Skip to content

Commit 3c9f4e6

Browse files
committed
Fix osc sm posts when only 32 bit atomics support
Signed-off-by: guserav <[email protected]>
1 parent 07c722e commit 3c9f4e6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ompi/mca/osc/sm/osc_sm_active_target.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ ompi_osc_sm_start(struct ompi_group_t *group,
151151

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

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

228228
OPAL_THREAD_LOCK(&module->lock);

ompi/mca/osc/sm/osc_sm_component.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit
244244
int i, flag;
245245
size_t pagesize;
246246
size_t state_size;
247-
size_t posts_size, post_size = (comm_size + 63) / 64;
247+
size_t posts_size, post_size = (comm_size + OSC_SM_POST_MASK) / (OSC_SM_POST_MASK + 1);
248248

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

0 commit comments

Comments
 (0)