[12663] | 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 | ## |
---|
[13242] | 15 | ## CONFIG_DIR is submission directory |
---|
[12663] | 16 | ## |
---|
[13242] | 17 | CONFIG_DIR=${SLURM_SUBMIT_DIR} |
---|
| 18 | # |
---|
| 19 | cd ${CONFIG_DIR} |
---|
[12663] | 20 | pwd |
---|
| 21 | ## |
---|
| 22 | ## Define and create execution directory and move there |
---|
| 23 | ## |
---|
| 24 | XXD=`date +%F%H%M%S` |
---|
| 25 | echo " XXD " $XXD |
---|
| 26 | mkdir -p $WORK/OUT/CPLTESTCASE/$XXD |
---|
| 27 | cd $WORK/OUT/CPLTESTCASE/$XXD |
---|
| 28 | echo "RUN directory " `pwd` |
---|
| 29 | ## |
---|
| 30 | ## Get input files for NEMO |
---|
| 31 | ## |
---|
| 32 | DATA1DIR=$WORK/FORCING/ORCA2_ICE_PISCES_v4.0 |
---|
| 33 | for file in $DATA1DIR/* |
---|
| 34 | do |
---|
| 35 | ln -s $file . || exit 2 |
---|
| 36 | done |
---|
| 37 | # Get input namelist and xml files |
---|
| 38 | for file in $CONFIG_DIR/*namelist*_ref $CONFIG_DIR/*namelist*_cfg $CONFIG_DIR/*.xml |
---|
| 39 | do |
---|
| 40 | cp $file . || exit 3 |
---|
| 41 | done |
---|
| 42 | ## |
---|
| 43 | ## Get input files for TOYATM, including the namcouple file |
---|
| 44 | ## |
---|
| 45 | TOYATM_DIR=$CONFIG_DIR/../../../tools/TOYATM/EXP |
---|
| 46 | for file in $TOYATM_DIR/* |
---|
| 47 | do |
---|
| 48 | cp $file . || exit 4 |
---|
| 49 | done |
---|
| 50 | ## |
---|
| 51 | ## Get Executables |
---|
| 52 | ## |
---|
| 53 | cp $CONFIG_DIR/nemo nemo.exe || exit 5 |
---|
[13242] | 54 | cp $TOYATM_DIR/toyatm.exe . || exit 5 |
---|
| 55 | ## |
---|
| 56 | ## Get script generating summary report |
---|
| 57 | cp $CONFIG_DIR/gen_report.sh . |
---|
[12663] | 58 | |
---|
| 59 | echo "DIR BEFORE EXEC" |
---|
| 60 | ls -l |
---|
| 61 | echo '(3) Prepare launch of the run' |
---|
| 62 | echo '----------------' |
---|
| 63 | export MPIRUN="srun --mpi=pmi2 --cpu-bind=cores -K1" |
---|
| 64 | NB_PROCS_NEMO=28 |
---|
| 65 | NB_PROCS_OASIS=1 |
---|
| 66 | NB_PROCS_TOYATM=1 |
---|
| 67 | date |
---|
| 68 | touch ./run_file |
---|
| 69 | echo 0-27 ./nemo.exe >>./run_file |
---|
| 70 | echo 28 ./toyatm.exe >>./run_file |
---|
| 71 | echo run_file |
---|
| 72 | cat ./run_file |
---|
| 73 | ## |
---|
| 74 | ## Run the CPL test case using 27 processes for nemo and 1 for toyatm |
---|
| 75 | ## |
---|
| 76 | echo '(4) Run the code' |
---|
| 77 | echo '----------------' |
---|
| 78 | time srun --multi-prog ./run_file |
---|
| 79 | echo "DIR AFTER EXEC" |
---|
| 80 | ls -l |
---|
| 81 | date |
---|
| 82 | pwd |
---|
[13242] | 83 | ## |
---|
| 84 | ## simple report generator for the test case |
---|
| 85 | ## |
---|
| 86 | ./gen_report.sh | tee CPL_OASIS_results |
---|
| 87 | |
---|
| 88 | |
---|
| 89 | cat CPL_OASIS_results |
---|
| 90 | ## Copy Summary of results back into submission directory |
---|
| 91 | cp CPL_OASIS_results ${CONFIG_DIR} |
---|