oshmem: Align OSHMEM API with spec v1.2 (modify existing functions)
Several functions are moved from to shmem-compat.h to shmem.h and back.
Этот коммит содержится в:
родитель
8498e26c4e
Коммит
9942dfdabf
@ -1,6 +1,6 @@
|
|||||||
/* oshmem/include/shmem-compat.h. This file contains OpenSHMEM lagacy API */
|
/* 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.
|
* All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
@ -23,10 +23,18 @@ OSHMEM_DECLSPEC int num_pes(void);
|
|||||||
OSHMEM_DECLSPEC int my_pe(void);
|
OSHMEM_DECLSPEC int my_pe(void);
|
||||||
|
|
||||||
/* old init/destruct functions - not in the open shmem spec but still supported */
|
/* old init/destruct functions - not in the open shmem spec but still supported */
|
||||||
OSHMEM_DECLSPEC void shmem_init(void);
|
OSHMEM_DECLSPEC void start_pes(int npes);
|
||||||
OSHMEM_DECLSPEC void shmem_finalize(void) OSHMEM_DESTRUCTOR;
|
|
||||||
OSHMEM_DECLSPEC int shmem_n_pes(void);
|
OSHMEM_DECLSPEC int _num_pes(void);
|
||||||
OSHMEM_DECLSPEC int shmem_my_pe(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_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);
|
OSHMEM_DECLSPEC void shmem_get(void *target, const void *source, size_t len, int pe);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2014 Mellanox Technologies, Inc.
|
* Copyright (c) 2014-2015 Mellanox Technologies, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2014 Intel, Inc. All rights reserved
|
* Copyright (c) 2014 Intel, Inc. All rights reserved
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
@ -106,14 +106,16 @@ enum shmem_wait_ops {
|
|||||||
/*
|
/*
|
||||||
* Initialization routines
|
* 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
|
* Query routines
|
||||||
*/
|
*/
|
||||||
OSHMEM_DECLSPEC int _num_pes(void);
|
OSHMEM_DECLSPEC int shmem_n_pes(void);
|
||||||
OSHMEM_DECLSPEC int _my_pe(void);
|
OSHMEM_DECLSPEC int shmem_my_pe(void);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -125,10 +127,10 @@ OSHMEM_DECLSPEC int shmem_addr_accessible(void *addr, int pe);
|
|||||||
/*
|
/*
|
||||||
* Symmetric heap routines
|
* Symmetric heap routines
|
||||||
*/
|
*/
|
||||||
OSHMEM_DECLSPEC void* shmalloc(size_t size);
|
OSHMEM_DECLSPEC void* shmem_malloc(size_t size);
|
||||||
OSHMEM_DECLSPEC void* shmemalign(size_t align, size_t size);
|
OSHMEM_DECLSPEC void* shmem_align(size_t align, size_t size);
|
||||||
OSHMEM_DECLSPEC void* shrealloc(void *ptr, size_t size);
|
OSHMEM_DECLSPEC void* shmem_realloc(void *ptr, size_t size);
|
||||||
OSHMEM_DECLSPEC void shfree(void* ptr);
|
OSHMEM_DECLSPEC void shmem_free(void* ptr);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Remote pointer operations
|
* Remote pointer operations
|
||||||
@ -138,6 +140,7 @@ OSHMEM_DECLSPEC void *shmem_ptr(void *ptr, int pe);
|
|||||||
/*
|
/*
|
||||||
* Elemental put routines
|
* 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_short_p(short* addr, short value, int pe);
|
||||||
OSHMEM_DECLSPEC void shmem_int_p(int* addr, int 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);
|
OSHMEM_DECLSPEC void shmem_long_p(long* addr, long value, int pe);
|
||||||
@ -149,7 +152,6 @@ OSHMEM_DECLSPEC void shmem_longdouble_p(long double* addr, long double value, i
|
|||||||
/*
|
/*
|
||||||
* Block data put routines
|
* 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_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_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);
|
OSHMEM_DECLSPEC void shmem_long_put(long *target, const long *source, size_t len, int pe);
|
||||||
@ -165,8 +167,8 @@ OSHMEM_DECLSPEC void shmem_putmem(void *target, const void *source, size_t len,
|
|||||||
/*
|
/*
|
||||||
* Strided put routines
|
* 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_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_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_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);
|
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 +193,6 @@ OSHMEM_DECLSPEC long double shmem_longdouble_g(long double* addr, int pe);
|
|||||||
/*
|
/*
|
||||||
* Block data get routines
|
* 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_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_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);
|
OSHMEM_DECLSPEC void shmem_long_get(long *target, const long *source, size_t len, int pe);
|
||||||
@ -207,8 +208,8 @@ OSHMEM_DECLSPEC void shmem_getmem(void *target, const void *source, size_t len,
|
|||||||
/*
|
/*
|
||||||
* Strided get routines
|
* 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_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_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_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);
|
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 */
|
/* 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.
|
* All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
@ -26,7 +26,6 @@ OSHMEM_DECLSPEC void shmem_int64_p(int64_t* addr, int64_t value, int pe);
|
|||||||
/*
|
/*
|
||||||
* Elemental put routines
|
* Elemental put routines
|
||||||
*/
|
*/
|
||||||
OSHMEM_DECLSPEC void shmem_char_p(char* addr, char value, int pe);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Block data put routines
|
* Block data put routines
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2013 Mellanox Technologies, Inc.
|
# Copyright (c) 2013-2015 Mellanox Technologies, Inc.
|
||||||
# All rights reserved
|
# All rights reserved
|
||||||
# Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
|
# Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
|
||||||
# $COPYRIGHT$
|
# $COPYRIGHT$
|
||||||
@ -15,8 +15,7 @@ if OSHMEM_PROFILING
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
OSHMEM_AUX_SOURCES = \
|
OSHMEM_AUX_SOURCES = \
|
||||||
shmem_lock.c \
|
shmem_lock.c
|
||||||
globalexit.c
|
|
||||||
|
|
||||||
OSHMEM_API_SOURCES = \
|
OSHMEM_API_SOURCES = \
|
||||||
shmem_init.c \
|
shmem_init.c \
|
||||||
@ -56,7 +55,8 @@ OSHMEM_API_SOURCES = \
|
|||||||
shmem_inc.c \
|
shmem_inc.c \
|
||||||
shmem_clear_lock.c \
|
shmem_clear_lock.c \
|
||||||
shmem_set_lock.c \
|
shmem_set_lock.c \
|
||||||
shmem_test_lock.c
|
shmem_test_lock.c \
|
||||||
|
shmem_global_exit.c
|
||||||
|
|
||||||
AM_CPPFLAGS = -DOSHMEM_PROFILING=0
|
AM_CPPFLAGS = -DOSHMEM_PROFILING=0
|
||||||
|
|
||||||
|
@ -67,7 +67,8 @@ OSHMEM_API_SOURCES = \
|
|||||||
pshmem_inc.c \
|
pshmem_inc.c \
|
||||||
pshmem_clear_lock.c \
|
pshmem_clear_lock.c \
|
||||||
pshmem_set_lock.c \
|
pshmem_set_lock.c \
|
||||||
pshmem_test_lock.c
|
pshmem_test_lock.c \
|
||||||
|
pshmem_global_exit.c
|
||||||
|
|
||||||
nodist_liboshmem_c_pshmem_la_SOURCES = \
|
nodist_liboshmem_c_pshmem_la_SOURCES = \
|
||||||
$(OSHMEM_API_SOURCES)
|
$(OSHMEM_API_SOURCES)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2013 Mellanox Technologies, Inc.
|
* Copyright (c) 2013-2015 Mellanox Technologies, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
@ -20,19 +20,23 @@
|
|||||||
/*
|
/*
|
||||||
* Initialization routines
|
* Initialization routines
|
||||||
*/
|
*/
|
||||||
#define start_pes pstart_pes
|
#define shmem_init pshmem_init
|
||||||
|
#define start_pes pstart_pes /* shmem-compat.h */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Finalization routines
|
* Finalization routines
|
||||||
*/
|
*/
|
||||||
#define shmem_finalize pshmem_finalize
|
#define shmem_finalize pshmem_finalize
|
||||||
|
#define shmem_global_exit pshmem_global_exit
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Query routines
|
* Query routines
|
||||||
*/
|
*/
|
||||||
#define _num_pes p_num_pes
|
#define shmem_n_pes pshmem_n_pes
|
||||||
#define _my_pe p_my_pe
|
#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 */
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -44,10 +48,14 @@
|
|||||||
/*
|
/*
|
||||||
* Symmetric heap routines
|
* Symmetric heap routines
|
||||||
*/
|
*/
|
||||||
#define shmalloc pshmalloc
|
#define shmem_malloc pshmem_malloc
|
||||||
#define shmemalign pshmemalign
|
#define shmem_align pshmem_align
|
||||||
#define shrealloc pshrealloc
|
#define shmem_realloc pshmem_realloc
|
||||||
#define shfree pshfree
|
#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
|
* Remote pointer operations
|
||||||
@ -72,7 +80,7 @@
|
|||||||
/*
|
/*
|
||||||
* Block data put routines
|
* Block data put routines
|
||||||
*/
|
*/
|
||||||
#define shmem_char_put pshmem_char_put
|
#define shmem_char_put pshmem_char_put /* shmem-compat.h */
|
||||||
#define shmem_short_put pshmem_short_put
|
#define shmem_short_put pshmem_short_put
|
||||||
#define shmem_int_put pshmem_int_put
|
#define shmem_int_put pshmem_int_put
|
||||||
#define shmem_long_put pshmem_long_put
|
#define shmem_long_put pshmem_long_put
|
||||||
@ -119,7 +127,7 @@
|
|||||||
/*
|
/*
|
||||||
* Block data get routines
|
* Block data get routines
|
||||||
*/
|
*/
|
||||||
#define shmem_char_get pshmem_char_get
|
#define shmem_char_get pshmem_char_get /* shmem-compat.h */
|
||||||
#define shmem_short_get pshmem_short_get
|
#define shmem_short_get pshmem_short_get
|
||||||
#define shmem_int_get pshmem_int_get
|
#define shmem_int_get pshmem_int_get
|
||||||
#define shmem_long_get pshmem_long_get
|
#define shmem_long_get pshmem_long_get
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2013 Mellanox Technologies, Inc.
|
* Copyright (c) 2013-2015 Mellanox Technologies, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
@ -19,11 +19,24 @@
|
|||||||
|
|
||||||
#if OSHMEM_PROFILING
|
#if OSHMEM_PROFILING
|
||||||
#include "oshmem/include/pshmem.h"
|
#include "oshmem/include/pshmem.h"
|
||||||
|
#pragma weak shmem_align = pshmem_align
|
||||||
#pragma weak shmemalign = pshmemalign
|
#pragma weak shmemalign = pshmemalign
|
||||||
#include "oshmem/shmem/c/profile/defines.h"
|
#include "oshmem/shmem/c/profile/defines.h"
|
||||||
#endif
|
#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)
|
void* shmemalign(size_t align, size_t size)
|
||||||
|
{
|
||||||
|
return _shmemalign(align, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void* _shmemalign(size_t align, size_t size)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
void* pBuff = NULL;
|
void* pBuff = NULL;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2013 Mellanox Technologies, Inc.
|
* Copyright (c) 2013-2015 Mellanox Technologies, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
@ -19,11 +19,24 @@
|
|||||||
|
|
||||||
#if OSHMEM_PROFILING
|
#if OSHMEM_PROFILING
|
||||||
#include "oshmem/include/pshmem.h"
|
#include "oshmem/include/pshmem.h"
|
||||||
|
#pragma weak shmem_malloc = pshmem_malloc
|
||||||
#pragma weak shmalloc = pshmalloc
|
#pragma weak shmalloc = pshmalloc
|
||||||
#include "oshmem/shmem/c/profile/defines.h"
|
#include "oshmem/shmem/c/profile/defines.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static inline void* _shmalloc(size_t size);
|
||||||
|
|
||||||
|
void* shmem_malloc(size_t size)
|
||||||
|
{
|
||||||
|
return _shmalloc(size);
|
||||||
|
}
|
||||||
|
|
||||||
void* shmalloc(size_t size)
|
void* shmalloc(size_t size)
|
||||||
|
{
|
||||||
|
return _shmalloc(size);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void* _shmalloc(size_t size)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
void* pBuff = NULL;
|
void* pBuff = NULL;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2013 Mellanox Technologies, Inc.
|
* Copyright (c) 2013-2015 Mellanox Technologies, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
@ -20,11 +20,24 @@
|
|||||||
|
|
||||||
#if OSHMEM_PROFILING
|
#if OSHMEM_PROFILING
|
||||||
#include "oshmem/include/pshmem.h"
|
#include "oshmem/include/pshmem.h"
|
||||||
|
#pragma weak shmem_free = pshmem_free
|
||||||
#pragma weak shfree = pshfree
|
#pragma weak shfree = pshfree
|
||||||
#include "oshmem/shmem/c/profile/defines.h"
|
#include "oshmem/shmem/c/profile/defines.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static inline void _shfree(void* ptr);
|
||||||
|
|
||||||
|
void shmem_free(void* ptr)
|
||||||
|
{
|
||||||
|
_shfree(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
void shfree(void* ptr)
|
void shfree(void* ptr)
|
||||||
|
{
|
||||||
|
_shfree(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void _shfree(void* ptr)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2012 Mellanox Technologies, Inc.
|
* Copyright (c) 2012-2015 Mellanox Technologies, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
@ -14,9 +14,27 @@
|
|||||||
|
|
||||||
#include "orte/mca/errmgr/errmgr.h"
|
#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;
|
extern int oshmem_shmem_inglobalexit;
|
||||||
|
|
||||||
|
static inline void _globalexit(int status);
|
||||||
|
|
||||||
|
void shmem_global_exit(int status)
|
||||||
|
{
|
||||||
|
_globalexit(status);
|
||||||
|
}
|
||||||
|
|
||||||
void globalexit(int status)
|
void globalexit(int status)
|
||||||
|
{
|
||||||
|
_globalexit(status);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void _globalexit(int status)
|
||||||
{
|
{
|
||||||
oshmem_shmem_inglobalexit++;
|
oshmem_shmem_inglobalexit++;
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2013 Mellanox Technologies, Inc.
|
* Copyright (c) 2013-2015 Mellanox Technologies, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
@ -25,16 +25,25 @@
|
|||||||
|
|
||||||
#if OSHMEM_PROFILING
|
#if OSHMEM_PROFILING
|
||||||
#include "oshmem/include/pshmem.h"
|
#include "oshmem/include/pshmem.h"
|
||||||
|
#pragma weak shmem_init = pshmem_init
|
||||||
#pragma weak start_pes = pstart_pes
|
#pragma weak start_pes = pstart_pes
|
||||||
#include "oshmem/shmem/c/profile/defines.h"
|
#include "oshmem/shmem/c/profile/defines.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern int oshmem_shmem_globalexit_status;
|
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)
|
void start_pes(int npes)
|
||||||
{
|
{
|
||||||
/* spec says that npes are ignored for now */
|
/* spec says that npes are ignored for now */
|
||||||
shmem_init();
|
_shmem_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void shmem_onexit(int exitcode, void *arg)
|
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;
|
oshmem_shmem_globalexit_status = exitcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
void shmem_init(void)
|
static inline void _shmem_init(void)
|
||||||
{
|
{
|
||||||
int err = OSHMEM_SUCCESS;
|
int err = OSHMEM_SUCCESS;
|
||||||
int provided;
|
int provided;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2013 Mellanox Technologies, Inc.
|
* Copyright (c) 2013-2015 Mellanox Technologies, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
#if OSHMEM_PROFILING
|
#if OSHMEM_PROFILING
|
||||||
#include "oshmem/include/pshmem.h"
|
#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 _num_pes = p_num_pes
|
||||||
#pragma weak _my_pe = p_my_pe
|
#pragma weak _my_pe = p_my_pe
|
||||||
#include "oshmem/shmem/c/profile/defines.h"
|
#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.
|
* All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
@ -21,11 +21,24 @@
|
|||||||
|
|
||||||
#if OSHMEM_PROFILING
|
#if OSHMEM_PROFILING
|
||||||
#include "oshmem/include/pshmem.h"
|
#include "oshmem/include/pshmem.h"
|
||||||
|
#pragma weak shmem_realloc = pshmem_realloc
|
||||||
#pragma weak shrealloc = pshrealloc
|
#pragma weak shrealloc = pshrealloc
|
||||||
#include "oshmem/shmem/c/profile/defines.h"
|
#include "oshmem/shmem/c/profile/defines.h"
|
||||||
#endif
|
#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)
|
void* shrealloc(void *ptr, size_t size)
|
||||||
|
{
|
||||||
|
return _shrealloc(ptr, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void* _shrealloc(void *ptr, size_t size)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
void* pBuff = NULL;
|
void* pBuff = NULL;
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user