New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 3572 for branches/2012/dev_r3342_MERCATOR7_SST/NEMOGCM/SETTE/prepare_job.sh – NEMO

Ignore:
Timestamp:
2012-11-16T11:23:06+01:00 (11 years ago)
Author:
cbricaud
Message:

merge dev_r3342_MERCATOR7_SST with trunk: rev3342 to rev3555.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2012/dev_r3342_MERCATOR7_SST/NEMOGCM/SETTE/prepare_job.sh

    r3422 r3572  
    11##################################################### 
    2 # Author : Italo Epicoco for NEMO 
    3 # Contact : italo.epicoco@unisalento.it 
    4 # 
    5 # Some scripts called by sette.sh  
    6 # prepare_job.sh   : create the job script for running job  
     2# Author : Simona Flavoni for NEMO 
     3# Contact : sflod@locean-ipsl.upmc.fr 
     4# 
     5# ---------------------------------------------------------------------- 
     6# NEMO/SETTE , NEMO Consortium (2010) 
     7# Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     8# ---------------------------------------------------------------------- 
     9# 
     10# Some scripts called by sette.sh 
     11# prepare_job.sh   : creates the job script for running job  
    712###################################################### 
    8 #set -x 
     13#set -vx 
    914set -o posix 
    1015#set -u 
    1116#set -e 
    12 # 
     17#+ 
    1318# 
    1419# ================ 
     
    1621# ================ 
    1722# 
    18 # -------------------------- 
    19 # create the job script for NEMO tests  
    20 # -------------------------- 
     23# ------------------------------------------------- 
     24# script that creates the job script for NEMO tests  
     25# ------------------------------------------------- 
    2126# 
    2227# SYNOPSIS 
     
    2530# :: 
    2631# 
    27 #  $ ./prepare_job.sh INPUT_FILE_CONFIG_NAME NUMBER_PROC TEST_NAME MPI_INTERACT MPI_FLAG 
     32#  $ ./prepare_job.sh INPUT_FILE_CONFIG_NAME NUMBER_PROC TEST_NAME MPI_FLAG JOB_FILE 
    2833# 
    2934# 
     
    3136# =========== 
    3237# 
    33 # Simple job for SET TESTS for NEMO (SETTE) 
     38# Part of the SETTE package to run tests for NEMO 
    3439#  
    35 #   get input files (if needed) : tar file   
    36 #  (note this job needs to have an input_CONFIG.cfg in which can be found input tar file name) 
    37 # 
    38 #   runs job in interactive or batch mode : all jobs using 1 process are run interactive, and all MPP jobs are 
    39 # 
    40 #   run in batch (MPI_INTERACT="no") or interactive (MPI_INTERACT="yes") see sette.sh and BATCH_TEMPLATE directory 
    41 # 
    42 #   and call post_test_tidyup function (that moves in NEMO_VALIDATION_DIR solver.stat, tracer.stat (for LOBSTER & PISCES) & ocean.output) 
     40# prepare the script $JOB_FILE to run the tests  
    4341# 
    4442# EXAMPLES 
     
    4745# :: 
    4846# 
    49 #  $ ./fcm_job.sh INPUT_FILE_CONFIG_NAME NUMBER_PROC TEST_NAME MPI_INTERACT MPI_FLAG 
    50 # 
    51 #  run a job of config GYRE with 1 processor SHORT test ( 5 days ) using an interactive run without mpirun 
    52 #  $ ./fcm_job.sh input_GYRE.cfg 1 SHORT yes no 
    53 # 
    54 #  run a job of config ORCA2_LIM_PISCES   with 8 processors test RESTARTABILITY submitting the job to the batch queue system and using mpirun 
    55 #  $ ./fcm_job.sh input_ORCA2_LIM_PISCES.cfg 8 LONG no yes 
     47#  $ ./prepare_job.sh INPUT_FILE_CONFIG_NAME NUMBER_PROC TEST_NAME MPI_FLAG $JOB_FILE 
     48# 
     49# prepare the $JOB_FILE for execution  
    5650# 
    5751# 
     
    6559# ========== 
    6660# 
    67 # $Id: fcm_job.sh 3050 2011-11-07 14:11:34Z acc $ 
     61# $Id: prepare_job.sh 3050 2011-11-07 14:11:34Z acc $ 
    6862# 
    6963# 
     
    7468# 
    7569 
    76 usage=" Usage : ./fcm_job.sh input_CONFIG_NAME.cfg  NUMBER_OF_PROCS TEST_NAME INTERACT MPI_FLAG" 
    77 usage=" example : ./fcm_job.sh input_ORCA2_LIM_PISCES.cfg 8 SHORT no/yes no/yes" 
     70usage=" Usage : ./prepare_job.sh INPUT_FILE_CONFIG_NAME NUMBER_PROC TEST_NAME MPI_FLAG JOB_FILE" 
     71usage=" example : ./prepare_job.sh input_ORCA2_LIM_PISCES.cfg 8 SHORT no/yes $JOB_FILE" 
    7872 
    7973 
     
    8175        if [ ${#} -lt ${minargcount} ] 
    8276        then 
    83                 echo "not enought arguments for fcm_job.sh script" 
    84                 echo "control number of argument of fcm_job.sh in sette.sh" 
     77                echo "not enough arguments for prepare_job.sh script" 
     78                echo "control number of argument of prepare_job.sh in sette.sh" 
    8579                echo "${usage}" 
    8680        exit 1 
     
    165159    exit 1 
    166160fi 
    167 #if [ ${NB_PROC} == 1 ] ; then 
    168 #    echo "running opa" >> ${SETTE_DIR}/output.sette 
    169 #    echo "            " >> ${SETTE_DIR}/output.sette 
    170 #    ./opa 
    171 # 
    172 # Tidy out output from this test and populate the NEMO_VALIDATION_DIR tree 
    173 # 
    174 #    post_test_tidyup 
    175 #else 
    176 #    echo "running opa in MPI" >> ${SETTE_DIR}/output.sette 
    177 #    echo "            " >> ${SETTE_DIR}/output.sette 
    178  
    179 #    if [ ${MPI_INTERACT} == "yes" ] ; then 
    180 #  # 
    181 #  # example for brodie (NEC SX8) machine 
    182 #  #  mpirun -np ${NB_PROC} opa 
    183 #  # example for dedale machine 
    184 #  #  mpirun --mca btl self,tcp -np ${NB_PROC} opa 
    185 #  # example for vargas (IBM Power6) machine 
    186 #  mpiexec -n ${NB_PROC} opa 
    187 #  # 
    188 #  post_test_tidyup 
    189 #    fi 
    190 # 
     161 
    191162# example for NOCS Altix system using PBS batch submission (requires ${SETTE_DIR}/sette_batch_template file) 
    192163# 
    193   #  if [ ${MPI_INTERACT} == "no" ] ; then 
     164  #  if [ ${MPI_FLAG} == "no" ] ; then 
    194165      case ${COMPILER} in  
    195166         ALTIX_NAUTILUS_MPT) 
     
    198169               # number of processes required is an integer multiple of 4 
    199170               # 
    200                NB_NODES=$( echo $NB_PROC | awk '{print $1  $1 / 4}') 
     171               NB_NODES=$( echo $NB_PROC | awk '{print $1 / 4}') 
    201172            else 
    202173               # 
     
    209180                        ifort_MERCATOR_CLUSTER) 
    210181                                echo NB_PROCS ${NB_PROC} 
    211                                 NB_NODES=$( echo $NB_PROC | awk '{print $1 - $1 % 8}'  | awk '{print $1 / 8 + 1 }') 
    212182                                echo NB_NODES ${NB_NODES} 
    213183                                echo  NB_PROC ${NB_PROC}  
    214184                                if [ ${NB_PROC} -eq 1 ] ; then 
     185                                   NB_NODES=1 
    215186                                   QUEUE=monoproc 
     187                                   NB_PROC_NODE=${NB_PROC}  
    216188                                else 
    217189                                   if [ ${NB_PROC} -le 8 ] ; then  
     190                                      NB_NODES=1 
    218191                                      QUEUE=mono 
     192                                      NB_PROC_NODE=${NB_PROC}  
    219193                                   else 
     194                                      NB_NODES=$( echo $NB_PROC | awk '{print $1 - $1 % 8}'  | awk '{print $1 / 8 }') 
    220195                                      QUEUE=multi 
    221                                       NB_PROC=8 
     196                                      NB_PROC_NODE=8 
    222197                                  fi     
    223198                                fi     
     199                                echo NB_PROCS     ${NB_PROC} 
     200                                echo NB_NODES     ${NB_NODES} 
     201                                echo NB_PROC_NODE ${NB_PROC_NODE}  
    224202            ;; 
    225203         *) 
     
    231209# Pass settings into job file by using sed to edit predefined strings 
    232210# 
    233          ((mem=5*NB_PROC)) 
    234          echo NB_NODES NB_PROC QUEUE ${NB_NODES} ${NB_PROC} ${QUEUE} 
    235211        cat ${SETTE_DIR}/job_batch_template | sed -e"s/NODES/${NB_NODES}/" -e"s/NPROCS/${NB_PROC}/" \ 
    236              -e"s/QUEUE/${QUEUE}/" -e"s/MEM/${mem}/" \ 
    237212             -e"s:DEF_SETTE_DIR:${SETTE_DIR}:" -e"s:DEF_INPUT_DIR:${INPUT_DIR}:" \ 
    238213             -e"s:DEF_EXE_DIR:${EXE_DIR}:" \ 
     
    258233   fi 
    259234    
    260    chmod a+x $JOB_FILE 
     235   chmod a+x $JOB_FILE ; echo "$JOB_FILE is ready" 
    261236 
    262237#fi 
Note: See TracChangeset for help on using the changeset viewer.