Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed tests on Windows in raster pairwise mode - Runs out of mmap segments #188

Open
simon-tarr opened this issue May 15, 2019 · 9 comments

Comments

@simon-tarr
Copy link

I have just installed the latest version of Julia and Circuitscape and get the following error when running Pkg.test("Circuitscape"):

Test Summary:          | Pass  Error  Total
Single Precision Tests |  576      1    577
  Network Pairwise     |   93            93
  Network Advanced     |   12            12
  Raster Pairwise      |  320      1    321
  Raster Advanced      |    5             5
  Raster One to All    |  134           134
  Raster All to One    |   12            12
ERROR: LoadError: Some tests did not pass: 576 passed, 0 failed, 1 errored, 0 broken.
in expression starting at C:\Users\simon.tarr\.julia\packages\Circuitscape\x2r8m\test\runtests.jl:11
ERROR: Package Circuitscape errored during testing
Stacktrace:
 [1] pkgerror(::String, ::Vararg{String,N} where N) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Pkg\src\Types.jl:120
 [2] #test#66(::Bool, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Pkg\src\Operations.jl:1328
 [3] #test at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Pkg\src\API.jl:0 [inlined]
 [4] #test#44(::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Pkg\src\API.jl:193
 [5] test at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Pkg\src\API.jl:178 [inlined]
 [6] #test#43 at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Pkg\src\API.jl:175 [inlined]
 [7] test at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Pkg\src\API.jl:175 [inlined]
 [8] #test#42 at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Pkg\src\API.jl:174 [inlined]
 [9] test at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Pkg\src\API.jl:174 [inlined]
 [10] #test#41(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::String) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Pkg\src\API.jl:173
 [11] test(::String) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Pkg\src\API.jl:173
 [12] top-level scope at none:0

I think this is related to issue #27.

I think whatever is causing this issue is also preventing me from running my own raster pairwise jobs successfully. The errors I am getting when running own own jobs are documented here #181 (comment)

Thanks.

@ranjanan
Copy link
Member

@simon-tarr could you share your data so I can reproduce #181 (comment) please? Are your test errors a dup of #178 ?

@simon-tarr
Copy link
Author

simon-tarr commented May 29, 2019

Hi @ranjanan, the data I'm using can be found here.

I'm not sure if my test errors are exactly the same as #178 but I think that's the case. At any rate, my test (Pkg.test("Circuitscape")) fails on Raster Pairwise, as per #178. As I'm using 'Raster Pairwise' in my 'real' data found in the above Gist, I should imagine the two things are related.

I should add, if I change the scenario from pairwise to all_to_one the model runs with no errors. Whatever's wrong with the package must surely lie within pairwise.

@simon-tarr
Copy link
Author

Hi @ranjanan throwing a spanner in the works here. I have stuck the same focal points and resistances files into the GUI version of Circuitscape and selected 'Raster Pairwise'. It runs absolutely fine. I hadn't checked the GUI since your last update to the code about 3 weeks ago. Prior to this, the GUI interface also didn't work (unfortunately I didn't save the error messages). However, now it does.

This result has sparked a few questions/thoughts/ramblings in my mind:

(1) When updating Circuitscape using the Julia command line, does this update the code that the GUI uses? Thus if I update via command line, will the GUI have access to the new, updated code? Or do the two versions of the software call different code bases and must be updated independently?

(2) Is it possible that I have made an error in the .ini file that's passed to the model when running via command line, generating the above errors? If the model works in the GUI but doesn't work in Julia command line (with the same data as input) then I guess that there's either a problem with the command line version of the code or I have somehow messed up the .ini file.

@simon-tarr
Copy link
Author

Some more information @ranjanan, which only really makes things more confusing. It turns out that I can cause the GUI version to crash...if I set the file path to something like C:/Users/simon.tarr/Documents/Output. It would seem that the username (with periods) is potentially still causing the issue here. If I set the GUI to output to, say, D:/Output then the GUI won't error.

However, I still get the error when outputting to D:/Output when using the command line version.

@Kim-Hall
Copy link

Just spending my sunday reading all of the issues --and apologies if I'm not really up to date here. @simon-tarr have you tried this since Ranjan moved from having a GUI to building the .ini in the CS.jl run?

@ViralBShah
Copy link
Member

Please reopen if still an issue on the latest Circuitscape master.

@ViralBShah
Copy link
Member

I wonder if we can call gc() once after the inner loop of the pairwise computations in order to release as many shared memory segments as possible. I suspect it is running out of those.

@ViralBShah
Copy link
Member

ViralBShah commented Feb 26, 2020

This issue only affects Windows.

Same issue: JuliaData/CSV.jl#424
Also see: https://stackoverflow.com/questions/4692426/largest-memory-map-allocation-size

Basically I think it is not worth chasing this one except for calling gc() in the compute loop and seeing if it does the trick. Otherwise, the focus needs to be on multi-threading (#197) for parallelism and moving away from shared arrays.

@ViralBShah ViralBShah reopened this Feb 26, 2020
@ViralBShah ViralBShah changed the title Failed tests Failed tests on Windows in raster pairwise mode - Runs out of mmap segments Feb 26, 2020
@ViralBShah
Copy link
Member

ViralBShah commented Feb 26, 2020

Example test failure log: https://travis-ci.org/Circuitscape/Circuitscape.jl/jobs/654980559#L7499

C:\Users\travis\build\Circuitscape\Circuitscape.jl\src\utils.jl:291
  Got exception outside of a @test
  could not create mapping view: The operation completed successfully. 
  Stacktrace:
   [1] error(::String) at .\error.jl:33
   [2] #mmap#1(::Bool, ::Bool, ::Function, ::Mmap.Anonymous, ::Type{Array{Float64,2}}, ::Tuple{Int64,Int64}, ::Int64) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Mmap\src\Mmap.jl:221
   [3] mmap(::Mmap.Anonymous, ::Type{Array{Float64,2}}, ::Tuple{Int64,Int64}, ::Int64) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Mmap\src\Mmap.jl:186
   [4] _shm_mmap_array(::Type, ::Tuple{Int64,Int64}, ::String, ::UInt16) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\SharedArrays\src\SharedArrays.jl:660
   [5] shm_mmap_array(::Type, ::Tuple{Int64,Int64}, ::String, ::UInt16) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\SharedArrays\src\SharedArrays.jl:639
   [6] #call#3(::Bool, ::Array{Int64,1}, ::Type{SharedArrays.SharedArray{Float64,2}}, ::Tuple{Int64,Int64}) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\SharedArrays\src\SharedArrays.jl:118
   [7] Type at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\SharedArrays\src\SharedArrays.jl:105 [inlined]
   [8] Type at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\SharedArrays\src\SharedArrays.jl:347 [inlined]
   [9] initialize_cum_maps(::Array{Float64,2}, ::Bool) at C:\Users\travis\build\Circuitscape\Circuitscape.jl\src\utils.jl:216

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants