Skip to content

Commit

Permalink
Using put_nb for iput when OFI inject is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
wrrobin committed Feb 13, 2024
1 parent 0e4cff6 commit ac09bc3
Showing 1 changed file with 55 additions and 2 deletions.
57 changes: 55 additions & 2 deletions src/data_c.c4
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
Expand All @@ -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, \
Expand All @@ -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 \
Expand Down

0 comments on commit ac09bc3

Please sign in to comment.