Last change
on this file since 1521 was
1521,
checked in by yushan, 6 years ago
|
save dev. TO DO : test with xios
|
File size:
1.5 KB
|
Rev | Line | |
---|
[1521] | 1 | #ifndef EP_COMM_HPP_INCLUDED |
---|
| 2 | #define EP_COMM_HPP_INCLUDED |
---|
| 3 | |
---|
| 4 | #include "ep_message.hpp" |
---|
| 5 | #include "ep_intercomm.hpp" |
---|
| 6 | #include "ep_barrier.hpp" |
---|
| 7 | #include "ep_buffer.hpp" |
---|
| 8 | |
---|
| 9 | typedef std::pair< int, int > SIZE_RANK_INFO; // < rank, size> |
---|
| 10 | typedef std::vector< std::pair<int, int> > RANK_MAP; // at(ep_rank) = <ep_rank_local, mpi_rank> |
---|
| 11 | typedef std::map<int, std::pair<int, int> > EP_RANK_MAP; // key(ep_rank) = <ep_rank_local, mpi_rank> |
---|
| 12 | //typedef std::vector<std::pair< std::pair<int, int>, std::pair<int, int> > > INTERCOMM_RANK_MAP; |
---|
| 13 | typedef std::list<ep_lib::MPI_Message > Message_list; |
---|
| 14 | |
---|
| 15 | namespace ep_lib |
---|
| 16 | { |
---|
| 17 | |
---|
| 18 | class ep_comm; |
---|
| 19 | |
---|
| 20 | class ep_communicator |
---|
| 21 | { |
---|
| 22 | public: |
---|
| 23 | |
---|
| 24 | SIZE_RANK_INFO size_rank_info[3]; // 0: ep_rank, ep_size |
---|
| 25 | // 1: ep_rank_loc, num_ep |
---|
| 26 | // 2: mpi_rank, mpi_size |
---|
| 27 | |
---|
| 28 | // for intercomm : = size_rank_info of local_comm |
---|
| 29 | |
---|
| 30 | |
---|
| 31 | ep_comm **comm_list; |
---|
| 32 | |
---|
| 33 | Message_list *message_queue; |
---|
| 34 | |
---|
| 35 | |
---|
| 36 | int comm_label; |
---|
| 37 | |
---|
| 38 | ep_intercomm *intercomm; |
---|
| 39 | |
---|
| 40 | }; |
---|
| 41 | |
---|
| 42 | |
---|
| 43 | class ep_comm |
---|
| 44 | { |
---|
| 45 | public: |
---|
| 46 | |
---|
| 47 | bool is_ep; |
---|
| 48 | bool is_intercomm; |
---|
| 49 | |
---|
| 50 | BUFFER *my_buffer; |
---|
| 51 | |
---|
| 52 | ep_barrier *ep_barrier; |
---|
| 53 | |
---|
| 54 | EP_RANK_MAP *ep_rank_map; // for intercomm : = ep_rank_map of newcomm |
---|
| 55 | |
---|
| 56 | |
---|
| 57 | |
---|
| 58 | void* mpi_comm; |
---|
| 59 | ep_communicator *ep_comm_ptr; |
---|
| 60 | ep_comm **mem_bridge; |
---|
| 61 | void* mpi_bridge; |
---|
| 62 | |
---|
| 63 | ep_comm(){}; |
---|
| 64 | ep_comm(void* comm); |
---|
| 65 | |
---|
| 66 | }; |
---|
| 67 | |
---|
| 68 | typedef ep_comm* MPI_Comm; |
---|
| 69 | |
---|
| 70 | |
---|
| 71 | } |
---|
| 72 | |
---|
| 73 | |
---|
| 74 | |
---|
| 75 | #endif // EP_COMM_HPP_INCLUDED |
---|
| 76 | |
---|
Note: See
TracBrowser
for help on using the repository browser.