Skip to content

Created/updated/bugfixed/unit-tested routines that apply/remove staggered phases and anti-periodic boundary conditions - #1670

Open
weinbe2 wants to merge 19 commits into
developfrom
feature/gauge-phase
Open

weinbe2 wants to merge 19 commits into
developfrom
feature/gauge-phase

Conversation

@weinbe2

@weinbe2 weinbe2 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Bug fixes

  • Staggered phases on extended fields (GaugePhase, include/kernels/gauge_phase.cuh):
    • The phases and the t boundary sign are now placed by each site's global coordinates, halo included. Previously they used local extended coordinates, which put the sign on the outermost halo slice of the last rank in t.
    • Affected callers: applyStaggeredPhase / removeStaggeredPhase on extended fields, including gaugeObservablesQuda, the gauge force and gauge path on extended copies, and qudaPolyakovLoop on the resident extended field.
  • Long links (QUDA_THREE_LINKS): the t boundary sign is now applied to the last three global time slices. Previously it was applied to one.
  • Long links with i_mu != 0: applyGaugePhase now errors. Previously it applied the single-link phase (e^{i\pi\mu/T}).
  • i_mu phase on extended fields: (T) is now the global time extent. Previously it was u.X()[3] * comm_dim(3), which includes the halo for extended fields.
  • Extended ghost exchange (GhostExtractorEx, include/kernels/extract_gauge_ghost_extended.cuh):
    • Sites are now labelled by the parity of their regular coordinates, matching copy_gauge_extended. Previously, when R[0] and sum(R) were both odd, injecting the x halo overwrote interior sites.
    • No current library caller uses such radii.
  • Test utilities (applyGaugeStaggeredPhase): phases are now applied in all four directions. Previously the t-direction phase was omitted, which only affects CHROMA.

New features

  • GaugeField::applyTBoundary / removeTBoundary, and the free function applyGaugeTBoundary:
    • They negate the t links that cross the t boundary in a field without staggered phases, halo included, and set the field's t boundary to antiperiodic / periodic. Pad ghosts are re-exchanged.
    • applyGaugeTBoundary requires reconstruct NO, 13, 12, 9 or 8 (NO, 13 or 9 for long links), and i_mu == 0 for reconstruct 12 and 8.
    • The member functions also require a native order, a periodic (apply) or antiperiodic (remove) t boundary, and staggered phase type NO.
  • Test utilities:
    • applyGaugeStaggeredPhase and applyGaugeTemporalBCs overloads for a host GaugeField of any order (extended fields excepted). The applyGaugeTemporalBCs overload takes the long-link flag from the field's link type.
    • get_staggered_phase_str in misc.{h,cpp}.
    • applyGaugeImaginaryChemicalPotential: (e^{i\pi\mu/T}) on every t link of a QDP-ordered field.
    • applyGaugeTemporalBCs is now declared in gauge_utils.h.
  • gauge_phase_test, with ctests gauge_phase and gauge_phase_partition (--partition 13). It checks:
    • Device phases against host phases, for MILC, TIFR and CHROMA, thin and long links, and periodic and antiperiodic boundaries.
    • Extended fields with halo widths 2 and 1.
    • i_mu on thin links.
    • Polyakov loop and gauge force through the interface.
    • applyTBoundary / removeTBoundary for every reconstruct, and on extended fields.

Other changes

  • MILC interface (createGaugeParamForObservables): phased links are now loaded with t_boundary = QUDA_ANTI_PERIODIC_T, as in MILC's other entry points. qudaPolyakovLoopPhased and qudaGaugeMeasurementsPhased no longer negate the Polyakov loop. Previously the links were labelled periodic and the loop was negated.
  • Test utilities: applyGaugeStaggeredPhase no longer takes a t_boundary argument. The t boundary sign is applied only by applyGaugeTemporalBCs.
  • quda.h: the documented i_mu phase for staggeredPhaseQuda is corrected from exp(imu/T) to exp(i pi i_mu / T) on every t link, with (T) the global time extent.

