oshmem: Align OSHMEM API with spec v1.3 (extension api changes)
openshmem.org specification does not mention about extension api but there is an agreemnet to do these changes for related ex api too. see Annex G: Version 1.3 Added const to every read-only pointer argument
Этот коммит содержится в:
родитель
157f81b699
Коммит
75050b44a2
@ -60,9 +60,9 @@ OSHMEM_DECLSPEC void pshmemx_iput16(void* target, const void* source, ptrdiff_t
|
|||||||
/*
|
/*
|
||||||
* Elemental get routines
|
* Elemental get routines
|
||||||
*/
|
*/
|
||||||
OSHMEM_DECLSPEC int16_t pshmemx_int16_g(int16_t* addr, int pe);
|
OSHMEM_DECLSPEC int16_t pshmemx_int16_g(const int16_t* addr, int pe);
|
||||||
OSHMEM_DECLSPEC int32_t pshmemx_int32_g(int32_t* addr, int pe);
|
OSHMEM_DECLSPEC int32_t pshmemx_int32_g(const int32_t* addr, int pe);
|
||||||
OSHMEM_DECLSPEC int64_t pshmemx_int64_g(int64_t* addr, int pe);
|
OSHMEM_DECLSPEC int64_t pshmemx_int64_g(const int64_t* addr, int pe);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Block data get routines
|
* Block data get routines
|
||||||
@ -113,33 +113,33 @@ OSHMEM_DECLSPEC void pshmemx_int64_wait_until(int64_t *addr, int cmp, int64_t v
|
|||||||
/*
|
/*
|
||||||
* Reduction routines
|
* Reduction routines
|
||||||
*/
|
*/
|
||||||
OSHMEM_DECLSPEC void pshmemx_int16_and_to_all(int16_t *target, int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void pshmemx_int16_and_to_all(int16_t *target, const int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
|
||||||
OSHMEM_DECLSPEC void pshmemx_int32_and_to_all(int32_t *target, int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void pshmemx_int32_and_to_all(int32_t *target, const int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
|
||||||
OSHMEM_DECLSPEC void pshmemx_int64_and_to_all(int64_t *target, int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void pshmemx_int64_and_to_all(int64_t *target, const int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
|
||||||
|
|
||||||
OSHMEM_DECLSPEC void pshmemx_int16_or_to_all(int16_t *target, int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void pshmemx_int16_or_to_all(int16_t *target, const int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
|
||||||
OSHMEM_DECLSPEC void pshmemx_int32_or_to_all(int32_t *target, int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void pshmemx_int32_or_to_all(int32_t *target, const int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
|
||||||
OSHMEM_DECLSPEC void pshmemx_int64_or_to_all(int64_t *target, int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void pshmemx_int64_or_to_all(int64_t *target, const int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
|
||||||
|
|
||||||
OSHMEM_DECLSPEC void pshmemx_int16_xor_to_all(int16_t *target, int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void pshmemx_int16_xor_to_all(int16_t *target, const int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
|
||||||
OSHMEM_DECLSPEC void pshmemx_int32_xor_to_all(int32_t *target, int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void pshmemx_int32_xor_to_all(int32_t *target, const int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
|
||||||
OSHMEM_DECLSPEC void pshmemx_int64_xor_to_all(int64_t *target, int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void pshmemx_int64_xor_to_all(int64_t *target, const int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
|
||||||
|
|
||||||
OSHMEM_DECLSPEC void pshmemx_int16_max_to_all(int16_t *target, int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void pshmemx_int16_max_to_all(int16_t *target, const int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
|
||||||
OSHMEM_DECLSPEC void pshmemx_int32_max_to_all(int32_t *target, int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void pshmemx_int32_max_to_all(int32_t *target, const int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
|
||||||
OSHMEM_DECLSPEC void pshmemx_int64_max_to_all(int64_t *target, int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void pshmemx_int64_max_to_all(int64_t *target, const int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
|
||||||
|
|
||||||
OSHMEM_DECLSPEC void pshmemx_int16_min_to_all(int16_t *target, int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void pshmemx_int16_min_to_all(int16_t *target, const int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
|
||||||
OSHMEM_DECLSPEC void pshmemx_int32_min_to_all(int32_t *target, int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void pshmemx_int32_min_to_all(int32_t *target, const int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
|
||||||
OSHMEM_DECLSPEC void pshmemx_int64_min_to_all(int64_t *target, int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void pshmemx_int64_min_to_all(int64_t *target, const int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
|
||||||
|
|
||||||
OSHMEM_DECLSPEC void pshmemx_int16_sum_to_all(int16_t *target, int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void pshmemx_int16_sum_to_all(int16_t *target, const int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
|
||||||
OSHMEM_DECLSPEC void pshmemx_int32_sum_to_all(int32_t *target, int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void pshmemx_int32_sum_to_all(int32_t *target, const int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
|
||||||
OSHMEM_DECLSPEC void pshmemx_int64_sum_to_all(int64_t *target, int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void pshmemx_int64_sum_to_all(int64_t *target, const int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
|
||||||
|
|
||||||
OSHMEM_DECLSPEC void pshmemx_int16_prod_to_all(int16_t *target, int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void pshmemx_int16_prod_to_all(int16_t *target, const int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
|
||||||
OSHMEM_DECLSPEC void pshmemx_int32_prod_to_all(int32_t *target, int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void pshmemx_int32_prod_to_all(int32_t *target, const int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
|
||||||
OSHMEM_DECLSPEC void pshmemx_int64_prod_to_all(int64_t *target, int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void pshmemx_int64_prod_to_all(int64_t *target, const int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Backward compatibility section
|
* Backward compatibility section
|
||||||
|
@ -45,9 +45,9 @@ OSHMEM_DECLSPEC void shmemx_iput16(void* target, const void* source, ptrdiff_t t
|
|||||||
/*
|
/*
|
||||||
* Elemental get routines
|
* Elemental get routines
|
||||||
*/
|
*/
|
||||||
OSHMEM_DECLSPEC int16_t shmemx_int16_g(int16_t* addr, int pe);
|
OSHMEM_DECLSPEC int16_t shmemx_int16_g(const int16_t* addr, int pe);
|
||||||
OSHMEM_DECLSPEC int32_t shmemx_int32_g(int32_t* addr, int pe);
|
OSHMEM_DECLSPEC int32_t shmemx_int32_g(const int32_t* addr, int pe);
|
||||||
OSHMEM_DECLSPEC int64_t shmemx_int64_g(int64_t* addr, int pe);
|
OSHMEM_DECLSPEC int64_t shmemx_int64_g(const int64_t* addr, int pe);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Block data get routines
|
* Block data get routines
|
||||||
@ -98,33 +98,33 @@ OSHMEM_DECLSPEC void shmemx_int64_wait_until(int64_t *addr, int cmp, int64_t va
|
|||||||
/*
|
/*
|
||||||
* Reduction routines
|
* Reduction routines
|
||||||
*/
|
*/
|
||||||
OSHMEM_DECLSPEC void shmemx_int16_and_to_all(int16_t *target, int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void shmemx_int16_and_to_all(int16_t *target, const int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
|
||||||
OSHMEM_DECLSPEC void shmemx_int32_and_to_all(int32_t *target, int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void shmemx_int32_and_to_all(int32_t *target, const int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
|
||||||
OSHMEM_DECLSPEC void shmemx_int64_and_to_all(int64_t *target, int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void shmemx_int64_and_to_all(int64_t *target, const int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
|
||||||
|
|
||||||
OSHMEM_DECLSPEC void shmemx_int16_or_to_all(int16_t *target, int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void shmemx_int16_or_to_all(int16_t *target, const int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
|
||||||
OSHMEM_DECLSPEC void shmemx_int32_or_to_all(int32_t *target, int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void shmemx_int32_or_to_all(int32_t *target, const int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
|
||||||
OSHMEM_DECLSPEC void shmemx_int64_or_to_all(int64_t *target, int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void shmemx_int64_or_to_all(int64_t *target, const int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
|
||||||
|
|
||||||
OSHMEM_DECLSPEC void shmemx_int16_xor_to_all(int16_t *target, int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void shmemx_int16_xor_to_all(int16_t *target, const int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
|
||||||
OSHMEM_DECLSPEC void shmemx_int32_xor_to_all(int32_t *target, int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void shmemx_int32_xor_to_all(int32_t *target, const int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
|
||||||
OSHMEM_DECLSPEC void shmemx_int64_xor_to_all(int64_t *target, int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void shmemx_int64_xor_to_all(int64_t *target, const int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
|
||||||
|
|
||||||
OSHMEM_DECLSPEC void shmemx_int16_max_to_all(int16_t *target, int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void shmemx_int16_max_to_all(int16_t *target, const int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
|
||||||
OSHMEM_DECLSPEC void shmemx_int32_max_to_all(int32_t *target, int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void shmemx_int32_max_to_all(int32_t *target, const int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
|
||||||
OSHMEM_DECLSPEC void shmemx_int64_max_to_all(int64_t *target, int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void shmemx_int64_max_to_all(int64_t *target, const int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
|
||||||
|
|
||||||
OSHMEM_DECLSPEC void shmemx_int16_min_to_all(int16_t *target, int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void shmemx_int16_min_to_all(int16_t *target, const int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
|
||||||
OSHMEM_DECLSPEC void shmemx_int32_min_to_all(int32_t *target, int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void shmemx_int32_min_to_all(int32_t *target, const int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
|
||||||
OSHMEM_DECLSPEC void shmemx_int64_min_to_all(int64_t *target, int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void shmemx_int64_min_to_all(int64_t *target, const int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
|
||||||
|
|
||||||
OSHMEM_DECLSPEC void shmemx_int16_sum_to_all(int16_t *target, int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void shmemx_int16_sum_to_all(int16_t *target, const int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
|
||||||
OSHMEM_DECLSPEC void shmemx_int32_sum_to_all(int32_t *target, int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void shmemx_int32_sum_to_all(int32_t *target, const int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
|
||||||
OSHMEM_DECLSPEC void shmemx_int64_sum_to_all(int64_t *target, int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void shmemx_int64_sum_to_all(int64_t *target, const int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
|
||||||
|
|
||||||
OSHMEM_DECLSPEC void shmemx_int16_prod_to_all(int16_t *target, int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void shmemx_int16_prod_to_all(int16_t *target, const int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
|
||||||
OSHMEM_DECLSPEC void shmemx_int32_prod_to_all(int32_t *target, int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void shmemx_int32_prod_to_all(int32_t *target, const int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
|
||||||
OSHMEM_DECLSPEC void shmemx_int64_prod_to_all(int64_t *target, int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
|
OSHMEM_DECLSPEC void shmemx_int64_prod_to_all(int64_t *target, const int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Backward compatibility section
|
* Backward compatibility section
|
||||||
|
@ -43,28 +43,6 @@
|
|||||||
return out_value; \
|
return out_value; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define SHMEM_TYPE_GX(type_name, type, prefix) \
|
|
||||||
type prefix##type_name##_g(type *addr, int pe) \
|
|
||||||
{ \
|
|
||||||
int rc = OSHMEM_SUCCESS; \
|
|
||||||
size_t size = 0; \
|
|
||||||
type out_value; \
|
|
||||||
\
|
|
||||||
RUNTIME_CHECK_INIT(); \
|
|
||||||
RUNTIME_CHECK_PE(pe); \
|
|
||||||
RUNTIME_CHECK_ADDR(addr); \
|
|
||||||
\
|
|
||||||
size = sizeof(out_value); \
|
|
||||||
rc = MCA_SPML_CALL(get( \
|
|
||||||
(void*)addr, \
|
|
||||||
size, \
|
|
||||||
(void*)&out_value, \
|
|
||||||
pe)); \
|
|
||||||
RUNTIME_CHECK_RC(rc); \
|
|
||||||
\
|
|
||||||
return out_value; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#if OSHMEM_PROFILING
|
#if OSHMEM_PROFILING
|
||||||
#include "oshmem/include/pshmem.h"
|
#include "oshmem/include/pshmem.h"
|
||||||
#pragma weak shmem_char_g = pshmem_char_g
|
#pragma weak shmem_char_g = pshmem_char_g
|
||||||
@ -89,6 +67,6 @@ SHMEM_TYPE_G(_longlong, long long, shmem)
|
|||||||
SHMEM_TYPE_G(_float, float, shmem)
|
SHMEM_TYPE_G(_float, float, shmem)
|
||||||
SHMEM_TYPE_G(_double, double, shmem)
|
SHMEM_TYPE_G(_double, double, shmem)
|
||||||
SHMEM_TYPE_G(_longdouble, long double, shmem)
|
SHMEM_TYPE_G(_longdouble, long double, shmem)
|
||||||
SHMEM_TYPE_GX(_int16, int16_t, shmemx)
|
SHMEM_TYPE_G(_int16, int16_t, shmemx)
|
||||||
SHMEM_TYPE_GX(_int32, int32_t, shmemx)
|
SHMEM_TYPE_G(_int32, int32_t, shmemx)
|
||||||
SHMEM_TYPE_GX(_int64, int64_t, shmemx)
|
SHMEM_TYPE_G(_int64, int64_t, shmemx)
|
||||||
|
@ -95,69 +95,6 @@ static bool __group_cache_enabled = true;
|
|||||||
RUNTIME_CHECK_RC(rc); \
|
RUNTIME_CHECK_RC(rc); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define SHMEM_TYPE_REDUCE_OPX(name, type_name, type, prefix) \
|
|
||||||
void prefix##type_name##_##name##_to_all( type *target, \
|
|
||||||
type *source, \
|
|
||||||
int nreduce, \
|
|
||||||
int PE_start, \
|
|
||||||
int logPE_stride, \
|
|
||||||
int PE_size, \
|
|
||||||
type *pWrk, \
|
|
||||||
long *pSync ) \
|
|
||||||
{ \
|
|
||||||
int rc = OSHMEM_SUCCESS; \
|
|
||||||
oshmem_group_t* group = NULL; \
|
|
||||||
\
|
|
||||||
RUNTIME_CHECK_INIT(); \
|
|
||||||
RUNTIME_CHECK_ADDR(target); \
|
|
||||||
RUNTIME_CHECK_ADDR(source); \
|
|
||||||
\
|
|
||||||
{ \
|
|
||||||
/* Create group basing PE_start, logPE_stride and PE_size */ \
|
|
||||||
if (!__group_cache_enabled) \
|
|
||||||
{ \
|
|
||||||
group = oshmem_proc_group_create(PE_start, (1 << logPE_stride), PE_size); \
|
|
||||||
if (!group) \
|
|
||||||
rc = OSHMEM_ERROR; \
|
|
||||||
} \
|
|
||||||
else \
|
|
||||||
{ \
|
|
||||||
group = find_group_in_cache(PE_start,logPE_stride,PE_size); \
|
|
||||||
if (!group) \
|
|
||||||
{ \
|
|
||||||
group = oshmem_proc_group_create(PE_start, (1 << logPE_stride), PE_size); \
|
|
||||||
if (!group) \
|
|
||||||
rc = OSHMEM_ERROR; \
|
|
||||||
cache_group(group,PE_start,logPE_stride,PE_size); \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
\
|
|
||||||
/* Collective operation call */ \
|
|
||||||
if ( rc == OSHMEM_SUCCESS ) \
|
|
||||||
{ \
|
|
||||||
oshmem_op_t* op = oshmem_op_##name##type_name; \
|
|
||||||
size_t size = nreduce * op->dt_size; \
|
|
||||||
\
|
|
||||||
/* Call collective reduce operation */ \
|
|
||||||
rc = group->g_scoll.scoll_reduce( \
|
|
||||||
group, \
|
|
||||||
op, \
|
|
||||||
(void*)target, \
|
|
||||||
(const void*)source, \
|
|
||||||
size, \
|
|
||||||
pSync, \
|
|
||||||
(void*)pWrk, \
|
|
||||||
SCOLL_DEFAULT_ALG ); \
|
|
||||||
} \
|
|
||||||
\
|
|
||||||
if ( !__group_cache_enabled && (rc == OSHMEM_SUCCESS ) ) \
|
|
||||||
{ \
|
|
||||||
oshmem_proc_group_destroy(group); \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
RUNTIME_CHECK_RC(rc); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#if OSHMEM_PROFILING
|
#if OSHMEM_PROFILING
|
||||||
#include "oshmem/include/pshmem.h"
|
#include "oshmem/include/pshmem.h"
|
||||||
#pragma weak shmem_short_and_to_all = pshmem_short_and_to_all
|
#pragma weak shmem_short_and_to_all = pshmem_short_and_to_all
|
||||||
@ -238,25 +175,25 @@ SHMEM_TYPE_REDUCE_OP(and, _short, short, shmem)
|
|||||||
SHMEM_TYPE_REDUCE_OP(and, _int, int, shmem)
|
SHMEM_TYPE_REDUCE_OP(and, _int, int, shmem)
|
||||||
SHMEM_TYPE_REDUCE_OP(and, _long, long, shmem)
|
SHMEM_TYPE_REDUCE_OP(and, _long, long, shmem)
|
||||||
SHMEM_TYPE_REDUCE_OP(and, _longlong, long long, shmem)
|
SHMEM_TYPE_REDUCE_OP(and, _longlong, long long, shmem)
|
||||||
SHMEM_TYPE_REDUCE_OPX(and, _int16, int16_t, shmemx)
|
SHMEM_TYPE_REDUCE_OP(and, _int16, int16_t, shmemx)
|
||||||
SHMEM_TYPE_REDUCE_OPX(and, _int32, int32_t, shmemx)
|
SHMEM_TYPE_REDUCE_OP(and, _int32, int32_t, shmemx)
|
||||||
SHMEM_TYPE_REDUCE_OPX(and, _int64, int64_t, shmemx)
|
SHMEM_TYPE_REDUCE_OP(and, _int64, int64_t, shmemx)
|
||||||
|
|
||||||
SHMEM_TYPE_REDUCE_OP(or, _short, short, shmem)
|
SHMEM_TYPE_REDUCE_OP(or, _short, short, shmem)
|
||||||
SHMEM_TYPE_REDUCE_OP(or, _int, int, shmem)
|
SHMEM_TYPE_REDUCE_OP(or, _int, int, shmem)
|
||||||
SHMEM_TYPE_REDUCE_OP(or, _long, long, shmem)
|
SHMEM_TYPE_REDUCE_OP(or, _long, long, shmem)
|
||||||
SHMEM_TYPE_REDUCE_OP(or, _longlong, long long, shmem)
|
SHMEM_TYPE_REDUCE_OP(or, _longlong, long long, shmem)
|
||||||
SHMEM_TYPE_REDUCE_OPX(or, _int16, int16_t, shmemx)
|
SHMEM_TYPE_REDUCE_OP(or, _int16, int16_t, shmemx)
|
||||||
SHMEM_TYPE_REDUCE_OPX(or, _int32, int32_t, shmemx)
|
SHMEM_TYPE_REDUCE_OP(or, _int32, int32_t, shmemx)
|
||||||
SHMEM_TYPE_REDUCE_OPX(or, _int64, int64_t, shmemx)
|
SHMEM_TYPE_REDUCE_OP(or, _int64, int64_t, shmemx)
|
||||||
|
|
||||||
SHMEM_TYPE_REDUCE_OP(xor, _short, short, shmem)
|
SHMEM_TYPE_REDUCE_OP(xor, _short, short, shmem)
|
||||||
SHMEM_TYPE_REDUCE_OP(xor, _int, int, shmem)
|
SHMEM_TYPE_REDUCE_OP(xor, _int, int, shmem)
|
||||||
SHMEM_TYPE_REDUCE_OP(xor, _long, long, shmem)
|
SHMEM_TYPE_REDUCE_OP(xor, _long, long, shmem)
|
||||||
SHMEM_TYPE_REDUCE_OP(xor, _longlong, long long, shmem)
|
SHMEM_TYPE_REDUCE_OP(xor, _longlong, long long, shmem)
|
||||||
SHMEM_TYPE_REDUCE_OPX(xor, _int16, int16_t, shmemx)
|
SHMEM_TYPE_REDUCE_OP(xor, _int16, int16_t, shmemx)
|
||||||
SHMEM_TYPE_REDUCE_OPX(xor, _int32, int32_t, shmemx)
|
SHMEM_TYPE_REDUCE_OP(xor, _int32, int32_t, shmemx)
|
||||||
SHMEM_TYPE_REDUCE_OPX(xor, _int64, int64_t, shmemx)
|
SHMEM_TYPE_REDUCE_OP(xor, _int64, int64_t, shmemx)
|
||||||
|
|
||||||
SHMEM_TYPE_REDUCE_OP(max, _short, short, shmem)
|
SHMEM_TYPE_REDUCE_OP(max, _short, short, shmem)
|
||||||
SHMEM_TYPE_REDUCE_OP(max, _int, int, shmem)
|
SHMEM_TYPE_REDUCE_OP(max, _int, int, shmem)
|
||||||
@ -265,9 +202,9 @@ SHMEM_TYPE_REDUCE_OP(max, _longlong, long long, shmem)
|
|||||||
SHMEM_TYPE_REDUCE_OP(max, _float, float, shmem)
|
SHMEM_TYPE_REDUCE_OP(max, _float, float, shmem)
|
||||||
SHMEM_TYPE_REDUCE_OP(max, _double, double, shmem)
|
SHMEM_TYPE_REDUCE_OP(max, _double, double, shmem)
|
||||||
SHMEM_TYPE_REDUCE_OP(max, _longdouble, long double, shmem)
|
SHMEM_TYPE_REDUCE_OP(max, _longdouble, long double, shmem)
|
||||||
SHMEM_TYPE_REDUCE_OPX(max, _int16, int16_t, shmemx)
|
SHMEM_TYPE_REDUCE_OP(max, _int16, int16_t, shmemx)
|
||||||
SHMEM_TYPE_REDUCE_OPX(max, _int32, int32_t, shmemx)
|
SHMEM_TYPE_REDUCE_OP(max, _int32, int32_t, shmemx)
|
||||||
SHMEM_TYPE_REDUCE_OPX(max, _int64, int64_t, shmemx)
|
SHMEM_TYPE_REDUCE_OP(max, _int64, int64_t, shmemx)
|
||||||
|
|
||||||
SHMEM_TYPE_REDUCE_OP(min, _short, short, shmem)
|
SHMEM_TYPE_REDUCE_OP(min, _short, short, shmem)
|
||||||
SHMEM_TYPE_REDUCE_OP(min, _int, int, shmem)
|
SHMEM_TYPE_REDUCE_OP(min, _int, int, shmem)
|
||||||
@ -276,9 +213,9 @@ SHMEM_TYPE_REDUCE_OP(min, _longlong, long long, shmem)
|
|||||||
SHMEM_TYPE_REDUCE_OP(min, _float, float, shmem)
|
SHMEM_TYPE_REDUCE_OP(min, _float, float, shmem)
|
||||||
SHMEM_TYPE_REDUCE_OP(min, _double, double, shmem)
|
SHMEM_TYPE_REDUCE_OP(min, _double, double, shmem)
|
||||||
SHMEM_TYPE_REDUCE_OP(min, _longdouble, long double, shmem)
|
SHMEM_TYPE_REDUCE_OP(min, _longdouble, long double, shmem)
|
||||||
SHMEM_TYPE_REDUCE_OPX(min, _int16, int16_t, shmemx)
|
SHMEM_TYPE_REDUCE_OP(min, _int16, int16_t, shmemx)
|
||||||
SHMEM_TYPE_REDUCE_OPX(min, _int32, int32_t, shmemx)
|
SHMEM_TYPE_REDUCE_OP(min, _int32, int32_t, shmemx)
|
||||||
SHMEM_TYPE_REDUCE_OPX(min, _int64, int64_t, shmemx)
|
SHMEM_TYPE_REDUCE_OP(min, _int64, int64_t, shmemx)
|
||||||
|
|
||||||
SHMEM_TYPE_REDUCE_OP(sum, _short, short, shmem)
|
SHMEM_TYPE_REDUCE_OP(sum, _short, short, shmem)
|
||||||
SHMEM_TYPE_REDUCE_OP(sum, _int, int, shmem)
|
SHMEM_TYPE_REDUCE_OP(sum, _int, int, shmem)
|
||||||
@ -289,9 +226,9 @@ SHMEM_TYPE_REDUCE_OP(sum, _double, double, shmem)
|
|||||||
SHMEM_TYPE_REDUCE_OP(sum, _longdouble, long double, shmem)
|
SHMEM_TYPE_REDUCE_OP(sum, _longdouble, long double, shmem)
|
||||||
SHMEM_TYPE_REDUCE_OP(sum, _complexf, float complex, shmem)
|
SHMEM_TYPE_REDUCE_OP(sum, _complexf, float complex, shmem)
|
||||||
SHMEM_TYPE_REDUCE_OP(sum, _complexd, double complex, shmem)
|
SHMEM_TYPE_REDUCE_OP(sum, _complexd, double complex, shmem)
|
||||||
SHMEM_TYPE_REDUCE_OPX(sum, _int16, int16_t, shmemx)
|
SHMEM_TYPE_REDUCE_OP(sum, _int16, int16_t, shmemx)
|
||||||
SHMEM_TYPE_REDUCE_OPX(sum, _int32, int32_t, shmemx)
|
SHMEM_TYPE_REDUCE_OP(sum, _int32, int32_t, shmemx)
|
||||||
SHMEM_TYPE_REDUCE_OPX(sum, _int64, int64_t, shmemx)
|
SHMEM_TYPE_REDUCE_OP(sum, _int64, int64_t, shmemx)
|
||||||
|
|
||||||
SHMEM_TYPE_REDUCE_OP(prod, _short, short, shmem)
|
SHMEM_TYPE_REDUCE_OP(prod, _short, short, shmem)
|
||||||
SHMEM_TYPE_REDUCE_OP(prod, _int, int, shmem)
|
SHMEM_TYPE_REDUCE_OP(prod, _int, int, shmem)
|
||||||
@ -302,6 +239,6 @@ SHMEM_TYPE_REDUCE_OP(prod, _double, double, shmem)
|
|||||||
SHMEM_TYPE_REDUCE_OP(prod, _longdouble, long double, shmem)
|
SHMEM_TYPE_REDUCE_OP(prod, _longdouble, long double, shmem)
|
||||||
SHMEM_TYPE_REDUCE_OP(prod, _complexf, float complex, shmem)
|
SHMEM_TYPE_REDUCE_OP(prod, _complexf, float complex, shmem)
|
||||||
SHMEM_TYPE_REDUCE_OP(prod, _complexd, double complex, shmem)
|
SHMEM_TYPE_REDUCE_OP(prod, _complexd, double complex, shmem)
|
||||||
SHMEM_TYPE_REDUCE_OPX(prod, _int16, int16_t, shmemx)
|
SHMEM_TYPE_REDUCE_OP(prod, _int16, int16_t, shmemx)
|
||||||
SHMEM_TYPE_REDUCE_OPX(prod, _int32, int32_t, shmemx)
|
SHMEM_TYPE_REDUCE_OP(prod, _int32, int32_t, shmemx)
|
||||||
SHMEM_TYPE_REDUCE_OPX(prod, _int64, int64_t, shmemx)
|
SHMEM_TYPE_REDUCE_OP(prod, _int64, int64_t, shmemx)
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user