source: configs/testing/bash/X64_CURIE.sh @ 520

Last change on this file since 520 was 520, checked in by dubos, 7 years ago

Update to testing

  • Property svn:executable set to *
File size: 2.9 KB
Line 
1#!/bin/bash
2
3# This script provides site-specific functions
4# called by the site-independent scripts
5# create_runs.sh and submit.sh
6
7# NB : we must use the queue 'normal' because there seems to be a limit
8# on the number of jobs that can be submitted to queue 'test'
9
10#----------------------------- split_XXX ----------------------------
11
12function split_serial_40() {
13    setvar nbp 41 nsplit_i 2 nsplit_j 2
14}
15function split_mpi_40() {
16    setvar nbp 41 nsplit_i 2 nsplit_j 2
17}
18function split_mpi_80() {
19    setvar nbp 81 nsplit_i 4 nsplit_j 2
20}
21function split_mpi_omp_40() {
22    setvar nbp 41 nsplit_i 2 nsplit_j 2 omp_level_size 4
23}
24
25#----------------- job submission ------------------
26
27function submit_job_X64_CURIE() # $1=script $* = SLURM OPTIONS
28{
29    TMP=$(mktemp)
30    ccc_msub $1 > $TMP
31    cat $TMP 1>&2
32    cat $TMP | awk '{print $NF }'
33    rm -f $TMP
34}
35
36#------------------------------ job_XXX -----------------------------
37
38# Serial jobs
39function job_serial() { # EXP_NAME
40    job_X64_CURIE $1 1 1 "./gcm.exe"
41}
42function job_serial_40() { # EXP_NAME
43    job_serial $1
44}
45
46# MPI jobs
47function job_mpi() { #EXP_NAME NB_MPI
48    job_X64_CURIE $1 $2 1 "ccc_mprun ./gcm.exe"
49}
50function job_mpi_40() { # EXP_NAME
51    job_mpi $1 40
52}
53function job_mpi_80() { # EXP_NAME
54    job_mpi $1 80
55}
56
57# MPI-OMP jobs
58function job_mpi_omp() { #EXP_NAME NB_MPI NB_OMP
59    job_X64_CURIE $1 $2 $3 "ccc_mprun ./gcm.exe"
60}
61function job_mpi_omp_40() { # EXP_NAME
62    job_mpi_omp $1 40 4
63}
64
65# Generic
66function job_X64_CURIE() { # EXP_NAME MPI_TASKS OMP_TASKS MPIRUN
67    cat <<EOF
68#!/bin/bash
69## Request name
70#MSUB -r $1
71#MSUB -q standard
72#MSUB -A gen7548
73#MSUB -x
74## Number of tasks (=MPI processes) to use
75#MSUB -n $2
76## Number of OpenMP threads
77#MSUB -c $3
78## Elapsed time limit in seconds
79#MSUB -T 600
80## Quality of Service required (long [3 days], normal [1 day], test [30 min])
81#MSUB -Q normal
82
83export OMP_NUM_THREADS=$3
84cd \${BRIDGE_MSUB_PWD}
85
86$(cat $ROOT/DYNAMICO/arch/arch-X64_CURIE.env)
87
88rm -rf gcm.log logs *.nc netcdf
89date > gcm.log
90ulimit -s unlimited
91$4 ./gcm.exe >> gcm.log
92date >> gcm.log
93
94mkdir -p netcdf
95cp gcm.log *.def netcdf
96mv *.nc netcdf
97
98mkdir -p logs
99cp *.xml logs
100mv xios_client_*.err xios_client_*.out gcm.log logs
101
102EOF
103}
104
105#------------------------------ post-processing job -----------------------------
106
107function job_post_X64_CURIE() # LIST
108{
109    DEPLIST=afterany
110    for ID in $* ; do
111        DEPLIST="$DEPLIST:$ID"
112    done
113    cat <<EOF
114#!/bin/bash
115## Request name
116#MSUB -r testing
117#MSUB -q standard
118#MSUB -A gen7548
119#MSUB -E "--dependency=$DEPLIST"
120## Number of tasks (=MPI processes) to use
121#MSUB -n 1
122## Elapsed time limit in seconds
123#MSUB -T 600
124## Quality of Service required (long [3 days], normal [1 day], test [30 min])
125#MSUB -Q normal
126
127export OMP_NUM_THREADS=1
128# this script is submitted from $ROOT/logs
129cd \${BRIDGE_MSUB_PWD}/..
130
131$(cat $ROOT/DYNAMICO/arch/arch-X64_CURIE.env)
132module load python
133
134bash/post.sh
135EOF
136}
Note: See TracBrowser for help on using the repository browser.