source: CONFIG_DEVT/IPSLCM6.5_work_ENSEMBLES/oasis3-mct/examples/test_1bin_ocnice/run_1bin_ocnice @ 5725

Last change on this file since 5725 was 5725, checked in by aclsce, 3 years ago

Added new oasis3-MCT version to be used to handle ensembles simulations with XIOS.

  • Property svn:executable set to *
File size: 10.8 KB
Line 
1#!/bin/ksh
2#set -x
3######################################################################
4#
5############### User's section #######################################
6#
7## - Define architecture and coupler
8arch=beaufix  #tioman_pgi_mpich/corail/curie(CEA)/jade/neptune_gfortran
9MPILIB=MPI1  #MPI1
10user=`whoami`
11#
12## - Define paths
13srcdir=`pwd`
14datadir=$srcdir/data_oasis3
15casename=`basename $srcdir`
16#
17# - Toy models: Define number of processes to run each executable
18#               and name of executables
19#
20#name of the executables
21    exe1=ocnice
22# number of processes for each executable
23    nproc_exe1=16
24#
25if [ ${arch} == tioman_pgi_mpich ]; then
26    MPIRUN=/usr/local/pgi/linux86-64/2011/mpi/mpich/bin/mpirun
27    rundir=${HOME}/oasis3-mct/examples/${casename}/work_${casename}
28elif [ ${arch} == tioman_intel_openmpi ]; then
29    MPIRUN=/usr/local_intel12/openmpi143/bin/mpirun
30    rundir=/space/${user}/oasis3-mct-examples_buildbot/${casename}/work_${casename}
31elif [ ${arch} == corail ]; then
32    rundir=/lustre/globc/${user}/oasis3-mct-examples_buildbot/${casename}/work_${casename}
33elif [ ${arch} == curie ]; then
34    rundir=/ccc/work/cont005/pa0490/coquartl/oasis3-mct-examples_buildbot/${casename}/work_${casename}
35elif [ ${arch} == jade ]; then
36    rundir=/data/11coqu/oasis3-mct-examples_buildbot/${casename}/work_${casename}
37elif [ ${arch} == neptune_gfortran ]; then
38    rundir=/scratch/globc/${user}/oasis3-mct-examples_buildbot/${casename}/work_${casename}
39elif [ ${arch} == ubuntu ]; then
40  MPIRUN=mpirun
41  rundir=${srcdir}/work_${casename}
42elif [ ${arch} == crayXE6 ]; then
43rundir=/zhome/academic/HLRS/imk/imkbreil/Programme/oasis/oasis3-mct/examples/tutorial/work_${casename}
44elif [ ${arch} == beaufix ]; then
45    rundir=/scratch/work/cglo765/trunk_r2348/examples/test_1bin_ocnice/work_${casename}
46    MPIRUN=/opt/softs/intel/impi/5.1.2.150/intel64/bin/mpirun   
47elif [ ${arch} == ada ]; then
48  MPIRUN=/opt/intel/impi/4.1.0.024/intel64/bin/mpirun
49  rundir=/workgpfs/rech/ces/rces980/modBRETAGNE/oasis3-mct/examples/tutorial/work_${casename}
50fi
51#
52############### End of user's section ################################
53
54echo ''
55echo '*****************************************************************'
56echo '*** '$casename' : '$run
57echo ''
58echo 'Rundir       :' $rundir
59echo 'Architecture :' $arch
60echo 'User         : '$user
61echo ''
62echo $exe1' runs on '$nproc_exe1 'processes'
63#echo $exe2' runs on '$nproc_exe2 'processes'
64#echo $exe3' runs on '$nproc_exe3 'processes'
65echo ''
66echo ''
67######################################################################
68###
69### 1. Copy source example directory containing everything needed
70###    into rundir
71
72rm -r -f $rundir
73mkdir -p $rundir
74
75cp -f $datadir/*txt $rundir/.
76cp -f $datadir/*nc  $rundir/.
77#cp -f $datadir/*.jnl $rundir/.
78#cp -f $datadir/*.gif $rundir/.
79
80cp -f $srcdir/$exe1 $rundir/.
81#cp -f $srcdir/$exe2 $rundir/.
82#cp -f $srcdir/$exe3 $rundir/.
83
84cp -f $datadir/namcouple $rundir/.
85
86#
87cd $rundir
88#
89######################################################################
90###
91### 3. Creation of configuration scripts
92
93###---------------------------------------------------------------------
94### Linux + pgi
95###---------------------------------------------------------------------
96
97if [ $arch == tioman_pgi_mpich ] ; then
98host=`uname -n`
99if [ $nproc_exe1 == 1 ]; then
100   cat <<EOF >> $rundir/appl-linux.conf
101$host 0 $rundir/$exe1
102EOF
103else
104   cat <<EOF >> $rundir/appl-linux.conf
105$host 0 $rundir/$exe1
106EOF
107
108  count=1
109  while [[ $count -lt $nproc_exe1 ]];do
110   cat <<EOF >> $rundir/appl-linux.conf
111$host 1 $rundir/$exe1
112EOF
113   (( count += 1 ))
114  done
115fi
116
117
118###---------------------------------------------------------------------
119### CORAIL
120###---------------------------------------------------------------------
121elif [ $arch == corail ] ; then
122
123  cat <<EOF > $rundir/run_$casename.$arch
124# Nom du job
125#PBS -N test_simple
126# Temps limite du job
127#PBS -l walltime=00:20:00
128# Nombre de processus
129#PBS -l select=1:mpiprocs=24:ncpus=24
130#PBS -l place=scatter:excl
131# adresse email a utiliser
132##PBS -M your_email
133# Mail envoye a la fin du job
134#PBS -m ae
135
136cd $rundir
137
138source /usr/local/bin/intelmpi.sh
139ulimit -s unlimited
140#
141#
142#time mpirun -np $nproc_exe1 ./$exe1 : -np $nproc_exe2 ./$exe2 : -np $nproc_exe3 ./$exe3
143#mpirun -np $nproc_exe1 ./$exe1 : -np $nproc_exe2 ./$exe2 : -np $nproc_exe3 ./$exe3
144mpirun -np $nproc_exe1 ./$exe1
145#
146EOF
147
148###---------------------------------------------------------------------
149### BEAUFIX
150###---------------------------------------------------------------------
151elif [ $arch == beaufix ] ; then
152
153   (( nproc = $nproc_exe1 ))
154
155  cat <<EOF > $rundir/run_$casename.$arch
156#!/bin/bash
157#SBATCH --time=01:00:00
158#SBATCH -p  normal64        # partition/queue
159#SBATCH --job-name=toys     # job name
160#SBATCH -N 1                # number of nodes
161#SBATCH -n $nproc                # number of procs
162#SBATCH -o job.out%j
163#SBATCH -o job.err%j
164#SBATCH --exclusive
165
166ulimit -s unlimited
167# rundir must be in the TMPDIR
168cd $rundir
169module load netcdf/4.4.0
170#
171#
172# Activate next line to run in coupled mode
173#time mpirun -np $nproc_exe1 ./$exe1 : -np $nproc_exe2 ./$exe2
174# Activate next two lines to run both models stand alone
175time mpirun -np $nproc_exe1 ./$exe1
176#
177EOF
178
179###---------------------------------------------------------------------
180### NEPTUNE
181###---------------------------------------------------------------------
182elif [ $arch == neptune_gfortran ] ; then
183
184  cat <<EOF > $rundir/run_$casename.$arch
185# Nom du job
186#PBS -N tests
187# Temps limite du job
188#PBS -l walltime=0:10:00
189# Nombre de processus
190#PBS -q debug
191#PBS -l select=2:mpiprocs=16:ncpus=16
192#PBS -l place=scatter:excl
193
194cd $rundir
195
196# To use Totalview
197#export DISPLAY=tioman.cerfacs.fr:0.0
198export LD_LIBRARY_PATH=/usr/lib64:$LD_LIBRARY_PATH
199ulimit -s unlimited
200#
201#
202# To use Totalview
203#time mpirun -tv -np $nproc_exe1 ./$exe1 : -np $nproc_exe2 ./$exe2 : -np $nproc_exe3 ./$exe3
204#time mpirun -np $nproc_exe1 ./$exe1 : -np $nproc_exe2 ./$exe2 : -np $nproc_exe3 ./$exe3
205time mpirun -np $nproc_exe1 ./$exe1
206#
207EOF
208
209###---------------------------------------------------------------------
210### CURIE (normal nodes)
211###---------------------------------------------------------------------
212elif [ $arch == curie ] ; then
213
214   cat <<EOF > $rundir/appl-curie.conf
215$nproc_exe1 $rundir/$exe1
216EOF
217
218      (( nproc = $nproc_exe1 ))
219
220  cat <<EOF > $rundir/run_$casename.$arch
221#!/bin/bash
222#MSUB -r test_interp # Request name
223#MSUB -q standard  # thin/standard nodes
224#MSUB -n $nproc # Number of tasks to use
225#MSUB -T 3600 # Elapsed time limit in seconds
226#MSUB -o $casename_%I.o # Standard output. %I is the job id
227#MSUB -e $casename_%I.e # Error output. %I is the job id
228#MSUB -A ra0982 # Project ID
229set -x
230cd $rundir
231ccc_mprun -f appl-curie.conf
232EOF
233
234###-----------------------------------------------------------------
235### JADE - CINES
236###-----------------------------------------------------------------
237elif [ $arch == jade ] ; then
238(( NNODE = (  $nproc_exe1 ) / 8 ))
239(( RESTE = (  $nproc_exe1 ) - ( $NNODE * 8 ) ))
240if [[ $RESTE -gt 0 ]]; then
241if [[ $RESTE -lt 8 ]]; then
242 (( NNODE = $NNODE + 1 ))
243fi
244fi
245
246echo $NNODE
247
248cat << EOF > $rundir/run_$casename.$arch
249#PBS -S /bin/bash
250#PBS -N OASIS
251#PBS -l walltime=00:10:00
252#PBS -l select=$NNODE:ncpus=8:mpiprocs=8
253#PBS -o $rundir/out
254#PBS -e $rundir/err
255#PBS -j oe
256#
257set -evx
258module load netcdf
259cd $rundir
260cat $PBS_NODEFILE
261## Lancement executable
262which mpiexec
263export MPI_GROUP_MAX=100
264time mpiexec -n $nproc_exe1 ./$exe1
265
266EOF
267
268###---------------------------------------------------------------------
269### CRAYXE6
270###---------------------------------------------------------------------
271elif [ $arch == crayXE6 ] ; then
272
273 (( nproc = $nproc_exe1 + $nproc_exe2 ))
274
275d_aus=lm_aus.log       # Ausgabe- u. Fehlerdateien
276d_err=lm_fehler.log
277
278  cat <<EOF > $rundir/run_$casename.$arch
279#!/bin/ksh
280# Nom du job
281#PBS -N ${casename}
282# Temps limite du job
283#PBS -l walltime=00:10:00
284# Nombre de processus
285#PBS -l mppwidth=$nproc
286#PBS -l mppnppn=1
287#PBS -l mppdepth=1
288#PBS -o $d_aus
289#PBS -e $d_err
290#
291cd $rundir
292#
293ulimit -c unlimited
294export LIBDWD_FORCE_CONTROLWORDS=1
295export LIBDWD_BITMAP_TYPE=ASCII
296#
297#export MPICH_GNI_DYNAMIC_CONN=disabled
298export MPICH_ENV_DISPLAY=1
299export MPICH_GNI_MAX_EAGER_MSG_SIZE=64000
300export MPICH_ABORT_ON_ERROR=1
301export MALLOC_MMAP_MAX_=0
302export MALLOC_TRIM_THRESHOLD_=-1
303#
304aprun -n $nproc_exe1 ./$exe1 : -n $nproc_exe2 ./$exe2
305#
306EOF
307
308###---------------------------------------------------------------------
309### ada
310###---------------------------------------------------------------------
311elif [ $arch == ada ] ; then
312
313 (( nproc = $nproc_exe1 + $nproc_exe2 ))
314
315  cat <<EOF > $rundir/run_$casename.$arch
316#!/bin/ksh
317# ######################
318# ##   ADA IDRIS   ##
319# ######################
320# Nom de la requete
321# @ job_name = ${casename}
322# Type de travail
323# @ job_type = parallel
324# Fichier de sortie standard
325# @ output = Script_Output_${casename}.000001
326# Fichier de sortie erreur (le meme)
327# @ error = Script_Output_${casename}.000001
328# Nombre de processus demandes
329# @ total_tasks = ${nproc}
330# @ environment = "BATCH_NUM_PROC_TOT=32"
331# Temps CPU max. par processus MPI hh:mm:ss
332# @ wall_clock_limit = 0:30:00
333# Fin de l entete
334# @ queue
335#
336# pour avoir l'echo des commandes
337set -x
338
339# on se place dans le repertoire rundir
340cd ${rundir}
341
342module load netcdf
343module load hdf5
344
345#
346export KMP_STACKSIZE=64m
347export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/smplocal/pub/NetCDF/4.1.3/lib
348
349poe -pgmmodel MPMD -cmdfile run_file
350#
351EOF
352
353fi 
354
355######################################################################
356###
357### 4. Execute the model
358
359if [ $arch == tioman_pgi_mpich ] ; then
360    echo 'Executing the model using '$MPIRUN 
361    $MPIRUN -p4pg appl-linux.conf ./$exe1 > runjob.err
362elif [ $arch == ubuntu ] || [ $arch == tioman_intel_openmpi ] ; then
363    echo 'Executing the model using '$MPIRUN 
364    $MPIRUN -np $nproc_exe1 ./$exe1 > runjob.err
365elif [ $arch == corail ]; then
366    echo 'Submitting the job to queue using qsub'
367    qsub -q submit $rundir/run_$casename.$arch
368    qstat | grep $user
369elif [ $arch == curie ]; then
370    ccc_msub $rundir/run_$casename.$arch
371    ccc_mpp | grep $user
372elif [ $arch == jade ] ; then
373    qsub $rundir/run_$casename.$arch
374    qstat -awu $user
375elif [ $arch == neptune_gfortran ]; then
376    echo 'Submitting the job to queue using qsub'
377    qsub $rundir/run_$casename.$arch
378    qstat | grep $user
379elif [ $arch == beaufix ]; then
380    echo 'Submitting the job to queue using sbatch'
381    sbatch $rundir/run_$casename.$arch
382    squeue -u $user
383fi
384
385echo $casename 'is executed or submitted to queue.'
386echo 'Results are found in rundir : '$rundir 
387
388######################################################################
389
Note: See TracBrowser for help on using the repository browser.