ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/brains/BlockSnapshotManager.cpp
(Generate patch)

Comparing trunk/src/brains/BlockSnapshotManager.cpp (file contents):
Revision 1879 by gezelter, Sun Jun 16 15:15:42 2013 UTC vs.
Revision 1964 by gezelter, Thu Jan 16 16:00:43 2014 UTC

# Line 76 | Line 76 | namespace OpenMD {
76        // number of frames in each block given the need to hold multiple blocks
77        // in memory at the same time:
78        nSnapshotPerBlock_ = int(frameCapacity) / blockCapacity_;
79 +      if (nSnapshotPerBlock_ <= 0) {
80 +       std::cerr << "not enough memory to hold two configs!" << std::endl;
81 +      }
82        reader_ = new DumpReader(info, filename);
83        nframes_ = reader_->getNFrames();
84        int nblocks = nframes_ / nSnapshotPerBlock_;
# Line 175 | Line 178 | namespace OpenMD {
178          //in case, unloadBlock called multiple times
179          activeRefCount_[i - activeBlocks_.begin()]  = 0;
180        }
181 +
182 +      if (activeRefCount_[i-activeBlocks_.begin()] == 0) {
183 +        internalUnload(block);
184 +      }
185          
186        unloadSuccess = true;
187      } else {
# Line 198 | Line 205 | namespace OpenMD {
205    }
206  
207    void BlockSnapshotManager::internalUnload(int block) {
208 +    std::cerr << "called internal unload for block "<< block << "\n";
209      for (int i = blocks_[block].first; i < blocks_[block].second; ++i) {
210        delete snapshots_[i];
211        snapshots_[i] = NULL;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines