Skip to content

peakflops(; parallel=true) broken on master #1030

Closed
JuliaLang/julia
#51757
@giordano

Description

@giordano
julia> using LinearAlgebra

julia> peakflops(; parallel=true)
ERROR: MethodError: no method matching nworkers()
The applicable method may be too new: running in world age 25267, while current world is 25269.

Closest candidates are:
  nworkers(::Distributed.WorkerPool) (method too new to be called from this world context.)
   @ Distributed ~/repo/julia/usr/share/julia/stdlib/v1.11/Distributed/src/workerpool.jl:139
  nworkers() (method too new to be called from this world context.)
   @ Distributed ~/repo/julia/usr/share/julia/stdlib/v1.11/Distributed/src/cluster.jl:900
  nworkers(::Distributed.AbstractWorkerPool) (method too new to be called from this world context.)
   @ Distributed ~/repo/julia/usr/share/julia/stdlib/v1.11/Distributed/src/workerpool.jl:148

Stacktrace:
 [1] peakflops(n::Int64; eltype::DataType, ntrials::Int64, parallel::Bool)
   @ LinearAlgebra ~/repo/julia/usr/share/julia/stdlib/v1.11/LinearAlgebra/src/LinearAlgebra.jl:622
 [2] peakflops(n::Int64; eltype::DataType, ntrials::Int64, parallel::Bool)
   @ InteractiveUtils ~/repo/julia/usr/share/julia/stdlib/v1.11/InteractiveUtils/src/InteractiveUtils.jl:335
 [3] peakflops
   @ InteractiveUtils ~/repo/julia/usr/share/julia/stdlib/v1.11/InteractiveUtils/src/InteractiveUtils.jl:330 [inlined]
 [4] top-level scope
   @ REPL[2]:1

julia> versioninfo()
Julia Version 1.11.0-DEV.632
Commit 1abafe85b2c* (2023-10-11 07:57 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: 8 × Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
  WORD_SIZE: 64
  LLVM: libLLVM-15.0.7 (ORCJIT, haswell)
  Threads: 1 on 8 virtual cores

Explicitly loading Distributed does the trick:

julia> using Distributed

julia> peakflops(; parallel=true)
1.4242260084820227e11

but that's not documented to be required:

help?> peakflops
search: peakflops

  peakflops(n::Integer=4096; eltype::DataType=Float64, ntrials::Integer=3, parallel::Bool=false)

  peakflops computes the peak flop rate of the computer by using double precision gemm!. For more information see LinearAlgebra.peakflops.

  │ Julia 1.1
  │
  │  This function will be moved from InteractiveUtils to LinearAlgebra in the future. In Julia 1.1 and later it is available as LinearAlgebra.peakflops.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions