Salome HOME
23261: [CEA 1695] Patch for updating GHS3DPRLPLUGIN
[plugins/ghs3dprlplugin.git] / bin / meshgems_mpi.h
1 /*
2  * Copyright 2009-2013 Distene SAS
3  *
4  */
5
6 #ifndef __MESHGEMS_MPI_H__
7 #define __MESHGEMS_MPI_H__
8
9 #define MESHGEMS_MPI_SUCCESS 0
10 #define MESHGEMS_MPI_ERR 1
11
12 #define MESHGEMS_MPI_ANY_SOURCE -1
13
14 /* Declare these as int rather than enum to be able to create dynamic types/operations */
15
16 typedef int meshgems_mpi_datatype;
17 typedef int meshgems_mpi_op;
18
19 #define meshgems_mpi_datatype_none 0
20 #define meshgems_mpi_datatype_i4 1
21 #define meshgems_mpi_datatype_i8 2
22 #define meshgems_mpi_datatype_r4 3
23 #define meshgems_mpi_datatype_r8 4
24 #define meshgems_mpi_datatype_enum_count 5
25
26 #define meshgems_mpi_op_none 0
27 #define meshgems_mpi_op_max 1
28 #define meshgems_mpi_op_sum 2
29 #define meshgems_mpi_op_enum_count 3
30
31 int meshgems_mpi_type_new(int count, int *array_of_blocklengths, long *array_of_displacements,
32                            meshgems_mpi_datatype *array_of_types, meshgems_mpi_datatype *newtype);
33 int meshgems_mpi_type_delete(meshgems_mpi_datatype datatype);
34
35 struct meshgems_mpi_handler_;
36 typedef struct meshgems_mpi_handler_ meshgems_mpi_handler;
37
38 meshgems_mpi_handler *meshgems_mpi_handler_new(void);
39 void meshgems_mpi_handler_delete(meshgems_mpi_handler *handler);
40
41 int meshgems_mpi_init(int *argc, char ***argv);
42 int meshgems_mpi_rank(int *r);
43 int meshgems_mpi_size(int *n);
44 int meshgems_mpi_finalize(void);
45
46 int meshgems_mpi_send(void* buffer, int count, meshgems_mpi_datatype datatype, int dest, int tag);
47 int meshgems_mpi_isend(void* buffer, int count, meshgems_mpi_datatype datatype, int dest, int tag,
48                        meshgems_mpi_handler *handler);
49 int meshgems_mpi_wait(meshgems_mpi_handler *handler);
50
51 int meshgems_mpi_recv(void* buffer, int count, meshgems_mpi_datatype, int src, int tag);
52
53 int meshgems_mpi_reduce(void *sendbuf, void *recvbuf, int count, meshgems_mpi_datatype datatype,
54                         meshgems_mpi_op op, int root);
55
56 int meshgems_mpi_allreduce(void *sendbuf, void *recvbuf, int count, meshgems_mpi_datatype datatype,
57                            meshgems_mpi_op op);
58
59 int meshgems_mpi_gather(void *sendbuf, int sendcount, meshgems_mpi_datatype sendtype, void *recvbuf,
60                         int recvcount, meshgems_mpi_datatype recvtype, int root);
61
62 int meshgems_mpi_allgather(void *sendbuf, int sendcount, meshgems_mpi_datatype sendtype,
63                            void *recvbuf, int recvcount, meshgems_mpi_datatype recvtype);
64
65 int meshgems_mpi_allgatherv(void *sendbuf, int sendcount, meshgems_mpi_datatype sendtype,
66                             void *recvbuf, int *recvcount, int *displs, meshgems_mpi_datatype recvtype);
67
68 int meshgems_mpi_barrier(void);
69
70 int meshgems_mpi_abort(int errorcode);
71
72 #endif