Skip to content

Execution context and modules activation for execution #338

Open
@denisri

Description

@denisri

Config modules can provide a static method init_execution_context in order to initialize things for execution. This method is called from the constructor of ExecutionContext. The context is created in the function capsul.engine.execution_context(), which, at the moment, does things in two steps:

  • create the context using only the list of config modules, but no config contents.
    The constructor is called at this moment, and calls init_execution_context for modules which do not have config values yet.
  • then, afterwards, fill in the config in the context. But it's too late, modules init_execution_context will not be calles again.

We should modify this, either by calling the constructor using the final complete (filtered) config, or call modules init_execution_context later after the config is setup.

Additionally there is another issue with execution contexts: they are apparently meant for "execution", thus computing server side, initialize config modules in order to run code and software in this config. But we need to instantiate them also on client side, because they are needed for completion: ProcessMetadata needs an execution context in its initialization. So this execution runtime initialization is also performed on client side, using config values which are suited for the server, which 1. is an unnecessary work here, 2. will potentially lead to errors because the config does not match the client machine running the init code there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions