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 int MPI_Status;
40typedef void *MPI_Comm;
41typedef int MPI_Fint;
42#define MPI_IN_PLACE nullptr
43#define MPI_COMM_WORLD nullptr
44#define MPI_STATUS_IGNORE nullptr
45#define MPI_SUCCESS 1
46
47enum MPI_thread_level : int {
48 MPI_THREAD_SINGLE,
49 MPI_THREAD_FUNNELED,
50 MPI_THREAD_SERIALIZED,
51 MPI_THREAD_MULTIPLE
52};
53
54
55int MPI_Init(int *argc, char ***argv);
56
57int MPI_Init_thread(int *argc, char ***argv, int threadlevel, int *provided);
58
59int MPI_Comm_rank(MPI_Comm comm, int *rank);
60
61int MPI_Comm_size(MPI_Comm comm, int *size);
62
63int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *newcomm);
64
65int MPI_Bcast(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm);
66
67int MPI_Reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
68 MPI_Op op, int root, MPI_Comm comm);
69
70int MPI_Ireduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
71 MPI_Op op, int root, MPI_Comm comm, MPI_Request *request);
72
73int MPI_Allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
74 MPI_Op op, MPI_Comm comm);
75
76int MPI_Iallreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
77 MPI_Op op, MPI_Comm comm, MPI_Request *request);
78
79int MPI_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
80 MPI_Comm comm);
81
82int MPI_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
83 MPI_Comm comm, MPI_Request *request);
84
85int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
86 MPI_Comm comm, MPI_Status *status);
87
88int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
89 MPI_Comm comm, MPI_Request *request);
90
91int MPI_Wait(MPI_Request *request, MPI_Status *status);
92
93int MPI_Waitall(int count, MPI_Request array_of_requests[],
94 MPI_Status *array_of_statuses);
95
96int MPI_Barrier(MPI_Comm comm);
97
98int MPI_Ibarrier(MPI_Comm comm, MPI_Request *request);
99
100int MPI_Cancel(MPI_Request *request);
101
102int MPI_Abort(MPI_Comm comm, int errorcode);
103
104MPI_Fint MPI_Comm_c2f(MPI_Comm comm);
105
106int MPI_Finalize();
107
108#endif