Skip to content

Commit b04a7ce

Browse files
committed
preprocessor logic for SHMEM*SYNC_SIZE
1 parent 3be80cd commit b04a7ce

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

include/par-res-kern_shmem.h

+29
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,32 @@ POSSIBILITY OF SUCH DAMAGE.
3333
#include <shmem.h>
3434

3535
extern void bail_out(int);
36+
37+
#if defined(SHMEM_MAJOR_VERSION) && defined(SHMEM_MINOR_VERSION)
38+
# if (SHMEM_MAJOR_VERSION>1) || ((SHMEM_MAJOR_VERSION == 1) && (SHMEM_MINOR_VERSION >= 3))
39+
# define PRK_SHMEM_BCAST_SYNC_SIZE SHMEM_BCAST_SYNC_SIZE
40+
# define PRK_SHMEM_REDUCE_SYNC_SIZE SHMEM_REDUCE_SYNC_SIZE
41+
# else // pre-1.3 OpenSHMEM or some other SHMEM
42+
# define PRK_SHMEM_BCAST_SYNC_SIZE _SHMEM_BCAST_SYNC_SIZE
43+
# define PRK_SHMEM_REDUCE_SYNC_SIZE _SHMEM_REDUCE_SYNC_SIZE
44+
# endif // OpenSHMEM versions
45+
#else // no VERSION symbols
46+
# if defined(SHMEM_BCAST_SYNC_SIZE)
47+
# define PRK_SHMEM_BCAST_SYNC_SIZE SHMEM_BCAST_SYNC_SIZE
48+
# elif defined(_SHMEM_BCAST_SYNC_SIZE)
49+
# define PRK_SHMEM_BCAST_SYNC_SIZE _SHMEM_BCAST_SYNC_SIZE
50+
# else
51+
# error No preprocesor definition of SHMEM_BCAST_SYNC_SIZE!
52+
# endif
53+
# if defined(SHMEM_REDUCE_SYNC_SIZE)
54+
# define PRK_SHMEM_REDUCE_SYNC_SIZE SHMEM_REDUCE_SYNC_SIZE
55+
# elif defined(_SHMEM_REDUCE_SYNC_SIZE)
56+
# define PRK_SHMEM_REDUCE_SYNC_SIZE _SHMEM_REDUCE_SYNC_SIZE
57+
# else
58+
# error No preprocesor definition of SHMEM_REDUCE_SYNC_SIZE!
59+
# endif
60+
#endif // VERSION symbols
61+
62+
63+
64+

0 commit comments

Comments
 (0)