Skip to content

Commit

Permalink
modules/kvs: Add fence_get_nprocs()
Browse files Browse the repository at this point in the history
  • Loading branch information
chu11 committed Feb 9, 2018
1 parent 7ce22e2 commit 04df016
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/modules/kvs/fence.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ bool fence_count_reached (fence_t *f)
return (f->count == f->nprocs);
}

int fence_get_nprocs (fence_t *f)
{
return f->nprocs;
}

int fence_get_flags (fence_t *f)
{
return f->flags;
Expand Down
1 change: 1 addition & 0 deletions src/modules/kvs/fence.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ void fence_destroy (fence_t *f);
/* if number of calls to fence_add_request_data() is == nprocs */
bool fence_count_reached (fence_t *f);

int fence_get_nprocs (fence_t *f);
int fence_get_flags (fence_t *f);
void fence_set_flags (fence_t *f, int flags);

Expand Down
2 changes: 0 additions & 2 deletions src/modules/kvs/kvs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1726,8 +1726,6 @@ static void relayfence_request_cb (flux_t *h, flux_msg_handler_t *mh,
goto error;
}
}
else
fence_set_flags (f, fence_get_flags (f) | flags);

if (fence_add_request_data (f, ops) < 0) {
flux_log_error (h, "%s: fence_add_request_data", __FUNCTION__);
Expand Down
3 changes: 3 additions & 0 deletions src/modules/kvs/test/fence.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ void basic_api_tests (void)
ok (fence_count_reached (f) == false,
"initial fence_count_reached() is false");

ok (fence_get_nprocs (f) == 1,
"initial fence_get_nprocs works");

ok (fence_get_flags (f) == 3,
"initial fence_get_flags works");

Expand Down

0 comments on commit 04df016

Please sign in to comment.