--- trunk/src/brains/BlockSnapshotManager.cpp 2012/08/31 21:16:10 1793 +++ trunk/src/brains/BlockSnapshotManager.cpp 2014/01/24 13:53:41 1965 @@ -35,7 +35,7 @@ * * [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). * [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). - * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). + * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008). * [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). */ @@ -67,7 +67,9 @@ namespace OpenMD { // RealType avaliablePhysMem = physMem - rssMem; int bytesPerStuntDouble = DataStorage::getBytesPerStuntDouble(storageLayout); - int bytesPerFrame = (nRigidBodies_ + nAtoms_) * bytesPerStuntDouble; + int bytesPerCutoffGroup = DataStorage::getBytesPerStuntDouble(DataStorage::dslPosition); + int bytesPerFrame = (nRigidBodies_ + nAtoms_) * bytesPerStuntDouble + + nCutoffGroups_ * bytesPerCutoffGroup; // total number of frames that can fit in memory //RealType frameCapacity = avaliablePhysMem / bytesPerFrame; @@ -76,6 +78,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_; @@ -99,6 +104,7 @@ namespace OpenMD { //std::cout << "Memory available for OpenMD:\t" << (unsigned long)avaliablePhysMem << " bytes" <setID(frame); snapshot->clearDerivedProperties(); - /** @todo fixed me */ currentSnapshot_ = snapshot; reader_->readFrame(frame);