Skip to content

Commit 795d8d7

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

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)