2
* Copyright (c) 2004-2006 The University of Tennessee and The University
3
* of Tennessee Research Foundation. All rights
5
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
6
* University of Stuttgart. All rights reserved.
9
* Additional copyrights may follow
19
/* PERUSE type declarations */
20
typedef void* peruse_event_h; /* Opaque event handle XXX */
22
typedef struct _peruse_comm_spec_t {
26
MPI_Datatype datatype;
32
typedef int (peruse_comm_callback_f)(peruse_event_h event_h,
33
MPI_Aint unique_id, peruse_comm_spec_t * spec, void * param);
35
/* PERUSE constants */
37
PERUSE_SUCCESS = 0, /* Success *//* XXX Devation from 1.11 */
38
PERUSE_ERR_INIT, /* PERUSE initialization failure */
39
PERUSE_ERR_GENERIC, /* Generic unspecified error */
40
PERUSE_ERR_MALLOC, /* Memory-related error */
41
PERUSE_ERR_EVENT, /* Invalid event descriptor */
42
PERUSE_ERR_EVENT_HANDLE, /* Invalid event handle */
43
PERUSE_ERR_PARAMETER, /* Invalid input parameter */
44
PERUSE_ERR_MPI_INIT, /* MPI has not been initialized */
45
PERUSE_ERR_COMM, /* MPI_ERR_COMM class */
46
PERUSE_ERR_MPI_OBJECT /* Error with associated MPI object */
50
PERUSE_EVENT_INVALID = -1, /* Must differ in value from PERUSE_SUCCESS. Devation from 1.11 */
52
/* Point-to-point request events */
53
PERUSE_COMM_REQ_ACTIVATE,
54
PERUSE_COMM_REQ_MATCH_UNEX,
55
PERUSE_COMM_REQ_INSERT_IN_POSTED_Q,
56
PERUSE_COMM_REQ_REMOVE_FROM_POSTED_Q,
57
PERUSE_COMM_REQ_XFER_BEGIN,
58
PERUSE_COMM_REQ_XFER_CONTINUE,
59
PERUSE_COMM_REQ_XFER_END,
60
PERUSE_COMM_REQ_COMPLETE,
61
PERUSE_COMM_REQ_NOTIFY,
62
PERUSE_COMM_MSG_ARRIVED,
63
PERUSE_COMM_MSG_INSERT_IN_UNEX_Q,
64
PERUSE_COMM_MSG_REMOVE_FROM_UNEX_Q,
65
PERUSE_COMM_MSG_MATCH_POSTED_REQ,
68
PERUSE_COMM_SEARCH_POSTED_Q_BEGIN,
69
PERUSE_COMM_SEARCH_POSTED_Q_END,
70
PERUSE_COMM_SEARCH_UNEX_Q_BEGIN, /* XXX Devation from 1.11 */
71
PERUSE_COMM_SEARCH_UNEX_Q_END,
73
/* Collective events */
75
/* One-sided events */
79
/* Scope of message queues */
81
PERUSE_PER_COMM=0, /* XXX Devation from 1.11 */
85
/* Operation values */
87
PERUSE_SEND=0, /* XXX Devation from 1.11 */
91
#define PERUSE_EVENT_HANDLE_NULL ((peruse_event_h)0)
97
/* PERUSE initialization */
98
int PERUSE_Init( void );
100
/* Query all implemented events */
101
int PERUSE_Query_supported_events( int* num_supported,
105
/* Query supported events */
106
int PERUSE_Query_event( const char* event_name, int* event );
108
/* Query event name */
109
int PERUSE_Query_event_name( int event, char** event_name );
111
/* Get environment variables that affect MPI library behavior */
112
int PERUSE_Query_environment( int* env_size, char*** env );
114
/* Query the scope of queue metrics - global or per communicator */
115
int PERUSE_Query_queue_event_scope( int* scope );
118
* II. Events, objects initialization and manipulation
120
/* Initialize event associated with an MPI communicator */
121
int PERUSE_Event_comm_register( int event,
123
peruse_comm_callback_f * callback_fn,
125
peruse_event_h * event_h );
127
/* Start collecting data (activate event) */
128
int PERUSE_Event_activate( peruse_event_h event_h );
130
/* Stop collecting data (deactivate event) */
131
int PERUSE_Event_deactivate( peruse_event_h event_h );
133
/* Free event handle */
134
int PERUSE_Event_release( peruse_event_h* event_h );
136
/* Set a new comm callback */
137
int PERUSE_Event_comm_callback_set( peruse_event_h event_h,
138
peruse_comm_callback_f* callback_fn,
141
/* Get the current comm callback */
142
int PERUSE_Event_comm_callback_get( peruse_event_h event_h,
143
peruse_comm_callback_f** callback_fn,
146
/* Obtain event descriptor from an event handle (reverse lookup) */
147
int PERUSE_Event_get( peruse_event_h event_h, int* event );
149
/* Obtain MPI object associated with event handle */
150
int PERUSE_Event_object_get( peruse_event_h event_h, void** mpi_object );
152
/* Propagaiont mode */
153
int PERUSE_Event_propagate( peruse_event_h event_h, int mode );