Skip to content

Commit

Permalink
load_inputs_file: Simplify File Check (#704)
Browse files Browse the repository at this point in the history
AMReX will now check this in a user-friendly and performant manner.
  • Loading branch information
ax3l authored Oct 3, 2024
1 parent d6f70e4 commit a8d0b76
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/python/ImpactX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,6 @@ void init_ImpactX (py::module& m)

.def("load_inputs_file",
[](ImpactX const & /* ix */, std::string const & filename) {
#if defined(AMREX_DEBUG) || defined(DEBUG)
// note: only in debug, since this is costly for the file
// system for highly parallel simulations with MPI
// possible improvement:
// - rank 0 tests file & broadcasts existence/failure
bool inputs_file_exists = false;
if (FILE *fp = fopen(filename.c_str(), "r")) {
fclose(fp);
inputs_file_exists = true;
}
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(inputs_file_exists,
"load_inputs_file: file does not exist: " + filename);
#endif

amrex::ParmParse::addfile(filename);
})

Expand Down

0 comments on commit a8d0b76

Please sign in to comment.