Skip to content

Commit cdca3bb

Browse files
committed
Bug fixes
Signed-off-by: Joseph Antony <jajoseph.antony18@gmail.com>
1 parent ebf7259 commit cdca3bb

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

ompi/mca/osc/sm/osc_sm_comm.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ ompi_osc_sm_win_get_notify_value(struct ompi_win_t *win,
4444
return MPI_ERR_NOTIFY_IDX;
4545
}
4646

47-
*value = (OMPI_MPI_COUNT_TYPE) osc_sm_target_notify_base(module, rank)[notify];
4847
opal_atomic_rmb();
48+
*value = (OMPI_MPI_COUNT_TYPE) osc_sm_target_notify_base(module, rank)[notify];
4949

5050
return OMPI_SUCCESS;
5151
}
@@ -141,15 +141,15 @@ ompi_osc_sm_rput_notify(const void *origin_addr,
141141
return ret;
142142
}
143143

144+
if (notify < 0 || (uint32_t) notify >= module->node_states[target].notify_counter_count) {
145+
return MPI_ERR_NOTIFY_IDX;
146+
}
147+
144148
/* the only valid field of RMA request status is the MPI_ERROR field.
145149
* ompi_request_empty has status MPI_SUCCESS and indicates the request is
146150
* complete. */
147151
*ompi_req = &ompi_request_empty;
148152

149-
if (notify < 0 || (uint32_t) notify >= module->node_states[target].notify_counter_count) {
150-
return MPI_ERR_NOTIFY_IDX;
151-
}
152-
153153
opal_atomic_wmb();
154154
opal_atomic_add(&osc_sm_target_notify_base(module, target)[notify], 1);
155155

@@ -483,7 +483,7 @@ ompi_osc_sm_get_notify(void *origin_addr,
483483
return ret;
484484
}
485485
if (notify < 0 || (uint32_t) notify >= module->node_states[target].notify_counter_count) {
486-
return OMPI_ERR_BAD_PARAM;
486+
return MPI_ERR_NOTIFY_IDX;
487487
}
488488

489489
opal_atomic_rmb();

ompi/mca/osc/sm/osc_sm_component.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ component_select(struct ompi_win_t *win, void **base, size_t size, ptrdiff_t dis
312312
free(rbuf);
313313
goto error;
314314
}
315-
315+
/* */
316316
total = 0;
317317
total_counters = 0;
318318
for (i = 0 ; i < comm_size ; ++i) {
@@ -391,9 +391,10 @@ component_select(struct ompi_win_t *win, void **base, size_t size, ptrdiff_t dis
391391
module->global_state = (ompi_osc_sm_global_state_t *) (module->posts[0] + comm_size * post_size);
392392
module->node_states = (ompi_osc_sm_node_state_t *) (module->global_state + 1);
393393

394-
/* set up notify counters in shared memory after node_states */
395-
module->notify_counters = (uint64_t *) ((char *)(module->node_states + comm_size) +
396-
OPAL_ALIGN_PAD_AMOUNT((uintptr_t)(module->node_states + comm_size), 64));
394+
/* set up notify counters in shared memory after posts and state.
395+
* posts_size and state_size are both padded to 64-byte multiples (lines 328, 330),
396+
* and segment_base is page-aligned, so this is guaranteed 64-byte aligned. */
397+
module->notify_counters = (uint64_t *)((char *) module->segment_base + posts_size + state_size);
397398
/* zero out notify counters */
398399
memset(module->notify_counters, 0, total_counters * sizeof(uint64_t));
399400

ompi/mpi/c/Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,7 @@ interface_profile_sources = \
702702
get_elements_x_generated.c \
703703
get_hw_resource_info_generated.c \
704704
get_library_version_generated.c \
705+
get_notify_generated.c \
705706
get_processor_name_generated.c \
706707
get_version_generated.c \
707708
graph_create_generated.c \
@@ -815,6 +816,7 @@ interface_profile_sources = \
815816
psend_init_generated.c \
816817
publish_name_generated.c \
817818
put_generated.c \
819+
put_notify_generated.c \
818820
query_thread_generated.c \
819821
raccumulate_generated.c \
820822
recv_generated.c \

0 commit comments

Comments
 (0)