Skip to content

Long runtimes for structural_simplify on large chemical reaction network model (potential future benchmark case?) #3557

@TorkelE

Description

@TorkelE

The model in question can be found here: https://github.com/SciML/Catalyst_PLOS_COMPBIO_2023/tree/master/Benchmarks/Data (it is the BCR.net file). It is quite large, about 1100 unknowns.

Currently, structural_simplify has very long runtimes when applied to this model. I imagine that this might make sense, as structural_simplify haven't been optimised for this kind of model yet. However, it might make sense to add it as a future benchmark for evaluating structural_simplifys performance?

To retrieve the model run

using Catalyst, ReactionNetworkImporters
BCR_loaded = loadrxnetwork(BNGNetwork(), "BCR.net")
BCR = complete(BCR_loaded.rn)

# Without remove conserved.
begin
    @time osys = convert(ODESystem, BCR; remove_conserved = false) # 3.4 seconds.
    @time complete(osys) # 1.9 seconds.
    @time structural_simplify(osys) # 471 seconds.
end

(I tried priming the model through Catalyst's remove_conserved, but that didn't help)

Actually simulating the model is fairly straightforward and quick

using OrdinaryDiffEq
oprob_js = ODEProblem(BCR, BCR_loaded.u0, 1000.0, BCR_loaded.p; jac = true, sparse = true)
@time sol = solve(oprob_js, Rodas5P()) # 11 seconds

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions