Skip to content

Commit e9f4e93

Browse files
author
Ralph Castain
authored
Merge pull request #4606 from rhc54/topic/register
Update to PMIx v3.0 PR for cleanup registration
2 parents a863c26 + 47fd231 commit e9f4e93

File tree

21 files changed

+727
-74
lines changed

21 files changed

+727
-74
lines changed

opal/mca/btl/vader/btl_vader.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* All rights reserved.
1313
* Copyright (c) 2006-2007 Voltaire. All rights reserved.
1414
* Copyright (c) 2009-2010 Cisco Systems, Inc. All rights reserved.
15-
* Copyright (c) 2010-2015 Los Alamos National Security, LLC. All rights
15+
* Copyright (c) 2010-2017 Los Alamos National Security, LLC. All rights
1616
* reserved.
1717
* Copyright (c) 2015 Mellanox Technologies. All rights reserved.
1818
*
@@ -136,6 +136,8 @@ struct mca_btl_vader_component_t {
136136
opal_list_t pending_endpoints; /**< list of endpoints with pending fragments */
137137
opal_list_t pending_fragments; /**< fragments pending remote completion */
138138

139+
char *backing_directory; /**< directory to place shared memory backing files */
140+
139141
/* knem stuff */
140142
#if OPAL_BTL_VADER_HAVE_KNEM
141143
unsigned int knem_dma_min; /**< minimum size to enable DMA for knem transfers (0 disables) */

opal/mca/btl/vader/btl_vader_component.c

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
* All rights reserved.
1313
* Copyright (c) 2006-2007 Voltaire. All rights reserved.
1414
* Copyright (c) 2009-2010 Cisco Systems, Inc. All rights reserved.
15-
* Copyright (c) 2010-2015 Los Alamos National Security, LLC.
15+
* Copyright (c) 2010-2017 Los Alamos National Security, LLC.
1616
* All rights reserved.
1717
* Copyright (c) 2011 NVIDIA Corporation. All rights reserved.
18-
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
18+
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
1919
* Copyright (c) 2014-2016 Research Organization for Information Science
2020
* and Technology (RIST). All rights reserved.
2121
* $COPYRIGHT$
@@ -211,6 +211,19 @@ static int mca_btl_vader_component_register (void)
211211
OPAL_INFO_LVL_3, MCA_BASE_VAR_SCOPE_GROUP, &mca_btl_vader_component.single_copy_mechanism);
212212
OBJ_RELEASE(new_enum);
213213

