From 94d1ae4c8251f053762dee872e9db90ee919d096 Mon Sep 17 00:00:00 2001 From: paboyle Date: Wed, 13 Jun 2018 20:24:06 +0100 Subject: [PATCH] Some prep work for GPU shared memory. Need to be careful, as will try GPU direct RDMA and inter-GPU memory sharing on SUmmit later --- lib/communicator/SharedMemoryMPI.cc | 46 +++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/lib/communicator/SharedMemoryMPI.cc b/lib/communicator/SharedMemoryMPI.cc index 4b74f3e9..4a288979 100644 --- a/lib/communicator/SharedMemoryMPI.cc +++ b/lib/communicator/SharedMemoryMPI.cc @@ -42,9 +42,14 @@ void GlobalSharedMemory::Init(Grid_MPI_Comm comm) ///////////////////////////////////////////////////////////////////// // Split into groups that can share memory ///////////////////////////////////////////////////////////////////// +#ifdef GRID_NVCC + MPI_Comm_split(comm, WorldRank , 0,&WorldShmComm); +#else MPI_Comm_split_type(comm, MPI_COMM_TYPE_SHARED, 0, MPI_INFO_NULL,&WorldShmComm); +#endif MPI_Comm_rank(WorldShmComm ,&WorldShmRank); MPI_Comm_size(WorldShmComm ,&WorldShmSize); + std::cout << " Shared communicator of size " <