-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scheduler
: abstract generation of submit script env variables (#5283)
The environment variables defined in the `JobTemplate` need to be written to the submit script header. The `Scheduler.get_submit_script` relied on the `__get_submit_script_header` abstract method to do this. This forces each plugin to write this code, even though this is very likely to be scheduler independent. Therefore it is best to abstract this functionality to the base class such that each scheduler plugin automatically has this implemented. If really needed, the plugin can still override the behavior by explicitly reimplementing the `_get_submit_script_environment_variables` method. The new `_get_submit_script_environment_variables` method could be called in the `get_submit_script` method of the base class, such that it is automatically included for all subclasses, but this is currently not possible for backwards compatibility reasons. Since currently it is up to plugins to format the variables themselves in the method `_get_submit_script_header`, if we were to now also add it in the base method, the environment variables would be included twice. Therefore, we opt that plugins just use the new method if they want to. This still requires external plugins to update to use the new method to print the environment variables for it to pick up the changes if `aiida-core` decides to improve the implementation. Note that it looks that `_get_submit_script_environment_variables` could be a `staticmethod`, but unfortunately it is not possible to call the super when overriding the staticmethod in a subclass.
- Loading branch information
Showing
7 changed files
with
33 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters