TECA
The Toolkit for Extreme Climate Analysis
teca_mpi_manager.h
1 #ifndef teca_mpi_manager_h
2 #define teca_mpi_manager_h
3 
4 #include "teca_config.h"
5 
6 /// A RAII class to ease MPI initalization and finalization
7 // MPI_Init is handled in the constructor, MPI_Finalize is handled in the
8 // destructor. Given that this is an application level helper rank and size
9 // are reported relative to MPI_COMM_WORLD.
11 {
12 public:
13  teca_mpi_manager() = delete;
14  teca_mpi_manager(const teca_mpi_manager &) = delete;
15  void operator=(const teca_mpi_manager &) = delete;
16 
17  teca_mpi_manager(int &argc, char **&argv);
19 
20  int get_comm_rank(){ return m_rank; }
21  int get_comm_size(){ return m_size; }
22 
23 private:
24  int m_rank;
25  int m_size;
26 };
27 
28 #endif
teca_mpi_manager
A RAII class to ease MPI initalization and finalization.
Definition: teca_mpi_manager.h:10
teca_error::TECA_EXPORT
p_teca_error_handler error_handler TECA_EXPORT
The global error handler instance.