source: XIOS/dev/branch_openmp/extern/src_ep_dev/ep_lib.hpp @ 1356

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

unify MPI_Comm type

File size: 3.6 KB
Line 
1#ifndef EP_LIB_HPP_INCLUDED
2#define EP_LIB_HPP_INCLUDED
3
4#include "ep_type.hpp"
5#include "ep_lib_intercomm.hpp"
6#include "ep_lib_local.hpp"
7#include "ep_lib_collective.hpp"
8#include "ep_tag.hpp"
9#include "ep_lib_fortran.hpp"
10
11namespace ep_lib
12{
13//#ifdef _intelmpi
14  typedef int MPI_Datatype;
15  typedef int MPI_Op;
16//  #define EP_ANY_SOURCE -2
17//  #define EP_ANY_TAG -1
18//#elif _openmpi
19//  typedef void* MPI_Datatype;
20//  typedef void* MPI_Op;
21//  #define EP_ANY_SOURCE -1
22//  #define EP_ANY_TAG -1
23//#endif
24
25  int MPI_Init_thread(int* argc, char*** argv, int required, int*provided);
26
27  int MPI_Init(int *argc, char ***argv);
28
29  int MPI_Initialized(int *flag);
30
31  int MPI_Comm_rank(MPI_Comm comm, int* rank);
32
33  int MPI_Comm_size(MPI_Comm comm, int* rank);
34
35  int MPI_Comm_free(MPI_Comm* comm);
36
37  int MPI_Finalize();
38 
39  double MPI_Wtime();
40
41  int MPI_Abort(MPI_Comm comm, int errorcode);
42
43  int MPI_Get_count(const MPI_Status *status, MPI_Datatype datatype, int *count);
44
45  // #ifdef _openmpi
46  // int MPI_Comm_create_endpoints(void* mpi_comm, int num_ep, MPI_Info info, MPI_Comm *& out_comm_hdls); // from MPI to create endpoints
47  // #elif _intelmpi
48  // int MPI_Comm_create_endpoints(int mpi_comm, int num_ep, MPI_Info info, MPI_Comm *& out_comm_hdls); // from MPI to create endpoints
49  // #endif
50 
51  int MPI_Comm_create_endpoints(void* base_comm_ptr, int num_ep, MPI_Info info, MPI_Comm *& out_comm_hdls); // from EP to create endpoints
52
53  int MPI_Send(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm);
54  int MPI_Ssend(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm);
55  int MPI_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request);
56  int MPI_Issend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request);
57
58  int tag_combine(int real_tag, int src, int dest);
59  int get_ep_rank(MPI_Comm comm, int ep_rank_loc, int mpi_rank);
60  int get_ep_rank_intercomm(MPI_Comm comm, int ep_rank_loc, int mpi_rank);
61
62  int Message_Check(MPI_Comm comm);
63  int Request_Check();
64
65  int MPI_Recv  (void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Status *status);
66  int MPI_Irecv (void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Request *request);
67  int MPI_Mrecv (void *buf, int count, MPI_Datatype datatype, MPI_Message *message, MPI_Status *status);
68  int MPI_Imrecv(void *buf, int count, MPI_Datatype datatype, MPI_Message *message, MPI_Request *request);
69
70
71  int MPI_Test(MPI_Request *request, int *flag, MPI_Status *status);
72  int MPI_Testall(int count, MPI_Request *array_of_requests, int *flag, MPI_Status *array_of_statuses);
73
74  int MPI_Wait(MPI_Request *request, MPI_Status *status);
75  int MPI_Waitall(int count, MPI_Request *array_of_requests, MPI_Status *array_of_statuses);
76
77
78  int MPI_Iprobe(int source, int tag, MPI_Comm comm, int *flag, MPI_Status *status);
79  int MPI_Improbe(int source, int tag, MPI_Comm comm, int *flag, MPI_Message *message, MPI_Status *status);
80 
81  int MPI_Alloc_mem(MPI_Aint size, MPI_Info info, void *baseptr);
82 
83  int MPI_Alloc_mem(unsigned long size, MPI_Info info, void *baseptr);
84
85
86  void check_sum_send(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, int type);
87  void check_sum_recv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, int type);
88
89  bool valid_type(MPI_Datatype type);
90  bool valid_op(MPI_Op op);
91
92}
93
94//MPI_Datatype to_mpi(ep_lib::MPI_Datatype type);
95
96
97#endif // EP_LIB_HPP_INCLUDED
Note: See TracBrowser for help on using the repository browser.