BuildHTUs_IP.pbs 1.19 KB
Newer Older
POLCHER Jan's avatar
POLCHER Jan committed
1 2 3 4 5
#!/bin/bash
#
#PBS -N BuildHTUs_IP
#
#PBS -j oe
6
#PBS -l nodes=1:ppn=64
POLCHER Jan's avatar
POLCHER Jan committed
7 8 9 10 11 12 13 14 15 16 17 18 19
#PBS -l walltime=128:00:00
#PBS -l mem=160gb
#PBS -l vmem=160gb
#
cd ${PBS_O_WORKDIR}
export NSLOTS=$(($PBS_NUM_NODES*$PBS_NUM_PPN))
#
# Set the right Python 3 Anaconda environment
#
source ../../Environment
#
# Clean-up. Weights are kept for future runs.
#
Anthony's avatar
Anthony committed
20
/bin/rm -f DocumentationInterface *graph.nc *.txt
POLCHER Jan's avatar
POLCHER Jan committed
21
#
22 23 24 25 26 27 28 29 30 31 32 33 34
# If weights file does not exist, then compute it quickly
#
if [ ! -e Weights.nc ] ; then
    mpirun -n ${NSLOTS} python ../../WeightsOnly.py
    if [ $? -gt 0 ] ; then
	exit
    else
	echo "============================================="
	echo "= Weight calculations successful            ="
	echo "============================================="	
    fi
fi
#
POLCHER Jan's avatar
POLCHER Jan committed
35 36 37 38 39 40 41 42 43 44 45 46 47 48
# Run the Python code to generate the HTUs and write them into a netCDF file.
#
mpirun -n ${NSLOTS} python ../../RoutingPreProc.py
if [ $? -gt 0 ] ; then
    echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    echo "X    Run on Iberian Peninsula failed    X"
    echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
else
    echo "======================================="
    echo "= Run on Iberian Peninsula successful ="
    echo "======================================="
fi
#
ls -l