Skip to content

Commit

Permalink
osc/ucx: Detach dynamic window memory when freeing a window
Browse files Browse the repository at this point in the history
Signed-off-by: Hessam Mirsadeghi <hmirsadeghi@nvidia.com>
  • Loading branch information
SeyedMir committed May 11, 2021
1 parent 8e00f1d commit dd7a882
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ompi/mca/osc/ucx/osc_ucx_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,7 @@ int ompi_osc_ucx_win_detach(struct ompi_win_t *win, const void *base) {
int ompi_osc_ucx_free(struct ompi_win_t *win) {
ompi_osc_ucx_module_t *module = (ompi_osc_ucx_module_t*) win->w_osc_module;
int ret;
uint64_t i;

assert(module->lock_count == 0);
assert(opal_list_is_empty(&module->pending_posts) == true);
Expand All @@ -687,6 +688,13 @@ int ompi_osc_ucx_free(struct ompi_win_t *win) {
return ret;
}

/* MPI_Win_free should detach any memory attached to dynamic windows */
for (i = 0; i < module->state.dynamic_win_count; i++) {
assert(module->local_dynamic_win_info[i].refcnt == 1);
opal_common_ucx_wpmem_free(module->local_dynamic_win_info[i].mem);
}
module->state.dynamic_win_count = 0;

free(module->addrs);
free(module->state_addrs);

Expand Down

0 comments on commit dd7a882

Please sign in to comment.