New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
GYRE_benchmark.sh in branches/2016/dev_HPC_Gyre_benchmark_test/NEMOGCM/BENCHMARK – NEMO

source: branches/2016/dev_HPC_Gyre_benchmark_test/NEMOGCM/BENCHMARK/GYRE_benchmark.sh @ 7230

Last change on this file since 7230 was 7230, checked in by timgraham, 8 years ago

Added modifications to instrument code and use perf_regions in GYRE_BENCHMARK

  • Property svn:executable set to *
File size: 4.0 KB
Line 
1#!/bin/bash
2############################################################
3# Author : Tim Graham
4# Contact: tim.graham@metoffice.gov.uk
5#
6# ----------------------------------------------------------------------
7# NEMO Consortium (2015)
8# Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
9# ----------------------------------------------------------------------
10#
11#############################################################
12#set -x
13set -o posix
14#set -u
15#set -e
16# ===========
17# DESCRIPTION
18# ===========
19#
20##############################################################
21
22#
23# Compiler among those in NEMOGCM/ARCH
24COMPILER=XC40_METO_perf_tools
25export BATCH_COMMAND_PAR="qsub"
26export BATCH_COMMAND_SEQ=$BATCH_COMMAND_PAR
27export INTERACT_FLAG="no"
28export MPIRUN_FLAG="yes"
29export USING_XIOS="yes"
30export PERF_REGIONS_HOME=/home/tigrah/perf_regions
31
32#Number of cores on a single node of HPC
33export CORES_PER_NODE=32
34
35# List of papi_counters to be used
36export LIST_COUNTERS=PAPI_L1_ICM
37
38
39# Make a link to perf_regions_fortran.f90 in MY_SRC directory
40# I think it should be possible to just include the .mod file but it's failing on XC40 at the moment
41ln -sf $PERF_REGIONS_HOME/src/perf_regions_fortran.F90 MY_SRC/perf_regions_fortran.F90
42
43#
44export DEL_KEYS="key_iomput"
45if [ ${USING_XIOS} == "yes" ] 
46 then
47   export DEL_KEYS=""
48fi
49#
50# Settings which control the use of stand alone servers (only relevant if using xios)
51#
52export USING_MPMD="no"
53export NUM_XIOSERVERS=4
54export JOB_PREFIX=batch-mpmd
55#
56if [ ${USING_MPMD} == "no" ] 
57 then
58   export NUM_XIOSERVERS=0
59   export JOB_PREFIX=batch
60fi
61#
62#
63if [ ${USING_MPMD} == "yes" ] && [ ${USING_XIOS} == "no"]
64 then
65   echo "Incompatible choices. MPMD mode requires the XIOS server"
66   exit
67fi
68#
69#########################################
70# Architecture specific settings
71# control HPC behaviour for benchmarking
72#########################################
73module load cray-netcdf
74
75
76#############################
77# Directory to run the tests
78#############################
79SETTE_DIR=$(cd $(dirname "$0"); pwd)
80MAIN_DIR=${SETTE_DIR%/BENCHMARK}
81CONFIG_DIR=${MAIN_DIR}/CONFIG
82TOOLS_DIR=${MAIN_DIR}/TOOLS
83COMPIL_DIR=${TOOLS_DIR}/COMPILE
84
85CMP_NAM=${1:-$COMPILER}
86# Copy job_batch_COMPILER file for specific compiler into job_batch_template
87cd ${SETTE_DIR}
88cp BATCH_TEMPLATE/${JOB_PREFIX}-${COMPILER} job_batch_template || exit
89
90
91#Cleanup instrumentation from old run
92. ./perf_regions_instrumentation.py cleanup
93
94#Instrument OPA_SRC code before compilation
95. ./perf_regions_instrumentation.py
96
97# GYRE CONFIGURATION
98export TEST_NAME="BENCHMARK"
99. ./param.cfg
100. ./all_functions.sh
101cd ${CONFIG_DIR}
102. ./makenemo -m ${CMP_NAM} -n GYRE_BENCHMARK -e /home/tigrah/dev_HPC_Gyre_benchmark_test/NEMOGCM/BENCHMARK/MY_SRC -r GYRE -j 8 del_key "key_mpp_mpi key_iomput"
103echo $PWD
104cd GYRE_BENCHMARK
105mkdir -p ${TEST_NAME}
106export EXE_DIR=${CONFIG_DIR}/${NEW_CONF}/${TEST_NAME}
107JOB_FILE=${EXE_DIR}/run_job.sh
108proc=1
109cd $EXE_DIR
110  cp -rL ${CONFIG_DIR}/${NEW_CONF}/EXP00/* ${EXE_DIR}/.
111  cp -r ${SETTE_DIR}/iodef_sette.xml ${EXE_DIR}/iodef.xml
112  cp -r ${SETTE_DIR}/perf_region_list.txt ${EXE_DIR}/perf_region_list.txt
113
114NPROC=1
115cd ${EXE_DIR} 
116if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
117set_namelist namelist_cfg cn_exp \"GYRE_LONG\"
118set_namelist namelist_cfg nn_it000 1
119set_namelist namelist_cfg nn_itend 500
120set_namelist namelist_cfg nn_stock 10000
121set_namelist namelist_cfg ln_clobber .true.
122set_namelist namelist_cfg nn_fwb 0
123set_namelist namelist_cfg jpni 1
124set_namelist namelist_cfg jpnj 1
125set_namelist namelist_cfg jpnij 1
126set_namelist namelist_cfg jpiglo  50
127set_namelist namelist_cfg jpjglo  40
128set_namelist namelist_cfg jpidta  50
129set_namelist namelist_cfg jpjdta  40
130set_namelist namelist_cfg jp_cfg  1
131if [ ${USING_MPMD} == "yes" ] ; then
132   set_xio_using_server iodef.xml true
133else
134   set_xio_using_server iodef.xml false
135fi
136cd ${SETTE_DIR}
137. ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
138cd ${SETTE_DIR} #Prepare job seems to leave us in a different working directory
139. ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
140
Note: See TracBrowser for help on using the repository browser.