Advanced Multi-Physics (AMP)
On-Line Documentation
Static Public Member Functions | Private Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
AMP::AMPManager Class Reference

Class AMPManager is a utility for managing startup and shutdown for AMP applications and for changing the maximum number of patch data components supported by AMP patches. All applications should call AMPManager::startup() at the beginning of the program. Startup will initialize all packages including MPI. AMPManager::shutdown() should be called at the end of the program, before calling exit(0). Note that the shutdown, but it shuts down the packages, MPI, and deallocates memory. More...

#include <AMPManager.h>

Static Public Member Functions

static void clearHandlers ()
 Clearthe default signal/terminate handlers (called on shutdown)
 
static void clearMPIErrorHandler ()
 Destroy the mpi error handler.
 
static void decrementResource (const std::string &resource)
 Decrement a resource counter.
 
static std::tuple< int, const char *const * > get_args ()
 
static AMPManagerProperties getAMPManagerProperties ()
 Function to return the AMPManagerProperties that was used to initialize AMP.
 
static const AMP::AMP_MPIgetCommWorld ()
 Get the global comm.
 
static void incrementResource (const std::string &resource)
 Increment a resource counter.
 
static std::string info ()
 Return detailed revision information.
 
static bool isFinalized ()
 Function to check if AMP has been finalized.
 
static bool isInitialized ()
 Function to check if AMP has been initialized.
 
static void registerShutdown (std::function< void()>)
 Register a function to perform cleanup at AMP::AMPManager::shutdown.
 
static void restart ()
 Restart as much of AMP as possible restoring it to a like new state.
 
static std::array< int, 3 > revision ()
 AMP version number.
 
static void setCommWorld (const AMP::AMP_MPI &)
 Set the global comm.
 
static void setHandlers ()
 Set the default signal/terminate handlers (called on startup)
 
static void setMPIErrorHandler ()
 Initialize the mpi error handler.
 
static void shutdown ()
 
static void startup (int &argc, char *argv[], const AMPManagerProperties &properties=AMPManagerProperties())
 
static void terminate_AMP (std::string message)
 Static function to terminate AMP.
 

Private Member Functions

 AMPManager ()=delete
 

Static Private Member Functions

static double bindDevices ()
 
static void clear_PETSc_error_handler ()
 
static void exitFun ()
 
static double initDevices ()
 
static void restart_SAMRAI ()
 
static void set_PETSc_error_handler ()
 
static double start_HYPRE ()
 
static double start_OpenMP ()
 
static double start_PETSc ()
 
static double start_SAMRAI ()
 
static double stop_HYPRE ()
 
static double stop_PETSc ()
 
static double stop_SAMRAI ()
 

Static Private Attributes

static int d_argc
 
static const char *const * d_argv
 
static std::vector< std::function< void()> > d_atShutdown
 
static int d_initialized
 
static AMPManagerProperties d_properties
 

Detailed Description

Class AMPManager is a utility for managing startup and shutdown for AMP applications and for changing the maximum number of patch data components supported by AMP patches. All applications should call AMPManager::startup() at the beginning of the program. Startup will initialize all packages including MPI. AMPManager::shutdown() should be called at the end of the program, before calling exit(0). Note that the shutdown, but it shuts down the packages, MPI, and deallocates memory.

Definition at line 131 of file AMPManager.h.

Constructor & Destructor Documentation

◆ AMPManager()

AMP::AMPManager::AMPManager ( )
privatedelete

Member Function Documentation

◆ bindDevices()

static double AMP::AMPManager::bindDevices ( )
staticprivate

◆ clear_PETSc_error_handler()

static void AMP::AMPManager::clear_PETSc_error_handler ( )
staticprivate

◆ clearHandlers()

static void AMP::AMPManager::clearHandlers ( )
static

Clearthe default signal/terminate handlers (called on shutdown)

◆ clearMPIErrorHandler()

static void AMP::AMPManager::clearMPIErrorHandler ( )
static

Destroy the mpi error handler.

◆ decrementResource()

static void AMP::AMPManager::decrementResource ( const std::string &  resource)
static

Decrement a resource counter.

◆ exitFun()

static void AMP::AMPManager::exitFun ( )
staticprivate

◆ get_args()

static std::tuple< int, const char *const * > AMP::AMPManager::get_args ( )
static

Return a reference to the original command line arguments that were used to initialize AMP.

