From a8d0b7641f297d69218721050f5f8ba4ea7ed3e1 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Wed, 2 Oct 2024 22:38:46 -0700 Subject: [PATCH] `load_inputs_file`: Simplify File Check (#704) AMReX will now check this in a user-friendly and performant manner. --- src/python/ImpactX.cpp | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/python/ImpactX.cpp b/src/python/ImpactX.cpp index 0326ca496..359015b76 100644 --- a/src/python/ImpactX.cpp +++ b/src/python/ImpactX.cpp @@ -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); })