1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 #ifndef _PERUSE_H_
17 #define _PERUSE_H_
18
19 #include "mpi.h"
20
21
22 typedef void* peruse_event_h;
23
24 typedef struct _peruse_comm_spec_t {
25 MPI_Comm comm;
26 void * buf;
27 int count;
28 MPI_Datatype datatype;
29 int peer;
30 int tag;
31 int operation;
32 } peruse_comm_spec_t;
33
34 typedef int (peruse_comm_callback_f)(peruse_event_h event_h,
35 MPI_Aint unique_id, peruse_comm_spec_t * spec, void * param);
36
37
38 enum {
39 PERUSE_SUCCESS = 0,
40 PERUSE_ERR_INIT,
41 PERUSE_ERR_GENERIC,
42 PERUSE_ERR_MALLOC,
43 PERUSE_ERR_EVENT,
44 PERUSE_ERR_EVENT_HANDLE,
45 PERUSE_ERR_PARAMETER,
46 PERUSE_ERR_MPI_INIT,
47 PERUSE_ERR_COMM,
48 PERUSE_ERR_MPI_OBJECT
49 };
50
51 enum {
52 PERUSE_EVENT_INVALID = -1,
53
54
55 PERUSE_COMM_REQ_ACTIVATE,
56 PERUSE_COMM_REQ_MATCH_UNEX,
57 PERUSE_COMM_REQ_INSERT_IN_POSTED_Q,
58 PERUSE_COMM_REQ_REMOVE_FROM_POSTED_Q,
59 PERUSE_COMM_REQ_XFER_BEGIN,
60 PERUSE_COMM_REQ_XFER_CONTINUE,
61 PERUSE_COMM_REQ_XFER_END,
62 PERUSE_COMM_REQ_COMPLETE,
63 PERUSE_COMM_REQ_NOTIFY,
64 PERUSE_COMM_MSG_ARRIVED,
65 PERUSE_COMM_MSG_INSERT_IN_UNEX_Q,
66 PERUSE_COMM_MSG_REMOVE_FROM_UNEX_Q,
67 PERUSE_COMM_MSG_MATCH_POSTED_REQ,
68
69
70 PERUSE_COMM_SEARCH_POSTED_Q_BEGIN,
71 PERUSE_COMM_SEARCH_POSTED_Q_END,
72 PERUSE_COMM_SEARCH_UNEX_Q_BEGIN,
73 PERUSE_COMM_SEARCH_UNEX_Q_END,
74
75
76
77
78 PERUSE_CUSTOM_EVENT
79 };
80
81
82 enum {
83 PERUSE_PER_COMM=0,
84 PERUSE_GLOBAL
85 };
86
87
88 enum {
89 PERUSE_SEND=0,
90 PERUSE_RECV
91 };
92
93 #define PERUSE_EVENT_HANDLE_NULL ((peruse_event_h)0)
94
95
96
97
98
99
100 OMPI_DECLSPEC int PERUSE_Init( void );
101
102
103 OMPI_DECLSPEC int PERUSE_Query_supported_events( int* num_supported,
104 char*** event_names,
105 int** events );
106
107
108 OMPI_DECLSPEC int PERUSE_Query_event( const char* event_name, int* event );
109
110
111 OMPI_DECLSPEC int PERUSE_Query_event_name( int event, char** event_name );
112
113
114 OMPI_DECLSPEC int PERUSE_Query_environment( int* env_size, char*** env );
115
116
117 OMPI_DECLSPEC int PERUSE_Query_queue_event_scope( int* scope );
118
119
120
121
122
123 OMPI_DECLSPEC int PERUSE_Event_comm_register( int event,
124 MPI_Comm comm,
125 peruse_comm_callback_f * callback_fn,
126 void * param,
127 peruse_event_h * event_h );
128
129
130 OMPI_DECLSPEC int PERUSE_Event_activate( peruse_event_h event_h );
131
132
133 OMPI_DECLSPEC int PERUSE_Event_deactivate( peruse_event_h event_h );
134
135
136 OMPI_DECLSPEC int PERUSE_Event_release( peruse_event_h* event_h );
137
138
139 OMPI_DECLSPEC int PERUSE_Event_comm_callback_set( peruse_event_h event_h,
140 peruse_comm_callback_f* callback_fn,
141 void * param);
142
143
144 OMPI_DECLSPEC int PERUSE_Event_comm_callback_get( peruse_event_h event_h,
145 peruse_comm_callback_f** callback_fn,
146 void ** param );
147
148
149 OMPI_DECLSPEC int PERUSE_Event_get( peruse_event_h event_h, int* event );
150
151
152 OMPI_DECLSPEC int PERUSE_Event_object_get( peruse_event_h event_h, void** mpi_object );
153
154
155 OMPI_DECLSPEC int PERUSE_Event_propagate( peruse_event_h event_h, int mode );
156
157 #endif