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 3661 for branches – NEMO

Changeset 3661 for branches


Ignore:
Timestamp:
2012-11-26T14:40:22+01:00 (11 years ago)
Author:
cbricaud
Message:

phase prepare_job.sh with trunk , rev 3555, due to an old Mercator prepare_job.sh script

File:
1 edited

Legend:

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

    r3651 r3661  
    1111# prepare_job.sh   : creates the job script for running job  
    1212###################################################### 
    13 #set -x 
     13#set -vx 
    1414set -o posix 
    1515#set -u 
    1616#set -e 
    17 # 
     17#+ 
    1818# 
    1919# ================ 
     
    3030# :: 
    3131# 
    32 #  $ ./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 
    3333# 
    3434# 
     
    3636# =========== 
    3737# 
    38 # Simple job for SET TESTS for NEMO (SETTE) 
     38# Part of the SETTE package to run tests for NEMO 
    3939#  
    40 #   get input files (if needed) : tar file   
    41 #  (note this job needs to have an input_CONFIG.cfg in which can be found input tar file name) 
    42 # 
    43 #   runs job in interactive or batch mode : all jobs using 1 process are run interactive, and all MPP jobs are 
    44 # 
    45 #   run in batch (MPI_INTERACT="no") or interactive (MPI_INTERACT="yes") see sette.sh and BATCH_TEMPLATE directory 
    46 # 
    47 #   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  
    4841# 
    4942# EXAMPLES 
     
    5245# :: 
    5346# 
    54 #  $ ./fcm_job.sh INPUT_FILE_CONFIG_NAME NUMBER_PROC TEST_NAME MPI_INTERACT MPI_FLAG 
    55 # 
    56 #  run a job of config GYRE with 1 processor SHORT test ( 5 days ) using an interactive run without mpirun 
    57 #  $ ./fcm_job.sh input_GYRE.cfg 1 SHORT yes no 
    58 # 
    59 #  run a job of config ORCA2_LIM_PISCES   with 8 processors test RESTARTABILITY submitting the job to the batch queue system and using mpirun 
    60 #  $ ./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  
    6150# 
    6251# 
     
    7059# ========== 
    7160# 
    72 # $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 $ 
    7362# 
    7463# 
     
    7968# 
    8069 
    81 usage=" Usage : ./fcm_job.sh input_CONFIG_NAME.cfg  NUMBER_OF_PROCS TEST_NAME INTERACT MPI_FLAG" 
    82 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" 
    8372 
    8473 
     
    8675        if [ ${#} -lt ${minargcount} ] 
    8776        then 
    88                 echo "not enought arguments for fcm_job.sh script" 
    89                 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" 
    9079                echo "${usage}" 
    9180        exit 1 
     
    170159    exit 1 
    171160fi 
    172 #if [ ${NB_PROC} == 1 ] ; then 
    173 #    echo "running opa" >> ${SETTE_DIR}/output.sette 
    174 #    echo "            " >> ${SETTE_DIR}/output.sette 
    175 #    ./opa 
    176 # 
    177 # Tidy out output from this test and populate the NEMO_VALIDATION_DIR tree 
    178 # 
    179 #    post_test_tidyup 
    180 #else 
    181 #    echo "running opa in MPI" >> ${SETTE_DIR}/output.sette 
    182 #    echo "            " >> ${SETTE_DIR}/output.sette 
    183  
    184 #    if [ ${MPI_INTERACT} == "yes" ] ; then 
    185 #  # 
    186 #  # example for brodie (NEC SX8) machine 
    187 #  #  mpirun -np ${NB_PROC} opa 
    188 #  # example for dedale machine 
    189 #  #  mpirun --mca btl self,tcp -np ${NB_PROC} opa 
    190 #  # example for vargas (IBM Power6) machine 
    191 #  mpiexec -n ${NB_PROC} opa 
    192 #  # 
    193 #  post_test_tidyup 
    194 #    fi 
    195 # 
     161 
    196162# example for NOCS Altix system using PBS batch submission (requires ${SETTE_DIR}/sette_batch_template file) 
    197163# 
    198   #  if [ ${MPI_INTERACT} == "no" ] ; then 
     164  #  if [ ${MPI_FLAG} == "no" ] ; then 
    199165      case ${COMPILER} in  
    200166         ALTIX_NAUTILUS_MPT) 
     
    203169               # number of processes required is an integer multiple of 4 
    204170               # 
    205                NB_NODES=$( echo $NB_PROC | awk '{print $1  $1 / 4}') 
     171               NB_NODES=$( echo $NB_PROC | awk '{print $1 / 4}') 
    206172            else 
    207173               # 
     
    215181                                echo NB_PROCS ${NB_PROC} 
    216182                                echo NB_NODES ${NB_NODES} 
    217                                 echo  NB_PROC ${NB_PROC}  
     183                                echo  NB_PROC ${NB_PROC} 
    218184                                if [ ${NB_PROC} -eq 1 ] ; then 
    219185                                   NB_NODES=1 
    220186                                   QUEUE=monoproc 
    221                                    NB_PROC_NODE=${NB_PROC}  
     187                                   NB_PROC_NODE=${NB_PROC} 
    222188                                else 
    223                                    if [ ${NB_PROC} -le 8 ] ; then  
     189                                   if [ ${NB_PROC} -le 8 ] ; then 
    224190                                      NB_NODES=1 
    225191                                      QUEUE=mono 
    226                                       NB_PROC_NODE=${NB_PROC}  
     192                                      NB_PROC_NODE=${NB_PROC} 
    227193                                   else 
    228194                                      NB_NODES=$( echo $NB_PROC | awk '{print $1 - $1 % 8}'  | awk '{print $1 / 8 }') 
    229195                                      QUEUE=multi 
    230196                                      NB_PROC_NODE=8 
    231                                   fi     
    232                                 fi     
     197                                  fi 
     198                                fi 
    233199                                echo NB_PROCS     ${NB_PROC} 
    234200                                echo NB_NODES     ${NB_NODES} 
    235                                 echo NB_PROC_NODE ${NB_PROC_NODE}  
    236             ;; 
     201                                echo NB_PROC_NODE ${NB_PROC_NODE} 
     202                                ;; 
    237203         *) 
    238204            NB_NODES=${NB_PROC} 
     
    243209# Pass settings into job file by using sed to edit predefined strings 
    244210# 
    245          ((mem=5*NB_PROC)) 
    246          echo NB_NODES NB_PROC QUEUE ${NB_NODES} ${NB_PROC} ${QUEUE} 
    247         cat ${SETTE_DIR}/job_batch_template | sed -e"s/NODES/${NB_NODES}/" -e"s/NPROCSNODE/${NB_PROC_NODE}/" \ 
    248              -e"s/NPROCS/${NB_PROC}/" \ 
    249              -e"s/QUEUE/${QUEUE}/" -e"s/MEM/${mem}/" \ 
    250              -e"s/QUEUE/${QUEUE}/" -e"s/MEM/${mem}/" \ 
     211        cat ${SETTE_DIR}/job_batch_template | sed -e"s/NODES/${NB_NODES}/" -e"s/NPROCS/${NB_PROC}/" \ 
    251212             -e"s:DEF_SETTE_DIR:${SETTE_DIR}:" -e"s:DEF_INPUT_DIR:${INPUT_DIR}:" \ 
    252213             -e"s:DEF_EXE_DIR:${EXE_DIR}:" \ 
     
    255216             -e"s:DEF_NEMO_VALIDATION:${NEMO_VALIDATION_DIR}:" -e"s:DEF_NEW_CONF:${NEW_CONF}:" \ 
    256217             -e"s:DEF_CMP_NAM:${CMP_NAM}:" -e"s:DEF_TEST_NAME:${TEST_NAME}:" > run_sette_test.job 
    257     
     218 
     219        if [ ${COMPILER} -eq 'ifort_MERCATOR_CLUSTER' ] ; then 
     220             cat run_sette_test.job | sed -e"s/QUEUE/${QUEUE}/" -e"s/MEM/${mem}/" > run_sette_test1.job 
     221             mv run_sette_test1.job run_sette_test.job 
     222        fi 
    258223# 
    259224# create the unique submission job script 
     
    272237   fi 
    273238    
    274    chmod a+x $JOB_FILE 
     239   chmod a+x $JOB_FILE ; echo "$JOB_FILE is ready" 
    275240 
    276241#fi 
Note: See TracChangeset for help on using the changeset viewer.