ESyS-Particle  4.0.1
RankAndComm.h
00001 
00002 //                                                         //
00003 // Copyright (c) 2003-2011 by The University of Queensland //
00004 // Earth Systems Science Computational Centre (ESSCC)      //
00005 // http://www.uq.edu.au/esscc                              //
00006 //                                                         //
00007 // Primary Business: Brisbane, Queensland, Australia       //
00008 // Licensed under the Open Software License version 3.0    //
00009 // http://www.opensource.org/licenses/osl-3.0.php          //
00010 //                                                         //
00012 
00013 #ifndef __RANKANDCOMM_H
00014 #define __RANKANDCOMM_H
00015 
00016 //--- MPI includes ---
00017 #include <mpi.h>
00018 
00019 class MpiRankAndComm
00020 {
00021 public:
00022   MpiRankAndComm(int globalRank, MPI_Comm globalComm)
00023     : m_globalRank(globalRank),
00024       m_globalComm(globalComm)
00025   {
00026   }
00027 
00028   int getRank() const
00029   {
00030     return m_globalRank;
00031   }
00032 
00033   MPI_Comm getComm() const
00034   {
00035     return m_globalComm;
00036   }
00037 
00038 private:
00039   int      m_globalRank;
00040   MPI_Comm m_globalComm;
00041 };
00042 
00043 #endif // __RANKANDCOMM_H