Skip to content

Commit f7faacc

Browse files
committed
osc/rdma: fix 32-bit builds
Signed-off-by: Nathan Hjelm <[email protected]>
1 parent 06af6f1 commit f7faacc

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

ompi/mca/osc/rdma/osc_rdma_frag.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ static inline void ompi_osc_rdma_frag_complete (ompi_osc_rdma_frag_t *frag)
2323
opal_atomic_rmb ();
2424

2525
(void) opal_atomic_swap_32 (&frag->pending, 1);
26+
#if OPAL_HAVE_ATOMIC_MATH_64
2627
(void) opal_atomic_swap_64 (&frag->curr_index, 0);
28+
#else
29+
(void) opal_atomic_swap_32 (&frag->curr_index, 0);
30+
#endif
2731
}
2832
}
2933

@@ -81,7 +85,11 @@ static inline int ompi_osc_rdma_frag_alloc (ompi_osc_rdma_module_t *module, size
8185
OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_INFO, "allocating frag. pending = %d", curr->pending);
8286
OPAL_THREAD_ADD_FETCH32(&curr->pending, 1);
8387

88+
#if OPAL_HAVE_ATOMIC_MATH_64
8489
my_index = opal_atomic_fetch_add_64 (&curr->curr_index, request_len);
90+
#else
91+
my_index = opal_atomic_fetch_add_32 (&curr->curr_index, request_len);
92+
#endif
8593
if (my_index + request_len > mca_osc_rdma_component.buffer_size) {
8694
if (my_index <= mca_osc_rdma_component.buffer_size) {
8795
/* this thread caused the buffer to spill over */

ompi/mca/osc/rdma/osc_rdma_types.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,11 @@ struct ompi_osc_rdma_frag_t {
229229

230230
/* Number of operations which have started writing into the frag, but not yet completed doing so */
231231
volatile int32_t pending;
232+
#if OPAL_HAVE_ATOMIC_MATH_64
232233
volatile int64_t curr_index;
234+
#else
235+
volatile int32_t curr_index;
236+
#endif
233237

234238
struct ompi_osc_rdma_module_t *module;
235239
mca_btl_base_registration_handle_t *handle;

0 commit comments

Comments
 (0)