Skip to content

Commit

Permalink
OSHMEM/MCA/SPML/UCX: reverted some of the changes, keeping only whats…
Browse files Browse the repository at this point in the history
… necessary
  • Loading branch information
roiedanino committed Jul 9, 2024
1 parent b88fa59 commit 2f0dd13
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 55 deletions.
60 changes: 30 additions & 30 deletions oshmem/mca/spml/ucx/spml_ucx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1648,96 +1648,96 @@ int mca_spml_ucx_put_all_nb(void *dest, const void *source, size_t size, long *c
int mca_spml_ucx_put_signal(shmem_ctx_t ctx, void* dst_addr, size_t size, void*
src_addr, uint64_t *sig_addr, uint64_t signal, int sig_op, int dst)
{
RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT_RET_INT();
return OSHMEM_ERR_NOT_IMPLEMENTED;
}

/* This routine is not implemented */
int mca_spml_ucx_put_signal_nb(shmem_ctx_t ctx, void* dst_addr, size_t size,
void* src_addr, uint64_t *sig_addr, uint64_t signal, int sig_op, int
dst)
{
RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT_RET_INT();
return OSHMEM_ERR_NOT_IMPLEMENTED;
}

/* This routine is not implemented */
void mca_spml_ucx_wait_until_all(void *ivars, int cmp, void
*cmp_value, size_t nelems, const int *status, int datatype)
{
RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT();
RUNTIME_SHMEM_NOT_IMPLEMENTED_API_ABORT();
}

/* This routine is not implemented */
size_t mca_spml_ucx_wait_until_any(void *ivars, int cmp, void
*cmp_value, size_t nelems, const int *status, int datatype)
{
RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT_RET_SIZE_T();
RUNTIME_SHMEM_NOT_IMPLEMENTED_API_ABORT_RET_SIZE_T();
}

/* This routine is not implemented */
size_t mca_spml_ucx_wait_until_some(void *ivars, int cmp, void
*cmp_value, size_t nelems, size_t *indices, const int *status, int
datatype)
{
RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT_RET_SIZE_T();
RUNTIME_SHMEM_NOT_IMPLEMENTED_API_ABORT_RET_SIZE_T();
}

/* This routine is not implemented */
void mca_spml_ucx_wait_until_all_vector(void *ivars, int cmp, void
*cmp_values, size_t nelems, const int *status, int datatype)
{
RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT();
RUNTIME_SHMEM_NOT_IMPLEMENTED_API_ABORT();
}

/* This routine is not implemented */
size_t mca_spml_ucx_wait_until_any_vector(void *ivars, int cmp, void
*cmp_value, size_t nelems, const int *status, int datatype)
{
RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT_RET_SIZE_T();
RUNTIME_SHMEM_NOT_IMPLEMENTED_API_ABORT_RET_SIZE_T();
}

/* This routine is not implemented */
size_t mca_spml_ucx_wait_until_some_vector(void *ivars, int cmp, void
*cmp_value, size_t nelems, size_t *indices, const int *status, int
datatype)
{
RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT_RET_SIZE_T();
RUNTIME_SHMEM_NOT_IMPLEMENTED_API_ABORT_RET_SIZE_T();
}

/* This routine is not implemented */
int mca_spml_ucx_test_all(void *ivars, int cmp, void *cmp_value,
size_t nelems, const int *status, int datatype)
{
RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT_RET_INT();
return OSHMEM_ERR_NOT_IMPLEMENTED;
}

/* This routine is not implemented */
size_t mca_spml_ucx_test_any(void *ivars, int cmp, void *cmp_value,
size_t nelems, const int *status, int datatype)
{
RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT_RET_SIZE_T();
RUNTIME_SHMEM_NOT_IMPLEMENTED_API_ABORT_RET_SIZE_T();
}

/* This routine is not implemented */
size_t mca_spml_ucx_test_some(void *ivars, int cmp, void *cmp_value,
size_t nelems, size_t *indices, const int *status, int datatype)
{
RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT_RET_SIZE_T();
RUNTIME_SHMEM_NOT_IMPLEMENTED_API_ABORT_RET_SIZE_T();
}

/* This routine is not implemented */
int mca_spml_ucx_test_all_vector(void *ivars, int cmp, void *cmp_values,
size_t nelems, const int *status,
int datatype)
{
RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT_RET_INT();
return OSHMEM_ERR_NOT_IMPLEMENTED;
}

/* This routine is not implemented */
size_t mca_spml_ucx_test_any_vector(void *ivars, int cmp,
void *cmp_values, size_t nelems,
const int *status, int datatype)
{
RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT_RET_INT();
RUNTIME_SHMEM_NOT_IMPLEMENTED_API_ABORT_RET_SIZE_T();
}

/* This routine is not implemented */
Expand All @@ -1746,47 +1746,47 @@ size_t mca_spml_ucx_test_some_vector(void *ivars, int cmp,
size_t *indices, const int *status,
int datatype)
{
RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT_RET_SIZE_T();
RUNTIME_SHMEM_NOT_IMPLEMENTED_API_ABORT_RET_SIZE_T();
}

/* This routine is not implemented */
int mca_spml_ucx_team_sync(shmem_team_t team)
{
RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT_RET_INT();
return OSHMEM_ERR_NOT_IMPLEMENTED;
}

/* This routine is not implemented */
int mca_spml_ucx_team_my_pe(shmem_team_t team)
{
RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT_RET_INT();
return OSHMEM_ERR_NOT_IMPLEMENTED;
}

/* This routine is not implemented */
int mca_spml_ucx_team_n_pes(shmem_team_t team)
{
RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT_RET_INT();
return OSHMEM_ERR_NOT_IMPLEMENTED;
}

/* This routine is not implemented */
int mca_spml_ucx_team_get_config(shmem_team_t team, long config_mask,
shmem_team_config_t *config)
{
RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT_RET_INT();
return OSHMEM_ERR_NOT_IMPLEMENTED;
}

/* This routine is not implemented */
int mca_spml_ucx_team_translate_pe(shmem_team_t src_team, int src_pe,
shmem_team_t dest_team)
{
RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT_RET_INT();
return OSHMEM_ERR_NOT_IMPLEMENTED;
}

/* This routine is not implemented */
int mca_spml_ucx_team_split_strided(shmem_team_t parent_team, int start, int
stride, int size, const shmem_team_config_t *config, long config_mask,
shmem_team_t *new_team)
{
RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT_RET_INT();
return OSHMEM_ERR_NOT_IMPLEMENTED;
}

/* This routine is not implemented */
Expand All @@ -1795,66 +1795,66 @@ int mca_spml_ucx_team_split_2d(shmem_team_t parent_team, int xrange, const
*xaxis_team, const shmem_team_config_t *yaxis_config, long yaxis_mask,
shmem_team_t *yaxis_team)
{
RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT_RET_INT();
return OSHMEM_ERR_NOT_IMPLEMENTED;
}

/* This routine is not implemented */
int mca_spml_ucx_team_destroy(shmem_team_t team)
{
RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT_RET_INT();
return OSHMEM_ERR_NOT_IMPLEMENTED;
}

/* This routine is not implemented */
int mca_spml_ucx_team_get(shmem_ctx_t ctx, shmem_team_t *team)
{
RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT_RET_INT();
return OSHMEM_ERR_NOT_IMPLEMENTED;
}

/* This routine is not implemented */
int mca_spml_ucx_team_create_ctx(shmem_team_t team, long options, shmem_ctx_t *ctx)
{
RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT_RET_INT();
return OSHMEM_ERR_NOT_IMPLEMENTED;
}

/* This routine is not implemented */
int mca_spml_ucx_team_alltoall(shmem_team_t team, void
*dest, const void *source, size_t nelems, int datatype)
{
RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT_RET_INT();
return OSHMEM_ERR_NOT_IMPLEMENTED;
}

/* This routine is not implemented */
int mca_spml_ucx_team_alltoalls(shmem_team_t team, void
*dest, const void *source, ptrdiff_t dst, ptrdiff_t sst, size_t nelems,
int datatype)
{
RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT_RET_INT();
return OSHMEM_ERR_NOT_IMPLEMENTED;
}

/* This routine is not implemented */
int mca_spml_ucx_team_broadcast(shmem_team_t team, void
*dest, const void *source, size_t nelems, int PE_root, int datatype)
{
RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT_RET_INT();
return OSHMEM_ERR_NOT_IMPLEMENTED;
}

/* This routine is not implemented */
int mca_spml_ucx_team_collect(shmem_team_t team, void
*dest, const void *source, size_t nelems, int datatype)
{
RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT_RET_INT();
return OSHMEM_ERR_NOT_IMPLEMENTED;
}

/* This routine is not implemented */
int mca_spml_ucx_team_fcollect(shmem_team_t team, void
*dest, const void *source, size_t nelems, int datatype)
{
RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT_RET_INT();
return OSHMEM_ERR_NOT_IMPLEMENTED;
}

/* This routine is not implemented */
int mca_spml_ucx_team_reduce(shmem_team_t team, void
*dest, const void *source, size_t nreduce, int operation, int datatype)
{
RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT_RET_INT();
return OSHMEM_ERR_NOT_IMPLEMENTED;
}
5 changes: 2 additions & 3 deletions oshmem/mca/sshmem/ucx/sshmem_ucx_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,11 @@ segment_create(map_segment_t *ds_buf,
{
mca_spml_ucx_t *spml = (mca_spml_ucx_t*)mca_spml.self;
unsigned flags = UCP_MEM_MAP_ALLOCATE;
int status;

if (hint & SHMEM_HINT_DEVICE_NIC_MEM) {
#if HAVE_DECL_UCS_MEMORY_TYPE_RDMA
status = segment_create_internal(ds_buf, NULL, size, flags,
UCS_MEMORY_TYPE_RDMA, 3);
int status = segment_create_internal(ds_buf, NULL, size,
flags, UCS_MEMORY_TYPE_RDMA, 3);
if (status == OSHMEM_SUCCESS) {
ds_buf->alloc_hints = hint;
ds_buf->allocator = &sshmem_ucx_allocator;
Expand Down
10 changes: 3 additions & 7 deletions oshmem/runtime/runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,20 +237,16 @@ OSHMEM_DECLSPEC int oshmem_shmem_register_params(void);

#endif /* OSHMEM_PARAM_CHECK */

#define RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT() \
#define RUNTIME_SHMEM_NOT_IMPLEMENTED_API_ABORT() \
do { \
SHMEM_API_ERROR("Called non-implemented API: %s", __func__); \
oshmem_shmem_abort(OSHMEM_ERR_NOT_IMPLEMENTED); \
} while (0)

#define RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT_RET_SIZE_T() \
RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT(); \
#define RUNTIME_SHMEM_NOT_IMPLEMENTED_API_ABORT_RET_SIZE_T() \
RUNTIME_SHMEM_NOT_IMPLEMENTED_API_ABORT(); \
return SIZE_MAX

#define RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT_RET_INT() \
RUNTIME_SHMEM_NON_IMPLEMENTED_API_ABORT(); \
return INT_MAX

END_C_DECLS

#endif /* OSHMEM_SHMEM_RUNTIME_H */
37 changes: 22 additions & 15 deletions oshmem/shmem/c/shmem_test_ivars.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,19 +121,21 @@
#include "oshmem/shmem/c/profile-defines.h"
#endif

#define SHMEM_TYPE_TEST_ALL(type_name, type, code, prefix) \
int prefix##type_name##_test_all(volatile type *ivars, size_t nelems, const int *status, \
int cmp, type value) \
{ \
RUNTIME_CHECK_INIT(); \
\
return MCA_SPML_CALL(test_all( \
(void*) ivars, \
cmp, \
(void*) &value, \
nelems, \
status, \
code)); \
#define SHMEM_TYPE_TEST_ALL(type_name, type, code, prefix) \
int prefix##type_name##_test_all(volatile type *ivars, size_t nelems, const int *status, int cmp, type value) \
{ \
int rc; \
\
RUNTIME_CHECK_INIT(); \
\
rc = MCA_SPML_CALL(test_all( \
(void*)ivars, \
cmp, \
(void*)&value, \
nelems, status, code)); \
RUNTIME_CHECK_IMPL_RC(rc); \
\
return rc; \
}

#define SHMEM_TYPE_TEST_ANY(type_name, type, code, prefix) \
Expand Down Expand Up @@ -187,15 +189,20 @@


#define SHMEM_TYPE_TEST_ALL_VECTOR(type_name, type, code, prefix) \
int prefix##type_name##_test_all_vector(volatile type *ivars, size_t nelems, const int *status, int cmp, type *values) \
int prefix##type_name##_test_all_vector(volatile type *ivars, size_t nelems, const int *status, int cmp, type *values) \
{ \
int rc; \
\
RUNTIME_CHECK_INIT(); \
\
return MCA_SPML_CALL(test_all_vector( \
rc = MCA_SPML_CALL(test_all_vector( \
(void*)ivars, \
cmp, \
(void*)values, \
nelems, status, code)); \
RUNTIME_CHECK_IMPL_RC(rc); \
\
return rc; \
}


Expand Down

0 comments on commit 2f0dd13

Please sign in to comment.