|
12 | 12 | * All rights reserved.
|
13 | 13 | * Copyright (c) 2006-2007 Voltaire. All rights reserved.
|
14 | 14 | * 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. |
16 | 16 | * All rights reserved.
|
17 | 17 | * Copyright (c) 2011 NVIDIA Corporation. All rights reserved.
|
18 | 18 | * Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
|
@@ -211,6 +211,19 @@ static int mca_btl_vader_component_register (void)
|
211 | 211 | OPAL_INFO_LVL_3, MCA_BASE_VAR_SCOPE_GROUP, &mca_btl_vader_component.single_copy_mechanism);
|
212 | 212 | OBJ_RELEASE(new_enum);
|
213 | 213 |
|
| 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 | + |
214 | 227 | #if OPAL_BTL_VADER_HAVE_KNEM
|
215 | 228 | /* Currently disabling DMA mode by default; it's not clear that this is useful in all applications and architectures. */
|
216 | 229 | 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,
|
491 | 504 | if (MCA_BTL_VADER_XPMEM != mca_btl_vader_component.single_copy_mechanism) {
|
492 | 505 | char *sm_file;
|
493 | 506 |
|
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, |
495 | 508 | opal_process_info.nodename, MCA_BTL_VADER_LOCAL_RANK);
|
496 | 509 | if (0 > rc) {
|
497 | 510 | free (btls);
|
498 | 511 | return NULL;
|
499 | 512 | }
|
500 | 513 |
|
| 514 | + if (NULL != opal_pmix.register_cleanup) { |
| 515 | + opal_pmix.register_cleanup (sm_file, false, false); |
| 516 | + } |
| 517 | + |
501 | 518 | rc = opal_shmem_segment_create (&component->seg_ds, sm_file, component->segment_size);
|
502 | 519 | free (sm_file);
|
503 | 520 | if (OPAL_SUCCESS != rc) {
|
|
0 commit comments