source: issm/trunk/src/c/classes/IssmComm.cpp@ 13975

Last change on this file since 13975 was 13975, checked in by Mathieu Morlighem, 12 years ago

merged trunk-jpl and trunk for revision 13974

File size: 824 bytes
Line 
1/*! \file IssmComm.cpp
2 * \brief file containing the methods for IssmComm.h
3 */
4
5#ifdef HAVE_CONFIG_H
6 #include <config.h>
7#else
8#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
9#endif
10
11#include "./IssmComm.h"
12#include "../include/types.h"
13
14void IssmComm::SetComm(COMM incomm){ /*{{{*/
15 comm=incomm;
16}/*}}}*/
17COMM IssmComm::GetComm(){ /*{{{*/
18 return comm;
19}/*}}}*/
20int IssmComm::GetRank(){ /*{{{*/
21 int my_rank = 0;
22
23 /*for matlab and python modules, comm == -1*/
24 if((int)comm==-1) return my_rank;
25
26 #ifdef _HAVE_MPI_
27 MPI_Comm_rank(comm,&my_rank);
28 #endif
29
30 return my_rank;
31
32}/*}}}*/
33int IssmComm::GetSize(){ /*{{{*/
34
35 int size = 1;
36
37 /*for matlab and python modules, comm == -1*/
38 if((int)comm==-1) return size;
39
40 #ifdef _HAVE_MPI_
41 MPI_Comm_size(comm,&size);
42 #endif
43
44 return size;
45
46}/*}}}*/
Note: See TracBrowser for help on using the repository browser.