dmi-hpcdev-intel.cfg.tmpl 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. # Platform dependent configuration functions for the DMI's new CRAY machine in Iceland
  2. function configure()
  3. {
  4. # This function should configure all settings/modules needed to
  5. # later prepare the EC-Earth run directory and set variables used
  6. # in the run script
  7. # Configure paths for building/running EC-Earth
  8. export ecearth_src_dir=[[[PLT:ACTIVE:ECEARTH_SRC_DIR]]]
  9. export run_dir=[[[PLT:ACTIVE:RUN_DIR]]]
  10. export ini_data_dir=[[[PLT:ACTIVE:INI_DATA_DIR]]]
  11. # File for standard output.
  12. # NOTE: This will be modified for restart jobs!
  13. stdout_file=${start_dir}/out/$exp_name.out
  14. # Resubmit this job for automatic restarts? [true/false]
  15. # Also, add options for the resubmit command here.
  16. resubmit_job=[[[PLT:ACTIVE:RESUBMIT_JOB]]]
  17. resubmit_opt="[[[PLT:ACTIVE:RESUBMIT_OPT]]]"
  18. # Configure GRIBEX paths
  19. export LOCAL_DEFINITION_TEMPLATES=[[[PLT:ACTIVE:GRIBEX_DEFINITION_PATH]]]
  20. # Configure grib api paths
  21. export GRIB_DEFINITION_PATH=[[[PLT:ACTIVE:ECEARTH_SRC_DIR]]]/util/grib_table_126:[[[PLT:ACTIVE:GRIBAPI_BASE_DIR]]]/[[[PLT:ACTIVE:GRIBAPI_DEFINITION_SUBDIR]]]
  22. export GRIB_SAMPLES_PATH=[[[PLT:ACTIVE:GRIBAPI_BASE_DIR]]]/[[[PLT:ACTIVE:GRIBAPI_SAMPLES_SUBDIR]]]
  23. export GRIB_BIN_PATH=[[[PLT:ACTIVE:GRIBAPI_BASE_DIR]]]/[[[PLT:ACTIVE:GRIBAPI_BIN_SUBDIR]]]
  24. # Configure number of processors per node
  25. proc_per_node=[[[PLT:ACTIVE:PROC_PER_NODE]]]
  26. # Configure and load modules
  27. pre_load_modules_cmd="[[[PLT:ACTIVE:PRE_LOAD_MODULES_CMD]]]"
  28. module_list="[[[PLT:ACTIVE:MODULE_LIST]]]"
  29. if [ -n "${module_list}" ]
  30. then
  31. set +u
  32. if [ -n "${pre_load_modules_cmd}" ]
  33. then
  34. eval $(echo "${pre_load_modules_cmd}")
  35. fi
  36. for m in "${module_list}"
  37. do
  38. module add $m
  39. done
  40. set -u
  41. fi
  42. # Add directories to the shared library search path
  43. if [ -n "[[[PLT:ACTIVE:ADD_TO_LD_LIBRARY_PATH]]]" ]
  44. then
  45. export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}"[[[PLT:ACTIVE:ADD_TO_LD_LIBRARY_PATH]]]"
  46. fi
  47. #hostname
  48. ulimit -s unlimited
  49. ulimit -v unlimited
  50. #ulimit -n 2048
  51. #ulimit -a
  52. }
  53. function launch()
  54. {
  55. # version using aprun
  56. cmd="/usr/bin/time -p aprun"
  57. while (( "$#" ))
  58. do
  59. nranks=$1
  60. executable=./$(basename $2)
  61. shift
  62. shift
  63. cmd+=" -n $nranks $executable"
  64. while (( "$#" )) && [ "$1" != "--" ]
  65. do
  66. cmd+=" $1"
  67. shift
  68. done
  69. shift || true
  70. (( "$#" )) && cmd+=" :"
  71. done
  72. echo $cmd
  73. $cmd
  74. }
  75. function finalise()
  76. {
  77. # This function should execute of any post run functionality, e.g.
  78. # platform dependent cleaning or a resubmit
  79. if ${resubmit_job} && [ $(date -d "${leg_end_date}" +%s) -lt $(date -d "${run_end_date}" +%s) ]
  80. then
  81. info "Resubmitting job for leg $((leg_number+1))"
  82. # go to submit dir
  83. cd ${PBS_O_WORKDIR} # same as ${start_dir}
  84. jobname=$exp_name.$(printf %03d $((leg_number+1)))
  85. log=$(basename ${stdout_file}).$(printf %03d $((leg_number+1)))
  86. cat > run_ece-esm.job << EOF
  87. #!/bin/bash
  88. #PBS -q hpc
  89. #PBS -N ${jobname}
  90. #PBS -l select=10
  91. #PBS -l place=scatter
  92. #PBS -l walltime=4:00:00
  93. #PBS -j oe
  94. #PBS -o out/${log}
  95. cd \$PBS_O_WORKDIR
  96. mkdir -p out
  97. ./ece-esm.sh
  98. exit
  99. EOF
  100. # Submit command
  101. set -x
  102. qsub ./run_ece-esm.job
  103. set +x
  104. else
  105. info "Not resubmitting."
  106. fi
  107. }