|
5 | 5 | * reserved. |
6 | 6 | * Copyright (c) 2014 Intel, Inc. All rights reserved. |
7 | 7 | * 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 |
9 | 9 | * and Technology (RIST). All rights reserved. |
10 | 10 | * $COPYRIGHT$ |
11 | 11 | * |
@@ -208,10 +208,9 @@ component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit |
208 | 208 | module->posts[0] = (uint64_t *) (module->posts + 1); |
209 | 209 | } else { |
210 | 210 | unsigned long total, *rbuf; |
211 | | - char *data_file; |
212 | 211 | int i, flag; |
213 | 212 | size_t pagesize; |
214 | | - size_t state_size; |
| 213 | + size_t state_size; |
215 | 214 | int posts_size, post_size = (comm_size + 63) / 64; |
216 | 215 |
|
217 | 216 | OPAL_OUTPUT_VERBOSE((1, ompi_osc_base_framework.framework_output, |
@@ -245,22 +244,24 @@ component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit |
245 | 244 | total += rbuf[i]; |
246 | 245 | } |
247 | 246 |
|
248 | | - if (asprintf(&data_file, "%s"OPAL_PATH_SEP"shared_window_%d.%s", |
249 | | - ompi_process_info.job_session_dir, |
250 | | - ompi_comm_get_cid(module->comm), |
251 | | - ompi_process_info.nodename) < 0) { |
252 | | - return OMPI_ERR_OUT_OF_RESOURCE; |
253 | | - } |
254 | | - |
255 | 247 | /* user opal/shmem directly to create a shared memory segment */ |
256 | 248 | state_size = sizeof(ompi_osc_sm_global_state_t) + sizeof(ompi_osc_sm_node_state_t) * comm_size; |
257 | 249 | posts_size = comm_size * post_size * sizeof (uint64_t); |
258 | | - if (0 == ompi_comm_rank (module->comm)) { |
259 | | - ret = opal_shmem_segment_create (&module->seg_ds, data_file, total + pagesize + state_size + posts_size); |
260 | | - if (OPAL_SUCCESS != ret) { |
261 | | - goto error; |
262 | | - } |
263 | | - } |
| 250 | + if (0 == ompi_comm_rank (module->comm)) { |
| 251 | + char *data_file; |
| 252 | + if (asprintf(&data_file, "%s"OPAL_PATH_SEP"shared_window_%d.%s", |
| 253 | + ompi_process_info.proc_session_dir, |
| 254 | + ompi_comm_get_cid(module->comm), |
| 255 | + ompi_process_info.nodename) < 0) { |
| 256 | + return OMPI_ERR_OUT_OF_RESOURCE; |
| 257 | + } |
| 258 | + |
| 259 | + ret = opal_shmem_segment_create (&module->seg_ds, data_file, total + pagesize + state_size + posts_size); |
| 260 | + free(data_file); |
| 261 | + if (OPAL_SUCCESS != ret) { |
| 262 | + goto error; |
| 263 | + } |
| 264 | + } |
264 | 265 |
|
265 | 266 | ret = module->comm->c_coll.coll_bcast (&module->seg_ds, sizeof (module->seg_ds), MPI_BYTE, 0, |
266 | 267 | module->comm, module->comm->c_coll.coll_bcast_module); |
|
0 commit comments