Skip to content

Commit 15f9d75

Browse files
author
rhc54
committed
Merge pull request open-mpi#1024 from hjelmn/v1.10_osc_sm_fix
osc/sm: Fix a bus error on MPI_WIN_{POST,START}.
2 parents 9f237fa + 6ee08da commit 15f9d75

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ompi/mca/osc/sm/osc_sm_component.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,10 @@ component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit
287287
module->posts = calloc (comm_size, sizeof (module->posts[0]));
288288
if (NULL == module->posts) return OMPI_ERR_TEMP_OUT_OF_RESOURCE;
289289

290-
module->global_state = (ompi_osc_sm_global_state_t *) (module->segment_base);
290+
/* set module->posts[0] first to ensure 64-bit alignment */
291+
module->posts[0] = (uint64_t *) (module->segment_base);
292+
module->global_state = (ompi_osc_sm_global_state_t *) (module->posts[0] + comm_size * post_size);
291293
module->node_states = (ompi_osc_sm_node_state_t *) (module->global_state + 1);
292-
module->posts[0] = (uint64_t *) (module->node_states + comm_size);
293294

294295
for (i = 0, total = state_size + posts_size ; i < comm_size ; ++i) {
295296
if (i > 0) {

0 commit comments

Comments
 (0)