From ac09bc3724aa5d92be061f16f206598b32a85a1a Mon Sep 17 00:00:00 2001 From: "Rahman, Md" Date: Tue, 13 Feb 2024 13:51:38 -0800 Subject: [PATCH] Using put_nb for iput when OFI inject is disabled --- src/data_c.c4 | 57 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/src/data_c.c4 b/src/data_c.c4 index 2083fb0b..be007144 100644 --- a/src/data_c.c4 +++ b/src/data_c.c4 @@ -416,6 +416,7 @@ SHMEM_PROF_DEF_CTX_PUT_N_SIGNAL_NBI(`mem') shmem_internal_get(ctx, target, source, (SIZE)*nelems, pe);\ } +#ifndef DISABLE_OFI_INJECT #define SHMEM_DEF_IPUT(STYPE,TYPE) \ void SHMEM_FUNCTION_ATTRIBUTES \ SHMEM_FUNC_PROTOTYPE(STYPE##_iput, TYPE *target, \ @@ -438,8 +439,34 @@ SHMEM_PROF_DEF_CTX_PUT_N_SIGNAL_NBI(`mem') source += sst; \ } \ } +#else +#define SHMEM_DEF_IPUT(STYPE,TYPE) \ + void SHMEM_FUNCTION_ATTRIBUTES \ + SHMEM_FUNC_PROTOTYPE(STYPE##_iput, TYPE *target, \ + const TYPE *source, ptrdiff_t tst, \ + ptrdiff_t sst, size_t nelems, int pe) \ + SHMEM_ERR_CHECK_INITIALIZED(); \ + SHMEM_ERR_CHECK_PE(pe); \ + SHMEM_ERR_CHECK_CTX(ctx); \ + SHMEM_ERR_CHECK_POSITIVE(tst); \ + SHMEM_ERR_CHECK_POSITIVE(sst); \ + SHMEM_ERR_CHECK_SYMMETRIC(target, sizeof(TYPE) * ((nelems-1) * tst + 1)); \ + SHMEM_ERR_CHECK_NULL(source, nelems); \ + SHMEM_ERR_CHECK_OVERLAP(target, source, \ + sizeof(TYPE) * ((nelems-1) * tst + 1), \ + sizeof(TYPE) * ((nelems-1) * sst + 1), 0); \ + for ( ; nelems > 0 ; --nelems) { \ + long completion = 0; \ + shmem_internal_put_nb(ctx, target, source, \ + sizeof(TYPE), pe, &completion); \ + shmem_internal_put_wait(ctx, &completion); \ + target += tst; \ + source += sst; \ + } \ + } +#endif - +#ifndef DISABLE_OFI_INJECT #define SHMEM_DEF_IPUT_N(NAME,SIZE) \ void SHMEM_FUNCTION_ATTRIBUTES \ SHMEM_FUNC_PROTOTYPE(iput##NAME, void *target, \ @@ -463,7 +490,33 @@ SHMEM_PROF_DEF_CTX_PUT_N_SIGNAL_NBI(`mem') source = (uint8_t*)source + sst*(SIZE); \ } \ } - +#else +#define SHMEM_DEF_IPUT_N(NAME,SIZE) \ + void SHMEM_FUNCTION_ATTRIBUTES \ + SHMEM_FUNC_PROTOTYPE(iput##NAME, void *target, \ + const void *source, ptrdiff_t tst, \ + ptrdiff_t sst, size_t nelems, int pe) \ + SHMEM_ERR_CHECK_INITIALIZED(); \ + SHMEM_ERR_CHECK_PE(pe); \ + SHMEM_ERR_CHECK_CTX(ctx); \ + SHMEM_ERR_CHECK_POSITIVE(tst); \ + SHMEM_ERR_CHECK_POSITIVE(sst); \ + SHMEM_ERR_CHECK_SYMMETRIC(target, \ + (SIZE) * ((nelems-1) * tst + 1)); \ + SHMEM_ERR_CHECK_NULL(source, nelems); \ + SHMEM_ERR_CHECK_OVERLAP(target, source, \ + (SIZE) * ((nelems-1) * tst + 1), \ + (SIZE) * ((nelems-1) * sst + 1), 0); \ + for ( ; nelems > 0 ; --nelems) { \ + long completion = 0; \ + shmem_internal_put_nb(ctx, target, source, (SIZE), pe, \ + &completion); \ + shmem_internal_put_wait(ctx, &completion); \ + target = (uint8_t*)target + tst*(SIZE); \ + source = (uint8_t*)source + sst*(SIZE); \ + } \ + } +#endif #define SHMEM_DEF_IGET(STYPE,TYPE) \ void SHMEM_FUNCTION_ATTRIBUTES \