--- branches/development/src/brains/BlockSnapshotManager.cpp 2010/07/09 23:08:25 1465 +++ branches/development/src/brains/BlockSnapshotManager.cpp 2011/09/14 21:15:17 1629 @@ -40,32 +40,37 @@ */ #include #include "brains/BlockSnapshotManager.hpp" -#include "utils/residentMem.h" -#include "utils/physmem.h" +//#include "utils/residentMem.h" +//#include "utils/physmem.h" #include "utils/Algorithm.hpp" #include "brains/SimInfo.hpp" #include "io/DumpReader.hpp" namespace OpenMD { - BlockSnapshotManager::BlockSnapshotManager(SimInfo* info, const std::string& filename, - int storageLayout, int blockCapacity) - : SnapshotManager(storageLayout), info_(info), blockCapacity_(blockCapacity), - activeBlocks_(blockCapacity_, -1), activeRefCount_(blockCapacity_, 0) { + BlockSnapshotManager::BlockSnapshotManager(SimInfo* info, + const std::string& filename, + int storageLayout, + long long int memSize, + int blockCapacity) + : SnapshotManager(storageLayout), info_(info), memSize_(memSize), + blockCapacity_(blockCapacity), activeBlocks_(blockCapacity_, -1), + activeRefCount_(blockCapacity_, 0) { nAtoms_ = info->getNGlobalAtoms(); nRigidBodies_ = info->getNGlobalRigidBodies(); + nCutoffGroups_ = info->getNCutoffGroups(); - RealType physMem = physmem_total(); - RealType rssMem = residentMem(); - RealType avaliablePhysMem = physMem - rssMem; - + // eliminate suspect calls to figure out free memory: + // RealType physMem = physmem_total(); + // RealType rssMem = residentMem(); + // RealType avaliablePhysMem = physMem - rssMem; int bytesPerStuntDouble = DataStorage::getBytesPerStuntDouble(storageLayout); - int bytesPerFrame = (nRigidBodies_ + nAtoms_) * bytesPerStuntDouble; // total number of frames that can fit in memory - RealType frameCapacity = avaliablePhysMem / bytesPerFrame; + //RealType frameCapacity = avaliablePhysMem / bytesPerFrame; + RealType frameCapacity = memSize_ / bytesPerFrame; // number of frames in each block given the need to hold multiple blocks // in memory at the same time: @@ -88,9 +93,10 @@ namespace OpenMD { std::cout << "-----------------------------------------------------"<setID(frame); /** @todo fixed me */