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

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

Testing : renamed build directories + minor fixes

  • 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
84export OMP_STACKSIZE=128M
85
86cd \${BRIDGE_MSUB_PWD}
87
88$(cat $ROOT/DYNAMICO/arch/arch-X64_CURIE.env)
89
90rm -rf gcm.log logs *.nc netcdf
91date > gcm.log
92ulimit -s unlimited
93$4 >> gcm.log
94date >> gcm.log
95
96mkdir -p netcdf
97cp gcm.log *.def netcdf
98mv *.nc netcdf
99
100mkdir -p logs
101cp *.xml logs
102mv xios_client_*.err xios_client_*.out gcm.log logs
103
104EOF
105}
106
107#------------------------------ post-processing job -----------------------------
108
109function job_post_X64_CURIE() # LIST
110{
111    DEPLIST=afterany
112    for ID in $* ; do
113        DEPLIST="$DEPLIST:$ID"
114    done
115    cat <<EOF
116#!/bin/bash
117## Request name
118#MSUB -r testing
119#MSUB -q standard
120#MSUB -A gen7548
121#MSUB -E "--dependency=$DEPLIST"
122## Number of tasks (=MPI processes) to use
123#MSUB -n 1
124## Elapsed time limit in seconds
125#MSUB -T 600
126## Quality of Service required (long [3 days], normal [1 day], test [30 min])
127#MSUB -Q normal
128
129export OMP_NUM_THREADS=1
130# this script is submitted from $ROOT/logs
131cd \${BRIDGE_MSUB_PWD}/..
132
133$(cat $ROOT/DYNAMICO/arch/arch-X64_CURIE.env)
134module load python
135
136bash/post.sh
137EOF
138}
Note: See TracBrowser for help on using the repository browser.