File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -879,8 +879,14 @@ def iterk_loop(self):
879
879
if dconvergence_detail :
880
880
self .report_var_values_at_rank0 (header = "Convergence detail:" )
881
881
882
- if (self ._PHIter == max_iterations ):
883
- global_toc ("Reached user-specified limit=%d on number of PH iterations" % max_iterations , self .cylinder_rank == 0 )
882
+ else : # no break, (self._PHIter == max_iterations)
883
+ # NOTE: If we return for any other reason things are reasonably in-sync.
884
+ # due to the convergence check. However, here we return we'll be
885
+ # out-of-sync because of the solve_loop could take vasty different
886
+ # times on different threads. This can especially mess up finalization.
887
+ # As a guard, we'll put a barrier here.
888
+ self .mpicomm .Barrier ()
889
+ global_toc ("Reached user-specified limit=%d on number of PH iterations" % max_iterations , self .cylinder_rank == 0 )
884
890
885
891
886
892
def post_loops (self , extensions = None ):
You can’t perform that action at this time.
0 commit comments