From 954e38bebe5456e072f906a35f2a23b30bd651b5 Mon Sep 17 00:00:00 2001 From: paboyle Date: Tue, 20 Mar 2018 18:16:15 +0000 Subject: [PATCH] Put a username in the path --- lib/communicator/SharedMemoryMPI.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/communicator/SharedMemoryMPI.cc b/lib/communicator/SharedMemoryMPI.cc index 1fa84dfb..8eebdc0f 100644 --- a/lib/communicator/SharedMemoryMPI.cc +++ b/lib/communicator/SharedMemoryMPI.cc @@ -27,6 +27,7 @@ Author: Peter Boyle /* END LEGAL */ #include +#include namespace Grid { @@ -288,7 +289,8 @@ void GlobalSharedMemory::SharedMemoryAllocate(uint64_t bytes, int flags) size_t size = bytes; - sprintf(shm_name,"/myGrid_mpi3_shm_%d_%d",WorldNode,r); + struct passwd *pw = getpwuid (getuid()); + sprintf(shm_name,"/Grid_%s_mpi3_shm_%d_%d",pw->pw_name,WorldNode,r); shm_unlink(shm_name); int fd=shm_open(shm_name,O_RDWR|O_CREAT,0666);