1 | #!/bin/bash |
---|
2 | ################################### |
---|
3 | ## Definitions for batch system |
---|
4 | #SBATCH -A omr@cpu # Accounting information |
---|
5 | #SBATCH --job-name=CPL_TESTCASE # Job name |
---|
6 | ##SBATCH --partition=cpu_p1 # Partition Name |
---|
7 | #SBATCH --ntasks=29 # Total number of MPI processes |
---|
8 | #SBATCH --ntasks-per-node=40 # Number of MPI processes per node |
---|
9 | #SBATCH --hint=nomultithread # 1 MPI process per node (no hyperthreading) |
---|
10 | #SBATCH --time=00:10:00 # Maximum execution time (HH:MM:SS) |
---|
11 | #SBATCH --output=cpltestcase_%j # Name of output listing file |
---|
12 | #SBATCH --error=cpltestcase_%j # Name of error listing file (the same) |
---|
13 | ################################### |
---|
14 | ## |
---|
15 | ## Go to submission directory |
---|
16 | ## |
---|
17 | cd ${SLURM_SUBMIT_DIR} |
---|
18 | pwd |
---|
19 | CONFIG_DIR=${SLURM_SUBMIT_DIR} |
---|
20 | ## |
---|
21 | ## Define and create execution directory and move there |
---|
22 | ## |
---|
23 | XXD=`date +%F%H%M%S` |
---|
24 | echo " XXD " $XXD |
---|
25 | mkdir -p $WORK/OUT/CPLTESTCASE/$XXD |
---|
26 | cd $WORK/OUT/CPLTESTCASE/$XXD |
---|
27 | echo "RUN directory " `pwd` |
---|
28 | ## |
---|
29 | ## Get input files for NEMO |
---|
30 | ## |
---|
31 | DATA1DIR=$WORK/FORCING/ORCA2_ICE_PISCES_v4.0 |
---|
32 | for file in $DATA1DIR/* |
---|
33 | do |
---|
34 | ln -s $file . || exit 2 |
---|
35 | done |
---|
36 | # Get input namelist and xml files |
---|
37 | for file in $CONFIG_DIR/*namelist*_ref $CONFIG_DIR/*namelist*_cfg $CONFIG_DIR/*.xml |
---|
38 | do |
---|
39 | cp $file . || exit 3 |
---|
40 | done |
---|
41 | ## |
---|
42 | ## Get input files for TOYATM, including the namcouple file |
---|
43 | ## |
---|
44 | TOYATM_DIR=$CONFIG_DIR/../../../tools/TOYATM/EXP |
---|
45 | for file in $TOYATM_DIR/* |
---|
46 | do |
---|
47 | cp $file . || exit 4 |
---|
48 | done |
---|
49 | ## |
---|
50 | ## Get Executables |
---|
51 | ## |
---|
52 | cp $CONFIG_DIR/nemo nemo.exe || exit 5 |
---|
53 | cp $TOYATM_DIR/../toyatm.exe . || exit 5 |
---|
54 | |
---|
55 | echo "DIR BEFORE EXEC" |
---|
56 | ls -l |
---|
57 | echo '(3) Prepare launch of the run' |
---|
58 | echo '----------------' |
---|
59 | export MPIRUN="srun --mpi=pmi2 --cpu-bind=cores -K1" |
---|
60 | NB_PROCS_NEMO=28 |
---|
61 | NB_PROCS_OASIS=1 |
---|
62 | NB_PROCS_TOYATM=1 |
---|
63 | date |
---|
64 | touch ./run_file |
---|
65 | echo 0-27 ./nemo.exe >>./run_file |
---|
66 | echo 28 ./toyatm.exe >>./run_file |
---|
67 | echo run_file |
---|
68 | cat ./run_file |
---|
69 | ## |
---|
70 | ## Run the CPL test case using 27 processes for nemo and 1 for toyatm |
---|
71 | ## |
---|
72 | echo '(4) Run the code' |
---|
73 | echo '----------------' |
---|
74 | time srun --multi-prog ./run_file |
---|
75 | echo "DIR AFTER EXEC" |
---|
76 | ls -l |
---|
77 | date |
---|
78 | pwd |
---|