From f6d3d70cadfc03036f5fdc4f89b7fcb225792716 Mon Sep 17 00:00:00 2001 From: Weiqun Zhang Date: Sat, 11 Jan 2025 20:57:17 -0800 Subject: [PATCH] Make ParmParse Parser more robust (#4291) It's now allowed to call ParmParse Parser functions (e.g., queryAddWithParser) outside OpenMP parallel regions before ParmParse is initialized. --- Src/Base/AMReX_ParmParse.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Src/Base/AMReX_ParmParse.cpp b/Src/Base/AMReX_ParmParse.cpp index 3ecfc8503a..6a1fda5bc0 100644 --- a/Src/Base/AMReX_ParmParse.cpp +++ b/Src/Base/AMReX_ParmParse.cpp @@ -28,7 +28,7 @@ namespace amrex { namespace { bool initialized = false; ParmParse::Table g_table; - std::vector> g_parser_recursive_symbols; + std::vector> g_parser_recursive_symbols(1); namespace pp_detail { int verbose = -1; } @@ -1205,6 +1205,7 @@ ParmParse::Finalize () #endif g_parser_recursive_symbols.clear(); + g_parser_recursive_symbols.resize(1); pp_detail::verbose = -1; initialized = false;