Skip to content

Commit 7f74929

Browse files
author
rhc54
committed
Merge pull request open-mpi#945 from ggouaillardet/topic/v1.10/osc_sm_unique_datafile
osc/sm: create datafile into the per proc directory in order to make …
2 parents 00d1f31 + 0b62eab commit 7f74929

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

ompi/mca/osc/sm/osc_sm_component.c

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* reserved.
66
* Copyright (c) 2014 Intel, Inc. All rights reserved.
77
* Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
8-
* Copyright (c) 2015 Research Organization for Information Science
8+
* Copyright (c) 2015-2016 Research Organization for Information Science
99
* and Technology (RIST). All rights reserved.
1010
* $COPYRIGHT$
1111
*
@@ -214,10 +214,9 @@ component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit
214214
module->posts[0] = (uint64_t *) (module->posts + 1);
215215
} else {
216216
unsigned long total, *rbuf;
217-
char *data_file;
218217
int i, flag;
219218
size_t pagesize;
220-
size_t state_size;
219+
size_t state_size;
221220
int posts_size, post_size = (comm_size + 63) / 64;
222221

223222
OPAL_OUTPUT_VERBOSE((1, ompi_osc_base_framework.framework_output,
@@ -251,22 +250,24 @@ component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit
251250
total += rbuf[i];
252251
}
253252

254-
if (asprintf(&data_file, "%s"OPAL_PATH_SEP"shared_window_%d.%s",
255-
ompi_process_info.job_session_dir,
256-
ompi_comm_get_cid(module->comm),
257-
ompi_process_info.nodename) < 0) {
258-
return OMPI_ERR_OUT_OF_RESOURCE;
259-
}
260-
261253
/* user opal/shmem directly to create a shared memory segment */
262254
state_size = sizeof(ompi_osc_sm_global_state_t) + sizeof(ompi_osc_sm_node_state_t) * comm_size;
263255
posts_size = comm_size * post_size * sizeof (uint64_t);
264-
if (0 == ompi_comm_rank (module->comm)) {
265-
ret = opal_shmem_segment_create (&module->seg_ds, data_file, total + pagesize + state_size + posts_size);
266-
if (OPAL_SUCCESS != ret) {
267-
goto error;
268-
}
269-
}
256+
if (0 == ompi_comm_rank (module->comm)) {
257+
char *data_file;
258+
if (asprintf(&data_file, "%s"OPAL_PATH_SEP"shared_window_%d.%s",
259+
ompi_process_info.proc_session_dir,
260+
ompi_comm_get_cid(module->comm),
261+
ompi_process_info.nodename) < 0) {
262+
return OMPI_ERR_OUT_OF_RESOURCE;
263+
}
264+
265+
ret = opal_shmem_segment_create (&module->seg_ds, data_file, total + pagesize + state_size + posts_size);
266+
free(data_file);
267+
if (OPAL_SUCCESS != ret) {
268+
goto error;
269+
}
270+
}
270271

271272
ret = module->comm->c_coll.coll_bcast (&module->seg_ds, sizeof (module->seg_ds), MPI_BYTE, 0,
272273
module->comm, module->comm->c_coll.coll_bcast_module);

0 commit comments

Comments
 (0)