--- trunk/src/brains/BlockSnapshotManager.cpp 2009/11/25 20:02:06 1390 +++ trunk/src/brains/BlockSnapshotManager.cpp 2011/07/25 17:30:53 1596 @@ -40,32 +40,38 @@ */ #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(); - 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 +94,10 @@ namespace OpenMD { std::cout << "-----------------------------------------------------"<