Skip to content

Commit f2d1b83

Browse files
committed
pfasst: Make sure num of procs and time steps are consistent.
Signed-off-by: Matthew Emmett <[email protected]>
1 parent 8eb0c97 commit f2d1b83

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/pfasst/controller/pfasst_impl.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,15 @@ namespace pfasst
4747
int nblocks = int(this->get_end_time() / this->get_time_step()) / comm->size();
4848

4949
if (nblocks == 0) {
50+
LOG(INFO) << "invalid duration: there are more time processors than time steps";
5051
throw ValueError("invalid duration: there are more time processors than time steps");
5152
}
5253

54+
if (nblocks * comm->size() * this->get_time_step() < this->get_end_time()) {
55+
LOG(INFO) << "invalid duration: mismatch between number of time processors and time steps";
56+
throw ValueError("invalid duration: mismatch between number of time processors and time steps");
57+
}
58+
5359
for (int nblock = 0; nblock < nblocks; nblock++) {
5460
this->set_step(nblock * comm->size() + comm->rank());
5561

0 commit comments

Comments
 (0)