|
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 | | - * Copyright (c) 2014-2015 Intel, Inc. All rights reserved. |
19 | | - * Copyright (c) 2014-2016 Research Organization for Information Science |
| 18 | + * Copyright (c) 2014-2018 Intel, Inc. All rights reserved. |
| 19 | + * Copyright (c) 2014-2018 Research Organization for Information Science |
20 | 20 | * and Technology (RIST). All rights reserved. |
21 | 21 | * $COPYRIGHT$ |
22 | 22 | * |
@@ -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.job_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,8 +504,8 @@ 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, |
495 | | - opal_process_info.nodename, MCA_BTL_VADER_LOCAL_RANK); |
| 507 | + rc = asprintf(&sm_file, "%s" OPAL_PATH_SEP "vader_segment.%s.%x.%d", mca_btl_vader_component.backing_directory, |
| 508 | + opal_process_info.nodename, OPAL_PROC_MY_NAME.jobid, MCA_BTL_VADER_LOCAL_RANK); |
496 | 509 | if (0 > rc) { |
497 | 510 | free (btls); |
498 | 511 | return NULL; |
|
0 commit comments