Last change
on this file since 1501 was
1354,
checked in by yushan, 6 years ago
|
omp dev : unify MPI_Comm type
|
File size:
743 bytes
|
Rev | Line | |
---|
[1134] | 1 | #include "ep_lib.hpp" |
---|
| 2 | #include <mpi.h> |
---|
| 3 | #include "ep_declaration.hpp" |
---|
[1354] | 4 | #include "ep_mpi.hpp" |
---|
[1134] | 5 | |
---|
| 6 | namespace ep_lib |
---|
| 7 | { |
---|
| 8 | |
---|
| 9 | |
---|
| 10 | |
---|
| 11 | int MPI_Comm_rank(MPI_Comm comm, int* rank) |
---|
| 12 | { |
---|
| 13 | |
---|
| 14 | if(comm.is_ep) |
---|
| 15 | { |
---|
| 16 | Debug("Calling EP_Comm_rank\n"); |
---|
| 17 | |
---|
| 18 | if(comm.is_intercomm) |
---|
| 19 | { |
---|
| 20 | *rank = comm.ep_comm_ptr->intercomm->size_rank_info[0].first; |
---|
| 21 | return 0; |
---|
| 22 | } |
---|
| 23 | else |
---|
| 24 | { |
---|
| 25 | *rank = comm.ep_comm_ptr->size_rank_info[0].first; |
---|
| 26 | return 0; |
---|
| 27 | } |
---|
| 28 | } |
---|
| 29 | |
---|
| 30 | |
---|
| 31 | if(comm != MPI_COMM_NULL) |
---|
| 32 | { |
---|
[1354] | 33 | ::MPI_Comm mpi_comm = to_mpi_comm(comm.mpi_comm); |
---|
[1134] | 34 | ::MPI_Comm_rank(mpi_comm, rank); |
---|
| 35 | return 0; |
---|
| 36 | } |
---|
| 37 | else |
---|
| 38 | { |
---|
| 39 | printf("rank is undefined\n"); |
---|
| 40 | |
---|
| 41 | *rank = MPI_UNDEFINED; |
---|
| 42 | return 0; |
---|
| 43 | } |
---|
| 44 | |
---|
| 45 | } |
---|
| 46 | |
---|
| 47 | |
---|
| 48 | |
---|
| 49 | } |
---|
| 50 | |
---|
| 51 | |
---|
Note: See
TracBrowser
for help on using the repository browser.