Skip to content

Commit

Permalink
Initialize MPI_Wtime (#1041)
Browse files Browse the repository at this point in the history
  • Loading branch information
WeiqunZhang authored Jun 20, 2020
1 parent 123970a commit 8be36ee
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Src/Base/AMReX_ParallelDescriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,11 @@ ParallelDescriptor::StartParallel (int* argc,
call_mpi_finalize = 0;
}

// It seems that for some MPI implementation, the first call to MPI_Wtime is always 0. That
// sometimes causes problems for amrex::UniqueString function. So we call MPI_Wtime here.
auto tfoo = MPI_Wtime();
amrex::ignore_unused(tfoo);

#ifdef AMREX_MPI_THREAD_MULTIPLE
{
int requested = MPI_THREAD_MULTIPLE;
Expand Down

0 comments on commit 8be36ee

Please sign in to comment.