Ignore:
Timestamp:
10/12/12 15:00:41 (12 years ago)
Author:
sdipsl
Message:
  • all available machine but IDRIS (will change soon) : print error code from mv, cp, ...
File:
1 edited

Legend:

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

    r705 r717  
    112112 
    113113#==================================================== 
    114 #- MirrorlibIGCM uncomment for frontend 
     114#- MirrorlibIGCM for frontend 
    115115typeset -r MirrorlibIGCM=${MirrorlibIGCM:=false} 
    116116 
    117117#==================================================== 
    118 #- libIGCM_POST uncomment for frontend 
     118#- libIGCM_POST for frontend 
    119119typeset -r libIGCM_POST=${libIGCM} 
    120120 
     
    137137#- IN 
    138138typeset -r R_IN=${R_IN:=/ccc/work/cont003/dsm/p86ipsl/IGCM} 
    139 typeset -r R_IN_ECMWF=${R_IN_ECMWF:=/dmnfs/cont003/p24data} 
     139typeset -r R_IN_ECMWF=${R_IN_ECMWF:=/ccc/work/cont003/dsm/p24data} 
    140140 
    141141#==================================================== 
     
    245245    IGCM_debug_Exit "IGCM_sys_RshPost" 
    246246  fi 
     247  # delete temporary file 
    247248  \rm tmp_IGCM_sys_RshPost_$$ 
    248249 
     
    291292    status=completed 
    292293  fi 
     294 
    293295  cat  << END_MAIL > job_end.mail 
    294   Dear ${LOGIN}, 
     296Dear ${LOGIN}, 
    295297 
    296298  Simulation ${config_UserChoices_JobName} is ${status} on supercomputer `hostname`. 
     
    354356  fi 
    355357  #- creation de repertoire sur le serveur fichier 
    356   if [ ! -d ${1} ]; then  
     358  if [ ! -d ${1} ]; then 
    357359    \mkdir -p $1 
    358360    if [ $? -gt 0 ] ; then 
     
    375377  fi 
    376378  #- creation de repertoire sur le serveur fichier 
    377   if [ ! -d ${1} ]; then  
     379  if [ ! -d ${1} ]; then 
    378380    \mkdir -p $1 
    379381    if [ $? -gt 0 ] ; then 
     
    664666 
    665667#D-************************* 
    666 #D- File transfer functions  
     668#D- File transfer functions 
    667669#D-************************* 
    668670#D- 
     
    733735  elif [ $MYLANG = "en" ] ; then 
    734736    case $RET in 
    735     0)  return;;                 
     737    0)  return;; 
    736738    1)  echo "rsync error : Syntax or usage error " 
    737739      return;; 
     
    789791  fi 
    790792 
    791   typeset RET DEST 
     793  typeset status DEST 
    792794 
    793795  mkdir -p ${HOME}/MIRROR/${PATHlibIGCM} 
     
    795797  echo ${RSYNC} ${RSYNC_opt} ${libIGCM} ${HOME}/MIRROR/${PATHlibIGCM} > out_rsync 2>&1 
    796798  ${RSYNC} ${RSYNC_opt} ${libIGCM} ${HOME}/MIRROR/${PATHlibIGCM} >> out_rsync 2>&1 
    797   RET=$? 
    798  
    799   if [ ${RET} -gt 0 ] ; then 
     799  status=$? 
     800 
     801  if [ ${status} -gt 0 ] ; then 
    800802    echo "IGCM_sys_Mirror_libIGCM Warning : no libIGCM on cesium." 
    801803    cat out_rsync 
     
    815817  fi 
    816818 
    817   typeset RET 
     819  typeset status 
    818820 
    819821  echo cp $@ > out_rsync 2>&1 
    820822  \cp $@ >> out_rsync 2>&1 
    821   RET=$? 
    822  
    823   if [ ${RET} -gt 0 ] ; then 
    824     echo "IGCM_sys_Cp : error." 
     823  status=$? 
     824 
     825  if [ ${status} -gt 0 ] ; then 
     826    echo "IGCM_sys_Cp : error code ${status}" 
    825827    cat out_rsync 
    826828    IGCM_debug_Exit "IGCM_sys_Cp" 
     
    842844  fi 
    843845 
    844   typeset RET 
     846  typeset status 
    845847 
    846848  echo rm $@ > out_rsync 2>&1 
    847849  \rm $@ >> out_rsync 2>&1 
    848   RET=$? 
    849  
    850   if [ ${RET} -gt 0 ] ; then 
    851     echo "IGCM_sys_Rm : error." 
     850  status=$? 
     851 
     852  if [ ${status} -gt 0 ] ; then 
     853    echo "IGCM_sys_Rm : error code ${status}" 
    852854    cat out_rsync 
    853855    IGCM_debug_Exit "IGCM_sys_Rm" 
     
    871873  if [ $DRYRUN = 0 ]; then 
    872874 
    873     typeset RET 
    874      
     875    typeset status 
     876 
    875877    echo mv $@ > out_rsync 2>&1 
    876878    \mv $@ >> out_rsync 2>&1 
    877     RET=$? 
    878      
    879     if [ ${RET} -gt 0 ] ; then 
    880       echo "IGCM_sys_Mv : error in mv." 
     879    status=$? 
     880 
     881    if [ ${status} -gt 0 ] ; then 
     882      echo "IGCM_sys_Mv : error code ${status}" 
    881883      cat out_rsync 
    882884      IGCM_debug_Exit "IGCM_sys_Mv" 
     
    908910    fi 
    909911 
    910     typeset RET 
     912    typeset status 
    911913 
    912914    # Only if we use rsync 
     
    915917    #USUAL WAY 
    916918    \cp -r $1 $2 > out_rsync 2>&1 
    917     RET=$? 
    918  
    919     if [ ${RET} -gt 0 ] ; then 
    920       echo "IGCM_sys_Put_Dir : error." 
     919    status=$? 
     920 
     921    if [ ${status} -gt 0 ] ; then 
     922      echo "IGCM_sys_Put_Dir : error code ${status}" 
    921923      cat out_rsync 
    922924      IGCM_debug_Exit "IGCM_sys_Put_Dir" 
     
    947949#    fi 
    948950 
    949     typeset RET 
     951    typeset NB_ESSAI DELAI status i 
     952    # number of tentative 
     953    NB_ESSAI=3 
     954    # time delay between tentative 
     955    DELAI=2 
    950956 
    951957    # Only if we use rsync 
     
    953959    # 
    954960    # USUAL WAY 
    955     # add dmfind/dmget (to demigrate all offline files) : 
    956     #dmfind $1 -state MIG -o -state OFL -o -state PAR | dmget 
    957     \cp -r $1 $2 > out_rsync 2>&1 
    958     RET=$? 
    959  
    960     if [ ${RET} -gt 0 ] ; then 
     961    # add 'ccc_hsm get' (to demigrate all offline files) to reduce time of this command : 
     962    ccc_hsm get -r $1 
     963 
     964    i=0 
     965    while [ $i -lt $NB_ESSAI ] ; do 
     966      \cp -ur $1 $2 >> out_rsync 2>&1 
     967      status=$? 
     968      if [ ${status} -gt 0 ]; then 
     969        IGCM_debug_Print 2 "IGCM_sys_Get_Dir : cp failed error code ${status} ${i}/${NB_ESSAI}" 
     970        IGCM_debug_Print 2 "IGCM_sys_Get_Dir : sleep ${DELAI} seconds and try again." 
     971        sleep $DELAI 
     972      else 
     973        break 
     974      fi 
     975      (( i = i + 1 )) 
     976    done 
     977 
     978    if [ ${status} -gt 0 ] ; then 
    961979      echo "IGCM_sys_Get_Dir : error." 
    962980      cat out_rsync 
     
    9941012    fi 
    9951013 
    996     typeset RET 
     1014    typeset status 
    9971015    # 
    9981016    if [ X${JobType} = XRUN ] ; then 
     
    10031021    # USUAL WAY 
    10041022    \cp $1 $2 > out_rsync 2>&1 
    1005     RET=$? 
    1006  
    1007 #       #RSYNC WITH NETWORK SSH CALL 
    1008 #       echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > out_rsync 2>&1 
    1009 #       ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> out_rsync 2>&1 
    1010  
    1011      #RSYNC WITH NFS USE 
    1012      echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1 
    1013      ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1 
    1014  
    1015      RET=$? 
    1016      IGCM_sys_Rsync_out $RET 
    1017  
    1018      ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 
    1019      (( RET=RET+$? )) 
    1020  
    1021     if [ ${RET} -gt 0 ] ; then 
    1022       echo "IGCM_sys_Put_Rest : error." 
     1023    status=$? 
     1024 
     1025#       #RSYNC WITH NETWORK SSH CALL 
     1026#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > out_rsync 2>&1 
     1027#       ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> out_rsync 2>&1 
     1028 
     1029     #RSYNC WITH NFS USE 
     1030     echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1 
     1031     ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1 
     1032 
     1033     status=$? 
     1034     IGCM_sys_Rsync_out $status 
     1035 
     1036     ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 
     1037     (( status=status+$? )) 
     1038 
     1039    if [ ${status} -gt 0 ] ; then 
     1040      echo "IGCM_sys_Put_Rest : cp failed error code ${status}" 
    10231041      cat out_rsync 
    10241042      IGCM_debug_Exit "IGCM_sys_Put_Rest" 
     
    10491067    fi 
    10501068 
    1051     typeset RET 
     1069    typeset status 
    10521070    # 
    10531071    if [ X${JobType} = XRUN ] ; then 
     
    10581076    # USUAL WAY 
    10591077    \cp $1 $2 > out_rsync 2>&1 
    1060     RET=$? 
    1061  
    1062     if [ ${RET} -gt 0 ] ; then 
    1063       echo "IGCM_sys_PutBuffer_Rest : error." 
     1078    status=$? 
     1079 
     1080    if [ ${status} -gt 0 ] ; then 
     1081      echo "IGCM_sys_PutBuffer_Rest : error code ${status}" 
    10641082      cat out_rsync 
    10651083      IGCM_debug_Exit "IGCM_sys_PutBuffer_Rest" 
     
    10831101    echo "IGCM_sys_Put_Out :" $@ 
    10841102  fi 
     1103 
     1104  typeset NB_ESSAI DELAI status i exist skip 
     1105 
     1106  # number of tentative 
     1107  NB_ESSAI=3 
     1108  # time delay between tentative 
     1109  DELAI=2 
     1110 
    10851111  if [ $DRYRUN = 0 ]; then 
    10861112    if [ ! -f ${1} ] ; then 
     
    10921118    IGCM_sys_MkdirArchive $( dirname $2 ) 
    10931119    # 
    1094     typeset RET 
    10951120 
    10961121    #===================================================== 
     
    11021127    #    typeset WORKPATH FILEPATH 
    11031128    #    WORKPATH=$( dirname $2 | sed -e "s|${R_OUT}|${R_BUF}|" ) 
    1104     #    IGCM_sys_MkdirWork ${WORKPATH}  
     1129    #    IGCM_sys_MkdirWork ${WORKPATH} 
    11051130    #    FILEPATH=${WORKPATH}/$( basename $2 ) 
    11061131    #    # 
     
    11101135    if [ X${JobType} = XRUN ] ; then 
    11111136      if [ X${3} = X ] ; then 
    1112         IGCM_sys_Chmod 444 ${1} 
     1137        IGCM_sys_Chmod 444 ${1} 
    11131138      fi 
    11141139    fi 
    11151140    # 
    1116     # USUAL WAY 
    1117     \cp $1 $2 > out_rsync 2>&1 
    1118     RET=$? 
    1119  
    1120 #       #RSYNC WITH NETWORK SSH CALL 
    1121 #       echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > out_rsync 2>&1 
    1122 #       ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> out_rsync 2>&1 
    1123  
    1124 #       #RSYNC WITH NFS USE 
    1125 #       echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1 
    1126 #       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1 
    1127  
    1128 #       RET=$? 
    1129 #       IGCM_sys_Rsync_out $RET 
    1130  
    1131 #       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 
    1132 #       (( RET=RET+$? )) 
    1133  
    1134     if [ ${RET} -gt 0 ] ; then 
     1141 
     1142    exist=false 
     1143    skip=false 
     1144    if [ -f $2 ] ; then 
     1145      IGCM_debug_Print 1 "$2 already exist" 
     1146      #dmget $2 
     1147      ccc_hsm get $2 
     1148      exist=true 
     1149      if [ "X$( diff $1 $2 )" = X ] ; then 
     1150        IGCM_debug_Print 2 "$1 and $2 are the same file, we skip the copy" 
     1151        skip=true 
     1152      else 
     1153        IGCM_debug_Print 2 "$1 and $2 are not the same file, we force the copy" 
     1154        skip=false 
     1155      fi 
     1156    fi 
     1157    # 
     1158    if ( [ X${exist} = Xtrue ] && [ X${skip} = Xfalse ] ) ; then 
     1159      IGCM_sys_Chmod u+w $2 
     1160    fi 
     1161 
     1162    if [ X${skip} = Xfalse ] ; then 
     1163      (( i = 0 )) 
     1164      while [ $i -lt $NB_ESSAI ] ; do 
     1165        # USUAL WAY 
     1166        \cp $1 $2 > out_rsync 2>&1 
     1167        status=$? 
     1168        if [ ${status} -gt 0 ]; then 
     1169          IGCM_debug_Print 2 "IGCM_sys_Put_Out : cp failed error code ${status} ${i}/${NB_ESSAI}" 
     1170          IGCM_debug_Print 2 "IGCM_sys_Put_Out : sleep ${DELAI} seconds and try again." 
     1171          sleep $DELAI 
     1172        else 
     1173          break 
     1174        fi 
     1175        (( i = i + 1 )) 
     1176      done 
     1177    fi 
     1178 
     1179#       #RSYNC WITH NETWORK SSH CALL 
     1180#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > out_rsync 2>&1 
     1181#       ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> out_rsync 2>&1 
     1182 
     1183#       #RSYNC WITH NFS USE 
     1184#       echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1 
     1185#       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1 
     1186 
     1187#       status=$? 
     1188#       IGCM_sys_Rsync_out $status 
     1189 
     1190#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 
     1191#       (( status=status+$? )) 
     1192 
     1193    if [ ${status} -gt 0 ] ; then 
    11351194      echo "IGCM_sys_Put_Out : error." 
    11361195      cat out_rsync 
     
    11561215    echo "IGCM_sys_PutBuffer_Out :" $@ 
    11571216  fi 
     1217 
     1218  typeset NB_ESSAI DELAI status i exist skip  
     1219 
     1220  # number of tentative 
     1221  NB_ESSAI=3 
     1222  # time delay between tentative 
     1223  DELAI=2 
     1224 
    11581225  if [ $DRYRUN = 0 ]; then 
    11591226    if [ ! -f ${1} ] ; then 
     
    11651232    IGCM_sys_Mkdir $( dirname $2 ) 
    11661233    # 
    1167     typeset RET 
    11681234 
    11691235    if [ X${JobType} = XRUN ] ; then 
    11701236      if [ X${3} = X ] ; then 
    1171         IGCM_sys_Chmod 444 ${1} 
     1237        IGCM_sys_Chmod 444 ${1} 
    11721238      fi 
    11731239    fi 
     1240 
     1241    exist=false 
     1242    skip=false 
     1243    if [ -f $2 ] ; then 
     1244      IGCM_debug_Print 1 "$2 already exist" 
     1245      exist=true 
     1246      if [ "X$( diff $1 $2 )" = X ] ; then 
     1247        IGCM_debug_Print 2 "$1 and $2 are the same file, we skip the copy" 
     1248        skip=true 
     1249      else 
     1250        IGCM_debug_Print 2 "$1 and $2 are not the same file, we force the copy" 
     1251        skip=false 
     1252      fi 
     1253    fi 
    11741254    # 
    1175     # USUAL WAY 
    1176     \cp $1 $2 > out_rsync 2>&1 
    1177     RET=$? 
    1178  
    1179     if [ ${RET} -gt 0 ] ; then 
     1255    if ( [ X${exist} = Xtrue ] && [ X${skip} = Xfalse ] ) ; then 
     1256      IGCM_sys_Chmod u+w $2 
     1257    fi 
     1258 
     1259    if [ X${skip} = Xfalse ] ; then 
     1260      i=0 
     1261      while [ $i -lt $NB_ESSAI ] ; do 
     1262        # USUAL WAY 
     1263        \cp $1 $2 > out_rsync 2>&1 
     1264        status=$? 
     1265        if [ ${status} -gt 0 ]; then 
     1266          IGCM_debug_Print 2 "IGCM_sys_PutBuffer_Out : cp failed error code ${status} ${i}/${NB_ESSAI}" 
     1267          IGCM_debug_Print 2 "IGCM_sys_PutBuffer_Out : sleep ${DELAI} seconds and try again." 
     1268          sleep $DELAI 
     1269        else 
     1270          break 
     1271        fi 
     1272        (( i = i + 1 )) 
     1273      done 
     1274    fi 
     1275 
     1276    if [ ${status} -gt 0 ] ; then 
    11801277      echo "IGCM_sys_PutBuffer_Out : error." 
    11811278      cat out_rsync 
     
    11991296  IGCM_debug_PushStack "IGCM_sys_Get" $@ 
    12001297 
    1201   typeset DEST RET dm_liste ifile target file_work  
     1298  typeset DEST RET dm_liste ifile target file_work 
     1299  typeset NB_ESSAI DELAI status i 
    12021300 
    12031301  if ( $DEBUG_sys ) ; then 
    12041302    echo "IGCM_sys_Get :" $@ 
    12051303  fi 
     1304 
     1305  # number of tentative 
     1306  NB_ESSAI=3 
     1307  # time delay between tentative 
     1308  DELAI=2 
     1309 
    12061310  if [ $DRYRUN -le 2 ]; then 
    12071311    if [ X${1} = X'/l' ] ; then 
     
    12291333    #fi 
    12301334 
    1231     # test if the (first) file is present in the old computation : 
    1232     IGCM_sys_TestFileArchive ${dm_liste[0]} 
    1233     RET=$? 
    1234     if [ ${RET} -gt 0 ] ; then 
    1235       echo "IGCM_sys_Get, ERROR : regular file ${dm_liste[0]} DOES NOT EXIST ." 
    1236       IGCM_debug_Exit "IGCM_sys_Get" 
    1237     fi 
    1238  
    1239     #dmget ${dm_liste[*]} > out_rsync 2>&1 
    12401335    ccc_hsm get ${dm_liste[*]} > out_rsync 2>&1 
    1241     RET=$? 
    1242     if [ ${RET} -gt 0 ] ; then 
    1243       echo "WARNING IGCM_sys_Get : demigration error." 
     1336    status=$? 
     1337    if [ ${status} -gt 0 ] ; then 
     1338      echo "WARNING IGCM_sys_Get : error code ${status}" 
    12441339      cat out_rsync 
    12451340      echo "WARNING IGCM_sys_Get : will stop later if the cp fails." 
    12461341    fi 
    12471342 
    1248     #if [ ${RET} -gt 0 ] ; then 
     1343    #if [ ${status} -gt 0 ] ; then 
    12491344    #    if [ ! "X$( grep "Lost dmusrcmd connection" out_rsync )" = "X" ] ; then 
    12501345    #   cat out_rsync 
     
    12541349    ##  dmget ${dm_liste[*]} > out_rsync 2>&1 
    12551350    #   ccc_hsm get ${dm_liste[*]} > out_rsync 2>&1 
    1256     #   RET=$? 
    1257     #   if [ ${RET} -gt 0 ] ; then 
    1258     #       echo "ERROR IGCM_sys_Get : again demigration error :" 
    1259     #       cat out_rsync 
    1260     #       IGCM_debug_Exit "IGCM_sys_Get" 
     1351    #   status=$? 
     1352    #   if [ ${status} -gt 0 ] ; then 
     1353    #       echo "ERROR IGCM_sys_Get : again demigration error :" 
     1354    #       cat out_rsync 
     1355    #       IGCM_debug_Exit "IGCM_sys_Get" 
    12611356    #   fi 
    12621357    #    else 
     
    12711366      (( RET=0 )) 
    12721367      for target in ${dm_liste[*]} ; do 
    1273         local_file=$( basename ${target} ) 
    1274         \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 
    1275         (( RET = RET + $? )) 
     1368        local_file=$( basename ${target} ) 
     1369        (( i = 0 )) 
     1370        # test if the target file is present before the loop 
     1371        IGCM_sys_TestFileArchive ${target} 
     1372        status=$? 
     1373        if [ ${status} -gt 0 ] ; then 
     1374          echo "IGCM_sys_Get, ERROR : regular file ${target} DOES NOT EXIST ." 
     1375          IGCM_debug_Exit "IGCM_sys_Get" 
     1376        else 
     1377          while [ $i -lt $NB_ESSAI ] ; do 
     1378            \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 
     1379            status=$? 
     1380            if [ ${status} -gt 0 ]; then 
     1381              IGCM_debug_Print 2 "IGCM_sys_Get : cp failed error code ${status} ${i}/${NB_ESSAI}" 
     1382              IGCM_debug_Print 2 "IGCM_sys_Get : sleep ${DELAI} seconds and try again." 
     1383              sleep $DELAI 
     1384            else 
     1385              break 
     1386            fi 
     1387            (( i = i + 1 )) 
     1388          done 
     1389          (( RET = RET + status )) 
     1390        fi 
    12761391      done 
    12771392    else 
    12781393      \cp ${dm_liste} ${DEST} >> out_rsync 2>&1 
    1279       RET=$? 
    1280     fi 
    1281  
    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 #       RET=$? 
    1291      IGCM_sys_Rsync_out $RET 
    1292  
    1293      ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 
    1294      (( RET=RET+$? )) 
     1394      status=$? 
     1395    fi 
     1396 
     1397#       #RSYNC WITH NETWORK SSH CALL 
     1398#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1 
     1399#       ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1 
     1400 
     1401     #RSYNC WITH NFS USE 
     1402     echo ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1 
     1403     ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1 
     1404 
     1405#       status=$? 
     1406     IGCM_sys_Rsync_out $status 
     1407 
     1408     ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 
     1409     (( RET=RET+$? )) 
    12951410 
    12961411    if [ ${RET} -gt 0 ] ; then 
    1297       echo "IGCM_sys_Get : copy error." 
     1412      echo "IGCM_sys_Get : error" 
    12981413      cat out_rsync 
     1414      \rm out_rsync 
    12991415      IGCM_debug_Exit "IGCM_sys_Get" 
    13001416    else 
     
    13151431  IGCM_debug_PushStack "IGCM_sys_GetBuffer" $@ 
    13161432 
    1317   typeset DEST RET buf_liste ifile target file_work  
     1433  typeset DEST RET status buf_liste ifile target file_work 
    13181434 
    13191435  if ( $DEBUG_sys ) ; then 
     
    13331449      (( RET=0 )) 
    13341450      for target in ${buf_liste[*]} ; do 
    1335         local_file=$( basename ${target} ) 
    1336         \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 
    1337         (( RET = RET + $? )) 
     1451        local_file=$( basename ${target} ) 
     1452        \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 
     1453        (( RET = RET + $? )) 
    13381454      done 
    13391455    else 
    13401456      \cp ${buf_liste} ${DEST} >> out_rsync 2>&1 
    1341       RET=$? 
     1457      status=$? 
    13421458    fi 
    13431459 
    13441460    if [ ${RET} -gt 0 ] ; then 
    1345       echo "IGCM_sys_GetBuffer : copy error." 
     1461      echo "IGCM_sys_GetBuffer : error" 
    13461462      cat out_rsync 
     1463      \rm out_rsync 
    13471464      IGCM_debug_Exit "IGCM_sys_GetBuffer" 
    13481465    else 
     
    13751492#D-#================================================== 
    13761493#D-function IGCM_sys_GetDate_FichArchive 
    1377 #D-* Purpose: donne la date filesys d'un fichier sur le filesystem ARCHIVE  
     1494#D-* Purpose: donne la date filesys d'un fichier sur le filesystem ARCHIVE 
    13781495#D-* Examples: 
    13791496#D- 
     
    13981515    echo "IGCM_sys_rebuild :" $@ 
    13991516  fi 
    1400   /home/cont003/p86ipsl/SX8/bin/rebuild -f -o $@ 
     1517 
     1518  typeset NB_ESSAI DELAI status i 
     1519  # number of tentative 
     1520  NB_ESSAI=3 
     1521  # time delay between tentative 
     1522  DELAI=2 
     1523 
     1524  i=0 
     1525  while [ $i -lt $NB_ESSAI ] ; do 
     1526      /home/cont003/p86ipsl/SX8/bin/rebuild -f -o $@ > out_rsync 2>&1 
     1527    status=$? 
     1528    if [ ${status} -gt 0 ] ; then 
     1529      IGCM_debug_Print 2 "IGCM_sys_rebuild : error code ${status}" 
     1530      cat out_rsync 
     1531      \rm out_rsync 
     1532      IGCM_debug_Print 2 "IGCM_sys_rebuild : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again." 
     1533    else 
     1534      \rm out_rsync 
     1535      break 
     1536    fi 
     1537    (( i = i + 1 )) 
     1538  done 
     1539 
    14011540  if [ $? -gt 0 ] ; then 
    1402     echo "IGCM_sys_rebuild : erreur ${@}." 
     1541    echo "IGCM_sys_rebuild : rebuild error" 
    14031542    IGCM_debug_Exit "rebuild" 
    14041543  fi 
     
    15671706############################################################ 
    15681707# Build MPI/OMP scripts 
    1569 function IGCM_sys_build_execution_scripts  
     1708function IGCM_sys_build_execution_scripts 
    15701709{ 
    15711710  IGCM_debug_PushStack "IGCM_sys_build_execution_scripts" $@ 
Note: See TracChangeset for help on using the changeset viewer.