source: flex_extract.git/templates/job.template @ 79729d5

ctbtodev
Last change on this file since 79729d5 was 79729d5, checked in by Anne Philipp <anne.philipp@…>, 5 years ago

switched from python2 to python3

  • Property mode set to 100644
File size: 1.8 KB
Line 
1#!/bin/ksh
2
3# ON ECGB:
4# start with ecaccess-job-submit -queueName ecgb NAME_OF_THIS_FILE  on gateway server
5# start with sbatch NAME_OF_THIS_FILE directly on machine
6
7#SBATCH --workdir=/scratch/ms/$usergroup/$username
8#SBATCH --qos=normal
9#SBATCH --job-name=flex_ecmwf
10#SBATCH --output=flex_ecmwf.%j.out
11#SBATCH --error=flex_ecmwf.%j.out
12#SBATCH --mail-type=FAIL
13#SBATCH --time=12:00:00
14
15## CRAY specific batch requests
16##PBS -N flex_ecmwf
17##PBS -q np
18##PBS -S /usr/bin/ksh
19## -o /scratch/ms/$usergroup/$username/flex_ecmwf.$$$${PBS_JOBID}.out
20## job output is in .ecaccess_DO_NOT_REMOVE
21##PBS -j oe
22##PBS -V
23##PBS -l EC_threads_per_task=24
24##PBS -l EC_memory_per_task=32000MB
25
26set -x
27export VERSION=$version_number
28case $$$${HOST} in
29  *ecg*)
30  module unload grib_api
31  module unload eccodes
32  module unload python
33  module unload emos
34  module load python3
35  module load eccodes/2.12.0
36  module load emos/455-r64
37  export PATH=$$$${PATH}:$fp_root_path
38  ;;
39  *cca*)
40  module unload python
41  module switch PrgEnv-cray PrgEnv-intel
42  module load python3
43  module load eccodes/2.12.0
44  module load emos
45  export SCRATCH=$$$${TMPDIR}
46  export PATH=$$$${PATH}:$fp_root_path
47  ;;
48esac
49
50cd $$$${SCRATCH}
51mkdir -p python$$$$$$$$
52cd python$$$$$$$$
53
54export CONTROL=CONTROL
55
56cat >$$$${CONTROL}<<EOF
57$$control_content
58EOF
59
60
61submit.py --controlfile=$$$${CONTROL} --inputdir=./work --outputdir=./work 1> prot 2>&1
62
63if [ $? -eq 0 ] ; then
64  l=0
65  for muser in `grep -i MAILOPS $$$${CONTROL}`; do
66      if [ $$$${l} -gt 0 ] ; then 
67         mail -s flex.$$$${HOST}.$$$$$$$$ $$$${muser} <prot
68      fi
69      l=$(($$$${l}+1))
70  done
71else
72  l=0
73  for muser in `grep -i MAILFAIL $$$${CONTROL}`; do
74      if [ $$$${l} -gt 0 ] ; then 
75         mail -s "ERROR! flex.$$$${HOST}.$$$$$$$$" $$$${muser} <prot
76      fi
77      l=$(($$$${l}+1))
78  done
79fi
80
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG