Skip to content

Commit

Permalink
Merge pull request wannier-developers#283 from giovannipizzi/fix_278_…
Browse files Browse the repository at this point in the history
…restart

Gathering matrices before dumping chk file
  • Loading branch information
jryates authored Jul 25, 2019
2 parents 8e1adc0 + 7635cfc commit 2157497
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/parameters.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3760,6 +3760,9 @@ subroutine param_write_chkpt(chkpt)
!! Write checkpoint file
!! IMPORTANT! If you change the chkpt format, adapt
!! accordingly also the w90chk2chk.x utility!
!! Also, note that this routine writes the u_matrix and the m_matrix - in parallel
!! mode these are however stored in distributed form in, e.g., u_matrix_loc only, so
!! if you are changing the u_matrix, remember to gather it from u_matrix_loc first!
!=================================================!

use w90_io, only: io_file_unit, io_date, seedname
Expand Down
12 changes: 11 additions & 1 deletion src/wannierise.F90
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,17 @@ subroutine wann_main
!omega_tilde = wann_spread%om_d + wann_spread%om_nu
end if

if (ldump .and. on_root) call param_write_chkpt('postdis')
if (ldump) then
! Before calling param_write_chkpt, I need to gather on the root node
! the u_matrix from the u_matrix_loc. No need to broadcast it since
! it's printed by the root node only
call comms_gatherv(u_matrix_loc, num_wann*num_wann*counts(my_node_id), &
u_matrix, num_wann*num_wann*counts, num_wann*num_wann*displs)
! I also transfer the M matrix
call comms_gatherv(m_matrix_loc, num_wann*num_wann*nntot*counts(my_node_id), &
m_matrix, num_wann*num_wann*nntot*counts, num_wann*num_wann*nntot*displs)
if (on_root) call param_write_chkpt('postdis')
endif

if (conv_window .gt. 1) call internal_test_convergence()

Expand Down

0 comments on commit 2157497

Please sign in to comment.