Skip to content

Commit

Permalink
fix parallel peakflop usage (#51757)
Browse files Browse the repository at this point in the history
This is required now once Distributed is not in the sysimage.

Fixes https://github.com/JuliaLang/julia/issues/51756
  • Loading branch information
KristofferC authored Oct 20, 2023
1 parent f2df1b4 commit 795d8d7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion stdlib/LinearAlgebra/src/LinearAlgebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,9 @@ function peakflops(n::Integer=4096; eltype::DataType=Float64, ntrials::Integer=3
if parallel
let Distributed = Base.require(Base.PkgId(
Base.UUID((0x8ba89e20_285c_5b6f, 0x9357_94700520ee1b)), "Distributed"))
return sum(Distributed.pmap(peakflops, fill(n, Distributed.nworkers())))
nworkers = @invokelatest Distributed.nworkers()
results = @invokelatest Distributed.pmap(peakflops, fill(n, nworkers))
return sum(results)
end
else
return 2*Float64(n)^3 / minimum(t)
Expand Down

0 comments on commit 795d8d7

Please sign in to comment.