Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gathering matrices before dumping chk file #283

Merged
merged 1 commit into from
Jul 25, 2019

Conversation

giovannipizzi
Copy link
Member

Fixes #278

In the parallel code, the u_matrix is distributed
in u_matrix_loc. However, the write_chkpt routine
writes on file the content of the u_matrix that was not
updated during the wannierisation but only at the end.
Therefore, the code was always restarting from the results
of the disentanglement (unless it was stop appropriately
with a fixed number of steps).

Now we gather the u_matrix_loc and m_matrix_loc just
before dumping, in the wannierise.F90 file.
Note that gathering is not needed in the main program file
because the dumping of the .chk file there happens right
after the disentanglement, where the u_matrix is still not
scattered.

Also, I'm not 100% sure that also the m_matrix_loc needs to be
gathered, but anyway this is what is done at the end of the
cycle in wann_main so it shouldn't harm (at worst it can be
a bit less efficient).

Final note: this is very hard to test automatically, so I
couldn't do a proper testing of this PR.

Fixes wannier-developers#278

In the parallel code, the `u_matrix` is distributed
in `u_matrix_loc`. However, the `write_chkpt` routine
writes on file the content of the `u_matrix` that was not
updated during the wannierisation but only at the end.
Therefore, the code was always restarting from the results
of the disentanglement (unless it was stop appropriately
with a fixed number of steps).

Now we gather the `u_matrix_loc` and `m_matrix_loc` just
before dumping, in the `wannierise.F90` file.
Note that gathering is not needed in the main program file
because the dumping of the .chk file there happens right
after the disentanglement, where the u_matrix is still not
scattered.

Also, I'm not 100% sure that also the `m_matrix_loc` needs to be
gathered, but anyway this is what is done at the end of the
cycle in `wann_main` so it shouldn't harm (at worst it can be
a bit less efficient).

Final note: this is very hard to test automatically, so I
couldn't do a proper testing of this PR.
@giovannipizzi giovannipizzi requested a review from jryates July 25, 2019 11:11
@codecov
Copy link

codecov bot commented Jul 25, 2019

Codecov Report

Merging #283 into develop will decrease coverage by 0.49%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           develop     #283     +/-   ##
==========================================
- Coverage    63.31%   62.81%   -0.5%     
==========================================
  Files           29       29             
  Lines        17979    17767    -212     
==========================================
- Hits         11383    11161    -222     
- Misses        6596     6606     +10
Impacted Files Coverage Δ
src/parameters.F90 80.44% <ø> (-1.53%) ⬇️
src/wannierise.F90 81.67% <100%> (+0.06%) ⬆️
src/postw90/geninterp.F90 69.23% <0%> (-5.77%) ⬇️
src/postw90/postw90_common.F90 62.87% <0%> (-5.76%) ⬇️
src/io.F90 67.53% <0%> (-2.82%) ⬇️
src/postw90/postw90.F90 81.92% <0%> (-2.6%) ⬇️
src/wannier_prog.F90 80.99% <0%> (-0.98%) ⬇️
src/postw90/kslice.F90 68.4% <0%> (-0.49%) ⬇️
test-suite/library-mode-test/test_library.F90 64.7% <0%> (-0.35%) ⬇️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5dda132...6d7daef. Read the comment docs.

@jryates jryates merged commit 18666f0 into wannier-developers:develop Jul 25, 2019
@giovannipizzi giovannipizzi deleted the fix_278_restart branch December 4, 2019 21:45
manxkim pushed a commit to manxkim/wannier90 that referenced this pull request Jan 10, 2021
…restart

Gathering matrices before dumping chk file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug in restart logic (when writing checkpoint file)
2 participants