QuadratureProvider Class Reference#

DiFfRG: DiFfRG::QuadratureProvider Class Reference
DiFfRG
Discretization Framework for functional Renormalization Group flows

A class that provides quadrature points and weights, in host and device memory. The quadrature points and weights are computed either the GSL quadratures or the MatsubaraQuadrature class. This avoids recomputing the quadrature points and weights for each integrator. More...

#include <quadrature_provider.hh>

Public Member Functions

 QuadratureProvider ()
 
 QuadratureProvider (const ConfigTree &config)
 Construct a provider that reports the quadratures it builds.
 
 QuadratureProvider (const ConfigTree &config, ReportPort log)
 
template<typename NT = double, typename MemorySpace = CPU_memory>
auto nodes (const size_t order, const QuadratureType type=QuadratureType::legendre)
 Get the quadrature points for a quadrature of size quadrature_size.
 
template<typename NT = double, typename MemorySpace = CPU_memory>
auto weights (const size_t order, const QuadratureType type=QuadratureType::legendre)
 Get the quadrature weights for a quadrature of size quadrature_size.
 
template<typename NT = double, typename MemorySpace = CPU_memory>
auto matsubara_nodes (const NT T, const NT typical_E)
 Get the quadrature points for a quadrature of size quadrature_size.
 
template<typename NT = double, typename MemorySpace = CPU_memory>
auto matsubara_weights (const NT T, const NT typical_E)
 Get the quadrature weights for a quadrature of size quadrature_size.
 
template<typename NT = double>
const MatsubaraQuadrature< NT > & matsubara_rule (const NT T, const NT typical_E)
 The Matsubara rule itself, for callers that need more than nodes and weights – its size, or the zero-mode-inclusive node list of sum_nodes(). The reference is into a node-based map and stays valid for the lifetime of the provider.
 
int max_matsubara_size () const
 The node ceiling /integration/max_matsubara_size, i.e. the budget the rule choice is made against.
 
template<typename NT = double>
int matsubara_predicted_size (const NT T, const NT typical_E) const
 Nodes the Monien rule would want at (T, typical_E). See MatsubaraStorage::predicted_size.
 
template<typename NT = double>
const MatsubaraQuadrature< NT > & matsubara_exact_sum (const NT T, const NT freq_cutoff)
 The exact Matsubara sum for a summand that vanishes above freq_cutoff. See MatsubaraQuadrature::reinit_exact_sum.
 
template<typename NT = double>
const MatsubaraQuadrature< NT > & matsubara_finite_interval (const NT cutoff, const size_t order)
 Gauss-Legendre over the finite frequency interval a compactly supported summand lives on, at the given order. See MatsubaraQuadrature::reinit_finite_interval.
 
template<typename ExecutionSpace >
ExecutionSpace next_execution_space ()
 Hand out one of a small pool of execution space instances, round robin.
 

Private Member Functions

void initialize (const ConfigTree &config, ReportPort log)
 

Private Attributes

std::optional< RunReporter > own_logger
 
internal::MatsubaraStorage matsubara_storage
 
internal::QuadratureStorage quadrature_storage
 
int verbosity
 

Detailed Description

A class that provides quadrature points and weights, in host and device memory. The quadrature points and weights are computed either the GSL quadratures or the MatsubaraQuadrature class. This avoids recomputing the quadrature points and weights for each integrator.

Constructor & Destructor Documentation

◆ QuadratureProvider() [1/3]

DiFfRG::QuadratureProvider::QuadratureProvider ( )

◆ QuadratureProvider() [2/3]

DiFfRG::QuadratureProvider::QuadratureProvider ( const ConfigTree & config)
explicit

Construct a provider that reports the quadratures it builds.

The standalone overload reports into the run log, <output folder>/<output name>.log, under the "quadrature" tag when /output/folder is present. It owns that reporter rather than borrow one from an OutputSession, because integrators request their quadratures inside their constructors – typically before any session exists; the file sink is shared process-wide per path, so the session opening the same file later appends to the quadrature inventory instead of truncating it. The inventory never echoes to the console, where it would drown the timestepper progress report. Passing a port joins an existing run reporter.

◆ QuadratureProvider() [3/3]

DiFfRG::QuadratureProvider::QuadratureProvider ( const ConfigTree & config,
ReportPort log )

Member Function Documentation

◆ initialize()

void DiFfRG::QuadratureProvider::initialize ( const ConfigTree & config,
ReportPort log )
private

