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.
Config modules can provide a static method
init_execution_contextin order to initialize things for execution. This method is called from the constructor ofExecutionContext. The context is created in the functioncapsul.engine.execution_context(), which, at the moment, does things in two steps:The constructor is called at this moment, and calls
init_execution_contextfor modules which do not have config values yet.init_execution_contextwill not be calles again.We should modify this, either by calling the constructor using the final complete (filtered) config, or call modules
init_execution_contextlater 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:
ProcessMetadataneeds 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.