1
2
3
4
5
6
7
8
9
10
11
12
13
14 #if !defined(OMPI_CXX_COMM_GLUE_H)
15 #define OMPI_CXX_COMM_GLUE_H
16
17 #include "ompi_config.h"
18 #include <stdlib.h>
19
20 #include "mpi.h"
21
22 #if defined(c_plusplus) || defined(__cplusplus)
23 extern "C" {
24 #endif
25
26 typedef struct ompi_cxx_intercept_file_extra_state_t {
27 void *read_fn_cxx;
28 void *write_fn_cxx;
29 void *extent_fn_cxx;
30 void *extra_state_cxx;
31 } ompi_cxx_intercept_file_extra_state_t;
32
33 enum ompi_cxx_communicator_type_t {
34 OMPI_CXX_COMM_TYPE_UNKNOWN,
35 OMPI_CXX_COMM_TYPE_INTRACOMM,
36 OMPI_CXX_COMM_TYPE_INTERCOMM,
37 OMPI_CXX_COMM_TYPE_CART,
38 OMPI_CXX_COMM_TYPE_GRAPH,
39 };
40 typedef enum ompi_cxx_communicator_type_t ompi_cxx_communicator_type_t;
41
42
43 struct ompi_predefined_errhandler_t;
44 extern struct ompi_predefined_errhandler_t ompi_mpi_errors_throw_exceptions;
45
46
47
48
49 typedef void (ompi_cxx_dummy_fn_t) (void);
50
51 ompi_cxx_communicator_type_t ompi_cxx_comm_get_type (MPI_Comm comm);
52
53 int ompi_cxx_errhandler_invoke_comm (MPI_Comm comm, int ret, const char *message);
54
55 int ompi_cxx_attr_create_keyval_comm (MPI_Comm_copy_attr_function *copy_fn,
56 MPI_Comm_delete_attr_function* delete_fn, int *keyval, void *extra_state,
57 int flags, void *bindings_extra_state);
58 int ompi_cxx_attr_create_keyval_win (MPI_Win_copy_attr_function *copy_fn,
59 MPI_Win_delete_attr_function* delete_fn, int *keyval, void *extra_state,
60 int flags, void *bindings_extra_state);
61 int ompi_cxx_attr_create_keyval_type (MPI_Type_copy_attr_function *copy_fn,
62 MPI_Type_delete_attr_function* delete_fn, int *keyval, void *extra_state,
63 int flags, void *bindings_extra_state);
64
65 void ompi_mpi_cxx_comm_errhandler_invoke (MPI_Comm *mpi_comm, int *err,
66 const char *message, void *comm_fn);
67 void ompi_mpi_cxx_win_errhandler_invoke (MPI_Win *mpi_comm, int *err,
68 const char *message, void *win_fn);
69 int ompi_cxx_errhandler_invoke_file (MPI_File file, int ret, const char *message);
70 void ompi_mpi_cxx_file_errhandler_invoke (MPI_File *mpi_comm, int *err,
71 const char *message, void *file_fn);
72
73 MPI_Errhandler ompi_cxx_errhandler_create_comm (ompi_cxx_dummy_fn_t *fn);
74 MPI_Errhandler ompi_cxx_errhandler_create_win (ompi_cxx_dummy_fn_t *fn);
75 MPI_Errhandler ompi_cxx_errhandler_create_file (ompi_cxx_dummy_fn_t *fn);
76
77 ompi_cxx_intercept_file_extra_state_t
78 *ompi_cxx_new_intercept_state (void *read_fn_cxx, void *write_fn_cxx, void *extent_fn_cxx,
79 void *extra_state_cxx);
80
81 void ompi_cxx_errhandler_set_callbacks (struct ompi_errhandler_t *errhandler, MPI_Comm_errhandler_function *eh_comm_fn,
82 ompi_file_errhandler_function *eh_file_fn, MPI_Win_errhandler_function *eh_win_fn);
83
84 #if defined(c_plusplus) || defined(__cplusplus)
85 }
86 #endif
87
88 #endif