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
|
Rev | Line | |
---|
[13589] | 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"
|
---|
[13613] | 12 | #include "../include/types.h"
|
---|
[13589] | 13 |
|
---|
| 14 | void IssmComm::SetComm(COMM incomm){ /*{{{*/
|
---|
| 15 | comm=incomm;
|
---|
| 16 | }/*}}}*/
|
---|
| 17 | COMM IssmComm::GetComm(){ /*{{{*/
|
---|
| 18 | return comm;
|
---|
| 19 | }/*}}}*/
|
---|
| 20 | int IssmComm::GetRank(){ /*{{{*/
|
---|
[13701] | 21 | int my_rank = 0;
|
---|
| 22 |
|
---|
| 23 | /*for matlab and python modules, comm == -1*/
|
---|
| 24 | if((int)comm==-1) return my_rank;
|
---|
| 25 |
|
---|
[13589] | 26 | #ifdef _HAVE_MPI_
|
---|
[13612] | 27 | MPI_Comm_rank(comm,&my_rank);
|
---|
[13589] | 28 | #endif
|
---|
[13701] | 29 |
|
---|
[13612] | 30 | return my_rank;
|
---|
[13589] | 31 |
|
---|
| 32 | }/*}}}*/
|
---|
| 33 | int IssmComm::GetSize(){ /*{{{*/
|
---|
[13701] | 34 |
|
---|
| 35 | int size = 1;
|
---|
| 36 |
|
---|
| 37 | /*for matlab and python modules, comm == -1*/
|
---|
| 38 | if((int)comm==-1) return size;
|
---|
| 39 |
|
---|
[13589] | 40 | #ifdef _HAVE_MPI_
|
---|
| 41 | MPI_Comm_size(comm,&size);
|
---|
| 42 | #endif
|
---|
[13701] | 43 |
|
---|
[13589] | 44 | return size;
|
---|
| 45 |
|
---|
| 46 | }/*}}}*/
|
---|
Note:
See
TracBrowser
for help on using the repository browser.