|
| | QuadratureIntegrator_fT (QuadratureProvider &quadrature_provider, const std::array< size_t, sdim > _grid_size, std::array< ctype, sdim > grid_min, std::array< ctype, sdim > grid_max, const std::array< QuadratureType, sdim > quadrature_type, const ctype T=1, const ctype typical_E=1) |
| |
| void | set_grid_extents (const std::array< ctype, sdim > grid_min, const std::array< ctype, sdim > grid_max) |
| |
| void | set_T (const ctype T) |
| |
| void | set_k (const ctype k) |
| | The RG scale, which is the DEFAULT frequency scale.
|
| |
| void | set_typical_E (const ctype typical_E) |
| | The heaviest scale the summand carries, if the model knows it. Zero means "only k".
|
| |
| void | set_frequency_cutoff (const ctype freq_cutoff) |
| | The frequency beyond which the summand is known to vanish, enabling the exact sum.
|
| |
| void | set_allow_exact_matsubara_sum (const bool allow) |
| | Force the exact sum on (or off) regardless of the kernel's trait.
|
| |
| void | set_matsubara_extent_margin (const ctype margin) |
| |
| size_t | get_matsubara_size () const |
| | Nodes on the frequency axis, INCLUDING the zero mode.
|
| |
| bool | uses_exact_matsubara_sum () const |
| | True if the frequency axis is currently the exact sum rather than a Gaussian quadrature rule.
|
| |
| template<typename... T> |
| void | get (NT &dest, const T &...t) const |
| |
template<typename OT , typename... T>
requires (!std::is_same_v<OT, NT>) |
| void | get (OT &dest, const T &...t) const |
| |
template<typename OT , typename... Args>
requires (!std::is_same_v<OT, NT>) |
| void | get (ExecutionSpace &space, OT &dest, const Args &...t) const |
| |
| template<typename view_type , typename Coordinates , typename... Args> |
| void | map (ExecutionSpace &space, const view_type integral_view, const Coordinates &coordinates, const Args &...args) |
| |
| size_t | quadrature_volume () const |
| | Points evaluated per external grid point. Half of the scheduler's cost score.
|
| |
| template<typename Coordinates , typename... Args> |
| auto | map (NT *dest, const Coordinates &coordinates, const Args &...args) |
| |
| template<typename Coordinates , typename... Args> |
| auto | map_dist (NT *dest, const Coordinates &coordinates, const Args &...args) |
| |
| | AbstractIntegrator () |
| |
| KOKKOS_FORCEINLINE_FUNCTION size_t | integrator_id () const |
| | Stable, rank-independent identity of this integrator.
|
| |
|
| ExecutionSpace | space |
| |
| QuadratureProvider & | quadrature_provider |
| |
| device::array< device::array< ctype, sdim >, 2 > | grid_extents |
| |
| device::array< ctype, sdim > | grid_start |
| |
| device::array< ctype, sdim > | grid_scale |
| |
| device::array< size_t, dim > | grid_size |
| |
| device::array< Kokkos::View< const ctype *, typename ExecutionSpace::memory_space >, sdim > | nodes |
| |
| device::array< Kokkos::View< const ctype *, typename ExecutionSpace::memory_space >, sdim > | weights |
| |
| ctype | T |
| |
| ctype | m_k |
| | The RG scale, which is the frequency scale unless the model set one; see set_k().
|
| |
| ctype | m_typical_E_user = 0 |
| | The model's heaviest scale, or zero if it never said; see set_typical_E().
|
| |
| ctype | m_freq_cutoff = 0 |
| | Support boundary in frequency; zero means "unknown", which disables the exact sum.
|
| |
| size_t | m_n_tail = 0 |
| | Nodes before the boundary of the concatenated axis of a split kernel; 0 when not split.
|
| |
| Kokkos::View< ctype *, typename ExecutionSpace::memory_space > | m_split_nodes |
| |
| Kokkos::View< ctype *, typename ExecutionSpace::memory_space > | m_split_weights |
| |
| bool | m_allow_exact = false |
| |
| bool | m_using_exact = false |
| |
| ctype | m_extent_margin = 1 |
| |
| Kokkos::View< const ctype *, typename ExecutionSpace::memory_space > | matsubara_nodes |
| |
| Kokkos::View< const ctype *, typename ExecutionSpace::memory_space > | matsubara_weights |
| |
| KokkosNDView< 1+dim, NT, ExecutionSpace > | m_cache |
| |
| device::array< size_t, 1+dim > | m_cache_extents {} |
| |
| Kokkos::View< ctype *, typename ExecutionSpace::memory_space > | m_positions |
| |
| std::string | m_positions_key |
| |
| Kokkos::View< NT *, ExecutionSpace > | m_dest_device |
| |
| size_t | m_dest_device_size = 0 |
| |
| Kokkos::View< NT *, PinnedHost_memory > | m_dest_pinned |
| | Page-locked staging for the device path, so the result copy is genuinely asynchronous.
|
| |
| size_t | m_dest_pinned_size = 0 |
| |
| Kokkos::View< NT, typename ExecutionSpace::memory_space > | m_result_view |
| |
| Kokkos::View< NT, typenameExecutionSpace::memory_space >::host_mirror_type | m_result_host |
| |
| bool | m_result_views_initialized = false |
| |
| size_t | m_integrator_id |
| |
|
| void | refresh_matsubara () |
| | Re-select and re-fetch the frequency rule after T, k, typical_E or the cutoff changed.
|
| |
| Kokkos::View< NT *, ExecutionSpace > | device_scratch (const size_t n) |
| | Grow-only scratch in the integrator's own execution space, reused across calls.
|
| |
| template<typename Coordinates , typename... Args> |
| void | run_or_queue_host (NT *dest, const Coordinates &coordinates, const Args &...args) |
| |
| template<typename Coordinates , typename... Args> |
| void | run_host (NT *dest, const Coordinates &coordinates, const Args &...args) |
| |
template<int dim, typename NT , typename KERNEL , typename ExecutionSpace >
template<typename XArr , typename PosArr , typename ArgTuple >
| static KOKKOS_INLINE_FUNCTION NT DiFfRG::QuadratureIntegrator_fT< dim, NT, KERNEL, ExecutionSpace >::node_value |
( |
const XArr & | x, |
|
|
const PosArr & | pos, |
|
|
const ArgTuple & | args, |
|
|
const ctype | xt, |
|
|
const ctype | wt, |
|
|
const bool | is_tail ) |
|
inlinestatic |
One Matsubara node's contribution at one spatial point, weight excluded.
Factored out of get()/map() so the +-frequency and zero-mode logic exists once, and – importantly – so the if constexpr on matsubara_even lives in an ordinary device function rather than inside an extended lambda, where nvcc's transformation is fragile.
The zero mode is NOT special-cased here: it arrives as an ordinary node (0, T/2) at the end of the node list (see MatsubaraQuadrature::sum_nodes), and w * (f(+0) + f(-0)) reproduces T f(0) exactly. The branch this replaces cost the whole warp a full extra kernel evaluation for one active lane.
The three packs are applied as NESTED lvalue tuples. Do not tuple_cat them: tuple_cat builds a by-value object, and args holds every interpolator by value, so the concatenated tuple becomes a full per-thread copy of all of them in local memory. On QCD_Nf2 that was 3576 B of stack frame and 2.3x of runtime in the vacuum integrator (see the comment in QuadratureIntegrator::map). Applying an lvalue tuple binds references instead.
template<int dim, typename NT , typename KERNEL , typename ExecutionSpace >
Re-select and re-fetch the frequency rule after T, k, typical_E or the cutoff changed.
Three rules are on offer, and every choice between them is made here rather than inside MatsubaraQuadrature, because they are questions about the summand's SPECTRUM and only this class is told about it (through k and typical_E).
Sum or integral, and with how many nodes – one question, decided on cost alone. Size the Monien rule to reach past typical_E; if that fits max_matsubara_size, sum. If it does not, a clamped sum would no longer reach the structure it was sized for, so integrate instead. The error that switch commits is then bounded by a budget the user sets, rather than by a constant claiming the thermal content has died away – a claim that was wrong by nine orders for a 4D-regulated summand, which has no pole for the 4 exp(-E/T) law to apply to (Part 13 of the convergence study: 3.1e-4 measured against 1.9e-13 claimed).
What the switch still cannot see is a scale in the summand LIGHTER than typical_E: the integral discards its thermal content and nothing here knows it is there. That is the reason typical_E is worth setting, and the reason it should be the scale that matters rather than the largest one present.
- Which scale to size against. The reach must cover
typical_E with a multiplier well above one, or the rule places no nodes where the structure lives. This is not a tail multiplier a compactly supported summand could do without: sizing a rule to merely SPAN the support of a 4D-regulated kernel is wrong by 4e-5 at k/T = 30 and by 2.5e-2 at k/T = 300 (Part 13). Reach buys node density. See monien_reach.
- Exact or Gaussian, for a summand of finite extent. Purely cost: the exact sum is never less accurate than the Gaussian rule – it is the sum itself – so whichever has fewer nodes wins. The crossover is crossed during a flow (the exact sum shrinks with k while the Monien rule grows), which is why this is decided per RG step.
template<int dim, typename NT , typename KERNEL , typename ExecutionSpace >
template<typename Coordinates , typename... Args>
The host-backend body of map_dist(). Queued jobs run one after another, so the shared m_dest_device scratch is written and drained before the next job touches it.
template<int dim, typename NT , typename KERNEL , typename ExecutionSpace >
template<typename Coordinates , typename... Args>
| void DiFfRG::QuadratureIntegrator_fT< dim, NT, KERNEL, ExecutionSpace >::run_or_queue_host |
( |
NT * | dest, |
|
|
const Coordinates & | coordinates, |
|
|
const Args &... | args ) |
|
inlineprivate |
Run a host-backend map now, or queue it for flush time if a deferral scope is open. See MapCompletion::record_work. Compiled out in a CUDA-less build.
template<int dim, typename NT , typename KERNEL , typename ExecutionSpace >
Force the exact sum on (or off) regardless of the kernel's trait.
The trait is generated from the diagram algebra and is the right default, but a model that knows better – or a study that wants to price the exact sum against the Gaussian rule on the same kernel – needs to be able to say so. Forcing it ON for a kernel whose summand does NOT vanish above the cutoff silently truncates the sum.
template<int dim, typename NT , typename KERNEL , typename ExecutionSpace >
The frequency beyond which the summand is known to vanish, enabling the exact sum.
Only meaningful for a kernel whose every term carries a dR/dt insertion that confines the loop frequency (see kernel_has_finite_matsubara_extent). For a 4D regulator of extent x_extent (in q^2/k^2) the summand's support is the ball q0^2 + |q|^2 <= x_extent * k^2, so the cutoff is sqrt(x_extent) * k – the SAME number the spatial grid is already cut at, which is why the wrappers can supply it without any new configuration.
Passing zero (the default) disables the exact sum and keeps the Monien/vacuum rule.
template<int dim, typename NT , typename KERNEL , typename ExecutionSpace >
The RG scale, which is the DEFAULT frequency scale.
Called by the wrappers on every RG step. It no longer overwrites a model-supplied typical_E – it is only consulted when none was set – so a model may set typical_E once, at construction, and have it survive. Before, it could not: set_typical_E was public on every wrapper but set_k clobbered it on the next RG step, with no diagnostic.
template<int dim, typename NT , typename KERNEL , typename ExecutionSpace >
The heaviest scale the summand carries, if the model knows it. Zero means "only k".
This REPLACES k as the scale the frequency rule is built from; k is only the default for a model that never says. It sizes the Monien rule (which must reach past it), scales the vacuum rule's tangent map (which spends its nodes around it), and decides between the two.
Report the scale whose thermal content matters, not simply the largest one present: a summand carrying a scale below typical_E has its thermal content silently discarded when the rule hands over to the integral, and nothing here can know it was there.
Set it from replicated or all-reduced data only. It sizes the frequency rule, so a value derived from rank-local data on a distributed grid makes the node count differ between ranks and the result stop being reproducible across decompositions.