MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
mfem::Hypre Class Reference

A simple singleton class for hypre's global settings, that 1) calls HYPRE_Init() and sets some GPU-relevant options at construction and 2) calls HYPRE_Finalize() at destruction. More...

#include <hypre.hpp>

Static Public Member Functions

static void Init ()
 Initialize hypre by calling HYPRE_Init() and set default options. After calling Hypre::Init(), hypre will be finalized automatically at program exit.
 
static void InitDevice ()
 Configure HYPRE's compute and memory policy.
 
static void Finalize ()
 Finalize hypre (called automatically at program exit if Hypre::Init() has been called).
 

Static Public Attributes

static bool configure_runtime_policy_from_mfem = true
 Use MFEM's device policy to configure HYPRE's device policy, true by default. This variable is used by InitDevice().
 

Detailed Description

A simple singleton class for hypre's global settings, that 1) calls HYPRE_Init() and sets some GPU-relevant options at construction and 2) calls HYPRE_Finalize() at destruction.

Definition at line 66 of file hypre.hpp.

Member Function Documentation

◆ Finalize()

void mfem::Hypre::Finalize ( )
static

Finalize hypre (called automatically at program exit if Hypre::Init() has been called).

Multiple calls to Hypre::Finalize() have no effect. This function can be called manually to more precisely control when hypre is finalized.

Definition at line 66 of file hypre.cpp.

◆ Init()

static void mfem::Hypre::Init ( )
inlinestatic

Initialize hypre by calling HYPRE_Init() and set default options. After calling Hypre::Init(), hypre will be finalized automatically at program exit.

Calling HYPRE_Finalize() manually is not compatible with this class.

Definition at line 74 of file hypre.hpp.

◆ InitDevice()

void mfem::Hypre::InitDevice ( )
static

Configure HYPRE's compute and memory policy.

By default HYPRE will be configured with the same policy as MFEM unless Hypre::configure_runtime_policy_from_mfem is false, in which case HYPRE's default will be used; if HYPRE is built for the GPU and the aforementioned variable is false then HYPRE will use the GPU even if MFEM is not.

This function is no-op if HYPRE is built without GPU support or the HYPRE version is less than 2.31.0.

This function is NOT called by Init(). Instead it is called by Device::Configure() (when MFEM_USE_MPI=YES) after the MFEM device configuration is complete.

Definition at line 43 of file hypre.cpp.

Member Data Documentation

◆ configure_runtime_policy_from_mfem

bool mfem::Hypre::configure_runtime_policy_from_mfem = true
static

Use MFEM's device policy to configure HYPRE's device policy, true by default. This variable is used by InitDevice().

This value is not used if HYPRE is build without GPU support or the HYPRE version is less than 2.31.0.

Definition at line 104 of file hypre.hpp.


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