Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stat db gpu improvments #125

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions Hadrons/StatLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,11 @@ void StatLogger::setDatabase(Database &db)
" deviceMemory.totalCurrent*0.000000953674316 AS totalCurrentMB, "
" deviceMemory.envCurrent*0.000000953674316 AS envCurrentMB, "
" deviceMemory.gridCurrent*0.000000953674316 AS gridCurrentMB, "
" deviceMemory.gridCommsCurrent*0.000000953674316 AS gridCommsCurrentMB, "
" deviceMemory.gridCacheCurrent*0.000000953674316 AS gridCacheCurrentMB, "
" deviceMemory.gridTotalCurrent*0.000000953674316 AS gridTotalCurrentMB, "
" deviceMemory.evictableCurrent*0.000000953674316 AS evictableCurrentMB, "
" (deviceMemory.totalCurrent-deviceMemory.gridTotalCurrent)*0.000000953674316 AS gridDeficitCurrentMB, "
" deviceMemory.hostToDevice*0.000000953674316 AS hostToDeviceMB, "
" deviceMemory.hostToDevice*0.000000953674316/" + periodSec + " AS hostToDeviceMBps, "
" deviceMemory.hostToDeviceTransfers AS hostToDeviceTransfers, "
Expand Down Expand Up @@ -195,12 +197,18 @@ void StatLogger::logDeviceMemory(const GridTime::rep time)
Mem buf;
DeviceMemoryEntry e;

size_t free_byte=0;
size_t total_byte=0;
#ifdef GRID_CUDA_NOUVM
cudaMemGetInfo( &free_byte, &total_byte ) ;
#endif
e.time = time;
e.totalCurrent = 0;
e.totalCurrent = total_byte-free_byte;
e.envCurrent = 0;
e.gridCurrent = MemoryManager::DeviceBytes;
e.gridCacheCurrent = MemoryManager::DeviceCacheBytes();
e.gridTotalCurrent = e.gridCurrent + e.gridCacheCurrent;
e.gridCommsCurrent = GlobalSharedMemory::MAX_MPI_SHM_BYTES;
e.gridTotalCurrent = e.gridCurrent + e.gridCacheCurrent + e.gridCommsCurrent;
e.evictableCurrent = MemoryManager::DeviceLRUBytes;
buf.h2d = MemoryManager::HostToDeviceBytes;
buf.h2dTr = MemoryManager::HostToDeviceXfer;
Expand Down
1 change: 1 addition & 0 deletions Hadrons/StatLogger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class StatLogger
SqlNotNull<size_t>, envCurrent,
SqlNotNull<size_t>, gridCurrent,
SqlNotNull<size_t>, gridCacheCurrent,
SqlNotNull<size_t>, gridCommsCurrent,
SqlNotNull<size_t>, gridTotalCurrent,
SqlNotNull<size_t>, evictableCurrent,
SqlNotNull<size_t>, hostToDevice,
Expand Down