Skip to content

Commit 1aa5055

Browse files
committed
fix parallel peakflop usage (#51757)
This is required now once Distributed is not in the sysimage. Fixes https://github.com/JuliaLang/julia/issues/51756 (cherry picked from commit 795d8d7)
1 parent ba2a8a3 commit 1aa5055

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

stdlib/LinearAlgebra/src/LinearAlgebra.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,9 @@ function peakflops(n::Integer=4096; eltype::DataType=Float64, ntrials::Integer=3
619619
if parallel
620620
let Distributed = Base.require(Base.PkgId(
621621
Base.UUID((0x8ba89e20_285c_5b6f, 0x9357_94700520ee1b)), "Distributed"))
622-
return sum(Distributed.pmap(peakflops, fill(n, Distributed.nworkers())))
622+
nworkers = @invokelatest Distributed.nworkers()
623+
results = @invokelatest Distributed.pmap(peakflops, fill(n, nworkers))
624+
return sum(results)
623625
end
624626
else
625627
return 2*Float64(n)^3 / minimum(t)

0 commit comments

Comments
 (0)