214+
if (0 == access ("/dev/shm", W_OK)) {
215+
mca_btl_vader_component.backing_directory = "/dev/shm";
216+
} else {
217+
mca_btl_vader_component.backing_directory = opal_process_info.proc_session_dir;
218+
}
219+
(void) mca_base_component_var_register (&mca_btl_vader_component.super.btl_version, "backing_directory",
220+
"Directory to place backing files for shared memory communication. "
221+
"This directory should be on a local filesystem such as /tmp or "
222+
"/dev/shm (default: (linux) /dev/shm, (others) session directory)",
223+
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0, OPAL_INFO_LVL_3,
224+
MCA_BASE_VAR_SCOPE_READONLY, &mca_btl_vader_component.backing_directory);
225+
226+
214227
#if OPAL_BTL_VADER_HAVE_KNEM
215228
/* Currently disabling DMA mode by default; it's not clear that this is useful in all applications and architectures. */
216229
mca_btl_vader_component.knem_dma_min = 0;
@@ -491,13 +504,17 @@ static mca_btl_base_module_t **mca_btl_vader_component_init (int *num_btls,
491504
if (MCA_BTL_VADER_XPMEM != mca_btl_vader_component.single_copy_mechanism) {
492505
char *sm_file;
493506

494-
rc = asprintf(&sm_file, "%s" OPAL_PATH_SEP "vader_segment.%s.%d", opal_process_info.proc_session_dir,
507+
rc = asprintf(&sm_file, "%s" OPAL_PATH_SEP "vader_segment.%s.%d", mca_btl_vader_component.backing_directory,
495508
opal_process_info.nodename, MCA_BTL_VADER_LOCAL_RANK);
496509
if (0 > rc) {
497510
free (btls);
498511
return NULL;
499512
}
500513

514+
if (NULL != opal_pmix.register_cleanup) {
515+
opal_pmix.register_cleanup (sm_file, false, false);
516+
}
517+
501518
rc = opal_shmem_segment_create (&component->seg_ds, sm_file, component->segment_size);
502519
free (sm_file);
503520
if (OPAL_SUCCESS != rc) {

opal/mca/pmix/base/base.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ typedef struct {
6565
opal_mutex_t mutex;
6666
opal_pmix_condition_t cond;
6767
volatile bool active;
68+
int status;
6869
} opal_pmix_lock_t;
6970

7071

opal/mca/pmix/pmix.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,9 @@ typedef int (*opal_pmix_base_process_monitor_fn_t)(opal_list_t *monitor,
867867
opal_list_t *directives,
868868
opal_pmix_info_cbfunc_t cbfunc, void *cbdata);
869869

870+
/* register cleanup */
871+
typedef int (*opal_pmix_base_register_cleanup_fn_t)(char *path, bool ignore, bool jobscope);
872+
870873
/*
871874
* the standard public API data structure
872875
*/
@@ -901,6 +904,7 @@ typedef struct {
901904
opal_pmix_base_alloc_fn_t allocate;
902905
opal_pmix_base_job_control_fn_t job_control;
903906
opal_pmix_base_process_monitor_fn_t monitor;
907+
opal_pmix_base_register_cleanup_fn_t register_cleanup;
904908
/* server APIs */
905909
opal_pmix_base_module_server_init_fn_t server_init;
906910
opal_pmix_base_module_server_finalize_fn_t server_finalize;

opal/mca/pmix/pmix3x/pmix/VERSION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ greek=
3030
# command, or with the date (if "git describe" fails) in the form of
3131
# "date<date>".
3232

33-
repo_rev=gitf56d30e
33+
repo_rev=git5c0b64b
3434

3535
# If tarball_version is not empty, it is used as the version string in
3636
# the tarball filename, regardless of all other versions listed in
@@ -44,7 +44,7 @@ tarball_version=
4444

4545
# The date when this release was created
4646

47-
date="Nov 11, 2017"
47+
date="Dec 11, 2017"
4848

4949
# The shared library version of each of PMIx's public libraries.
5050
# These versions are maintained in accordance with the "Library

opal/mca/pmix/pmix3x/pmix/include/pmix_common.h.in

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,16 @@ typedef uint32_t pmix_rank_t;
462462
#define PMIX_JOB_CTRL_PROVISION_IMAGE "pmix.jctrl.pvnimg" // (char*) name of the image that is to be provisioned
463463
#define PMIX_JOB_CTRL_PREEMPTIBLE "pmix.jctrl.preempt" // (bool) job can be pre-empted
464464
#define PMIX_JOB_CTRL_TERMINATE "pmix.jctrl.term" // (bool) politely terminate the specified procs
465+
#define PMIX_REGISTER_CLEANUP "pmix.reg.cleanup" // (char*) comma-delimited list of files/directories to
466+
// be removed upon process termination
467+
#define PMIX_CLEANUP_RECURSIVE "pmix.clnup.recurse" // (bool) recursively cleanup all subdirectories under the
468+
// specified one(s)
469+
#define PMIX_CLEANUP_EMPTY "pmix.clnup.empty" // (bool) only remove empty subdirectories
470+
#define PMIX_CLEANUP_IGNORE "pmix.clnup.ignore" // (char*) comma-delimited list of filenames that are not
471+
// to be removed
472+
#define PMIX_CLEANUP_LEAVE_TOPDIR "pmix.clnup.lvtop" // (bool) when recursively cleaning subdirs, do not remove
473+
// the top-level directory (the one given in the
474+
// cleanup request)
465475

466476
/* monitoring attributes */
467477
#define PMIX_MONITOR_ID "pmix.monitor.id" // (char*) provide a string identifier for this request
@@ -584,6 +594,7 @@ typedef int pmix_status_t;
584594
#define PMIX_ERR_NOT_IMPLEMENTED -48
585595
#define PMIX_ERR_COMM_FAILURE -49
586596
#define PMIX_ERR_UNPACK_READ_PAST_END_OF_BUFFER -50 // internal-only
597+
#define PMIX_ERR_CONFLICTING_CLEANUP_DIRECTIVES -51
587598

588599
/* define a starting point for v2.x error values */
589600
#define PMIX_ERR_V2X_BASE -100

opal/mca/pmix/pmix3x/pmix/src/atomics/sys/powerpc/atomic.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ void pmix_atomic_rmb(void)
8484
static inline
8585
void pmix_atomic_wmb(void)
8686
{
87-
PMIXRMB();
87+
PMIXWMB();
8888
}
8989

9090
static inline
@@ -110,7 +110,7 @@ void pmix_atomic_isync(void)
110110
#pragma mc_func pmix_atomic_rmb { "7c2004ac" } /* lwsync */
111111
#pragma reg_killed_by pmix_atomic_rmb /* none */
112112

113-
#pragma mc_func pmix_atomic_wmb { "7c0006ac" } /* eieio */
113+
#pragma mc_func pmix_atomic_wmb { "7c2004ac" } /* lwsync */
114114
#pragma reg_killed_by pmix_atomic_wmb /* none */
115115

116116
#endif

0 commit comments

Comments
 (0)