HWRF  trunk@4391
hwrf_pre_job.sh.inc
1 # This is a Posix SH include file that should be sourced at the top of
2 # every job. It initializes the environment for various clusters so
3 # that the rest of the HWRF or Rocoto can run properly.
4 
5 if [[ "Q${HWRF_FORCE_TMPDIR:-}" != "Q" ]] ; then
6  if [[ ! -d "$HWRF_FORCE_TMPDIR" ]] ; then
7  if ( mkdir -p "$HWRF_FORCE_TMPDIR" ) ; then
8  : # trick to avoid triggering a set -e during a race condition
9  fi
10  fi
11  export TMPDIR="$HWRF_FORCE_TMPDIR"
12 fi
13 
14 if [[ "QQ$WHERE_AM_I" == QQ ]] ; then
15  if [[ -d /lfs3 ]] ; then
16  export WHERE_AM_I=jet
17  elif [[ -d /scratch3 ]] ; then
18  if ( grep E5-2690 /proc/cpuinfo > /dev/null 2>&1 ) ; then
19  export WHERE_AM_I=theia
20  else
21  export WHERE_AM_I=zeus
22  fi
23  elif [[ -d /gpfs/hps && -e /etc/SuSE-release ]] ; then
24  export WHERE_AM_I=wcosscray
25  elif [[ -d /dcom && -d /hwrf ]] ; then
26  export WHERE_AM_I=wcoss
27  elif [[ -d /glade ]] ; then
28  export WHERE_AM_I=yellowstone
29  elif [[ -d /data && -d /home && -d /scratch ]] ; then
30  export WHERE_AM_I=s4
31  fi
32 fi
33 
34 moduleuse=$HOMEhwrf/modulefiles/$WHERE_AM_I
35 case "${WHERE_AM_I:-unknown}" in
36  jet) . /apps/lmod/lmod/init/sh ;;
37  zeus) . /usr/share/Modules/init/sh ;;
38  ttfri) . /opt/modules/Modules/3.2.9/init/sh ;;
39  s4) : ;;
40  yellowstone)
41  . /usr/share/Modules/init/sh
42  export PATH=/glade/p/work/strahan/rocoto/hwrf-rocoto/bin:$PATH
43  moduleuse=no
44  ;;
45  wcoss|wcoss2|wcoss1)
46  moduleuse=$HOMEhwrf/modulefiles/wcoss
47  . /usrx/local/Modules/default/init/sh
48  module purge
49  ;;
50  wcosscray)
51  if [[ -e /gpfs/td2 ]] ; then
52  moduleuse=$HOMEhwrf/modulefiles/wcossluna
53  else
54  moduleuse=$HOMEhwrf/modulefiles/wcosssurge
55  fi
56  . /opt/modules/default/init/sh
57  #module purge
58  ;;
59  theia) : ;;
60  *)
61  echo "WARNING: UNSUPPORTED SYSTEM $WHERE_AM_I" 1>&2
62 esac
63 
64 if [[ "$moduleuse" != no ]] ; then
65  module use $moduleuse
66 
67  if [[ "${GSI_DOMAIN:-}QQ" == QQ ]] ; then
68  echo NOT A GSI JOB - LOADING HWRF/run
69  module load HWRF/run
70  else
71  echo GSI JOB - LOAD HWRF/rungsi
72  module load HWRF/rungsi
73  fi
74 fi
75 
76 if [[ "${QUIET_PRE_JOB:-NO}" != YES ]] ; then
77  if [[ "$WHERE_AM_I" == zeus || "$WHERE_AM_I" == jet || "$WHERE_AM_I" == ttfri ]] ; then
78  echo ====================PBS_NODEFILE CONTENTS===================
79  ( set +eu ; cat "$PBS_NODEFILE" ; /bin/true )
80  fi
81  echo =======================/proc/meminfo========================
82  cat /proc/meminfo
83  echo ========================ps auxwww===========================
84  ps auxwww
85  echo ===========================env==============================
86  env
87  echo ======================df -h /dev/shm========================
88  df -h /dev/shm
89  echo ========================ulimit -a===========================
90  ulimit -a
91  echo ============================================================
92 fi
def load(filename)
Loads the HWRFLauncher created by the launch() function.
Definition: launcher.py:297
def run(arg, logger=None, sleeptime=None, kwargs)
Executes the specified program and attempts to return its exit status.
Definition: run.py:376
Defines classes that know how to run all parts of the HWRF system.
Definition: __init__.py:1