From 5dd6c5204bb05428c898bf8ba6df2e83df2ce47f Mon Sep 17 00:00:00 2001 From: Nathan Hjelm Date: Wed, 11 Jul 2018 13:37:23 -0600 Subject: [PATCH] osc/sm: avoid filename collision when multiple windows share same CID This commit fixes an issue identified by MTT where we can have two different sets of processes on the same node creating a shared memory window with communicators sharing the same CID. To avoid this issue the temporary filename now includes the creating processes vpid. References #5363 Signed-off-by: Nathan Hjelm --- ompi/mca/osc/sm/osc_sm_component.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ompi/mca/osc/sm/osc_sm_component.c b/ompi/mca/osc/sm/osc_sm_component.c index 15cf5d51333..de891e71a11 100644 --- a/ompi/mca/osc/sm/osc_sm_component.c +++ b/ompi/mca/osc/sm/osc_sm_component.c @@ -282,9 +282,9 @@ component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit posts_size += OPAL_ALIGN_PAD_AMOUNT(posts_size, 64); if (0 == ompi_comm_rank (module->comm)) { char *data_file; - ret = asprintf (&data_file, "%s" OPAL_PATH_SEP "osc_sm.%s.%x.%d", - mca_osc_sm_component.backing_directory, ompi_process_info.nodename, - OMPI_PROC_MY_NAME->jobid, ompi_comm_get_cid(module->comm)); + ret = asprintf (&data_file, "%s" OPAL_PATH_SEP "osc_sm.%s.%x.%d.%d", + mca_osc_sm_component.backing_directory, ompi_process_info.nodename, + OMPI_PROC_MY_NAME->jobid, (int) OMPI_PROC_MY_NAME->vpid, ompi_comm_get_cid(module->comm)); if (ret < 0) { return OMPI_ERR_OUT_OF_RESOURCE; }