Skip to content

Commit

Permalink
Make ParmParse Parser more robust (#4291)
Browse files Browse the repository at this point in the history
It's now allowed to call ParmParse Parser functions (e.g.,
queryAddWithParser) outside OpenMP parallel regions before ParmParse is
initialized.
  • Loading branch information
WeiqunZhang authored Jan 12, 2025
1 parent 1548946 commit f6d3d70
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Src/Base/AMReX_ParmParse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace amrex {
namespace {
bool initialized = false;
ParmParse::Table g_table;
std::vector<std::set<std::string>> g_parser_recursive_symbols;
std::vector<std::set<std::string>> g_parser_recursive_symbols(1);
namespace pp_detail {
int verbose = -1;
}
Expand Down Expand Up @@ -1205,6 +1205,7 @@ ParmParse::Finalize ()
#endif

g_parser_recursive_symbols.clear();
g_parser_recursive_symbols.resize(1);

pp_detail::verbose = -1;
initialized = false;
Expand Down

0 comments on commit f6d3d70

Please sign in to comment.