Ignore:
Timestamp:
03/30/15 17:18:46 (9 years ago)
Author:
sdipsl
Message:

house keeping in libIGCM_sys (third pass). Will ease #248 and #251

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh

    r1179 r1180  
    6464# Host and user names 
    6565# $hostname ou hostname 
    66 typeset  HOST=${HOST:=$( hostname )} 
     66typeset HOST=${HOST:=$( hostname )} 
    6767# $username ou whoami 
    68 typeset  LOGIN=${LOGIN:=$( whoami )} 
     68typeset LOGIN=${LOGIN:=$( whoami )} 
    6969# $hostname of the MASTER job 
    70 typeset MASTER=${HOST} 
     70typeset MASTER=${MASTER:=$( hostname )} 
    7171 
    7272#D- 
     
    8585 
    8686#==================================================== 
    87 # Set environment tools (ferret, nco, cdo) 
     87# Set environment tools (ferret, nco, cdo, rebuild, ...) 
    8888#==================================================== 
    8989#. /home/${LOGIN}/.atlas_env_${HOST}_ksh 
    90  
    91 export PATH=${PATH}:/home/jripsl/snapshot/Monitoring/CNClient/ 
     90#export PATH=${PATH}:/home/${LOGIN}/rebuild/bin/ 
    9291 
    9392#==================================================== 
     
    131130#- Max number of arguments passed to nco operator or demigration command 
    132131UNIX_MAX_LIMIT=360 
     132 
     133#==================================================== 
     134#- set PackDefault to false on obelix 
     135PackDefault=false 
    133136 
    134137#==================================================== 
     
    207210function IGCM_sys_RshMaster { 
    208211  IGCM_debug_PushStack "IGCM_sys_RshMaster" $@ 
    209   /bin/ksh <<-EOF 
     212  OUTCOMMAND_PATH=${OUTCOMMAND_PATH} /bin/ksh <<-EOF 
    210213    export libIGCM=${libIGCM} 
    211214    export DEBUG_debug=${DEBUG_debug} 
     
    264267  fi 
    265268  # keep standard input (stdin) for the loop onto temporary file 
    266   cat >/tmp/tmp_IGCM_sys_RshPost_$$_${LOGNAME} 
    267  
    268   /bin/ksh </tmp/tmp_IGCM_sys_RshPost_$$_${LOGNAME} 
     269  cat >${OUTCOMMAND_PATH}/tmp_IGCM_sys_RshPost_$$_${LOGNAME} 
     270 
     271  OUTCOMMAND_PATH=${OUTCOMMAND_PATH} /bin/ksh <${OUTCOMMAND_PATH}/tmp_IGCM_sys_RshPost_$$_${LOGNAME} 
    269272  if [ $? -gt 0 ] ; then 
    270273    echo "IGCM_sys_RshPost : erreur." 
     
    272275  fi 
    273276  # delete temporary file 
    274   \rm /tmp/tmp_IGCM_sys_RshPost_$$_${LOGNAME} 
     277  \rm ${OUTCOMMAND_PATH}/tmp_IGCM_sys_RshPost_$$_${LOGNAME} 
    275278  IGCM_debug_PopStack "IGCM_sys_RshPost" 
    276279} 
     
    304307 
    305308  if [ ! -z ${config_UserChoices_MailName} ] ; then 
    306     mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} < mail.txt 
     309    mail -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} < mail.txt 
    307310  elif [ -f ~/.forward ] ; then 
    308     mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < mail.txt 
     311    mail -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < mail.txt 
     312  else 
     313    mail -s "${config_UserChoices_JobName} ${status}" ${USER} < mail.txt 
    309314  fi 
    310315 
     
    473478#D-#================================================== 
    474479#D-function IGCM_sys_IsFileArchived 
    475 #D-* Purpose: Test file that must NOT EXISTS on Archive 
     480#D-* Purpose: Test file that must NOT EXISTS on Archive based on filename only 
    476481#D-* Examples: 
    477482#D- 
     
    556561  fi 
    557562 
    558   \ls -lR ${@} 
     563  \tree -f $@ 
    559564 
    560565  IGCM_debug_PopStack "IGCM_sys_Tree" 
     
    924929  fi 
    925930  if [ $DRYRUN = 0 ]; then 
    926     typeset status 
    927  
    928     #USUAL WAY 
    929     \cp -ur $1 $2 > ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 2>&1 
    930     status=$? 
     931    typeset NB_ESSAI DELAI status i 
     932    # number of tentative 
     933    NB_ESSAI=3 
     934    # time delay between tentative 
     935    DELAI=2 
     936 
     937    # 
     938    # USUAL WAY 
     939    i=0 
     940    while [ $i -lt $NB_ESSAI ] ; do 
     941      \cp -ur $1 $2 >> ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 2>&1 
     942      status=$? 
     943      if [ ${status} -gt 0 ] ; then 
     944        IGCM_debug_Print 2 "IGCM_sys_Get_Dir : cp failed error code ${status} ${i}/${NB_ESSAI}" 
     945        IGCM_debug_Print 2 "IGCM_sys_Get_Dir : sleep ${DELAI} seconds and try again." 
     946        sleep $DELAI 
     947      else 
     948        break 
     949      fi 
     950      (( i = i + 1 )) 
     951    done 
    931952 
    932953    if [ ${status} -gt 0 ] ; then 
     
    10331054 
    10341055    if [ ${status} -gt 0 ] ; then 
    1035       echo "IGCM_sys_Put_Rest : cp failed error code ${status}" 
     1056      IGCM_debug_Print 2 "IGCM_sys_Put_Rest : cp failed error code ${status}" 
    10361057      [ -f ${1} ] && ls -l ${1} 
    10371058      [ -f ${2} ] && ls -l ${2} 
     
    17191740    echo "IGCM_sys_build_execution_scripts " $@ 
    17201741  fi 
     1742 
    17211743  typeset nodes listnodes init_node start_num init_exec comp ExeNameIn ExeNameOut 
    17221744  typeset node_num_current node_current comp_proc_mpi_loc comp_proc_omp_loc 
    17231745  typeset num_corempi nombre_restant_node nombre_restant_comp 
    1724  
    1725   if [ ! -f ${SUBMIT_DIR}/Job_${config_UserChoices_JobName} ]  ; then 
    1726     IGCM_debug_Exit "IGCM_sys_default build_execution_scripts : Job_${config_UserChoices_JobName} don't exist in SUBMIT_DIR : ${SUBMIT_DIR} " 
    1727   fi 
    17281746 
    17291747  if ( ${OK_PARA_MPMD} ) ; then 
     
    17621780      init_exec=n 
    17631781 
    1764       # Test : if oasis is there, we put it at the first position 
    1765  
     1782      # Build run_file 
     1783 
     1784      # First loop on the components for the coupler ie oasis (only if oasis3) 
     1785      # the coupler ie oasis3 must be the first one 
    17661786      for comp in ${config_ListOfComponents[*]} ; do 
    17671787 
     
    19651985 
    19661986      fi 
     1987 
    19671988    done 
    19681989 
Note: See TracChangeset for help on using the changeset viewer.