Last change
on this file since 2337 was
1503,
checked in by yushan, 6 years ago
|
rank_map is passed from vector to map, in order to have more flexibility in comm_split
|
File size:
901 bytes
|
Line | |
---|
1 | #include "ep_lib.hpp" |
---|
2 | #include <mpi.h> |
---|
3 | #include "ep_declaration.hpp" |
---|
4 | #include "ep_mpi.hpp" |
---|
5 | |
---|
6 | using namespace std; |
---|
7 | |
---|
8 | namespace ep_lib |
---|
9 | { |
---|
10 | |
---|
11 | int MPI_Fetch_and_op(const void *origin_addr, void *result_addr, MPI_Datatype datatype, int target_rank, MPI_Aint target_disp, MPI_Op op, MPI_Win win) |
---|
12 | { |
---|
13 | int target_mpi_rank = win->comm->ep_rank_map->at(target_rank).second; |
---|
14 | int target_local_rank = win->comm->ep_rank_map->at(target_rank).first; |
---|
15 | int num_ep = win->comm->ep_comm_ptr->size_rank_info[1].second; |
---|
16 | if(num_ep==1) |
---|
17 | return ::MPI_Fetch_and_op(origin_addr, result_addr, to_mpi_type(datatype), target_mpi_rank, to_mpi_aint(target_disp), to_mpi_op(op), to_mpi_win(win->server_win[target_local_rank])); |
---|
18 | |
---|
19 | else |
---|
20 | return ::MPI_Fetch_and_op(origin_addr, result_addr, to_mpi_type(datatype), target_mpi_rank, to_mpi_aint(target_disp), to_mpi_op(op), to_mpi_win(win->client_win)); |
---|
21 | } |
---|
22 | |
---|
23 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.