Skip to content

Commit

Permalink
Merge pull request #906 from Sandia-OpenSHMEM/topic/teams
Browse files Browse the repository at this point in the history
Merge topic/teams into master
  • Loading branch information
jdinan authored Nov 19, 2019
2 parents 9efe8d0 + cf7beea commit 9c22e2e
Show file tree
Hide file tree
Showing 44 changed files with 3,026 additions and 290 deletions.
10 changes: 10 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,16 @@ options.
compute node is determined by its unique hostname, and the number of
STXs available on a compute node is provided by the libfabric library.

Team Environment variables:

SHMEM_TEAMS_MAX (default: 10)
Sets the maximum number of available teams per PE, including the
predefined teams. The maximum supported value is 64. The value must
be the same across all PEs in SHMEM_TEAM_WORLD.

SHMEM_TEAM_SHARED_ONLY_SELF (default: off)
If defined, the predefined team, SHMEM_TEAM_SHARED, will only include
the self PE.

Debugging Environment variables:

Expand Down
39 changes: 39 additions & 0 deletions bindings/shmem_bind_c.m4
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,45 @@ $1(int, int, `SHM_INTERNAL_INT', `$2', `$3')
$1(long, long, `SHM_INTERNAL_LONG', `$2', `$3')
$1(longlong, long long, `SHM_INTERNAL_LONG_LONG', `$2', `$3')')dnl
dnl
define(`SHMEM_BIND_C_COLL_AND_OR_XOR', dnl args: macro_name, op_name, op_const
`$1(uchar, unsigned char, `SHM_INTERNAL_UCHAR', `$2', `$3')
$1(short, short, `SHM_INTERNAL_SHORT', `$2', `$3')
$1(ushort, unsigned short, `SHM_INTERNAL_USHORT', `$2', `$3')
$1(int, int, `SHM_INTERNAL_INT', `$2', `$3')
$1(uint, unsigned int, `SHM_INTERNAL_UINT', `$2', `$3')
$1(long, long, `SHM_INTERNAL_LONG', `$2', `$3')
$1(ulong, unsigned long, `SHM_INTERNAL_ULONG', `$2', `$3')
$1(longlong, long long, `SHM_INTERNAL_LONG_LONG', `$2', `$3')
$1(ulonglong, unsigned long long, `SHM_INTERNAL_ULONG_LONG', `$2', `$3')')dnl
dnl
define(`SHMEM_BIND_C_COLL_MIN_MAX', dnl args: macro_name, op_name, op_const
`$1(short, short, `SHM_INTERNAL_SHORT', `$2', `$3')
$1(ushort, unsigned short, `SHM_INTERNAL_USHORT', `$2', `$3')
$1(int, int, `SHM_INTERNAL_INT', `$2', `$3')
$1(uint, unsigned int, `SHM_INTERNAL_UINT', `$2', `$3')
$1(long, long, `SHM_INTERNAL_LONG', `$2', `$3')
$1(ulong, unsigned long, `SHM_INTERNAL_ULONG', `$2', `$3')
$1(longlong, long long, `SHM_INTERNAL_LONG_LONG', `$2', `$3')
$1(ulonglong, unsigned long long, `SHM_INTERNAL_ULONG_LONG', `$2', `$3')
$1(float, float, `SHM_INTERNAL_FLOAT', `$2', `$3')
$1(double, double, `SHM_INTERNAL_DOUBLE', `$2', `$3')
$1(longdouble, long double, `SHM_INTERNAL_LONG_DOUBLE', `$2', `$3')')dnl
dnl
define(`SHMEM_BIND_C_COLL_SUM_PROD', dnl args: macro_name, op_name, op_const
`$1(short, short, `SHM_INTERNAL_SHORT', `$2', `$3')
$1(ushort, unsigned short, `SHM_INTERNAL_USHORT', `$2', `$3')
$1(int, int, `SHM_INTERNAL_INT', `$2', `$3')
$1(uint, unsigned int, `SHM_INTERNAL_UINT', `$2', `$3')
$1(long, long, `SHM_INTERNAL_LONG', `$2', `$3')
$1(ulong, unsigned long, `SHM_INTERNAL_ULONG', `$2', `$3')
$1(longlong, long long, `SHM_INTERNAL_LONG_LONG', `$2', `$3')
$1(ulonglong, unsigned long long, `SHM_INTERNAL_ULONG_LONG', `$2', `$3')
$1(float, float, `SHM_INTERNAL_FLOAT', `$2', `$3')
$1(double, double, `SHM_INTERNAL_DOUBLE', `$2', `$3')
$1(longdouble, long double, `SHM_INTERNAL_LONG_DOUBLE', `$2', `$3')
$1(complexd, double _Complex, `SHM_INTERNAL_DOUBLE_COMPLEX', `$2', `$3')
$1(complexf, float _Complex, `SHM_INTERNAL_FLOAT_COMPLEX', `$2', `$3')')dnl
dnl
define(`SHMEM_BIND_C_COLL_FLOATS', dnl args: macro_name, op_name, op_const
`$1(float, float, `SHM_INTERNAL_FLOAT', `$2', `$3')
$1(double, double, `SHM_INTERNAL_DOUBLE', `$2', `$3')
Expand Down
40 changes: 40 additions & 0 deletions bindings/shmem_bind_c11.m4
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,43 @@ $1(ushort, unsigned short)$2
$1(uint, unsigned int)$2
$1(ulong, unsigned long)$2
$1(ulonglong, unsigned long long)')dnl
dnl
define(`SHMEM_BIND_C11_COLL_AND_OR_XOR', dnl args: macro_name, op_name, op_const
`$1(uchar, unsigned char, `SHM_INTERNAL_UCHAR')$2
$1(short, short, `SHM_INTERNAL_SHORT')$2
$1(ushort, unsigned short, `SHM_INTERNAL_USHORT')$2
$1(int, int, `SHM_INTERNAL_INT')$2
$1(uint, unsigned int, `SHM_INTERNAL_UINT')$2
$1(long, long, `SHM_INTERNAL_LONG')$2
$1(ulong, unsigned long, `SHM_INTERNAL_ULONG')$2
$1(longlong, long long, `SHM_INTERNAL_LONG_LONG')$2
$1(ulonglong, unsigned long long, `SHM_INTERNAL_ULONG_LONG')')dnl
dnl
define(`SHMEM_BIND_C11_COLL_MIN_MAX', dnl args: macro_name, op_name, op_const
`$1(short, short, `SHM_INTERNAL_SHORT')$2
$1(ushort, unsigned short, `SHM_INTERNAL_USHORT')$2
$1(int, int, `SHM_INTERNAL_INT')$2
$1(uint, unsigned int, `SHM_INTERNAL_UINT')$2
$1(long, long, `SHM_INTERNAL_LONG')$2
$1(ulong, unsigned long, `SHM_INTERNAL_ULONG')$2
$1(longlong, long long, `SHM_INTERNAL_LONG_LONG')$2
$1(ulonglong, unsigned long long, `SHM_INTERNAL_ULONG_LONG')$2
$1(float, float, `SHM_INTERNAL_FLOAT')$2
$1(double, double, `SHM_INTERNAL_DOUBLE')$2
$1(longdouble, long double, `SHM_INTERNAL_LONG_DOUBLE')')dnl
dnl
define(`SHMEM_BIND_C11_COLL_SUM_PROD', dnl args: macro_name, op_name, op_const
`$1(short, short, `SHM_INTERNAL_SHORT')$2
$1(ushort, unsigned short, `SHM_INTERNAL_USHORT')$2
$1(int, int, `SHM_INTERNAL_INT')$2
$1(uint, unsigned int, `SHM_INTERNAL_UINT')$2
$1(long, long, `SHM_INTERNAL_LONG')$2
$1(ulong, unsigned long, `SHM_INTERNAL_ULONG')$2
$1(longlong, long long, `SHM_INTERNAL_LONG_LONG')$2
$1(ulonglong, unsigned long long, `SHM_INTERNAL_ULONG_LONG')$2
$1(float, float, `SHM_INTERNAL_FLOAT')$2
$1(double, double, `SHM_INTERNAL_DOUBLE')$2
$1(longdouble, long double, `SHM_INTERNAL_LONG_DOUBLE')$2
$1(complexd, double _Complex, `SHM_INTERNAL_DOUBLE_COMPLEX')$2
$1(complexf, float _Complex, `SHM_INTERNAL_FLOAT_COMPLEX')')dnl
dnl
44 changes: 43 additions & 1 deletion bindings/shmem_bind_cxx.m4
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ $1(uint, unsigned int, `SHM_INTERNAL_UINT')$2
$1(ulong, unsigned long, `SHM_INTERNAL_ULONG')$2
$1(ulonglong, unsigned long long, `SHM_INTERNAL_ULONG_LONG')')dnl
dnl
define(`SHMEM_BIND_CXX_SYNC', dnl args: macro_name
define(`SHMEM_BIND_CXX_SYNC', dnl args: macro_name, end
SHMEM_BIND_CXX_SYNC_EXTRAS($1,$2)dnl
`$1(short, short)$2
$1(int, int)$2
Expand All @@ -66,8 +66,50 @@ $1(uint, unsigned int)$2
$1(ulong, unsigned long)$2
$1(ulonglong, unsigned long long)')dnl
dnl
define(`SHMEM_BIND_CXX_COLL_AND_OR_XOR', dnl args: macro_name, end
`$1(uchar, unsigned char, `SHM_INTERNAL_UCHAR')$2
$1(short, short, `SHM_INTERNAL_SHORT')$2
$1(ushort, unsigned short, `SHM_INTERNAL_USHORT')$2
$1(int, int, `SHM_INTERNAL_INT')$2
$1(uint, unsigned int, `SHM_INTERNAL_UINT')$2
$1(long, long, `SHM_INTERNAL_LONG')$2
$1(ulong, unsigned long, `SHM_INTERNAL_ULONG')$2
$1(longlong, long long, `SHM_INTERNAL_LONG_LONG')$2
$1(ulonglong, unsigned long long, `SHM_INTERNAL_ULONG_LONG')')dnl
dnl
define(`SHMEM_BIND_CXX_COLL_MIN_MAX', dnl args: macro_name, op_name, op_const
`$1(short, short, `SHM_INTERNAL_SHORT')$2
$1(ushort, unsigned short, `SHM_INTERNAL_USHORT')$2
$1(int, int, `SHM_INTERNAL_INT')$2
$1(uint, unsigned int, `SHM_INTERNAL_UINT')$2
$1(long, long, `SHM_INTERNAL_LONG')$2
$1(ulong, unsigned long, `SHM_INTERNAL_ULONG')$2
$1(longlong, long long, `SHM_INTERNAL_LONG_LONG')$2
$1(ulonglong, unsigned long long, `SHM_INTERNAL_ULONG_LONG')$2
$1(float, float, `SHM_INTERNAL_FLOAT')$2
$1(double, double, `SHM_INTERNAL_DOUBLE')$2
$1(longdouble, long double, `SHM_INTERNAL_LONG_DOUBLE')')dnl
dnl
define(`SHMEM_BIND_CXX_COLL_SUM_PROD', dnl args: macro_name, op_name, op_const
`$1(short, short, `SHM_INTERNAL_SHORT')$2
$1(ushort, unsigned short, `SHM_INTERNAL_USHORT')$2
$1(int, int, `SHM_INTERNAL_INT')$2
$1(uint, unsigned int, `SHM_INTERNAL_UINT')$2
$1(long, long, `SHM_INTERNAL_LONG')$2
$1(ulong, unsigned long, `SHM_INTERNAL_ULONG')$2
$1(longlong, long long, `SHM_INTERNAL_LONG_LONG')$2
$1(ulonglong, unsigned long long, `SHM_INTERNAL_ULONG_LONG')$2
$1(float, float, `SHM_INTERNAL_FLOAT')$2
$1(double, double, `SHM_INTERNAL_DOUBLE')$2
$1(longdouble, long double, `SHM_INTERNAL_LONG_DOUBLE')$2
$1(complexd, double _Complex, `SHM_INTERNAL_DOUBLE_COMPLEX')$2
$1(complexf, float _Complex, `SHM_INTERNAL_FLOAT_COMPLEX')')dnl
dnl
define(`SHMEM_CXX_DEFINE_FOR_RMA', `SHMEM_BIND_CXX_RMA(`$1')')dnl
define(`SHMEM_CXX_DEFINE_FOR_AMO', `SHMEM_BIND_CXX_AMO(`$1')')dnl
define(`SHMEM_CXX_DEFINE_FOR_EXTENDED_AMO', `SHMEM_BIND_CXX_EXTENDED_AMO(`$1')')dnl
define(`SHMEM_CXX_DEFINE_FOR_BITWISE_AMO', `SHMEM_BIND_CXX_BITWISE_AMO(`$1')')dnl
define(`SHMEM_CXX_DEFINE_FOR_SYNC', `SHMEM_BIND_CXX_SYNC(`$1')')dnl
define(`SHMEM_CXX_DEFINE_FOR_COLL_AND_OR_XOR', `SHMEM_BIND_CXX_COLL_AND_OR_XOR(`$1')')dnl
define(`SHMEM_CXX_DEFINE_FOR_COLL_MIN_MAX', `SHMEM_BIND_CXX_COLL_MIN_MAX(`$1')')dnl
define(`SHMEM_CXX_DEFINE_FOR_COLL_SUM_PROD', `SHMEM_BIND_CXX_COLL_SUM_PROD(`$1')')dnl
10 changes: 10 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,14 @@ AS_CASE([$enable_ofi_mr],
AC_DEFINE([ENABLE_MR_SCALABLE], [1], [If defined, the OFI transport will use FI_MR_SCALABLE])],
[AC_MSG_ERROR([Invalid OFI memory registration mode: $enable_ofi_mr])])

AC_ARG_ENABLE([max-teams],
[AC_HELP_STRING([--enable-max-teams=NUMBER],
[Default value for the maximum number of teams allowed (default: 10)])])

AS_IF([test -z "$enable_max_teams"],
[AC_DEFINE([DEFAULT_TEAMS_MAX], [10], [Maximum number of teams (default)])],
[AC_DEFINE_UNQUOTED([DEFAULT_TEAMS_MAX], [$enable_max_teams], [Maximum number of teams (custom)])])

AC_ARG_ENABLE([rpm-prefix],
[AC_HELP_STRING([--enable-rpm-prefix],
[Generate RPM spec file that supports an alternate installation prefix (default:disabled)])])
Expand Down Expand Up @@ -482,6 +490,8 @@ SHMEM_FIND_INT_TYPE([long], [$transport])
SHMEM_FIND_INT_TYPE([long long], [$transport])
SHMEM_FIND_INT_TYPE([ptrdiff_t], [$transport])

SHMEM_FIND_UINT_TYPE([unsigned char], [$transport])
SHMEM_FIND_UINT_TYPE([unsigned short], [$transport])
SHMEM_FIND_UINT_TYPE([unsigned int], [$transport])
SHMEM_FIND_UINT_TYPE([unsigned long], [$transport])
SHMEM_FIND_UINT_TYPE([unsigned long long], [$transport])
Expand Down
21 changes: 21 additions & 0 deletions mpp/shmemx-def.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,29 @@ typedef struct {
uint64_t target;
} shmemx_pcntr_t;

/* Teams */
typedef struct shmem_impl_team_t {
int dummy;
} * shmemx_team_t;

typedef struct {
int num_contexts;
} shmemx_team_config_t;

#if SHMEM_HAVE_ATTRIBUTE_VISIBILITY == 1
__attribute__((visibility("default"))) extern shmemx_team_t SHMEMX_TEAM_WORLD;
__attribute__((visibility("default"))) extern shmemx_team_t SHMEMX_TEAM_SHARED;
#else
extern shmemx_team_t SHMEMX_TEAM_WORLD;
extern shmemx_team_t SHMEMX_TEAM_SHARED;
#endif

#define SHMEMX_TEAM_INVALID NULL

#define SHMEMX_CTX_INVALID NULL

#define SHMEMX_TEAM_NUM_CONTEXTS (1l<<0)

#ifdef __cplusplus
}
#endif
Expand Down
144 changes: 144 additions & 0 deletions mpp/shmemx.h4
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,77 @@ static inline void shmemx_put_signal_nbi(shmem_ctx_t ctx, $2* dest, const $2* so
}')dnl
SHMEM_CXX_DEFINE_FOR_RMA(`SHMEM_CXX_PUT_SIGNAL_NBI')

/* Team Collective Routines */
define(`SHMEM_CXX_BCAST',
`static inline int shmemx_broadcast(shmemx_team_t team, $2* dest, const $2* source,
size_t nelems, int PE_root) {
return shmemx_$1_broadcast(team, dest, source, nelems, PE_root);
}')dnl
SHMEM_CXX_DEFINE_FOR_RMA(`SHMEM_CXX_BCAST')

define(`SHMEM_CXX_COLLECT',
`static inline int shmemx_collect(shmemx_team_t team, $2* dest, const $2* source,
size_t nelems) {
return shmemx_$1_collect(team, dest, source, nelems);
}')dnl
SHMEM_CXX_DEFINE_FOR_RMA(`SHMEM_CXX_COLLECT')

define(`SHMEM_CXX_FCOLLECT',
`static inline int shmemx_fcollect(shmemx_team_t team, $2* dest, const $2* source,
size_t nelems) {
return shmemx_$1_fcollect(team, dest, source, nelems);
}')dnl
SHMEM_CXX_DEFINE_FOR_RMA(`SHMEM_CXX_FCOLLECT')

define(`SHMEM_CXX_AND_REDUCE',
`static inline int shmemx_and_reduce(shmemx_team_t team, $2* dest, const $2* source,
size_t nreduce) {
return shmemx_$1_and_reduce(team, dest, source, nreduce);
}')dnl
SHMEM_CXX_DEFINE_FOR_COLL_AND_OR_XOR(`SHMEM_CXX_AND_REDUCE')

define(`SHMEM_CXX_MIN_REDUCE',
`static inline int shmemx_min_reduce(shmemx_team_t team, $2* dest, const $2* source,
size_t nreduce) {
return shmemx_$1_min_reduce(team, dest, source, nreduce);
}')dnl
SHMEM_CXX_DEFINE_FOR_COLL_MIN_MAX(`SHMEM_CXX_MIN_REDUCE')

define(`SHMEM_CXX_MAX_REDUCE',
`static inline int shmemx_max_reduce(shmemx_team_t team, $2* dest, const $2* source,
size_t nreduce) {
return shmemx_$1_max_reduce(team, dest, source, nreduce);
}')dnl
SHMEM_CXX_DEFINE_FOR_COLL_MIN_MAX(`SHMEM_CXX_MAX_REDUCE')

define(`SHMEM_CXX_SUM_REDUCE',
`static inline int shmemx_sum_reduce(shmemx_team_t team, $2* dest, const $2* source,
size_t nreduce) {
return shmemx_$1_sum_reduce(team, dest, source, nreduce);
}')dnl
SHMEM_CXX_DEFINE_FOR_COLL_SUM_PROD(`SHMEM_CXX_SUM_REDUCE')

define(`SHMEM_CXX_PROD_REDUCE',
`static inline int shmemx_prod_reduce(shmemx_team_t team, $2* dest, const $2* source,
size_t nreduce) {
return shmemx_$1_prod_reduce(team, dest, source, nreduce);
}')dnl
SHMEM_CXX_DEFINE_FOR_COLL_SUM_PROD(`SHMEM_CXX_PROD_REDUCE')

define(`SHMEM_CXX_ALLTOALL',
`static inline int shmemx_alltoall(shmemx_team_t team, $2* dest, const $2* source,
size_t nelems) {
return shmemx_$1_alltoall(team, dest, source, nelems);
}')dnl
SHMEM_CXX_DEFINE_FOR_RMA(`SHMEM_CXX_ALLTOALL')

define(`SHMEM_CXX_ALLTOALLS',
`static inline int shmemx_alltoalls(shmemx_team_t team, $2* dest, const $2* source,
ptrdiff_t dst, ptrdiff_t sst, size_t nelems) {
return shmemx_$1_alltoalls(team, dest, source, dst, sst, nelems);
}')dnl
SHMEM_CXX_DEFINE_FOR_RMA(`SHMEM_CXX_ALLTOALLS')

/* C11 Generic Macros */
#elif (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L && !defined(SHMEM_INTERNAL_INCLUDE))

Expand Down Expand Up @@ -348,6 +419,79 @@ SHMEM_BIND_C11_RMA(`SHMEM_CTX_C11_GEN_PUT_SIGNAL_NBI', `, \') \
SHMEM_BIND_C11_RMA(`SHMEM_C11_GEN_PUT_SIGNAL_NBI', `, \') \
)(__VA_ARGS__)

/* Team Collective Routines */
define(`SHMEM_C11_GEN_BCAST', ` $2*: shmemx_$1_broadcast')dnl
#define shmemx_broadcast(...) \
_Generic(SHMEM_C11_TYPE_EVAL_PTR(SHMEM_C11_ARG1(__VA_ARGS__)), \
SHMEM_BIND_C11_RMA(`SHMEM_C11_GEN_BCAST', `, \') \
)(__VA_ARGS__)

define(`SHMEM_C11_GEN_COLLECT', ` $2*: shmemx_$1_collect')dnl
#define shmemx_collect(...) \
_Generic(SHMEM_C11_TYPE_EVAL_PTR(SHMEM_C11_ARG1(__VA_ARGS__)), \
SHMEM_BIND_C11_RMA(`SHMEM_C11_GEN_COLLECT', `, \') \
)(__VA_ARGS__)

define(`SHMEM_C11_GEN_FCOLLECT', ` $2*: shmemx_$1_fcollect')dnl
#define shmemx_fcollect(...) \
_Generic(SHMEM_C11_TYPE_EVAL_PTR(SHMEM_C11_ARG1(__VA_ARGS__)), \
SHMEM_BIND_C11_RMA(`SHMEM_C11_GEN_FCOLLECT', `, \') \
)(__VA_ARGS__)

define(`SHMEM_C11_GEN_AND_REDUCE', ` $2*: shmemx_$1_and_reduce')dnl
#define shmemx_and_reduce(...) \
_Generic(SHMEM_C11_TYPE_EVAL_PTR(SHMEM_C11_ARG1(__VA_ARGS__)), \
SHMEM_BIND_C11_COLL_AND_OR_XOR(`SHMEM_C11_GEN_AND_REDUCE', `, \') \
)(__VA_ARGS__)

define(`SHMEM_C11_GEN_OR_REDUCE', ` $2*: shmemx_$1_or_reduce')dnl
#define shmemx_or_reduce(...) \
_Generic(SHMEM_C11_TYPE_EVAL_PTR(SHMEM_C11_ARG1(__VA_ARGS__)), \
SHMEM_BIND_C11_COLL_AND_OR_XOR(`SHMEM_C11_GEN_OR_REDUCE', `, \') \
)(__VA_ARGS__)

define(`SHMEM_C11_GEN_XOR_REDUCE', ` $2*: shmemx_$1_xor_reduce')dnl
#define shmemx_xor_reduce(...) \
_Generic(SHMEM_C11_TYPE_EVAL_PTR(SHMEM_C11_ARG1(__VA_ARGS__)), \
SHMEM_BIND_C11_COLL_AND_OR_XOR(`SHMEM_C11_GEN_XOR_REDUCE', `, \') \
)(__VA_ARGS__)

define(`SHMEM_C11_GEN_MIN_REDUCE', ` $2*: shmemx_$1_min_reduce')dnl
#define shmemx_min_reduce(...) \
_Generic(SHMEM_C11_TYPE_EVAL_PTR(SHMEM_C11_ARG1(__VA_ARGS__)), \
SHMEM_BIND_C11_COLL_MIN_MAX(`SHMEM_C11_GEN_MIN_REDUCE', `, \') \
)(__VA_ARGS__)

define(`SHMEM_C11_GEN_MAX_REDUCE', ` $2*: shmemx_$1_max_reduce')dnl
#define shmemx_max_reduce(...) \
_Generic(SHMEM_C11_TYPE_EVAL_PTR(SHMEM_C11_ARG1(__VA_ARGS__)), \
SHMEM_BIND_C11_COLL_MIN_MAX(`SHMEM_C11_GEN_MAX_REDUCE', `, \') \
)(__VA_ARGS__)

define(`SHMEM_C11_GEN_SUM_REDUCE', ` $2*: shmemx_$1_sum_reduce')dnl
#define shmemx_sum_reduce(...) \
_Generic(SHMEM_C11_TYPE_EVAL_PTR(SHMEM_C11_ARG1(__VA_ARGS__)), \
SHMEM_BIND_C11_COLL_SUM_PROD(`SHMEM_C11_GEN_SUM_REDUCE', `, \') \
)(__VA_ARGS__)

define(`SHMEM_C11_GEN_PROD_REDUCE', ` $2*: shmemx_$1_prod_reduce')dnl
#define shmemx_prod_reduce(...) \
_Generic(SHMEM_C11_TYPE_EVAL_PTR(SHMEM_C11_ARG1(__VA_ARGS__)), \
SHMEM_BIND_C11_COLL_SUM_PROD(`SHMEM_C11_GEN_PROD_REDUCE', `, \') \
)(__VA_ARGS__)

define(`SHMEM_C11_GEN_ALLTOALL', ` $2*: shmemx_$1_alltoall')dnl
#define shmemx_alltoall(...) \
_Generic(SHMEM_C11_TYPE_EVAL_PTR(SHMEM_C11_ARG1(__VA_ARGS__)), \
SHMEM_BIND_C11_RMA(`SHMEM_C11_GEN_ALLTOALL', `, \') \
)(__VA_ARGS__)

define(`SHMEM_C11_GEN_ALLTOALLS', ` $2*: shmemx_$1_alltoalls')dnl
#define shmemx_alltoalls(...) \
_Generic(SHMEM_C11_TYPE_EVAL_PTR(SHMEM_C11_ARG1(__VA_ARGS__)), \
SHMEM_BIND_C11_RMA(`SHMEM_C11_GEN_ALLTOALLS', `, \') \
)(__VA_ARGS__)

#endif /* C11 */

#endif /* SHMEMX_H */
Loading

0 comments on commit 9c22e2e

Please sign in to comment.