-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* output time and step number to a file rather than screen. Will continue with more meaningful outputs * move all data reduction including file IO to a separate data reduction class * added missing files for the DataReducer class * bring amrex up to 23.02 * added parallel reduction operation over grid. ParReduce is a bit more straightforward than doing the array reduction followed by a parallel reduction * modify reduction operator to deal with an ArithmeticArray, which is an array that includes basic arithmetic operations * use code generator to make data reduction work for any number of flavors * add Tr(rho) to the scalar output. Also only output to the reduction file if the processor id is 0 * generate particle reduction code to work with any number of particles * added HighFive submodule * first bit of support for hdf5 realtime io * added hdf5 support for all reduced data * added support for outputting the net energy of the system. Required adding one more scalar variable to each particle. This is a good metric to track numerical errors - the number should remain constant * remove commented reduction examples * total energy should account for the relative number of real neutrinos present in a particular neutrino particle. * only output particle info at first timestep if it is output at any time * add fluxes to realtime data output * comment out print lines so initial conditions functions can be used more cleanly in scripts * Reduced max grid size on FFI test to force MPI parallelism * Run fiducial simulation in test suite. Will use it to test data reduction scripts as well. * Get rid of mpi errors in stdout * Reduce the number of steps the fiducial test takes to reduce testing time * install yt to be able to test data reduction scripts * Add more data reduction scripts to fiducial test * First attempt at including HFD5 tests in jenkins * Remove extraneous plot files to avoid accumuation of 'old' files during testing * move amrex to submodules directory * Clean up makefiles to make them a little bit more user friendly and transparent * fix glob search string so reduction script doesnt match to reduced data files * fix python script filename * further reduce number of steps for test speed * fix some paths to get hdf5 working in tests (hopefully) * Protect reduced data file initialization to only occur for IO processor. Mixed in with some formatting changes from VS Code. * cache submodules for faster testing * ignore hdf5 files * Create a three-flavor version of the initial condition script. * Add understandable error message that works even when the code is not compiled in debug mode to save future headache * Add babysitting plot scripts to plot reduced data output. Add to Jenkins to make sure they work and the reduced data look good. * add gnuplot library * Rename one of the makefiles to be a clear default * draft update of the readme * line spacing * A few more tweaks going through the readme and testing * updated change log for next version --------- Co-authored-by: Sherwood Richers <[email protected]>
- Loading branch information
Showing
32 changed files
with
707 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
[submodule "amrex"] | ||
path = amrex | ||
path = submodules/amrex | ||
url = https://github.com/dwillcox/amrex.git | ||
[submodule "submodules/HighFive"] | ||
path = submodules/HighFive | ||
url = https://github.com/BlueBrain/HighFive.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
FROM nvidia/cuda:11.4.0-devel-ubuntu20.04 | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get update | ||
RUN apt-get install -y python3 python3-pip gfortran build-essential libhdf5-openmpi-dev openmpi-bin pkg-config libopenmpi-dev openmpi-bin libblas-dev liblapack-dev libpnetcdf-dev git python-is-python3 | ||
RUN pip3 install numpy matplotlib h5py scipy sympy | ||
RUN apt-get install -y python3 python3-pip gfortran build-essential libhdf5-openmpi-dev openmpi-bin pkg-config libopenmpi-dev openmpi-bin libblas-dev liblapack-dev libpnetcdf-dev git python-is-python3 gnuplot | ||
RUN pip3 install numpy matplotlib h5py scipy sympy yt | ||
ENV USER=jenkins | ||
ENV LOGNAME=jenkins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,6 @@ plt* | |
tmp_build_dir | ||
Backtrace.* | ||
*.png | ||
*.dat | ||
*.h5 | ||
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# plots <N00> and <N_offdiag> as a function of time | ||
# assuming the code was compiled with HDF5 and wrote the file reduced0D.h5 | ||
|
||
import os | ||
os.environ['HDF5_USE_FILE_LOCKING'] = 'FALSE' | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
import glob | ||
import h5py | ||
import matplotlib as mpl | ||
from matplotlib.ticker import (MultipleLocator, FormatStrFormatter,AutoMinorLocator,LogLocator) | ||
|
||
|
||
base=["N","Fx","Fy","Fz"] | ||
diag_flavor=["00","11"]#,"22"] | ||
offdiag_flavor=["01"]#,"02","12"] | ||
re=["Re","Im"] | ||
# real/imag | ||
R=0 | ||
I=1 | ||
|
||
|
||
###################### | ||
# read averaged data # | ||
###################### | ||
avgData = h5py.File("reduced0D.h5","r") | ||
t=np.array(avgData["time(s)"])*1e9 | ||
N00=np.array(avgData["N00(1|ccm)"]) | ||
Noffdiag = np.array(avgData["N_offdiag_mag(1|ccm)"]) | ||
avgData.close() | ||
|
||
################ | ||
# plot options # | ||
################ | ||
mpl.rcParams['font.size'] = 22 | ||
mpl.rcParams['font.family'] = 'serif' | ||
#mpl.rc('text', usetex=True) | ||
mpl.rcParams['xtick.major.size'] = 7 | ||
mpl.rcParams['xtick.major.width'] = 2 | ||
mpl.rcParams['xtick.major.pad'] = 8 | ||
mpl.rcParams['xtick.minor.size'] = 4 | ||
mpl.rcParams['xtick.minor.width'] = 2 | ||
mpl.rcParams['ytick.major.size'] = 7 | ||
mpl.rcParams['ytick.major.width'] = 2 | ||
mpl.rcParams['ytick.minor.size'] = 4 | ||
mpl.rcParams['ytick.minor.width'] = 2 | ||
mpl.rcParams['axes.linewidth'] = 2 | ||
|
||
|
||
fig, ax = plt.subplots(1,1, figsize=(6,5)) | ||
|
||
############## | ||
# formatting # | ||
############## | ||
ax.axhline(1./3., color="green") | ||
ax.set_ylabel(r"$\langle N\rangle$ (cm$^{-3}$)") | ||
ax.set_xlabel(r"$t\,(10^{-9}\,\mathrm{s})$") | ||
ax.tick_params(axis='both', which='both', direction='in', right=True,top=True) | ||
ax.xaxis.set_minor_locator(AutoMinorLocator()) | ||
ax.yaxis.set_minor_locator(AutoMinorLocator()) | ||
ax.minorticks_on() | ||
ax.grid(which='both') | ||
|
||
############# | ||
# plot data # | ||
############# | ||
ax.plot(t, N00) | ||
|
||
############ | ||
# save pdf # | ||
############ | ||
plt.savefig("avgfee.pdf", bbox_inches="tight") | ||
|
||
# same for f_e\mu | ||
ax.semilogy(t, Noffdiag) | ||
plt.savefig("avgfemu.pdf", bbox_inches="tight") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
set term pdf | ||
set output 'avgfee.pdf' | ||
set key autotitle columnhead | ||
set xlabel 'time (s)' | ||
set ylabel 'N00 (cm^-3)' | ||
set yrange [0:*] | ||
plot 'reduced0D.dat' u 2:5 w l |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.