Skip to content

Commit

Permalink
Minor cleanup
Browse files Browse the repository at this point in the history
- Correct MPI_T_event_dropped_cb_function arguments
- Check for negative event index

Signed-off-by: Chris Chambreau <chambreau1@llnl.gov>
  • Loading branch information
cchambreau authored and hppritcha committed Jan 18, 2022
1 parent 0837be1 commit 6cd087d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion ompi/include/mpi.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -880,8 +880,9 @@ typedef enum ompi_mpi_t_source_order_t MPI_T_source_order;
typedef void (*MPI_T_event_free_cb_function) (MPI_T_event_registration handle,
MPI_T_cb_safety cb_safety,
void *user_data);
typedef void (*MPI_T_event_dropped_cb_function) (int count,
typedef void (*MPI_T_event_dropped_cb_function) (MPI_Count count,
MPI_T_event_registration handle,
int source_index,
MPI_T_cb_safety cb_safety,
void *user_data);
typedef void (*MPI_T_event_cb_function) (MPI_T_event_instance event,
Expand Down
4 changes: 2 additions & 2 deletions ompi/mpi/tool/event_get_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ int MPI_T_event_get_info (int event_index, char *name, int *name_len,
char *desc, int *desc_len, int *bind)
{
mca_base_event_t * const event;
int ret, max_datatypes = 0;
int ret, max_datatypes = 0, current_displacement = 0;

if (!mpit_is_initialized ()) {
return MPI_T_ERR_NOT_INITIALIZED;
Expand Down Expand Up @@ -114,7 +114,7 @@ int MPI_T_event_get_info (int event_index, char *name, int *name_len,
*num_elements = max_datatypes;
}

if (verbosity) {
if (NULL != verbosity) {
*verbosity = event->event_verbosity;
}

Expand Down
2 changes: 1 addition & 1 deletion opal/mca/base/mca_base_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ int mca_base_registration_get_event (mca_base_event_registration_t *registration

static int mca_base_event_get_by_index_internal (int index, mca_base_event_t **event, bool invalidok)
{
if (index >= event_count) {
if (0 > index || index >= event_count) {
return OPAL_ERR_VALUE_OUT_OF_BOUNDS;
}

Expand Down

0 comments on commit 6cd087d

Please sign in to comment.