@@ -30,6 +30,8 @@ def __init__(self, num_procs, controller_params, description):
3030 for p in range (num_procs ):
3131 self .MS .append (stepclass .step (description ))
3232
33+ assert not (len (self .MS ) > 1 and len (self .MS [0 ].levels ) == 1 ), "ERROR: classic cannot do MSSDC"
34+
3335 if self .params .dump_setup :
3436 self .dump_setup (step = self .MS [0 ], controller_params = controller_params , description = description )
3537
@@ -144,7 +146,7 @@ def restart_block(self, active_slots, time, u0):
144146 # reset some values
145147 self .MS [p ].status .done = False
146148 self .MS [p ].status .pred_cnt = active_slots .index (p ) + 1
147- self .MS [p ].status .iter = 1
149+ self .MS [p ].status .iter = 0
148150 self .MS [p ].status .stage = 'SPREAD'
149151 for l in self .MS [p ].levels :
150152 l .tag = False
@@ -293,7 +295,7 @@ def pfasst(self, S, num_procs):
293295
294296 # update stage and return
295297 self .hooks .pre_iteration (step = S , level_number = 0 )
296- S .status .stage = 'IT_FINE_SWEEP '
298+ S .status .stage = 'IT_CHECK '
297299 return S
298300
299301 elif stage == 'IT_FINE_SWEEP' :
@@ -321,7 +323,10 @@ def pfasst(self, S, num_procs):
321323 self .logger .debug ('Process %2i provides data on level %2i with tag %s'
322324 % (S .status .slot , 0 , True ))
323325 self .send (S .levels [0 ], tag = True )
324- S .status .stage = 'IT_CHECK'
326+ if len (S .levels ) > 1 :
327+ S .status .stage = 'IT_UP'
328+ else : # SDC
329+ S .status .stage = 'IT_CHECK'
325330 else :
326331 S .status .stage = 'IT_FINE_SEND'
327332 # return
@@ -331,10 +336,12 @@ def pfasst(self, S, num_procs):
331336
332337 # check whether to stop iterating
333338
334- self .hooks .post_iteration (step = S , level_number = 0 )
335-
339+ S .levels [0 ].sweep .compute_residual ()
336340 S .status .done = self .check_convergence (S )
337341
342+ if S .status .iter > 0 :
343+ self .hooks .post_iteration (step = S , level_number = 0 )
344+
338345 # if the previous step is still iterating but I am done, un-do me to still forward values
339346 if not S .status .first and S .status .done and (S .prev .status .done is not None and not S .prev .status .done ):
340347 S .status .done = False
@@ -348,12 +355,7 @@ def pfasst(self, S, num_procs):
348355 # increment iteration count here (and only here)
349356 S .status .iter += 1
350357 self .hooks .pre_iteration (step = S , level_number = 0 )
351- if len (S .levels ) > 1 :
352- S .status .stage = 'IT_UP'
353- elif num_procs > 1 : # MSSDC
354- S .status .stage = 'IT_COARSE_RECV'
355- elif num_procs == 1 : # SDC
356- S .status .stage = 'IT_FINE_SWEEP'
358+ S .status .stage = 'IT_FINE_SWEEP'
357359 # return
358360 return S
359361
@@ -475,7 +477,7 @@ def pfasst(self, S, num_procs):
475477 self .hooks .post_sweep (step = S , level_number = l - 1 )
476478
477479 # update stage and return
478- S .status .stage = 'IT_FINE_SWEEP '
480+ S .status .stage = 'IT_CHECK '
479481 return S
480482
481483 else :
0 commit comments