Changeset 14290
- Timestamp:
- 01/25/13 16:11:11 (12 years ago)
- Location:
- issm/trunk-jpl/src/c/classes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/IssmComm.cpp
r14287 r14290 13 13 14 14 void IssmComm::SetComm(COMM incomm){ /*{{{*/ 15 comm=incomm; 15 16 /*A comm is provided, we are running in parallel (this is not a module)*/ 17 parallel = true; 18 comm = incomm; 19 20 }/*}}}*/ 21 void IssmComm::SetComm(void){ /*{{{*/ 22 23 /*no comm provided, This is a matlab/python module*/ 24 parallel = true; 25 comm = incomm; 26 16 27 }/*}}}*/ 17 28 COMM IssmComm::GetComm(){ /*{{{*/ 29 if(!parallel) _error_("Cannot return comm in serial mode"); 18 30 return comm; 19 31 }/*}}}*/ 20 32 int IssmComm::GetRank(){ /*{{{*/ 33 21 34 int my_rank = 0; 35 36 /*for matlab and python modules*/ 37 if(!parallel) return my_rank; 22 38 23 24 39 #ifdef _HAVE_MPI_ 25 40 MPI_Comm_rank(comm,&my_rank); 26 #else27 /*for matlab and python modules, comm == -1*/28 if((int)comm==-1) return my_rank;29 41 #endif 30 42 … … 36 48 int size = 1; 37 49 50 /*for matlab and python modules*/ 51 if(!parallel) return size; 52 38 53 #ifdef _HAVE_MPI_ 39 54 MPI_Comm_size(comm,&size); -
issm/trunk-jpl/src/c/classes/IssmComm.h
r13589 r14290 21 21 private: 22 22 static COMM comm; 23 static bool parallel; 23 24 24 25 public: 25 26 static void SetComm(COMM incomm); 26 static COMM GetComm(); 27 static int GetRank(); 28 static int GetSize(); 27 static void SetComm(void); 28 static COMM GetComm(void); 29 static int GetRank(void); 30 static int GetSize(void); 29 31 }; 30 32
Note:
See TracChangeset
for help on using the changeset viewer.