Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HYP smearing. Also add 3D/4D version of STOUT and APE smearing. #1426

Merged
merged 25 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
bc88999
Add `dir_ignore` to `QudaGaugeSmearParam`.
SaltyChiang Jan 7, 2024
4aaa49a
Add HYP smearing.
SaltyChiang Jan 8, 2024
2089093
Update `flops()` and `bytes()` for HYP smearing.
SaltyChiang Jan 8, 2024
4d073f7
Make compiler happy with STRICT build.
SaltyChiang Jan 10, 2024
0fc4cb4
Set default tolerance of SU3 projection 10x epsilon.
SaltyChiang Jan 10, 2024
e240272
clang-format
SaltyChiang Jan 10, 2024
2839225
Use `GaugeField::toleranceSU3()`
SaltyChiang Jan 10, 2024
c0b920a
Merge remote-tracking branch 'clqcd/feature/gauge-smear' into feature…
weinbe2 Feb 1, 2024
1133b3f
Moved allocating temporaries into the HYPSmear routine
weinbe2 Feb 1, 2024
e0d97b4
Merge branch 'develop' of https://github.com/lattice/quda into featur…
weinbe2 Feb 1, 2024
9545d28
Code cleanup, introducing extended field coordinate E
weinbe2 Feb 1, 2024
6685b14
Partial progress towards HYP cleanup
weinbe2 Feb 1, 2024
2640ae9
Cleanup/bugfixes
weinbe2 Feb 1, 2024
4f2a625
Cleaned up/corrected staple abstraction. Still generating a stack fra…
weinbe2 Feb 1, 2024
0fd5776
Cleanup before getting rid of templating over staples
weinbe2 Feb 1, 2024
5f15d84
Removed as much stack frame as possible, remaining frame is due to re…
weinbe2 Feb 1, 2024
a3fae46
Updated timers
weinbe2 Feb 1, 2024
d4a24e5
clang-format
weinbe2 Feb 1, 2024
6721776
Clang error: unused "using"
weinbe2 Feb 5, 2024
a2326f8
Removed superfluous getProfile calls
weinbe2 Feb 5, 2024
124bab9
Merge remote-tracking branch 'clqcd/feature/gauge-smear' into feature…
weinbe2 Feb 5, 2024
0892e26
Remove unused param to make compiler happy.
SaltyChiang Feb 6, 2024
1688931
clang-14 + nvcc-11.8 think variables like `sigma_with_mu` unused.
SaltyChiang Feb 6, 2024
74f9a23
Update comments.
SaltyChiang Feb 6, 2024
2b5a7c2
Use `dir_ignore < 0` to represent the default situation.
SaltyChiang Feb 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/enum_quda.h
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,7 @@ typedef enum QudaGaugeSmearType_s {
QUDA_GAUGE_SMEAR_APE,
QUDA_GAUGE_SMEAR_STOUT,
QUDA_GAUGE_SMEAR_OVRIMP_STOUT,
QUDA_GAUGE_SMEAR_HYP,
QUDA_GAUGE_SMEAR_WILSON_FLOW,
QUDA_GAUGE_SMEAR_SYMANZIK_FLOW,
QUDA_GAUGE_SMEAR_INVALID = QUDA_INVALID_ENUM
Expand Down
5 changes: 3 additions & 2 deletions include/enum_quda_fortran.h
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,9 @@
#define QUDA_GAUGE_SMEAR_APE 0
#define QUDA_GAUGE_SMEAR_STOUT 1
#define QUDA_GAUGE_SMEAR_OVRIMP_STOUT 2
#define QUDA_GAUGE_SMEAR_WILSON_FLOW 3
#define QUDA_GAUGE_SMEAR_SYMANZIK_FLOW 4
#define QUDA_GAUGE_SMEAR_HYP 3
#define QUDA_GAUGE_SMEAR_WILSON_FLOW 4
#define QUDA_GAUGE_SMEAR_SYMANZIK_FLOW 5
#define QUDA_GAUGE_SMEAR_INVALID QUDA_INVALID_ENUM

#define QudaFermionSmearType integer(4)
Expand Down
13 changes: 13 additions & 0 deletions include/gauge_field.h
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,19 @@ namespace quda {
*/
static bool are_compatible_weak(const GaugeField &a, const GaugeField &b);

/**
* @brief Helper function that returns the default tolerance used by SU(3) projection
* @return The default tolerance, which is ~10x epsilon
*/
double toleranceSU3() const
{
switch (precision) {
case QUDA_DOUBLE_PRECISION: return 2e-15;
case QUDA_SINGLE_PRECISION: return 1e-6;
default: return 1e-6;
}
}

friend struct GaugeFieldParam;
};

Expand Down
20 changes: 17 additions & 3 deletions include/gauge_tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,19 @@ namespace quda
@param[out] dataDs Output smeared field
@param[in] dataOr Input gauge field
@param[in] alpha smearing parameter
@param[in] dir_ignore ignored direction
*/
void APEStep(GaugeField &dataDs, GaugeField &dataOr, double alpha);
void APEStep(GaugeField &dataDs, GaugeField &dataOr, double alpha, int dir_ignore);

/**
@brief Apply STOUT smearing to the gauge field

@param[out] dataDs Output smeared field
@param[in] dataOr Input gauge field
@param[in] rho smearing parameter
@param[in] dir_ignore ignored direction
*/
void STOUTStep(GaugeField &dataDs, GaugeField &dataOr, double rho);
void STOUTStep(GaugeField &dataDs, GaugeField &dataOr, double rho, int dir_ignore);

/**
@brief Apply Over Improved STOUT smearing to the gauge field
Expand All @@ -114,8 +116,20 @@ namespace quda
@param[in] dataOr Input gauge field
@param[in] rho smearing parameter
@param[in] epsilon smearing parameter
@param[in] dir_ignore ignored direction
*/
void OvrImpSTOUTStep(GaugeField &dataDs, GaugeField &dataOr, double rho, double epsilon);
void OvrImpSTOUTStep(GaugeField &dataDs, GaugeField &dataOr, double rho, double epsilon, int dir_ignore);

/**
@brief Apply HYP smearing to the gauge field
@param[out] dataDs Output smeared field
@param[in] dataOr Input gauge field
@param[in] alpha1 smearing parameter
@param[in] alpha2 smearing parameter
@param[in] alpha3 smearing parameter
@param[in] dir_ignore ignored direction
*/
void HYPStep(GaugeField &dataDs, GaugeField &dataOr, double alpha1, double alpha2, double alpha3, int dir_ignore);

/**
@brief Apply Wilson Flow steps W1, W2, Vt to the gauge field.
Expand Down
16 changes: 8 additions & 8 deletions include/kernels/gauge_ape.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
namespace quda
{

#define DOUBLE_TOL 1e-15
#define SINGLE_TOL 2e-6

template <typename Float_, int nColor_, QudaReconstructType recon_, int apeDim_>
struct GaugeAPEArg : kernel_param<> {
using Float = Float_;
Expand All @@ -26,14 +23,16 @@ namespace quda
int X[4]; // grid dimensions
int border[4];
const Float alpha;
const int dir_ignore;
const Float tolerance;

GaugeAPEArg(GaugeField &out, const GaugeField &in, double alpha) :
GaugeAPEArg(GaugeField &out, const GaugeField &in, double alpha, int dir_ignore) :
kernel_param(dim3(in.LocalVolumeCB(), 2, apeDim)),
out(out),
in(in),
alpha(alpha),
tolerance(in.Precision() == QUDA_DOUBLE_PRECISION ? DOUBLE_TOL : SINGLE_TOL)
dir_ignore(dir_ignore),
tolerance(in.toleranceSU3())
{
for (int dir = 0; dir < 4; ++dir) {
border[dir] = in.R()[dir];
Expand Down Expand Up @@ -61,16 +60,17 @@ namespace quda
x[dr] += arg.border[dr];
X[dr] += 2 * arg.border[dr];
}
dir = dir + (dir >= arg.dir_ignore);

int dx[4] = {0, 0, 0, 0};
Link U, Stap, TestU, I;
// This function gets stap = S_{mu,nu} i.e., the staple of length 3,
computeStaple(arg, x, X, parity, dir, Stap, Arg::apeDim);
computeStaple(arg, x, X, parity, dir, Stap, arg.dir_ignore);

// Get link U
U = arg.in(dir, linkIndexShift(x, dx, X), parity);
Stap = Stap * (arg.alpha / ((real)(2. * (3. - 1.))));

Stap = Stap * (arg.alpha / ((real)(2 * (Arg::apeDim - 1))));
setIdentity(&I);

TestU = I * (static_cast<real>(1.0) - arg.alpha) + Stap * conj(U);
Expand Down
Loading