Skip to content

Commit

Permalink
Merge pull request #500 from sjhong6230/chkpt
Browse files Browse the repository at this point in the history
Fixed bug in writing checkpoint file in parallel mode
  • Loading branch information
JeromeCCP9 authored Jun 24, 2024
2 parents cf7f915 + e73b482 commit 829f9f6
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/wannier_prog.F90
Original file line number Diff line number Diff line change
Expand Up @@ -645,19 +645,15 @@ subroutine write_chkpt(common_data, label, istdout, istderr, ierr)
return
endif

u(:, :, :) = 0.d0
uopt(:, :, :) = 0.d0
u(:, :, :) = common_data%u_matrix
uopt(:, :, :) = common_data%u_opt
m(:, :, :, :) = 0.d0

do ikl = 1, nkrank
ikg = global_k(ikl)
u(:, :, ikg) = common_data%u_matrix(:, :, ikl)
uopt(:, :, ikg) = common_data%u_opt(:, :, ikl)
m(:, :, :, ikg) = common_data%m_matrix_local(1:nw, 1:nw, :, ikl)
enddo

call comms_reduce(u(1, 1, 1), nw*nw*nk, 'SUM', error, common_data%comm)
call comms_reduce(uopt(1, 1, 1), nb*nw*nk, 'SUM', error, common_data%comm)
call comms_reduce(m(1, 1, 1, 1), nw*nw*nn*nk, 'SUM', error, common_data%comm)
if (allocated(error)) then
call prterr(error, ierr, istdout, istderr, common_data%comm)
Expand Down

0 comments on commit 829f9f6

Please sign in to comment.