--- trunk/src/brains/BlockSnapshotManager.cpp 2013/06/16 15:15:42 1879 +++ trunk/src/brains/BlockSnapshotManager.cpp 2014/01/24 14:17:42 1966 @@ -67,8 +67,13 @@ namespace OpenMD { // RealType avaliablePhysMem = physMem - rssMem; int bytesPerStuntDouble = DataStorage::getBytesPerStuntDouble(storageLayout); - int bytesPerFrame = (nRigidBodies_ + nAtoms_) * bytesPerStuntDouble; + int bytesPerCutoffGroup = DataStorage::getBytesPerStuntDouble(DataStorage::dslPosition); + int bytesPerFrameData = Snapshot::getFrameDataSize(); + int bytesPerFrame = (nRigidBodies_ + nAtoms_) * bytesPerStuntDouble + + nCutoffGroups_ * bytesPerCutoffGroup + + bytesPerFrameData; + // total number of frames that can fit in memory //RealType frameCapacity = avaliablePhysMem / bytesPerFrame; RealType frameCapacity = (RealType) memSize_ / (RealType) bytesPerFrame; @@ -76,6 +81,9 @@ namespace OpenMD { // number of frames in each block given the need to hold multiple blocks // in memory at the same time: nSnapshotPerBlock_ = int(frameCapacity) / blockCapacity_; + if (nSnapshotPerBlock_ <= 0) { + std::cerr << "not enough memory to hold two configs!" << std::endl; + } reader_ = new DumpReader(info, filename); nframes_ = reader_->getNFrames(); int nblocks = nframes_ / nSnapshotPerBlock_; @@ -91,20 +99,33 @@ namespace OpenMD { snapshots_.insert(snapshots_.begin(), nframes_, static_cast(NULL)); - std::cout << "-----------------------------------------------------"<