-
Notifications
You must be signed in to change notification settings - Fork 191
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
[WIP]Call WriteJobInfo for openpmd diagnostics #4360
Open
dpgrote
wants to merge
8
commits into
ECP-WarpX:development
Choose a base branch
from
dpgrote:write_job_info_with_openpmd
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e8b1c30
Call WriteJobInfo for openpmd diagnostics
dpgrote aa22970
Put job info file in prefix directory
dpgrote 31ab36f
Merge branch 'development' into write_job_info_with_openpmd
dpgrote 14c4cf2
Reverted previous changes and now write job info in attributes
dpgrote 8e8a03e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] cf3d104
Use amrex::OpenMP::get_max_threads
dpgrote f780f94
Small clean up
dpgrote 764726a
Merge branch 'development' into write_job_info_with_openpmd
dpgrote File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,130 @@ | ||
#include "FlushFormat.H" | ||
|
||
#include "WarpX.H" | ||
|
||
#include <AMReX_ParallelDescriptor.H> | ||
#include <AMReX_ParmParse.H> | ||
#include <AMReX_buildInfo.H> | ||
|
||
|
||
void | ||
FlushFormat::WriteJobInfo(const std::string& dir) const | ||
{ | ||
|
||
auto & warpx = WarpX::GetInstance(); | ||
|
||
if (amrex::ParallelDescriptor::IOProcessor()) | ||
{ | ||
// job_info file with details about the run | ||
std::ofstream jobInfoFile; | ||
std::string FullPathJobInfoFile = dir; | ||
|
||
const std::string PrettyLine = std::string(78, '=') + "\n"; | ||
// std::string OtherLine = std::string(78, '-') + "\n"; | ||
// std::string SkipSpace = std::string(8, ' ') + "\n"; | ||
|
||
|
||
FullPathJobInfoFile += "/warpx_job_info"; | ||
jobInfoFile.open(FullPathJobInfoFile.c_str(), std::ios::out); | ||
|
||
// job information | ||
jobInfoFile << PrettyLine; | ||
jobInfoFile << " WarpX Job Information\n"; | ||
jobInfoFile << PrettyLine; | ||
|
||
jobInfoFile << "number of MPI processes: " << amrex::ParallelDescriptor::NProcs() << "\n"; | ||
#ifdef AMREX_USE_OMP | ||
jobInfoFile << "number of threads: " << omp_get_max_threads() << "\n"; | ||
#endif | ||
|
||
jobInfoFile << "\n\n"; | ||
|
||
// build information | ||
jobInfoFile << PrettyLine; | ||
jobInfoFile << " Build Information\n"; | ||
jobInfoFile << PrettyLine; | ||
|
||
jobInfoFile << "build date: " << amrex::buildInfoGetBuildDate() << "\n"; | ||
jobInfoFile << "build machine: " << amrex::buildInfoGetBuildMachine() << "\n"; | ||
jobInfoFile << "build dir: " << amrex::buildInfoGetBuildDir() << "\n"; | ||
jobInfoFile << "AMReX dir: " << amrex::buildInfoGetAMReXDir() << "\n"; | ||
|
||
jobInfoFile << "\n"; | ||
|
||
jobInfoFile << "COMP: " << amrex::buildInfoGetComp() << "\n"; | ||
jobInfoFile << "COMP version: " << amrex::buildInfoGetCompVersion() << "\n"; | ||
|
||
jobInfoFile << "\n"; | ||
|
||
jobInfoFile << "C++ compiler: " << amrex::buildInfoGetCXXName() << "\n"; | ||
jobInfoFile << "C++ flags: " << amrex::buildInfoGetCXXFlags() << "\n"; | ||
|
||
jobInfoFile << "\n"; | ||
|
||
jobInfoFile << "Fortran comp: " << amrex::buildInfoGetFName() << "\n"; | ||
jobInfoFile << "Fortran flags: " << amrex::buildInfoGetFFlags() << "\n"; | ||
|
||
jobInfoFile << "\n"; | ||
|
||
jobInfoFile << "Link flags: " << amrex::buildInfoGetLinkFlags() << "\n"; | ||
jobInfoFile << "Libraries: " << amrex::buildInfoGetLibraries() << "\n"; | ||
|
||
jobInfoFile << "\n"; | ||
|
||
const char* githash1 = amrex::buildInfoGetGitHash(1); | ||
const char* githash2 = amrex::buildInfoGetGitHash(2); | ||
const char* githash3 = amrex::buildInfoGetGitHash(3); | ||
if (strlen(githash1) > 0) { | ||
jobInfoFile << "WarpX git describe: " << githash1 << "\n"; | ||
} | ||
if (strlen(githash2) > 0) { | ||
jobInfoFile << "AMReX git describe: " << githash2 << "\n"; | ||
} | ||
if (strlen(githash3) > 0) { | ||
jobInfoFile << "PICSAR git describe: " << githash3 << "\n"; | ||
} | ||
|
||
jobInfoFile << "\n\n"; | ||
|
||
// grid information | ||
jobInfoFile << PrettyLine; | ||
jobInfoFile << " Grid Information\n"; | ||
jobInfoFile << PrettyLine; | ||
|
||
for (int i = 0; i <= warpx.finestLevel(); i++) | ||
{ | ||
jobInfoFile << " level: " << i << "\n"; | ||
jobInfoFile << " number of boxes = " << warpx.boxArray(i).size() << "\n"; | ||
jobInfoFile << " maximum zones = "; | ||
for (int n = 0; n < AMREX_SPACEDIM; n++) | ||
{ | ||
jobInfoFile << warpx.Geom(i).Domain().length(n) << " "; | ||
} | ||
jobInfoFile << "\n\n"; | ||
} | ||
|
||
jobInfoFile << " Boundary conditions\n"; | ||
|
||
jobInfoFile << " -x: " << "interior" << "\n"; | ||
jobInfoFile << " +x: " << "interior" << "\n"; | ||
if (AMREX_SPACEDIM >= 2) { | ||
jobInfoFile << " -y: " << "interior" << "\n"; | ||
jobInfoFile << " +y: " << "interior" << "\n"; | ||
} | ||
#if defined(WARPX_DIM_3D) | ||
jobInfoFile << " -z: " << "interior" << "\n"; | ||
jobInfoFile << " +z: " << "interior" << "\n"; | ||
#endif | ||
|
||
jobInfoFile << "\n\n"; | ||
|
||
|
||
// runtime parameters | ||
jobInfoFile << PrettyLine; | ||
jobInfoFile << " Inputs File Parameters\n"; | ||
jobInfoFile << PrettyLine; | ||
|
||
amrex::ParmParse::dumpTable(jobInfoFile, true); | ||
|
||
jobInfoFile.close(); | ||
} | ||
} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@dpgrote I wonder if this should be written by full diagnostics at all - or instead rather like the
warpx_used_inputs
file just in general, when the simulation starts?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.
Good question. I like this kind of thing to be written out in the same place as the diagnostics so that it is associated with the output of the simulation. If this is written at the startup, the code would have to figure out where the diagnostics will be written.