Skip to content

Commit

Permalink
Merge pull request #6803 from guserav/fix-osc-sm-post-32-bit-atomics
Browse files Browse the repository at this point in the history
Fix osc sm posts when only 32 bit atomics support
  • Loading branch information
hjelmn authored Aug 28, 2019
2 parents b846028 + 3c9f4e6 commit c4d0752
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions ompi/mca/osc/sm/osc_sm_active_target.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ ompi_osc_sm_start(struct ompi_group_t *group,

for (int i = 0 ; i < size ; ++i) {
int rank_byte = ranks[i] >> OSC_SM_POST_BITS;
osc_sm_post_type_t rank_bit = ((osc_sm_post_type_t) 1) << (ranks[i] & 0x3f);
osc_sm_post_type_t rank_bit = ((osc_sm_post_type_t) 1) << (ranks[i] & OSC_SM_POST_MASK);

/* wait for rank to post */
while (!(module->posts[my_rank][rank_byte] & rank_bit)) {
Expand Down Expand Up @@ -221,8 +221,8 @@ ompi_osc_sm_post(struct ompi_group_t *group,
ompi_osc_sm_module_t *module =
(ompi_osc_sm_module_t*) win->w_osc_module;
int my_rank = ompi_comm_rank (module->comm);
int my_byte = my_rank >> 6;
uint64_t my_bit = ((uint64_t) 1) << (my_rank & 0x3f);
int my_byte = my_rank >> OSC_SM_POST_BITS;
osc_sm_post_type_t my_bit = ((osc_sm_post_type_t) 1) << (my_rank & OSC_SM_POST_MASK);
int gsize;

OPAL_THREAD_LOCK(&module->lock);
Expand Down
2 changes: 1 addition & 1 deletion ompi/mca/osc/sm/osc_sm_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit
int i, flag;
size_t pagesize;
size_t state_size;
size_t posts_size, post_size = (comm_size + 63) / 64;
size_t posts_size, post_size = (comm_size + OSC_SM_POST_MASK) / (OSC_SM_POST_MASK + 1);

OPAL_OUTPUT_VERBOSE((1, ompi_osc_base_framework.framework_output,
"allocating shared memory region of size %ld\n", (long) size));
Expand Down

0 comments on commit c4d0752

Please sign in to comment.