1
1

Merge pull request #1149 from igor-ivanov/pr/oshmem-spec1.2

Fix: align OSHMEM API with spec v1.2
Этот коммит содержится в:
Mike Dubman 2015-11-26 11:45:16 +02:00
родитель 0482a02e5f 217423e278
Коммит f122d4f770
83 изменённых файлов: 1964 добавлений и 793 удалений

Просмотреть файл

@ -12,16 +12,25 @@
#include <stdio.h>
#include "shmem.h"
#if !defined(OSHMEM_SPEC_VERSION) || OSHMEM_SPEC_VERSION < 10200
#error This application uses API 1.2 and up
#endif
int main(int argc, char* argv[])
{
int proc, nproc;
char name[SHMEM_MAX_NAME_LEN];
int major, minor;
start_pes(0);
nproc = _num_pes();
proc = _my_pe();
shmem_init();
nproc = shmem_n_pes();
proc = shmem_my_pe();
shmem_info_get_name(name);
shmem_info_get_version(&major, &minor);
printf("Hello, world, I am %d of %d\n",
proc, nproc);
printf("Hello, world, I am %d of %d: %s (version: %d.%d)\n",
proc, nproc, name, major, minor);
shmem_finalize();
return 0;
}

Просмотреть файл

@ -13,11 +13,17 @@ program hello_oshmem
include 'shmem.fh'
integer proc, nproc
integer my_pe, num_pes
integer shmem_my_pe, shmem_n_pes
integer major, minor, len
character(len=SHMEM_MAX_NAME_LEN) name
call START_PES(0)
proc = MY_PE()
nproc = NUM_PES()
call SHMEM_INIT()
proc = SHMEM_MY_PE()
nproc = SHMEM_N_PES()
call SHMEM_INFO_GET_VERSION(major, minor)
call SHMEM_INFO_GET_NAME(name)
write(*, '("Hello, world, I am ", i2, " of ", i2, ": (version: ", i0, ".", i0, ")")') proc, nproc, major, minor
call SHMEM_FINALIZE()
write(*, '("Hello, world, I am ", i2, " of ", i2)') proc, nproc
end program hello_oshmem

Просмотреть файл

