source:
XIOS/dev/branch_openmp/extern/ep_dev/ep_rank.cpp
@
1511
Last change on this file since 1511 was 1500, checked in by yushan, 6 years ago | |
---|---|
File size: 748 bytes |
Rev | Line | |
---|---|---|
[1381] | 1 | #include "ep_lib.hpp" |
2 | #include <mpi.h> | |
3 | #include "ep_declaration.hpp" | |
4 | #include "ep_mpi.hpp" | |
5 | ||
6 | namespace ep_lib | |
7 | { | |
8 | ||
9 | ||
10 | ||
11 | int MPI_Comm_rank(MPI_Comm comm, int* rank) | |
12 | { | |
13 | ||
[1500] | 14 | if(comm->is_ep) |
[1381] | 15 | { |
16 | Debug("Calling EP_Comm_rank\n"); | |
17 | ||
[1500] | 18 | if(comm->is_intercomm) |
[1381] | 19 | { |
[1500] | 20 | *rank = comm->ep_comm_ptr->intercomm->size_rank_info[0].first; |
[1381] | 21 | return 0; |
22 | } | |
23 | else | |
24 | { | |
[1500] | 25 | *rank = comm->ep_comm_ptr->size_rank_info[0].first; |
[1381] | 26 | return 0; |
27 | } | |
28 | } | |
29 | ||
30 | ||
31 | if(comm != MPI_COMM_NULL) | |
32 | { | |
[1500] | 33 | ::MPI_Comm mpi_comm = to_mpi_comm(comm->mpi_comm); |
[1381] | 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.