Skip to content

Commit 6e2af18

Browse files
committed
osc/rdma: Remove usage of custom min() function
Use the opal_min() function instead of a custom macro. Signed-off-by: Brian Barrett <bbarrett@amazon.com>
1 parent 222b7f3 commit 6e2af18

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

ompi/mca/osc/rdma/osc_rdma_accumulate.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,15 @@
1919
* $HEADER$
2020
*/
2121

22+
#include "ompi_config.h"
23+
2224
#include "osc_rdma_accumulate.h"
2325
#include "osc_rdma_request.h"
2426
#include "osc_rdma_comm.h"
2527
#include "osc_rdma_lock.h"
2628
#include "osc_rdma_btl_comm.h"
2729

30+
#include "opal/util/minmax.h"
2831
#include "ompi/mca/osc/base/base.h"
2932
#include "ompi/mca/osc/base/osc_base_obj_convert.h"
3033

@@ -583,9 +586,9 @@ static inline int ompi_osc_rdma_gacc_master (ompi_osc_rdma_sync_t *sync, const v
583586

584587
/* determine how much to put in this operation */
585588
if (source_count) {
586-
acc_len = min(min(target_iovec[target_iov_index].iov_len, source_iovec[source_iov_index].iov_len), acc_limit);
589+
acc_len = opal_min(opal_min(target_iovec[target_iov_index].iov_len, source_iovec[source_iov_index].iov_len), acc_limit);
587590
} else {
588-
acc_len = min(target_iovec[target_iov_index].iov_len, acc_limit);
591+
acc_len = opal_min(target_iovec[target_iov_index].iov_len, acc_limit);
589592
}
590593

591594
if (0 != acc_len) {

ompi/mca/osc/rdma/osc_rdma_comm.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,18 @@
1515
* $HEADER$
1616
*/
1717

18+
#include "ompi_config.h"
19+
1820
#include "osc_rdma_comm.h"
1921
#include "osc_rdma_frag.h"
2022
#include "osc_rdma_sync.h"
2123
#include "osc_rdma_request.h"
2224
#include "osc_rdma_dynamic.h"
2325
#include "osc_rdma_btl_comm.h"
2426

25-
#include "ompi/mca/osc/base/osc_base_obj_convert.h"
2627
#include "opal/align.h"
28+
#include "opal/util/minmax.h"
29+
#include "ompi/mca/osc/base/osc_base_obj_convert.h"
2730

2831
/* helper functions */
2932
static inline void ompi_osc_rdma_cleanup_rdma (ompi_osc_rdma_sync_t *sync, bool dec_always, ompi_osc_rdma_frag_t *frag,
@@ -246,7 +249,7 @@ static int ompi_osc_rdma_master_noncontig (ompi_osc_rdma_sync_t *sync, void *loc
246249
assert (0 != local_iov_count);
247250

248251
/* determine how much to transfer in this operation */
249-
rdma_len = min(min(local_iovec[local_iov_index].iov_len, remote_iovec[remote_iov_index].iov_len), max_rdma_len);
252+
rdma_len = opal_min(opal_min(local_iovec[local_iov_index].iov_len, remote_iovec[remote_iov_index].iov_len), max_rdma_len);
250253

251254
/* execute the get */
252255
if (!subreq && alloc_reqs) {

ompi/mca/osc/rdma/osc_rdma_comm.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
#define OMPI_OSC_RDMA_DECODE_MAX 64
2424

25-
#define min(a,b) ((a) < (b) ? (a) : (b))
2625
#define ALIGNMENT_MASK(x) ((x) ? (x) - 1 : 0)
2726

2827
/**

0 commit comments

Comments
 (0)