Python error on cheyenne when using rocoto to run METplus #2173
-
Hi! I am currently trying to run METplus on cheyenne using the rocoto workflow manager. I have a shell script that calls the run_metplus.py command that is being run by rocoto. I included user_env_vars.MET_PYTHON_EXE=/glade/p/ral/jntp/MET/METplus/miniconda/miniconda3/envs/metplus_v5.0_py3.8/bin/python in my call. The script runs perfectly when I run it manually, but I am getting the following error about the python version when running with rocoto.
I've tried adding the correct python version to my path and setting MET_PYTHON_EXE outside of the script, and neither are working. Any ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Hi @briannen, hopefully I can help you work through this environment issue. Python is used in METplus in multiple places, and I suspect that's the source of this confusion:
The error you're getting refers to the version of python used to run the METplus wrappers in (1). The MET_PYTHON_EXE environment variable relates to MET's python embedding logic in (2). You can read more about MET_PYTHON_EXE in Appendix F if you're curious. So setting the MET_PYTHON_EXE environment variable won't have any impact on which version of python is used to execute the METplus wrappers. I will say this is a very, very common problem on HPC's. Something runs fine on the login node, but then doesn't run when submitting to the queuing system because of an environment issue. And in this case, the environment issue is the version of python that's being used on the compute node. So how do we fix this? I'm guessing that your workflow may already have an environment setup step? For example, do you have some script you run to load modules and otherwise setup your environment? If so, that's where you'd address this issue. You'd also activate the correct miniconda environment in the same spot. Please go take a look and let me know if you're still stuck. If so, I'll ask @georgemccabe to advise on best practices for setting up your METplus runtime environment when submitting jobs on HPC such as Cheyenne. |
Beta Was this translation helpful? Give feedback.
Hi @briannen, I confirmed that the module load command you sent do work, at least on a login node. Note that the metplus/5.0.1 file loads met/11.0.1, so you do not need to load MET explicitly. Both module files prepend the appropriate conda environment bin directory to the path, so the correct version of Python should be available when running METplus. I do not have experience running rocoto on cheyenne, so I can't speak to any differences in the environment that would result from running this way vs. the login node. You could try adding some commands after the module loads to verify the files that are in your path:
which python3
which run_metplus.py
One option to ensuring the correct ver…