123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- # Platform dependent configuration functions for the 'zenobe' machine
- #(zenobe.hpc.cenaero.be)
- function configure()
- {
- # This function should configure all settings/modules needed to
- # later prepare the EC-Earth run directory and set variables used
- # in the run script
- # Configure paths for building/running EC-Earth
- ecearth_src_dir=${HOME}/modeles/ecearth/sources
- run_dir=/SCRATCH/acad/ecearth/${USER}/run/${exp_name}
- ini_data_dir=/SCRATCH/acad/ecearth/DATA
- # File for standard output.
- # NOTE: This will be modified for restart jobs!
- stdout_file=${PBS_O_WORKDIR-$PWD}/${PBS_JOBNAME-"local"}_${PBS_JOBID-"id"}.log
- # Resubmit this job for automatic restarts? [true/false]
- # Also, add options for the resubmit command here.
- resubmit_job=true
- resubmit_opt=""
- # Configure GRIBEX paths
- export LOCAL_DEFINITION_TEMPLATES=/projects/acad/ecearth/opt/gribex/lib/gribtemplates
- export ECMWF_LOCAL_TABLE_PATH=/projects/acad/ecearth/opt/gribex/lib/gribtables
- # Configure grib api paths
- export GRIB_DEFINITION_PATH=/projects/acad/ecearth/opt/grib_api/share/definitions
- export GRIB_SAMPLES_PATH=/projects/acad/ecearth/opt/grib_api/share/ifs_samples/grib1
- export GRIB_BIN_PATH=/projects/acad/ecearth/opt/grib_api/bin
- # Configure number of processors per node
- proc_per_node=24
- # Configure and load modules
- pre_load_modules_cmd="module purge"
- module_list="compiler compiler/intel/comp_and_lib/2016.2.181 intelmpi/5.1.3.181/64 hdf5/1.8.18-el6/intel_2016.2.181/intelmpi_5.1.3.181"
- if [ -n "${pre_load_modules_cmd}" ]
- then
- ${pre_load_modules_cmd}
- fi
- module load ${module_list}
- # Add directories to the shared library search path
- export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}"/projects/acad/ecearth/opt/grib_api/lib:/projects/acad/ecearth/opt/openjpeg/lib:/projects/acad/ecearth/opt/netcdf/4.4.1.1_ivy_2016.2.181/lib"
- }
- function launch()
- {
- # Compute and check the node distribution
- info "======================="
- info "Node/proc distribution:"
- info "-----------------------"
- info "IFS: ${ifs_numproc}"
- info "NEMO: ${nem_numproc}"
- info "XIOS: ${xio_numproc}"
- info "======================="
- cmd="mpirun"
- while (( "$#" ))
- do
- nranks=$1
- executable=./$(basename $2)
- shift
- shift
- cmd+=" -n $nranks $executable"
- while (( "$#" )) && [ "$1" != "--" ]
- do
- cmd+=" $1"
- shift
- done
- shift || true
- (( "$#" )) && cmd+=" :"
- done
- #export OMP_NUM_THREADS=1
- pwd
- echo $cmd
- #exit
- $cmd
- }
- function finalise()
- {
- # This function should execute of any post run functionality, e.g.
- # platform dependent cleaning or a resubmit
- if ${resubmit_job} && [ $(date -d "${leg_end_date}" +%s) -lt $(date -d "${run_end_date}" +%s) ]
- then
- info "Resubmitting job for leg $((leg_number+1))"
- # Need to go to start_dir to find the run script
- cd ${PBS_O_WORKDIR} # same as $start_dir
- cp ./${PBS_JOBNAME} ./${PBS_JOBNAME}.$$
-
- sed "s:force_run_from_scratch=true:force_run_from_scratch=false:" \
- <./${PBS_JOBNAME}.$$ \
- >./${PBS_JOBNAME}
- cp -f ./${PBS_JOBNAME} ./${PBS_JOBNAME}.$$
- sed "s:special_restart=true:special_restart=false:" \
- <./${PBS_JOBNAME}.$$ \
- >./${PBS_JOBNAME}
- \rm -f ./${PBS_JOBNAME}.$$
- # Submit command
- set -x
- qsub ./${PBS_JOBNAME}
- set +x
- else
- info "Not resubmitting."
- fi
- }
|