◆ getAMPManagerProperties()

static AMPManagerProperties AMP::AMPManager::getAMPManagerProperties ( )
static

Function to return the AMPManagerProperties that was used to initialize AMP.

◆ getCommWorld()

static const AMP::AMP_MPI & AMP::AMPManager::getCommWorld ( )
static

Get the global comm.

◆ incrementResource()

static void AMP::AMPManager::incrementResource ( const std::string &  resource)
static

Increment a resource counter.

◆ info()

static std::string AMP::AMPManager::info ( )
static

Return detailed revision information.

◆ initDevices()

static double AMP::AMPManager::initDevices ( )
staticprivate

◆ isFinalized()

static bool AMP::AMPManager::isFinalized ( )
static

Function to check if AMP has been finalized.

◆ isInitialized()

static bool AMP::AMPManager::isInitialized ( )
static

Function to check if AMP has been initialized.

◆ registerShutdown()

static void AMP::AMPManager::registerShutdown ( std::function< void()>  )
static

Register a function to perform cleanup at AMP::AMPManager::shutdown.

◆ restart()

static void AMP::AMPManager::restart ( )
static

Restart as much of AMP as possible restoring it to a like new state.

◆ restart_SAMRAI()

static void AMP::AMPManager::restart_SAMRAI ( )
staticprivate

◆ revision()

static std::array< int, 3 > AMP::AMPManager::revision ( )
static

AMP version number.

This function returns the current version of AMP Note that a value of {0,0,xxx} will be returned for the development version. The build number is the revision number based on the commits in the development version. Note: when comparing versions, only the last number needs to be compared.

Returns
Returns array containing the {major,minor,build} version

◆ set_PETSc_error_handler()

static void AMP::AMPManager::set_PETSc_error_handler ( )
staticprivate

◆ setCommWorld()

static void AMP::AMPManager::setCommWorld ( const AMP::AMP_MPI )
static

Set the global comm.

◆ setHandlers()

static void AMP::AMPManager::setHandlers ( )
static

Set the default signal/terminate handlers (called on startup)

◆ setMPIErrorHandler()

static void AMP::AMPManager::setMPIErrorHandler ( )
static

Initialize the mpi error handler.

◆ shutdown()

static void AMP::AMPManager::shutdown ( )
static

Shutdown the AMP package. Depending on the compile flags set at compile-time, this routine shuts down MPI and calls registered shutdown handlers.

◆ start_HYPRE()

static double AMP::AMPManager::start_HYPRE ( )
staticprivate

◆ start_OpenMP()

static double AMP::AMPManager::start_OpenMP ( )
staticprivate

◆ start_PETSc()

static double AMP::AMPManager::start_PETSc ( )
staticprivate

◆ start_SAMRAI()

static double AMP::AMPManager::start_SAMRAI ( )
staticprivate

◆ startup()

static void AMP::AMPManager::startup ( int &  argc,
char *  argv[],
const AMPManagerProperties properties = AMPManagerProperties() 
)
static

Initialize the AMP package. Depending on the architecture and compile flags, this routine sets up MPI, initializes IEEE exception handlers, and other architecture-specific details.

◆ stop_HYPRE()

static double AMP::AMPManager::stop_HYPRE ( )
staticprivate

◆ stop_PETSc()

static double AMP::AMPManager::stop_PETSc ( )
staticprivate

◆ stop_SAMRAI()

static double AMP::AMPManager::stop_SAMRAI ( )
staticprivate

◆ terminate_AMP()

static void AMP::AMPManager::terminate_AMP ( std::string  message)
static

Static function to terminate AMP.

Member Data Documentation

◆ d_argc

int AMP::AMPManager::d_argc
staticprivate

Definition at line 216 of file AMPManager.h.

◆ d_argv

const char* const* AMP::AMPManager::d_argv
staticprivate

Definition at line 217 of file AMPManager.h.

◆ d_atShutdown

std::vector<std::function<void()> > AMP::AMPManager::d_atShutdown
staticprivate

Definition at line 219 of file AMPManager.h.

◆ d_initialized

int AMP::AMPManager::d_initialized
staticprivate

Definition at line 215 of file AMPManager.h.

◆ d_properties

AMPManagerProperties AMP::AMPManager::d_properties
staticprivate

Definition at line 218 of file AMPManager.h.


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



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:41.
Comments on this page