Known limitations

  • staggeredPhaseQuda builds QUDA_GENERAL_LINKS, so long links passed through it are treated as thin links (sign on one slice). This is unchanged by this PR.

Testing

Build: STRICT, sm_100, MPI, OpenMP, Wilson, clover and staggered. Twisted clover was added for clover_force_test. Runs used QUDA_ENABLE_TUNING=0, with several ranks sharing one GPU (QUDA_ENABLE_MPS=1).

  • gauge_phase_test passes 98 of 98 on these grids and --partition values:

    QUDA_TEST_GRID_SIZE --partition values
    1 1 1 1 none, 1, 8, 9, 13, 14, 15
    1 1 1 2 none, 1, 13
    1 1 2 2 none, 13, 14
    1 1 1 4 none, 1
    2 1 1 2 none, 4, 6
  • ctest on 1 1 1 2: 34 of 35 pass. The tests run were:

    • dslash_* (Wilson, clover, staggered, asqtad, HISQ);
    • invert_test_* (Wilson, clover, staggered, asqtad, split-grid included);
    • clover_force_test, hisq_stencil, gauge_path, su3;
    • unitarize_link_*, hisq_paths_force_*, gauge_phase*.
  • Pre-existing issue in invert_test_clover_asym, 6 of 319 cases fail, all *_mat_pc_normop_pc_l2_heavy_quark. The final residual is 1.080e-12 against a tolerance of 1.076e-12.

  • clover_force_test with twisted clover enabled, on 1 1 1 2: 32 of 32 pass. The suites are clover, clover RHMC, twisted clover, and non-degenerate twisted clover.

  • MILC develop (551dc479) su3_rhmd_hisq, NERSC small RHMC (18³×36, 2 trajectories). QUDA: QMP and QIO, staggered only.

    • This branch and develop (af7e15080) give identical delta S, PLAQ, P_LOOP, G_LOOP, PBP and solver iteration counts, on both 1 GPU and 2 ranks on one GPU (t partitioned).
    • P_LOOP comes from qudaGaugeMeasurementsPhased: −1.589037e-02, −9.524123e-03 on 1 GPU and −1.589043e-02, −9.524098e-03 on 2 ranks.

…hout the t boundary sign, and on any host gauge field
…e field, halo included, from its global coordinates
…inks, and reject an imaginary chemical potential on them
…iperiodic t sign into the links of fields without staggered phases and take it out
… and take whether a time slice's t links cross the t boundary from one GaugePhaseGeometry::crossesTBoundary
…h reconstruct 13 and 9, which store the sign in their phase
…ich rebuild the t boundary sign on one time slice rather than three, and move the reconstruct checks of GaugeField::applyTBoundary and removeTBoundary there, noting why reconstruct 12 and 8 reject an imaginary chemical potential
…ordinates in gauge_phase_test's link comparison, so that differing links are reported at their coordinates, and put get_phase_str's documentation on it
…cal potential, exp(i pi i_mu / T) on every t link with T the global time extent, and that removing them takes it out, with the host phase from a new test utility, applyGaugeImaginaryChemicalPotential, and document that phase for staggeredPhaseQuda
…elds of halo width 1 have sites labelled with the opposite parity to their coordinates, on a single GPU and on CI's grid partitioned in z and t
…ar coordinates in the extended ghost exchange, as the rest of QUDA does, so that halos of odd total width with an odd x radius no longer overwrite interior sites
…g of one coordinate onto the global lattice in a globalCoord member that boundaryTimeSlices shares
…est utilities' compare_link_fields, which takes QDP-ordered host fields of any one layout, instead of a site-by-site comparison of its own
…ntum checks, compare_floats and strong_check_mom, on MILC-ordered copies, and check the force is not zero by its action, from momentumActionCPU, against a zero field's
…aggered_phase_str test utility, and skip its disabled reconstructs with getReconstructNibble, as the other tests do
…kes long links from the field's link type, and build gauge_phase_test's phased and signed references with it on plain copies, comparing reconstructs other than NO within tolerance instead of through a device round trip

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants