13 #ifndef _PERUSE_INTERNAL_H_
14 #define _PERUSE_INTERNAL_H_
16 #include "ompi_config.h"
17 #include "ompi/peruse/peruse.h"
19 #include "ompi/communicator/communicator.h"
20 #include "ompi/file/file.h"
21 #include "ompi/win/win.h"
25 typedef int (ompi_peruse_callback_f)(peruse_event_h event_h,
26 MPI_Aint unique_id,
void * spec,
void * param);
39 ompi_peruse_callback_f*
fn;
47 PERUSE_TYPE_INVALID=-1,
53 extern int ompi_peruse_initialized;
54 extern int ompi_peruse_finalized;
56 #define OMPI_ERR_PERUSE_INIT_FINALIZE \
57 if( OPAL_UNLIKELY(!ompi_peruse_initialized || ompi_peruse_finalized) ) { \
58 return PERUSE_ERR_INIT; \
64 int ompi_peruse_init (
void);
65 int ompi_peruse_finalize (
void);
72 #define PERUSE_TRACE_COMM_EVENT(event, base_req, op) \
74 if( NULL != (base_req)->req_comm->c_peruse_handles ) { \
75 ompi_peruse_handle_t * _ptr = (base_req)->req_comm->c_peruse_handles[(event)]; \
76 if (NULL != _ptr && _ptr->active) { \
77 peruse_comm_spec_t _comm_spec; \
78 _comm_spec.comm = (base_req)->req_comm; \
79 _comm_spec.buf = (base_req)->req_addr; \
80 _comm_spec.count = (base_req)->req_count; \
81 _comm_spec.datatype = (base_req)->req_datatype; \
82 _comm_spec.peer = (base_req)->req_peer; \
83 _comm_spec.tag = (base_req)->req_tag; \
84 _comm_spec.operation = (op); \
85 _ptr->fn(_ptr, (MPI_Aint)(base_req), &_comm_spec, _ptr->param); \
90 #define PERUSE_TRACE_COMM_OMPI_EVENT(event, base_req, size, op) \
92 if( NULL != (base_req)->req_comm->c_peruse_handles ) { \
93 ompi_peruse_handle_t * _ptr = (base_req)->req_comm->c_peruse_handles[(event)]; \
94 if (NULL != _ptr && _ptr->active) { \
95 peruse_comm_spec_t _comm_spec; \
96 _comm_spec.comm = (base_req)->req_comm; \
97 _comm_spec.buf = (base_req)->req_addr; \
98 _comm_spec.count = size; \
99 _comm_spec.datatype = MPI_PACKED; \
100 _comm_spec.peer = (base_req)->req_peer; \
101 _comm_spec.tag = (base_req)->req_tag; \
102 _comm_spec.operation = (op); \
103 _ptr->fn(_ptr, (MPI_Aint)(base_req), &_comm_spec, _ptr->param); \
108 #define PERUSE_TRACE_MSG_EVENT(event, comm_ptr, hdr_peer, hdr_tag, op) \
110 if( NULL != (comm_ptr)->c_peruse_handles ) { \
111 ompi_peruse_handle_t * _ptr = (comm_ptr)->c_peruse_handles[(event)]; \
112 if (NULL != _ptr && _ptr->active) { \
113 peruse_comm_spec_t _comm_spec; \
114 _comm_spec.comm = (ompi_communicator_t*) (comm_ptr); \
115 _comm_spec.buf = NULL; \
116 _comm_spec.count = 0; \
117 _comm_spec.datatype = MPI_DATATYPE_NULL; \
118 _comm_spec.peer = (hdr_peer); \
119 _comm_spec.tag = (hdr_tag); \
120 _comm_spec.operation = (op); \
121 _ptr->fn (_ptr, (MPI_Aint)0, &_comm_spec, _ptr->param); \
128 #define PERUSE_TRACE_COMM_EVENT(event, base_req, op)
129 #define PERUSE_TRACE_COMM_OMPI_EVENT(event, base_req, size, op)
130 #define PERUSE_TRACE_MSG_EVENT(event, comm_ptr, hdr_peer, hdr_tag, op)
ompi_peruse_callback_f * fn
Callback function specified by user.
Definition: peruse-internal.h:39
ompi_communicator_t * comm
Corresponding communicator.
Definition: peruse-internal.h:36
Definition: peruse-internal.h:30
Definition: mutex_unix.h:53
int type
Object-type this event is registered on.
Definition: peruse-internal.h:35
The opal_list_t interface is used to provide a generic doubly-linked list container for Open MPI...
opal_mutex_t lock
Lock protecting the entry XXX needed?
Definition: peruse-internal.h:32
int active
Whether this handle has been activated.
Definition: peruse-internal.h:33
Definition: opal_list.h:98
Back-end structure for MPI_File.
Definition: file.h:42
ompi_win_t * win
Corresponding window, in case we have support.
Definition: peruse-internal.h:38
int event
Event being watched.
Definition: peruse-internal.h:34
opal_list_item_t super
Allow handle to be placed on a list.
Definition: peruse-internal.h:31
ompi_file_t * file
Corresponding file.
Definition: peruse-internal.h:37
void * param
Parameters being passed to callback.
Definition: peruse-internal.h:40
Definition: communicator.h:118
#define OBJ_CLASS_DECLARATION(NAME)
Declaration for class descriptor.
Definition: opal_object.h:236