Skip to content

Commit

Permalink
Merge pull request #2121 from ggouaillardet/topic/v2.x/oshmem_finaliz…
Browse files Browse the repository at this point in the history
…e_on_exit

v2.1.x: oshmem: move finalisation to oshmem_onexit
  • Loading branch information
hppritcha authored Oct 6, 2016
2 parents be030c3 + d9debb1 commit 088ed04
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 25 deletions.
10 changes: 3 additions & 7 deletions oshmem/include/oshmem_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
*
* Copyright (c) 2013 Mellanox Technologies, Inc.
* All rights reserved.
* Copyright (c) 2013 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2013 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2016 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -52,19 +54,13 @@
# ifndef OSHMEM_MODULE_DECLSPEC
# define OSHMEM_MODULE_DECLSPEC __opal_attribute_visibility__("default")
# endif
# ifndef OSHMEM_DESTRUCTOR
# define OSHMEM_DESTRUCTOR __opal_attribute_destructor__
# endif
# else
# ifndef OSHMEM_DECLSPEC
# define OSHMEM_DECLSPEC
# endif
# ifndef OSHMEM_MODULE_DECLSPEC
# define OSHMEM_MODULE_DECLSPEC
# endif
# ifndef OSHMEM_DESTRUCTOR
# define OSHMEM_DESTRUCTOR
# endif
# endif
#endif /* defined(__WINDOWS__) */

Expand Down
12 changes: 3 additions & 9 deletions oshmem/include/pshmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* Copyright (c) 2014-2016 Mellanox Technologies, Inc.
* All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved
* Copyright (c) 2016 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -32,14 +34,6 @@
# endif
#endif

#ifndef OSHMEM_DESTRUCTOR
# if defined(OPAL_C_HAVE_VISIBILITY) && (OPAL_C_HAVE_VISIBILITY == 1)
# define OSHMEM_DESTRUCTOR __attribute__((__destructor__))
# else
# define OSHMEM_DESTRUCTOR
# endif
#endif

#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
#define OSHMEMP_HAVE_C11 1
#else
Expand All @@ -65,7 +59,7 @@ OSHMEM_DECLSPEC void pshmem_global_exit(int status);
/*
* Finalization routines
*/
OSHMEM_DECLSPEC void pshmem_finalize(void) OSHMEM_DESTRUCTOR;
OSHMEM_DECLSPEC void pshmem_finalize(void);

/*
* Query routines
Expand Down
12 changes: 3 additions & 9 deletions oshmem/include/shmem.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* Copyright (c) 2014-2016 Mellanox Technologies, Inc.
* All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved
* Copyright (c) 2016 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -39,14 +41,6 @@
# endif
#endif

#ifndef OSHMEM_DESTRUCTOR
# if defined(OPAL_C_HAVE_VISIBILITY) && (OPAL_C_HAVE_VISIBILITY == 1)
# define OSHMEM_DESTRUCTOR __attribute__((__destructor__))
# else
# define OSHMEM_DESTRUCTOR
# endif
#endif

#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
#define OSHMEM_HAVE_C11 1
#else
Expand Down Expand Up @@ -123,7 +117,7 @@ enum shmem_wait_ops {
* Initialization routines
*/
OSHMEM_DECLSPEC void shmem_init(void);
OSHMEM_DECLSPEC void shmem_finalize(void) OSHMEM_DESTRUCTOR;
OSHMEM_DECLSPEC void shmem_finalize(void);
OSHMEM_DECLSPEC void shmem_global_exit(int status);

/*
Expand Down
3 changes: 3 additions & 0 deletions oshmem/shmem/c/shmem_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* All rights reserved.
* Copyright (c) 2015 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2016 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -50,6 +52,7 @@ void start_pes(int npes)
static void shmem_onexit(int exitcode, void *arg)
{
oshmem_shmem_globalexit_status = exitcode;
shmem_finalize();
}

static inline void _shmem_init(void)
Expand Down

0 comments on commit 088ed04

Please sign in to comment.