Skip to content

Automatically order components #384

@cmacmackin

Description

@cmacmackin

Currently the transform (and other) methods of components get executed in the order which the components are specified in the Hermes-3 input file. This isn't ideal, as many components depend on the results of other components and this means the user must make sure to specify the desired components in the right order. This could become even more of a problem if things like collisions and other parts of the closure get put into separate components, as it would make the dependency tree that much more complicated.

I've already proposed #383, which would require components to specify which variables they read and write. Once that is implemented, it would be possible for the ComponentScheduler class to do construct a DAG and do a topological sort to determine the correct order of components. This would make Hermes-3 more reliable and easier to use.

Note: A further potential application of this is that it cold allow task-based parallelism in the execution of components. It's not clear this would be useful, given that Hermes-3 and BOUT++ already provide parallelism using domain-decomposition, however.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestrefactorImproving code structure

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions