Skip to content

Commit 2073766

Browse files
committed
osc/rdma: add support for controlling location of backing store
This commit adds a new MCA variable to set the location of the backing store: osc_rdma_backing_directory. The default on Linux has been changed to use /dev/shm to improve performance in cases where /tmp is not a tmpfs. Signed-off-by: Nathan Hjelm <[email protected]> (cherry picked from commit d0d59b1) Signed-off-by: Nathan Hjelm <[email protected]>
1 parent d596ac2 commit 2073766

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

ompi/mca/osc/rdma/osc_rdma.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ struct ompi_osc_rdma_component_t {
106106

107107
/** aggregation free list */
108108
opal_free_list_t aggregate;
109+
110+
/** directory where to place backing files */
111+
char *backing_directory;
109112
};
110113
typedef struct ompi_osc_rdma_component_t ompi_osc_rdma_component_t;
111114

ompi/mca/osc/rdma/osc_rdma_component.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,18 @@ static int ompi_osc_rdma_component_register (void)
268268
MCA_BASE_VAR_SCOPE_GROUP, &ompi_osc_rdma_mtl_names);
269269
free(description_str);
270270

271+
if (0 == access ("/dev/shm", W_OK)) {
272+
mca_osc_rdma_component.backing_directory = "/dev/shm";
273+
} else {
274+
mca_osc_rdma_component.backing_directory = ompi_process_info.proc_session_dir;
275+
}
276+
277+
(void) mca_base_component_var_register (&mca_osc_rdma_component.super.osc_version, "backing_directory",
278+
"Directory to place backing files for memory windows. "
279+
"This directory should be on a local filesystem such as /tmp or "
280+
"/dev/shm (default: (linux) /dev/shm, (others) session directory)",
281+
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0, OPAL_INFO_LVL_3,
282+
MCA_BASE_VAR_SCOPE_READONLY, &mca_osc_rdma_component.backing_directory);
271283

272284
/* register performance variables */
273285

@@ -602,9 +614,9 @@ static int allocate_state_shared (ompi_osc_rdma_module_t *module, void **base, s
602614
}
603615

604616
/* allocate the shared memory segment */
605-
ret = asprintf (&data_file, "%s"OPAL_PATH_SEP"window_%d.%s",
606-
ompi_process_info.job_session_dir, ompi_comm_get_cid (module->comm),
607-
ompi_process_info.nodename);
617+
ret = asprintf (&data_file, "%s" OPAL_PATH_SEP "osc_rdma.%s.%x.%d",
618+
mca_osc_rdma_component.backing_directory, ompi_process_info.nodename,
619+
OMPI_PROC_MY_NAME->jobid, ompi_comm_get_cid(module->comm));
608620
if (0 > ret) {
609621
ret = OMPI_ERR_OUT_OF_RESOURCE;
610622
break;

0 commit comments

Comments
 (0)