/************************************************************************************* Grid physics library, www.github.com/paboyle/Grid Source file: ./lib/communicator/SharedMemory.cc Copyright (C) 2015 Author: Peter Boyle This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ #include NAMESPACE_BEGIN(Grid); #define header "SharedMemoryNone: " /*Construct from an MPI communicator*/ void GlobalSharedMemory::Init(Grid_MPI_Comm comm) { assert(_ShmSetup==0); WorldComm = 0; WorldRank = 0; WorldSize = 1; WorldShmComm = 0 ; WorldShmRank = 0 ; WorldShmSize = 1 ; WorldNodes = 1 ; WorldNode = 0 ; WorldShmRanks.resize(WorldSize); WorldShmRanks[0] = 0; WorldShmCommBufs.resize(1); _ShmSetup=1; } void GlobalSharedMemory::OptimalCommunicator(const Coordinate &processors,Grid_MPI_Comm & optimal_comm,Coordinate &SHM) { optimal_comm = WorldComm; SHM = Coordinate(processors.size(),1); } //////////////////////////////////////////////////////////////////////////////////////////// // Hugetlbfs mapping intended, use anonymous mmap //////////////////////////////////////////////////////////////////////////////////////////// #if 1 void GlobalSharedMemory::SharedMemoryAllocate(uint64_t bytes, int flags) { std::cout << header "SharedMemoryAllocate "<< bytes<< " GPU implementation "<