Ignore:
Timestamp:
10/16/12 13:04:38 (12 years ago)
Author:
sdipsl
Message:
  • curie, titane, mercurex9, mercure : minor bugfixes coming from r716 and r717. Further systematic loop over cp command
  • obelix, vargas, ulam : cosmetics
File:
1 edited

Legend:

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

    r717 r719  
    4242# YOU MUST COMPILE YOUR EXE FILES FOR DRYRUN MODE ! 
    4343# ------------------------------------------------------------------------------------- 
    44 # | DRYRUN=  |  Date computations, | sys_Get    |  Exe    | sys_Put_Out; sys_Put_Rest | 
    45 # |          |  Cp/Exe param files |            |  Chmod  |                           | 
    46 # |          |      Qsub           |            |         |                           | 
     44# | DRYRUN=  |  Date computations, | sys_Get    |  Exe    | sys_Put_Out; sys_Put_Rest | 
     45# |          |  Cp/Exe param files |            |  Chmod  |                           | 
     46# |          |      Qsub           |            |         |                           | 
    4747# ------------------------------------------------------------------------------------- 
    48 # |    0     |       yes           |    yes     |  yes    |      yes                  | 
     48# |    0     |       yes           |    yes     |  yes    |      yes                  | 
    4949# ------------------------------------------------------------------------------------- 
    50 # |    1     |       yes           |    yes     |  yes    |      no                   | 
     50# |    1     |       yes           |    yes     |  yes    |      no                   | 
    5151# ------------------------------------------------------------------------------------- 
    52 # |    2     |       yes           |    yes     |  no     |      no                   | 
     52# |    2     |       yes           |    yes     |  no     |      no                   | 
    5353# ------------------------------------------------------------------------------------- 
    54 # |    3     |       yes           |    no      |  no     |      no                   | 
     54# |    3     |       yes           |    no      |  no     |      no                   | 
    5555# ------------------------------------------------------------------------------------- 
    5656 
     
    346346  fi 
    347347 
    348     cat  << END_MAIL > job_end.mail 
     348  cat  << END_MAIL > job_end.mail 
    349349Dear ${LOGIN}, 
    350350 
     
    738738#D-  Error values and explanations can depend on your system version. 
    739739function IGCM_sys_Rsync_out { 
    740   RET=$1 
    741   if [ ! $RET ] ; then 
     740  status=$1 
     741  if [ ! $status ] ; then 
    742742    echo "rsync error !" 
    743743  fi 
    744744 
    745745  if [ $MYLANG = "fr" ]; then 
    746     case $RET in 
     746    case $status in 
    747747    0)  return ;; 
    748748    1)  echo "Erreur de rsync ; RERR_SYNTAX : " 
     
    792792      echo "Temps d'attente écoulé dans l'envoi/réception de données" 
    793793      return;; 
    794     *)  echo "Erreur de rsync : code de retour de rsync inconnu :" $RET 
     794    *)  echo "Erreur de rsync : code de retour de rsync inconnu :" $status 
    795795      return;; 
    796796    esac 
    797797  elif [ $MYLANG = "en" ] ; then 
    798     case $RET in 
     798    case $status in 
    799799    0)  return;; 
    800800    1)  echo "rsync error : Syntax or usage error " 
     
    833833    30) echo "rsync error : Timeout in data send/receive " 
    834834      return;; 
    835     *)  echo "rsync error : return code of rsync unknown :" $RET 
     835    *)  echo "rsync error : return code of rsync unknown :" $status 
    836836      return;; 
    837837    esac 
     
    13021302 
    13031303    if [ X${skip} = Xfalse ] ; then 
    1304       (( i = 0 )) 
     1304      i=0 
    13051305      while [ $i -lt $NB_ESSAI ] ; do 
    13061306        # USUAL WAY 
     
    14371437  IGCM_debug_PushStack "IGCM_sys_Get" $@ 
    14381438 
    1439   typeset DEST RET dm_liste ifile target file_work 
     1439  typeset DEST dm_liste ifile target file_work 
    14401440  typeset NB_ESSAI DELAI status i 
    14411441 
     
    15031503    #fi 
    15041504 
     1505    #   #RSYNC WITH NETWORK SSH CALL 
     1506    #   echo ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1 
     1507    #   ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1 
     1508 
     1509    #   #RSYNC WITH NFS USE 
     1510    #   echo ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1 
     1511    #   ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1 
     1512 
     1513    #   status=$? 
     1514    #   IGCM_sys_Rsync_out $status 
     1515 
     1516    #   ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 
     1517    #   (( status=status+$? )) 
     1518 
    15051519    #USUAL WAY 
    15061520    if [ X${1} = X'/l' ] ; then 
    1507       (( RET=0 )) 
    15081521      for target in ${dm_liste[*]} ; do 
    15091522        local_file=$( basename ${target} ) 
    1510         (( i = 0 )) 
    15111523        # test if the target file is present before the loop 
    15121524        IGCM_sys_TestFileArchive ${target} 
     
    15161528          IGCM_debug_Exit "IGCM_sys_Get" 
    15171529        else 
     1530          i=0 
    15181531          while [ $i -lt $NB_ESSAI ] ; do 
    15191532            \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 
     
    15281541            (( i = i + 1 )) 
    15291542          done 
    1530           (( RET = RET + status )) 
     1543          if [ ${status} -gt 0 ] ; then 
     1544            echo "IGCM_sys_Get : error" 
     1545            cat out_rsync 
     1546            \rm out_rsync 
     1547            IGCM_debug_Exit "IGCM_sys_Get" 
     1548          else 
     1549            \rm out_rsync 
     1550          fi 
    15311551        fi 
    15321552      done 
    15331553    else 
    1534       \cp ${dm_liste} ${DEST} >> out_rsync 2>&1 
    1535       status=$? 
    1536     fi 
    1537  
    1538 #       #RSYNC WITH NETWORK SSH CALL 
    1539 #       echo ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1 
    1540 #       ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1 
    1541  
    1542 #       #RSYNC WITH NFS USE 
    1543 #       echo ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1 
    1544 #       ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1 
    1545  
    1546 #       status=$? 
    1547 #       IGCM_sys_Rsync_out $status 
    1548  
    1549 #       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 
    1550 #       (( RET=RET+$? )) 
    1551  
    1552     if [ ${RET} -gt 0 ] ; then 
    1553       echo "IGCM_sys_Get : error" 
    1554       cat out_rsync 
    1555       \rm out_rsync 
    1556       IGCM_debug_Exit "IGCM_sys_Get" 
    1557     else 
    1558       \rm out_rsync 
     1554      i=0 
     1555      while [ $i -lt $NB_ESSAI ] ; do 
     1556        \cp ${dm_liste} ${DEST} >> out_rsync 2>&1 
     1557        status=$? 
     1558        if [ ${status} -gt 0 ]; then 
     1559          IGCM_debug_Print 2 "IGCM_sys_Get : cp failed error code ${status} ${i}/${NB_ESSAI}" 
     1560          IGCM_debug_Print 2 "IGCM_sys_Get : sleep ${DELAI} seconds and try again." 
     1561          sleep $DELAI 
     1562        else 
     1563          break 
     1564        fi 
     1565        (( i = i + 1 )) 
     1566      done 
     1567      if [ ${status} -gt 0 ] ; then 
     1568        echo "IGCM_sys_Get : error" 
     1569        cat out_rsync 
     1570        \rm out_rsync 
     1571        IGCM_debug_Exit "IGCM_sys_Get" 
     1572      else 
     1573        \rm out_rsync 
     1574      fi 
    15591575    fi 
    15601576  else 
     
    15721588  IGCM_debug_PushStack "IGCM_sys_GetBuffer" $@ 
    15731589 
    1574   typeset DEST RET status buf_liste ifile target file_work 
     1590  typeset DEST buf_liste ifile target file_work 
     1591  typeset NB_ESSAI DELAI status i 
    15751592 
    15761593  if ( $DEBUG_sys ) ; then 
    15771594    echo "IGCM_sys_GetBuffer :" $@ 
    15781595  fi 
     1596 
     1597  # number of tentative 
     1598  NB_ESSAI=3 
     1599  # time delay between tentative 
     1600  DELAI=2 
     1601 
    15791602  if [ $DRYRUN -le 2 ]; then 
    15801603    if [ X${1} = X'/l' ] ; then 
     
    15881611    #USUAL WAY 
    15891612    if [ X${1} = X'/l' ] ; then 
    1590       (( RET=0 )) 
    15911613      for target in ${buf_liste[*]} ; do 
    15921614        local_file=$( basename ${target} ) 
    1593         \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 
    1594         (( RET = RET + $? )) 
     1615        i=0 
     1616        while [ $i -lt $NB_ESSAI ] ; do 
     1617          \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 
     1618          status=$? 
     1619          if [ ${status} -gt 0 ]; then 
     1620            IGCM_debug_Print 2 "IGCM_sys_GetBuffer : cp failed error code ${status} ${i}/${NB_ESSAI}" 
     1621            IGCM_debug_Print 2 "IGCM_sys_GetBuffer : sleep ${DELAI} seconds and try again." 
     1622            sleep $DELAI 
     1623          else 
     1624            break 
     1625          fi 
     1626          (( i = i + 1 )) 
     1627        done 
     1628        if [ ${status} -gt 0 ] ; then 
     1629          echo "IGCM_sys_Get : error" 
     1630          cat out_rsync 
     1631          \rm out_rsync 
     1632          IGCM_debug_Exit "IGCM_sys_GetBuffer" 
     1633        else 
     1634          \rm out_rsync 
     1635        fi 
    15951636      done 
    15961637    else 
    1597       \cp ${buf_liste} ${DEST} >> out_rsync 2>&1 
    1598       status=$? 
    1599     fi 
    1600  
    1601     if [ ${RET} -gt 0 ] ; then 
    1602       echo "IGCM_sys_GetBuffer : error" 
    1603       cat out_rsync 
    1604       \rm out_rsync 
    1605       IGCM_debug_Exit "IGCM_sys_GetBuffer" 
    1606     else 
    1607       \rm out_rsync 
     1638      i=0 
     1639      while [ $i -lt $NB_ESSAI ] ; do 
     1640        \cp ${buf_liste} ${DEST} >> out_rsync 2>&1 
     1641        status=$? 
     1642        if [ ${status} -gt 0 ]; then 
     1643          IGCM_debug_Print 2 "IGCM_sys_GetBuffer : cp failed error code ${status} ${i}/${NB_ESSAI}" 
     1644          IGCM_debug_Print 2 "IGCM_sys_GetBuffer : sleep ${DELAI} seconds and try again." 
     1645          sleep $DELAI 
     1646        else 
     1647          break 
     1648        fi 
     1649        (( i = i + 1 )) 
     1650      done 
     1651      if [ ${status} -gt 0 ] ; then 
     1652        echo "IGCM_sys_Get : error" 
     1653        cat out_rsync 
     1654        \rm out_rsync 
     1655        IGCM_debug_Exit "IGCM_sys_GetBuffer" 
     1656      else 
     1657        \rm out_rsync 
     1658      fi 
    16081659    fi 
    16091660  else 
Note: See TracChangeset for help on using the changeset viewer.