[cig-commits] commit 2001 by heien to /var/svn/dealii/aspect
dealii.demon at gmail.com
dealii.demon at gmail.com
Fri Nov 1 15:28:02 PDT 2013
Revision 2001
Changed checkpointing serialization to run on all processes (though still only output on process 0)
U trunk/aspect/source/simulator/checkpoint_restart.cc
http://www.dealii.org/websvn/revision.php?repname=Aspect+Repository&path=%2F&rev=2001&peg=2001
Diff:
Modified: trunk/aspect/source/simulator/checkpoint_restart.cc
===================================================================
--- trunk/aspect/source/simulator/checkpoint_restart.cc 2013-10-31 15:31:22 UTC (rev 2000)
+++ trunk/aspect/source/simulator/checkpoint_restart.cc 2013-11-01 22:27:08 UTC (rev 2001)
@@ -91,16 +91,17 @@
}
// save general information
- if (my_id == 0)
- {
- std::ostringstream oss;
- // serialize into a stringstream
- {
+ // This calls the serialization functions on all processes,
+ // but only writes to the restart.resume.z file on process 0
+ {
+ std::ostringstream oss;
- aspect::oarchive oa (oss);
- oa << (*this);
- }
- //compress with zlib and write to file
+ // serialize into a stringstream
+ aspect::oarchive oa (oss);
+ oa << (*this);
+
+ //compress with zlib and write to file
+ if (my_id == 0)
{
uLongf compressed_data_length = compressBound (oss.str().length());
std::vector<char *> compressed_data (compressed_data_length);
@@ -124,7 +125,7 @@
f.write((char *)&compressed_data[0], compressed_data_length);
}
- }
+ }
pcout << "*** Snapshot created!" << std::endl << std::endl;
computing_timer.exit_section();
}
More information about the CIG-COMMITS
mailing list