DOLFIN-X
DOLFIN-X C++ interface
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
dolfinx::common::SubSystemsManager Class Reference

This is a singleton class which manages the initialisation and finalisation of various sub systems, such as MPI and PETSc. More...

#include <SubSystemsManager.h>

Public Member Functions

 SubSystemsManager (const SubSystemsManager &)=delete
 

Static Public Member Functions

static SubSystemsManagersingleton ()
 Singleton instance. Calling this ensures singleton instance of SubSystemsManager is initialized according to the "Construct on First Use" idiom.
 
static void init_mpi ()
 Initialise MPI.
 
static int init_mpi (int argc, char *argv[], int required_thread_level)
 Initialise MPI with required level of thread support.
 
static void init_logging (int argc, char *argv[])
 Initialise loguru.
 
static void init_petsc ()
 Initialize PETSc without command-line arguments.
 
static void init_petsc (int argc, char *argv[])
 Initialize PETSc with command-line arguments. Note that PETSc command-line arguments may also be filtered and sent to PETSc by parameters.parse(argc, argv).
 
static void finalize ()
 Finalize subsystems. This will be called by the destructor, but in special cases it may be necessary to call finalize() explicitly.
 
static bool responsible_mpi ()
 Return true if DOLFINX initialised MPI (and is therefore responsible for finalization)
 
static bool responsible_petsc ()
 Return true if DOLFINX initialised PETSc (and is therefore responsible for finalization)
 
static bool mpi_initialized ()
 Check if MPI has been initialised (returns true if MPI has been initialised, even if it is later finalised)
 
static bool mpi_finalized ()
 Check if MPI has been finalized (returns true if MPI has been finalised)
 
static PetscErrorCode PetscDolfinErrorHandler (MPI_Comm comm, int line, const char *fun, const char *file, PetscErrorCode n, PetscErrorType p, const char *mess, void *ctx)
 PETSc error handler. Logs everything known to DOLFINX logging system (with level TRACE) and stores the error message into pests_err_msg member.
 

Public Attributes

std::string petsc_err_msg
 Last recorded PETSc error message.
 

Detailed Description

This is a singleton class which manages the initialisation and finalisation of various sub systems, such as MPI and PETSc.


The documentation for this class was generated from the following files: