Skip to content

Commit 3ed1cd9

Browse files
cchambreauhppritcha
authored andcommitted
Minor cleanup
- Correct MPI_T_event_dropped_cb_function arguments - Check for negative event index Signed-off-by: Chris Chambreau <[email protected]>
1 parent 7caf47c commit 3ed1cd9

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

ompi/include/mpi.h.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,8 +879,9 @@ typedef enum ompi_mpi_t_source_order_t MPI_T_source_order;
879879
typedef void (*MPI_T_event_free_cb_function) (MPI_T_event_registration handle,
880880
MPI_T_cb_safety cb_safety,
881881
void *user_data);
882-
typedef void (*MPI_T_event_dropped_cb_function) (int count,
882+
typedef void (*MPI_T_event_dropped_cb_function) (MPI_Count count,
883883
MPI_T_event_registration handle,
884+
int source_index,
884885
MPI_T_cb_safety cb_safety,
885886
void *user_data);
886887
typedef void (*MPI_T_event_cb_function) (MPI_T_event_instance event,

ompi/mpi/tool/event_get_info.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ int MPI_T_event_get_info (int event_index, char *name, int *name_len,
3434
char *desc, int *desc_len, int *bind)
3535
{
3636
mca_base_event_t * const event;
37-
int ret, max_datatypes = 0;
37+
int ret, max_datatypes = 0, current_displacement = 0;
3838

3939
if (!mpit_is_initialized ()) {
4040
return MPI_T_ERR_NOT_INITIALIZED;
@@ -114,7 +114,7 @@ int MPI_T_event_get_info (int event_index, char *name, int *name_len,
114114
*num_elements = max_datatypes;
115115
}
116116

117-
if (verbosity) {
117+
if (NULL != verbosity) {
118118
*verbosity = event->event_verbosity;
119119
}
120120

opal/mca/base/mca_base_event.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ int mca_base_registration_get_event (mca_base_event_registration_t *registration
148148

149149
static int mca_base_event_get_by_index_internal (int index, mca_base_event_t **event, bool invalidok)
150150
{
151-
if (index >= event_count) {
151+
if (0 > index || index >= event_count) {
152152
return OPAL_ERR_VALUE_OUT_OF_BOUNDS;
153153
}
154154

0 commit comments

Comments
 (0)