Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
load_inputs_file: Simplify File Check
Browse files Browse the repository at this point in the history
AMReX will now check this in a user-friendly and performant manner.
ax3l committed Sep 17, 2024
1 parent b8345b3 commit 9b65b8c
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
@@ -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);
})

0 comments on commit 9b65b8c

Please sign in to comment.