Skip to content

Commit e53b50c

Browse files
authored
use smaller matrix size in peakflops on 32-bit (#1255)
This might help prevent failures like https://buildkite.com/julialang/julia-master/builds/46307#0195de97-a496-4daa-b71e-3124e3592505. Allocating several 128MB arrays on 32-bit certainly sounds like asking for an OOM.
2 parents 0cbf85f + 0c87d0d commit e53b50c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/LinearAlgebra.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,8 @@ end
726726
(\)(F::TransposeFactorization{T,<:LU}, B::VecOrMat{Complex{T}}) where {T<:BlasReal} =
727727
ldiv(F, B)
728728

729+
const default_peakflops_size = Int === Int32 ? 2048 : 4096
730+
729731
"""
730732
LinearAlgebra.peakflops(n::Integer=4096; eltype::DataType=Float64, ntrials::Integer=3, parallel::Bool=false)
731733
@@ -750,7 +752,7 @@ of the problem that is solved on each processor.
750752
This function requires at least Julia 1.1. In Julia 1.0 it is available from
751753
the standard library `InteractiveUtils`.
752754
"""
753-
function peakflops(n::Integer=4096; eltype::DataType=Float64, ntrials::Integer=3, parallel::Bool=false)
755+
function peakflops(n::Integer=default_peakflops_size; eltype::DataType=Float64, ntrials::Integer=3, parallel::Bool=false)
754756
t = zeros(Float64, ntrials)
755757
for i=1:ntrials
756758
a = ones(eltype,n,n)

0 commit comments

Comments
 (0)