Skip to content

Commit

Permalink
Merge pull request #1431 from qcdcode/feature/WFlowQuda_restart
Browse files Browse the repository at this point in the history
  • Loading branch information
maddyscientist authored Jan 18, 2024
2 parents dd5bd98 + 9666be3 commit 273d4fe
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ Advanced Scientific Computing (PASC21) [arXiv:2104.05615[hep-lat]].
* Eloy Romero (William and Mary)
* Hauke Sandmeyer (Bielefeld)
* Mario Schröck (INFN)
* Aniket Sen (HISKP, University of Bonn)
* Guochun Shi (NCSA)
* Alexei Strelchenko (Fermi National Accelerator Laboratory)
* Jiqun Tu (NVIDIA)
Expand Down
2 changes: 2 additions & 0 deletions include/quda.h
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,8 @@ extern "C" {
double rho; /**< Serves as one of the coefficients used in Over Improved Stout smearing, or as the single coefficient used in Stout */
unsigned int meas_interval; /**< Perform the requested measurements on the gauge field at this interval */
QudaGaugeSmearType smear_type; /**< The smearing type to perform */
QudaBoolean restart; /**< Used to restart the smearing from existing gaugeSmeared */
double t0; /**< Starting flow time for Wilson flow */
} QudaGaugeSmearParam;

typedef struct QudaBLASParam_s {
Expand Down
4 changes: 4 additions & 0 deletions lib/check_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -1100,12 +1100,16 @@ void printQudaGaugeSmearParam(QudaGaugeSmearParam *param)
P(alpha, 0.0);
P(rho, 0.0);
P(epsilon, 0.0);
P(restart, QUDA_BOOLEAN_FALSE);
P(t0, 0.0);
#else
P(n_steps, (unsigned int)INVALID_INT);
P(meas_interval, (unsigned int)INVALID_INT);
P(alpha, INVALID_DOUBLE);
P(rho, INVALID_DOUBLE);
P(epsilon, INVALID_DOUBLE);
P(restart, QUDA_BOOLEAN_INVALID);
P(t0, INVALID_DOUBLE);
#endif

#ifdef INIT_PARAM
Expand Down
17 changes: 12 additions & 5 deletions lib/interface_quda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5113,9 +5113,13 @@ void performWFlowQuda(QudaGaugeSmearParam *smear_param, QudaGaugeObservableParam
pushOutputPrefix("performWFlowQuda: ");
checkGaugeSmearParam(smear_param);

if (gaugePrecise == nullptr) errorQuda("Gauge field must be loaded");
freeUniqueGaugeQuda(QUDA_SMEARED_LINKS);
gaugeSmeared = createExtendedGauge(*gaugePrecise, R, profileWFlow);
if (smear_param->restart) {
if (gaugeSmeared == nullptr) errorQuda("gaugeSmeared must be loaded");
} else {
if (gaugePrecise == nullptr) errorQuda("Gauge field must be loaded");
freeUniqueGaugeQuda(QUDA_SMEARED_LINKS);
gaugeSmeared = createExtendedGauge(*gaugePrecise, R, profileWFlow);
}

GaugeFieldParam gParamEx(*gaugeSmeared);
GaugeField gaugeAux(gParamEx);
Expand All @@ -5132,7 +5136,7 @@ void performWFlowQuda(QudaGaugeSmearParam *smear_param, QudaGaugeObservableParam
gaugeObservables(in, obs_param[measurement_n]);

logQuda(QUDA_SUMMARIZE, "flow t, plaquette, E_tot, E_spatial, E_temporal, Q charge\n");
logQuda(QUDA_SUMMARIZE, "%le %.16e %+.16e %+.16e %+.16e %+.16e\n", 0.0, obs_param[0].plaquette[0],
logQuda(QUDA_SUMMARIZE, "%le %.16e %+.16e %+.16e %+.16e %+.16e\n", smear_param->t0, obs_param[0].plaquette[0],
obs_param[0].energy[0], obs_param[0].energy[1], obs_param[0].energy[2], obs_param[0].qcharge);

for (unsigned int i = 0; i < smear_param->n_steps; i++) {
Expand All @@ -5144,11 +5148,14 @@ void performWFlowQuda(QudaGaugeSmearParam *smear_param, QudaGaugeObservableParam
if ((i + 1) % smear_param->meas_interval == 0) {
measurement_n++; // increment measurements.
gaugeObservables(out, obs_param[measurement_n]);
logQuda(QUDA_SUMMARIZE, "%le %.16e %+.16e %+.16e %+.16e %+.16e\n", smear_param->epsilon * (i + 1),
logQuda(QUDA_SUMMARIZE, "%le %.16e %+.16e %+.16e %+.16e %+.16e\n", (smear_param->t0 + smear_param->epsilon * (i + 1)),
obs_param[measurement_n].plaquette[0], obs_param[measurement_n].energy[0],
obs_param[measurement_n].energy[1], obs_param[measurement_n].energy[2], obs_param[measurement_n].qcharge);
}
}
// copy out to gaugeSmeared so that flowed gauge can be saved to host and WFlow can be restarted
copyExtendedGauge(*gaugeSmeared, out, QUDA_CUDA_FIELD_LOCATION);
gaugeSmeared->exchangeExtendedGhost( gaugeSmeared->R() );

popOutputPrefix();
}
Expand Down

0 comments on commit 273d4fe

Please sign in to comment.