Initialize cached sync runtime in derived evolvers
This commit is contained in:
@@ -126,6 +126,8 @@ void Z4c_class::Initialize()
|
|||||||
CheckPoint->readcheck_sh(SH, myrank);
|
CheckPoint->readcheck_sh(SH, myrank);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Initialize_Level_Runtime();
|
||||||
|
|
||||||
double h = GH->PatL[0]->data->blb->data->getdX(0);
|
double h = GH->PatL[0]->data->blb->data->getdX(0);
|
||||||
for (int i = 1; i < dim; i++)
|
for (int i = 1; i < dim; i++)
|
||||||
h = Mymin(h, GH->PatL[0]->data->blb->data->getdX(i));
|
h = Mymin(h, GH->PatL[0]->data->blb->data->getdX(i));
|
||||||
|
|||||||
@@ -244,6 +244,8 @@ void bssnEM_class::Initialize()
|
|||||||
CheckPoint->readcheck_sh(SH, myrank);
|
CheckPoint->readcheck_sh(SH, myrank);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Initialize_Level_Runtime();
|
||||||
|
|
||||||
double h = GH->PatL[0]->data->blb->data->getdX(0);
|
double h = GH->PatL[0]->data->blb->data->getdX(0);
|
||||||
for (int i = 1; i < dim; i++)
|
for (int i = 1; i < dim; i++)
|
||||||
h = Mymin(h, GH->PatL[0]->data->blb->data->getdX(i));
|
h = Mymin(h, GH->PatL[0]->data->blb->data->getdX(i));
|
||||||
|
|||||||
@@ -151,6 +151,8 @@ void bssnEScalar_class::Initialize()
|
|||||||
CheckPoint->readcheck_sh(SH, myrank);
|
CheckPoint->readcheck_sh(SH, myrank);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Initialize_Level_Runtime();
|
||||||
|
|
||||||
double h = GH->PatL[0]->data->blb->data->getdX(0);
|
double h = GH->PatL[0]->data->blb->data->getdX(0);
|
||||||
for (int i = 1; i < dim; i++)
|
for (int i = 1; i < dim; i++)
|
||||||
h = Mymin(h, GH->PatL[0]->data->blb->data->getdX(i));
|
h = Mymin(h, GH->PatL[0]->data->blb->data->getdX(i));
|
||||||
|
|||||||
@@ -784,6 +784,8 @@ bssn_class::bssn_class(double Couranti, double StartTimei, double TotalTimei,
|
|||||||
xc(0), yc(0), zc(0), xr(0), yr(0), zr(0), trigger(0), dTT(0), dumpid(0),
|
xc(0), yc(0), zc(0), xr(0), yr(0), zr(0), trigger(0), dTT(0), dumpid(0),
|
||||||
#endif
|
#endif
|
||||||
a_lev(a_levi), maxl(maxli), decn(decni), maxrex(maxrexi), drex(drexi),
|
a_lev(a_levi), maxl(maxli), decn(decni), maxrex(maxrexi), drex(drexi),
|
||||||
|
sync_cache_pre(0), sync_cache_cor(0), sync_cache_rp_coarse(0), sync_cache_rp_fine(0),
|
||||||
|
sync_cache_restrict(0), sync_cache_outbd(0),
|
||||||
CheckPoint(0)
|
CheckPoint(0)
|
||||||
// CheckPoint(0)
|
// CheckPoint(0)
|
||||||
{
|
{
|
||||||
@@ -1409,6 +1411,38 @@ bssn_class::bssn_class(double Couranti, double StartTimei, double TotalTimei,
|
|||||||
|
|
||||||
//================================================================================================
|
//================================================================================================
|
||||||
|
|
||||||
|
void bssn_class::Initialize_Level_Runtime()
|
||||||
|
{
|
||||||
|
if (!GH)
|
||||||
|
{
|
||||||
|
if (ErrorMonitor && ErrorMonitor->outfile)
|
||||||
|
ErrorMonitor->outfile << "Initialize_Level_Runtime called before GH is initialized" << endl;
|
||||||
|
MPI_Abort(MPI_COMM_WORLD, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ConstraintRefreshLevels)
|
||||||
|
{
|
||||||
|
ConstraintRefreshLevels = new int[GH->levels];
|
||||||
|
for (int il = 0; il < GH->levels; il++)
|
||||||
|
ConstraintRefreshLevels[il] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!sync_cache_pre)
|
||||||
|
sync_cache_pre = new Parallel::SyncCache[GH->levels];
|
||||||
|
if (!sync_cache_cor)
|
||||||
|
sync_cache_cor = new Parallel::SyncCache[GH->levels];
|
||||||
|
if (!sync_cache_rp_coarse)
|
||||||
|
sync_cache_rp_coarse = new Parallel::SyncCache[GH->levels];
|
||||||
|
if (!sync_cache_rp_fine)
|
||||||
|
sync_cache_rp_fine = new Parallel::SyncCache[GH->levels];
|
||||||
|
if (!sync_cache_restrict)
|
||||||
|
sync_cache_restrict = new Parallel::SyncCache[GH->levels];
|
||||||
|
if (!sync_cache_outbd)
|
||||||
|
sync_cache_outbd = new Parallel::SyncCache[GH->levels];
|
||||||
|
}
|
||||||
|
|
||||||
|
//================================================================================================
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//================================================================================================
|
//================================================================================================
|
||||||
@@ -1439,9 +1473,6 @@ void bssn_class::Initialize()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
GH = new cgh(0, ngfs, Symmetry, pname, checkrun, ErrorMonitor);
|
GH = new cgh(0, ngfs, Symmetry, pname, checkrun, ErrorMonitor);
|
||||||
ConstraintRefreshLevels = new int[GH->levels];
|
|
||||||
for (int il = 0; il < GH->levels; il++)
|
|
||||||
ConstraintRefreshLevels[il] = 0;
|
|
||||||
if (checkrun)
|
if (checkrun)
|
||||||
CheckPoint->readcheck_cgh(PhysTime, GH, myrank, nprocs, Symmetry);
|
CheckPoint->readcheck_cgh(PhysTime, GH, myrank, nprocs, Symmetry);
|
||||||
else
|
else
|
||||||
@@ -1477,13 +1508,7 @@ void bssn_class::Initialize()
|
|||||||
Setup_Black_Hole_position();
|
Setup_Black_Hole_position();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize sync caches (per-level, for predictor and corrector)
|
Initialize_Level_Runtime();
|
||||||
sync_cache_pre = new Parallel::SyncCache[GH->levels];
|
|
||||||
sync_cache_cor = new Parallel::SyncCache[GH->levels];
|
|
||||||
sync_cache_rp_coarse = new Parallel::SyncCache[GH->levels];
|
|
||||||
sync_cache_rp_fine = new Parallel::SyncCache[GH->levels];
|
|
||||||
sync_cache_restrict = new Parallel::SyncCache[GH->levels];
|
|
||||||
sync_cache_outbd = new Parallel::SyncCache[GH->levels];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//================================================================================================
|
//================================================================================================
|
||||||
@@ -1762,6 +1787,18 @@ bssn_class::~bssn_class()
|
|||||||
sync_cache_rp_fine[i].destroy();
|
sync_cache_rp_fine[i].destroy();
|
||||||
delete[] sync_cache_rp_fine;
|
delete[] sync_cache_rp_fine;
|
||||||
}
|
}
|
||||||
|
if (sync_cache_restrict)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < GH->levels; i++)
|
||||||
|
sync_cache_restrict[i].destroy();
|
||||||
|
delete[] sync_cache_restrict;
|
||||||
|
}
|
||||||
|
if (sync_cache_outbd)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < GH->levels; i++)
|
||||||
|
sync_cache_outbd[i].destroy();
|
||||||
|
delete[] sync_cache_outbd;
|
||||||
|
}
|
||||||
|
|
||||||
delete GH;
|
delete GH;
|
||||||
#ifdef WithShell
|
#ifdef WithShell
|
||||||
|
|||||||
@@ -184,6 +184,9 @@ public:
|
|||||||
virtual void Constraint_Out();
|
virtual void Constraint_Out();
|
||||||
virtual void Compute_Constraint();
|
virtual void Compute_Constraint();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void Initialize_Level_Runtime();
|
||||||
|
|
||||||
#ifdef With_AHF
|
#ifdef With_AHF
|
||||||
protected:
|
protected:
|
||||||
MyList<var> *AHList, *AHDList, *GaugeList;
|
MyList<var> *AHList, *AHDList, *GaugeList;
|
||||||
|
|||||||
Reference in New Issue
Block a user