Skip to content

Commit

Permalink
Port obs-mon to orion and hercules, add lua module files to create ob…
Browse files Browse the repository at this point in the history
…s-mon python ve (NOAA-EMC#42)

This PR includes:

- Port Obs-Monitor to orion & hercules. 
- Addition of lua module files to create an obs-mon python virtual
environment. Note that I have the ve components temporarily installed in
my own noscrub space. I know this isn't suitable for a permanent
solution but thought it would be an acceptable placeholder.
- Correct use of CFP on wcoss2.  Really this time I've got it.  Honest.
- Removed file cleanup at finish. This needs to be done as a separate
job submission which runs after the plot job finishes. I'll open a new
issue to get that done.

Lastly, as describe in the discussion in NOAA-EMC#41 hercules is now having what
looks like communications issues when it runs eva. Execution hangs when
trying to resolve a url request from cartopy. That may be a system
issue, or it might be a permissions issue from the ve components which I
parked in my noscrub space. Though that location works fine on orion
(and wcoss2). I'm not quite sure how much to make of that.



Closes NOAA-EMC#41
  • Loading branch information
EdwardSafford-NOAA authored Aug 22, 2024
1 parent 648409c commit c215cd9
Show file tree
Hide file tree
Showing 10 changed files with 267 additions and 80 deletions.
4 changes: 2 additions & 2 deletions driver/runObsMon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ logfile="${logdir}/OM_setup.log"
if [[ -e ${logfile} ]]; then rm ${logfile}; fi

case ${MACHINE_ID} in
hera)
hera|orion|hercules)
${SUB} --account ${ACCOUNT} --ntasks=1 --mem=400M --time=0:05:00 \
-J ${jobname} --partition service -o ${logfile} ${jobfile}
;;
Expand All @@ -116,7 +116,7 @@ case ${MACHINE_ID} in
-v "PYTHONPATH=${PYTHONPATH}, PATH=${PATH}, HOMEobsmon=${HOMEobsmon}, COMOUT=${COMOUT}, \
MODEL=${MODEL}, PDY=${PDY}, cyc=${cyc}, DATAROOT=${DATAROOT}, APRUN_PY=${APRUN_PY}, \
MACHINE_ID=${MACHINE_ID}, ACCOUNT=${ACCOUNT}, JOB_QUEUE=${JOB_QUEUE}, SUB=${SUB},
OM_LOGS=${OM_LOGS}, YAML_FILE=${YAML_FILE}" \
OM_LOGS=${OM_LOGS}, YAML_FILE=${YAML_FILE}, CARTOPY_DATA_DIR=${CARTOPY_DATA_DIR}" \
-l select=1:mem=500mb -l walltime=0:05:00 -N ${jobname} ${jobfile}
;;
esac
Expand Down
11 changes: 7 additions & 4 deletions jobs/JMON_PLOT_OBS
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ if [[ -d ${DATAROOT}/${NET} ]]; then rm -rf ${DATAROOT}/${NET}; fi
mkdir -p ${DATA}
cd ${DATA}

##################################
# Remove workspace when finished
##################################
KEEPDATA=${KEEPDATA:-"NO"}

################
# Run exscript
################
Expand All @@ -46,8 +51,6 @@ if [[ -e "${pgmout}" ]] ; then
fi

####################
# Remove workspace
# Remove workspace -- this will have to be a separate job that runs
# after the OM_plot job is complete.
####################
KEEPDATA=${KEEPDATA:-"NO"}
cd ${DATAROOT}
[[ ${KEEPDATA} = "NO" ]] && rm -rf ${DATA}
39 changes: 39 additions & 0 deletions modulefiles/obs-monitor/hera.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", "/scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.6.0/envs/unified-env-rocky8/install/modulefiles/Core")

load ("stack-intel/2021.5.0")
load ("python/3.10.13")

local pyenvpath = "/scratch1/NCEPDEV/da/Edward.Safford/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", "/scratch1/NCEPDEV/da/Edward.Safford/noscrub/python/envs/obs-mon/bin")
prepend_path("PYTHONPATH", "/scratch1/NCEPDEV/da/Edward.Safford/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")

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")

39 changes: 39 additions & 0 deletions modulefiles/obs-monitor/orion.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/orion/spack-stack-1.6.0/envs/unified-env-rocky9/install/modulefiles/Core")

load ("stack-intel/2021.9.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")

36 changes: 36 additions & 0 deletions modulefiles/obs-monitor/wcoss2.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
help([[
Load python virtual environment for obs-monitor
]])

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

conflict(pkgName)


load ("python/3.10.4")

local pyenvpath = "/lfs/h2/emc/da/noscrub/edward.safford/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", "/lfs/h2/emc/da/noscrub/edward.safford/python/envs/obs-mon/bin")
prepend_path("PYTHONPATH", "/lfs/h2/emc/da/noscrub/edward.safford/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")

42 changes: 35 additions & 7 deletions parm/OM_config
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,65 @@ export JOBSobsmon=${om_dir_root}/jobs
source ${om_dir_root}/ush/detect_machine.sh
export MACHINE_ID=`echo "${MACHINE_ID%%.*}"`

module use ${HOMEobsmon}/modulefiles

case ${MACHINE_ID} in

hera)
export SUB="sbatch"
export SERVICE_PARTITION="service"
export CARTOPY_DATA_DIR="/scratch1/NCEPDEV/da/Edward.Safford/noscrub/python/envs/obs-mon/share/cartopy"

ptmp="/scratch2/NCEPDEV/stmp3/$USER"
stmp="/scratch2/NCEPDEV/stmp1/$USER"
ptmp="/scratch2/NCEPDEV/stmp3/${USER}"
stmp="/scratch2/NCEPDEV/stmp1/${USER}"
queue=""
project=""
account="da-cpu"
aprun_py="python"
;;

wcoss2)
export SUB="qsub"
export CARTOPY_DATA_DIR="/lfs/h2/emc/da/noscrub/edward.safford/python/envs/obs-mon/share/cartopy"

ptmp="/lfs/h2/emc/ptmp/$USER"
stmp="/lfs/h2/emc/stmp/$USER"
ptmp="/lfs/h2/emc/ptmp/${USER}"
stmp="/lfs/h2/emc/stmp/${USER}"
queue="dev"
project="GDAS-DEV"
account="GFS-DEV"
aprun_py=`which python`
;;

orion)
export SUB="sbatch"
export CARTOPY_DATA_DIR="/work/noaa/da/esafford/noscrub/python/envs/obs-mon/share/cartopy"

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

queue=""
project=""
account="da-cpu"
;;

hercules)
export SUB="sbatch"
export CARTOPY_DATA_DIR="/work/noaa/da/esafford/noscrub/python/envs/obs-mon/share/cartopy"

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

queue=""
project=""
account="da-cpu"
;;
esac

module load obs-monitor/${MACHINE_ID}
export APRUN_PY=`which python`

export ACCOUNT=${ACCOUNT:-$account}
export PROJECT=${PROJECT:-$project}
export JOB_QUEUE=${JOB_QUEUE:-$queue}

export OM_LOGS="${ptmp}/logs/OM_logs"
export DATAROOT=${DATAROOT:-${stmp}}
export COMOUT=${COMOUT:-${ptmp}}
export APRUN_PY=${APRUN_PY:-${aprun_py}}
Loading

0 comments on commit c215cd9

Please sign in to comment.