Revert "skip redundant MPI ghost cell syncs for stages 0, 1 & 2"

This reverts commit f7ada421cf.
This commit is contained in:
2026-02-26 20:56:41 +08:00
parent 780f1c80d0
commit 94d236385d
3 changed files with 105 additions and 60 deletions

View File

@@ -1221,7 +1221,25 @@ void bssnEM_class::Step(int lev, int YN)
}
#endif
// CA-RK4: skip post-prediction sync (redundant; ghost cells computable locally)
Parallel::Sync(GH->PatL[lev], SynchList_pre, Symmetry);
#ifdef WithShell
if (lev == 0)
{
clock_t prev_clock, curr_clock;
if (myrank == 0)
curr_clock = clock();
SH->Synch(SynchList_pre, Symmetry);
if (myrank == 0)
{
prev_clock = curr_clock;
curr_clock = clock();
cout << " Shell stuff synchronization used "
<< (double)(curr_clock - prev_clock) / ((double)CLOCKS_PER_SEC)
<< " seconds! " << endl;
}
}
#endif
// for black hole position
if (BH_num > 0 && lev == GH->levels - 1)
@@ -1665,28 +1683,25 @@ void bssnEM_class::Step(int lev, int YN)
}
#endif
// CA-RK4: only sync after last corrector (iter_count == 3); stages 1 & 2 are redundant
if (iter_count == 3) {
Parallel::Sync(GH->PatL[lev], SynchList_cor, Symmetry);
Parallel::Sync(GH->PatL[lev], SynchList_cor, Symmetry);
#ifdef WithShell
if (lev == 0)
if (lev == 0)
{
clock_t prev_clock, curr_clock;
if (myrank == 0)
curr_clock = clock();
SH->Synch(SynchList_cor, Symmetry);
if (myrank == 0)
{
clock_t prev_clock, curr_clock;
if (myrank == 0)
curr_clock = clock();
SH->Synch(SynchList_cor, Symmetry);
if (myrank == 0)
{
prev_clock = curr_clock;
curr_clock = clock();
cout << " Shell stuff synchronization used "
<< (double)(curr_clock - prev_clock) / ((double)CLOCKS_PER_SEC)
<< " seconds! " << endl;
}
prev_clock = curr_clock;
curr_clock = clock();
cout << " Shell stuff synchronization used "
<< (double)(curr_clock - prev_clock) / ((double)CLOCKS_PER_SEC)
<< " seconds! " << endl;
}
}
#endif
} // end CA-RK4 guard
// for black hole position
if (BH_num > 0 && lev == GH->levels - 1)
{