diff --git a/asQ/preconditioners/circulantpc.py b/asQ/preconditioners/circulantpc.py index 4ac1bf76..bccb89db 100644 --- a/asQ/preconditioners/circulantpc.py +++ b/asQ/preconditioners/circulantpc.py @@ -265,6 +265,8 @@ def initialize(self, pc): self.block_solvers.append(block_solver) + self.first_solve = True + self.initialized = True @profiler() @@ -360,6 +362,9 @@ def apply_impl(self, pc, x, y): # Do the block solves + if self.first_solve and self.ensemble.ensemble_comm.rank > 0: + self.ensemble.global_comm.Barrier() + with PETSc.Log.Event("asQ.diag_preconditioner.CirculantPC.apply.block_solves"): for i in range(self.nlocal_timesteps): # copy the data into solver input @@ -377,6 +382,14 @@ def apply_impl(self, pc, x, y): cpx.get_real(self.block_sol, self.xfr[i]) cpx.get_imag(self.block_sol, self.xfi[i]) + if self.first_solve and self.ensemble.ensemble_comm.rank == 0: + self.ensemble.global_comm.Barrier() + + if self.first_solve: + self.ensemble.global_comm.Barrier() + + self.first_solve = False + ###################### # Undiagonalise - Copy, transfer, IFFT, transfer, scale, copy # get array of basis coefficients