Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
958 commits
Select commit Hold shift + click to select a range
e4f0854
Updated PE heating rate temperature cutoff. This was improperly
aemerick Jan 17, 2020
b31a07f
1) Stellar abundance output to separate file. 2) New parameter to inc…
aemerick Jan 21, 2020
163065a
Flag in yields interpolation to allow calling function to change beha…
Jan 21, 2020
e561cab
Merge branch 'enzo-emerick-uptodate' of https://github.com/aemerick/e…
Jan 21, 2020
b60338a
Bugfix. Old bug from a while ago. PE heating was too large by a facto…
aemerick Jan 22, 2020
55e60d5
Merge with master
aemerick Mar 16, 2020
a31c4a3
Merge with master
aemerick Mar 16, 2020
1696480
Leftover merge conflict fix
aemerick Mar 16, 2020
2a5c3f2
parenthesis bugfix
aemerick Mar 16, 2020
c5be37c
New parameter / feature. Adjust maximum refinement levels to keep wit…
aemerick Mar 16, 2020
4204e9a
Three modifications / changes:
aemerick Mar 17, 2020
74f7914
Updating for my version of Grackle to read in LW background model par…
aemerick Mar 17, 2020
236567e
variable name change for clarity
aemerick Mar 18, 2020
ba35c83
Enforce mass and energy conservation in injecting feedback to the gri…
aemerick Mar 18, 2020
7b6d286
PISNe field for PopIII in individual stars. Bugfix in missed rproc mo…
aemerick Mar 18, 2020
64ecb37
Bugfix / typos from previous commit
aemerick Mar 18, 2020
3b60f84
Comments
aemerick Mar 18, 2020
07e6f2f
Removed old INFM relation for WD and replaced with updated 2019 one. …
aemerick Mar 18, 2020
4e5dbda
Removing need to set / check testproblemdata.multimetals
aemerick Mar 18, 2020
3177a8f
dialing down default stellar yield size to 10
aemerick Mar 19, 2020
40a5ef7
Untested: Adding in routine to include stellar surface abundance retu…
aemerick Mar 19, 2020
3154489
Reshuffling location of some individual star routines to slightly mor…
aemerick Mar 19, 2020
646e16f
Creating a feedback radius parameter to inject feedback based on fixe…
aemerick Mar 20, 2020
b2de5b4
Error catching for the mass / energy conservation check in particle f…
aemerick Mar 20, 2020
5508a1b
Bugfix in print
aemerick Mar 20, 2020
e2b0696
Attempting a bug fix that I thought I didn't need. Crashing in attemp…
aemerick Mar 20, 2020
c221c98
Updating with new agb, popIII, snIa, snII, and rprocess fields for in…
aemerick Mar 20, 2020
11a9ebd
ability to output on feedback for individual stars (simple hack)
aemerick Mar 20, 2020
f191bbc
Bugfix in individual star must refine. Fixing error that refined to d…
aemerick Mar 20, 2020
dc248ac
Attempt to fully fix duplication of particles. However, need to make …
aemerick Mar 23, 2020
56ce8f3
Improving individual star must-refine behavior for particles that hav…
aemerick Mar 23, 2020
a94ae94
Bugfix in refinement lifetime for the particular test case problem of…
aemerick Mar 23, 2020
c6b5863
Turning off wind mixing model by default
aemerick Mar 23, 2020
54825df
removed debugging print
aemerick Mar 23, 2020
45d1261
Bugfix in localnumberofstars communication. I'm not sure why this is …
aemerick Mar 23, 2020
8cf4f5d
Bugfixes in star particles with individual star (I think). There appe…
aemerick Mar 23, 2020
742d7d9
Commiting a bunch of commented out code that was an attempt to correc…
aemerick Mar 24, 2020
445f88f
Changing default feedback overlap sample to 16 from 32. Tests show th…
aemerick Mar 24, 2020
d703e1d
moving error statement to root processor only
aemerick Mar 24, 2020
3c3e595
zeroing radiative transfer fields when no sources are present (before…
aemerick Mar 24, 2020
b6e8bfc
removing old thing in function not used
aemerick Mar 25, 2020
0ef6890
temporary debug prints
aemerick Mar 25, 2020
2e25923
commenting out hotfixes that hide a bug
aemerick Mar 26, 2020
36addf0
Bugfix in index
aemerick Mar 26, 2020
ac69050
Removing uneeded prints
aemerick Mar 26, 2020
091f049
Error catching if maximum stelalr yields is reached
aemerick Mar 26, 2020
20b2416
Moving photon energy definitions and band thresholds (HI, HeI, HeII, …
aemerick Mar 27, 2020
3611b93
Updates to try and fully sync Individual Star and PopIII models with …
aemerick Mar 31, 2020
e7f7e35
Making FUV Luminosity photon luminosity in RadiationSource to be cons…
aemerick Mar 31, 2020
de8ce0c
Began implementing New Heger and Woosley 2010 Pop III radiation model…
aemerick Apr 1, 2020
cbc9665
finalized fits to popIII model
aemerick Apr 1, 2020
d23f386
Updating individual star radiation model inputs to be self-consistent
aemerick Apr 2, 2020
e4e1430
changing metallicity ordering in radiation tables
aemerick Apr 2, 2020
c5a95c9
bugfix in case photon energy <= 0
aemerick Apr 2, 2020
a8b99e5
Moving zeroing of PE heating field to where it is created (rather tha…
aemerick Apr 2, 2020
e4b577f
typo fix in IndividualStarRefineForRadiation parameter read
aemerick Apr 2, 2020
4d2826a
Updating mass bin size for popIII yield table
aemerick Apr 3, 2020
8bb507a
Error checking if multimetals is on and cosmology sim does not have m…
aemerick Apr 3, 2020
2d43438
Merge branch 'enzo-emerick-uptodate' of https://github.com/aemerick/e…
aemerick Apr 3, 2020
c0ae98e
Updating black body correction factors with new, correct values
aemerick Apr 3, 2020
43eaeb0
Bugfix in parameter mispelling
aemerick Apr 3, 2020
b4b3584
Merge branch 'enzo-emerick-uptodate' of https://github.com/aemerick/e…
aemerick Apr 3, 2020
d357ef0
Bugfix in MaximumRefinementLevelPhysicalScale behavior that led to ru…
aemerick Apr 3, 2020
747326e
gdb debug
aemerick Apr 7, 2020
eb1bf94
Merge branch 'enzo-emerick-uptodate' of https://github.com/aemerick/e…
aemerick Apr 7, 2020
1d436c3
Potential odd bugfix initializing an array with a not strictly compil…
aemerick Apr 7, 2020
7e28772
Merge with grackle parameters fix
aemerick Apr 9, 2020
df610a7
Adding LW background model to grackle parameters for my version of gr…
aemerick Apr 9, 2020
7c360f6
Typo fix in PopIIIRadiationModel parameter output
aemerick Apr 10, 2020
49dc903
Merge branch 'grackle-parameters' of https://github.com/aemerick/enzo…
aemerick Apr 10, 2020
da3a2f9
Moving Individual star popIII radiation model to its own switch. Bugf…
aemerick Apr 10, 2020
a796a6d
bugfix. missed initial nbin value from previous commit
aemerick Apr 10, 2020
ff14271
another bugfix from last commit. correct mass check for individual st…
aemerick Apr 11, 2020
3e0c49d
Bugfix. Adding PopIII PISNe and RProcess field to density normalization
aemerick Apr 14, 2020
a7f0ca6
2nd Bugfix. Adding PopIII PISNe and RProcess field to density normali…
aemerick Apr 14, 2020
b8f427f
Merge branch 'enzo-emerick-uptodate' of https://github.com/aemerick/e…
aemerick Apr 14, 2020
93895ab
pow to POW
aemerick Apr 14, 2020
1132339
error check
aemerick Apr 14, 2020
8b2c4d6
adding rprocess
aemerick Apr 14, 2020
409dacc
decreasing default max number of particle attributes
aemerick Apr 14, 2020
44cb927
Not sure if this function is used. But updating wind_mass and sn_mass…
aemerick Apr 14, 2020
5b8ba44
note to self
aemerick Apr 14, 2020
00520c9
Bugfix in generating particle attributes for PopIII tracer fields
aemerick Apr 14, 2020
01b0221
New Type Ia model for individual stars which uses fits to Ruiter+2011
aemerick Apr 16, 2020
689d72b
Revamping generation of particle labels to be in ONE place
aemerick Apr 17, 2020
c2aa1cc
Beginning to implement SNIa yields for new model in individual star m…
aemerick Apr 17, 2020
1362169
Final steps implementing new SNIa model for individual stars which ca…
aemerick Apr 17, 2020
e0f8aee
bugfix for initializing metal field fractions. Now consistent across …
aemerick Apr 17, 2020
e4e808d
Bugfix in particle attribute label functions. Switching to using std:…
aemerick Apr 17, 2020
40f2ca2
saving particle attributes properly for new metal fields'
aemerick Apr 17, 2020
b5954e1
bugfix in data labels for ChemicalEvolutionTest
aemerick Apr 17, 2020
8f2c37a
Bugfixes in new SNIa model. Correct time array size in model. Checkin…
aemerick Apr 17, 2020
05f869c
Bugfix assiging sniatype from particle properties
aemerick Apr 17, 2020
385a16f
be a little more lenient on mass ejection check"
aemerick Apr 17, 2020
0d0f583
Bugfix in setting SNIaTypes. removing print statements for debugging
aemerick Apr 17, 2020
a1a967b
Bugfix in Event DTD inits
aemerick Apr 17, 2020
d912554
bugfix in number of star print
aemerick Apr 17, 2020
fbec75c
Two additions:
aemerick Apr 19, 2020
0472a1f
Turning maximum number of particle attributes into a compile-time par…
aemerick Apr 20, 2020
0bea59d
Units bugfix in H2II and HM dissociation from tree
aemerick Apr 20, 2020
d24d469
ChemicalEvolutionTest now works with pop3 stars
aemerick Apr 20, 2020
3044f39
New typedef to handle species fields that are stored as density and n…
aemerick Apr 20, 2020
6d1ab67
Compute cooling time gives negative / positive values for net cooling…
aemerick Apr 20, 2020
e7910e2
First commit of script to manage Enzo runs and restarts
aemerick Apr 21, 2020
6a22355
First cut implementing Chiaki+2017 model for PopIII to PopII star for…
aemerick Apr 21, 2020
e17dce5
Updating new PopIII model (Chiaki+2017) for metallicity threshold to …
aemerick Apr 22, 2020
78fac67
making more variables const in new popIII metal fraction model
aemerick Apr 22, 2020
e3a5e1d
int conversion and error check bugfix'
aemerick Apr 22, 2020
31b8fbb
Bugfix in StellarAbundances to include new metal fields for Ouput. Bu…
aemerick Apr 22, 2020
9dc07cc
Moving ParticleTableAttributeStartIndex outside ifstatement for consi…
aemerick Apr 22, 2020
72abc46
switching to using general solar abundances and MMW lookup functions …
aemerick Apr 23, 2020
96a46e3
MMW function in header. Using physics constants values
aemerick Apr 23, 2020
aad4145
First commit in a sequence of several. Revamping stellar yields input…
aemerick Apr 23, 2020
343e2da
First full cut at revamping stellar yields table to use HDF5 input
aemerick Apr 24, 2020
d580146
Bugfix in Chiaki threshold (5.07 to -5.07)
aemerick Apr 24, 2020
9646e37
Bugfixes in new yield tables. Previous commit(s) didn't have the ifdef
aemerick Apr 24, 2020
7aa1414
started implementing new yield model having 4 tables: SN, Wind, AGB, …
aemerick Apr 24, 2020
e9c783b
Updated Yield routines to work fully with new model while remaining b…
aemerick Apr 24, 2020
307c8b0
New yield tables input filename as runtime parameter
aemerick Apr 25, 2020
6f7dcec
Bugfix in stellar yield surface abundance return. Now have correct mo…
aemerick Apr 25, 2020
5082f53
Adjusting total mass ejected for surface abundances and adding debug …
aemerick Apr 27, 2020
c0291c6
Increasing particle refinement level with refinement physical resolution
aemerick Apr 27, 2020
1aee76d
upping the IMF table size
aemerick Apr 27, 2020
843fa23
Adding r process enrichment model mass ranges and deposit to grid
aemerick Apr 27, 2020
2c6287e
bugfix in stellar yields with H and He
aemerick Apr 28, 2020
f8bcae7
Bugfix in Surface abundance return model (scaled by Z twice on accide…
aemerick Apr 28, 2020
8b8f1ed
bugfix in popIII mass extrapolation
aemerick Apr 28, 2020
1da89a5
Silencing Hdf5 error output and moving a print to root only
aemerick Apr 28, 2020
f0d105a
More explicit error checking in surface abundance return
aemerick Apr 28, 2020
72e1a44
consistent calling H abundance rather than hard coding
aemerick Apr 28, 2020
9146a94
another surface abundnaces bugfix in Limongi corrections
aemerick Apr 28, 2020
cabac5a
New chemical evolution parameter to initialized stars with scaled sol…
aemerick Apr 30, 2020
e13f5d5
More bugfixes for surface abundances
aemerick Apr 30, 2020
5581e6c
Correcting debug compile flags. Including ggdb
aemerick May 1, 2020
5663ca5
Final bugfixes and error checks to surface abundance routines. I bele…
aemerick May 1, 2020
795d538
Comment to clarify code so I don't freak out about this again later o…
aemerick May 1, 2020
d8ab199
First test of doubling r-process elements and adding in wind field. D…
aemerick May 5, 2020
7b7eac7
New file from last commit
aemerick May 5, 2020
bf7a43d
Bugfixes in particle attribute labels and determining number of parti…
aemerick May 5, 2020
a4fe83a
Bugfixes in data labels for second set of Pop III yields and wind den…
aemerick May 5, 2020
992f5f1
Minor fixes in popIII ifs for consistency
aemerick May 5, 2020
13409c5
Adding wind and popIII doubled fields
aemerick May 5, 2020
34956e6
moving popIII if within overall popIII for consistency"
aemerick May 5, 2020
8237a94
upping max stellar abundances to accomodate popIII tracers
aemerick May 5, 2020
34571c7
Adding wind density tracer field and PopIII doubled element fields. B…
aemerick May 5, 2020
d8c7b29
increasing defaeult stellar yields
aemerick May 5, 2020
9f5d65d
Adding switch for number of sources to start using source clustering …
aemerick May 5, 2020
ea37bca
last if moving popIIIseparate yields to within popiii formation if
aemerick May 5, 2020
547ad52
Bugfix in assiging abundances to popIII second set of element yields …
aemerick May 5, 2020
da1d4ca
Decided to track metal wind yields from intermediate and high mass st…
aemerick May 7, 2020
2c5069e
increasing abundance limit
aemerick May 7, 2020
5a660aa
New parameter to control Individual star must refine properties. If I…
aemerick May 13, 2020
c98f181
Merge branch 'enzo-emerick-uptodate' of https://github.com/aemerick/e…
aemerick May 13, 2020
a4d364b
bugfix in print statement for param
aemerick May 13, 2020
03226c0
Two bugfixes:
aemerick May 14, 2020
221c569
checking for std::alloc errors
aemerick May 14, 2020
b1c5e6a
Merge branch 'enzo-emerick-uptodate' of https://github.com/aemerick/e…
aemerick May 14, 2020
f499e99
Bugfix that excluded PopIII from FUV radiation and PE heating
aemerick May 15, 2020
9e58c72
Bugfix in popIII luminosity interpolation for massive stars
aemerick May 18, 2020
99ad243
commented out code
aemerick May 18, 2020
346ef86
erge branch 'enzo-emerick-uptodate' of https://github.com/aemerick/en…
aemerick May 18, 2020
6dcfce4
bugfix in fUv energy
aemerick May 18, 2020
dc4e38c
adding IR radiation property
aemerick May 18, 2020
06df89f
better comments
aemerick May 18, 2020
79dc473
Bugfix in FUV energy
aemerick May 18, 2020
34156da
fudge for safety
aemerick May 18, 2020
08a775b
Merge branch 'enzo-emerick-uptodate' of https://github.com/aemerick/e…
aemerick May 18, 2020
7784c17
New function to delete jobs running with same name. Not safe unless u…
aemerick May 18, 2020
b561aae
Proper handling of RT periodic conditions in optically thin radiation
aemerick May 18, 2020
9e721de
Merge branch 'enzo-emerick-uptodate' of https://github.com/aemerick/e…
aemerick May 18, 2020
fad05a8
bugfix in OT source clustering distances with periodic boundaries
aemerick May 20, 2020
79d0b97
Bugfix in job listing columns. setting format. turning off verbose. b…
aemerick May 20, 2020
4908c4d
bugfix and memory leak fix
aemerick May 23, 2020
edf0458
Bugfix
aemerick May 25, 2020
08890e7
Trying to track down a memory error. Maybe this will help for rebuild…
aemerick May 25, 2020
b3716f5
Merge branch 'enzo-emerick-uptodate' of https://github.com/aemerick/e…
aemerick May 25, 2020
a2c6443
removing accidental print
aemerick May 25, 2020
38a35f3
revert to original buffer size
aemerick May 25, 2020
c9d9c43
potential bugfix in active particles. comments from memleak tests
aemerick May 26, 2020
1a6e8dc
bugfix
aemerick May 26, 2020
e682814
bugfix
aemerick May 26, 2020
9368e40
potential bugfix. nullptr
aemerick May 26, 2020
071c08e
Merge branch 'enzo-emerick-uptodate' of https://github.com/aemerick/e…
aemerick May 26, 2020
ca6c4d3
Small fix re-ordering arguments to an if statement to prevent errors …
aemerick May 26, 2020
e4e87ca
comments
aemerick May 26, 2020
2570fdf
Merge branch 'enzo-emerick-uptodate' of https://github.com/aemerick/e…
aemerick May 26, 2020
c56e912
Address sanitizer got upset about something. rearranged ifstatement a…
aemerick May 26, 2020
1b26df3
erge branch 'enzo-emerick-uptodate' of https://github.com/aemerick/en…
aemerick May 26, 2020
1e80036
bugfix in init
aemerick May 26, 2020
46d1238
Error checking to make sure colour field nums don't exceed limit
aemerick May 26, 2020
f75ba2c
bugfix in refinetophysicalradius type
aemerick May 26, 2020
e6786e4
maybe bugfixes for memleaks?
aemerick May 27, 2020
2f485bc
Merge branch 'enzo-emerick-uptodate' of https://github.com/aemerick/e…
aemerick May 27, 2020
611c217
more informative output whenever stars form, showing counters for typ…
aemerick May 27, 2020
dd98050
Fixing some warnings. Mostly unused variables and string+macro deals …
aemerick May 27, 2020
5ee9b3e
Error checking on buffer size
aemerick May 27, 2020
cf42435
Guarding if statements
aemerick May 27, 2020
2d8fb68
Potential minor bugfix only calling H2shielding temperature functions…
aemerick May 27, 2020
4a97d71
Merge branch 'enzo-emerick-uptodate' of https://github.com/aemerick/e…
aemerick May 27, 2020
1d8051c
bugfix in stellar yields read-in
aemerick May 27, 2020
f7132c1
Merge branch 'enzo-emerick-uptodate' of https://github.com/aemerick/e…
aemerick May 27, 2020
bf6fc64
adding debug info to o2
aemerick May 27, 2020
53400ed
Changing array sizes for star particle refinement (mustrefine) to jus…
aemerick May 29, 2020
a702d4c
Merge branch 'enzo-emerick-uptodate' of https://github.com/aemerick/e…
aemerick May 29, 2020
4d1b9de
better
aemerick May 29, 2020
e564b2c
Merge branch 'enzo-emerick-uptodate' of https://github.com/aemerick/e…
aemerick May 29, 2020
183648c
Forgot to set particle ID number when using only one star
aemerick Jun 2, 2020
d3b4999
Small(?) memory leak fix in radiation sources. Sources would sometime…
aemerick Jun 2, 2020
ef69abb
allow particle lifetime to be chosen from file as either a value (in …
aemerick Jun 2, 2020
aac3b79
Merge branch 'enzo-emerick-uptodate' of https://github.com/aemerick/e…
aemerick Jun 2, 2020
81cf092
Bugfix related to the previous commit. fixing memory leak in radiatio…
aemerick Jun 2, 2020
feceb3c
Merge branch 'enzo-emerick-uptodate' of https://github.com/aemerick/e…
aemerick Jun 2, 2020
abbdf2b
removing commented lines
aemerick Jun 3, 2020
9a2bea0
fixing error in generating star particle must refine arrays
aemerick Jun 3, 2020
173cace
NULL-ing buffer
aemerick Jun 3, 2020
3371f9b
NULL-ing pointers after delete
aemerick Jun 3, 2020
c882a23
Merge branch 'enzo-emerick-uptodate' of https://github.com/aemerick/e…
aemerick Jun 3, 2020
f45b10a
Updating SNIa model to save lifetime after the SNIa goes off in order…
aemerick Jun 23, 2020
617b39a
adding more info to SN print statements
aemerick Jun 24, 2020
3c71ee9
forgot to commit one more delete / NULL from the memory leak fix
aemerick Jun 24, 2020
0c908b9
Bugfix in correction term for Limongi abundanace
aemerick Jun 26, 2020
c952d38
Updates to solar abundances to generalize with different definitions …
aemerick Jun 26, 2020
ec4efdf
moving H mass fraction to load properly from defined solar values
aemerick Jul 6, 2020
d735849
Correctly setting initial value for array (overstepped bound by 1.. n…
aemerick Jul 6, 2020
7fe4955
More informative star print statements with abundance information in …
aemerick Jul 6, 2020
4cb8f58
Bugfix in computing solar abundances.
aemerick Jul 6, 2020
103b541
updates to job output formatting and ibrun behavior
aemerick Jul 6, 2020
3889608
Bugfix when number of particle attributes is 0 (DM only runs)
aemerick Jul 16, 2020
3689847
Merge branch 'enzo-emerick-uptodate' of https://github.com/aemerick/e…
aemerick Jul 16, 2020
ebcd9d1
[BUGFIX] Applying TopGrid partition changes to particle communication
jwise77 Dec 8, 2020
41e1da9
MPI bugfix (zoom-ins) and several minor memory fixes
jwise77 Jan 3, 2021
23c6ce8
Fixing a memory error from recent bugfix
jwise77 Jan 11, 2021
6ad319f
assorted bug fixes including neg particle mass
kaleybrauer Jan 26, 2022
90d8eb5
testing removal of for-loop in Pop III formation
kaleybrauer Feb 3, 2022
765d7b6
consistency fix for sne_ia attribute with non-individual stars
kaleybrauer May 11, 2022
2f102fb
no additional abundances for non-indiv star particles
kaleybrauer May 11, 2022
4adeeff
timers on StarParticleFinalize
kaleybrauer Jun 3, 2022
f07d35f
beginning custom map for looking up stars, unfinished
kaleybrauer Jun 15, 2022
2590e28
using map from std to speed up CopyToGrid, unfinished
kaleybrauer Jun 15, 2022
292dd97
still debugging StarLookupMap
kaleybrauer Jun 16, 2022
1b9a944
fixed one error with stars lookup map
kaleybrauer Jul 12, 2022
5dcdd76
slightly cleaned up code, more starsmap debugging
kaleybrauer Jul 13, 2022
8d33424
fixed lookup map to speed up CopyToGrid
kaleybrauer Jul 15, 2022
cf54b1e
fully debugged lookup map
kaleybrauer Jul 21, 2022
b27041b
passing lookup map as constant reference
kaleybrauer Aug 10, 2022
86e3716
FUV heating with non-indiv stars
kaleybrauer Sep 19, 2022
efd2937
additional timers to identify bottleneck in Initialize
kaleybrauer Nov 28, 2022
55d6af2
checking lookup map for stars
kaleybrauer Feb 14, 2024
fdbb3fb
clean up comments
kaleybrauer Feb 14, 2024
5172c33
density bug
kaleybrauer Jan 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ temp.show-*
Make.config.machine
Make.config.override
*.mod
*.orig

src/mpgrafic/degraf/Makefile
src/mpgrafic/degraf/config.h
Expand Down
354 changes: 354 additions & 0 deletions run/fraggle.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,354 @@
#!/opt/apps/intel18/python3/3.7.0/bin/python3.7
"""

Author: Munier Salem - early-med 2010's
Modified: Andrew Emerick

FRAGGLE

Designed to repeatedly run enzo from within a
single batch submission. Originally created to
avoid memory fragmentation issues, this restarts
Enzo up to a user-defined number of times to attempt
to maximize use of a single job submission without
re-queing.

Run using:

python3 ./fraggle.py

Currently assumes the executable is 'enzo.exe' and
running on Stampede2.

HOW IT WORKS:

- The parameter file (if it exists) is found

- The most recent data dump (determined by sim. time)
is found, for both regular (e.g. DD) and redshift
data dumps. By defualt, interpolated outputs are
ignored.

- Enzo is called from the most recent of the above,
or the initial parameter file if no dumps exist.

- If Enzo exits (for any reason) this process repeats
for up to the number of desired times OR until
the same output is restarted from after a specified
number of times. This can be controlled with the
N_TOTAL_RESTART and N_SAME_RESTART parameters

- Code exists (but is not yet used) to modify the
output cadence and Courant timestep to try and increase
dump frequency or slow down the Hydro solver in
case there are issues here. Will be added in soon (Apr 2020)
"""
# troubleshooting
#import sys
#print sys.path

import os, sys, glob, time
import numpy as np

from subprocess import call,check_output,CalledProcessError

MIN_TIME_STEP = 0.1 # does nothing now
MAX_TIME_STEP = 5.0 # does nothing now

#
# Dictionary of system-dependent run commands
#

RUN = {'Stampede2' : 'ibrun '} # mem_affinity '}

# default exectable filename
EXEC_FNAME = "./enzo.exe"

SYSTEM = 'Stampede2' # what are we on?

VERBOSE = False # use -d command


def check_memory_failure(outfile = None):
"""
grep for the std out file and see if there are hints that the last
resart failed due to running out of memory. Returns true if this is
likely
"""
memory_failure = False

#
# Try and find the .out file
#

jobid = os.getenv("SLURM_JOBID")
if not isinstance(jobid, str):
jobid = str(jobid)

# find the file
if outfile is None:
outfile = (glob.glob("./*" + jobid + "*.err") + glob.glob("./*/*"+jobid+"*.err"))[0]

if len(outfile) == 0:
print("CHECK_MEMORY_FAILURE (Fraggle): Cannot find output file for " + jobid)
raise RuntimeError

with open(outfile,'r') as f:
for line in f:
if "throwing an instance of 'std::bad_alloc'" in line:
memory_failure = True
break

return memory_failure

def cancel_jobs():
"""
Cancels running jobs with SAME job name but different
job ID as this one
"""
os.system('squeue -u emerick -o "%.10i %.10P %.10j %.8u %.2t %.10M %.6D" > emerick_jobs_list.out')

this_jobID = int(os.environ['SLURM_JOBID'])
this_jobname = os.environ['SLURM_JOB_NAME']

jobs_list = np.genfromtxt('./emerick_jobs_list.out',
dtype="i8,|U10,|U10,|U7,|U2,|U6,i2",
names=True)


for i in np.arange(np.size(jobs_list["JOBID"])):
if jobs_list["NAME"][i] == this_jobname:
print("FRAGGLE: Found a job with the same name : ", this_jobname, this_jobID, jobs_list['NAME'][i], jobs_list['JOBID'][i])
if jobs_list["ST"][i] == "R" and int(jobs_list["JOBID"][i]) != this_jobID:
print("FRAGGLE: Cancelling job name: %12s with ID: %i"%(jobs_list['NAME'][i], jobs_list['JOBID'][i]))
time.sleep(3)
sys.stdout.flush()
time.sleep(3)
os.system('scancel %i'%(jobs_list["JOBID"][i]))
sys.stdout.flush()

return


def get_parameter_file():
"""
Find the .enzo parameter file
"""

par_name = glob.glob("*.enzo")

if np.size(par_name) > 1:
print("WARNING: More than one parameter file found")
print(par_name)
par_name = par_name[0]
print("Using: ", par_name)

elif np.size(par_name) == 0:
print("WARNING: No parameter file found")
par_name = None

else:
par_name = par_name[0]
print("Found parameter file " + par_name)

return par_name


def resetdtDataDump(fName,stretch):

# open and read parameter file
file = open(fName,'rb')
params = file.read().split('\n')
file.close()
# alter run time
key = 'dtDataDump'
idx = None
for i,p in enumerate(params):
line = p.split('=')
if line[0].strip() == key:
val = min(float(line[1])*stretch,MAX_TIME_STEP)
if val < MIN_TIME_STEP:
raise RuntimeError('Run has stalled!!!')
params[i] = " = ".join([key,str(val)])
break
# Print updated params ...
file = open('tmp.par','wb')
file.write("\n".join(params))
file.close()

return


def get_all_restart_dumps(DataDumpName = "DD", DataDumpDir = "DD", RedshiftDumpName = "RD",
RedshiftDumpDir = "RD", parameter_file = None,
ignore_interpolated = True):

"""
Gathers a time-ordered (most recent sim-time first) list of available restart
data dumps.
"""
if not (parameter_file is None):
if (os.path.isfile(parameter_file)):
#
with open(parameter_file) as f:
names_list = ['DataDumpDir','DataDumpName','RedshiftDumpDir',
'RedshiftDumpName']
for line in f:
if "=" in line:
split_line = line.split("=")
if split_line[0] == 'DataDumpDir':
DataDumpDir = split_line[-1]
elif split_line[0] == 'DataDumpName':
DataDumpName = split_line[-1]
elif split_line[0] == 'RedshiftDumpName':
RedshiftDumpName = split_line[-1]
elif split_line[0] == 'RedshiftDumpDir':
RedshiftDumpDir = split_line[-1]

else:
print(parameter_file, " path cannot be found")
raise RuntimeError

# look for all files

DD_pattern = DataDumpDir + "????/" + DataDumpName + "????"
RD_pattern = RedshiftDumpDir + "????/" + RedshiftDumpName + "????"

DD_files = np.sort(glob.glob(DD_pattern))
RD_files = np.sort(glob.glob(RD_pattern))

all_files = np.array(list(DD_files) + list(RD_files))

if np.size(all_files) == 0:
print("No files found matching the pattern " + DD_pattern + " or " + RD_pattern)
return None

all_times = np.zeros(np.size(all_files))
interpolated = np.zeros(np.size(all_files)) * False

# check sim time for all files and whether or not they
# are interpolated dumps
for fnum, fname in enumerate(all_files):
with open(fname) as f:
for line in f:
if "WARNING! Interpolated output" in line: # do not restart from interpolated dumps
interpolated[fnum] = True
if "InitialTime" in line:
all_times[fnum] = float(line.split("=")[-1])

# reverse sort by time (most recent first)
sort = np.argsort(all_times)
all_files = all_files[ sort ][::-1]
all_times = all_times[ sort ][::-1]
interpolated = interpolated[ sort ][::-1]

# ignore interpolated
if ignore_interpolated:
return_files = all_files[ np.logical_not(interpolated) ]
else:
return_files = all_files


return return_files


if __name__ == "__main__":

if VERBOSE:
verbose_str = ' -d'
else:
verbose_str = ' -'


if np.size(sys.argv) > 1:

if len(sys.argv) >= 2:
SYSTEM = str(sys.arv[1])
if len(sys.argv) >= 3:
EXEC_FNAME = str(sys.argv[2])

if not (os.path.isfile(EXEC_FNAME)):
print(EXEC_FNAME + " not found. Are we in the right place?")
raise RuntimeError

if not SYSTEM in RUN.keys():
print(SYSTEM + " not specified in the RUN dictionary."
" fraggle does not know how to execute the job. Please include the command")
raise RuntimeError

print("Attempting to run " + EXEC_FNAME + " on system " + SYSTEM)

print("Cancelling jobs with same name currently running")
cancel_jobs()

#
# find parameter file name
#
parfile = get_parameter_file()

#
# figure out the most recent data dump (DD????/DD????)
#
all_dumps = get_all_restart_dumps(parameter_file = parfile)

if (all_dumps is None) and (parfile is None):
print("Cannot find anything to start from")
raise RuntimeError

#
# If there are no data dumps, start from the beginning
#
count = 0
if all_dumps is None:
if VERBOSE:
_verbose_str = verbose_str
else:
_verbose_str = ''

start_command = RUN[SYSTEM] + EXEC_FNAME + _verbose_str + ' ' + parfile
call(start_command, shell=True)
count = 1

#
# Otherwise, keep running
# change count_max to try and do multiple restarts in a single run
# this can be helped by forcing Enzo to exit on output
count_max = 4
same_output_countmax = 3
#
prev_restart_name = None
restart_count = 1
n = 0; nlast = 0 # placeholders -- if we want to try going backwards in dumps as well
while (count < count_max):

# check for any std::alloc errors
if check_memory_failure():
print("FRAGGLE-WARN: Failing due to std::alloc() error thrown")
print("FRAGGLE-WARN: Not restarting - likely need to increase memory available")
break

if restart_count >= same_output_countmax:
print("FRAGGLE-WARN: Failing after attempting the same dump too many times (%i)"%(restart_count) +restart_name)
print("FRAGGLE-WARN: Ending run")
break

if count > 0:
all_dumps = get_all_restart_dumps(parameter_file = parfile)
print(all_dumps)

restart_name = all_dumps[n]

if restart_name == prev_restart_name:
restart_count = restart_count + 1
print("FRAGGLE-WARN: Restarting from the same data dump again (try number %i): "%(restart_count) + restart_name)
else:
print("Restarting simulation from: " + restart_name)
restart_count = 1

restart_command = RUN[SYSTEM] + EXEC_FNAME + verbose_str + 'r ' + restart_name
print("Using command: " + restart_command)
call(restart_command, shell=True)

prev_restart_name = restart_name
count = count + 1

Loading