aboutsummaryrefslogtreecommitdiff
path: root/Source/Utils/MPIInitHelpers.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Utils/MPIInitHelpers.cpp')
-rw-r--r--Source/Utils/MPIInitHelpers.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/Utils/MPIInitHelpers.cpp b/Source/Utils/MPIInitHelpers.cpp
index 47411375a..9d205eb5f 100644
--- a/Source/Utils/MPIInitHelpers.cpp
+++ b/Source/Utils/MPIInitHelpers.cpp
@@ -41,12 +41,13 @@ namespace utils
std::pair< int, int >
warpx_mpi_init (int argc, char* argv[])
{
- int thread_required = warpx_mpi_thread_required();
- int thread_provided = -1;
+ const int thread_required = warpx_mpi_thread_required();
#ifdef AMREX_USE_MPI
+ int thread_provided = -1;
MPI_Init_thread(&argc, &argv, thread_required, &thread_provided);
#else
amrex::ignore_unused(argc, argv);
+ const int thread_provided = -1;
#endif
return std::make_pair(thread_required, thread_provided);
}
@@ -64,7 +65,7 @@ namespace utils
warpx_check_mpi_thread_level ()
{
#ifdef AMREX_USE_MPI
- int thread_required = warpx_mpi_thread_required();
+ const int thread_required = warpx_mpi_thread_required();
int thread_provided = -1;
MPI_Query_thread(&thread_provided);
auto mtn = amrex::ParallelDescriptor::mpi_level_to_string;