Changeset 1569 for trunk


Ignore:
Timestamp:
12/15/22 11:08:40 (17 months ago)
Author:
aclsce
Message:

Added fonctionality to create RUN_DIR and Job_debug to be launched directly in the RUN_DIR directory.

Location:
trunk/libIGCM
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/AA_job

    r1568 r1569  
    244244#R_IN=/u/rech/por/rpor111/DATA 
    245245 
    246 #D- Turn in dry run mode ? (0,1,2,3) 
     246#D- Turn in dry run mode ? (0,1,2,3,4) 
    247247#D- Default=0 
    248248#D- 
    249 #DRYRUN=3 
     249DRYRUN=0 
    250250#D-# YOU HAVE TO COMPILE YOUR EXE FILES to USE DRYRUN MODE ! 
    251251#D-# ------------------------------------------------------------------------------------- 
     
    262262#D-# |    3     |       yes           |    no      |  no     |      no                   | 
    263263#D-# ------------------------------------------------------------------------------------- 
    264  
     264#D-# |    4     |       yes           |    yes     |  creation of RUN_DIR and Job_debug  | 
     265#D-# ------------------------------------------------------------------------------------- 
    265266#D- 
    266267# --------------------------------------------------------------------------------------------------# 
     
    532533 
    533534  echo "========================================================================" 
    534   if [ ${DRYRUN} -le 1 ] ; then 
    535     REAL_DATE_INIT=$( date ) 
    536     echo                                                                                   > ${Exe_Output} 
    537     echo "#######################################"                                        >> ${Exe_Output} 
    538     echo "EXECUTION of : ${EXECUTION}" 
    539     echo "EXECUTION of : ${EXECUTION}"                                                    >> ${Exe_Output} 
    540     echo                                                                                  >> ${Exe_Output} 
    541     typeset RET 
    542     RUN_DATE_BEGIN=$( date '+%Y-%m-%dT%H:%M:%S' ) 
    543     ${EXECUTION}  >> ${Exe_Output} 2>&1 
    544     RET=$? 
    545     RUN_DATE_END=$( date '+%Y-%m-%dT%H:%M:%S' ) 
    546     if [ ${RET} -gt 0 ] ; then 
    547       echo "Return code of executable :" ${RET} 
    548       IGCM_debug_Exit "EXECUTABLE" 
    549       IGCM_sys_Mkdir ${SUBMIT_DIR}/Debug 
    550       IGCM_sys_Cp ${Exe_Output} ${SUBMIT_DIR}/Debug/${PREFIX}_${Exe_Output}_error 
    551       ExecutionFail=true 
    552     fi 
    553     echo                                            >> ${Exe_Output} 
    554     echo "#######################################"  >> ${Exe_Output} 
    555     echo "libIGCM RunDateBegin=${RUN_DATE_BEGIN}"   >> ${Exe_Output} 
    556     echo "libIGCM RunDateEnd=${RUN_DATE_END}"       >> ${Exe_Output} 
    557     echo                                            >> ${Exe_Output} 
     535  if [ ${DRYRUN_DEBUG} = 4 ] ; then 
     536      IGCM_sys_create_run_dir  
    558537  else 
    559     echo "EXECUTION of : ${EXECUTION} simulated for DRYRUN = " $DRYRUN 
    560     echo "EXECUTION of : ${EXECUTION} simulated for DRYRUN = " $DRYRUN > ${Exe_Output} 
    561     if ( $DEBUG_debug ) ; then 
    562       echo "FOR EXECUTION DRYRUN mode = " $DRYRUN >> stack 
    563     fi 
     538      if [ ${DRYRUN} -le 1 ] ; then 
     539          REAL_DATE_INIT=$( date ) 
     540          echo                                                                                   > ${Exe_Output} 
     541          echo "#######################################"                                        >> ${Exe_Output} 
     542          echo "EXECUTION of : ${EXECUTION}" 
     543          echo "EXECUTION of : ${EXECUTION}"                                                    >> ${Exe_Output} 
     544          echo                                                                                  >> ${Exe_Output} 
     545          typeset RET 
     546          RUN_DATE_BEGIN=$( date '+%Y-%m-%dT%H:%M:%S' ) 
     547          ${EXECUTION}  >> ${Exe_Output} 2>&1 
     548          RET=$? 
     549          RUN_DATE_END=$( date '+%Y-%m-%dT%H:%M:%S' ) 
     550          if [ ${RET} -gt 0 ] ; then 
     551              echo "Return code of executable :" ${RET} 
     552              IGCM_debug_Exit "EXECUTABLE" 
     553              IGCM_sys_Mkdir ${SUBMIT_DIR}/Debug 
     554              IGCM_sys_Cp ${Exe_Output} ${SUBMIT_DIR}/Debug/${PREFIX}_${Exe_Output}_error 
     555              ExecutionFail=true 
     556          fi 
     557          echo                                            >> ${Exe_Output} 
     558          echo "#######################################"  >> ${Exe_Output} 
     559          echo "libIGCM RunDateBegin=${RUN_DATE_BEGIN}"   >> ${Exe_Output} 
     560          echo "libIGCM RunDateEnd=${RUN_DATE_END}"       >> ${Exe_Output} 
     561          echo                                            >> ${Exe_Output} 
     562      else 
     563          echo "EXECUTION of : ${EXECUTION} simulated for DRYRUN = " $DRYRUN 
     564          echo "EXECUTION of : ${EXECUTION} simulated for DRYRUN = " $DRYRUN > ${Exe_Output} 
     565          if ( $DEBUG_debug ) ; then 
     566              echo "FOR EXECUTION DRYRUN mode = " $DRYRUN >> stack 
     567          fi 
     568      fi 
    564569  fi 
    565570  echo "========================================================================" 
  • trunk/libIGCM/ins_job

    r1568 r1569  
    120120F_JOB=${libIGCM}'/AA_job'; 
    121121[[ ! -f ${F_JOB} ]] && { print - "${F_JOB} unreachable"; exit 3; } 
     122F_JOB_DEBUG=${libIGCM}'/AA_job_debug'; 
     123[[ ! -f ${F_JOB_DEBUG} ]] && { print - "${F_JOB_DEBUG} unreachable"; exit 3; } 
    122124F_RCI=${libIGCM}'/run.card.init'; 
    123125[[ ! -f ${F_RCI} ]] && { print - "${F_RCI} unreachable"; exit 3; } 
     
    573575  # update Headers so that ressources description are accurate (MPMD/SPMD/...) 
    574576  IGCM_sys_updateHeaders ${j}'/'${n_f} 
     577 
     578  n_f='Job_debug_'${JobName}; 
     579  [[ ${x_f} = 'false' ]] && [[ -f ${j}'/'${n_f} ]] && { ins_job_Warning; continue; } 
     580  [[ ${x_v} = 'verbose' ]] && print - "\nWorking with file ${F_CFG}\nin directory ${j}\nfor ${n_f}"; 
     581  sed -e "/^${W_W} */ s///" \ 
     582      -e "/^${W_P}/d"       \ 
     583      -e "s%::modipsl::%${F_MOD}%" \ 
     584      -e "s/::Jobname::/${JobName}/" \ 
     585      -e "s/::default_project::/${ProjectID}/" \ 
     586      -e "s/::WallTime::/${WallTime}/" \ 
     587      ${F_JOB_DEBUG} > ${libIGCM}'/'${n_f} 
     588  chmod u+x ${libIGCM}'/'${n_f} 
     589 
     590  # update Headers so that ressources description are accurate (MPMD/SPMD/...) 
     591  IGCM_sys_updateHeaders ${libIGCM}'/'${n_f} 
     592   
    575593done 
    576594 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys.ksh

    r1568 r1569  
    16411641  IGCM_debug_PopStack "IGCM_sys_cdo" 
    16421642} 
    1643  
    16441643#  
     1644#D-#================================================== 
     1645#D-function IGCM_sys_create_run_dir 
     1646#D-* Purpose: stop the simulation in order to work into the run_dir directory 
     1647#D-* Examples: 
     1648#D- 
     1649function IGCM_sys_create_run_dir { 
     1650  IGCM_debug_PushStack "IGCM_sys_create_run_dir" 
     1651  if ( $DEBUG_sys ) ; then 
     1652    echo "IGCM_sys_create_run_dir :" 
     1653  fi 
     1654  if [ -f ${libIGCM}/Job_debug_${config_UserChoices_JobName} ] ; then 
     1655 
     1656      CPL_comp=n ; SRF_comp=n ; OCE_comp=n ; CHM_comp=n 
     1657      for comp in ${config_ListOfComponents[*]} ; do 
     1658        [ "X${comp}" = "XCPL" ] && CPL_comp=y 
     1659        [ "X${comp}" = "XSRF" ] && SRF_comp=y 
     1660        [ "X${comp}" = "XOCE" ] && OCE_comp=y 
     1661        [ "X${comp}" = "XCHM" ] && CHM_comp=y 
     1662        eval ExeNameIn=\${config_Executable_${comp}[0]} 
     1663        eval ExeNameOut=\${config_Executable_${comp}[1]} 
     1664        if [ X${ExeNameIn} != X\"\" ] ; then 
     1665          eval ExeNameIn=${ExeNameIn} 
     1666          echo "$ExeNameIn"" ""$ExeNameOut" >> components_binary.txt  
     1667        fi 
     1668      done 
     1669   SUBMIT_DIRECTORY=$(grep SUBMIT_DIR ${libIGCM}/libIGCM_sys/libIGCM_sys_${SYSTEM}.ksh | grep -m1 typeset | cut -dx -f2) 
     1670      sed -e "s%::ENVFILE::%${EnvFile}%" \ 
     1671          -e "s%::EXECUTION::%${EXECUTION}%" \ 
     1672          -e "s%::EXECUTION_TYPE::%${executionType}%" \ 
     1673          -e "s%::JOBNAME::%${config_UserChoices_JobName}%" \ 
     1674          -e "s%::SUBMIT_DIR::%${SUBMIT_DIRECTORY}%" \ 
     1675          -e "s%::CPL_comp::%${CPL_comp}%" \ 
     1676          -e "s%::OCE_comp::%${OCE_comp}%" \ 
     1677          -e "s%::SRF_comp::%${SRF_comp}%" \ 
     1678          -e "s%::CHM_comp::%${CHM_comp}%" \ 
     1679          ${libIGCM}/Job_debug_${config_UserChoices_JobName} > ${RUN_DIR}/Job_debug_${config_UserChoices_JobName} 
     1680      echo 
     1681      echo "############################################" 
     1682      echo "#    DEBUG PHASE : CREATION OF RUN_DIR    #" 
     1683      echo "############################################" 
     1684      echo 
     1685      echo "You are in development or debug phase" 
     1686      echo "You can run directly into the running directory which is here " 
     1687      echo ${RUN_DIR} 
     1688      echo "Inside the run directory you will find a Job_debug_${config_UserChoices_JobName}" 
     1689      echo "to be used to launch the run as follows :" 
     1690      echo "${SUBMIT} Job_debug_${config_UserChoices_JobName}" 
     1691      exit 
     1692  else 
     1693      echo "############################################" 
     1694      echo "#    DEBUG PHASE : CREATION OF RUN_DIR    #" 
     1695      echo "############################################" 
     1696      echo 
     1697      echo "You are in development or debug phase" 
     1698      echo "You can run directly into the running directory which is here " 
     1699      echo ${RUN_DIR} 
     1700      exit 
     1701  fi 
     1702  
     1703  IGCM_debug_PopStack "IGCM_sys_create_run_dir" 
     1704} 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_irene-amd.ksh

    r1544 r1569  
    3838#==================================================== 
    3939# Turn in dry run mode ? (sys_Put_Rest, sys_Put_Out, sys_Get) 
    40 typeset -r DRYRUN=${DRYRUN:=0} 
     40if ([ X${DRYRUN} != X\"\" ] && [ ${DRYRUN} = 4 ]) ; then 
     41  typeset -r DRYRUN=0 
     42  typeset -r DRYRUN_DEBUG=4 
     43else 
     44  typeset -r DRYRUN=${DRYRUN:=0} 
     45  typeset -r DRYRUN_DEBUG=0 
     46fi 
    4147 
    4248# YOU MUST COMPILE YOUR EXE FILES FOR DRYRUN MODE ! 
     
    5460# |    3     |       yes           |    no      |  no     |      no                   | 
    5561# ------------------------------------------------------------------------------------- 
     62# |    4     |       yes           |    yes     |  creation of RUN_DIR and Job_debug  | 
     63# ------------------------------------------------------------------------------------- 
     64 
    5665 
    5766#===================================================== 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_irene.ksh

    r1512 r1569  
    3838#==================================================== 
    3939# Turn in dry run mode ? (sys_Put_Rest, sys_Put_Out, sys_Get) 
    40 typeset -r DRYRUN=${DRYRUN:=0} 
     40if ([ X${DRYRUN} != X ] && [ ${DRYRUN} = 4 ]) ; then 
     41  typeset -r DRYRUN=0 
     42  typeset -r DRYRUN_DEBUG=4 
     43else 
     44  typeset -r DRYRUN=${DRYRUN:=0} 
     45  typeset -r DRYRUN_DEBUG=0 
     46fi 
     47 
    4148 
    4249# YOU MUST COMPILE YOUR EXE FILES FOR DRYRUN MODE ! 
     
    5461# |    3     |       yes           |    no      |  no     |      no                   | 
    5562# ------------------------------------------------------------------------------------- 
     63# |    4     |       yes           |    yes     |  creation of RUN_DIR and Job_debug  | 
     64# ------------------------------------------------------------------------------------- 
     65 
    5666 
    5767#===================================================== 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_jeanzay.ksh

    r1556 r1569  
    3838#==================================================== 
    3939# Turn in dry run mode ? (sys_Put_Rest, sys_Put_Out, sys_Get) 
    40 typeset -r DRYRUN=${DRYRUN:=0} 
     40if ([ X${DRYRUN} != X ] && [ ${DRYRUN} = 4 ]) ; then 
     41  typeset -r DRYRUN=0 
     42  typeset -r DRYRUN_DEBUG=4 
     43else 
     44  typeset -r DRYRUN=${DRYRUN:=0} 
     45  typeset -r DRYRUN_DEBUG=0 
     46fi 
    4147 
    4248# YOU MUST COMPILE YOUR EXE FILES FOR DRYRUN MODE ! 
     
    5460# |    3     |       yes           |    no      |  no     |      no                   | 
    5561# ------------------------------------------------------------------------------------- 
     62# |    4     |       yes           |    yes     |  creation of RUN_DIR and Job_debug  | 
     63# ------------------------------------------------------------------------------------- 
     64 
    5665 
    5766#===================================================== 
     
    14061415             (( index_host = current_core / NB_CORE_PER_NODE )) 
    14071416             host_value=${listnodes[${index_host}]} 
    1408                echo "$host_value" >> hostlist 
     1417             echo "$host_value" >> hostlist 
     1418             if [ ${DRYRUN_DEBUG} = 4 ] ; then 
     1419                 echo "node_${index_host}_X" >> hostlist_template 
     1420             fi 
    14091421             (( current_core = current_core + offset_comp_proc_loc )) 
    14101422          done 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_mesoipsl.ksh

    r1558 r1569  
    3838#==================================================== 
    3939# Turn in dry run mode ? (sys_Put_Rest, sys_Put_Out, sys_Get) 
    40 typeset -r DRYRUN=${DRYRUN:=0} 
     40if ([ X${DRYRUN} != X ] && [ ${DRYRUN} = 4 ]) ; then 
     41  typeset -r DRYRUN=0 
     42  typeset -r DRYRUN_DEBUG=4 
     43else 
     44  typeset -r DRYRUN=${DRYRUN:=0} 
     45  typeset -r DRYRUN_DEBUG=0 
     46fi 
    4147 
    4248# YOU MUST COMPILE YOUR EXE FILES FOR DRYRUN MODE ! 
     
    5359# ------------------------------------------------------------------------------------- 
    5460# |    3     |       yes           |    no      |  no     |      no                   | 
     61# ------------------------------------------------------------------------------------- 
     62# |    4     |       yes           |    yes     |  creation of RUN_DIR and Job_debug  | 
    5563# ------------------------------------------------------------------------------------- 
    5664 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh

    r1487 r1569  
    3838#==================================================== 
    3939# Turn in dry run mode ? (sys_Put_Rest, sys_Put_Out, sys_Get) 
    40 typeset -r DRYRUN=${DRYRUN:=0} 
     40if ([ X${DRYRUN} != X ] && [ ${DRYRUN} = 4 ]) ; then 
     41  typeset -r DRYRUN=0 
     42  typeset -r DRYRUN_DEBUG=4 
     43else 
     44  typeset -r DRYRUN=${DRYRUN:=0} 
     45  typeset -r DRYRUN_DEBUG=0 
     46fi 
    4147 
    4248# YOU MUST COMPILE YOUR EXE FILES FOR DRYRUN MODE ! 
     
    5460# |    3     |       yes           |    no      |  no     |      no                   | 
    5561# ------------------------------------------------------------------------------------- 
     62# |    4     |       yes           |    yes     |  creation of RUN_DIR and Job_debug  | 
     63# ------------------------------------------------------------------------------------- 
     64 
    5665 
    5766#===================================================== 
     
    140149#==================================================== 
    141150#- RUN_DIR_PATH : Temporary working directory (=> TMP) 
    142 if [ X${PBS_JOBID} != X ] ; then 
    143   typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=/scratch/$PBS_O_LOGNAME.$PBS_JOBID} 
     151if [ ${DRYRUN_DEBUG} = 4 ] ; then 
     152    typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=/home/scratch01/$LOGIN/RUN_DIR} 
    144153else 
    145   typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=/tmp/tmp$$} 
     154    if [ X${PBS_JOBID} != X ] ; then 
     155        typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=/scratch/$PBS_O_LOGNAME.$PBS_JOBID} 
     156    else 
     157        typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=/tmp/tmp$$} 
     158    fi 
    146159fi 
    147160 
Note: See TracChangeset for help on using the changeset viewer.