The LibMeshInit
class, when constructed, initializes the dependent libraries (e.g.
更多...
#include <libmesh.h>
Public 成员函数 | |
LibMeshInit (int argc, const char *const *argv, MPI_Comm COMM_WORLD_IN=MPI_COMM_WORLD, int n_threads=-1) | |
Initialize the library for use, with the command line options provided. 更多... | |
LibMeshInit (int argc, const char *const *argv, int COMM_WORLD_IN=0, int n_threads=-1) | |
virtual | ~LibMeshInit () |
Destructor. 更多... | |
const Parallel::Communicator & | comm () const |
Returns a Communicator created from the TIMPIInit object we hold, which will be a compatibility shim if MPI is not enabled. 更多... | |
Parallel::Communicator & | comm () |
Private 属性 | |
TIMPI::TIMPIInit * | _timpi_init |
Parallel::Communicator * | _comm |
vtkMPIController * | _vtk_mpi_controller |
The LibMeshInit
class, when constructed, initializes the dependent libraries (e.g.
MPI or PETSC) and does the command line parsing needed by libMesh. The LibMeshInit destructor closes those libraries properly.
For most users, a single LibMeshInit object should be created at the start of your main() function.
All libMesh functionality should be used only when a LibMeshInit object exists. Dependent library functionality, likewise, except in codes which manually initialize those libraries before LibMeshInit creation and finalize them after LibMeshInit destruction.
Since "it is best not to perform much more than a return rc after calling MPI_Finalize", applications which want to do anything after LibMeshInit destruction should manage MPI initialization and finalization manually.
libMesh::LibMeshInit::LibMeshInit | ( | int | argc, |
const char *const * | argv, | ||
MPI_Comm | COMM_WORLD_IN = MPI_COMM_WORLD , |
||
int | n_threads = -1 |
||
) |
Initialize the library for use, with the command line options provided.
This will e.g. call MPI_Init if MPI is available and enabled and has not already been initialized; similar initialization may take place for Petsc, Slepc, multithreading support, libMesh Singleton objects, the libMesh::out/err IO streams, and any libMesh handlers for floating-point exceptions, signals, and/or C++ aborts.
You must create a LibMeshInit object before using any of the library functionality. This method may take an optional parameter to use a user-specified MPI communicator.
libMesh::LibMeshInit::LibMeshInit | ( | int | argc, |
const char *const * | argv, | ||
int | COMM_WORLD_IN = 0 , |
||
int | n_threads = -1 |
||
) |
|
virtual |
Destructor.
Cleans up libMesh Singleton objects, and thread manager if threading is in use. Prints reference count and performance logging information if enabled. Restores pre-LibMeshInit terminate handler and floating-point-exception handling. Finalizes any of Slepc, Petsc, and MPI which were initialized by LibMeshInit.
参考 _comm, libMesh::libMeshPrivateData::_is_initialized, _timpi_init, _vtk_mpi_controller, libMesh::Singleton::cleanup(), libMesh::closed(), comm(), libMesh::enableFPE(), libMesh::err, libMesh::ReferenceCounter::n_objects(), libMesh::old_terminate_handler, libMesh::on_command_line(), libMesh::out, libMesh::perflog , 以及 libMesh::ReferenceCounter::print_info().
|
inline |
Returns a Communicator created from the TIMPIInit object we hold, which will be a compatibility shim if MPI is not enabled.
参考 _comm.
参考自 ~LibMeshInit().
|
inline |
参考 _comm.
|
private |
参考自 comm() , 以及 ~LibMeshInit().
|
private |
参考自 ~LibMeshInit().
|
private |
参考自 ~LibMeshInit().