From 67daef6ba786b90af045d39fa3f1759f2203ff0e Mon Sep 17 00:00:00 2001 From: Thomas Radke Date: Sun, 12 Feb 2006 20:00:00 +0000 Subject: 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 --- Carpet/CarpetIOHDF5/src/Input.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Carpet/CarpetIOHDF5/src/Input.cc') 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]; -- cgit v1.2.3