mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-25 21:25:56 +01:00
create separate InitMessage for MemoryManager that can be called after communicator setup
This commit is contained in:
parent
ddbb008694
commit
6365a89ba3
@ -137,9 +137,13 @@ void MemoryManager::Init(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// only root node delivers messages, this is called before communicator is initialized,
|
}
|
||||||
// so need a manual restriction
|
|
||||||
if ( CartesianCommunicator::RankWorld() == 0 ) {
|
void MemoryManager::InitMessage(void) {
|
||||||
|
#ifndef GRID_UVM
|
||||||
|
std::cout << GridLogMessage << "MemoryManager Cache "<< MemoryManager::DeviceMaxBytes <<" bytes "<<std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
std::cout << GridLogMessage<< "MemoryManager::Init() setting up"<<std::endl;
|
std::cout << GridLogMessage<< "MemoryManager::Init() setting up"<<std::endl;
|
||||||
#ifdef ALLOCATION_CACHE
|
#ifdef ALLOCATION_CACHE
|
||||||
std::cout << GridLogMessage<< "MemoryManager::Init() cache pool for recent allocations: SMALL "<<Ncache[CpuSmall]<<" LARGE "<<Ncache[Cpu]<<std::endl;
|
std::cout << GridLogMessage<< "MemoryManager::Init() cache pool for recent allocations: SMALL "<<Ncache[CpuSmall]<<" LARGE "<<Ncache[Cpu]<<std::endl;
|
||||||
@ -168,7 +172,7 @@ void MemoryManager::Init(void)
|
|||||||
std::cout << GridLogMessage<< "MemoryManager::Init() Using SYCL malloc_device"<<std::endl;
|
std::cout << GridLogMessage<< "MemoryManager::Init() Using SYCL malloc_device"<<std::endl;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void *MemoryManager::Insert(void *ptr,size_t bytes,int type)
|
void *MemoryManager::Insert(void *ptr,size_t bytes,int type)
|
||||||
|
@ -98,6 +98,7 @@ private:
|
|||||||
static void PrintBytes(void);
|
static void PrintBytes(void);
|
||||||
public:
|
public:
|
||||||
static void Init(void);
|
static void Init(void);
|
||||||
|
static void InitMessage(void);
|
||||||
static void *SharedAllocate(size_t bytes);
|
static void *SharedAllocate(size_t bytes);
|
||||||
static void SharedFree (void *ptr,size_t bytes);
|
static void SharedFree (void *ptr,size_t bytes);
|
||||||
static void *CpuAllocate(size_t bytes);
|
static void *CpuAllocate(size_t bytes);
|
||||||
|
@ -377,9 +377,7 @@ void Grid_init(int *argc,char ***argv)
|
|||||||
std::cout << GridLogMessage << "Mapped stencil comms buffers as MAP_HUGETLB "<<std::endl;
|
std::cout << GridLogMessage << "Mapped stencil comms buffers as MAP_HUGETLB "<<std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef GRID_UVM
|
MemoryManager::InitMessage();
|
||||||
std::cout << GridLogMessage << "MemoryManager Cache "<< MemoryManager::DeviceMaxBytes <<" bytes "<<std::endl;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if( GridCmdOptionExists(*argv,*argv+*argc,"--debug-mem") ){
|
if( GridCmdOptionExists(*argv,*argv+*argc,"--debug-mem") ){
|
||||||
MemoryProfiler::debug = true;
|
MemoryProfiler::debug = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user