Init Class Reference#

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

Starts and owns the libraries DiFfRG runs on: MPI, PETSc, SLEPc, Zoltan, p4est and Kokkos. More...

#include <init.hh>

Public Member Functions

 Init (int argc, char *argv[], const std::string parameter_file="parameter.json")
 Start the libraries (first call only) and remember the command line.
 
 Init (const std::string parameter_file="parameter.json")
 Start the libraries without a command line.
 
const ConfigurationHelper get_configuration_helper () const
 Parse the stored command line and parameter file.
 

Static Public Member Functions

static bool is_initialized ()
 Whether an Init has already started the libraries.
 

Detailed Description

Starts and owns the libraries DiFfRG runs on: MPI, PETSc, SLEPc, Zoltan, p4est and Kokkos.

The first Init of a process does all the work; later ones only store their arguments. The libraries stay up until the process exits, and are shut down by exit handlers, not by ~Init: the Init object may be a temporary. Do not initialize MPI or Kokkos yourself.

The first construction

  • reads the parameter file and command line silently (ConfigurationHelper::probe()) for the keys below,
  • sets the CPU thread budget, see ThreadSource,
  • starts MPI and the other libraries,
  • with several MPI ranks on one node, assigns GPUs round robin: node-local rank \(r\) gets device \(r \bmod n_\text{GPU}\), and warns if two ranks end up on the same GPU,
  • starts Kokkos.

Keys read here (all optional):

  • /discretization/threads (uint, default 0 = automatic): CPU threads per rank.
  • /integration/map_quantum (double, default 0 = automatic): work-split size of the integrator map scheduler, see MapScheduler::set_quantum().
  • /integration/map_verbose (bool, default false): log every map schedule.

Constructor & Destructor Documentation

◆ Init() [1/2]

Init ( int argc,
char * argv[],
const std::string parameter_file = "parameter.json" )

Start the libraries (first call only) and remember the command line.

Parameters
argcForwarded argc from main().
argvForwarded argv from main().
parameter_fileThe default parameter file; must be the same file the application reads.

◆ Init() [2/2]

Init ( const std::string parameter_file = "parameter.json")

Start the libraries without a command line.

Parameters
parameter_fileThe default parameter file.

Member Function Documentation

◆ get_configuration_helper()

const ConfigurationHelper get_configuration_helper ( ) const

Parse the stored command line and parameter file.

Builds a new ConfigurationHelper on every call, with all its effects (e.g. --help exits).

◆ is_initialized()

static bool is_initialized ( )
static

Whether an Init has already started the libraries.


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