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_mercure.ksh

    r717 r719  
    559559#D-  Error values and explanations can depend on your system version. 
    560560function IGCM_sys_Rsync_out { 
    561   RET=$1 
    562   if [ ! $RET ] ; then 
     561  status=$1 
     562  if [ ! $status ] ; then 
    563563    echo "rsync error !" 
    564564  fi 
    565565 
    566566  if [ $MYLANG = "fr" ]; then 
    567     case $RET in 
     567    case $status in 
    568568    0)  return ;; 
    569569    1)  echo "Erreur de rsync ; RERR_SYNTAX : " 
     
    613613      echo "Temps d'attente écoulé dans l'envoi/réception de données" 
    614614      return;; 
    615     *)  echo "Erreur de rsync : code de retour de rsync inconnu :" $RET 
     615    *)  echo "Erreur de rsync : code de retour de rsync inconnu :" $status 
    616616      return;; 
    617617    esac 
    618618  elif [ $MYLANG = "en" ] ; then 
    619     case $RET in 
     619    case $status in 
    620620    0)  return;; 
    621621    1)  echo "rsync error : Syntax or usage error " 
     
    654654    30) echo "rsync error : Timeout in data send/receive " 
    655655      return;; 
    656     *)  echo "rsync error : return code of rsync unknown :" $RET 
     656    *)  echo "rsync error : return code of rsync unknown :" $status 
    657657      return;; 
    658658    esac 
     
    10781078 
    10791079    if [ X${skip} = Xfalse ] ; then 
    1080       (( i = 0 )) 
     1080      i=0 
    10811081      while [ $i -lt $NB_ESSAI ] ; do 
    10821082        # USUAL WAY 
     
    12141214  IGCM_debug_PushStack "IGCM_sys_Get" $@ 
    12151215 
    1216   typeset DEST RET dm_liste ifile target file_work 
     1216  typeset DEST dm_liste ifile target file_work 
    12171217  typeset NB_ESSAI DELAI status i 
    12181218 
     
    12801280    #fi 
    12811281 
     1282    #   #RSYNC WITH NETWORK SSH CALL 
     1283    #   echo ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1 
     1284    #   ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1 
     1285 
     1286    #   #RSYNC WITH NFS USE 
     1287    #   echo ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1 
     1288    #   ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1 
     1289 
     1290    #   status=$? 
     1291    #   IGCM_sys_Rsync_out $status 
     1292 
     1293    #   ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 
     1294    #   (( status=status+$? )) 
     1295 
    12821296    #USUAL WAY 
    12831297    if [ X${1} = X'/l' ] ; then 
    1284       (( RET=0 )) 
    12851298      for target in ${dm_liste[*]} ; do 
    12861299        local_file=$( basename ${target} ) 
    1287         (( i = 0 )) 
    12881300        # test if the target file is present before the loop 
    12891301        IGCM_sys_TestFileArchive ${target} 
     
    12931305          IGCM_debug_Exit "IGCM_sys_Get" 
    12941306        else 
     1307          i=0 
    12951308          while [ $i -lt $NB_ESSAI ] ; do 
    12961309            \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 
     
    13051318            (( i = i + 1 )) 
    13061319          done 
    1307           (( RET = RET + status )) 
     1320          if [ ${status} -gt 0 ] ; then 
     1321            echo "IGCM_sys_Get : error" 
     1322            cat out_rsync 
     1323            \rm out_rsync 
     1324            IGCM_debug_Exit "IGCM_sys_Get" 
     1325          else 
     1326            \rm out_rsync 
     1327          fi 
    13081328        fi 
    13091329      done 
    13101330    else 
    1311       \cp ${dm_liste} ${DEST} >> out_rsync 2>&1 
    1312       status=$? 
    1313     fi 
    1314  
    1315 #       #RSYNC WITH NETWORK SSH CALL 
    1316 #       echo ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1 
    1317 #       ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1 
    1318  
    1319 #       #RSYNC WITH NFS USE 
    1320 #       echo ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1 
    1321 #       ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1 
    1322  
    1323 #       status=$? 
    1324 #       IGCM_sys_Rsync_out $status 
    1325  
    1326 #       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 
    1327 #       (( RET=RET+$? )) 
    1328  
    1329     if [ ${RET} -gt 0 ] ; then 
    1330       echo "IGCM_sys_Get : error" 
    1331       cat out_rsync 
    1332 #      IGCM_debug_Exit "IGCM_sys_Get" 
    1333     else 
    1334       \rm out_rsync 
     1331      i=0 
     1332      while [ $i -lt $NB_ESSAI ] ; do 
     1333        \cp ${dm_liste} ${DEST} >> out_rsync 2>&1 
     1334        status=$? 
     1335        if [ ${status} -gt 0 ]; then 
     1336          IGCM_debug_Print 2 "IGCM_sys_Get : cp failed error code ${status} ${i}/${NB_ESSAI}" 
     1337          IGCM_debug_Print 2 "IGCM_sys_Get : sleep ${DELAI} seconds and try again." 
     1338          sleep $DELAI 
     1339        else 
     1340          break 
     1341        fi 
     1342        (( i = i + 1 )) 
     1343      done 
     1344      if [ ${status} -gt 0 ] ; then 
     1345        echo "IGCM_sys_Get : error" 
     1346        cat out_rsync 
     1347        \rm out_rsync 
     1348        IGCM_debug_Exit "IGCM_sys_Get" 
     1349      else 
     1350        \rm out_rsync 
     1351      fi 
    13351352    fi 
    13361353  else 
     
    13481365  IGCM_debug_PushStack "IGCM_sys_GetBuffer" $@ 
    13491366 
    1350   typeset DEST RET status buf_liste ifile target file_work 
     1367  typeset DEST buf_liste ifile target file_work 
     1368  typeset NB_ESSAI DELAI status i 
    13511369 
    13521370  if ( $DEBUG_sys ) ; then 
    13531371    echo "IGCM_sys_GetBuffer :" $@ 
    13541372  fi 
     1373 
     1374  # number of tentative 
     1375  NB_ESSAI=3 
     1376  # time delay between tentative 
     1377  DELAI=2 
     1378 
    13551379  if [ $DRYRUN -le 2 ]; then 
    13561380    if [ X${1} = X'/l' ] ; then 
     
    13641388    #USUAL WAY 
    13651389    if [ X${1} = X'/l' ] ; then 
    1366       (( RET=0 )) 
    13671390      for target in ${buf_liste[*]} ; do 
    13681391        local_file=$( basename ${target} ) 
    1369         \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 
    1370         (( RET = RET + $? )) 
     1392        i=0 
     1393        while [ $i -lt $NB_ESSAI ] ; do 
     1394          \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 
     1395          status=$? 
     1396          if [ ${status} -gt 0 ]; then 
     1397            IGCM_debug_Print 2 "IGCM_sys_GetBuffer : cp failed error code ${status} ${i}/${NB_ESSAI}" 
     1398            IGCM_debug_Print 2 "IGCM_sys_GetBuffer : sleep ${DELAI} seconds and try again." 
     1399            sleep $DELAI 
     1400          else 
     1401            break 
     1402          fi 
     1403          (( i = i + 1 )) 
     1404        done 
     1405        if [ ${status} -gt 0 ] ; then 
     1406          echo "IGCM_sys_Get : error" 
     1407          cat out_rsync 
     1408          \rm out_rsync 
     1409          IGCM_debug_Exit "IGCM_sys_GetBuffer" 
     1410        else 
     1411          \rm out_rsync 
     1412        fi 
    13711413      done 
    13721414    else 
    1373       \cp ${buf_liste} ${DEST} >> out_rsync 2>&1 
    1374       status=$? 
    1375     fi 
    1376  
    1377     if [ ${RET} -gt 0 ] ; then 
    1378       echo "IGCM_sys_GetBuffer : error" 
    1379       cat out_rsync 
    1380       \rm out_rsync 
    1381       IGCM_debug_Exit "IGCM_sys_GetBuffer" 
    1382     else 
    1383       \rm out_rsync 
     1415      i=0 
     1416      while [ $i -lt $NB_ESSAI ] ; do 
     1417        \cp ${buf_liste} ${DEST} >> out_rsync 2>&1 
     1418        status=$? 
     1419        if [ ${status} -gt 0 ]; then 
     1420          IGCM_debug_Print 2 "IGCM_sys_GetBuffer : cp failed error code ${status} ${i}/${NB_ESSAI}" 
     1421          IGCM_debug_Print 2 "IGCM_sys_GetBuffer : sleep ${DELAI} seconds and try again." 
     1422          sleep $DELAI 
     1423        else 
     1424          break 
     1425        fi 
     1426        (( i = i + 1 )) 
     1427      done 
     1428      if [ ${status} -gt 0 ] ; then 
     1429        echo "IGCM_sys_Get : error" 
     1430        cat out_rsync 
     1431        \rm out_rsync 
     1432        IGCM_debug_Exit "IGCM_sys_GetBuffer" 
     1433      else 
     1434        \rm out_rsync 
     1435      fi 
    13841436    fi 
    13851437  else 
     
    15521604  i=0 
    15531605  while [ $i -lt $NB_ESSAI ] ; do 
    1554       /home/cont003/p86ipsl/X86_64/bin/rebuild -f -o $@ > out_rsync 2>&1 
     1606    /home/cont003/p86ipsl/X86_64/bin/rebuild -f -o $@ > out_rsync 2>&1 
    15551607    status=$? 
    15561608    if [ ${status} -gt 0 ] ; then 
Note: See TracChangeset for help on using the changeset viewer.