Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try spack-stack 1.9.0 on Hera for unifying python environment #563

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

grantfirl
Copy link
Collaborator

I created a new modulefile to use an experimental installation of spack-stack 1.9.0 from Ratko Vasic on Hera.

To use:

  • cd to the top level of ccpp-scm
  • module use scm/etc/modules
  • module load hera_intel_spack_stack_1.9.0

This load the spack-stack installation of python, although following https://spack-stack.readthedocs.io/en/1.6.0/MaintainersSection.html, I've created a new virtual environment using the spack-stack 1.9.0 python that should have every python package needed by any and all python scripts in the CCPP SCM repo. The environment is located in /scratch1/BMC/gmtb/ccpp-scm-software/spack-stack-1.9.0. To activate this virtual environment:

  • source /scratch1/BMC/gmtb/ccpp-scm-software/spack-stack-1.9.0/bin/activate

Copy link
Collaborator

@hertneky hertneky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SCM built and ran successfully with spack-stack 1.9.0. There was a deprecation notice while building that can probably be silenced or something.

SCM UFS case-gen script successfully created a case and the case ran fine with the virtual environment.

Commands used:

./UFS_forcing_ensemble_generator.py -d /scratch1/BMC/gmtb/Dustin.Swales/SCM/replay/rt_3252959/control_c48_intel -sc --C_RES 48 -dt 1200 -n control_c48_intel_C_test -sdf SCM_GFS_v17_p8 -lons 230 -lats 30 -fm 2 -vm 1

./run_scm.py --npz_type gfs --file scm_ufsens_control_c48_intel_C_test.py --timestep 1200

@scrasmussen
Copy link
Member

This load the spack-stack installation of python, although following https://spack-stack.readthedocs.io/en/1.6.0/MaintainersSection.html, I've created a new virtual environment using the spack-stack 1.9.0 python that should have every python package needed by any and all python scripts in the CCPP SCM repo. The environment is located in /scratch1/BMC/gmtb/ccpp-scm-software/spack-stack-1.9.0. To activate this virtual environment:

* source /scratch1/BMC/gmtb/ccpp-scm-software/spack-stack-1.9.0/bin/activate

@grantfirl Because Lua modules run in a subshell there isn't a non-hacky and fragile way to source the Python environment from the .lua file. What you could do is add the following to the Lua file which would print a message that the user could copy and paste. The source command could also exist in the SPACK_SOURCE variable so the user could just enter the following from the command line $SPACK_SOURCE so at least it is easy. You could choose a short variable name too and that would make it even easier. Maybe there is a better way but my digging into the issue didn't reveal anything.

setenv("SPACK_SOURCE","source scratch1/BMC/gmtb/ccpp-scm-software/spack-stack-1.9.0/bin/activate")
LmodMessage("The User will need to enter the following into the terminal, SPACK_SOURCE has the source command")
LmodMessage("$SPACK_SOURCE")
LmodMessage("or")
LmodMessage("source scratch1/BMC/gmtb/ccpp-scm-software/spack-stack-1.9.0/bin/activate")

Copy link
Member

@scrasmussen scrasmussen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't test it on Hera (don't have access) but looks good to me.

@hertneky
Copy link
Collaborator

@scrasmussen Agree to everything you said. I was able to use this line:

execute{cmd="source /scratch1/BMC/gmtb/ccpp-scm-software/spack-stack-1.9.0/bin/activate", modeA={"load"}}

It sourced the file because I was then able to run case_gen and the scm. Must be in bash of course.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants