Skip to content

Commit

Permalink
Fix MPI test for JSON serialisation
Browse files Browse the repository at this point in the history
  • Loading branch information
mfherbst committed Aug 17, 2023
1 parent a7b59f0 commit 1c10712
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions test/serialisation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,16 @@ function test_serialisation(label;
@test isfile(dumpfile)

data = open(JSON3.read, dumpfile) # Get data back as dict
for key in (:converged, :occupation_threshold, :εF, :eigenvalues,
:occupation, :n_bands_converge, :n_iter, :algorithm, :norm_Δρ)

# Keys which need to be MPI-synchronised
for key in (:eigenvalues, :occupation)
gathered = DFTK.gather_kpts(getproperty(scfres, key), scfres.basis)
mpi_master() && @test data[key] == gathered
end

# Normal keys and energy values
for key in (:converged, :occupation_threshold, :εF, :n_bands_converge,
:n_iter, :algorithm, :norm_Δρ)
@test data[key] == getproperty(scfres, key)
end
for key in keys(scfres.energies)
Expand Down

2 comments on commit 1c10712

@mfherbst
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/89873

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.6.11 -m "<description of version>" 1c10712b29959b886920c3eedab35788da19bb54
git push origin v0.6.11

Please sign in to comment.