Skip to content

Commit 088ed04

Browse files
authored
Merge pull request #2121 from ggouaillardet/topic/v2.x/oshmem_finalize_on_exit
v2.1.x: oshmem: move finalisation to oshmem_onexit
2 parents be030c3 + d9debb1 commit 088ed04

File tree

4 files changed

+12
-25
lines changed

4 files changed

+12
-25
lines changed

oshmem/include/oshmem_config.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
*
33
* Copyright (c) 2013 Mellanox Technologies, Inc.
44
* All rights reserved.
5-
* Copyright (c) 2013 Cisco Systems, Inc. All rights reserved.
5+
* Copyright (c) 2013 Cisco Systems, Inc. All rights reserved.
6+
* Copyright (c) 2016 Research Organization for Information Science
7+
* and Technology (RIST). All rights reserved.
68
* $COPYRIGHT$
79
*
810
* Additional copyrights may follow
@@ -52,19 +54,13 @@
5254
# ifndef OSHMEM_MODULE_DECLSPEC
5355
# define OSHMEM_MODULE_DECLSPEC __opal_attribute_visibility__("default")
5456
# endif
55-
# ifndef OSHMEM_DESTRUCTOR
56-
# define OSHMEM_DESTRUCTOR __opal_attribute_destructor__
57-
# endif
5857
# else
5958
# ifndef OSHMEM_DECLSPEC
6059
# define OSHMEM_DECLSPEC
6160
# endif
6261
# ifndef OSHMEM_MODULE_DECLSPEC
6362
# define OSHMEM_MODULE_DECLSPEC
6463
# endif
65-
# ifndef OSHMEM_DESTRUCTOR
66-
# define OSHMEM_DESTRUCTOR
67-
# endif
6864
# endif
6965
#endif /* defined(__WINDOWS__) */
7066

oshmem/include/pshmem.h

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
* Copyright (c) 2014-2016 Mellanox Technologies, Inc.
33
* All rights reserved.
44
* Copyright (c) 2014 Intel, Inc. All rights reserved
5+
* Copyright (c) 2016 Research Organization for Information Science
6+
* and Technology (RIST). All rights reserved.
57
* $COPYRIGHT$
68
*
79
* Additional copyrights may follow
@@ -32,14 +34,6 @@
3234
# endif
3335
#endif
3436

35-
#ifndef OSHMEM_DESTRUCTOR
36-
# if defined(OPAL_C_HAVE_VISIBILITY) && (OPAL_C_HAVE_VISIBILITY == 1)
37-
# define OSHMEM_DESTRUCTOR __attribute__((__destructor__))
38-
# else
39-
# define OSHMEM_DESTRUCTOR
40-
# endif
41-
#endif
42-
4337
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
4438
#define OSHMEMP_HAVE_C11 1
4539
#else
@@ -65,7 +59,7 @@ OSHMEM_DECLSPEC void pshmem_global_exit(int status);
6559
/*
6660
* Finalization routines
6761
*/
68-
OSHMEM_DECLSPEC void pshmem_finalize(void) OSHMEM_DESTRUCTOR;
62+
OSHMEM_DECLSPEC void pshmem_finalize(void);
6963

7064
/*
7165
* Query routines

oshmem/include/shmem.h.in

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
* Copyright (c) 2014-2016 Mellanox Technologies, Inc.
33
* All rights reserved.
44
* Copyright (c) 2014 Intel, Inc. All rights reserved
5+
* Copyright (c) 2016 Research Organization for Information Science
6+
* and Technology (RIST). All rights reserved.
57
* $COPYRIGHT$
68
*
79
* Additional copyrights may follow
@@ -39,14 +41,6 @@
3941
# endif
4042
#endif
4143

42-
#ifndef OSHMEM_DESTRUCTOR
43-
# if defined(OPAL_C_HAVE_VISIBILITY) && (OPAL_C_HAVE_VISIBILITY == 1)
44-
# define OSHMEM_DESTRUCTOR __attribute__((__destructor__))
45-
# else
46-
# define OSHMEM_DESTRUCTOR
47-
# endif
48-
#endif
49-
5044
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
5145
#define OSHMEM_HAVE_C11 1
5246
#else
@@ -123,7 +117,7 @@ enum shmem_wait_ops {
123117
* Initialization routines
124118
*/
125119
OSHMEM_DECLSPEC void shmem_init(void);
126-
OSHMEM_DECLSPEC void shmem_finalize(void) OSHMEM_DESTRUCTOR;
120+
OSHMEM_DECLSPEC void shmem_finalize(void);
127121
OSHMEM_DECLSPEC void shmem_global_exit(int status);
128122

129123
/*

oshmem/shmem/c/shmem_init.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* All rights reserved.
44
* Copyright (c) 2015 Los Alamos National Security, LLC.
55
* All rights reserved.
6+
* Copyright (c) 2016 Research Organization for Information Science
7+
* and Technology (RIST). All rights reserved.
68
* $COPYRIGHT$
79
*
810
* Additional copyrights may follow
@@ -50,6 +52,7 @@ void start_pes(int npes)
5052
static void shmem_onexit(int exitcode, void *arg)
5153
{
5254
oshmem_shmem_globalexit_status = exitcode;
55+
shmem_finalize();
5356
}
5457

5558
static inline void _shmem_init(void)

0 commit comments

Comments
 (0)