From c8f75c472aa14c461e0a9a946c24f85e53c49c80 Mon Sep 17 00:00:00 2001 From: Gleb Natapov Date: Wed, 28 Jun 2006 12:00:47 +0000 Subject: [PATCH] remove modulo op from fast path. Improvement 0.02-0.04ms. This commit was SVN r10538. --- ompi/mca/btl/openib/btl_openib_eager_rdma.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ompi/mca/btl/openib/btl_openib_eager_rdma.h b/ompi/mca/btl/openib/btl_openib_eager_rdma.h index c049a2737a..034ae7a499 100644 --- a/ompi/mca/btl/openib/btl_openib_eager_rdma.h +++ b/ompi/mca/btl/openib/btl_openib_eager_rdma.h @@ -78,9 +78,11 @@ typedef struct mca_btl_openib_eager_rdma_remote_t mca_btl_openib_eager_rdma_remo ((char*)(E)->eager_rdma_local.base.pval + \ (I) * (E)->endpoint_btl->eager_rdma_frag_size) -#define MCA_BTL_OPENIB_RDMA_NEXT_INDEX(I) do { \ - (I) = ((I) + 1) % \ - mca_btl_openib_component.eager_rdma_num; \ +#define MCA_BTL_OPENIB_RDMA_NEXT_INDEX(I) do { \ + (I) = ((I) + 1); \ + if((I) == \ + mca_btl_openib_component.eager_rdma_num) \ + (I) = 0; \ } while (0) #if defined(c_plusplus) || defined(__cplusplus) }