Skip to content

Oceananigans: traced conditional statement containing update_state! errors: #2360

@jlk9

Description

@jlk9

Oceananigans' time_step! function (for methods without reactant models) contains a conditional statement that calls update_state! on the first timestep. This conditional statement breaks when used with Reactant, even with @trace present, so currently Oceananigans Reactant models have their own method calls:

https://github.com/CliMA/Oceananigans.jl/blob/5fff325a53e033e39fa93bc3510336a313cdb6c5/ext/OceananigansReactantExt/TimeSteppers.jl#L53C1-L113C4

It would be better if @trace can be made to work with update_state!, so we can maybe avoid this. I've started an example to minimize it here. To run it, pull that branch of Oceananigans #jlk9/error-trace-reactant-if and run julia -O0 --project test/reactant_test_utils.jl. I'll reduce further as needed.

@wsmoses

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