ParGeMSLR
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
pargemslr::ParallelLogClass Class Reference

The data structure for parallel computing, including data structures for MPI and CUDA. More...

#include <parallel.hpp>

Public Member Functions

int Clear ()
 Free the parallel_log. More...
 
 ParallelLogClass ()
 The default constructor of parallel_log. More...
 
 ParallelLogClass (const ParallelLogClass &parlog)
 The copy constructor of parallel_log. More...
 
 ParallelLogClass (ParallelLogClass &&parlog)
 The = operator of parallel_log. More...
 
ParallelLogClassoperator= (const ParallelLogClass &parlog)
 The = operator of parallel_log. More...
 
ParallelLogClassoperator= (ParallelLogClass &&parlog)
 The = operator of parallel_log. More...
 
 ParallelLogClass (MPI_Comm comm_in)
 The constructor of parallel_log, setup a new local comm. More...
 
 ~ParallelLogClass ()
 The destructor of parallel_log. More...
 
int GetMpiInfo (int &np, int &myid, MPI_Comm &comm) const
 Get comm, np, and myid. When _comm is NULL, get the global one, otherwise get the local one. More...
 
MPI_Comm GetComm () const
 Get the MPI_comm. When _comm is NULL, get the global one, otherwise get the local one. More...
 

Public Attributes

int _size
 The total number of local MPI ranks. More...
 
int _rank
 The number of local MPI rank. More...
 
MPI_Comm _commref
 The MPI comm that doesn't need to be freed. More...
 
MPI_Comm * _comm
 The local MPI comm. More...
 

Static Public Attributes

static int _working_location
 The working location of the code (device/host). More...
 
static int _gsize
 The total number of global MPI ranks. More...
 
static int _grank
 The number of global MPI rank. More...
 
static MPI_Comm * _gcomm
 The global MPI comm. More...
 
static MPI_Comm * _lcomm
 The local MPI comm (one np only, for consistancy). More...
 
static vector< double > _times
 The std::vector stores the timing information. More...
 
static vector< double > _times_buffer_start
 The std::vector stores the start time of each section. More...
 
static vector< double > _times_buffer_end
 The std::vector stores the end time of each section. More...
 

Detailed Description

The data structure for parallel computing, including data structures for MPI and CUDA.
All CUDA information are shared, local MPI information can be different.

Constructor & Destructor Documentation

◆ ParallelLogClass() [1/4]

pargemslr::ParallelLogClass::ParallelLogClass ( )

The default constructor of parallel_log.

◆ ParallelLogClass() [2/4]

pargemslr::ParallelLogClass::ParallelLogClass ( const ParallelLogClass parlog)

The copy constructor of parallel_log.

◆ ParallelLogClass() [3/4]

pargemslr::ParallelLogClass::ParallelLogClass ( ParallelLogClass &&  parlog)

The = operator of parallel_log.

Parameters
[in]parlogThe ParallelLogClass.

◆ ParallelLogClass() [4/4]

pargemslr::ParallelLogClass::ParallelLogClass ( MPI_Comm  comm_in)

The constructor of parallel_log, setup a new local comm.

Parameters
[in]comm_inThe new comm.

◆ ~ParallelLogClass()

pargemslr::ParallelLogClass::~ParallelLogClass ( )

The destructor of parallel_log.

Member Function Documentation

◆ Clear()

int pargemslr::ParallelLogClass::Clear ( )

Free the parallel_log.

◆ GetComm()

MPI_Comm pargemslr::ParallelLogClass::GetComm ( ) const

Get the MPI_comm. When _comm is NULL, get the global one, otherwise get the local one.

Returns
Return the MPI_comm.

◆ GetMpiInfo()

int pargemslr::ParallelLogClass::GetMpiInfo ( int &  np,
int &  myid,
MPI_Comm &  comm 
) const

Get comm, np, and myid. When _comm is NULL, get the global one, otherwise get the local one.

Parameters
[in]npThe number of processors.
[in]myidThe local MPI rank number.
[in]commThe MPI_Comm.
Returns
Return error message.

◆ operator=() [1/2]

ParallelLogClass& pargemslr::ParallelLogClass::operator= ( const ParallelLogClass parlog)

The = operator of parallel_log.

Parameters
[in]parlogThe ParallelLogClass.
Returns
Return the ParallelLogClass.

◆ operator=() [2/2]

ParallelLogClass& pargemslr::ParallelLogClass::operator= ( ParallelLogClass &&  parlog)

The = operator of parallel_log.

Parameters
[in]parlogThe ParallelLogClass.
Returns
Return the ParallelLogClass.

Member Data Documentation

◆ _comm

MPI_Comm* pargemslr::ParallelLogClass::_comm

The local MPI comm.

◆ _commref

MPI_Comm pargemslr::ParallelLogClass::_commref

The MPI comm that doesn't need to be freed.

◆ _gcomm

MPI_Comm* pargemslr::ParallelLogClass::_gcomm
static

The global MPI comm.

◆ _grank

int pargemslr::ParallelLogClass::_grank
static

The number of global MPI rank.

◆ _gsize

int pargemslr::ParallelLogClass::_gsize
static

The total number of global MPI ranks.

◆ _lcomm

MPI_Comm* pargemslr::ParallelLogClass::_lcomm
static

The local MPI comm (one np only, for consistancy).

◆ _rank

int pargemslr::ParallelLogClass::_rank

The number of local MPI rank.

◆ _size

int pargemslr::ParallelLogClass::_size

The total number of local MPI ranks.

◆ _times

vector<double> pargemslr::ParallelLogClass::_times
static

The std::vector stores the timing information.

◆ _times_buffer_end

vector<double> pargemslr::ParallelLogClass::_times_buffer_end
static

The std::vector stores the end time of each section.

◆ _times_buffer_start

vector<double> pargemslr::ParallelLogClass::_times_buffer_start
static

The std::vector stores the start time of each section.

◆ _working_location

int pargemslr::ParallelLogClass::_working_location
static

The working location of the code (device/host).


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