Skip to content

Commit

Permalink
Minimal change for put_scalar to disable fi_inject
Browse files Browse the repository at this point in the history
  • Loading branch information
wrrobin committed Feb 14, 2024
1 parent 72f8e11 commit 6e54bc9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 80 deletions.
58 changes: 3 additions & 55 deletions src/data_c.c4
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +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 @@ -439,34 +439,8 @@ 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 @@ -490,33 +464,7 @@ 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
30 changes: 5 additions & 25 deletions src/shmem_comm.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,6 @@
#include "transport.h"
#include "shr_transport.h"

/*static inline
void
shmem_internal_put_scalar(shmem_ctx_t ctx, void *target, const void *source, size_t len, int pe)
{
shmem_internal_assert(len > 0);
if (shmem_shr_transport_use_write(ctx, target, source, len, pe)) {
shmem_shr_transport_put_scalar(ctx, target, source, len, pe);
} else {
shmem_transport_put_scalar((shmem_transport_ctx_t *)ctx, target, source, len, pe);
}
}*/


static inline
void
Expand All @@ -59,14 +46,16 @@ shmem_internal_put_nb(shmem_ctx_t ctx, void *target, const void *source, size_t
}
}


static inline
void
shmem_internal_put_wait(shmem_ctx_t ctx, long *completion)
{
shmem_transport_put_wait((shmem_transport_ctx_t *)ctx, completion);
/* on-node is always blocking, so this is a no-op for them */
shmem_transport_put_wait((shmem_transport_ctx_t *)ctx, completion);
/* on-node is always blocking, so this is a no-op for them */
}


static inline
void
shmem_internal_put_scalar(shmem_ctx_t ctx, void *target, const void *source, size_t len, int pe)
Expand All @@ -76,10 +65,10 @@ shmem_internal_put_scalar(shmem_ctx_t ctx, void *target, const void *source, siz
if (shmem_shr_transport_use_write(ctx, target, source, len, pe)) {
shmem_shr_transport_put_scalar(ctx, target, source, len, pe);
} else {
long completion = 0;
#ifndef DISABLE_OFI_INJECT
shmem_transport_put_scalar((shmem_transport_ctx_t *)ctx, target, source, len, pe);
#else
long completion = 0;
shmem_transport_put_nb((shmem_transport_ctx_t *)ctx, target, source, len, pe, &completion);
shmem_internal_put_wait(ctx, &completion);
#endif
Expand Down Expand Up @@ -134,15 +123,6 @@ shmem_internal_put_ct_nb(shmemx_ct_t ct, void *target, const void *source, size_
}


/*static inline
void
shmem_internal_put_wait(shmem_ctx_t ctx, long *completion)
{
shmem_transport_put_wait((shmem_transport_ctx_t *)ctx, completion);
*/ /* on-node is always blocking, so this is a no-op for them */
/*}*/


static inline
void
shmem_internal_get(shmem_ctx_t ctx, void *target, const void *source, size_t len, int pe)
Expand Down

0 comments on commit 6e54bc9

Please sign in to comment.