Last change
on this file was
1646,
checked in by yushan, 6 years ago
|
branch merged with trunk @1645. arch file (ep&mpi) added for ADA
|
File size:
948 bytes
|
Line | |
---|
1 | #ifdef _usingEP |
---|
2 | #include "ep_lib.hpp" |
---|
3 | #include <mpi.h> |
---|
4 | #include "ep_declaration.hpp" |
---|
5 | #include "ep_mpi.hpp" |
---|
6 | |
---|
7 | using namespace std; |
---|
8 | |
---|
9 | namespace ep_lib |
---|
10 | { |
---|
11 | |
---|
12 | int MPI_Compare_and_swap(const void *origin_addr, const void *compare_addr, void *result_addr, MPI_Datatype datatype, int target_rank, MPI_Aint target_disp, MPI_Win win) |
---|
13 | { |
---|
14 | int target_mpi_rank = win->comm->ep_rank_map->at(target_rank).second; |
---|
15 | int target_local_rank = win->comm->ep_rank_map->at(target_rank).first; |
---|
16 | int num_ep = win->comm->ep_comm_ptr->size_rank_info[1].second; |
---|
17 | if(num_ep==1) |
---|
18 | return ::MPI_Compare_and_swap(origin_addr, compare_addr, result_addr, to_mpi_type(datatype), target_mpi_rank, to_mpi_aint(target_disp), to_mpi_win(win->server_win[target_local_rank])); |
---|
19 | |
---|
20 | else |
---|
21 | return ::MPI_Compare_and_swap(origin_addr, compare_addr, result_addr, to_mpi_type(datatype), target_mpi_rank, to_mpi_aint(target_disp), to_mpi_win(win->client_win)); |
---|
22 | } |
---|
23 | |
---|
24 | } |
---|
25 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.