Skip to content

Commit 7f7e5d6

Browse files
authored
Fix mpi test (#956)
* fix mpi * some formatting * unused variables * fix(?) BLAS * Update parallelization.md
1 parent 4aa68f8 commit 7f7e5d6

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

docs/src/tricks/parallelization.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,7 @@ using LinearAlgebra
188188
BLAS.set_num_threads(N)
189189
```
190190
where `N` is the number of threads you desire.
191-
To **check the number of BLAS threads** currently used, you can use
192-
```julia
193-
Int(ccall((BLAS.@blasfunc(openblas_get_num_threads), BLAS.libblas), Cint, ()))
194-
```
195-
or (from Julia 1.6) simply `BLAS.get_num_threads()`.
191+
To **check the number of BLAS threads** currently used, you can use `BLAS.get_num_threads()`.
196192

197193
### Julia threads
198194
On top of BLAS threading DFTK uses Julia threads (`Thread.@threads`)

src/terms/local.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ end
127127
(::AtomicLocal)(basis::PlaneWaveBasis{T}) where {T} =
128128
TermAtomicLocal(compute_local_potential(basis))
129129

130-
function compute_forces(term::TermAtomicLocal, basis::PlaneWaveBasis{T}, ψ, occupation;
130+
function compute_forces(::TermAtomicLocal, basis::PlaneWaveBasis{T}, ψ, occupation;
131131
ρ, kwargs...) where {T}
132132
S = promote_type(T, real(eltype(ψ[1])))
133133
forces_local(S, basis, ρ, zero(Vec3{T}))
@@ -158,7 +158,7 @@ end
158158
forces
159159
end
160160

161-
@views function compute_dynmat(term::TermAtomicLocal, basis::PlaneWaveBasis{T}, ψ, occupation;
161+
@views function compute_dynmat(::TermAtomicLocal, basis::PlaneWaveBasis{T}, ψ, occupation;
162162
ρ, δρs, q=zero(Vec3{T}), kwargs...) where {T}
163163
S = complex(T)
164164
model = basis.model
@@ -192,7 +192,7 @@ end
192192

193193
# δH is the perturbation of the local potential due to a position displacement e^{iq·r} of
194194
# the α coordinate of atom s.
195-
function compute_δHψ_αs(term::TermAtomicLocal, basis::PlaneWaveBasis, ψ, α, s, q)
195+
function compute_δHψ_αs(::TermAtomicLocal, basis::PlaneWaveBasis, ψ, α, s, q)
196196
δV_αs = similar(ψ[1], basis.fft_size..., basis.model.n_spin_components)
197197
# Perturbation of the local potential with respect to a displacement on the direction α
198198
# of the atom s. All spin components get the same.

src/transfer.jl

+4-3
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ the transfer from `ψk_in` (defined on `basis_in` and `kpt_in`) to `ψk_out`
3737
(defined on `basis_out` and `kpt_out`).
3838
3939
Note that `kpt_out` does not have to belong to `basis_out` as long as it is equivalent to
40-
some other point in it (kpt_out = kpt_in + ΔG).
41-
In that case, the transfer does not change the Bloch wave ψ.
42-
It does change the periodic part u: e^ikx uk(x) = e^i(k+ΔG)x (e^-iΔGx uk(x)).
40+
some other point in it (`kpt_out = kpt_in + ΔG`).
41+
In that case, the transfer does not change the Bloch wave ``ψ``.
42+
It does change the periodic part ``u``:
43+
``e^{i k·x} u_k(x) = e^{i (k+ΔG)·x} (e^{-i ΔG·x} u_k(x))``.
4344
Beware: this is a lossy conversion in general.
4445
"""
4546
function transfer_mapping(basis_in::PlaneWaveBasis, kpt_in::Kpoint,

test/transfer.jl

+2-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ end
9292
end
9393
end
9494

95-
@testitem "Construct k-point from equivalent" begin
95+
# Don't test MPI for now, as the processor that has k-point k may not have k+p.
96+
@testitem "Construct k-point from equivalent" tags=[:dont_test_mpi] begin
9697
using DFTK
9798
using DFTK: get_kpoint
9899
using LinearAlgebra

0 commit comments

Comments
 (0)