From 4261d7308168e8a69a3072c6bb7f30d8725a541c Mon Sep 17 00:00:00 2001 From: Luke Shingles Date: Sat, 8 Mar 2025 07:17:36 +0000 Subject: [PATCH] Update sn3d.cc --- sn3d.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sn3d.cc b/sn3d.cc index 67f51a9f8..1e2552db4 100644 --- a/sn3d.cc +++ b/sn3d.cc @@ -872,7 +872,7 @@ auto main(int argc, char *argv[]) -> int { // initialise or read in virtual packet spectra vpkt_init(globals::timestep, my_rank, globals::simulation_continued_from_saved); - while (globals::timestep < globals::timestep_finish && !terminate_early) { + while (globals::timestep < std::min(globals::timestep_finish, globals::ntimesteps - 1) && !terminate_early) { MPI_Barrier(MPI_COMM_WORLD); // titer example: Do 3 iterations on timestep 0-6