-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve folder structure of hdf5 / pouts / .dat #166
Conversation
hdf5 / pouts / .dat
Fully backwards compatible. The base folder where all files are outputted is now 'output_path', defaulted to "". This folder must exist. HDF5's are written to 'output_path + hdf5_subpath'. pout files are written to 'output_path + pout_subpath' and can be renamed to 'pout_prefix'. .dat files (punctures, extraction files) are written to 'output_path + extraction_subpath'. All subpaths are defaulted to "". They are created at runtime, so need not exist before.
1b7eb97
to
dbc0fce
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes look great, Tiago! Thanks for doing this 😄 I have tested that it works for me. On my laptop it wasn't necessary for the output_path
to exist before running but perhaps this is architecture/compiler/OS dependent.
I have some [relatively minor] comments.
GRParmParse::folder_exists(output_path), | ||
"should be a valid folder"); | ||
check_parameter("pout_path", pout_path, | ||
GRParmParse::folder_exists(pout_path), | ||
"should be a valid folder"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In some respects, this check is pointless since either the path will have been created by the system (as on my laptop) or the code will have failed because the path doesn't exist and it tried to write some default parameter messages to the pout file. Maybe this check needs to be written to std::cout
instead in read_filesystem_params
and not use the usual check_parameter
functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually the folder was created on your laptop because even the mkdir_recursive
for pout's created it, since it's recursive!!! But had you not used a pout/hdf5/.dat subpath, then it would not have been created. So what we mean by "must exist" is probably that we do not take direct responsibility in creating it ourselves.
I will remove the pout check -> indeed we create it ourselves, so it will exist if nothing goes wrong. The output_path
check will give an error if the directory doesn't exist and you didn't specify any pout subpath (and hence output_path
was not created by mkdir_recursive
)
I've just thought it might be useful to put the mode integral files into a subdirectory of the |
974b089
to
bcf138a
Compare
To print the number of boxes on all ranks on regrids, this is done in postRegrid. postRegrid is not called at t=0 (or at a restart), so GRAMRLevel::advance prints if it's rank 0 OR if it's t=restart_time
bcf138a
to
f772ac2
Compare
Also fixed bug (constraint norms should be sent to appropriate directory at 'data_path')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ❤ the nicely formatted parameter files. Unfortunately, I still found a few comments to make.
I have tested all the parameter files with the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy for this to be merged.
…prove_folder_structure Improve folder structure of hdf5 / pouts / .dat
This PR improves the organization of the folder structure of all the output to the filesystem in several ways.
chk_prefix = "/scratch/mypath/BinaryBH_"
and similarly for the other parameters). Now these can be left with just the prefix (i.e.chk_prefix = BinaryBH_
) and one new parameter was introduced:output_path
, the base path prepending all outputs. It defaults to""
, so it doesn't break any old code. If non-empty,output_path
must exist already before the start of the job.hdf5
files,pout
files and.dat
files (puncture files and extraction files) can now be put in their own specific folder usinghdf5_subpath
,pout_subpath
anddata_subpath
(output_path
prepends all of them). Again, they default to""
, so they don't break any code. Unlikeoutput_path
, any subpath doesn't need to be created before hand, this PR takes care of creating them (even if they contain multiple levels of uncreated directories which need to be created recursively).pout
files can also be changed now to whatever prefix one wants, using the parameterpout_prefix
. This might be useful not to override oldpout
files.write_extraction
is on. These files can be included in another directory by specifyingextraction_subpath
(which defaults todata_subpath
)pout
verbosity can be reduced withprint_progress_only_to_rank_0
, which will print the number of boxes per rank on ranks other than rank 0 only at regrid time steps. For large number of nodes this improves performance.Example:
Adding to the BinaryBH Example
params_very_cheap.txt
the following:would put all the files in a folder
results/
with files in subdirectories:hdf5
's inresults/hdf5
,pout
's inresults/pout
and.dat
s files inresults/data
. It would also change the name of thepout
files topoutChanged
.Let me know if you think there is a better naming for any parameter.