ert
ert copied to clipboard
Refactor `num_cpu` across the board
When it comes to figuring out the config objects, this is related to #3957, #3918, #4004, and more generally #3986.
Documentation of num cpu is covered by #1379, and a user reported bug may be found in #3979
These are my findings regarding num cpu -
found in | source | used by |
---|---|---|
queue config | config file / dict NUM_CPU |
enkf main; submission of jobs |
ecl config | data file DATA_FILE |
enkf main |
enkf main | queue config, or ecl config | simulator and run models |
subst config | config file / dict NUM_CPU , or data file DATA_FILE |
substitution list |
To me it seems like enkfmain (or res config, if you will, wherever) could handle all getting of the num cpu from different sources (config file / dict and data file), and pass the value to the different config objects as needed - and based on this usage list, at least ecl config would no longer need to hold / know about num cpu.
There is a test in: https://github.com/equinor/ert/pull/4017 which tests how NUM_CPU is set when no NUM_CPU is set in the config, but DATA_FILE is set, this seems to be relevant for this issue.
thanks for pointing it out, i'm gonna check it out!
indeed we are aware of the mechanism tested for there, and have no intention of changing anything about that logic - so no problem!
at least if i understood correctly, the logic for among others substitution config is: if num cpu is given in the user config, use that value, otherwise fetch it from the data file if a data file is provided.
turns out we can completely remove num cpu from the queue config (which is obvious and natural, really) - it's literally not used.