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

AssertionError: norm(asolve * volt .- sources) < 1.0e-5 in "all-to-one" mode using the latest development version of Circuiscape. v5.7.1 #288

Closed
luroy opened this issue May 3, 2021 · 4 comments

Comments

@luroy
Copy link

luroy commented May 3, 2021

Dear all,
I’ve just started using Circuitscape on Julia (and also using Julia). So I apologize in advance if my following comment is due to my unfamiliarity with Circuitscape and/or Julia.
From the same inputs, I ran Circuitscape both one-to-all and all-to-one modes. Everything went well from my one-to-all runtime file (.ini), but I got the following error when running my all-to-one ini file (in R using “JuliaCall” package, but I also have the same error in Julia 1.6.0 console):

AssertionError: norm(asolve * volt .- sources) < 1.0e-5
Stacktrace:
  [1] (::Base.var"#837#839")(x::Task)
    @ Base .\asyncmap.jl:177
  [2] foreach(f::Base.var"#837#839", itr::Vector{Any})
    @ Base .\abstractarray.jl:2141
  [3] maptwice(wrapped_f::Function, chnl::Channel{Any}, worker_tasks::Vector{Any}, c::UnitRange{Int64})
    @ Base .\asyncmap.jl:177
  [4] wrap_n_exec_twice
    @ .\asyncmap.jl:153 [inlined]
  [5] #async_usemap#822
    @ .\asyncmap.jl:103 [inlined]
  [6] #asyncmap#821
    @ .\asyncmap.jl:81 [inlined]
  [7] pmap(f::Function, p::Distributed.WorkerPool, c::UnitRange{Int64}; distributed::Bool, batch_size::Int64, on_error::Nothing, retry_delays::Vector{Any}, retry_check::Nothing)
    @ Distributed C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Distributed\src\pmap.jl:126
  [8] pmap(f::Function, p::Distributed.WorkerPool, c::UnitRange{Int64})
    @ Distributed C:\buildbot\worker\package_win64\build\usr\share\julia\std

Of course, my .ini files were exactly the same, except for the 'scenario' line.

I think the error I got is due to the latest development version of Circuiscape. v5.7.1 (i.e. Circuitscape v5.7.1 https://github.com/Circuitscape/Circuitscape.jl.git#master). Indeed, when I reinstalled Circuitscape via the following command on Julia: julia> Pkg.add("Circuitscape"), I compute my all-to-one ini file and did not get an error.

Hoping it can be useful!

Léa

@ranjanan
Copy link
Member

@luroy could you please post your files in a dropbox / google drive so I can take a look?

@vlandau
Copy link
Member

vlandau commented May 26, 2021

@ranjanan I wonder if we should use a relative tolerance for satisfying the @assert statement instead of absolute?

@vlandau
Copy link
Member

vlandau commented May 26, 2021

This problem is also triggered in Omniscape, but only when using 32-bit (single precision). @luroy would you happen to also be using precision = single in your INI file? If so, you may solve the problem at least temporarily by using precision = double.

@ranjanan it seems to only be triggered from this test on the vl/cholmod branch, and I have confirmed that when I alter the test input to tell Circuitscape to use 64-bit instead, the error is not triggered. Maybe we need to set a higher tolerance for the @assert statement when using single precision, but you may want to do some digging first.

@vlandau
Copy link
Member

vlandau commented Jun 1, 2021

@luroy we've issued a patch release that should fix the problem you were having. Run using Pkg; Pkg.update("Circuitscape") in your Julia terminal to get this latest version. I'm going to close this issue, but please feel free to reopen it if you find the problem persisting in Circuitscape v5.8.1!

@vlandau vlandau closed this as completed Jun 1, 2021
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

3 participants