◆ matsubara_exact_sum()

template<typename NT = double>
const MatsubaraQuadrature< NT > & DiFfRG::QuadratureProvider::matsubara_exact_sum ( const NT T,
const NT freq_cutoff )
inline

The exact Matsubara sum for a summand that vanishes above freq_cutoff. See MatsubaraQuadrature::reinit_exact_sum.

◆ matsubara_finite_interval()

template<typename NT = double>
const MatsubaraQuadrature< NT > & DiFfRG::QuadratureProvider::matsubara_finite_interval ( const NT cutoff,
const size_t order )
inline

Gauss-Legendre over the finite frequency interval a compactly supported summand lives on, at the given order. See MatsubaraQuadrature::reinit_finite_interval.

◆ matsubara_nodes()

template<typename NT = double, typename MemorySpace = CPU_memory>
auto DiFfRG::QuadratureProvider::matsubara_nodes ( const NT T,
const NT typical_E )
inline

Get the quadrature points for a quadrature of size quadrature_size.

Parameters
quadrature_sizeSize of the quadrature.
Returns
const std::vector<double>&

◆ matsubara_predicted_size()

template<typename NT = double>
int DiFfRG::QuadratureProvider::matsubara_predicted_size ( const NT T,
const NT typical_E ) const
inline

Nodes the Monien rule would want at (T, typical_E). See MatsubaraStorage::predicted_size.

◆ matsubara_rule()

template<typename NT = double>
const MatsubaraQuadrature< NT > & DiFfRG::QuadratureProvider::matsubara_rule ( const NT T,
const NT typical_E )
inline

The Matsubara rule itself, for callers that need more than nodes and weights – its size, or the zero-mode-inclusive node list of sum_nodes(). The reference is into a node-based map and stays valid for the lifetime of the provider.

◆ matsubara_weights()

template<typename NT = double, typename MemorySpace = CPU_memory>
auto DiFfRG::QuadratureProvider::matsubara_weights ( const NT T,
const NT typical_E )
inline

Get the quadrature weights for a quadrature of size quadrature_size.

Parameters
quadrature_sizeSize of the quadrature.
Returns
const std::vector<double>&

◆ max_matsubara_size()

int DiFfRG::QuadratureProvider::max_matsubara_size ( ) const
inline

The node ceiling /integration/max_matsubara_size, i.e. the budget the rule choice is made against.

◆ next_execution_space()

template<typename ExecutionSpace >
ExecutionSpace DiFfRG::QuadratureProvider::next_execution_space ( )
inline

Hand out one of a small pool of execution space instances, round robin.

Every integrator used to default-construct its ExecutionSpace, i.e. they all shared the default stream and no two flows could ever execute concurrently – even the ones that are mutually independent (the vertex flows of a typical RHS read the same dressings and write disjoint outputs). Handing neighbouring integrators different instances lets those overlap, which matters most for the many small launches that individually leave the device underutilised.

Safe to mix with the interpolators' uploads, which fence on the host before returning, so any kernel issued afterwards on any stream already sees the new data.

The pool is created lazily and shared by every integrator holding this provider. Host execution spaces have no streams to speak of, so they get a default-constructed instance.

◆ nodes()

template<typename NT = double, typename MemorySpace = CPU_memory>
auto DiFfRG::QuadratureProvider::nodes ( const size_t order,
const QuadratureType type = QuadratureType::legendre )
inline

Get the quadrature points for a quadrature of size quadrature_size.

Parameters
quadrature_sizeSize of the quadrature.
Returns
const std::vector<double>&

◆ weights()

template<typename NT = double, typename MemorySpace = CPU_memory>
auto DiFfRG::QuadratureProvider::weights ( const size_t order,
const QuadratureType type = QuadratureType::legendre )
inline

Get the quadrature weights for a quadrature of size quadrature_size.

Parameters
quadrature_sizeSize of the quadrature.
Returns
const std::vector<double>&

Member Data Documentation

◆ matsubara_storage

internal::MatsubaraStorage DiFfRG::QuadratureProvider::matsubara_storage
private

◆ own_logger

std::optional<RunReporter> DiFfRG::QuadratureProvider::own_logger
private

◆ quadrature_storage

internal::QuadratureStorage DiFfRG::QuadratureProvider::quadrature_storage
private

◆ verbosity

int DiFfRG::QuadratureProvider::verbosity
private

The documentation for this class was generated from the following file:
  • /home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/common/quadrature/quadrature_provider.hh