diff --git a/src/Main/InvokeSolver.cpp b/src/Main/InvokeSolver.cpp index e256197cc..970017084 100644 --- a/src/Main/InvokeSolver.cpp +++ b/src/Main/InvokeSolver.cpp @@ -140,6 +140,7 @@ void InvokeSolver( const Solver_t TSolver, const int lv, const double TimeNew, c int ArrayID = 0; // array index to load and store data ( 0 or 1 ) int NPG[2]; // number of patch groups to be updated at a time int NTotal; // total number of patch groups to be updated + int NTotalRankMax; // total number of patch groups to be updated among all the ranks int Disp; // index displacement in PID0_List if ( OverlapMPI ) @@ -195,6 +196,8 @@ void InvokeSolver( const Solver_t TSolver, const int lv, const double TimeNew, c NPG[ArrayID] = ( NPG_Max < NTotal ) ? NPG_Max : NTotal; + MPI_Allreduce( &NTotal, &NTotalRankMax, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD ); + // evaluate time evolution matrix (once per level per timestep) # if ( GRAMFE_SCHEME == GRAMFE_MATMUL ) @@ -249,6 +252,91 @@ void InvokeSolver( const Solver_t TSolver, const int lv, const double TimeNew, c } // for (int Disp=NPG_Max; Disp= 1 + { + for (int DispMakeup=((NTotal == 0) ? NPG_Max : (((NTotal + NPG_Max - 1)/NPG_Max)*NPG_Max)); DispMakeup