Fixed bug in writing checkpoint file in parallel mode #500
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While computing various quantities using
wannier90.x
andWannierBerri
, I reported the following issue.wannier-berri/wannier-berri#325 (comment)
With more tests, I found out this also happens for
postw90.x
. Also, it happens only for parallel executions.When I inspected the code, I noticed a bug in the
write_chkpt
subroutine in thewannier_prog.f90
file.Since
common_data%u_matrix
andcommon_data%u_opt
are global, they should not be reduced by MPI routines.Fixing this point gives consistent results with Wannier90-3.1.0. I also suspect the reason for the above issue is the same.
The reason that this bug was not reported in tests is that the checkpoint files were generated from previous versions.
This bug needs an immediate fix and this PR should be considered urgent.