Skip to content

Commit

Permalink
used margo 0.16.0 timers
Browse files Browse the repository at this point in the history
  • Loading branch information
mdorier committed Apr 12, 2024
1 parent c6c46e0 commit 76f87d5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ spack:
lib64: [LD_LIBRARY_PATH]
packages:
mochi-margo:
require: "@0.15.0:"
require: "@0.16.0:"
13 changes: 11 additions & 2 deletions src/centralized/centralized-backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ static inline void member_state_free(void* args)
}
margo_addr_free(state->context->mid, state->address);
ABT_mutex_unlock(ABT_MUTEX_MEMORY_GET_HANDLE(&state->mtx));
uint16_t id = state->provider_id;
margo_instance_id mid = state->context->mid;
free(state);
}

Expand Down Expand Up @@ -304,6 +302,17 @@ static flock_return_t centralized_destroy_group(void* ctx)
// We do this before deregistering the RPCs to avoid ULTs
// failing because they are still using the RPC ids.
FLOCK_GROUP_VIEW_LOCK(&context->view);
margo_timer_t* timers = (margo_timer_t*)calloc(context->view.members.size, sizeof(*timers));
size_t num_timers = 0;
for(size_t i = 0; i < context->view.members.size; ++i) {
member_state* state = (member_state*)context->view.members.data[i].extra.data;
if(!state) continue;
if(state->ping_timer == MARGO_TIMER_NULL) continue;
timers[num_timers] = state->ping_timer;
num_timers += 1;
}
margo_timer_cancel_many(num_timers, timers);
free(timers);
flock_group_view_clear_extra(&context->view);
FLOCK_GROUP_VIEW_UNLOCK(&context->view);
}
Expand Down

0 comments on commit 76f87d5

Please sign in to comment.