environment changes not working as expected on standalone setups #912
-
This is something that has bugged me for a long time: oifs:
# Ok here's something that's not intuitive and certainly needs improvement in the next version
# compiletime and runtime env changes have to be placed within one of the components (does not
# matter which one) and then they are valid for all components.
compiletime_environment_changes:
iolibraries: geomar_libs
choose_computer.name:
levante:
#compiler_mpi: intel2022_impi2021
compiler_mpi: intel2022_openmpi
iolibraries: system_libs
blogin:
compiler_mpi: intel2019_impi2019_nemo4
glogin:
compiler_mpi: intel2019_impi2019
juwels:
compiler_mpi: intel2020_psmpi2020
nesh:
... And I have the choose_version:
GYRE_PISCES:
choose_computer.name:
blogin:
environment_changes:
compiler_mpi: intel2019_impi2019_nemo4
iolibraries: geomar_libs
add_module_actions:
- "load gcc/9.3.0"
requires:
- xios-trunk
- nemobasemodel-4.2.x the My workaround for now is to manually change the |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
I stumbdde across a similar issue, when working on #906. The solution was to put the I think you can probably leave the choose_version:
GYRE_PISCES:
environment_changes:
choose_computer.name:
blogin:
compiler_mpi: intel2019_impi2019_nemo4
iolibraries: geomar_libs
add_module_actions:
- "load gcc/9.3.0" |
Beta Was this translation helpful? Give feedback.
-
I tried that before and it doesn't make a difference. I think the problem is that things such as |
Beta Was this translation helpful? Give feedback.
-
I can confirm that I can reproduce the problem and I have a provisional solution for it. The For variables (non lists/dictionaries) that can trigger choose blocks defined in the A tested provisional solution to your problem would be: hlrn_compiler_mpi: intel2019_impi2019
hlrn_iolibraries: geomar_libs
environment_changes:
choose_computer.name:
glogin:
compiler_mpi: ${nemo.hlrn_compiler_mpi}
iolibraries: ${nemo.hlrn_iolibraries}
blogin:
compiler_mpi: ${nemo.hlrn_compiler_mpi}
iolibraries: ${nemo.hlrn_iolibraries}
choose_version:
GYRE_PISCES:
hlrn_compiler_mpi: intel2019_impi2019_nemo4
hlrn_iolibraries: geomar_libs This works because the dependency of the variables in So the general recommendation for now: try to keep the Potential solutions for the future would be:
|
Beta Was this translation helpful? Give feedback.
I can confirm that I can reproduce the problem and I have a provisional solution for it.
The
*environment_changes
dictionaries can be indented intochoose_
blocks as in your version switch. That works well foradd_module_actions
andadd_export_vars
because they are list expansion or dictionary merges, and the composition order of the information does not matter (if the last environment information expansion is the one that takes place in your switch it does not matter because we just want to add).For variables (non lists/dictionaries) that can trigger choose blocks defined in the
<computer>.yaml
are treated different:esm_environment
checks first if these variables have been define in some