source: XIOS/dev/branch_openmp/extern/ep_dev/ep_comm.hpp @ 1511

Last change on this file since 1511 was 1511, checked in by yushan, 6 years ago

save dev

File size: 1.5 KB
Line 
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
9typedef std::pair< int, int > SIZE_RANK_INFO; // < rank, size>
10typedef std::vector< std::pair<int, int> > RANK_MAP;  // at(ep_rank) = <ep_rank_local, mpi_rank>
11typedef 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;
13typedef std::list<ep_lib::MPI_Message > Message_list;
14
15namespace 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
29    ep_comm **comm_list;
30
31    Message_list *message_queue;
32
33
34    int comm_label;
35
36    ep_intercomm *intercomm;
37
38    ep_communicator();
39    bool operator == (ep_communicator right);
40    bool operator != (ep_communicator right);
41   
42  };
43 
44
45  class ep_comm
46  {
47    public:
48
49    bool is_ep;
50    bool is_intercomm;
51
52    BUFFER     *my_buffer;
53    ep_barrier *ep_barrier;
54    EP_RANK_MAP   *ep_rank_map;
55    void* mpi_comm;
56    ep_communicator *ep_comm_ptr;
57    ep_comm    **mem_bridge;
58    void* mpi_bridge;
59
60    ep_comm(); 
61    ep_comm(void* comm);
62
63
64    bool operator == (ep_comm right);
65    bool operator != (ep_comm right);
66    bool is_null();
67
68  };
69 
70  typedef ep_comm*  MPI_Comm;
71
72
73}
74
75
76
77#endif // EP_COMM_HPP_INCLUDED
78
Note: See TracBrowser for help on using the repository browser.