Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions asQ/preconditioners/circulantpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@ def initialize(self, pc):

self.block_solvers.append(block_solver)

self.first_solve = True

self.initialized = True

@profiler()
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading