HILA
Loading...
Searching...
No Matches
hilapp_mpi.h
1#ifndef HILAPP_MPI_H_
2#define HILAPP_MPI_H_
3
4
5////////////////////////////////////////////////////////////////////////////
6/// This header introduces MPI functions for hilapp, not for final compile
7/// Useful because (statically compiled) hilapp does not automatically know
8/// the location of mpi.h, and saves the trouble of finding it
9////////////////////////////////////////////////////////////////////////////
10
11
12// Selection of MPI datatypes - if needed add here
13enum MPI_Datatype : int {
14 MPI_BYTE,
15 MPI_CHAR,
16 MPI_SHORT,
17 MPI_INT,
18 MPI_LONG,
19 MPI_FLOAT,
20 MPI_DOUBLE,
21 MPI_LONG_DOUBLE,
22 MPI_C_DOUBLE_COMPLEX,
23 MPI_C_FLOAT_COMPLEX,
24 MPI_UNSIGNED,
25 MPI_UNSIGNED_LONG,
26 MPI_INT64_T,
27 MPI_UINT64_T,
28 MPI_2INT,
29 MPI_LONG_INT,
30 MPI_FLOAT_INT,
31 MPI_DOUBLE_INT,
32 MPI_LONG_DOUBLE_INT
33};
34
35enum MPI_Op : int { MPI_SUM, MPI_PROD, MPI_MAX, MPI_MIN, MPI_MAXLOC, MPI_MINLOC };
36
37typedef void *MPI_Comm;
38typedef void *MPI_Request;
39typedef struct ompi_status_public_t MPI_Status;
40typedef void *MPI_Comm;
41typedef int MPI_Fint;
42typedef void *MPI_Errhandler;
43#define MPI_IN_PLACE nullptr
44#define MPI_COMM_WORLD nullptr
45#define MPI_STATUS_IGNORE nullptr
46#define MPI_ERRORS_RETURN nullptr
47#define MPI_REQUEST_NULL nullptr
48#define MPI_SUCCESS 1
49
50enum MPI_thread_level : int {
51 MPI_THREAD_SINGLE,
52 MPI_THREAD_FUNNELED,
53 MPI_THREAD_SERIALIZED,
54 MPI_THREAD_MULTIPLE
55};
56
57struct ompi_status_public_t {
58 /* These fields are publicly defined in the MPI specification.
59 User applications may freely read from these fields. */
60 int MPI_SOURCE;
61 int MPI_TAG;
62 int MPI_ERROR;
63 /* The following two fields are internal to the Open MPI
64 implementation and should not be accessed by MPI applications.
65 They are subject to change at any time. These are not the
66 droids you're looking for. */
67 int _cancelled;
68 size_t _ucount;
69};
70
71int MPI_Init(int *argc, char ***argv);
72
73int MPI_Init_thread(int *argc, char ***argv, int threadlevel, int *provided);
74
75int MPI_Comm_rank(MPI_Comm comm, int *rank);
76
77int MPI_Comm_size(MPI_Comm comm, int *size);
78
79int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *newcomm);
80
81int MPI_Comm_set_errhandler(MPI_Comm comm, MPI_Errhandler errhandler);
82
83int MPI_Bcast(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm);
84
85int MPI_Reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
86 MPI_Op op, int root, MPI_Comm comm);
87
88int MPI_Ireduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
89 MPI_Op op, int root, MPI_Comm comm, MPI_Request *request);
90
91int MPI_Allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
92 MPI_Op op, MPI_Comm comm);
93
94int MPI_Iallreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
95 MPI_Op op, MPI_Comm comm, MPI_Request *request);
96
97int MPI_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
98 MPI_Comm comm);
99
100int MPI_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
101 MPI_Comm comm, MPI_Request *request);
102
103int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
104 MPI_Comm comm, MPI_Status *status);
105
106int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
107 MPI_Comm comm, MPI_Request *request);
108
109int MPI_Wait(MPI_Request *request, MPI_Status *status);
110
111int MPI_Waitall(int count, MPI_Request array_of_requests[],
112 MPI_Status *array_of_statuses);
113
114int MPI_Barrier(MPI_Comm comm);
115
116int MPI_Ibarrier(MPI_Comm comm, MPI_Request *request);
117
118int MPI_Cancel(MPI_Request *request);
119
120int MPI_Test(MPI_Request *request, int *flag, MPI_Status *status);
121
122int MPI_Test_cancelled(const MPI_Status *status, int *flag);
123
124int MPI_Request_free(MPI_Request *request);
125
126int MPI_Abort(MPI_Comm comm, int errorcode);
127
128MPI_Fint MPI_Comm_c2f(MPI_Comm comm);
129
130int MPI_Finalize();
131
132#endif