--- trunk/OOPSE-2.0/src/brains/BlockSnapshotManager.cpp 2005/02/16 20:43:10 2039 +++ trunk/OOPSE-2.0/src/brains/BlockSnapshotManager.cpp 2005/04/15 22:04:00 2204 @@ -47,47 +47,48 @@ BlockSnapshotManager::BlockSnapshotManager(SimInfo* in #include "io/DumpReader.hpp" namespace oopse { -BlockSnapshotManager::BlockSnapshotManager(SimInfo* info, const std::string& filename, - int storageLayout, int blockCapacity) + BlockSnapshotManager::BlockSnapshotManager(SimInfo* info, const std::string& filename, + int storageLayout, int blockCapacity) : SnapshotManager(storageLayout), info_(info), blockCapacity_(blockCapacity), activeBlocks_(blockCapacity_, -1), activeRefCount_(blockCapacity_, 0) { - nAtoms_ = info->getNGlobalAtoms(); - nRigidBodies_ = info->getNGlobalRigidBodies(); + nAtoms_ = info->getNGlobalAtoms(); + nRigidBodies_ = info->getNGlobalRigidBodies(); - double physMem = physmem_total(); - double rssMem = residentMem(); - double avaliablePhysMem = physMem - rssMem; + double physMem = physmem_total(); + double rssMem = residentMem(); + double avaliablePhysMem = physMem - rssMem; - std::cout << "physmem = " << int(physMem) << "\trssMem = "<< rssMem << "\t availablePhysMem = " << avaliablePhysMem <getNFrames(); - reader_ = new DumpReader(info, filename); - nframes_ = reader_->getNFrames(); - - int nblocks = nframes_ / nSnapshotPerBlock_; - if (nframes_ % nSnapshotPerBlock_ != 0) { + int nblocks = nframes_ / nSnapshotPerBlock_; + if (nframes_ % nSnapshotPerBlock_ != 0) { ++nblocks; - } + } - for (int i = 0; i < nblocks; ++i) { + for (int i = 0; i < nblocks; ++i) { blocks_.push_back(SnapshotBlock(i*nSnapshotPerBlock_, (i+1)*nSnapshotPerBlock_)); - } - //the last block may not have nSnapshotPerBlock frames, we need to consider this special situation - blocks_.back().second = nframes_; + } + //the last block may not have nSnapshotPerBlock frames, we need to consider this special situation + blocks_.back().second = nframes_; - snapshots_.insert(snapshots_.begin(), nframes_, static_cast(NULL)); + snapshots_.insert(snapshots_.begin(), nframes_, static_cast(NULL)); + + std::cout << "physmem = " << int(physMem) << "\trssMem = "<< int(rssMem) << "\t availablePhysMem = " << int(avaliablePhysMem) <