Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add hrecules.lua mod.
  • Loading branch information
EdwardSafford-NOAA committed Aug 19, 2024
1 parent ba0d23d commit acd8fb1
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
39 changes: 39 additions & 0 deletions modulefiles/obs-monitor/hercules.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
help([[
Load python virtual environment for obs-monitor
]])

local pkgName = myModuleName()
local pkgVersion = myModuleVersion()
local pkgNameVer = myModuleFullName()

conflict(pkgName)


prepend_path("MODULEPATH", " /work/noaa/epic/role-epic/spack-stack/hercules/spack-stack-1.6.0/envs/unified-env-intel-2023.2.4/install/modulefiles/Core")

load ("stack-intel/2021.10.0")
load ("python/3.10.8")

local pyenvpath = "/work/noaa/da/esafford/noscrub/python/envs/"
local pyenvname = "obs-mon"

local pyenvactivate = pathJoin(pyenvpath, pyenvname, "bin/activate")

if (mode() == "load") then
local activate_cmd = "source "..pyenvactivate
execute{cmd=activate_cmd, modeA={"load"}}
prepend_path("PATH", "/work/noaa/da/esafford/noscrub/python/envs/obs-mon/bin")
prepend_path("PYTHONPATH", "/work/noaa/da/esafford/noscrub/python/envs/obs-mon")

else
if (mode() == "unload") then
local deactivate_cmd = "deactivate"
execute{cmd=deactivate_cmd, modeA={"unload"}}
end
end

whatis("Name: ".. pkgName)
whatis("Version: ".. pkgVersion)
whatis("Category: Obs-monitor")
whatis("Description: Load all libraries needed for obs-monitor")

15 changes: 14 additions & 1 deletion parm/OM_config
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ case ${MACHINE_ID} in
aprun_py=`which python`
;;

orion|hercules)
orion)
export SUB="sbatch"

ptmp="/work2/noaa/stmp/${USER}"
Expand All @@ -50,6 +50,19 @@ case ${MACHINE_ID} in
aprun_py="python"
module load obs-monitor/orion
;;

hercules)
export SUB="sbatch"

ptmp="/work2/noaa/stmp/${USER}"
stmp="/work/noaa/stmp/${USER}"

queue=""
project=""
account="da-cpu"
aprun_py="python"
module load obs-monitor/hercules
;;
esac

export ACCOUNT=${ACCOUNT:-$account}
Expand Down

0 comments on commit acd8fb1

Please sign in to comment.