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

Error: no method matching namemap when tracing COBREXA #16

Open
clasqui opened this issue Mar 28, 2023 · 6 comments
Open

Error: no method matching namemap when tracing COBREXA #16

clasqui opened this issue Mar 28, 2023 · 6 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@clasqui
Copy link
Contributor

clasqui commented Mar 28, 2023

Case

Trying to trace COBREXA quick start guide. To reproduce, start julia with the environment for extrae using Extrae.jl/scripts/env.sh julia quick-start.jl. The script run consists of the following:

using Distributed
using Extrae
using Cassette

addprocs_extrae(2)
@everywhere using COBREXA, GLPK

model = load_model("e_coli_core.xml")
function main()
    result = flux_variability_analysis(model, GLPK.Optimizer; workers=workers())
end

Cassette.overdub(Extrae.ExtraeCtx(), main)
@everywhere Extrae.finish()

Error

After extrae is initialized and the overdubbing of the main function starts, the following error appears:

LoadError: MethodError: no method matching namemap(::Type{MathOptInterface.ActivationCondition})
The applicable method may be too new: running in world age 29672, while current world is 29803.
Closest candidates are:
  namemap(::Type{MathOptInterface.ActivationCondition}) at Enums.jl:201 (method too new to be called from this world context.)
  namemap(::Type{MathOptInterface.BasisStatusCode}) at Enums.jl:201 (method too new to be called from this world context.)
  namemap(::Type{HDF5.API.H5F_mem_t}) at Enums.jl:201 (method too new to be called from this world context.)

I attatch the whole output with the stacktrace here:
cobrexa-trace.log

@clasqui clasqui added the bug Something isn't working label Mar 28, 2023
@mofeing
Copy link
Member

mofeing commented Mar 29, 2023

@clasqui mmm could you import COBREXA addprocs_extrae? I know you can't for the distributed workers but can you at least in the master?

@clasqui
Copy link
Contributor Author

clasqui commented Mar 29, 2023

@mofeing I don't understand your question. I can import the COBREXA package both in master and in workers (line 6 of the example, using the @everywhere clause). The problem appears in the line Cassette.overdub(Extrae.ExtraeCtx(), main), when Cassette starts overdubbing the whole tree of calls of the COBREXA code.

@mofeing
Copy link
Member

mofeing commented Mar 29, 2023

In Julia, when a function is compiled it gets a timestamp assigned (i.e. the world age). This is done because due to the possibility of compilation and execution of code at the same time using @eval. What if you're redefining the function you're currently running in?

This is what the world age avoids: it avoids running code newer than the current executing world age when there have been 2 compilations for the same function.

I'm trying to figure it why it affects the namemap function specifically. 🤔

@mofeing mofeing added the help wanted Extra attention is needed label Mar 29, 2023
@mofeing
Copy link
Member

mofeing commented Mar 29, 2023

@clasqui could you try running main once without Cassette and then with Cassette?

using Distributed
using Extrae
using Cassette

addprocs_extrae(2)
@everywhere using COBREXA, GLPK

model = load_model("e_coli_core.xml")
function main()
    result = flux_variability_analysis(model, GLPK.Optimizer; workers=workers())
end

# warmup
main()

Cassette.overdub(Extrae.ExtraeCtx(), main)
@everywhere Extrae.finish()

@clasqui
Copy link
Contributor Author

clasqui commented Mar 29, 2023

@mofeing No luck... first one is executed correctly. Then when it tries to overdub the function, the error raises. It happens always in the same function.
Can we force precompiling or something like this of the overdbub?

@mofeing
Copy link
Member

mofeing commented Mar 29, 2023

mmm I don't think so with Cassette but maybe yeah with CassetteOverlay.jl, but its still experimental. I would first try luck on Julia's Slack, maybe in the #general or #helpdesk channels. Maybe even in #autodiff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants