ecmwf / pyflow

A high level Python interface to ecFlow allowing the creation of ecFlow suites in a modular and "pythonic" way
https://pyflow-workflow-generator.readthedocs.io/en/latest/
Apache License 2.0
7 stars 7 forks source link

WIP: Use Troika directives in TroikaHost (#31) #34

Closed oiffrig closed 1 month ago

oiffrig commented 9 months ago

(#31) Converts the Slurm directives in TroikaHost to Troika directives

WIP: directives kept as plain Slurm for now:

FussyDuck commented 9 months ago

CLA assistant check
All committers have signed the CLA.

corentincarton commented 8 months ago

@oiffrig, I just had a chat with some colleagues from production who are running on LUMI and they need new options like "#SBATCH --partition=standard-g" and "#SBATCH --exclusive". At the moment, we always need to add manually the new options in pyflow, which is not very flexible. Couldn't we have a special key in the submit arguments (user_defined for instance) that would give a list of directives. For instance:

execution_contexts:
    parallel:
        nodes: 40
        tasks_per_node: 8 
        user_defined:
             - "#SBATCH --exclusive"
             - "#SBATCH --partition=standard-g"
             - "#TROIKA --my_troika_option=values"

It's the first design that comes out of my mind so happy to discuss if you have a better idea!

oiffrig commented 8 months ago

Could be an option, I don't have an issue with that. What I'm doing in Troika is allowing to configure a mapping that extends/overrides the set of directives. We could have something similar in pyflow, although such a mapping is very much host-dependent.

oiffrig commented 8 months ago

Also, Troika supports #TROIKA partition=foo already, I just need to add it to the TroikaHost

corentincarton commented 8 months ago

That's a good point.. maybe we could extend the mapping in the constructor. We could then have a special configuration in wellies for atos or lumi for instance.

oiffrig commented 8 months ago

I was wondering, do you think it would be useful to pass all submit arguments to Troika, keeping the overrides where necessary? That way, if somebody wants to use a new Troika directive, they will not be limited by pyflow supporting it. We can easily keep the translation where needed.

corentincarton commented 8 months ago

I'm just wondering if we shouldn't just drop the translation and throw an error to force people to use the troika directives instead... It is the TroikaHost after all! EDIT: OK, maybe not an error but a deprecated warning ;)