Skip to content
master
 1using Test
 2using DFTK
 3using Distributed
 4using LinearAlgebra
 5
 6if nworkers() == 1
 7    addprocs(5)
 8end
 9@show nworkers()
10
11@everywhere using SacerDOS
12
13function test_params(case)
14    p = get_params(; case)
15    g_params = gaussian_parameters(p)
16    orders = [0, 1, 2]
17
18    terms_serial = @time dos_gaussian(p.lattice, p.atoms, p.positions, p.Ecut, p.kgrid,
19                                      g_params, p.xs; p.disregistries, orders, p.δ)
20
21    terms_distributed = @time SacerDOS.dos_gaussian_distributed(p.lattice, p.atoms, p.positions,
22                                                                p.Ecut, p.kgrid, g_params, p.xs;
23                                                                p.disregistries, orders, p.δ)
24
25    @test terms_serial.dos  terms_distributed.dos
26    @test all(terms_serial.doses .≈ terms_distributed.doses)
27end
28test_params(:mfast)