Skip to content

Commit

Permalink
limit maxrss check only to travis linux 64-bit
Browse files Browse the repository at this point in the history
  • Loading branch information
amitmurthy committed Oct 15, 2015
1 parent 379e9c2 commit e958e8e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ before_install:
sudo apt-get install binutils:i386 -y;
sudo apt-get install gcc:i386 g++:i386 make:i386 cpp:i386 g++-4.6:i386 gcc-4.6:i386 libssl-dev:i386 patchelf:i386 gfortran:i386 llvm-3.3-dev:i386 libsuitesparse-dev:i386 libopenblas-dev:i386 libopenblas-base:i386 libblas-dev:i386 liblapack-dev:i386 liblapack3:i386 libarpack2-dev:i386 libarpack2:i386 libfftw3-dev:i386 libgmp-dev:i386 libpcre3-dev:i386 libunwind7-dev:i386 libopenlibm-dev:i386 libmpfr-dev:i386 -y;
else
export JULIA_TEST_MAXRSS_MB="500";
sudo apt-get install patchelf gfortran llvm-3.3-dev libsuitesparse-dev libopenblas-dev liblapack-dev libarpack2-dev libfftw3-dev libgmp-dev libpcre3-dev libunwind7-dev libopenlibm-dev libmpfr-dev -y;
fi;
elif [ `uname` = "Darwin" ]; then
Expand Down
13 changes: 9 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ cd(dirname(@__FILE__)) do
@everywhere include("testdefs.jl")

results=[]
max_worker_rss = parse(Int, get(ENV, "JULIA_TEST_MAXRSS_MB", "500"))
if haskey(ENV, "JULIA_TEST_MAXRSS_MB")
max_worker_rss = parse(Int, ENV["JULIA_TEST_MAXRSS_MB"]) * 2^20
else
max_worker_rss = typemax(Csize_t)
end
println(max_worker_rss)

This comment has been minimized.

Copy link
@tkelman

tkelman Oct 15, 2015

Contributor

left in a debug print?

This comment has been minimized.

Copy link
@amitmurthy

amitmurthy Oct 15, 2015

Author Contributor

Yes. Will fix.

@sync begin
for p in workers()
@async begin
Expand All @@ -35,14 +40,14 @@ cd(dirname(@__FILE__)) do
end
push!(results, (test, resp))

if (isa(resp, Integer) && (resp > max_worker_rss * 2^20)) || isa(resp, Exception)
if (isa(resp, Integer) && (resp > max_worker_rss)) || isa(resp, Exception)
if n > 1
rmprocs(p, waitfor=0.5)
p = addprocs(1; exeflags=`--check-bounds=yes --depwarn=error`)[1]
remotecall_fetch(()->include("testdefs.jl"), p)
else
# single process testing, bail if mem limit reached, or on an exception.
isa(resp, Exception) ? rethrow(resp) : error("Halting tests. memory limit reached : $(resp) > $(max_worker_rss * 2^20)")
# single process testing, bail if mem limit reached, or, on an exception.
isa(resp, Exception) ? rethrow(resp) : error("Halting tests. Memory limit reached : $resp > $max_worker_rss")
end
end
end
Expand Down

0 comments on commit e958e8e

Please sign in to comment.