Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass user_data argument to free_cb_function registered with MPI_T_event_handle_free function #6

Open
wants to merge 1 commit into
base: topic/mpi_t_events
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ompi/mpi/tool/event_handle_free.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
* Copyright (c) 2017 IBM Corporation. All rights reserved.
* Copyright (c) 2018-2019 Triad National Security, LLC. All rights
* reserved.
* Copyright (c) 2024 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -40,7 +42,7 @@ int MPI_T_event_handle_free (MPI_T_event_registration event_registration,
if (MPI_T_EVENT_REGISTRATION_NULL == event_registration) {
ret = MPI_T_ERR_INVALID_HANDLE;
} else {
mca_base_event_registration_free (event_registration,
mca_base_event_registration_free (event_registration, user_data,
(mca_base_event_registration_free_cb_fn_t) free_cb_function);
}

Expand Down
7 changes: 5 additions & 2 deletions opal/mca/base/mca_base_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
* Copyright (c) 2017 IBM Corporation. All rights reserved.
* Copyright (c) 2018-2019 Triad National Security, LLC. All rights
* reserved.
* Copyright (c) 2024 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -416,8 +418,9 @@ int mca_base_event_callback_get_info (mca_base_event_registration_t *registratio
return OPAL_SUCCESS;
}

void mca_base_event_registration_free (mca_base_event_registration_t *registration, mca_base_event_registration_free_cb_fn_t cbfn)
void mca_base_event_registration_free (mca_base_event_registration_t *registration, void *user_data, mca_base_event_registration_free_cb_fn_t cbfn)
{
registration->user_data[MCA_BASE_CB_REQUIRE_NONE] = user_data;
registration->free_cb = cbfn;
OBJ_RELEASE(registration);
}
Expand Down Expand Up @@ -577,7 +580,7 @@ static void mca_base_event_registration_destructor (mca_base_event_registration_
}

if (registration->free_cb) {
registration->free_cb (registration, MCA_BASE_CB_REQUIRE_NONE, registration->user_data);
registration->free_cb (registration, MCA_BASE_CB_REQUIRE_NONE, registration->user_data[MCA_BASE_CB_REQUIRE_NONE]);
}
}

Expand Down
4 changes: 3 additions & 1 deletion opal/mca/base/mca_base_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* reserved.
* Copyright (c) 2018-2019 Triad National Security, LLC. All rights
* reserved.
* Copyright (c) 2024 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
*
* Additional copyrights may follow
*
Expand Down Expand Up @@ -198,7 +200,7 @@ OPAL_DECLSPEC int mca_base_event_registration_alloc (mca_base_event_t *event, vo
OPAL_DECLSPEC int mca_base_event_register_callback (mca_base_event_registration_t *registration, mca_base_cb_safety_t cb_safety,
opal_info_t *info, void *user_data, mca_base_event_cb_fn_t event_cbfn);

OPAL_DECLSPEC void mca_base_event_registration_free (mca_base_event_registration_t *registration, mca_base_event_registration_free_cb_fn_t cbfn);
OPAL_DECLSPEC void mca_base_event_registration_free (mca_base_event_registration_t *registration, void *user_data, mca_base_event_registration_free_cb_fn_t cbfn);

OPAL_DECLSPEC void mca_base_event_registration_set_dropped_handler (mca_base_event_registration_t *registration, mca_base_event_dropped_cb_fn_t cbfn);

Expand Down
Loading