diff options
author | Thomas Radke <tradke@aei.mpg.de> | 2006-02-12 20:00:00 +0000 |
---|---|---|
committer | Thomas Radke <tradke@aei.mpg.de> | 2006-02-12 20:00:00 +0000 |
commit | 67daef6ba786b90af045d39fa3f1759f2203ff0e (patch) | |
tree | d2167f74a0f5b89dd0ecdef27ada38033c292725 /Carpet/CarpetIOHDF5/src/Input.cc | |
parent | 6aa1577bbab3a9f02bd45b91980d58f5640406b1 (diff) |
CarpetIOHDF5: more efficient recovery with same number of processors
This patch introduces some optimisation for the case when recovering with the
same number of processors as used during the checkpoint: each processor
opens only its own chunked file and reads its metadata, skipping all others.
darcs-hash:20060212200032-776a0-3dd501d20b8efb66faa715b401038218bb388b4f.gz
Diffstat (limited to 'Carpet/CarpetIOHDF5/src/Input.cc')
-rw-r--r-- | Carpet/CarpetIOHDF5/src/Input.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Carpet/CarpetIOHDF5/src/Input.cc b/Carpet/CarpetIOHDF5/src/Input.cc index 2729565c9..505e92e7b 100644 --- a/Carpet/CarpetIOHDF5/src/Input.cc +++ b/Carpet/CarpetIOHDF5/src/Input.cc @@ -247,6 +247,14 @@ int Recover (cGH* cctkGH, const char *basefilename, int called_from) // loop over all input files of this set for (unsigned int i = 0; i < fileset->files.size(); i++) { + + // some optimisation for the case when recovering on the same number + // of processors as during the checkpoint: + // read only this processor's chunked file, skip all others + if (fileset->nioprocs == dist::size() and i > 0) { + break; + } + const int file_idx = (i + fileset->first_ioproc) % fileset->nioprocs; file_t& file = fileset->files[file_idx]; |