From 5bf85ed45bbc3aa115bde260b65f66c82d7e7c18 Mon Sep 17 00:00:00 2001 From: Jerome Jackson Date: Wed, 15 Jan 2025 18:40:28 +0000 Subject: [PATCH] fixes bug in parallel checkpoint read edge cases allow u_matrix_opt to be uninitialised on non-root ranks fixed by broadcasting at read always --- src/readwrite.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/readwrite.F90 b/src/readwrite.F90 index be693b18..e573be54 100644 --- a/src/readwrite.F90 +++ b/src/readwrite.F90 @@ -2434,11 +2434,8 @@ subroutine w90_readwrite_chkpt_dist(dis_manifold, wannier_data, u_matrix, u_matr return endif endif - end if - call comms_bcast(u_matrix_opt(1, 1, 1), num_bands*num_wann*num_kpts, error, comm) - if (allocated(error)) return call comms_bcast(dis_manifold%lwindow(1, 1), num_bands*num_kpts, error, comm) if (allocated(error)) return call comms_bcast(dis_manifold%ndimwin(1), num_kpts, error, comm) @@ -2446,6 +2443,9 @@ subroutine w90_readwrite_chkpt_dist(dis_manifold, wannier_data, u_matrix, u_matr call comms_bcast(omega_invariant, 1, error, comm) if (allocated(error)) return end if + + call comms_bcast(u_matrix_opt(1, 1, 1), num_bands*num_wann*num_kpts, error, comm) + if (allocated(error)) return call comms_bcast(wannier_data%centres(1, 1), 3*num_wann, error, comm) if (allocated(error)) return call comms_bcast(wannier_data%spreads(1), num_wann, error, comm)