Changeset 719 for trunk/libIGCM/libIGCM_sys/libIGCM_sys_titane.ksh
- Timestamp:
- 10/16/12 13:04:38 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libIGCM/libIGCM_sys/libIGCM_sys_titane.ksh
r717 r719 42 42 # YOU MUST COMPILE YOUR EXE FILES FOR DRYRUN MODE ! 43 43 # ------------------------------------------------------------------------------------- 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 | | | | 47 47 # ------------------------------------------------------------------------------------- 48 # | 0 | yes | yes| yes | yes |48 # | 0 | yes | yes | yes | yes | 49 49 # ------------------------------------------------------------------------------------- 50 # | 1 | yes | yes| yes | no |50 # | 1 | yes | yes | yes | no | 51 51 # ------------------------------------------------------------------------------------- 52 # | 2 | yes | yes| no | no |52 # | 2 | yes | yes | no | no | 53 53 # ------------------------------------------------------------------------------------- 54 # | 3 | yes | no| no | no |54 # | 3 | yes | no | no | no | 55 55 # ------------------------------------------------------------------------------------- 56 56 … … 346 346 fi 347 347 348 348 cat << END_MAIL > job_end.mail 349 349 Dear ${LOGIN}, 350 350 … … 738 738 #D- Error values and explanations can depend on your system version. 739 739 function IGCM_sys_Rsync_out { 740 RET=$1741 if [ ! $ RET] ; then740 status=$1 741 if [ ! $status ] ; then 742 742 echo "rsync error !" 743 743 fi 744 744 745 745 if [ $MYLANG = "fr" ]; then 746 case $ RETin746 case $status in 747 747 0) return ;; 748 748 1) echo "Erreur de rsync ; RERR_SYNTAX : " … … 792 792 echo "Temps d'attente écoulé dans l'envoi/réception de données" 793 793 return;; 794 *) echo "Erreur de rsync : code de retour de rsync inconnu :" $ RET794 *) echo "Erreur de rsync : code de retour de rsync inconnu :" $status 795 795 return;; 796 796 esac 797 797 elif [ $MYLANG = "en" ] ; then 798 case $ RETin798 case $status in 799 799 0) return;; 800 800 1) echo "rsync error : Syntax or usage error " … … 833 833 30) echo "rsync error : Timeout in data send/receive " 834 834 return;; 835 *) echo "rsync error : return code of rsync unknown :" $ RET835 *) echo "rsync error : return code of rsync unknown :" $status 836 836 return;; 837 837 esac … … 1302 1302 1303 1303 if [ X${skip} = Xfalse ] ; then 1304 (( i = 0 ))1304 i=0 1305 1305 while [ $i -lt $NB_ESSAI ] ; do 1306 1306 # USUAL WAY … … 1437 1437 IGCM_debug_PushStack "IGCM_sys_Get" $@ 1438 1438 1439 typeset DEST RETdm_liste ifile target file_work1439 typeset DEST dm_liste ifile target file_work 1440 1440 typeset NB_ESSAI DELAI status i 1441 1441 … … 1503 1503 #fi 1504 1504 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 1505 1519 #USUAL WAY 1506 1520 if [ X${1} = X'/l' ] ; then 1507 (( RET=0 ))1508 1521 for target in ${dm_liste[*]} ; do 1509 1522 local_file=$( basename ${target} ) 1510 (( i = 0 ))1511 1523 # test if the target file is present before the loop 1512 1524 IGCM_sys_TestFileArchive ${target} … … 1516 1528 IGCM_debug_Exit "IGCM_sys_Get" 1517 1529 else 1530 i=0 1518 1531 while [ $i -lt $NB_ESSAI ] ; do 1519 1532 \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 … … 1528 1541 (( i = i + 1 )) 1529 1542 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 1531 1551 fi 1532 1552 done 1533 1553 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 1559 1575 fi 1560 1576 else … … 1572 1588 IGCM_debug_PushStack "IGCM_sys_GetBuffer" $@ 1573 1589 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 1575 1592 1576 1593 if ( $DEBUG_sys ) ; then 1577 1594 echo "IGCM_sys_GetBuffer :" $@ 1578 1595 fi 1596 1597 # number of tentative 1598 NB_ESSAI=3 1599 # time delay between tentative 1600 DELAI=2 1601 1579 1602 if [ $DRYRUN -le 2 ]; then 1580 1603 if [ X${1} = X'/l' ] ; then … … 1588 1611 #USUAL WAY 1589 1612 if [ X${1} = X'/l' ] ; then 1590 (( RET=0 ))1591 1613 for target in ${buf_liste[*]} ; do 1592 1614 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 1595 1636 done 1596 1637 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 1608 1659 fi 1609 1660 else
Note: See TracChangeset
for help on using the changeset viewer.