@ -11,6 +11,8 @@
#include <stdio.h>
#include <shmem.h>
#warning This application uses deprecated API see http://www.open-mpi.org/
int main (void)
{
static int aaa, bbb;

Просмотреть файл

@ -15,6 +15,8 @@
#include <shmem.h>
#warning This application uses deprecated API see http://www.open-mpi.org/
long pSync[_SHMEM_BCAST_SYNC_SIZE];
#define N 3

Просмотреть файл

@ -15,6 +15,8 @@
#include <shmem.h>
#warning This application uses deprecated API see http://www.open-mpi.org/
int main(void)
{
long *x;

Просмотреть файл

@ -27,6 +27,8 @@
#include <stdio.h>
#include <shmem.h>
#warning This application uses deprecated API see http://www.open-mpi.org/
int main(void)
{
short source[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };

Просмотреть файл

@ -11,6 +11,8 @@
#include <stdio.h>
#include <shmem.h>
#warning This application uses deprecated API see http://www.open-mpi.org/
#define SIZE 16
int main(int argc, char* argv[])

Просмотреть файл

@ -11,15 +11,19 @@
#include <shmem.h>
#include <stdio.h>
#if !defined(OSHMEM_SPEC_VERSION) || OSHMEM_SPEC_VERSION < 10200
#error This application uses API 1.2 and up
#endif
int main (int argc, char * argv[])
{
static int rbuf = -1;
int proc, nproc, next;
int message = 10;
start_pes(0);
proc = _my_pe();
nproc = _num_pes();
shmem_init();
nproc = shmem_n_pes();
proc = shmem_my_pe();
/* Calculate the PE number of the next process in the ring. Use the
modulus operator so that the last process "wraps around" to PE 0. */
@ -51,6 +55,7 @@ int main (int argc, char * argv[])
--message;
}
}
shmem_finalize();
/* All done */

Просмотреть файл

@ -92,6 +92,7 @@ endif
include op/Makefile.am
include proc/Makefile.am
include request/Makefile.am
include info/Makefile.am
include runtime/Makefile.am
include shmem/Makefile.am
include shmem/man/man3/Makefile.extra

Просмотреть файл

@ -53,7 +53,8 @@ extern "C" {
/*
* Initialization routines
*/
OSHMEM_DECLSPEC void pstart_pes(int npes);
OSHMEM_DECLSPEC void pshmem_init(void);
OSHMEM_DECLSPEC void pshmem_global_exit(int status);
/*
* Finalization routines
@ -63,8 +64,8 @@ OSHMEM_DECLSPEC void pshmem_finalize(void) OSHMEM_DESTRUCTOR;
/*
* Query routines
*/
OSHMEM_DECLSPEC int p_num_pes(void);
OSHMEM_DECLSPEC int p_my_pe(void);
OSHMEM_DECLSPEC int pshmem_n_pes(void);
OSHMEM_DECLSPEC int pshmem_my_pe(void);
/*
@ -76,10 +77,10 @@ OSHMEM_DECLSPEC int pshmem_addr_accessible(void *addr, int pe);
/*
* Symmetric heap routines
*/
OSHMEM_DECLSPEC void* pshmalloc(size_t size);
OSHMEM_DECLSPEC void* pshmemalign(size_t align, size_t size);
OSHMEM_DECLSPEC void* pshrealloc(void *ptr, size_t size);
OSHMEM_DECLSPEC void pshfree(void* ptr);
OSHMEM_DECLSPEC void* pshmem_malloc(size_t size);
OSHMEM_DECLSPEC void* pshmem_align(size_t align, size_t size);
OSHMEM_DECLSPEC void* pshmem_realloc(void *ptr, size_t size);
OSHMEM_DECLSPEC void pshmem_free(void* ptr);
/*
* Remote pointer operations
@ -89,6 +90,7 @@ OSHMEM_DECLSPEC void *pshmem_ptr(void *ptr, int pe);
/*
* Elemental put routines
*/
OSHMEM_DECLSPEC void pshmem_char_p(char* addr, char value, int pe);
OSHMEM_DECLSPEC void pshmem_short_p(short* addr, short value, int pe);
OSHMEM_DECLSPEC void pshmem_int_p(int* addr, int value, int pe);
OSHMEM_DECLSPEC void pshmem_long_p(long* addr, long value, int pe);
@ -100,7 +102,6 @@ OSHMEM_DECLSPEC void pshmem_longdouble_p(long double* addr, long double value,
/*
* Block data put routines
*/
OSHMEM_DECLSPEC void pshmem_char_put(char *target, const char *source, size_t len, int pe);
OSHMEM_DECLSPEC void pshmem_short_put(short *target, const short *source, size_t len, int pe);
OSHMEM_DECLSPEC void pshmem_int_put(int* target, const int* source, size_t len, int pe);
OSHMEM_DECLSPEC void pshmem_long_put(long *target, const long *source, size_t len, int pe);
@ -116,8 +117,8 @@ OSHMEM_DECLSPEC void pshmem_putmem(void *target, const void *source, size_t len
/*
* Strided put routines
*/
OSHMEM_DECLSPEC void pshmem_int_iput(int* target, const int* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
OSHMEM_DECLSPEC void pshmem_short_iput(short* target, const short* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
OSHMEM_DECLSPEC void pshmem_int_iput(int* target, const int* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
OSHMEM_DECLSPEC void pshmem_float_iput(float* target, const float* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
OSHMEM_DECLSPEC void pshmem_double_iput(double* target, const double* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
OSHMEM_DECLSPEC void pshmem_longlong_iput(long long* target, const long long* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
@ -130,6 +131,7 @@ OSHMEM_DECLSPEC void pshmem_iput128(void* target, const void* source, ptrdiff_t
/*
* Elemental get routines
*/
OSHMEM_DECLSPEC char pshmem_char_g(char* addr, int pe);
OSHMEM_DECLSPEC short pshmem_short_g(short* addr, int pe);
OSHMEM_DECLSPEC int pshmem_int_g(int* addr, int pe);
OSHMEM_DECLSPEC long pshmem_long_g(long* addr, int pe);
@ -141,7 +143,6 @@ OSHMEM_DECLSPEC long double pshmem_longdouble_g(long double* addr, int pe);
/*
* Block data get routines
*/
OSHMEM_DECLSPEC void pshmem_char_get(char *target, const char *source, size_t len, int pe);
OSHMEM_DECLSPEC void pshmem_short_get(short *target, const short *source, size_t len, int pe);
OSHMEM_DECLSPEC void pshmem_int_get(int *target, const int *source, size_t len, int pe);
OSHMEM_DECLSPEC void pshmem_long_get(long *target, const long *source, size_t len, int pe);

Просмотреть файл

@ -16,110 +16,194 @@
extern "C" {
#endif
/*
* Legacy API
* old init/destruct functions - not in the open shmem spec but still supported
*/
OSHMEM_DECLSPEC void pstart_pes(int npes);
OSHMEM_DECLSPEC int p_num_pes(void);
OSHMEM_DECLSPEC int p_my_pe(void);
OSHMEM_DECLSPEC void* pshmalloc(size_t size);
OSHMEM_DECLSPEC void* pshmemalign(size_t align, size_t size);
OSHMEM_DECLSPEC void* pshrealloc(void *ptr, size_t size);
OSHMEM_DECLSPEC void pshfree(void* ptr);
OSHMEM_DECLSPEC void pshmem_char_put(char *target, const char *source, size_t len, int pe);
OSHMEM_DECLSPEC void pshmem_char_get(char *target, const char *source, size_t len, int pe);
/*
* All OpenSHMEM extension APIs that are not part of this specification must be defined in the shmemx.h include
* file. These extensions shall use the shmemx_ prefix for all routine, variable, and constant names.
*/
/*
* Elemental put routines
*/
OSHMEM_DECLSPEC void pshmem_char_p(char* addr, char value, int pe);
OSHMEM_DECLSPEC void pshmem_int16_p(int16_t* addr, int16_t value, int pe);
OSHMEM_DECLSPEC void pshmem_int32_p(int32_t* addr, int32_t value, int pe);
OSHMEM_DECLSPEC void pshmem_int64_p(int64_t* addr, int64_t value, int pe);
OSHMEM_DECLSPEC void pshmemx_int16_p(int16_t* addr, int16_t value, int pe);
OSHMEM_DECLSPEC void pshmemx_int32_p(int32_t* addr, int32_t value, int pe);
OSHMEM_DECLSPEC void pshmemx_int64_p(int64_t* addr, int64_t value, int pe);
/*
* Block data put routines
*/
OSHMEM_DECLSPEC void pshmem_put16(void *target, const void *source, size_t len, int pe);
OSHMEM_DECLSPEC void pshmemx_put16(void *target, const void *source, size_t len, int pe);
/*
* Strided put routines
*/
OSHMEM_DECLSPEC void pshmem_iput16(void* target, const void* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
OSHMEM_DECLSPEC void pshmemx_iput16(void* target, const void* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
/*
* Elemental get routines
*/
OSHMEM_DECLSPEC char pshmem_char_g(char* addr, int pe);
OSHMEM_DECLSPEC int16_t pshmem_int16_g(int16_t* addr, int pe);
OSHMEM_DECLSPEC int32_t pshmem_int32_g(int32_t* addr, int pe);
OSHMEM_DECLSPEC int64_t pshmem_int64_g(int64_t* addr, int pe);
OSHMEM_DECLSPEC int16_t pshmemx_int16_g(int16_t* addr, int pe);
OSHMEM_DECLSPEC int32_t pshmemx_int32_g(int32_t* addr, int pe);
OSHMEM_DECLSPEC int64_t pshmemx_int64_g(int64_t* addr, int pe);
/*
* Block data get routines
*/
OSHMEM_DECLSPEC void pshmem_get16(void *target, const void *source, size_t len, int pe);
OSHMEM_DECLSPEC void pshmemx_get16(void *target, const void *source, size_t len, int pe);
/*
* Strided get routines
*/
OSHMEM_DECLSPEC void pshmem_iget16(void* target, const void* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
OSHMEM_DECLSPEC void pshmemx_iget16(void* target, const void* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
/*
* Atomic operations
*/
/* Atomic swap */
OSHMEM_DECLSPEC int32_t pshmem_int32_swap(int32_t *target, int32_t value, int pe);
OSHMEM_DECLSPEC int64_t pshmem_int64_swap(int64_t *target, int64_t value, int pe);
OSHMEM_DECLSPEC int32_t pshmemx_int32_swap(int32_t *target, int32_t value, int pe);
OSHMEM_DECLSPEC int64_t pshmemx_int64_swap(int64_t *target, int64_t value, int pe);
/* Atomic conditional swap */
OSHMEM_DECLSPEC int32_t pshmem_int32_cswap(int32_t *target, int32_t cond, int32_t value, int pe);
OSHMEM_DECLSPEC int64_t pshmem_int64_cswap(int64_t *target, int64_t cond, int64_t value, int pe);
OSHMEM_DECLSPEC int32_t pshmemx_int32_cswap(int32_t *target, int32_t cond, int32_t value, int pe);
OSHMEM_DECLSPEC int64_t pshmemx_int64_cswap(int64_t *target, int64_t cond, int64_t value, int pe);
/* Atomic Fetch&Add */
OSHMEM_DECLSPEC int32_t pshmem_int32_fadd(int32_t *target, int32_t value, int pe);
OSHMEM_DECLSPEC int64_t pshmem_int64_fadd(int64_t *target, int64_t value, int pe);
OSHMEM_DECLSPEC int32_t pshmemx_int32_fadd(int32_t *target, int32_t value, int pe);
OSHMEM_DECLSPEC int64_t pshmemx_int64_fadd(int64_t *target, int64_t value, int pe);
/* Atomic Fetch&Inc */
OSHMEM_DECLSPEC int32_t pshmem_int32_finc(int32_t *target, int pe);
OSHMEM_DECLSPEC int64_t pshmem_int64_finc(int64_t *target, int pe);
OSHMEM_DECLSPEC int32_t pshmemx_int32_finc(int32_t *target, int pe);
OSHMEM_DECLSPEC int64_t pshmemx_int64_finc(int64_t *target, int pe);
/* Atomic Add*/
OSHMEM_DECLSPEC void pshmem_int32_add(int32_t *target, int32_t value, int pe);
OSHMEM_DECLSPEC void pshmem_int64_add(int64_t *target, int64_t value, int pe);
OSHMEM_DECLSPEC void pshmemx_int32_add(int32_t *target, int32_t value, int pe);
OSHMEM_DECLSPEC void pshmemx_int64_add(int64_t *target, int64_t value, int pe);
/* Atomic Inc */
OSHMEM_DECLSPEC void pshmem_int32_inc(int32_t *target, int pe);
OSHMEM_DECLSPEC void pshmem_int64_inc(int64_t *target, int pe);
OSHMEM_DECLSPEC void pshmemx_int32_inc(int32_t *target, int pe);
OSHMEM_DECLSPEC void pshmemx_int64_inc(int64_t *target, int pe);
/*
* P2P sync routines
*/
OSHMEM_DECLSPEC void pshmem_int16_wait(int16_t *addr, int16_t value);
OSHMEM_DECLSPEC void pshmem_int32_wait(int32_t *addr, int32_t value);
OSHMEM_DECLSPEC void pshmem_int64_wait(int64_t *addr, int64_t value);
OSHMEM_DECLSPEC void pshmemx_int32_wait(int32_t *addr, int32_t value);
OSHMEM_DECLSPEC void pshmemx_int64_wait(int64_t *addr, int64_t value);
OSHMEM_DECLSPEC void pshmem_int16_wait_until(int16_t *addr, int cmp, int16_t value);
OSHMEM_DECLSPEC void pshmem_int32_wait_until(int32_t *addr, int cmp, int32_t value);
OSHMEM_DECLSPEC void pshmem_int64_wait_until(int64_t *addr, int cmp, int64_t value);
OSHMEM_DECLSPEC void pshmemx_int32_wait_until(int32_t *addr, int cmp, int32_t value);
OSHMEM_DECLSPEC void pshmemx_int64_wait_until(int64_t *addr, int cmp, int64_t value);
/*
* Reduction routines
*/
OSHMEM_DECLSPEC void pshmem_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 pshmem_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 pshmem_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_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_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_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 pshmem_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 pshmem_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 pshmem_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_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_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_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 pshmem_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 pshmem_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 pshmem_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_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_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_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 pshmem_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 pshmem_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 pshmem_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_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_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_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 pshmem_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 pshmem_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 pshmem_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_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_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_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 pshmem_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 pshmem_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 pshmem_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_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_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_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 pshmem_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 pshmem_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 pshmem_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_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_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_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);
/*
* Backward compatibility section
*/
#define pshmem_int16_p pshmemx_int16_p
#define pshmem_int32_p pshmemx_int32_p
#define pshmem_int64_p pshmemx_int64_p
#define pshmem_put16 pshmemx_put16
#define pshmem_iput16 pshmemx_iput16
#define pshmem_int16_g pshmemx_int16_g
#define pshmem_int32_g pshmemx_int32_g
#define pshmem_int64_g pshmemx_int64_g
#define pshmem_get16 pshmemx_get16
#define pshmem_iget16 pshmemx_iget16
#define pshmem_int32_swap pshmemx_int32_swap
#define pshmem_int64_swap pshmemx_int64_swap
#define pshmem_int32_cswap pshmemx_int32_cswap
#define pshmem_int64_cswap pshmemx_int64_cswap
#define pshmem_int32_fadd pshmemx_int32_fadd
#define pshmem_int64_fadd pshmemx_int64_fadd
#define pshmem_int32_finc pshmemx_int32_finc
#define pshmem_int64_finc pshmemx_int64_finc
#define pshmem_int32_add pshmemx_int32_add
#define pshmem_int64_add pshmemx_int64_add
#define pshmem_int32_inc pshmemx_int32_inc
#define pshmem_int64_inc pshmemx_int64_inc
#define pshmem_int32_wait pshmemx_int32_wait
#define pshmem_int64_wait pshmemx_int64_wait
#define pshmem_int32_wait_until pshmemx_int32_wait_until
#define pshmem_int64_wait_until pshmemx_int64_wait_until
#define pshmem_int16_and_to_all pshmemx_int16_and_to_all
#define pshmem_int32_and_to_all pshmemx_int32_and_to_all
#define pshmem_int64_and_to_all pshmemx_int64_and_to_all
#define pshmem_int16_or_to_all pshmemx_int16_or_to_all
#define pshmem_int32_or_to_all pshmemx_int32_or_to_all
#define pshmem_int64_or_to_all pshmemx_int64_or_to_all
#define pshmem_int16_xor_to_all pshmemx_int16_xor_to_all
#define pshmem_int32_xor_to_all pshmemx_int32_xor_to_all
#define pshmem_int64_xor_to_all pshmemx_int64_xor_to_all
#define pshmem_int16_max_to_all pshmemx_int16_max_to_all
#define pshmem_int32_max_to_all pshmemx_int32_max_to_all
#define pshmem_int64_max_to_all pshmemx_int64_max_to_all
#define pshmem_int16_min_to_all pshmemx_int16_min_to_all
#define pshmem_int32_min_to_all pshmemx_int32_min_to_all
#define pshmem_int64_min_to_all pshmemx_int64_min_to_all
#define pshmem_int16_sum_to_all pshmemx_int16_sum_to_all
#define pshmem_int32_sum_to_all pshmemx_int32_sum_to_all
#define pshmem_int64_sum_to_all pshmemx_int64_sum_to_all
#define pshmem_int16_prod_to_all pshmemx_int16_prod_to_all
#define pshmem_int32_prod_to_all pshmemx_int32_prod_to_all
#define pshmem_int64_prod_to_all pshmemx_int64_prod_to_all
#if defined(c_plusplus) || defined(__cplusplus)
}

Просмотреть файл

@ -1,6 +1,6 @@
/* oshmem/include/shmem-compat.h. This file contains OpenSHMEM lagacy API */
/*
* Copyright (c) 2014 Mellanox Technologies, Inc.
* Copyright (c) 2014-2015 Mellanox Technologies, Inc.
* All rights reserved.
* $COPYRIGHT$
*
@ -18,15 +18,23 @@ extern "C" {
/*
* Legacy API
* old init/destruct functions - not in the open shmem spec but still supported
*/
OSHMEM_DECLSPEC int num_pes(void);
OSHMEM_DECLSPEC int my_pe(void);
/* old init/destruct functions - not in the open shmem spec but still supported */
OSHMEM_DECLSPEC void shmem_init(void);
OSHMEM_DECLSPEC void shmem_finalize(void) OSHMEM_DESTRUCTOR;
OSHMEM_DECLSPEC int shmem_n_pes(void);
OSHMEM_DECLSPEC int shmem_my_pe(void);
OSHMEM_DECLSPEC void start_pes(int npes);
OSHMEM_DECLSPEC int _num_pes(void);
OSHMEM_DECLSPEC int _my_pe(void);
OSHMEM_DECLSPEC void* shmalloc(size_t size);
OSHMEM_DECLSPEC void* shmemalign(size_t align, size_t size);
OSHMEM_DECLSPEC void* shrealloc(void *ptr, size_t size);
OSHMEM_DECLSPEC void shfree(void* ptr);
OSHMEM_DECLSPEC void shmem_char_put(char *target, const char *source, size_t len, int pe);
OSHMEM_DECLSPEC void shmem_char_get(char *target, const char *source, size_t len, int pe);
OSHMEM_DECLSPEC void shmem_put(void *target, const void *source, size_t len, int pe);
OSHMEM_DECLSPEC void shmem_get(void *target, const void *source, size_t len, int pe);

Просмотреть файл

@ -13,6 +13,16 @@
!
! TODO: exact values should be found during configuration
!
integer SHMEM_MAJOR_VERSION
parameter ( SHMEM_MAJOR_VERSION = 1 )
integer SHMEM_MINOR_VERSION
parameter ( SHMEM_MINOR_VERSION = 2 )
CHARACTER(LEN = 256), PARAMETER :: SHMEM_VENDOR_STRING = "http://www.open-mpi.org/"
integer SHMEM_MAX_NAME_LEN
parameter ( SHMEM_MAX_NAME_LEN = 256-1 )
integer SHMEM_BARRIER_SYNC_SIZE
parameter ( SHMEM_BARRIER_SYNC_SIZE = 4 )
@ -20,7 +30,6 @@
integer SHMEM_BCAST_SYNC_SIZE
parameter ( SHMEM_BCAST_SYNC_SIZE = 8 )
integer SHMEM_COLLECT_SYNC_SIZE
parameter ( SHMEM_COLLECT_SYNC_SIZE = 8 )

Просмотреть файл

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014 Mellanox Technologies, Inc.
* Copyright (c) 2014-2015 Mellanox Technologies, Inc.
* All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved
* $COPYRIGHT$
@ -79,6 +79,15 @@ extern "C" {
/*
* Constants and definitions
*/
#define SHMEM_MAJOR_VERSION 1
#define SHMEM_MINOR_VERSION 2
#define SHMEM_VENDOR_STRING "http://www.open-mpi.org/"
#define SHMEM_MAX_NAME_LEN 256
#ifndef OSHMEM_SPEC_VERSION
#define OSHMEM_SPEC_VERSION (SHMEM_MAJOR_VERSION * 10000 + SHMEM_MINOR_VERSION * 100)
#endif
enum shmem_wait_ops {
SHMEM_CMP_EQ,
SHMEM_CMP_NE,
@ -106,15 +115,21 @@ enum shmem_wait_ops {
/*
* Initialization routines
*/
OSHMEM_DECLSPEC void start_pes(int npes);
OSHMEM_DECLSPEC void shmem_init(void);
OSHMEM_DECLSPEC void shmem_finalize(void) OSHMEM_DESTRUCTOR;
OSHMEM_DECLSPEC void shmem_global_exit(int status);
/*
* Query routines
*/
OSHMEM_DECLSPEC int _num_pes(void);
OSHMEM_DECLSPEC int _my_pe(void);
OSHMEM_DECLSPEC int shmem_n_pes(void);
OSHMEM_DECLSPEC int shmem_my_pe(void);
/*
* Info routines
*/
OSHMEM_DECLSPEC void shmem_info_get_version(int *major, int *minor);
OSHMEM_DECLSPEC void shmem_info_get_name(char *name);
/*
* Accessability routines
@ -125,10 +140,10 @@ OSHMEM_DECLSPEC int shmem_addr_accessible(void *addr, int pe);
/*
* Symmetric heap routines
*/
OSHMEM_DECLSPEC void* shmalloc(size_t size);
OSHMEM_DECLSPEC void* shmemalign(size_t align, size_t size);
OSHMEM_DECLSPEC void* shrealloc(void *ptr, size_t size);
OSHMEM_DECLSPEC void shfree(void* ptr);
OSHMEM_DECLSPEC void* shmem_malloc(size_t size);
OSHMEM_DECLSPEC void* shmem_align(size_t align, size_t size);
OSHMEM_DECLSPEC void* shmem_realloc(void *ptr, size_t size);
OSHMEM_DECLSPEC void shmem_free(void* ptr);
/*
* Remote pointer operations
@ -138,6 +153,7 @@ OSHMEM_DECLSPEC void *shmem_ptr(void *ptr, int pe);
/*
* Elemental put routines
*/
OSHMEM_DECLSPEC void shmem_char_p(char* addr, char value, int pe);
OSHMEM_DECLSPEC void shmem_short_p(short* addr, short value, int pe);
OSHMEM_DECLSPEC void shmem_int_p(int* addr, int value, int pe);
OSHMEM_DECLSPEC void shmem_long_p(long* addr, long value, int pe);
@ -149,7 +165,6 @@ OSHMEM_DECLSPEC void shmem_longdouble_p(long double* addr, long double value, i
/*
* Block data put routines
*/
OSHMEM_DECLSPEC void shmem_char_put(char *target, const char *source, size_t len, int pe);
OSHMEM_DECLSPEC void shmem_short_put(short *target, const short *source, size_t len, int pe);
OSHMEM_DECLSPEC void shmem_int_put(int* target, const int* source, size_t len, int pe);
OSHMEM_DECLSPEC void shmem_long_put(long *target, const long *source, size_t len, int pe);
@ -165,8 +180,8 @@ OSHMEM_DECLSPEC void shmem_putmem(void *target, const void *source, size_t len,
/*
* Strided put routines
*/
OSHMEM_DECLSPEC void shmem_int_iput(int* target, const int* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
OSHMEM_DECLSPEC void shmem_short_iput(short* target, const short* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
OSHMEM_DECLSPEC void shmem_int_iput(int* target, const int* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
OSHMEM_DECLSPEC void shmem_float_iput(float* target, const float* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
OSHMEM_DECLSPEC void shmem_double_iput(double* target, const double* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
OSHMEM_DECLSPEC void shmem_longlong_iput(long long* target, const long long* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
@ -191,7 +206,6 @@ OSHMEM_DECLSPEC long double shmem_longdouble_g(long double* addr, int pe);
/*
* Block data get routines
*/
OSHMEM_DECLSPEC void shmem_char_get(char *target, const char *source, size_t len, int pe);
OSHMEM_DECLSPEC void shmem_short_get(short *target, const short *source, size_t len, int pe);
OSHMEM_DECLSPEC void shmem_int_get(int *target, const int *source, size_t len, int pe);
OSHMEM_DECLSPEC void shmem_long_get(long *target, const long *source, size_t len, int pe);
@ -207,8 +221,8 @@ OSHMEM_DECLSPEC void shmem_getmem(void *target, const void *source, size_t len,
/*
* Strided get routines
*/
OSHMEM_DECLSPEC void shmem_int_iget(int* target, const int* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
OSHMEM_DECLSPEC void shmem_short_iget(short* target, const short* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
OSHMEM_DECLSPEC void shmem_int_iget(int* target, const int* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
OSHMEM_DECLSPEC void shmem_float_iget(float* target, const float* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
OSHMEM_DECLSPEC void shmem_double_iget(double* target, const double* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
OSHMEM_DECLSPEC void shmem_longlong_iget(long long* target, const long long* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);

Просмотреть файл

@ -1,6 +1,6 @@
/* oshmem/include/shmemx.h. This file contains vendor extension functions */
/*
* Copyright (c) 2014 Mellanox Technologies, Inc.
* Copyright (c) 2014-2015 Mellanox Technologies, Inc.
* All rights reserved.
* $COPYRIGHT$
*
@ -17,117 +17,178 @@ extern "C" {
#endif
/*
* Elemental put routines
* All OpenSHMEM extension APIs that are not part of this specification must be defined in the shmemx.h include
* file. These extensions shall use the shmemx_ prefix for all routine, variable, and constant names.
*/
OSHMEM_DECLSPEC void shmem_int16_p(int16_t* addr, int16_t value, int pe);
OSHMEM_DECLSPEC void shmem_int32_p(int32_t* addr, int32_t value, int pe);
OSHMEM_DECLSPEC void shmem_int64_p(int64_t* addr, int64_t value, int pe);
/*
* Elemental put routines
*/
OSHMEM_DECLSPEC void shmem_char_p(char* addr, char value, int pe);
OSHMEM_DECLSPEC void shmemx_int16_p(int16_t* addr, int16_t value, int pe);
OSHMEM_DECLSPEC void shmemx_int32_p(int32_t* addr, int32_t value, int pe);
OSHMEM_DECLSPEC void shmemx_int64_p(int64_t* addr, int64_t value, int pe);
/*
* Elemental put routines
*/
/*
* Block data put routines
*/
OSHMEM_DECLSPEC void shmem_put16(void *target, const void *source, size_t len, int pe);
OSHMEM_DECLSPEC void shmemx_put16(void *target, const void *source, size_t len, int pe);
/*
* Strided put routines
*/
OSHMEM_DECLSPEC void shmem_iput16(void* target, const void* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
OSHMEM_DECLSPEC void shmemx_iput16(void* target, const void* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
/*
* Elemental get routines
*/
OSHMEM_DECLSPEC int16_t shmem_int16_g(int16_t* addr, int pe);
OSHMEM_DECLSPEC int32_t shmem_int32_g(int32_t* addr, int pe);
OSHMEM_DECLSPEC int64_t shmem_int64_g(int64_t* addr, int pe);
/*
* Elemental get routines
*/
OSHMEM_DECLSPEC char shmem_char_g(char* addr, int pe);
OSHMEM_DECLSPEC int16_t shmemx_int16_g(int16_t* addr, int pe);
OSHMEM_DECLSPEC int32_t shmemx_int32_g(int32_t* addr, int pe);
OSHMEM_DECLSPEC int64_t shmemx_int64_g(int64_t* addr, int pe);
/*
* Block data get routines
*/
OSHMEM_DECLSPEC void shmem_get16(void *target, const void *source, size_t len, int pe);
OSHMEM_DECLSPEC void shmemx_get16(void *target, const void *source, size_t len, int pe);
/*
* Strided get routines
*/
OSHMEM_DECLSPEC void shmem_iget16(void* target, const void* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
OSHMEM_DECLSPEC void shmemx_iget16(void* target, const void* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
/*
* Atomic operations
*/
/* Atomic swap */
OSHMEM_DECLSPEC int32_t shmem_int32_swap(int32_t *target, int32_t value, int pe);
OSHMEM_DECLSPEC int64_t shmem_int64_swap(int64_t *target, int64_t value, int pe);
OSHMEM_DECLSPEC int32_t shmemx_int32_swap(int32_t *target, int32_t value, int pe);
OSHMEM_DECLSPEC int64_t shmemx_int64_swap(int64_t *target, int64_t value, int pe);
/* Atomic conditional swap */
OSHMEM_DECLSPEC int32_t shmem_int32_cswap(int32_t *target, int32_t cond, int32_t value, int pe);
OSHMEM_DECLSPEC int64_t shmem_int64_cswap(int64_t *target, int64_t cond, int64_t value, int pe);
OSHMEM_DECLSPEC int32_t shmemx_int32_cswap(int32_t *target, int32_t cond, int32_t value, int pe);
OSHMEM_DECLSPEC int64_t shmemx_int64_cswap(int64_t *target, int64_t cond, int64_t value, int pe);
/* Atomic Fetch&Add */
OSHMEM_DECLSPEC int32_t shmem_int32_fadd(int32_t *target, int32_t value, int pe);
OSHMEM_DECLSPEC int64_t shmem_int64_fadd(int64_t *target, int64_t value, int pe);
OSHMEM_DECLSPEC int32_t shmemx_int32_fadd(int32_t *target, int32_t value, int pe);
OSHMEM_DECLSPEC int64_t shmemx_int64_fadd(int64_t *target, int64_t value, int pe);
/* Atomic Fetch&Inc */
OSHMEM_DECLSPEC int32_t shmem_int32_finc(int32_t *target, int pe);
OSHMEM_DECLSPEC int64_t shmem_int64_finc(int64_t *target, int pe);
OSHMEM_DECLSPEC int32_t shmemx_int32_finc(int32_t *target, int pe);
OSHMEM_DECLSPEC int64_t shmemx_int64_finc(int64_t *target, int pe);
/* Atomic Add*/
OSHMEM_DECLSPEC void shmem_int32_add(int32_t *target, int32_t value, int pe);
OSHMEM_DECLSPEC void shmem_int64_add(int64_t *target, int64_t value, int pe);
OSHMEM_DECLSPEC void shmemx_int32_add(int32_t *target, int32_t value, int pe);
OSHMEM_DECLSPEC void shmemx_int64_add(int64_t *target, int64_t value, int pe);
/* Atomic Inc */
OSHMEM_DECLSPEC void shmem_int32_inc(int32_t *target, int pe);
OSHMEM_DECLSPEC void shmem_int64_inc(int64_t *target, int pe);
OSHMEM_DECLSPEC void shmemx_int32_inc(int32_t *target, int pe);
OSHMEM_DECLSPEC void shmemx_int64_inc(int64_t *target, int pe);
/*
* P2P sync routines
*/
OSHMEM_DECLSPEC void shmem_int16_wait(int16_t *addr, int16_t value);
OSHMEM_DECLSPEC void shmem_int32_wait(int32_t *addr, int32_t value);
OSHMEM_DECLSPEC void shmem_int64_wait(int64_t *addr, int64_t value);
OSHMEM_DECLSPEC void shmemx_int32_wait(int32_t *addr, int32_t value);
OSHMEM_DECLSPEC void shmemx_int64_wait(int64_t *addr, int64_t value);
OSHMEM_DECLSPEC void shmem_int16_wait_until(int16_t *addr, int cmp, int16_t value);
OSHMEM_DECLSPEC void shmem_int32_wait_until(int32_t *addr, int cmp, int32_t value);
OSHMEM_DECLSPEC void shmem_int64_wait_until(int64_t *addr, int cmp, int64_t value);
OSHMEM_DECLSPEC void shmemx_int32_wait_until(int32_t *addr, int cmp, int32_t value);
OSHMEM_DECLSPEC void shmemx_int64_wait_until(int64_t *addr, int cmp, int64_t value);
/*
* Reduction routines
*/
OSHMEM_DECLSPEC void shmem_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 shmem_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 shmem_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_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_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_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 shmem_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 shmem_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 shmem_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_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_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_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 shmem_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 shmem_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 shmem_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_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_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_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 shmem_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 shmem_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 shmem_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_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_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_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 shmem_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 shmem_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 shmem_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_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_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_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 shmem_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 shmem_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 shmem_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_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_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_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 shmem_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 shmem_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 shmem_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_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_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_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);
/*
* Backward compatibility section
*/
#define shmem_int16_p shmemx_int16_p
#define shmem_int32_p shmemx_int32_p
#define shmem_int64_p shmemx_int64_p
#define shmem_put16 shmemx_put16
#define shmem_iput16 shmemx_iput16
#define shmem_int16_g shmemx_int16_g
#define shmem_int32_g shmemx_int32_g
#define shmem_int64_g shmemx_int64_g
#define shmem_get16 shmemx_get16
#define shmem_iget16 shmemx_iget16
#define shmem_int32_swap shmemx_int32_swap
#define shmem_int64_swap shmemx_int64_swap
#define shmem_int32_cswap shmemx_int32_cswap
#define shmem_int64_cswap shmemx_int64_cswap
#define shmem_int32_fadd shmemx_int32_fadd
#define shmem_int64_fadd shmemx_int64_fadd
#define shmem_int32_finc shmemx_int32_finc
#define shmem_int64_finc shmemx_int64_finc
#define shmem_int32_add shmemx_int32_add
#define shmem_int64_add shmemx_int64_add
#define shmem_int32_inc shmemx_int32_inc
#define shmem_int64_inc shmemx_int64_inc
#define shmem_int32_wait shmemx_int32_wait
#define shmem_int64_wait shmemx_int64_wait
#define shmem_int32_wait_until shmemx_int32_wait_until
#define shmem_int64_wait_until shmemx_int64_wait_until
#define shmem_int16_and_to_all shmemx_int16_and_to_all
#define shmem_int32_and_to_all shmemx_int32_and_to_all
#define shmem_int64_and_to_all shmemx_int64_and_to_all
#define shmem_int16_or_to_all shmemx_int16_or_to_all
#define shmem_int32_or_to_all shmemx_int32_or_to_all
#define shmem_int64_or_to_all shmemx_int64_or_to_all
#define shmem_int16_xor_to_all shmemx_int16_xor_to_all
#define shmem_int32_xor_to_all shmemx_int32_xor_to_all
#define shmem_int64_xor_to_all shmemx_int64_xor_to_all
#define shmem_int16_max_to_all shmemx_int16_max_to_all
#define shmem_int32_max_to_all shmemx_int32_max_to_all
#define shmem_int64_max_to_all shmemx_int64_max_to_all
#define shmem_int16_min_to_all shmemx_int16_min_to_all
#define shmem_int32_min_to_all shmemx_int32_min_to_all
#define shmem_int64_min_to_all shmemx_int64_min_to_all
#define shmem_int16_sum_to_all shmemx_int16_sum_to_all
#define shmem_int32_sum_to_all shmemx_int32_sum_to_all
#define shmem_int64_sum_to_all shmemx_int64_sum_to_all
#define shmem_int16_prod_to_all shmemx_int16_prod_to_all
#define shmem_int32_prod_to_all shmemx_int32_prod_to_all
#define shmem_int64_prod_to_all shmemx_int64_prod_to_all
#if defined(c_plusplus) || defined(__cplusplus)
}

18
oshmem/info/Makefile.am Обычный файл
Просмотреть файл

@ -0,0 +1,18 @@
#
# Copyright (c) 2015 Mellanox Technologies, Inc.
# All rights reserved.
# # $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
#
# This makefile.am does not stand on its own - it is included from ompi/Makefile.am
headers += \
info/info.h
liboshmem_la_SOURCES += \
info/info.c

319
oshmem/info/info.c Обычный файл
Просмотреть файл

@ -0,0 +1,319 @@
/*
* Copyright (c) 2015 Mellanox Technologies, Inc.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "oshmem_config.h"
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "orte/runtime/orte_globals.h"
#include "orte/util/show_help.h"
#include "opal/util/output.h"
#include "oshmem/version.h"
#include "oshmem/constants.h"
#include "oshmem/info/info.h"
#include "oshmem/shmem/shmem_api_logger.h"
/*
* Global variables
*/
oshmem_info_t oshmem_shmem_info_env = {
false,
false,
false,
256 * 1024 * 1024
};
#define OSHMEM_MAX_LIBRARY_VERSION_STRING 256
/*
* Local functions
*/
static int oshmem_info_value_to_bool(char *value, bool *interp);
static int oshmem_info_value_to_int(char *value, int *interp);
static int oshmem_info_get_heap_size(char *value, size_t *interp);
static int oshmem_info_get_library_version(char *version, int *len);
/*
* This function is called during oshmem_init.
*/
int oshmem_info_init(void)
{
int ret = OSHMEM_SUCCESS;
char *cptr;
/* fill the env info object */
if (NULL != (cptr = getenv(OSHMEM_ENV_VERSION))) {
ret = oshmem_info_value_to_bool(cptr, &oshmem_shmem_info_env.print_version);
if (OSHMEM_SUCCESS != ret) {
goto out;
}
}
if (oshmem_shmem_info_env.print_version && 0 == ORTE_PROC_MY_NAME->vpid) {
char version[OSHMEM_MAX_LIBRARY_VERSION_STRING];
int len;
ret = oshmem_info_get_library_version(version, &len);
if (OSHMEM_SUCCESS != ret || 0 == len) {
goto out;
}
orte_show_help("help-shmem-runtime.txt",
"oshmem_init:print-version",
true,
version);
}
if (NULL != (cptr = getenv(OSHMEM_ENV_INFO))) {
ret = oshmem_info_value_to_bool(cptr, &oshmem_shmem_info_env.print_info);
if (OSHMEM_SUCCESS != ret) {
goto out;
}
}
if (oshmem_shmem_info_env.print_info && 0 == ORTE_PROC_MY_NAME->vpid) {
orte_show_help("help-shmem-runtime.txt",
"oshmem_init:print-info",
true,
OSHMEM_ENV_VERSION,
OSHMEM_ENV_INFO,
OSHMEM_ENV_SYMMETRIC_SIZE,
OSHMEM_ENV_DEBUG);
}
if (NULL != (cptr = getenv(OSHMEM_ENV_DEBUG))) {
ret = oshmem_info_value_to_bool(cptr, &oshmem_shmem_info_env.debug);
if (OSHMEM_SUCCESS != ret) {
goto out;
}
}
if (NULL != (cptr = getenv(OSHMEM_ENV_SYMMETRIC_SIZE))) {
char *p1 = getenv(SHMEM_HEAP_SIZE);
if (p1 && strcmp(cptr, p1)) {
SHMEM_API_ERROR("Found conflict between env '%s' and '%s'.\n",
OSHMEM_ENV_SYMMETRIC_SIZE, SHMEM_HEAP_SIZE);
ret = OSHMEM_ERR_BAD_PARAM;
goto out;
}
ret = oshmem_info_get_heap_size(cptr, &oshmem_shmem_info_env.symmetric_heap_size);
if (OSHMEM_SUCCESS != ret) {
goto out;
}
} else if (NULL != (cptr = getenv(SHMEM_HEAP_SIZE))) {
ret = oshmem_info_get_heap_size(cptr, &oshmem_shmem_info_env.symmetric_heap_size);
if (OSHMEM_SUCCESS != ret) {
goto out;
}
}
/* All done */
return OSHMEM_SUCCESS;
out:
return ret;
}
/*
* Shut down oshmem_info handling
*/
int oshmem_info_finalize(void)
{
/* All done -- destroy the table */
return OSHMEM_SUCCESS;
}
/**
* Convert value string to boolean
*
* Convert value string \c value into a boolean. The
* strings "true", "false", and integer numbers can be converted
* into booleans. All others will return \c OSHMEM_ERR_BAD_PARAM
*
* @param value Value string for info key to interpret
* @param interp returned interpretation of the value key
*
* @retval OSHMEM_SUCCESS string was successfully interpreted
* @retval OSHMEM_ERR_BAD_PARAM string was not able to be interpreted
*/
static int oshmem_info_value_to_bool(char *value, bool *interp)
{
int tmp;
/* idiot case */
if (NULL == value || NULL == interp) return OSHMEM_ERR_BAD_PARAM;
/* is it true / false? */
if (0 == strcmp(value, "true")) {
*interp = true;
return OSHMEM_SUCCESS;
} else if (0 == strcmp(value, "false")) {
*interp = false;
return OSHMEM_SUCCESS;
/* is it a number? */
} else if (OSHMEM_SUCCESS == oshmem_info_value_to_int(value, &tmp)) {
if (tmp == 0) {
*interp = false;
} else {
*interp = true;
}
return OSHMEM_SUCCESS;
}
return OSHMEM_ERR_BAD_PARAM;
}
/**
* Convert value string to integer
*
* Convert value string \c value into a integer.
* All others will return \c OSHMEM_ERR_BAD_PARAM
*
* @param value Value string for info key to interpret
* @param interp returned interpretation of the value key
*
* @retval OSHMEM_SUCCESS string was successfully interpreted
* @retval OSHMEM_ERR_BAD_PARAM string was not able to be interpreted
*/
static int oshmem_info_value_to_int(char *value, int *interp)
{
long tmp;
char *endp;
if (NULL == value || '\0' == value[0]) return OSHMEM_ERR_BAD_PARAM;
errno = 0;
tmp = strtol(value, &endp, 10);
/* we found something not a number */
if (*endp != '\0') return OSHMEM_ERR_BAD_PARAM;
/* underflow */
if (tmp == 0 && errno == EINVAL) return OSHMEM_ERR_BAD_PARAM;
*interp = (int) tmp;
return OSHMEM_SUCCESS;
}
static int oshmem_info_get_heap_size(char *value, size_t *interp)
{
char *p;
long long factor = 1;
int idx;
long long size = 0;
p = value;
if (1 == sscanf(p, "%lld%n", &size, &idx)) {
if (p[idx] != '\0') {
if (p[idx + 1] == '\0') {
if (p[idx] == 'k' || p[idx] == 'K') {
factor = 1024;
} else if (p[idx] == 'm' || p[idx] == 'M') {
factor = 1024 * 1024;
} else if (p[idx] == 'g' || p[idx] == 'G') {
factor = 1024 * 1024 * 1024;
} else if (p[idx] == 't' || p[idx] == 'T') {
factor = 1024UL * 1024UL * 1024UL * 1024UL;
} else {
size = 0;
}
} else {
size = 0;
}
}
}
if (size <= 0) {
return OSHMEM_ERR_BAD_PARAM;
} else {
char *tmp = p;
if(!p) {
asprintf(&tmp, "%lld", size * factor);
}
if (tmp) {
setenv(OSHMEM_ENV_SYMMETRIC_SIZE, tmp, 1);
setenv(SHMEM_HEAP_SIZE, tmp, 1);
}
if (!p && tmp) {
free(tmp);
}
}
*interp = size * factor;
return OSHMEM_SUCCESS;
}
static int oshmem_info_get_library_version(char *version, int *resultlen)
{
int len_left;
char *ptr, tmp[OSHMEM_MAX_LIBRARY_VERSION_STRING];
ptr = tmp;
len_left = sizeof(tmp);
memset(tmp, 0, OSHMEM_MAX_LIBRARY_VERSION_STRING);
snprintf(tmp, OSHMEM_MAX_LIBRARY_VERSION_STRING, "Open SHMEM v%d.%d.%d",
OSHMEM_MAJOR_VERSION, OSHMEM_MINOR_VERSION, OSHMEM_RELEASE_VERSION);
ptr += strlen(tmp);
len_left -= strlen(tmp);
if (strlen(OSHMEM_GREEK_VERSION) > 0) {
snprintf(ptr, len_left, "%s", OSHMEM_GREEK_VERSION);
ptr = tmp + strlen(tmp);
len_left = OSHMEM_MAX_LIBRARY_VERSION_STRING - strlen(tmp);
}
/* Package name */
if (strlen(OPAL_PACKAGE_STRING) > 0) {
snprintf(ptr, len_left, ", package: %s", OPAL_PACKAGE_STRING);
ptr = tmp + strlen(tmp);
len_left = OSHMEM_MAX_LIBRARY_VERSION_STRING - strlen(tmp);
}
/* Ident string */
if (strlen(OSHMEM_IDENT_STRING) > 0) {
snprintf(ptr, len_left, ", ident: %s", OSHMEM_IDENT_STRING);
ptr = tmp + strlen(tmp);
len_left = OSHMEM_MAX_LIBRARY_VERSION_STRING - strlen(tmp);
}
/* Repository revision */
if (strlen(OSHMEM_REPO_REV) > 0) {
snprintf(ptr, len_left, ", repo rev: %s", OSHMEM_REPO_REV);
ptr = tmp + strlen(tmp);
len_left = OSHMEM_MAX_LIBRARY_VERSION_STRING - strlen(tmp);
}
/* Release date */
if (strlen(OSHMEM_RELEASE_DATE) > 0) {
snprintf(ptr, len_left, ", %s", OSHMEM_RELEASE_DATE);
ptr = tmp + strlen(tmp);
len_left = OSHMEM_MAX_LIBRARY_VERSION_STRING - strlen(tmp);
}
memcpy(version, tmp, strlen(tmp) + 1);
*resultlen = strlen(tmp) + 1;
return OSHMEM_SUCCESS;
}

69
oshmem/info/info.h Обычный файл
Просмотреть файл

@ -0,0 +1,69 @@
/*
* Copyright (c) 2015 Mellanox Technologies, Inc.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef OSHMEM_INFO_H
#define OSHMEM_INFO_H
#include "oshmem_config.h"
#include "oshmem/types.h"
#include "oshmem/constants.h"
/*
* Environment variables
*/
#define OSHMEM_ENV_SYMMETRIC_SIZE "SMA_SYMMETRIC_SIZE"
#define OSHMEM_ENV_DEBUG "SMA_DEBUG"
#define OSHMEM_ENV_INFO "SMA_INFO"
#define OSHMEM_ENV_VERSION "SMA_VERSION"
/**
* \internal
* oshmem_info_t structure.
*/
struct oshmem_info_t {
/**< print the library version at start-up */
bool print_version;
/**< print helpful text about all these environment variables */
bool print_info;
/**< enable debugging messages */
bool debug;
/**< number of bytes to allocate for symmetric heap */
size_t symmetric_heap_size;
};
/**
* \internal
* Convenience typedef
*/
typedef struct oshmem_info_t oshmem_info_t;
BEGIN_C_DECLS
/**
* Global instance for oshmem_info_env
*/
OSHMEM_DECLSPEC extern oshmem_info_t oshmem_shmem_info_env;
/**
* This function is invoked during oshmem_shmem_init() and sets up
* oshmem_shmem_info_env handling.
*/
int oshmem_info_init(void);
/**
* This functions is called during oshmem_shmem_finalize() and shuts
* down oshmem_shmem_info_env handling.
*/
int oshmem_info_finalize(void);
END_C_DECLS
#endif /* OSHMEM_INFO_H */

Просмотреть файл

@ -17,6 +17,7 @@
#include "oshmem/mca/mca.h"
#include "opal/mca/base/base.h"
#include "opal/mca/base/mca_base_component_repository.h"
#include "oshmem/info/info.h"
#include "oshmem/util/oshmem_util.h"
#include "oshmem/mca/memheap/memheap.h"
#include "oshmem/mca/memheap/base/base.h"
@ -177,66 +178,7 @@ int mca_memheap_base_select()
static size_t _memheap_size(void)
{
char *p;
long long factor = 1;
int idx;
long long size = 0;
p = getenv(OSHMEM_ENV_SYMMETRIC_SIZE);
if (!p) {
p = getenv(SHMEM_HEAP_SIZE);
} else {
char *p1 = getenv(SHMEM_HEAP_SIZE);
if (p1 && strcmp(p, p1)) {
MEMHEAP_ERROR("Found conflict between env '%s' and '%s'.\n",
OSHMEM_ENV_SYMMETRIC_SIZE, SHMEM_HEAP_SIZE);
return 0;
}
}
if (!p) {
size = SIZE_IN_MEGA_BYTES(DEFAULT_SYMMETRIC_HEAP_SIZE);
} else if (1 == sscanf(p, "%lld%n", &size, &idx)) {
if (p[idx] != '\0') {
if (p[idx + 1] == '\0') {
if (p[idx] == 'k' || p[idx] == 'K') {
factor = 1024;
} else if (p[idx] == 'm' || p[idx] == 'M') {
factor = 1024 * 1024;
} else if (p[idx] == 'g' || p[idx] == 'G') {
factor = 1024 * 1024 * 1024;
} else if (p[idx] == 't' || p[idx] == 'T') {
factor = 1024UL * 1024UL * 1024UL * 1024UL;
} else {
size = 0;
}
} else {
size = 0;
}
}
}
if (size <= 0) {
MEMHEAP_ERROR("Set incorrect symmetric heap size\n");
return 0;
} else {
char *tmp = p;
if(!p) {
asprintf(&tmp, "%lld", size);
}
if (tmp) {
setenv(OSHMEM_ENV_SYMMETRIC_SIZE, tmp, 1);
setenv(SHMEM_HEAP_SIZE, tmp, 1);
}
if (!p && tmp) {
free(tmp);
}
}
return (size_t) memheap_align(size * factor);
return (size_t) memheap_align(oshmem_shmem_info_env.symmetric_heap_size);
}
static memheap_context_t* _memheap_create(void)

Просмотреть файл

@ -20,8 +20,6 @@
#include "oshmem/mca/sshmem/sshmem.h"
#include "oshmem/mca/spml/spml.h"
#define DEFAULT_SYMMETRIC_HEAP_SIZE 256
#define SIZE_IN_MEGA_BYTES(size_in_mb) size_in_mb * 1024 * 1024
BEGIN_C_DECLS
struct mca_memheap_base_module_t;

Просмотреть файл

@ -29,3 +29,14 @@ double check that everything has shut down cleanly.
Local host: %s
PID: %d
#
[oshmem_init:print-version]
Open SHMEM version:
%s
#
[oshmem_init:print-info]
Open SHMEM environment variables:
%s - print the library version at start-up
%s - print helpful text about all these environment variables
%s - number of bytes to allocate for symmetric heap
%s - enable debugging messages

Просмотреть файл

@ -50,6 +50,7 @@
#include "oshmem/mca/atomic/base/base.h"
#include "oshmem/mca/memheap/base/base.h"
#include "oshmem/mca/sshmem/base/base.h"
#include "oshmem/info/info.h"
#include "oshmem/proc/proc.h"
#include "oshmem/proc/proc_group_cache.h"
#include "oshmem/op/op.h"
@ -159,6 +160,11 @@ static int _shmem_finalize(void)
return ret;
}
/* free info resources */
if (OSHMEM_SUCCESS != (ret = oshmem_info_finalize())) {
return ret;
}
return ret;
}

Просмотреть файл

@ -63,6 +63,7 @@
#include "oshmem/mca/atomic/base/base.h"
#include "oshmem/mca/memheap/base/base.h"
#include "oshmem/mca/sshmem/base/base.h"
#include "oshmem/info/info.h"
#include "oshmem/proc/proc.h"
#include "oshmem/proc/proc_group_cache.h"
#include "oshmem/op/op.h"
@ -232,11 +233,6 @@ static int _shmem_init(int argc, char **argv, int requested, int *provided)
int ret = OSHMEM_SUCCESS;
char *error = NULL;
if (OSHMEM_SUCCESS != (ret = oshmem_proc_init())) {
error = "oshmem_proc_init() failed";
goto error;
}
/* Register the OSHMEM layer's MCA parameters */
if (OSHMEM_SUCCESS != (ret = oshmem_shmem_register_params())) {
error = "oshmem_info_register: oshmem_register_params failed";
@ -249,6 +245,18 @@ static int _shmem_init(int argc, char **argv, int requested, int *provided)
opal_output_set_verbosity(shmem_api_logger_output,
oshmem_shmem_api_verbose);
/* initialize info */
if (OSHMEM_SUCCESS != (ret = oshmem_info_init())) {
error = "oshmem_info_init() failed";
goto error;
}
/* initialize proc */
if (OSHMEM_SUCCESS != (ret = oshmem_proc_init())) {
error = "oshmem_proc_init() failed";
goto error;
}
if (OSHMEM_SUCCESS != (ret = oshmem_group_cache_list_init())) {
error = "oshmem_group_cache_list_init() failed";
goto error;

Просмотреть файл

@ -1,5 +1,5 @@
#
# Copyright (c) 2013 Mellanox Technologies, Inc.
# Copyright (c) 2013-2015 Mellanox Technologies, Inc.
# All rights reserved
# Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
@ -15,8 +15,7 @@ if OSHMEM_PROFILING
endif
OSHMEM_AUX_SOURCES = \
shmem_lock.c \
globalexit.c
shmem_lock.c
OSHMEM_API_SOURCES = \
shmem_init.c \
@ -56,7 +55,9 @@ OSHMEM_API_SOURCES = \
shmem_inc.c \
shmem_clear_lock.c \
shmem_set_lock.c \
shmem_test_lock.c
shmem_test_lock.c \
shmem_global_exit.c \
shmem_info.c
AM_CPPFLAGS = -DOSHMEM_PROFILING=0

Просмотреть файл

@ -67,7 +67,9 @@ OSHMEM_API_SOURCES = \
pshmem_inc.c \
pshmem_clear_lock.c \
pshmem_set_lock.c \
pshmem_test_lock.c
pshmem_test_lock.c \
pshmem_global_exit.c \
pshmem_info.c
nodist_liboshmem_c_pshmem_la_SOURCES = \
$(OSHMEM_API_SOURCES)

Просмотреть файл

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013 Mellanox Technologies, Inc.
* Copyright (c) 2013-2015 Mellanox Technologies, Inc.
* All rights reserved.
* $COPYRIGHT$
*
@ -20,305 +20,309 @@
/*
* Initialization routines
*/
#define start_pes pstart_pes
#define shmem_init pshmem_init
#define start_pes pstart_pes /* shmem-compat.h */
/*
* Finalization routines
*/
#define shmem_finalize pshmem_finalize
#define shmem_finalize pshmem_finalize
#define shmem_global_exit pshmem_global_exit
/*
* Query routines
*/
#define _num_pes p_num_pes
#define _my_pe p_my_pe
#define shmem_n_pes pshmem_n_pes
#define shmem_my_pe pshmem_my_pe
#define _num_pes p_num_pes /* shmem-compat.h */
#define _my_pe p_my_pe /* shmem-compat.h */
/*
* Accessability routines
*/
#define shmem_pe_accessible pshmem_pe_accessible
#define shmem_addr_accessible pshmem_addr_accessible
#define shmem_pe_accessible pshmem_pe_accessible
#define shmem_addr_accessible pshmem_addr_accessible
/*
* Symmetric heap routines
*/
#define shmalloc pshmalloc
#define shmemalign pshmemalign
#define shrealloc pshrealloc
#define shfree pshfree
#define shmem_malloc pshmem_malloc
#define shmem_align pshmem_align
#define shmem_realloc pshmem_realloc
#define shmem_free pshmem_free
#define shmalloc pshmalloc /* shmem-compat.h */
#define shmemalign pshmemalign /* shmem-compat.h */
#define shrealloc pshrealloc /* shmem-compat.h */
#define shfree pshfree /* shmem-compat.h */
/*
* Remote pointer operations
*/
#define shmem_ptr pshmem_ptr
#define shmem_ptr pshmem_ptr
/*
* Elemental put routines
*/
#define shmem_char_p pshmem_char_p
#define shmem_short_p pshmem_short_p
#define shmem_int_p pshmem_int_p
#define shmem_long_p pshmem_long_p
#define shmem_float_p pshmem_float_p
#define shmem_double_p pshmem_double_p
#define shmem_longlong_p pshmem_longlong_p
#define shmem_longdouble_p pshmem_longdouble_p
#define shmem_int16_p pshmem_int16_p
#define shmem_int32_p pshmem_int32_p
#define shmem_int64_p pshmem_int64_p
#define shmem_char_p pshmem_char_p
#define shmem_short_p pshmem_short_p
#define shmem_int_p pshmem_int_p
#define shmem_long_p pshmem_long_p
#define shmem_float_p pshmem_float_p
#define shmem_double_p pshmem_double_p
#define shmem_longlong_p pshmem_longlong_p
#define shmem_longdouble_p pshmem_longdouble_p
#define shmemx_int16_p pshmemx_int16_p
#define shmemx_int32_p pshmemx_int32_p
#define shmemx_int64_p pshmemx_int64_p
/*
* Block data put routines
*/
#define shmem_char_put pshmem_char_put
#define shmem_short_put pshmem_short_put
#define shmem_int_put pshmem_int_put
#define shmem_long_put pshmem_long_put
#define shmem_float_put pshmem_float_put
#define shmem_double_put pshmem_double_put
#define shmem_longlong_put pshmem_longlong_put
#define shmem_longdouble_put pshmem_longdouble_put
#define shmem_put16 pshmem_put16
#define shmem_put32 pshmem_put32
#define shmem_put64 pshmem_put64
#define shmem_put128 pshmem_put128
#define shmem_putmem pshmem_putmem
#define shmem_char_put pshmem_char_put /* shmem-compat.h */
#define shmem_short_put pshmem_short_put
#define shmem_int_put pshmem_int_put
#define shmem_long_put pshmem_long_put
#define shmem_float_put pshmem_float_put
#define shmem_double_put pshmem_double_put
#define shmem_longlong_put pshmem_longlong_put
#define shmem_longdouble_put pshmem_longdouble_put
#define shmemx_put16 pshmemx_put16
#define shmem_put32 pshmem_put32
#define shmem_put64 pshmem_put64
#define shmem_put128 pshmem_put128
#define shmem_putmem pshmem_putmem
/*
* Strided put routines
*/
#define shmem_int_iput pshmem_int_iput
#define shmem_short_iput pshmem_short_iput
#define shmem_float_iput pshmem_float_iput
#define shmem_double_iput pshmem_double_iput
#define shmem_longlong_iput pshmem_longlong_iput
#define shmem_longdouble_iput pshmem_longdouble_iput
#define shmem_long_iput pshmem_long_iput
#define shmem_iput16 pshmem_iput16
#define shmem_iput32 pshmem_iput32
#define shmem_iput64 pshmem_iput64
#define shmem_iput128 pshmem_iput128
#define shmem_int_iput pshmem_int_iput
#define shmem_short_iput pshmem_short_iput
#define shmem_float_iput pshmem_float_iput
#define shmem_double_iput pshmem_double_iput
#define shmem_longlong_iput pshmem_longlong_iput
#define shmem_longdouble_iput pshmem_longdouble_iput
#define shmem_long_iput pshmem_long_iput
#define shmemx_iput16 pshmemx_iput16
#define shmem_iput32 pshmem_iput32
#define shmem_iput64 pshmem_iput64
#define shmem_iput128 pshmem_iput128
/*
* Elemental get routines
*/
#define shmem_char_g pshmem_char_g
#define shmem_short_g pshmem_short_g
#define shmem_int_g pshmem_int_g
#define shmem_long_g pshmem_long_g
#define shmem_float_g pshmem_float_g
#define shmem_double_g pshmem_double_g
#define shmem_longlong_g pshmem_longlong_g
#define shmem_longdouble_g pshmem_longdouble_g
#define shmem_int16_g pshmem_int16_g
#define shmem_int32_g pshmem_int32_g
#define shmem_int64_g pshmem_int64_g
#define shmem_char_g pshmem_char_g
#define shmem_short_g pshmem_short_g
#define shmem_int_g pshmem_int_g
#define shmem_long_g pshmem_long_g
#define shmem_float_g pshmem_float_g
#define shmem_double_g pshmem_double_g
#define shmem_longlong_g pshmem_longlong_g
#define shmem_longdouble_g pshmem_longdouble_g
#define shmemx_int16_g pshmemx_int16_g
#define shmemx_int32_g pshmemx_int32_g
#define shmemx_int64_g pshmemx_int64_g
/*
* Block data get routines
*/
#define shmem_char_get pshmem_char_get
#define shmem_short_get pshmem_short_get
#define shmem_int_get pshmem_int_get
#define shmem_long_get pshmem_long_get
#define shmem_float_get pshmem_float_get
#define shmem_double_get pshmem_double_get
#define shmem_longlong_get pshmem_longlong_get
#define shmem_longdouble_get pshmem_longdouble_get
#define shmem_get16 pshmem_get16
#define shmem_get32 pshmem_get32
#define shmem_get64 pshmem_get64
#define shmem_get128 pshmem_get128
#define shmem_getmem pshmem_getmem
#define shmem_char_get pshmem_char_get /* shmem-compat.h */
#define shmem_short_get pshmem_short_get
#define shmem_int_get pshmem_int_get
#define shmem_long_get pshmem_long_get
#define shmem_float_get pshmem_float_get
#define shmem_double_get pshmem_double_get
#define shmem_longlong_get pshmem_longlong_get
#define shmem_longdouble_get pshmem_longdouble_get
#define shmemx_get16 pshmemx_get16
#define shmem_get32 pshmem_get32
#define shmem_get64 pshmem_get64
#define shmem_get128 pshmem_get128
#define shmem_getmem pshmem_getmem
/*
* Strided get routines
*/
#define shmem_int_iget pshmem_int_iget
#define shmem_short_iget pshmem_short_iget
#define shmem_float_iget pshmem_float_iget
#define shmem_double_iget pshmem_double_iget
#define shmem_longlong_iget pshmem_longlong_iget
#define shmem_longdouble_iget pshmem_longdouble_iget
#define shmem_long_iget pshmem_long_iget
#define shmem_iget16 pshmem_iget16
#define shmem_iget32 pshmem_iget32
#define shmem_iget64 pshmem_iget64
#define shmem_iget128 pshmem_iget128
#define shmem_int_iget pshmem_int_iget
#define shmem_short_iget pshmem_short_iget
#define shmem_float_iget pshmem_float_iget
#define shmem_double_iget pshmem_double_iget
#define shmem_longlong_iget pshmem_longlong_iget
#define shmem_longdouble_iget pshmem_longdouble_iget
#define shmem_long_iget pshmem_long_iget
#define shmemx_iget16 pshmemx_iget16
#define shmem_iget32 pshmem_iget32
#define shmem_iget64 pshmem_iget64
#define shmem_iget128 pshmem_iget128
/*
* Atomic operations
*/
/* Atomic swap */
#define shmem_swap pshmem_swap
#define shmem_double_swap pshmem_double_swap
#define shmem_float_swap pshmem_float_swap
#define shmem_int_swap pshmem_int_swap
#define shmem_long_swap pshmem_long_swap
#define shmem_longlong_swap pshmem_longlong_swap
#define shmem_int32_swap pshmem_int32_swap
#define shmem_int64_swap pshmem_int64_swap
#define shmem_swap pshmem_swap
#define shmem_double_swap pshmem_double_swap
#define shmem_float_swap pshmem_float_swap
#define shmem_int_swap pshmem_int_swap
#define shmem_long_swap pshmem_long_swap
#define shmem_longlong_swap pshmem_longlong_swap
#define shmemx_int32_swap pshmemx_int32_swap
#define shmemx_int64_swap pshmemx_int64_swap
/* Atomic conditional swap */
#define shmem_int_cswap pshmem_int_cswap
#define shmem_long_cswap pshmem_long_cswap
#define shmem_longlong_cswap pshmem_longlong_cswap
#define shmem_int32_cswap pshmem_int32_cswap
#define shmem_int64_cswap pshmem_int64_cswap
#define shmem_int_cswap pshmem_int_cswap
#define shmem_long_cswap pshmem_long_cswap
#define shmem_longlong_cswap pshmem_longlong_cswap
#define shmemx_int32_cswap pshmemx_int32_cswap
#define shmemx_int64_cswap pshmemx_int64_cswap
/* Atomic Fetch&Add */
#define shmem_int_fadd pshmem_int_fadd
#define shmem_long_fadd pshmem_long_fadd
#define shmem_longlong_fadd pshmem_longlong_fadd
#define shmem_int32_fadd pshmem_int32_fadd
#define shmem_int64_fadd pshmem_int64_fadd
#define shmem_int_fadd pshmem_int_fadd
#define shmem_long_fadd pshmem_long_fadd
#define shmem_longlong_fadd pshmem_longlong_fadd
#define shmemx_int32_fadd pshmemx_int32_fadd
#define shmemx_int64_fadd pshmemx_int64_fadd
/* Atomic Fetch&Inc */
#define shmem_int_finc pshmem_int_finc
#define shmem_long_finc pshmem_long_finc
#define shmem_longlong_finc pshmem_longlong_finc
#define shmem_int32_finc pshmem_int32_finc
#define shmem_int64_finc pshmem_int64_finc
#define shmem_int_finc pshmem_int_finc
#define shmem_long_finc pshmem_long_finc
#define shmem_longlong_finc pshmem_longlong_finc
#define shmemx_int32_finc pshmemx_int32_finc
#define shmemx_int64_finc pshmemx_int64_finc
/* Atomic Add*/
#define shmem_int_add pshmem_int_add
#define shmem_long_add pshmem_long_add
#define shmem_longlong_add pshmem_longlong_add
#define shmem_int32_add pshmem_int32_add
#define shmem_int64_add pshmem_int64_add
#define shmem_int_add pshmem_int_add
#define shmem_long_add pshmem_long_add
#define shmem_longlong_add pshmem_longlong_add
#define shmemx_int32_add pshmemx_int32_add
#define shmemx_int64_add pshmemx_int64_add
/* Atomic Inc */
#define shmem_int_inc pshmem_int_inc
#define shmem_long_inc pshmem_long_inc
#define shmem_longlong_inc pshmem_longlong_inc
#define shmem_int32_inc pshmem_int32_inc
#define shmem_int64_inc pshmem_int64_inc
#define shmem_int_inc pshmem_int_inc
#define shmem_long_inc pshmem_long_inc
#define shmem_longlong_inc pshmem_longlong_inc
#define shmemx_int32_inc pshmemx_int32_inc
#define shmemx_int64_inc pshmemx_int64_inc
/*
* Lock functions
*/
#define shmem_set_lock pshmem_set_lock
#define shmem_clear_lock pshmem_clear_lock
#define shmem_test_lock pshmem_test_lock
#define shmem_set_lock pshmem_set_lock
#define shmem_clear_lock pshmem_clear_lock
#define shmem_test_lock pshmem_test_lock
/*
* P2P sync routines
*/
#define shmem_short_wait pshmem_short_wait
#define shmem_int_wait pshmem_int_wait
#define shmem_long_wait pshmem_long_wait
#define shmem_longlong_wait pshmem_longlong_wait
#define shmem_wait pshmem_wait
#define shmem_int16_wait pshmem_int16_wait
#define shmem_int32_wait pshmem_int32_wait
#define shmem_int64_wait pshmem_int64_wait
#define shmem_short_wait pshmem_short_wait
#define shmem_int_wait pshmem_int_wait
#define shmem_long_wait pshmem_long_wait
#define shmem_longlong_wait pshmem_longlong_wait
#define shmem_wait pshmem_wait
#define shmemx_int32_wait pshmemx_int32_wait
#define shmemx_int64_wait pshmemx_int64_wait
#define shmem_short_wait_until pshmem_short_wait_until
#define shmem_int_wait_until pshmem_int_wait_until
#define shmem_long_wait_until pshmem_long_wait_until
#define shmem_longlong_wait_until pshmem_longlong_wait_until
#define shmem_wait_until pshmem_wait_until
#define shmem_int16_wait_until pshmem_int16_wait_until
#define shmem_int32_wait_until pshmem_int32_wait_until
#define shmem_int64_wait_until pshmem_int64_wait_until
#define shmem_short_wait_until pshmem_short_wait_until
#define shmem_int_wait_until pshmem_int_wait_until
#define shmem_long_wait_until pshmem_long_wait_until
#define shmem_longlong_wait_until pshmem_longlong_wait_until
#define shmem_wait_until pshmem_wait_until
#define shmemx_int32_wait_until pshmemx_int32_wait_until
#define shmemx_int64_wait_until pshmemx_int64_wait_until
/*
* Barrier sync routines
*/
#define shmem_barrier pshmem_barrier
#define shmem_barrier_all pshmem_barrier_all
#define shmem_fence pshmem_fence
#define shmem_quiet pshmem_quiet
#define shmem_barrier pshmem_barrier
#define shmem_barrier_all pshmem_barrier_all
#define shmem_fence pshmem_fence
#define shmem_quiet pshmem_quiet
/*
* Collective routines
*/
#define shmem_broadcast32 pshmem_broadcast32
#define shmem_broadcast64 pshmem_broadcast64
#define shmem_broadcast pshmem_broadcast
#define shmem_collect32 pshmem_collect32
#define shmem_collect64 pshmem_collect64
#define shmem_fcollect32 pshmem_fcollect32
#define shmem_fcollect64 pshmem_fcollect64
#define shmem_broadcast32 pshmem_broadcast32
#define shmem_broadcast64 pshmem_broadcast64
#define shmem_broadcast pshmem_broadcast
#define shmem_collect32 pshmem_collect32
#define shmem_collect64 pshmem_collect64
#define shmem_fcollect32 pshmem_fcollect32
#define shmem_fcollect64 pshmem_fcollect64
/*
* Reduction routines
*/
#define shmem_short_and_to_all pshmem_short_and_to_all
#define shmem_int_and_to_all pshmem_int_and_to_all
#define shmem_long_and_to_all pshmem_long_and_to_all
#define shmem_longlong_and_to_all pshmem_longlong_and_to_all
#define shmem_int16_and_to_all pshmem_int16_and_to_all
#define shmem_int32_and_to_all pshmem_int32_and_to_all
#define shmem_int64_and_to_all pshmem_int64_and_to_all
#define shmem_short_and_to_all pshmem_short_and_to_all
#define shmem_int_and_to_all pshmem_int_and_to_all
#define shmem_long_and_to_all pshmem_long_and_to_all
#define shmem_longlong_and_to_all pshmem_longlong_and_to_all
#define shmemx_int16_and_to_all pshmemx_int16_and_to_all
#define shmemx_int32_and_to_all pshmemx_int32_and_to_all
#define shmemx_int64_and_to_all pshmemx_int64_and_to_all
#define shmem_short_or_to_all pshmem_short_or_to_all
#define shmem_int_or_to_all pshmem_int_or_to_all
#define shmem_long_or_to_all pshmem_long_or_to_all
#define shmem_longlong_or_to_all pshmem_longlong_or_to_all
#define shmem_int16_or_to_all pshmem_int16_or_to_all
#define shmem_int32_or_to_all pshmem_int32_or_to_all
#define shmem_int64_or_to_all pshmem_int64_or_to_all
#define shmem_short_or_to_all pshmem_short_or_to_all
#define shmem_int_or_to_all pshmem_int_or_to_all
#define shmem_long_or_to_all pshmem_long_or_to_all
#define shmem_longlong_or_to_all pshmem_longlong_or_to_all
#define shmemx_int16_or_to_all pshmemx_int16_or_to_all
#define shmemx_int32_or_to_all pshmemx_int32_or_to_all
#define shmemx_int64_or_to_all pshmemx_int64_or_to_all
#define shmem_short_xor_to_all pshmem_short_xor_to_all
#define shmem_int_xor_to_all pshmem_int_xor_to_all
#define shmem_long_xor_to_all pshmem_long_xor_to_all
#define shmem_longlong_xor_to_all pshmem_longlong_xor_to_all
#define shmem_int16_xor_to_all pshmem_int16_xor_to_all
#define shmem_int32_xor_to_all pshmem_int32_xor_to_all
#define shmem_int64_xor_to_all pshmem_int64_xor_to_all
#define shmem_short_xor_to_all pshmem_short_xor_to_all
#define shmem_int_xor_to_all pshmem_int_xor_to_all
#define shmem_long_xor_to_all pshmem_long_xor_to_all
#define shmem_longlong_xor_to_all pshmem_longlong_xor_to_all
#define shmemx_int16_xor_to_all pshmemx_int16_xor_to_all
#define shmemx_int32_xor_to_all pshmemx_int32_xor_to_all
#define shmemx_int64_xor_to_all pshmemx_int64_xor_to_all
#define shmem_short_max_to_all pshmem_short_max_to_all
#define shmem_int_max_to_all pshmem_int_max_to_all
#define shmem_long_max_to_all pshmem_long_max_to_all
#define shmem_longlong_max_to_all pshmem_longlong_max_to_all
#define shmem_float_max_to_all pshmem_float_max_to_all
#define shmem_double_max_to_all pshmem_double_max_to_all
#define shmem_longdouble_max_to_all pshmem_longdouble_max_to_all
#define shmem_int16_max_to_all pshmem_int16_max_to_all
#define shmem_int32_max_to_all pshmem_int32_max_to_all
#define shmem_int64_max_to_all pshmem_int64_max_to_all
#define shmem_short_max_to_all pshmem_short_max_to_all
#define shmem_int_max_to_all pshmem_int_max_to_all
#define shmem_long_max_to_all pshmem_long_max_to_all
#define shmem_longlong_max_to_all pshmem_longlong_max_to_all
#define shmem_float_max_to_all pshmem_float_max_to_all
#define shmem_double_max_to_all pshmem_double_max_to_all
#define shmem_longdouble_max_to_all pshmem_longdouble_max_to_all
#define shmemx_int16_max_to_all pshmemx_int16_max_to_all
#define shmemx_int32_max_to_all pshmemx_int32_max_to_all
#define shmemx_int64_max_to_all pshmemx_int64_max_to_all
#define shmem_short_min_to_all pshmem_short_min_to_all
#define shmem_int_min_to_all pshmem_int_min_to_all
#define shmem_long_min_to_all pshmem_long_min_to_all
#define shmem_longlong_min_to_all pshmem_longlong_min_to_all
#define shmem_float_min_to_all pshmem_float_min_to_all
#define shmem_double_min_to_all pshmem_double_min_to_all
#define shmem_longdouble_min_to_all pshmem_longdouble_min_to_all
#define shmem_int16_min_to_all pshmem_int16_min_to_all
#define shmem_int32_min_to_all pshmem_int32_min_to_all
#define shmem_int64_min_to_all pshmem_int64_min_to_all
#define shmem_short_min_to_all pshmem_short_min_to_all
#define shmem_int_min_to_all pshmem_int_min_to_all
#define shmem_long_min_to_all pshmem_long_min_to_all
#define shmem_longlong_min_to_all pshmem_longlong_min_to_all
#define shmem_float_min_to_all pshmem_float_min_to_all
#define shmem_double_min_to_all pshmem_double_min_to_all
#define shmem_longdouble_min_to_all pshmem_longdouble_min_to_all
#define shmemx_int16_min_to_all pshmemx_int16_min_to_all
#define shmemx_int32_min_to_all pshmemx_int32_min_to_all
#define shmemx_int64_min_to_all pshmemx_int64_min_to_all
#define shmem_short_sum_to_all pshmem_short_sum_to_all
#define shmem_int_sum_to_all pshmem_int_sum_to_all
#define shmem_long_sum_to_all pshmem_long_sum_to_all
#define shmem_longlong_sum_to_all pshmem_longlong_sum_to_all
#define shmem_float_sum_to_all pshmem_float_sum_to_all
#define shmem_double_sum_to_all pshmem_double_sum_to_all
#define shmem_longdouble_sum_to_all pshmem_longdouble_sum_to_all
#define shmem_complexf_sum_to_all pshmem_complexf_sum_to_all
#define shmem_complexd_sum_to_all pshmem_complexd_sum_to_all
#define shmem_int16_sum_to_all pshmem_int16_sum_to_all
#define shmem_int32_sum_to_all pshmem_int32_sum_to_all
#define shmem_int64_sum_to_all pshmem_int64_sum_to_all
#define shmem_short_sum_to_all pshmem_short_sum_to_all
#define shmem_int_sum_to_all pshmem_int_sum_to_all
#define shmem_long_sum_to_all pshmem_long_sum_to_all
#define shmem_longlong_sum_to_all pshmem_longlong_sum_to_all
#define shmem_float_sum_to_all pshmem_float_sum_to_all
#define shmem_double_sum_to_all pshmem_double_sum_to_all
#define shmem_longdouble_sum_to_all pshmem_longdouble_sum_to_all
#define shmem_complexf_sum_to_all pshmem_complexf_sum_to_all
#define shmem_complexd_sum_to_all pshmem_complexd_sum_to_all
#define shmemx_int16_sum_to_all pshmemx_int16_sum_to_all
#define shmemx_int32_sum_to_all pshmemx_int32_sum_to_all
#define shmemx_int64_sum_to_all pshmemx_int64_sum_to_all
#define shmem_short_prod_to_all pshmem_short_prod_to_all
#define shmem_int_prod_to_all pshmem_int_prod_to_all
#define shmem_long_prod_to_all pshmem_long_prod_to_all
#define shmem_longlong_prod_to_all pshmem_longlong_prod_to_all
#define shmem_float_prod_to_all pshmem_float_prod_to_all
#define shmem_double_prod_to_all pshmem_double_prod_to_all
#define shmem_short_prod_to_all pshmem_short_prod_to_all
#define shmem_int_prod_to_all pshmem_int_prod_to_all
#define shmem_long_prod_to_all pshmem_long_prod_to_all
#define shmem_longlong_prod_to_all pshmem_longlong_prod_to_all
#define shmem_float_prod_to_all pshmem_float_prod_to_all
#define shmem_double_prod_to_all pshmem_double_prod_to_all
#define shmem_longdouble_prod_to_all pshmem_longdouble_prod_to_all
#define shmem_complexf_prod_to_all pshmem_complexf_prod_to_all
#define shmem_complexd_prod_to_all pshmem_complexd_prod_to_all
#define shmem_int16_prod_to_all pshmem_int16_prod_to_all
#define shmem_int32_prod_to_all pshmem_int32_prod_to_all
#define shmem_int64_prod_to_all pshmem_int64_prod_to_all
#define shmem_complexf_prod_to_all pshmem_complexf_prod_to_all
#define shmem_complexd_prod_to_all pshmem_complexd_prod_to_all
#define shmemx_int16_prod_to_all pshmemx_int16_prod_to_all
#define shmemx_int32_prod_to_all pshmemx_int32_prod_to_all
#define shmemx_int64_prod_to_all pshmemx_int64_prod_to_all
/*
* Platform specific cache management routines

Просмотреть файл

@ -22,8 +22,8 @@
* must be completed without the possibility of another process updating target between the
* time of the fetch and the update.
*/
#define SHMEM_TYPE_ADD(type_name, type) \
void shmem##type_name##_add(type *target, type value, int pe) \
#define SHMEM_TYPE_ADD(type_name, type, ...) \
void shmem##__VA_ARGS__##type_name##_add(type *target, type value, int pe) \
{ \
int rc = OSHMEM_SUCCESS; \
size_t size = 0; \
@ -52,13 +52,13 @@
#pragma weak shmem_int_add = pshmem_int_add
#pragma weak shmem_long_add = pshmem_long_add
#pragma weak shmem_longlong_add = pshmem_longlong_add
#pragma weak shmem_int32_add = pshmem_int32_add
#pragma weak shmem_int64_add = pshmem_int64_add
#pragma weak shmemx_int32_add = pshmemx_int32_add
#pragma weak shmemx_int64_add = pshmemx_int64_add
#include "oshmem/shmem/c/profile/defines.h"
#endif
SHMEM_TYPE_ADD(_int, int)
SHMEM_TYPE_ADD(_long, long)
SHMEM_TYPE_ADD(_longlong, long long)
SHMEM_TYPE_ADD(_int32, int32_t)
SHMEM_TYPE_ADD(_int64, int64_t)
SHMEM_TYPE_ADD(_int32, int32_t, x)
SHMEM_TYPE_ADD(_int64, int64_t, x)

Просмотреть файл

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013 Mellanox Technologies, Inc.
* Copyright (c) 2013-2015 Mellanox Technologies, Inc.
* All rights reserved.
* $COPYRIGHT$
*
@ -19,11 +19,24 @@
#if OSHMEM_PROFILING
#include "oshmem/include/pshmem.h"
#pragma weak shmem_align = pshmem_align
#pragma weak shmemalign = pshmemalign
#include "oshmem/shmem/c/profile/defines.h"
#endif
static inline void* _shmemalign(size_t align, size_t size);
void* shmem_align(size_t align, size_t size)
{
return _shmemalign(align, size);
}
void* shmemalign(size_t align, size_t size)
{
return _shmemalign(align, size);
}
static inline void* _shmemalign(size_t align, size_t size)
{
int rc;
void* pBuff = NULL;

Просмотреть файл

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013 Mellanox Technologies, Inc.
* Copyright (c) 2013-2015 Mellanox Technologies, Inc.
* All rights reserved.
* $COPYRIGHT$
*
@ -19,11 +19,24 @@
#if OSHMEM_PROFILING
#include "oshmem/include/pshmem.h"
#pragma weak shmem_malloc = pshmem_malloc
#pragma weak shmalloc = pshmalloc
#include "oshmem/shmem/c/profile/defines.h"
#endif
static inline void* _shmalloc(size_t size);
void* shmem_malloc(size_t size)
{
return _shmalloc(size);
}
void* shmalloc(size_t size)
{
return _shmalloc(size);
}
static inline void* _shmalloc(size_t size)
{
int rc;
void* pBuff = NULL;

Просмотреть файл

@ -24,8 +24,8 @@
* of target. The operation must be completed without the possibility of another process updating
* target between the time of the fetch and the update.
*/
#define SHMEM_TYPE_CSWAP(type_name, type) \
type shmem##type_name##_cswap(type *target, type cond, type value, int pe) \
#define SHMEM_TYPE_CSWAP(type_name, type, ...) \
type shmem##__VA_ARGS__##type_name##_cswap(type *target, type cond, type value, int pe) \
{ \
int rc = OSHMEM_SUCCESS; \
size_t size = 0; \
@ -53,14 +53,14 @@
#pragma weak shmem_int_cswap = pshmem_int_cswap
#pragma weak shmem_long_cswap = pshmem_long_cswap
#pragma weak shmem_longlong_cswap = pshmem_longlong_cswap
#pragma weak shmem_int32_cswap = pshmem_int32_cswap
#pragma weak shmem_int64_cswap = pshmem_int64_cswap
#pragma weak shmemx_int32_cswap = pshmemx_int32_cswap
#pragma weak shmemx_int64_cswap = pshmemx_int64_cswap
#include "oshmem/shmem/c/profile/defines.h"
#endif
SHMEM_TYPE_CSWAP(_int, int)
SHMEM_TYPE_CSWAP(_long, long)
SHMEM_TYPE_CSWAP(_longlong, long long)
SHMEM_TYPE_CSWAP(_int32, int32_t)
SHMEM_TYPE_CSWAP(_int64, int64_t)
SHMEM_TYPE_CSWAP(_int32, int32_t, x)
SHMEM_TYPE_CSWAP(_int64, int64_t, x)

Просмотреть файл

@ -24,8 +24,8 @@
* without the possibility of another process updating target between the time of the
* fetch and the update.
*/
#define SHMEM_TYPE_FADD(type_name, type) \
type shmem##type_name##_fadd(type *target, type value, int pe) \
#define SHMEM_TYPE_FADD(type_name, type, ...) \
type shmem##__VA_ARGS__##type_name##_fadd(type *target, type value, int pe) \
{ \
int rc = OSHMEM_SUCCESS; \
size_t size = 0; \
@ -54,13 +54,13 @@
#pragma weak shmem_int_fadd = pshmem_int_fadd
#pragma weak shmem_long_fadd = pshmem_long_fadd
#pragma weak shmem_longlong_fadd = pshmem_longlong_fadd
#pragma weak shmem_int32_fadd = pshmem_int32_fadd
#pragma weak shmem_int64_fadd = pshmem_int64_fadd
#pragma weak shmemx_int32_fadd = pshmemx_int32_fadd
#pragma weak shmemx_int64_fadd = pshmemx_int64_fadd
#include "oshmem/shmem/c/profile/defines.h"
#endif
SHMEM_TYPE_FADD(_int, int)
SHMEM_TYPE_FADD(_long, long)
SHMEM_TYPE_FADD(_longlong, long long)
SHMEM_TYPE_FADD(_int32, int32_t)
SHMEM_TYPE_FADD(_int64, int64_t)
SHMEM_TYPE_FADD(_int32, int32_t, x)
SHMEM_TYPE_FADD(_int64, int64_t, x)

Просмотреть файл

@ -24,8 +24,8 @@
* completed without the possibility of another process updating target between the time of
* the fetch and the update.
*/
#define SHMEM_TYPE_FINC(type_name, type) \
type shmem##type_name##_finc(type *target, int pe) \
#define SHMEM_TYPE_FINC(type_name, type, ...) \
type shmem##__VA_ARGS__##type_name##_finc(type *target, int pe) \
{ \
int rc = OSHMEM_SUCCESS; \
size_t size; \
@ -55,13 +55,13 @@
#pragma weak shmem_int_finc = pshmem_int_finc
#pragma weak shmem_long_finc = pshmem_long_finc
#pragma weak shmem_longlong_finc = pshmem_longlong_finc
#pragma weak shmem_int32_finc = pshmem_int32_finc
#pragma weak shmem_int64_finc = pshmem_int64_finc
#pragma weak shmemx_int32_finc = pshmemx_int32_finc
#pragma weak shmemx_int64_finc = pshmemx_int64_finc
#include "oshmem/shmem/c/profile/defines.h"
#endif
SHMEM_TYPE_FINC(_int, int)
SHMEM_TYPE_FINC(_long, long)
SHMEM_TYPE_FINC(_longlong, long long)
SHMEM_TYPE_FINC(_int32, int32_t)
SHMEM_TYPE_FINC(_int64, int64_t)
SHMEM_TYPE_FINC(_int32, int32_t, x)
SHMEM_TYPE_FINC(_int64, int64_t, x)

Просмотреть файл

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013 Mellanox Technologies, Inc.
* Copyright (c) 2013-2015 Mellanox Technologies, Inc.
* All rights reserved.
* $COPYRIGHT$
*
@ -20,11 +20,24 @@
#if OSHMEM_PROFILING
#include "oshmem/include/pshmem.h"
#pragma weak shmem_free = pshmem_free
#pragma weak shfree = pshfree
#include "oshmem/shmem/c/profile/defines.h"
#endif
static inline void _shfree(void* ptr);
void shmem_free(void* ptr)
{
_shfree(ptr);
}
void shfree(void* ptr)
{
_shfree(ptr);
}
static inline void _shfree(void* ptr)
{
int rc;

Просмотреть файл

@ -21,8 +21,8 @@
* double, long) from symmetric data objects on remote PEs.
* Retrieves the value at the symmetric address addr of the remote PE pe.
*/
#define SHMEM_TYPE_G(type_name, type) \
type shmem##type_name##_g(type *addr, int pe) \
#define SHMEM_TYPE_G(type_name, type, ...) \
type shmem##__VA_ARGS__##type_name##_g(type *addr, int pe) \
{ \
int rc = OSHMEM_SUCCESS; \
size_t size = 0; \
@ -53,9 +53,9 @@
#pragma weak shmem_float_g = pshmem_float_g
#pragma weak shmem_double_g = pshmem_double_g
#pragma weak shmem_longdouble_g = pshmem_longdouble_g
#pragma weak shmem_int16_g = pshmem_int16_g
#pragma weak shmem_int32_g = pshmem_int32_g
#pragma weak shmem_int64_g = pshmem_int64_g
#pragma weak shmemx_int16_g = pshmemx_int16_g
#pragma weak shmemx_int32_g = pshmemx_int32_g
#pragma weak shmemx_int64_g = pshmemx_int64_g
#include "oshmem/shmem/c/profile/defines.h"
#endif
@ -67,6 +67,6 @@ SHMEM_TYPE_G(_longlong, long long)
SHMEM_TYPE_G(_float, float)
SHMEM_TYPE_G(_double, double)
SHMEM_TYPE_G(_longdouble, long double)
SHMEM_TYPE_G(_int16, int16_t)
SHMEM_TYPE_G(_int32, int32_t)
SHMEM_TYPE_G(_int64, int64_t)
SHMEM_TYPE_G(_int16, int16_t, x)
SHMEM_TYPE_G(_int32, int32_t, x)
SHMEM_TYPE_G(_int64, int64_t, x)

Просмотреть файл

@ -54,7 +54,7 @@
#pragma weak shmem_double_get = pshmem_double_get
#pragma weak shmem_longdouble_get = pshmem_longdouble_get
#pragma weak shmem_getmem = pshmem_getmem
#pragma weak shmem_get16 = pshmem_get16
#pragma weak shmemx_get16 = pshmemx_get16
#pragma weak shmem_get32 = pshmem_get32
#pragma weak shmem_get64 = pshmem_get64
#pragma weak shmem_get128 = pshmem_get128
@ -70,8 +70,8 @@ SHMEM_TYPE_GET(_float, float)
SHMEM_TYPE_GET(_double, double)
SHMEM_TYPE_GET(_longdouble, long double)
#define SHMEM_TYPE_GETMEM(name, element_size) \
void shmem##name(void *target, const void *source, size_t nelems, int pe) \
#define SHMEM_TYPE_GETMEM(name, element_size, ...) \
void shmem##__VA_ARGS__##name(void *target, const void *source, size_t nelems, int pe) \
{ \
int rc = OSHMEM_SUCCESS; \
size_t size = 0; \
@ -92,7 +92,7 @@ SHMEM_TYPE_GET(_longdouble, long double)
}
SHMEM_TYPE_GETMEM(_getmem, 1)
SHMEM_TYPE_GETMEM(_get16, 2)
SHMEM_TYPE_GETMEM(_get16, 2, x)
SHMEM_TYPE_GETMEM(_get32, 4)
SHMEM_TYPE_GETMEM(_get64, 8)
SHMEM_TYPE_GETMEM(_get128, 16)

Просмотреть файл

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012 Mellanox Technologies, Inc.
* Copyright (c) 2012-2015 Mellanox Technologies, Inc.
* All rights reserved.
* $COPYRIGHT$
*
@ -14,9 +14,27 @@
#include "orte/mca/errmgr/errmgr.h"
#if OSHMEM_PROFILING
#include "oshmem/include/pshmem.h"
#pragma weak shmem_global_exit = pshmem_global_exit
#include "oshmem/shmem/c/profile/defines.h"
#endif
extern int oshmem_shmem_inglobalexit;
static inline void _globalexit(int status);
void shmem_global_exit(int status)
{
_globalexit(status);
}
void globalexit(int status)
{
_globalexit(status);
}
static inline void _globalexit(int status)
{
oshmem_shmem_inglobalexit++;

Просмотреть файл

@ -57,6 +57,7 @@
#pragma weak shmem_float_iget = pshmem_float_iget
#pragma weak shmem_double_iget = pshmem_double_iget
#pragma weak shmem_longdouble_iget = pshmem_longdouble_iget
#pragma weak shmemx_iget16 = pshmemx_iget16
#pragma weak shmem_iget32 = pshmem_iget32
#pragma weak shmem_iget64 = pshmem_iget64
#pragma weak shmem_iget128 = pshmem_iget128
@ -71,8 +72,8 @@ SHMEM_TYPE_IGET(_float, float)
SHMEM_TYPE_IGET(_double, double)
SHMEM_TYPE_IGET(_longdouble, long double)
#define SHMEM_TYPE_IGETMEM(name, element_size) \
void shmem##name(void *target, const void *source, ptrdiff_t tst, ptrdiff_t sst, size_t nelems, int pe) \
#define SHMEM_TYPE_IGETMEM(name, element_size, ...) \
void shmem##__VA_ARGS__##name(void *target, const void *source, ptrdiff_t tst, ptrdiff_t sst, size_t nelems, int pe) \
{ \
int rc = OSHMEM_SUCCESS; \
size_t i = 0; \
@ -94,6 +95,7 @@ SHMEM_TYPE_IGET(_longdouble, long double)
return ; \
}
SHMEM_TYPE_IGETMEM(_iget16, 2, x)
SHMEM_TYPE_IGETMEM(_iget32, 4)
SHMEM_TYPE_IGETMEM(_iget64, 8)
SHMEM_TYPE_IGETMEM(_iget128, 16)

Просмотреть файл

@ -23,8 +23,8 @@
* one. The operation must be completed without the possibility of another process updating
* target between the time of the fetch and the update.
*/
#define SHMEM_TYPE_INC(type_name, type) \
void shmem##type_name##_inc(type *target, int pe) \
#define SHMEM_TYPE_INC(type_name, type, ...) \
void shmem##__VA_ARGS__##type_name##_inc(type *target, int pe) \
{ \
int rc = OSHMEM_SUCCESS; \
size_t size = 0; \
@ -54,13 +54,13 @@
#pragma weak shmem_int_inc = pshmem_int_inc
#pragma weak shmem_long_inc = pshmem_long_inc
#pragma weak shmem_longlong_inc = pshmem_longlong_inc
#pragma weak shmem_int32_inc = pshmem_int32_inc
#pragma weak shmem_int64_inc = pshmem_int64_inc
#pragma weak shmemx_int32_inc = pshmemx_int32_inc
#pragma weak shmemx_int64_inc = pshmemx_int64_inc
#include "oshmem/shmem/c/profile/defines.h"
#endif
SHMEM_TYPE_INC(_int, int)
SHMEM_TYPE_INC(_long, long)
SHMEM_TYPE_INC(_longlong, long long)
SHMEM_TYPE_INC(_int32, int32_t)
SHMEM_TYPE_INC(_int64, int64_t)
SHMEM_TYPE_INC(_int32, int32_t, x)
SHMEM_TYPE_INC(_int64, int64_t, x)

36
oshmem/shmem/c/shmem_info.c Обычный файл
Просмотреть файл

@ -0,0 +1,36 @@
/*
* Copyright (c) 2015 Mellanox Technologies, Inc.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "oshmem_config.h"
#include <string.h>
#include <assert.h>
#include "oshmem/constants.h"
#include "oshmem/include/shmem.h"
void shmem_info_get_version(int *major, int *minor)
{
if (major) {
*major = SHMEM_MAJOR_VERSION;
}
if (minor) {
*minor = SHMEM_MINOR_VERSION;
}
}
void shmem_info_get_name(char *name)
{
if (name) {
assert(sizeof(SHMEM_VENDOR_STRING) < SHMEM_MAX_NAME_LEN);
memset(name, 0, SHMEM_MAX_NAME_LEN);
memcpy(name, SHMEM_VENDOR_STRING, sizeof(SHMEM_VENDOR_STRING));
}
}

Просмотреть файл

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013 Mellanox Technologies, Inc.
* Copyright (c) 2013-2015 Mellanox Technologies, Inc.
* All rights reserved.
* $COPYRIGHT$
*
@ -25,16 +25,25 @@
#if OSHMEM_PROFILING
#include "oshmem/include/pshmem.h"
#pragma weak shmem_init = pshmem_init
#pragma weak start_pes = pstart_pes
#include "oshmem/shmem/c/profile/defines.h"
#endif
extern int oshmem_shmem_globalexit_status;
static inline void _shmem_init(void);
void shmem_init(void)
{
/* spec says that npes are ignored for now */
_shmem_init();
}
void start_pes(int npes)
{
/* spec says that npes are ignored for now */
shmem_init();
_shmem_init();
}
static void shmem_onexit(int exitcode, void *arg)
@ -42,7 +51,7 @@ static void shmem_onexit(int exitcode, void *arg)
oshmem_shmem_globalexit_status = exitcode;
}
void shmem_init(void)
static inline void _shmem_init(void)
{
int err = OSHMEM_SUCCESS;
int provided;

Просмотреть файл

@ -57,7 +57,7 @@
#pragma weak shmem_float_iput = pshmem_float_iput
#pragma weak shmem_double_iput = pshmem_double_iput
#pragma weak shmem_longdouble_iput = pshmem_longdouble_iput
#pragma weak shmem_iput16 = pshmem_iput16
#pragma weak shmemx_iput16 = pshmemx_iput16
#pragma weak shmem_iput32 = pshmem_iput32
#pragma weak shmem_iput64 = pshmem_iput64
#pragma weak shmem_iput128 = pshmem_iput128
@ -72,8 +72,8 @@ SHMEM_TYPE_IPUT(_float, float)
SHMEM_TYPE_IPUT(_double, double)
SHMEM_TYPE_IPUT(_longdouble, long double)
#define SHMEM_TYPE_IPUTMEM(name, element_size) \
void shmem##name(void *target, const void *source, ptrdiff_t tst, ptrdiff_t sst, size_t nelems, int pe) \
#define SHMEM_TYPE_IPUTMEM(name, element_size, ...) \
void shmem##__VA_ARGS__##name(void *target, const void *source, ptrdiff_t tst, ptrdiff_t sst, size_t nelems, int pe) \
{ \
int rc = OSHMEM_SUCCESS; \
size_t i = 0; \
@ -95,7 +95,7 @@ SHMEM_TYPE_IPUT(_longdouble, long double)
return ; \
}
SHMEM_TYPE_IPUTMEM(_iput16, 2)
SHMEM_TYPE_IPUTMEM(_iput16, 2, x)
SHMEM_TYPE_IPUTMEM(_iput32, 4)
SHMEM_TYPE_IPUTMEM(_iput64, 8)
SHMEM_TYPE_IPUTMEM(_iput128, 16)

Просмотреть файл

@ -23,8 +23,8 @@
* data object of the remote PE indicated by the parameter pe. These routines start the remote
* transfer and may return before the data is delivered to the remote PE.
*/
#define SHMEM_TYPE_P(type_name, type) \
void shmem##type_name##_p(type *addr, type value, int pe) \
#define SHMEM_TYPE_P(type_name, type, ...) \
void shmem##__VA_ARGS__##type_name##_p(type *addr, type value, int pe) \
{ \
int rc = OSHMEM_SUCCESS; \
size_t size = 0; \
@ -54,9 +54,9 @@
#pragma weak shmem_float_p = pshmem_float_p
#pragma weak shmem_double_p = pshmem_double_p
#pragma weak shmem_longdouble_p = pshmem_longdouble_p
#pragma weak shmem_int16_p = pshmem_int16_p
#pragma weak shmem_int32_p = pshmem_int32_p
#pragma weak shmem_int64_p = pshmem_int64_p
#pragma weak shmemx_int16_p = pshmemx_int16_p
#pragma weak shmemx_int32_p = pshmemx_int32_p
#pragma weak shmemx_int64_p = pshmemx_int64_p
#include "oshmem/shmem/c/profile/defines.h"
#endif
@ -68,6 +68,6 @@ SHMEM_TYPE_P(_longlong, long long)
SHMEM_TYPE_P(_float, float)
SHMEM_TYPE_P(_double, double)
SHMEM_TYPE_P(_longdouble, long double)
SHMEM_TYPE_P(_int16, int16_t)
SHMEM_TYPE_P(_int32, int32_t)
SHMEM_TYPE_P(_int64, int64_t)
SHMEM_TYPE_P(_int16, int16_t, x)
SHMEM_TYPE_P(_int32, int32_t, x)
SHMEM_TYPE_P(_int64, int64_t, x)

Просмотреть файл

@ -57,7 +57,7 @@
#pragma weak shmem_double_put = pshmem_double_put
#pragma weak shmem_longdouble_put = pshmem_longdouble_put
#pragma weak shmem_putmem = pshmem_putmem
#pragma weak shmem_put16 = pshmem_put16
#pragma weak shmemx_put16 = pshmemx_put16
#pragma weak shmem_put32 = pshmem_put32
#pragma weak shmem_put64 = pshmem_put64
#pragma weak shmem_put128 = pshmem_put128
@ -73,8 +73,8 @@ SHMEM_TYPE_PUT(_float, float)
SHMEM_TYPE_PUT(_double, double)
SHMEM_TYPE_PUT(_longdouble, long double)
#define SHMEM_TYPE_PUTMEM(name, element_size) \
void shmem##name(void *target, const void *source, size_t nelems, int pe) \
#define SHMEM_TYPE_PUTMEM(name, element_size, ...) \
void shmem##__VA_ARGS__##name(void *target, const void *source, size_t nelems, int pe) \
{ \
int rc = OSHMEM_SUCCESS; \
size_t size = 0; \
@ -95,7 +95,7 @@ SHMEM_TYPE_PUT(_longdouble, long double)
}
SHMEM_TYPE_PUTMEM(_putmem, 1)
SHMEM_TYPE_PUTMEM(_put16, 2)
SHMEM_TYPE_PUTMEM(_put16, 2, x)
SHMEM_TYPE_PUTMEM(_put32, 4)
SHMEM_TYPE_PUTMEM(_put64, 8)
SHMEM_TYPE_PUTMEM(_put128, 16)

Просмотреть файл

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013 Mellanox Technologies, Inc.
* Copyright (c) 2013-2015 Mellanox Technologies, Inc.
* All rights reserved.
* $COPYRIGHT$
*
@ -18,6 +18,8 @@
#if OSHMEM_PROFILING
#include "oshmem/include/pshmem.h"
#pragma weak shmem_n_pes = pshmem_n_pes
#pragma weak shmem_my_pe = pshmem_my_pe
#pragma weak _num_pes = p_num_pes
#pragma weak _my_pe = p_my_pe
#include "oshmem/shmem/c/profile/defines.h"

Просмотреть файл

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013 Mellanox Technologies, Inc.
* Copyright (c) 2013-2015 Mellanox Technologies, Inc.
* All rights reserved.
* $COPYRIGHT$
*
@ -21,11 +21,24 @@
#if OSHMEM_PROFILING
#include "oshmem/include/pshmem.h"
#pragma weak shmem_realloc = pshmem_realloc
#pragma weak shrealloc = pshrealloc
#include "oshmem/shmem/c/profile/defines.h"
#endif
static inline void* _shrealloc(void *ptr, size_t size);
void* shmem_realloc(void *ptr, size_t size)
{
return _shrealloc(ptr, size);
}
void* shrealloc(void *ptr, size_t size)
{
return _shrealloc(ptr, size);
}
static inline void* _shrealloc(void *ptr, size_t size)
{
int rc;
void* pBuff = NULL;

Просмотреть файл

@ -32,8 +32,8 @@ static bool __group_cache_enabled = true;
* object of every PE in the active set. The active set of PEs is defined by the triple PE_start,
* logPE_stride and PE_size.
*/
#define SHMEM_TYPE_REDUCE_OP(name, type_name, type) \
void shmem##type_name##_##name##_to_all( type *target, \
#define SHMEM_TYPE_REDUCE_OP(name, type_name, type, ...) \
void shmem##__VA_ARGS__##type_name##_##name##_to_all( type *target, \
type *source, \
int nreduce, \
int PE_start, \
@ -101,25 +101,25 @@ static bool __group_cache_enabled = true;
#pragma weak shmem_int_and_to_all = pshmem_int_and_to_all
#pragma weak shmem_long_and_to_all = pshmem_long_and_to_all
#pragma weak shmem_longlong_and_to_all = pshmem_longlong_and_to_all
#pragma weak shmem_int16_and_to_all = pshmem_int16_and_to_all
#pragma weak shmem_int32_and_to_all = pshmem_int32_and_to_all
#pragma weak shmem_int64_and_to_all = pshmem_int64_and_to_all
#pragma weak shmemx_int16_and_to_all = pshmemx_int16_and_to_all
#pragma weak shmemx_int32_and_to_all = pshmemx_int32_and_to_all
#pragma weak shmemx_int64_and_to_all = pshmemx_int64_and_to_all
#pragma weak shmem_short_or_to_all = pshmem_short_or_to_all
#pragma weak shmem_int_or_to_all = pshmem_int_or_to_all
#pragma weak shmem_long_or_to_all = pshmem_long_or_to_all
#pragma weak shmem_longlong_or_to_all = pshmem_longlong_or_to_all
#pragma weak shmem_int16_or_to_all = pshmem_int16_or_to_all
#pragma weak shmem_int32_or_to_all = pshmem_int32_or_to_all
#pragma weak shmem_int64_or_to_all = pshmem_int64_or_to_all
#pragma weak shmemx_int16_or_to_all = pshmemx_int16_or_to_all
#pragma weak shmemx_int32_or_to_all = pshmemx_int32_or_to_all
#pragma weak shmemx_int64_or_to_all = pshmemx_int64_or_to_all
#pragma weak shmem_short_xor_to_all = pshmem_short_xor_to_all
#pragma weak shmem_int_xor_to_all = pshmem_int_xor_to_all
#pragma weak shmem_long_xor_to_all = pshmem_long_xor_to_all
#pragma weak shmem_longlong_xor_to_all = pshmem_longlong_xor_to_all
#pragma weak shmem_int16_xor_to_all = pshmem_int16_xor_to_all
#pragma weak shmem_int32_xor_to_all = pshmem_int32_xor_to_all
#pragma weak shmem_int64_xor_to_all = pshmem_int64_xor_to_all
#pragma weak shmemx_int16_xor_to_all = pshmemx_int16_xor_to_all
#pragma weak shmemx_int32_xor_to_all = pshmemx_int32_xor_to_all
#pragma weak shmemx_int64_xor_to_all = pshmemx_int64_xor_to_all
#pragma weak shmem_short_max_to_all = pshmem_short_max_to_all
#pragma weak shmem_int_max_to_all = pshmem_int_max_to_all
@ -128,9 +128,9 @@ static bool __group_cache_enabled = true;
#pragma weak shmem_float_max_to_all = pshmem_float_max_to_all
#pragma weak shmem_double_max_to_all = pshmem_double_max_to_all
#pragma weak shmem_longdouble_max_to_all= pshmem_longdouble_max_to_all
#pragma weak shmem_int16_max_to_all = pshmem_int16_max_to_all
#pragma weak shmem_int32_max_to_all = pshmem_int32_max_to_all
#pragma weak shmem_int64_max_to_all = pshmem_int64_max_to_all
#pragma weak shmemx_int16_max_to_all = pshmemx_int16_max_to_all
#pragma weak shmemx_int32_max_to_all = pshmemx_int32_max_to_all
#pragma weak shmemx_int64_max_to_all = pshmemx_int64_max_to_all
#pragma weak shmem_short_min_to_all = pshmem_short_min_to_all
#pragma weak shmem_int_min_to_all = pshmem_int_min_to_all
@ -139,9 +139,9 @@ static bool __group_cache_enabled = true;
#pragma weak shmem_float_min_to_all = pshmem_float_min_to_all
#pragma weak shmem_double_min_to_all = pshmem_double_min_to_all
#pragma weak shmem_longdouble_min_to_all= pshmem_longdouble_min_to_all
#pragma weak shmem_int16_min_to_all = pshmem_int16_min_to_all
#pragma weak shmem_int32_min_to_all = pshmem_int32_min_to_all
#pragma weak shmem_int64_min_to_all = pshmem_int64_min_to_all
#pragma weak shmemx_int16_min_to_all = pshmemx_int16_min_to_all
#pragma weak shmemx_int32_min_to_all = pshmemx_int32_min_to_all
#pragma weak shmemx_int64_min_to_all = pshmemx_int64_min_to_all
#pragma weak shmem_short_sum_to_all = pshmem_short_sum_to_all
#pragma weak shmem_int_sum_to_all = pshmem_int_sum_to_all
@ -152,9 +152,9 @@ static bool __group_cache_enabled = true;
#pragma weak shmem_longdouble_sum_to_all= pshmem_longdouble_sum_to_all
#pragma weak shmem_complexf_sum_to_all = pshmem_complexf_sum_to_all
#pragma weak shmem_complexd_sum_to_all = pshmem_complexd_sum_to_all
#pragma weak shmem_int16_sum_to_all = pshmem_int16_sum_to_all
#pragma weak shmem_int32_sum_to_all = pshmem_int32_sum_to_all
#pragma weak shmem_int64_sum_to_all = pshmem_int64_sum_to_all
#pragma weak shmemx_int16_sum_to_all = pshmemx_int16_sum_to_all
#pragma weak shmemx_int32_sum_to_all = pshmemx_int32_sum_to_all
#pragma weak shmemx_int64_sum_to_all = pshmemx_int64_sum_to_all
#pragma weak shmem_short_prod_to_all = pshmem_short_prod_to_all
#pragma weak shmem_int_prod_to_all = pshmem_int_prod_to_all
@ -165,9 +165,9 @@ static bool __group_cache_enabled = true;
#pragma weak shmem_longdouble_prod_to_all = pshmem_longdouble_prod_to_all
#pragma weak shmem_complexf_prod_to_all = pshmem_complexf_prod_to_all
#pragma weak shmem_complexd_prod_to_all = pshmem_complexd_prod_to_all
#pragma weak shmem_int16_prod_to_all = pshmem_int16_prod_to_all
#pragma weak shmem_int32_prod_to_all = pshmem_int32_prod_to_all
#pragma weak shmem_int64_prod_to_all = pshmem_int64_prod_to_all
#pragma weak shmemx_int16_prod_to_all = pshmemx_int16_prod_to_all
#pragma weak shmemx_int32_prod_to_all = pshmemx_int32_prod_to_all
#pragma weak shmemx_int64_prod_to_all = pshmemx_int64_prod_to_all
#include "oshmem/shmem/c/profile/defines.h"
#endif /* OSHMEM_PROFILING */
@ -175,25 +175,25 @@ SHMEM_TYPE_REDUCE_OP(and, _short, short)
SHMEM_TYPE_REDUCE_OP(and, _int, int)
SHMEM_TYPE_REDUCE_OP(and, _long, long)
SHMEM_TYPE_REDUCE_OP(and, _longlong, long long)
SHMEM_TYPE_REDUCE_OP(and, _int16, int16_t)
SHMEM_TYPE_REDUCE_OP(and, _int32, int32_t)
SHMEM_TYPE_REDUCE_OP(and, _int64, int64_t)
SHMEM_TYPE_REDUCE_OP(and, _int16, int16_t, x)
SHMEM_TYPE_REDUCE_OP(and, _int32, int32_t, x)
SHMEM_TYPE_REDUCE_OP(and, _int64, int64_t, x)
SHMEM_TYPE_REDUCE_OP(or, _short, short)
SHMEM_TYPE_REDUCE_OP(or, _int, int)
SHMEM_TYPE_REDUCE_OP(or, _long, long)
SHMEM_TYPE_REDUCE_OP(or, _longlong, long long)
SHMEM_TYPE_REDUCE_OP(or, _int16, int16_t)
SHMEM_TYPE_REDUCE_OP(or, _int32, int32_t)
SHMEM_TYPE_REDUCE_OP(or, _int64, int64_t)
SHMEM_TYPE_REDUCE_OP(or, _int16, int16_t, x)
SHMEM_TYPE_REDUCE_OP(or, _int32, int32_t, x)
SHMEM_TYPE_REDUCE_OP(or, _int64, int64_t, x)
SHMEM_TYPE_REDUCE_OP(xor, _short, short)
SHMEM_TYPE_REDUCE_OP(xor, _int, int)
SHMEM_TYPE_REDUCE_OP(xor, _long, long)
SHMEM_TYPE_REDUCE_OP(xor, _longlong, long long)
SHMEM_TYPE_REDUCE_OP(xor, _int16, int16_t)
SHMEM_TYPE_REDUCE_OP(xor, _int32, int32_t)
SHMEM_TYPE_REDUCE_OP(xor, _int64, int64_t)
SHMEM_TYPE_REDUCE_OP(xor, _int16, int16_t, x)
SHMEM_TYPE_REDUCE_OP(xor, _int32, int32_t, x)
SHMEM_TYPE_REDUCE_OP(xor, _int64, int64_t, x)
SHMEM_TYPE_REDUCE_OP(max, _short, short)
SHMEM_TYPE_REDUCE_OP(max, _int, int)
@ -202,9 +202,9 @@ SHMEM_TYPE_REDUCE_OP(max, _longlong, long long)
SHMEM_TYPE_REDUCE_OP(max, _float, float)
SHMEM_TYPE_REDUCE_OP(max, _double, double)
SHMEM_TYPE_REDUCE_OP(max, _longdouble, long double)
SHMEM_TYPE_REDUCE_OP(max, _int16, int16_t)
SHMEM_TYPE_REDUCE_OP(max, _int32, int32_t)
SHMEM_TYPE_REDUCE_OP(max, _int64, int64_t)
SHMEM_TYPE_REDUCE_OP(max, _int16, int16_t, x)
SHMEM_TYPE_REDUCE_OP(max, _int32, int32_t, x)
SHMEM_TYPE_REDUCE_OP(max, _int64, int64_t, x)
SHMEM_TYPE_REDUCE_OP(min, _short, short)
SHMEM_TYPE_REDUCE_OP(min, _int, int)
@ -213,9 +213,9 @@ SHMEM_TYPE_REDUCE_OP(min, _longlong, long long)
SHMEM_TYPE_REDUCE_OP(min, _float, float)
SHMEM_TYPE_REDUCE_OP(min, _double, double)
SHMEM_TYPE_REDUCE_OP(min, _longdouble, long double)
SHMEM_TYPE_REDUCE_OP(min, _int16, int16_t)
SHMEM_TYPE_REDUCE_OP(min, _int32, int32_t)
SHMEM_TYPE_REDUCE_OP(min, _int64, int64_t)
SHMEM_TYPE_REDUCE_OP(min, _int16, int16_t, x)
SHMEM_TYPE_REDUCE_OP(min, _int32, int32_t, x)
SHMEM_TYPE_REDUCE_OP(min, _int64, int64_t, x)
SHMEM_TYPE_REDUCE_OP(sum, _short, short)
SHMEM_TYPE_REDUCE_OP(sum, _int, int)
@ -226,9 +226,9 @@ SHMEM_TYPE_REDUCE_OP(sum, _double, double)
SHMEM_TYPE_REDUCE_OP(sum, _longdouble, long double)
SHMEM_TYPE_REDUCE_OP(sum, _complexf, float complex)
SHMEM_TYPE_REDUCE_OP(sum, _complexd, double complex)
SHMEM_TYPE_REDUCE_OP(sum, _int16, int16_t)
SHMEM_TYPE_REDUCE_OP(sum, _int32, int32_t)
SHMEM_TYPE_REDUCE_OP(sum, _int64, int64_t)
SHMEM_TYPE_REDUCE_OP(sum, _int16, int16_t, x)
SHMEM_TYPE_REDUCE_OP(sum, _int32, int32_t, x)
SHMEM_TYPE_REDUCE_OP(sum, _int64, int64_t, x)
SHMEM_TYPE_REDUCE_OP(prod, _short, short)
SHMEM_TYPE_REDUCE_OP(prod, _int, int)
@ -239,6 +239,6 @@ SHMEM_TYPE_REDUCE_OP(prod, _double, double)
SHMEM_TYPE_REDUCE_OP(prod, _longdouble, long double)
SHMEM_TYPE_REDUCE_OP(prod, _complexf, float complex)
SHMEM_TYPE_REDUCE_OP(prod, _complexd, double complex)
SHMEM_TYPE_REDUCE_OP(prod, _int16, int16_t)
SHMEM_TYPE_REDUCE_OP(prod, _int32, int32_t)
SHMEM_TYPE_REDUCE_OP(prod, _int64, int64_t)
SHMEM_TYPE_REDUCE_OP(prod, _int16, int16_t, x)
SHMEM_TYPE_REDUCE_OP(prod, _int32, int32_t, x)
SHMEM_TYPE_REDUCE_OP(prod, _int64, int64_t, x)

Просмотреть файл

@ -22,8 +22,8 @@
* contents of target. The operation must be completed without the possibility of another
* process updating target between the time of the fetch and the update.
*/
#define SHMEM_TYPE_SWAP(type_name, type) \
type shmem##type_name##_swap(type *target, type value, int pe) \
#define SHMEM_TYPE_SWAP(type_name, type, ...) \
type shmem##__VA_ARGS__##type_name##_swap(type *target, type value, int pe) \
{ \
int rc = OSHMEM_SUCCESS; \
size_t size = 0; \
@ -54,8 +54,8 @@
#pragma weak shmem_longlong_swap = pshmem_longlong_swap
#pragma weak shmem_float_swap = pshmem_float_swap
#pragma weak shmem_double_swap = pshmem_double_swap
#pragma weak shmem_int32_swap = pshmem_int32_swap
#pragma weak shmem_int64_swap = pshmem_int64_swap
#pragma weak shmemx_int32_swap = pshmemx_int32_swap
#pragma weak shmemx_int64_swap = pshmemx_int64_swap
#include "oshmem/shmem/c/profile/defines.h"
#endif
@ -65,5 +65,5 @@ SHMEM_TYPE_SWAP(_long, long)
SHMEM_TYPE_SWAP(_longlong, long long)
SHMEM_TYPE_SWAP(_float, float)
SHMEM_TYPE_SWAP(_double, double)
SHMEM_TYPE_SWAP(_int32, int32_t)
SHMEM_TYPE_SWAP(_int64, int64_t)
SHMEM_TYPE_SWAP(_int32, int32_t, x)
SHMEM_TYPE_SWAP(_int64, int64_t, x)

Просмотреть файл

@ -21,8 +21,8 @@
* A call to any shmem_wait() routine does not return until some other processor makes the
* value at address var not equal to value.
*/
#define SHMEM_TYPE_WAIT(type_name, type, code) \
void shmem##type_name##_wait(type *addr, type value) \
#define SHMEM_TYPE_WAIT(type_name, type, code, ...) \
void shmem##__VA_ARGS__##type_name##_wait(type *addr, type value) \
{ \
int rc = OSHMEM_SUCCESS; \
\
@ -45,15 +45,15 @@
#pragma weak shmem_int_wait = pshmem_int_wait
#pragma weak shmem_long_wait = pshmem_long_wait
#pragma weak shmem_longlong_wait = pshmem_longlong_wait
#pragma weak shmem_int32_wait = pshmem_int32_wait
#pragma weak shmem_int64_wait = pshmem_int64_wait
#pragma weak shmemx_int32_wait = pshmemx_int32_wait
#pragma weak shmemx_int64_wait = pshmemx_int64_wait
#pragma weak shmem_wait_until = pshmem_wait_until
#pragma weak shmem_short_wait_until = pshmem_short_wait_until
#pragma weak shmem_int_wait_until = pshmem_int_wait_until
#pragma weak shmem_long_wait_until = pshmem_long_wait_until
#pragma weak shmem_longlong_wait_until = pshmem_longlong_wait_until
#pragma weak shmem_int32_wait_until = pshmem_int32_wait_until
#pragma weak shmem_int64_wait_until = pshmem_int64_wait_until
#pragma weak shmemx_int32_wait_until = pshmemx_int32_wait_until
#pragma weak shmemx_int64_wait_until = pshmemx_int64_wait_until
#include "oshmem/shmem/c/profile/defines.h"
#endif
@ -62,11 +62,11 @@ SHMEM_TYPE_WAIT(_short, short, SHMEM_SHORT)
SHMEM_TYPE_WAIT(_int, int, SHMEM_INT)
SHMEM_TYPE_WAIT(_long, long, SHMEM_LONG)
SHMEM_TYPE_WAIT(_longlong, long long, SHMEM_LLONG)
SHMEM_TYPE_WAIT(_int32, int32_t, SHMEM_INT32_T)
SHMEM_TYPE_WAIT(_int64, int64_t, SHMEM_INT64_T)
SHMEM_TYPE_WAIT(_int32, int32_t, SHMEM_INT32_T, x)
SHMEM_TYPE_WAIT(_int64, int64_t, SHMEM_INT64_T, x)
#define SHMEM_TYPE_WAIT_UNTIL(type_name, type, code) \
void shmem##type_name##_wait_until(type *addr, int cmp, type value) \
#define SHMEM_TYPE_WAIT_UNTIL(type_name, type, code, ...) \
void shmem##__VA_ARGS__##type_name##_wait_until(type *addr, int cmp, type value) \
{ \
int rc = OSHMEM_SUCCESS; \
\
@ -87,5 +87,5 @@ SHMEM_TYPE_WAIT_UNTIL(_short, short, SHMEM_SHORT)
SHMEM_TYPE_WAIT_UNTIL(_int, int, SHMEM_INT)
SHMEM_TYPE_WAIT_UNTIL(_long, long, SHMEM_LONG)
SHMEM_TYPE_WAIT_UNTIL(_longlong, long long, SHMEM_LLONG)
SHMEM_TYPE_WAIT_UNTIL(_int32, int32_t, SHMEM_INT32_T)
SHMEM_TYPE_WAIT_UNTIL(_int64, int64_t, SHMEM_INT64_T)
SHMEM_TYPE_WAIT_UNTIL(_int32, int32_t, SHMEM_INT32_T, x)
SHMEM_TYPE_WAIT_UNTIL(_int64, int64_t, SHMEM_INT64_T, x)

Просмотреть файл

@ -35,9 +35,10 @@ liboshmem_fortran_la_SOURCES = shmem_finalize_f.c
if ! OSHMEM_PROFILING
liboshmem_fortran_la_SOURCES += \
start_pes_f.c \
num_pes_f.c \
my_pe_f.c \
shmem_init_f.c \
shmem_global_exit_f.c \
shmem_n_pes_f.c \
shmem_my_pe_f.c \
shmem_barrier_all_f.c \
shpalloc_f.c \
shpdeallc_f.c \
@ -124,7 +125,8 @@ liboshmem_fortran_la_SOURCES += \
shmem_int4_inc_f.c \
shmem_int8_inc_f.c \
shmem_quiet_f.c \
shmem_fence_f.c
shmem_fence_f.c \
shmem_info_f.c
AM_CPPFLAGS = -DOSHMEM_PROFILING=0
endif

Просмотреть файл

@ -27,9 +27,10 @@ headers = prototypes_pshmem.h \
defines.h
nodist_liboshmem_fortran_pshmem_la_SOURCES = \
pstart_pes_f.c \
pnum_pes_f.c \
pmy_pe_f.c \
pshmem_init_f.c \
pshmem_global_exit_f.c \
pshmem_n_pes_f.c \
pshmem_my_pe_f.c \
pshmem_barrier_all_f.c \
pshpalloc_f.c \
pshpdeallc_f.c \
@ -116,7 +117,8 @@ nodist_liboshmem_fortran_pshmem_la_SOURCES = \
pshmem_int4_inc_f.c \
pshmem_int8_inc_f.c \
pshmem_quiet_f.c \
pshmem_fence_f.c
pshmem_fence_f.c \
pshmem_info_f.c
#
# Sym link in the sources from the real OSHMEM directory

Просмотреть файл

@ -17,11 +17,31 @@
* pshmem_* symbols
*/
#define SHMEM_INIT PSHMEM_INIT
#define shmem_init_ pshmem_init_
#define shmem_init__ pshmem_init__
#define START_PES PSTART_PES
#define start_pes_ pstart_pes_
#define start_pes__ pstart_pes__
#define SHMEM_GLOBAL_EXIT PSHMEM_GLOBAL_EXIT
#define shmem_global_exit_ pshmem_global_exit_
#define shmem_global_exit__ pshmem_global_exit__
#define SHMEM_MY_PE PSHMEM_MY_PE
#define shmem_my_pe_ pshmem_my_pe_
#define shmem_my_pe__ pshmem_my_pe__
#define MY_PE PMY_PE
#define my_pe_ pmy_pe_
#define my_pe__ pmy_pe__
#define _my_pe_ p_my_pe_
#define SHMEM_N_PES PSHMEM_N_PES
#define shmem_n_pes_ pshmem_n_pes_
#define shmem_n_pes__ pshmem_n_pes__
#define NUM_PES PNUM_PES
#define num_pes_ pnum_pes_
#define num_pes__ pnum_pes__
@ -570,8 +590,4 @@
#define shpdeallc_ pshpdeallc_
#define shpdeallc__ pshpdeallc__
#define START_PES PSTART_PES
#define start_pes_ pstart_pes_
#define start_pes__ pstart_pes__
#endif /* OSHMEM_FORTRAN_PROFILE_DEFINES_H */

Просмотреть файл

@ -21,8 +21,12 @@ BEGIN_C_DECLS
OSHMEM_DECLSPEC ret lower_name##__ args; \
OSHMEM_DECLSPEC ret upper_name args
PN (void, pshmem_init, PSHMEM_INIT, (void));
PN (void, pstart_pes, PSTART_PES, (MPI_Fint npes));
PN (void, pshmem_global_exit, PSHMEM_GLOBAL_EXIT, (MPI_Fint npes));
PN (MPI_Fint, pshmem_n_pes, PSHMEM_N_PES, (void));
PN (MPI_Fint, pnum_pes, PNUM_PES, (void));
PN (MPI_Fint, pshmem_my_pe, PSHMEM_MY_PE, (void));
PN (MPI_Fint, pmy_pe, PMY_PE, (void));
OSHMEM_DECLSPEC MPI_Fint p_my_pe_(void);
PN (void, pshmem_barrier_all, PSHMEM_BARRIER_ALL, (void));

Просмотреть файл

@ -21,10 +21,16 @@ BEGIN_C_DECLS
OSHMEM_DECLSPEC ret lower_name##__ args; \
OSHMEM_DECLSPEC ret upper_name args
PN (void, shmem_init, SHMEM_INIT, (void));
PN (void, start_pes, START_PES, (MPI_Fint npes));
PN (void, shmem_global_exit, SHMEM_GLOBAL_EXIT, (MPI_Fint npes));
PN (MPI_Fint, shmem_n_pes, SHMEM_N_PES, (void));
PN (MPI_Fint, num_pes, NUM_PES, (void));
PN (MPI_Fint, shmem_my_pe, SHMEM_MY_PE, (void));
PN (MPI_Fint, my_pe, MY_PE, (void));
OSHMEM_DECLSPEC MPI_Fint _my_pe_(void);
PN (void, shmem_info_get_version, SHMEM_INFO_GET_VERSION, (MPI_Fint *major, MPI_Fint *minor));
PN (void, shmem_info_get_name, SHMEM_INFO_GET_NAME, (char *name));
PN (void, shmem_finalize, SHMEM_FINALIZE, (void));
PN (void, shmem_barrier_all, SHMEM_BARRIER_ALL, (void));
PN (void, shpalloc, SHPALLOC, (FORTRAN_POINTER_T *addr, MPI_Fint *length, MPI_Fint *errcode, MPI_Fint *abort));

33
oshmem/shmem/fortran/shmem_global_exit_f.c Обычный файл
Просмотреть файл

@ -0,0 +1,33 @@
/*
* Copyright (c) 2013 Mellanox Technologies, Inc.
* All rights reserved.
* Copyright (c) 2013 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "oshmem_config.h"
#include "oshmem/shmem/fortran/bindings.h"
#include "oshmem/include/shmem.h"
#if OSHMEM_PROFILING
#include "oshmem/shmem/fortran/profile/pbindings.h"
SHMEM_GENERATE_WEAK_BINDINGS(SHMEM_GLOBAL_EXIT, shmem_global_exit)
#include "oshmem/shmem/fortran/profile/defines.h"
#endif
SHMEM_GENERATE_FORTRAN_BINDINGS_SUB (void,
SHMEM_GLOBAL_EXIT,
shmem_global_exit_,
shmem_global_exit__,
shmem_global_exit_f,
(MPI_Fint status),
(status) )
void shmem_global_exit_f(MPI_Fint status)
{
shmem_global_exit(status);
}

52
oshmem/shmem/fortran/shmem_info_f.c Обычный файл
Просмотреть файл

@ -0,0 +1,52 @@
/*
* Copyright (c) 2013 Mellanox Technologies, Inc.
* All rights reserved.
* Copyright (c) 2013 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "oshmem_config.h"
#include <string.h>
#include "ompi/mpi/fortran/base/strings.h"
#include "oshmem/shmem/fortran/bindings.h"
#include "oshmem/include/shmem.h"
SHMEM_GENERATE_FORTRAN_BINDINGS_SUB (void,
SHMEM_INFO_GET_VERSION,
shmem_info_get_version_,
shmem_info_get_version__,
shmem_info_get_version_f,
(MPI_Fint *major, MPI_Fint *minor),
(major,minor) )
void shmem_info_get_version_f(MPI_Fint *major, MPI_Fint *minor)
{
int c_major, c_minor;
shmem_info_get_version(&c_major, &c_minor);
*major = OMPI_INT_2_FINT(c_major);
*minor = OMPI_INT_2_FINT(c_minor);
}
SHMEM_GENERATE_FORTRAN_BINDINGS_SUB (void,
SHMEM_INFO_GET_NAME,
shmem_info_get_name_,
shmem_info_get_name__,
shmem_info_get_name_f,
(char *name),
(name) )
void shmem_info_get_name_f(char *name)
{
char c_name[SHMEM_MAX_NAME_LEN];
shmem_info_get_name(c_name);
ompi_fortran_string_c2f(c_name, name, strlen(c_name) + 1);
}

Просмотреть файл

@ -15,10 +15,24 @@
#if OSHMEM_PROFILING
#include "oshmem/shmem/fortran/profile/pbindings.h"
SHMEM_GENERATE_WEAK_BINDINGS(SHMEM_INIT, shmem_init)
SHMEM_GENERATE_WEAK_BINDINGS(START_PES, start_pes)
#include "oshmem/shmem/fortran/profile/defines.h"
#endif
SHMEM_GENERATE_FORTRAN_BINDINGS_SUB (void,
SHMEM_INIT,
shmem_init_,
shmem_init__,
shmem_init_f,
(void),
() )
void shmem_init_f(void)
{
shmem_init();
}
SHMEM_GENERATE_FORTRAN_BINDINGS_SUB (void,
START_PES,
start_pes_,
@ -31,4 +45,3 @@ void start_pes_f(MPI_Fint npes)
{
shmem_init();
}

Просмотреть файл

@ -15,11 +15,27 @@
#if OSHMEM_PROFILING
#include "oshmem/shmem/fortran/profile/pbindings.h"
SHMEM_GENERATE_WEAK_BINDINGS(SHMEM_MY_PE, shmem_my_pe)
SHMEM_GENERATE_WEAK_BINDINGS(MY_PE, my_pe)
#pragma weak _my_pe_ = p_my_pe_
#include "oshmem/shmem/fortran/profile/defines.h"
#endif
SHMEM_GENERATE_FORTRAN_BINDINGS_FUNCTION (MPI_Fint,
SHMEM_MY_PE,
shmem_my_pe_,
shmem_my_pe__,
shmem_my_pe_f,
(void),
() )
MPI_Fint shmem_my_pe_f(void)
{
MPI_Fint rc;
rc = OMPI_INT_2_FINT(shmem_my_pe());
return rc;
}
SHMEM_GENERATE_FORTRAN_BINDINGS_FUNCTION (MPI_Fint,
MY_PE,
my_pe_,
@ -28,11 +44,6 @@ SHMEM_GENERATE_FORTRAN_BINDINGS_FUNCTION (MPI_Fint,
(void),
() )
MPI_Fint _my_pe_(void)
{
return my_pe_f();
}
MPI_Fint my_pe_f(void)
{
MPI_Fint rc;
@ -40,3 +51,7 @@ MPI_Fint my_pe_f(void)
return rc;
}
MPI_Fint _my_pe_(void)
{
return my_pe_f();
}

Просмотреть файл

@ -15,10 +15,26 @@
#if OSHMEM_PROFILING
#include "oshmem/shmem/fortran/profile/pbindings.h"
SHMEM_GENERATE_WEAK_BINDINGS(SHMEM_N_PES, shmem_n_pes)
SHMEM_GENERATE_WEAK_BINDINGS(NUM_PES, num_pes)
#include "oshmem/shmem/fortran/profile/defines.h"
#endif
SHMEM_GENERATE_FORTRAN_BINDINGS_FUNCTION (MPI_Fint,
SHMEM_N_PES,
shmem_n_pes_,
shmem_n_pes__,
shmem_n_pes_f,
(void),
() )
MPI_Fint shmem_n_pes_f(void)
{
MPI_Fint rc;
rc = OMPI_INT_2_FINT(shmem_n_pes());
return rc;
}
SHMEM_GENERATE_FORTRAN_BINDINGS_FUNCTION (MPI_Fint,
NUM_PES,
num_pes_,
@ -33,4 +49,3 @@ MPI_Fint num_pes_f(void)
rc = OMPI_INT_2_FINT(num_pes());
return rc;
}

Просмотреть файл

@ -644,12 +644,6 @@ JNIEXPORT jboolean JNICALL Java_shmem_Addr_testLock(
abort();
}
JNIEXPORT void JNICALL Java_shmem_Addr_waitShort(
JNIEnv *env, jobject jthis, jlong addr, jshort value)
{
shmem_int16_wait((void*)addr, value);
}
JNIEXPORT void JNICALL Java_shmem_Addr_waitInt(
JNIEnv *env, jobject jthis, jlong addr, jint value)
{
@ -662,12 +656,6 @@ JNIEXPORT void JNICALL Java_shmem_Addr_waitLong(
shmem_int64_wait((void*)addr, value);
}
JNIEXPORT void JNICALL Java_shmem_Addr_waitUntilShort(
JNIEnv *env, jobject jthis, jlong addr, jint cmp, jshort value)
{
shmem_int16_wait_until((void*)addr, cmp, value);
}
JNIEXPORT void JNICALL Java_shmem_Addr_waitUntilInt(
JNIEnv *env, jobject jthis, jlong addr, jint cmp, jint value)
{

Просмотреть файл

@ -9,18 +9,28 @@
include $(top_srcdir)/Makefile.ompi-rules
shmem_api_man_pages = \
shmem/man/man3/intro_shmem.3 \
shmem/man/man3/OpenSHMEM.3 \
shmem_legacy_api_man_pages = \
shmem/man/man3/start_pes.3 \
shmem/man/man3/_num_pes.3 \
shmem/man/man3/_my_pe.3 \
shmem/man/man3/shmem_pe_accessible.3 \
shmem/man/man3/shmem_addr_accessible.3 \
shmem/man/man3/shmalloc.3 \
shmem/man/man3/shmemalign.3 \
shmem/man/man3/shrealloc.3 \
shmem/man/man3/shfree.3 \
shmem/man/man3/shfree.3
shmem_api_man_pages = \
shmem/man/man3/intro_shmem.3 \
shmem/man/man3/OpenSHMEM.3 \
shmem/man/man3/shmem_init.3 \
shmem/man/man3/shmem_finalize.3 \
shmem/man/man3/shmem_n_pes.3 \
shmem/man/man3/shmem_my_pe.3 \
shmem/man/man3/shmem_pe_accessible.3 \
shmem/man/man3/shmem_addr_accessible.3 \
shmem/man/man3/shmem_malloc.3 \
shmem/man/man3/shmem_align.3 \
shmem/man/man3/shmem_realloc.3 \
shmem/man/man3/shmem_free.3 \
shmem/man/man3/shmem_ptr.3 \
shmem/man/man3/shmem_char_p.3 \
shmem/man/man3/shmem_short_p.3 \
@ -174,10 +184,15 @@ shmem_api_man_pages = \
shmem/man/man3/shmem_set_cache_inv.3 \
shmem/man/man3/shmem_set_cache_line_inv.3 \
shmem/man/man3/shmem_clear_cache_inv.3 \
shmem/man/man3/shmem_clear_cache_line_inv.3
shmem/man/man3/shmem_clear_cache_line_inv.3 \
shmem/man/man3/shmem_info_get_name.3 \
shmem/man/man3/shmem_info_get_version.3 \
shmem/man/man3/shmem_global_exit.3
if PROJECT_OSHMEM
nodist_man_MANS += $(shmem_api_man_pages)
nodist_man_MANS += $(shmem_legacy_api_man_pages)
endif # PROJECT_OSHMEM
EXTRA_DIST += $(shmem_api_man_pages:.3=.3in)
EXTRA_DIST += $(shmem_legacy_api_man_pages:.3=.3in)

Просмотреть файл

@ -1,41 +1 @@
.\" -*- nroff -*-
.\" Copyright (c) 2015 University of Houston. All rights reserved.
.\" Copyright (c) 2015 Mellanox Technologies, Inc.
.\" $COPYRIGHT$
.de Vb
.ft CW
.nf
..
.de Ve
.ft R
.fi
..
.TH "MY\\_PE" "3" "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#"
.SH NAME
my_pe, _my_pe, shmem_my_pe \- Returns the virtual PE number of the calling PE.
.SH SYNOPSIS
C or C++:
.Vb
#include <mpp/shmem.h>
int _my_pe (void);
int shmem_my_pe (void);
.Ve
Fortran:
.Vb
include 'mpp/shmem.fh'
I = MY_PE ()
I = SHMEM_MY_PE ()
.Ve
.SH DESCRIPTION
my_pe() or shmem_my_pe() return the processing element (PE) number of the calling PE. It accepts no
arguments. The result is an integer between 0 and npes \- 1, where npes is the total
number of PEs executing the current program.
.SH SEE ALSO
\fIintro_shmem\fP(3),
\fInum_pes\fP(3),
\fIstart_pes\fP(3)
.so man3/shmem_my_pe.3

Просмотреть файл

@ -1,39 +1 @@
.\" -*- nroff -*-
.\" Copyright (c) 2015 University of Houston. All rights reserved.
.\" Copyright (c) 2015 Mellanox Technologies, Inc.
.\" $COPYRIGHT$
.de Vb
.ft CW
.nf
..
.de Ve
.ft R
.fi
..
.TH "NUM\\_PES" "3" "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#"
.SH NAME
num_pes, _num_pes, shmem_n_pes \- Returns the number of processing elements (PEs) used to run the application.
.SH SYNOPSIS
C or C++:
.Vb
#include <mpp/shmem.h>
int _num_pes (void);
int shmem_n_pes (void);
.Ve
Fortran:
.Vb
include 'mpp/shmem.fh'
I = NUM_PES ()
I = SHMEM_N_PES ()
.Ve
.SH DESCRIPTION
num_pes() or shmem_n_pes() return the total number of PEs running in an application.
.SH SEE ALSO
\fIintro_shmem\fP(3),
\fImy_pe\fP(3),
\fIstart_pes\fP(3)
.so man3/shmem_n_pes.3

Просмотреть файл

@ -1259,14 +1259,14 @@ main() {
long source[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
static long target[10];
start_pes(0);
if (_my_pe() == 0) {
shmem_init();
if (shmem_my_pe() == 0) {
/* put 10 elements into target on PE 1 */
shmem_long_put(target, source, 10, 1);
}
shmem_barrier_all(); /* sync sender and receiver */
if (_my_pe() == 1)
printf("target[0] on PE %d is %d\\n", _my_pe(), target[0]);
if (shmem_my_pe() == 1)
printf("target[0] on PE %d is %d\\n", shmem_my_pe(), target[0]);
}
.Ve
.SH SEE ALSO
@ -1305,8 +1305,7 @@ specific man pages for implementation information.
\fIshmem_xor\fP(3),
\fIshmem_pe_accessible\fP(3),
\fIshmem_addr_accessible\fP(3),
\fIstart_pes\fP(3),
\fIshmalloc\fP(3C),
\fIshpalloc\fP(3F),
\fIMY_PE\fP(3I),
\fINUM_PES\fP(3I)
\fIshmem_init\fP(3),
\fIshmem_malloc\fP(3C),
\fIshmem_my_pe\fP(3I),
\fIshmem_n_pes\fP(3I)

Просмотреть файл

@ -1 +1 @@
.so man3/shmalloc.3
.so man3/shmem_malloc.3

1
oshmem/shmem/man/man3/shmem_align.3in Обычный файл
Просмотреть файл

@ -0,0 +1 @@
.so man3/shmem_malloc.3

Просмотреть файл

@ -44,7 +44,7 @@ functions such as \fIshmem_put32\fP(3)\&.
.Vb
setup_data()
{
if (_my_pe() == 0) {
if (shmem_my_pe() == 0) {
setup();
}
@ -56,4 +56,4 @@ setup_data()
.SH SEE ALSO
\fIshmem_barrier\fP(3),
\fIstart_pes\fP(3)
\fIshmem_init\fP(3)

Просмотреть файл

@ -195,16 +195,16 @@ main()
{
long source[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
static long target[10];
start_pes(2);
shmem_init();
if (_my_pe() == 0) {
if (shmem_my_pe() == 0) {
/* put 10 words into target on PE 1 */
shmem_long_put(target, source, 10, 1);
}
shmem_barrier_all(); /* sync sender and receiver */
if (_my_pe() == 1)
if (shmem_my_pe() == 1)
shmem_udcflush(); /* not required on Altix systems */
printf("target[0] on PE %d is %d\\n", _my_pe(), target[0]);
printf("target[0] on PE %d is %d\\n", shmem_my_pe(), target[0]);
}
.Ve
.SH SEE ALSO

47
oshmem/shmem/man/man3/shmem_finalize.3in Обычный файл
Просмотреть файл

@ -0,0 +1,47 @@
.\" -*- nroff -*-
.\" Copyright (c) 2015 University of Houston. All rights reserved.
.\" Copyright (c) 2015 Mellanox Technologies, Inc.
.\" $COPYRIGHT$
.de Vb
.ft CW
.nf
..
.de Ve
.ft R
.fi
..
.TH "SHMEM\\_FINALIZE" "3" "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#"
.SH NAME
shmem_finalize
\- A collective operation that releases resources used by the OpenSHMEM library.
This only terminates the Open-SHMEM portion of a program, not the entire program.
.SH SYNOPSIS
C or C++:
.Vb
#include <mpp/shmem.h>
void shmem_finalize(void);
.Ve
Fortran:
.Vb
include 'mpp/shmem.fh'
CALL SHMEM_FINALIZE
.Ve
.SH DESCRIPTION
shmem_finalize
is a collective operation that ends the OpenSHMEM portion of a program previously initialized
by shmem_init and releases resources used by the OpenSHMEM library. This collective operation requires
all PEs to participate in the call. There is an implicit global barrier in shmem_finalize so that pending
communication is completed, and no resources can be released until all PEs have entered shmem_finalize.
shmem_finalize must be the last OpenSHMEM library call encountered in the OpenSHMEM portion of
a program. A call to shmem_finalize will release any resources initialized by a corresponding call to
shmem_init. All processes and threads that represent the PEs will still exist after the call to shmem_finalize
returns, but they will no longer have access to any resources that have been released.
.SH SEE ALSO
\fIintro_shmem\fP(3),
\fIshmem_my_pe\fP(3),
\fIshmem_init\fP(3)

1
oshmem/shmem/man/man3/shmem_free.3in Обычный файл
Просмотреть файл

@ -0,0 +1 @@
.so man3/shmem_malloc.3

47
oshmem/shmem/man/man3/shmem_global_exit.3in Обычный файл
Просмотреть файл

@ -0,0 +1,47 @@
.\" -*- nroff -*-
.\" Copyright (c) 2015 University of Houston. All rights reserved.
.\" Copyright (c) 2015 Mellanox Technologies, Inc.
.\" $COPYRIGHT$
.de Vb
.ft CW
.nf
..
.de Ve
.ft R
.fi
..
.TH "SHMEM\\_GLOBAL\\_EXIT" "3" "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#"
.SH NAME
shmem_global_exit
\- A routine that allows any PE to force termination of an entire program.
.SH SYNOPSIS
C or C++:
.Vb
#include <mpp/shmem.h>
void shmem_global_exit(int status);
.Ve
Fortran:
.Vb
include 'mpp/shmem.fh'
INTEGER STATUS
CALL SHMEM_GLOBAL_EXIT(status)
.Ve
.SH DESCRIPTION
shmem_global_exit()
shmem_global_exit is a non-collective routine that allows any one PE to force termination of an Open-
SHMEM program for all PEs, passing an exit status to the execution environment. This routine terminates
the entire program, not just the OpenSHMEM portion. When any PE calls shmem_global_exit, it results in
the immediate notification to all PEs to terminate. shmem_global_exit flushes I/O and releases resources
in accordance with C/C++/Fortran language requirements for normal program termination. If more than
one PE calls shmem_global_exit, then the exit status returned to the environment shall be one of the values
passed to shmem_global_exit as the status argument. There is no return to the caller of shmem_global_exit;
control is returned from the OpenSHMEM program to the execution environment for all PEs.
.SH SEE ALSO
\fIintro_shmem\fP(3),
\fIshmem_my_pe\fP(3),
\fIshmem_init\fP(3)

Просмотреть файл

@ -0,0 +1,48 @@
.\" -*- nroff -*-
.\" Copyright (c) 2015 University of Houston. All rights reserved.
.\" Copyright (c) 2015 Mellanox Technologies, Inc.
.\" $COPYRIGHT$
.de Vb
.ft CW
.nf
..
.de Ve
.ft R
.fi
..
.TH "SHMEM\\_INFO\\_GET\\_NAME" "3" "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#"
.SH NAME
shmem_info_get_name
\- This routine returns the vendor defined character string.
.SH SYNOPSIS
C or C++:
.Vb
#include <mpp/shmem.h>
void shmem_info_get_name(char *name);
.Ve
Fortran:
.Vb
include 'mpp/shmem.fh'
SHMEM_INFO_GET_NAME(NAME)
CHARACTER *(*)NAME
.Ve
.SH DESCRIPTION
shmem_info_get_name()
This routine returns the vendor defined character string of size defined by the constant SHMEM_MAX_NAME_LEN.
The program calling this function prepares the memory of size SHMEM_MAX_NAME_LEN, and the implementation
copies the string of size at most SHMEM_MAX_NAME_LEN. In C, the string is terminated
by a null character. In Fortran, the string of size less than SHMEM_MAX_NAME_LEN is padded with
blank characters up to size SHMEM_MAX_NAME_LEN. The implementation copying a string of size
greater than SHMEM_MAX_NAME_LEN results in an undefined behavior. Multiple invocations of the
routine in an OpenSHMEM program always return the same string. For a given library implementation,
the major and minor version returned by these calls is consistent with the compile-time constants defined
in its shmem.h.
.SH SEE ALSO
\fIintro_shmem\fP(3),
\fIshmem_my_pe\fP(3),
\fIshmem_init\fP(3)

Просмотреть файл

@ -0,0 +1,43 @@
.\" -*- nroff -*-
.\" Copyright (c) 2015 University of Houston. All rights reserved.
.\" Copyright (c) 2015 Mellanox Technologies, Inc.
.\" $COPYRIGHT$
.de Vb
.ft CW
.nf
..
.de Ve
.ft R
.fi
..
.TH "SHMEM\\_INFO\\_GET\\_VERSION" "3" "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#"
.SH NAME
shmem_info_get_version
\- Returns the major and minor version of the library implementation.
.SH SYNOPSIS
C or C++:
.Vb
#include <mpp/shmem.h>
void shmem_info_get_version(int *major, int *minor);
.Ve
Fortran:
.Vb
include 'mpp/shmem.fh'
SHMEM_INFO_GET_VERSION(MAJOR, MINOR)
INTEGER MAJOR, MINOR
.Ve
.SH DESCRIPTION
shmem_info_get_version()
This routine returns the major and minor version of the OpenSHMEM standard in use. For a given library
implementation, the major and minor version returned by these calls is consistent with the compile-time
constants, SHMEM_MAJOR_VERSION and SHMEM_MINOR_VERSION, defined in its shmem.h. The
valid major version value is 1, and the valid minor version value is 2.
.SH SEE ALSO
\fIintro_shmem\fP(3),
\fIshmem_my_pe\fP(3),
\fIshmem_init\fP(3)

84
oshmem/shmem/man/man3/shmem_init.3in Обычный файл
Просмотреть файл

@ -0,0 +1,84 @@
.\" -*- nroff -*-
.\" Copyright (c) 2015 University of Houston. All rights reserved.
.\" Copyright (c) 2015 Mellanox Technologies, Inc.
.\" $COPYRIGHT$
.de Vb
.ft CW
.nf
..
.de Ve
.ft R
.fi
..
.TH "SHMEM\\_INIT" "3" "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#"
.SH NAME
shmem_init, start_pes
\- Allocates a block of memory from the symmetric heap.
.SH SYNOPSIS
C or C++:
.Vb
void shmem_init(void);
void start_pes(int npes);
.Ve
Fortran:
.Vb
CALL SHMEM_INIT()
CALL START_PES(npes)
.Ve
.SH DESCRIPTION
The start_pes routine should be the first statement in a SHMEM parallel program.
.PP
The start_pes routine accepts the following argument:
.TP
npes
Unused. Should be set to 0.
.PP
This routine initializes the SHMEM API, therefore it must be called before calling any
other SHMEM routine.
This routine is responsible inter alia for setting up the symmetric heap on the calling PE, and
the creation of the virtual PE numbers. Upon successful return from this routine, the calling PE
will be able to communicate with and transfer data to other PEs.
.PP
Multiple calls to this function are not allowed.
.PP
For an overview of programming with SHMEM communication routines, example SHMEM
programs, and instructions for compiling SHMEM programs, see the \fIintro_shmem\fP(3)
man page.
.SH EXAMPLES
This is a simple program that calls \fIshmem_integer_put\fP(3):
.Vb
PROGRAM PUT
INCLUDE "mpp/shmem.fh"
INTEGER TARG, SRC, RECEIVER, BAR
COMMON /T/ TARG
PARAMETER (RECEIVER=1)
CALL SHMEM_INIT()
IF (MY_PE() .EQ. 0) THEN
SRC = 33
CALL SHMEM_INTEGER_PUT(TARG, SRC, 1, RECEIVER)
ENDIF
CALL SHMEM_BARRIER_ALL ! SYNCHRONIZES SENDER AND RECEIVER
IF (MY_PE() .EQ. RECEIVER) THEN
PRINT *,'PE ', MY_PE(),' TARG=',TARG,' (expect 33)'
ENDIF
END
.Ve
.SH NOTES
If the start_pes call is not the first statement in a program, unexpected results may occur on
some architectures.
.SH SEE ALSO
\fIintro_shmem\fP(3),
\fIshmem_barrier\fP(3),
\fIshmem_barrier_all\fP(3),
\fIshmem_put\fP(3),
\fImy_pe\fP(3I),
\fIshmem_n_pes\fP(3I)

Просмотреть файл

@ -114,10 +114,10 @@ main()
static int race_winner = \-1;
int oldval;
start_pes(2);
oldval = shmem_int_cswap(&race_winner, \-1, _my_pe(), 0);
shmem_init();
oldval = shmem_int_cswap(&race_winner, \-1, shmem_my_pe(), 0);
if (oldval == \-1)
printf("pe %d was first\\n",_my_pe());
printf("pe %d was first\\n",shmem_my_pe());
}
.Ve
.SH SEE ALSO

113
oshmem/shmem/man/man3/shmem_malloc.3in Обычный файл
Просмотреть файл

@ -0,0 +1,113 @@
.\" -*- nroff -*-
.\" Copyright (c) 2015 University of Houston. All rights reserved.
.\" Copyright (c) 2015 Mellanox Technologies, Inc.
.\" $COPYRIGHT$
.de Vb
.ft CW
.nf
..
.de Ve
.ft R
.fi
..
.TH "SHMALLOC" "3" "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#"
.SH NAME
\fIshmem_malloc\fP(3),
\fIshmem_free\fP(3),
\fIshmem_align\fP(3),
\fIshmem_realloc\fP(3)
\fIshmalloc\fP(3),
\fIshfree\fP(3),
\fIshmemalign\fP(3),
\fIshrealloc\fP(3)
\- Symmetric heap memory management functions.
.SH SYNOPSIS
C or C++:
.Vb
#include <mpp/shmem.h>
void *shmem_malloc(size_t size);
void *shmalloc(size_t size);
void shmem_free(void *ptr);
void shfree(void *ptr);
void *shmem_realloc(void *ptr, size_t size);
void *shrealloc(void *ptr, size_t size);
void *shmem_align(size_t alignment, size_t size);
void *shmemalign(size_t alignment, size_t size);
extern long malloc_error;
.Ve
.SH DESCRIPTION
The \fBshmem_malloc\fP
function returns a pointer to a block of at least size bytes
suitably aligned for any use. This space is allocated from the symmetric heap (in contrast
to \fImalloc\fP(3C),
which allocates from the private heap).
.PP
The \fBshmem_align\fP
function allocates a block in the symmetric heap that has a
byte alignment specified by the alignment argument.
.PP
The \fBshmem_free\fP
function causes the block to which ptr points to, to be deallocated,
that is, made available for further allocation. If ptr is a null pointer, no action
occurs; otherwise, if the argument does not match a pointer earlier returned by a symmetric
heap function, or if the space has already been deallocated, malloc_error is set to indicate the
error, and shfree returns.
.PP
The \fBshmem_realloc\fP
function changes the size of the block to which ptr points to, to the
size (in bytes) specified by size.
.PP
The contents of the block are unchanged up to the lesser of the new and old sizes. If the new
size is larger, the value of the newly allocated portion of the block is indeterminate. If ptr is a
null pointer, the shrealloc function behaves like the shmalloc function for the specified size. If
size is 0 and ptr is not a null pointer, the block to which it points to is freed. Otherwise, if ptr
does not match a pointer earlier returned by a symmetric heap function, or if the space has
already been deallocated, the malloc_error variable is set to indicate the error, and shrealloc
returns a null pointer. If the space cannot be allocated, the block to which ptr points to is
unchanged.
.PP
The shmem_malloc, shmem_free, and shmem_realloc functions are provided so that multiple PEs in an
application can allocate symmetric, remotely accessible memory blocks. These memory
blocks can then be used with (shmem) communication routines. Each of these functions call
the \fIshmem_barrier_all\fP(3)
function before returning; this ensures that all PEs
participate in the memory allocation, and that the memory on other PEs can be used as soon
as the local PE returns.
.PP
The user is responsible for calling these functions with identical argument(s) on all PEs; if
differing size arguments are used, subsequent calls may not return the same symmetric heap
address on all PEs.
.PP
.SH NOTES
The total size of the symmetric heap is determined at job startup. One can adjust the size of
the heap using the SHMEM_SYMMETRIC_HEAP_SIZE environment variable. See the
\fIintro_shmem\fP(3)
man page for futher details.
The shmem_malloc, shmem_free, and shmem_realloc functions differ from the private heap allocation functions
in that all PEs in an application must call them (a barrier is used to ensure this).
.PP
.SH RETURN VALUES
The \fBshmem_malloc\fP
function returns a pointer to the allocated space (which should
be identical on all PEs); otherwise, it returns a null pointer (with malloc_error set).
The \fBshmem_free\fP
function returns no value.
The \fBshmem_realloc\fP
function returns a pointer to the allocated space (which
may have moved); otherwise, it returns a null pointer (with malloc_error set).
.SH SEE ALSO
\fIintro_shmem\fP(3),
\fIshmem_my_pe\fP(3I),
\fIshmem_init\fP(3)

41
oshmem/shmem/man/man3/shmem_my_pe.3in Обычный файл
Просмотреть файл

@ -0,0 +1,41 @@
.\" -*- nroff -*-
.\" Copyright (c) 2015 University of Houston. All rights reserved.
.\" Copyright (c) 2015 Mellanox Technologies, Inc.
.\" $COPYRIGHT$
.de Vb
.ft CW
.nf
..
.de Ve
.ft R
.fi
..
.TH "SHMEM\\_MY\\_PE" "3" "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#"
.SH NAME
shmem_my_pe, my_pe, _my_pe \- Returns the virtual PE number of the calling PE.
.SH SYNOPSIS
C or C++:
.Vb
#include <mpp/shmem.h>
int shmem_my_pe (void);
int my_pe (void);
.Ve
Fortran:
.Vb
include 'mpp/shmem.fh'
I = SHMEM_MY_PE ()
I = MY_PE ()
.Ve
.SH DESCRIPTION
my_pe() or shmem_my_pe() return the processing element (PE) number of the calling PE. It accepts no
arguments. The result is an integer between 0 and npes \- 1, where npes is the total
number of PEs executing the current program.
.SH SEE ALSO
\fIintro_shmem\fP(3),
\fIshmem_n_pes\fP(3),
\fIshmem_init\fP(3)

39
oshmem/shmem/man/man3/shmem_n_pes.3in Обычный файл
Просмотреть файл

@ -0,0 +1,39 @@
.\" -*- nroff -*-
.\" Copyright (c) 2015 University of Houston. All rights reserved.
.\" Copyright (c) 2015 Mellanox Technologies, Inc.
.\" $COPYRIGHT$
.de Vb
.ft CW
.nf
..
.de Ve
.ft R
.fi
..
.TH "SHMEM\\_N\\_PES" "3" "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#"
.SH NAME
num_pes, _num_pes, shmem_n_pes \- Returns the number of processing elements (PEs) used to run the application.
.SH SYNOPSIS
C or C++:
.Vb
#include <mpp/shmem.h>
int _num_pes (void);
int shmem_n_pes (void);
.Ve
Fortran:
.Vb
include 'mpp/shmem.fh'
I = NUM_PES ()
I = SHMEM_N_PES ()
.Ve
.SH DESCRIPTION
num_pes() or shmem_n_pes() return the total number of PEs running in an application.
.SH SEE ALSO
\fIintro_shmem\fP(3),
\fIshmem_my_pe\fP(3),
\fIshmem_init\fP(3)

Просмотреть файл

@ -95,15 +95,15 @@ main()
int *ptr;
int i;
start_pes(0);
if (_my_pe() == 0) {
shmem_init();
if (shmem_my_pe() == 0) {
/* initialize PE 1's bigd array */
ptr = shmem_ptr(bigd, 1);
for (i=0; i<100; i++)
*ptr++ = i+1;
}
shmem_barrier_all();
if (_my_pe() == 1) {
if (shmem_my_pe() == 1) {
printf("bigd on PE 1 is:\\n");
for (i=0; i<100; i++)
printf(" %d\\n",bigd[i]);

1
oshmem/shmem/man/man3/shmem_realloc.3in Обычный файл
Просмотреть файл

@ -0,0 +1 @@
.so man3/shmem_malloc.3

Просмотреть файл

@ -197,15 +197,15 @@ main()
6, 7, 8, 9, 10 };
static short target[10];
start_pes(2);
if (_my_pe() == 0) {
shmem_init();
if (shmem_my_pe() == 0) {
/* put 10 words into target on PE 1 */
shmem_short_iput(target, source, 1, 2, 5, 1);
}
shmem_barrier_all(); /* sync sender and receiver */
if (_my_pe() == 1) {
if (shmem_my_pe() == 1) {
shmem_udcflush(); /* not required on IRIX systems */
printf("target on PE %d is %d %d %d %d %d0, _my_pe(),
printf("target on PE %d is %d %d %d %d %d0, shmem_my_pe(),
(int)target[0], (int)target[1], (int)target[2],
(int)target[3], (int)target[4] );
}

Просмотреть файл

@ -1 +1 @@
.so man3/shmalloc.3
.so man3/shmem_malloc.3

Просмотреть файл

@ -1 +1 @@
.so man3/shmalloc.3
.so man3/shmem_malloc.3

Просмотреть файл

@ -1,82 +1 @@
.\" -*- nroff -*-
.\" Copyright (c) 2015 University of Houston. All rights reserved.
.\" Copyright (c) 2015 Mellanox Technologies, Inc.
.\" $COPYRIGHT$
.de Vb
.ft CW
.nf
..
.de Ve
.ft R
.fi
..
.TH "START\\_PES" "3" "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#"
.SH NAME
\fIstart_pes\fP(3)
\- Allocates a block of memory from the symmetric heap.
.SH SYNOPSIS
C or C++:
.Vb
void start_pes(int npes);
.Ve
Fortran:
.Vb
CALL START_PES(npes)
.Ve
.SH DESCRIPTION
The start_pes routine should be the first statement in a SHMEM parallel program.
.PP
The start_pes routine accepts the following argument:
.TP
npes
Unused. Should be set to 0.
.PP
This routine initializes the SHMEM API, therefore it must be called before calling any
other SHMEM routine.
This routine is responsible inter alia for setting up the symmetric heap on the calling PE, and
the creation of the virtual PE numbers. Upon successful return from this routine, the calling PE
will be able to communicate with and transfer data to other PEs.
.PP
Multiple calls to this function are not allowed.
.PP
For an overview of programming with SHMEM communication routines, example SHMEM
programs, and instructions for compiling SHMEM programs, see the \fIintro_shmem\fP(3)
man page.
.SH EXAMPLES
This is a simple program that calls \fIshmem_integer_put\fP(3):
.Vb
PROGRAM PUT
INCLUDE "mpp/shmem.fh"
INTEGER TARG, SRC, RECEIVER, BAR
COMMON /T/ TARG
PARAMETER (RECEIVER=1)
CALL START_PES(0)
IF (MY_PE() .EQ. 0) THEN
SRC = 33
CALL SHMEM_INTEGER_PUT(TARG, SRC, 1, RECEIVER)
ENDIF
CALL SHMEM_BARRIER_ALL ! SYNCHRONIZES SENDER AND RECEIVER
IF (MY_PE() .EQ. RECEIVER) THEN
PRINT *,'PE ', MY_PE(),' TARG=',TARG,' (expect 33)'
ENDIF
END
.Ve
.SH NOTES
If the start_pes call is not the first statement in a program, unexpected results may occur on
some architectures.
.SH SEE ALSO
\fIintro_shmem\fP(3),
\fIshmem_barrier\fP(3),
\fIshmem_barrier_all\fP(3),
\fIshmem_put\fP(3),
\fImy_pe\fP(3I),
\fInum_pes\fP(3I)
.so man3/shmem_init.3