Changeset 1178 for trunk


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

house keeping in libIGCM_sys (first pass). Will ease #248

Location:
trunk/libIGCM/libIGCM_sys
Files:
3 edited

Legend:

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

    r1174 r1178  
    8585# ie storage filesystem 
    8686typeset -r STOREHOST=${MASTER} 
    87  
    88 #==================================================== 
    89 # Source default environment 
    90 #==================================================== 
    91 ##. /etc/profile 
    9287 
    9388#==================================================== 
     
    10681063  fi 
    10691064  if [ $DRYRUN = 0 ]; then 
    1070 #    if [ ! -d ${1} ] ; then 
    1071 #      echo "WARNING : IGCM_sys_Get_Dir ${1} DOES NOT EXIST ." 
    1072 #      IGCM_debug_PopStack "IGCM_sys_Get_Dir" 
    1073 #      return 
    1074 #    fi 
    1075  
    10761065    typeset NB_ESSAI DELAI status i 
    10771066    # number of tentative 
     
    11021091 
    11031092    if [ ${status} -gt 0 ] ; then 
    1104       echo "IGCM_sys_Get_Dir : error." 
     1093      IGCM_debug_Print 2 "IGCM_sys_Get_Dir : cp failed error code ${status}" 
    11051094      cat /tmp/out_command.$$ 
    11061095      IGCM_debug_Exit "IGCM_sys_Get_Dir" 
     
    12671256#D-#================================================== 
    12681257#D-function IGCM_sys_PrepareTaredRestart 
    1269 #D-* Purpose: Prepare tared restart to be access by computing job. Identity here. 
     1258#D-* Purpose: Prepare tared restart to be access by computing job. 
    12701259#D-* Examples: 
    12711260#D- 
     
    13051294    IGCM_sys_MkdirArchive $( dirname $2 ) 
    13061295    # 
    1307  
    1308     #===================================================== 
    1309     #         COMMENT OUT DOUBLE COPY ON SCRATCHDIR 
    1310     #===================================================== 
    1311  
    1312     #echo ${2} | grep "${R_OUT}" > /dev/null 2>&1 
    1313     #if [ $? -eq 0 ] ; then 
    1314     #    typeset WORKPATH FILEPATH 
    1315     #    WORKPATH=$( dirname $2 | sed -e "s|${R_OUT}|${R_BUF}|" ) 
    1316     #    IGCM_sys_MkdirWork ${WORKPATH} 
    1317     #    FILEPATH=${WORKPATH}/$( basename $2 ) 
    1318     #    # 
    1319     #    IGCM_sys_Cp ${1} ${FILEPATH} 
    1320     #fi 
    1321  
    13221296    exist=false 
    13231297    skip=false 
     
    15231497    fi 
    15241498    eval DEST=\${${#}} 
    1525  
    1526     #===================================================== 
    1527     #         COMMENT OUT DOUBLE COPY ON SCRATCHDIR 
    1528     #===================================================== 
    1529  
    1530     # Is it an R_OUT file (not R_IN) ? 
    1531     #echo ${dm_liste[0]} | grep "${R_OUT}" > /dev/null 2>&1 
    1532     #if [ $? -eq 0 ] ; then 
    1533     #  # Yes  ? then we try to get it in SCRATCHDIR 
    1534     #  set +A file_work $( echo ${dm_liste[*]} | sed -e "s|${R_OUT}|${R_BUF}|g" ) 
    1535     #  if [ -f ${file_work[0]} ] ; then 
    1536     #    IGCM_sys_Cp ${file_work[*]} ${DEST} 
    1537     #    IGCM_debug_PopStack "IGCM_sys_Get" 
    1538     #    return 
    1539     #  fi 
    1540     #fi 
    1541  
    15421499    ccc_hsm get ${dm_liste[*]} > /tmp/out_command.$$ 2>&1 
    15431500    status=$? 
     
    18691826#D-#================================================== 
    18701827#D-function IGCM_sys_Put_Dods 
    1871 #D-* Purpose: Put $(ARCHIVE) files on DODS internet protocole. 
     1828#D-* Purpose: Put ${ARCHIVE} files on DODS internet protocole. 
    18721829#D-* Examples: 
    18731830#D- 
     
    23172274            string_final="" 
    23182275            for index in `seq $slot $(($slot+$comp_proc_omp_loc-1))`; do 
    2319               (( index_slot = index * 2 ))       
     2276              (( index_slot = index * 2 )) 
    23202277              string=$index_slot$virg 
    23212278              string_final=$string_final$string 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh

    r1163 r1178  
    6868typeset  LOGIN=${LOGIN:=$( whoami )} 
    6969# $hostname of the MASTER job 
    70 typeset -r MASTER=${HOST} 
     70typeset MASTER=${HOST} 
    7171 
    7272#D- 
     
    175175  fi 
    176176 
    177   # ON OBELIX NO SPECIAL CASE WHEN X${config_UserChoices_SpaceName} = XTEST 
     177  # ON DEFAULT MACHINE NO SPECIAL CASE WHEN X${config_UserChoices_SpaceName} = XTEST 
    178178 
    179179  #==================================================== 
     
    236236 
    237237#D-#================================================== 
     238#D-function IGCM_sys_RshArchive_NoError 
     239#D-* Purpose: Archive rsh command, without error 
     240#D-*          used only in monitoring.job 
     241#D-* Examples: 
     242#D- 
     243function IGCM_sys_RshArchive_NoError { 
     244  IGCM_debug_PushStack "IGCM_sys_RshArchive_NoError" $@ 
     245  /bin/ksh <<-EOF 
     246    ${@} 2> \dev\null 
     247EOF 
     248  IGCM_debug_PopStack "IGCM_sys_RshArchive_NoError" 
     249} 
     250 
     251#D-#================================================== 
    238252#D-function IGCM_sys_RshPost 
    239253#D-* Purpose: Post-process rsh command 
     
    245259    echo "IGCM_sys_RshPost :" $@ 
    246260  fi 
    247  
    248261  # keep standard input (stdin) for the loop onto temporary file 
    249   cat >tmp_IGCM_sys_RshPost_$$ 
    250  
    251   /bin/ksh <tmp_IGCM_sys_RshPost_$$ 
     262  cat >/tmp/tmp_IGCM_sys_RshPost_$$_${LOGNAME} 
     263 
     264  /bin/ksh </tmp/tmp_IGCM_sys_RshPost_$$_${LOGNAME} 
    252265  if [ $? -gt 0 ] ; then 
    253266    echo "IGCM_sys_RshPost : erreur." 
     
    255268  fi 
    256269  # delete temporary file 
    257   \rm tmp_IGCM_sys_RshPost_$$ 
     270  \rm /tmp/tmp_IGCM_sys_RshPost_$$_${LOGNAME} 
    258271  IGCM_debug_PopStack "IGCM_sys_RshPost" 
    259272} 
     
    334347  fi 
    335348  #- creation de repertoire sur le serveur fichier 
    336   mkdir -p $1 
    337   status=$? 
    338  
    339   if [ ${status} -gt 0 ] ; then 
    340     IGCM_debug_Print 2 "IGCM_sys_MkdirArchive : mkdir failed error code ${status}" 
    341     IGCM_debug_Exit "IGCM_sys_MkdirArchive" 
     349  if [ ! -d ${1} ]; then 
     350    \mkdir -p $1 
     351    status=$? 
     352 
     353    if [ ${status} -gt 0 ] ; then 
     354      IGCM_debug_Print 2 "IGCM_sys_MkdirArchive : mkdir failed error code ${status}" 
     355      IGCM_debug_Exit "IGCM_sys_MkdirArchive" 
     356    fi 
    342357  fi 
    343358  IGCM_debug_PopStack "IGCM_sys_MkdirArchive" 
     
    537552  fi 
    538553 
    539   \tree -f $@ 
     554  \ls -lR ${@} 
    540555 
    541556  IGCM_debug_PopStack "IGCM_sys_Tree" 
     
    746761  mkdir -p ${HOME}/MIRROR/${PATHlibIGCM} 
    747762 
    748   echo ${RSYNC} ${RSYNC_opt} ${libIGCM} ${HOME}/MIRROR/${PATHlibIGCM} > /tmp/out_command.$$ 2>&1 
    749   ${RSYNC} ${RSYNC_opt} ${libIGCM} ${HOME}/MIRROR/${PATHlibIGCM} >> /tmp/out_command.$$ 2>&1 
     763  echo ${RSYNC} ${RSYNC_opt} ${libIGCM} ${HOME}/MIRROR/${PATHlibIGCM} > /tmp/out_command_${LOGIN}.$$ 2>&1 
     764  ${RSYNC} ${RSYNC_opt} ${libIGCM} ${HOME}/MIRROR/${PATHlibIGCM} >> /tmp/out_command_${LOGIN}.$$ 2>&1 
    750765  status=$? 
    751766 
    752767  if [ ${status} -gt 0 ] ; then 
    753768    echo "IGCM_sys_Mirror_libIGCM Warning : no libIGCM on frontend." 
    754     cat /tmp/out_command.$$ 
     769    cat /tmp/out_command_${LOGIN}.$$ 
    755770  fi 
    756771  IGCM_debug_PopStack "IGCM_sys_Mirror_libIGCM" 
     
    770785  typeset status 
    771786 
    772   echo cp $@ > /tmp/out_command.$$ 2>&1 
    773   \cp $@ >> /tmp/out_command.$$ 2>&1 
     787  echo cp $@ > /tmp/out_command_${LOGIN}.$$ 2>&1 
     788  \cp $@ >> /tmp/out_command_${LOGIN}.$$ 2>&1 
    774789  status=$? 
    775790 
    776791  if [ ${status} -gt 0 ] ; then 
    777792    echo "IGCM_sys_Cp : error code ${status}" 
    778     cat /tmp/out_command.$$ 
     793    cat /tmp/out_command_${LOGIN}.$$ 
    779794    IGCM_debug_Exit "IGCM_sys_Cp" 
    780795  else 
    781     \rm /tmp/out_command.$$ 
     796    \rm /tmp/out_command_${LOGIN}.$$ 
    782797  fi 
    783798  IGCM_debug_PopStack "IGCM_sys_Cp" 
     
    797812  typeset status 
    798813 
    799   echo rm $@ > /tmp/out_command.$$ 2>&1 
    800   \rm $@ >> /tmp/out_command.$$ 2>&1 
     814  echo rm $@ > /tmp/out_command_${LOGIN}.$$ 2>&1 
     815  \rm $@ >> /tmp/out_command_${LOGIN}.$$ 2>&1 
    801816  status=$? 
    802817 
    803818  if [ ${status} -gt 0 ] ; then 
    804819    echo "IGCM_sys_Rm : error code ${status}" 
    805     cat /tmp/out_command.$$ 
     820    cat /tmp/out_command_${LOGIN}.$$ 
    806821    IGCM_debug_Exit "IGCM_sys_Rm" 
    807822  else 
    808     \rm /tmp/out_command.$$ 
     823    \rm /tmp/out_command_${LOGIN}.$$ 
    809824  fi 
    810825  IGCM_debug_PopStack "IGCM_sys_Rm" 
     
    842857    typeset status 
    843858 
    844     echo mv $@ > /tmp/out_command.$$ 2>&1 
    845     \mv $@ >> /tmp/out_command.$$ 2>&1 
     859    echo mv $@ > /tmp/out_command_${LOGIN}.$$ 2>&1 
     860    \mv $@ >> /tmp/out_command_${LOGIN}.$$ 2>&1 
    846861    status=$? 
    847862 
    848863    if [ ${status} -gt 0 ] ; then 
    849864      echo "IGCM_sys_Mv : error code ${status}" 
    850       cat /tmp/out_command.$$ 
     865      cat /tmp/out_command_${LOGIN}.$$ 
    851866      IGCM_debug_Exit "IGCM_sys_Mv" 
    852867    else 
    853       \rm /tmp/out_command.$$ 
    854     fi 
    855   fi 
    856  
     868      \rm /tmp/out_command_${LOGIN}.$$ 
     869    fi 
     870  fi 
    857871  IGCM_debug_PopStack "IGCM_sys_Mv" 
    858872} 
     
    881895    # 
    882896    #USUAL WAY 
    883     \cp -r $1 $2 > /tmp/out_command.$$ 2>&1 
     897    \cp -r $1 $2 > /tmp/out_command_${LOGIN}.$$ 2>&1 
    884898    status=$? 
    885899 
    886900    if [ ${status} -gt 0 ] ; then 
    887901      IGCM_debug_Print 2 "IGCM_sys_Put_Dir : cp failed error code ${status}" 
    888       cat /tmp/out_command.$$ 
     902      cat /tmp/out_command_${LOGIN}.$$ 
    889903      IGCM_debug_Exit "IGCM_sys_Put_Dir" 
    890904    else 
    891       \rm /tmp/out_command.$$ 
     905      \rm /tmp/out_command_${LOGIN}.$$ 
    892906    fi 
    893907  fi 
     
    906920  fi 
    907921  if [ $DRYRUN = 0 ]; then 
    908     if [ ! -d ${1} ] ; then 
    909       echo "WARNING : IGCM_sys_Get_Dir ${1} DOES NOT EXIST ." 
    910       IGCM_debug_PopStack "IGCM_sys_Get_Dir" 
    911       return 
    912     fi 
    913  
    914922    typeset status 
    915923 
    916924    #USUAL WAY 
    917     \cp -ur $1 $2 > /tmp/out_command.$$ 2>&1 
     925    \cp -ur $1 $2 > /tmp/out_command_${LOGIN}.$$ 2>&1 
    918926    status=$? 
    919927 
    920928    if [ ${status} -gt 0 ] ; then 
    921929      IGCM_debug_Print 2 "IGCM_sys_Get_Dir : cp failed error code ${status}" 
    922       cat /tmp/out_command.$$ 
     930      cat /tmp/out_command_${LOGIN}.$$ 
    923931      IGCM_debug_Exit "IGCM_sys_Get_Dir" 
    924932    else 
    925       \rm /tmp/out_command.$$ 
     933      \rm /tmp/out_command_${LOGIN}.$$ 
    926934    fi 
    927935  fi 
     
    954962    i=0 
    955963    while [ $i -lt $NB_ESSAI ] ; do 
    956       \cp -urL $1 $2 > /tmp/out_command.$$ 2>&1 
     964      \cp -urL $1 $2 > /tmp/out_command_${LOGIN}.$$ 2>&1 
    957965      status=$? 
    958966      if [ ${status} -gt 0 ]; then 
     
    968976    if [ ${status} -gt 0 ] ; then 
    969977      echo "IGCM_sys_Get_Master : error." 
    970       cat /tmp/out_command.$$ 
     978      cat /tmp/out_command_${LOGIN}.$$ 
    971979      IGCM_debug_Exit "IGCM_sys_Get_Master" 
    972980    else 
    973       \rm /tmp/out_command.$$ 
     981      \rm /tmp/out_command_${LOGIN}.$$ 
    974982    fi 
    975983  fi 
     
    10021010    typeset status 
    10031011    # 
    1004     if [ X${JobType} = XRUN ] ; then 
    1005       IGCM_sys_Chmod 444 ${1} 
    1006     fi 
    1007     # 
    1008     # Only if we use rsync 
    1009     #IGCM_sys_MkdirArchive $( dirname $2 ) 
    1010     # 
    1011     #USUAL WAY 
     1012    # USUAL WAY 
    10121013    \cp $1 $2 > /tmp/out_command.$$ 2>&1 
    10131014    status=$? 
    10141015 
    10151016#       #RSYNC WITH NETWORK SSH CALL 
    1016 #       echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > /tmp/out_command.$$ 2>&1 
    1017 #       ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> /tmp/out_command.$$ 2>&1 
     1017#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > /tmp/out_command_${LOGIN}.$$ 2>&1 
     1018#       ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> /tmp/out_command_${LOGIN}.$$ 2>&1 
    10181019 
    10191020#       #RSYNC WITH NFS USE 
    1020 #       echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > /tmp/out_command.$$ 2>&1 
    1021 #       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> /tmp/out_command.$$ 2>&1 
     1021#       echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > /tmp/out_command_${LOGIN}.$$ 2>&1 
     1022#       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> /tmp/out_command_${LOGIN}.$$ 2>&1 
    10221023 
    10231024#       status=$? 
    10241025#       IGCM_sys_Rsync_out $status 
    10251026 
    1026 #       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk /tmp/out_command.$$ 
     1027#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk /tmp/out_command_${LOGIN}.$$ 
    10271028#       (( status=status+$? )) 
    10281029 
    10291030    if [ ${status} -gt 0 ] ; then 
    10301031      echo "IGCM_sys_Put_Rest : cp failed error code ${status}" 
     1032      [ -f ${1} ] && ls -l ${1} 
     1033      [ -f ${2} ] && ls -l ${2} 
     1034      [ -f ${2}/${1} ] && ls -l ${2}/${1} 
    10311035      cat /tmp/out_command.$$ 
    10321036      IGCM_debug_Exit "IGCM_sys_Put_Rest" 
    10331037    else 
     1038 
     1039      if [ X${JobType} = XRUN ] ; then 
     1040        [ -f ${2} ] && IGCM_sys_Chmod 444 ${2} 
     1041        [ -f ${2}/${1} ] && IGCM_sys_Chmod 444 ${2}/${1} 
     1042      fi 
     1043 
    10341044      \rm /tmp/out_command.$$ 
    10351045    fi 
     
    10561066 
    10571067    typeset status 
    1058     # 
    1059     if [ X${JobType} = XRUN ] ; then 
    1060       IGCM_sys_Chmod 444 ${1} 
    1061     fi 
    1062  
    10631068    # 
    10641069    # USUAL WAY 
     
    10731078      IGCM_debug_Exit "IGCM_sys_PutBuffer_Rest" 
    10741079    else 
     1080 
     1081      if [ X${JobType} = XRUN ] ; then 
     1082        [ -f ${2} ] && IGCM_sys_Chmod 444 ${2} 
     1083        [ -f ${2}/${1} ] && IGCM_sys_Chmod 444 ${2}/${1} 
     1084      fi 
     1085 
    10751086      \rm /tmp/out_command.$$ 
    10761087    fi 
     
    11191130    # 
    11201131 
    1121     echo ${RSYNC} ${RSYNC_opt} $1 $2 > /tmp/out_command.$$ 2>&1 
    1122     ${RSYNC} ${RSYNC_opt} $1 $2 >> /tmp/out_command.$$ 2>&1 
     1132    echo ${RSYNC} ${RSYNC_opt} $1 $2 > /tmp/out_command_${LOGIN}.$$ 2>&1 
     1133    ${RSYNC} ${RSYNC_opt} $1 $2 >> /tmp/out_command_${LOGIN}.$$ 2>&1 
    11231134    status=$? 
    11241135    IGCM_sys_Rsync_out $status 
    11251136 
    1126     ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk /tmp/out_command.$$ 
     1137    ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk /tmp/out_command_${LOGIN}.$$ 
    11271138    (( status=status+$? )) 
    11281139 
    11291140    if [ ${status} -gt 0 ] ; then 
    11301141      IGCM_debug_Print 2 "IGCM_sys_Put_Out : rsync failed error code ${status}" 
    1131       cat /tmp/out_command.$$ 
     1142      cat /tmp/out_command_${LOGIN}.$$ 
    11321143      IGCM_debug_Exit "IGCM_sys_Put_Out" 
    11331144    else 
    1134       \rm /tmp/out_command.$$ 
     1145      \rm /tmp/out_command_${LOGIN}.$$ 
    11351146    fi 
    11361147  fi 
     
    11891200      i=0 
    11901201      while [ $i -lt $NB_ESSAI ] ; do 
    1191         # USUAL WAY 
    1192         \cp $1 $2 > /tmp/out_command.$$ 2>&1 
    1193         status=$? 
     1202        if [ $( stat -c %d $1 ) -ne $( stat -c %d $( dirname $2 ) ) ] ; then 
     1203          # USUAL WAY 
     1204          \cp $1 $2 > /tmp/out_command.$$ 2>&1 
     1205          status=$? 
     1206        else 
     1207          # NOT SO USUAL WAY 
     1208          \mv $1 $2 > /tmp/out_command.$$ 2>&1 
     1209          status=$? 
     1210        fi 
    11941211        if [ ${status} -gt 0 ]; then 
    11951212          IGCM_debug_Print 2 "IGCM_sys_PutBuffer_Out : cp failed error code ${status} ${i}/${NB_ESSAI}" 
     
    12581275 
    12591276    #USUAL WAY 
    1260     \cp ${dm_liste[*]} ${DEST} > /tmp/out_command.$$ 2>&1 
     1277    \cp ${dm_liste[*]} ${DEST} > /tmp/out_command_${LOGIN}.$$ 2>&1 
    12611278    status=$? 
    12621279 
    12631280    if [ ${status} -gt 0 ] ; then 
    12641281      IGCM_debug_Print 2 "IGCM_sys_Get : cp failed error code ${status}" 
    1265       cat /tmp/out_command.$$ 
     1282      cat /tmp/out_command_${LOGIN}.$$ 
    12661283      IGCM_debug_Exit "IGCM_sys_Get" 
    12671284    else 
    1268       \rm /tmp/out_command.$$ 
     1285      \rm /tmp/out_command_${LOGIN}.$$ 
    12691286    fi 
    12701287  fi 
     
    13061323        i=0 
    13071324        while [ $i -lt $NB_ESSAI ] ; do 
    1308           \cp ${target} ${DEST}/${local_file} >> /tmp/out_command.$$ 2>&1 
     1325          \cp ${target} ${DEST}/${local_file} >> /tmp/out_command_${LOGIN}.$$ 2>&1 
    13091326          status=$? 
    13101327          if [ ${status} -gt 0 ]; then 
     
    13191336        if [ ${status} -gt 0 ] ; then 
    13201337          echo "IGCM_sys_Get : error" 
    1321           cat /tmp/out_command.$$ 
    1322           \rm /tmp/out_command.$$ 
     1338          cat /tmp/out_command_${LOGIN}.$$ 
     1339          \rm /tmp/out_command_${LOGIN}.$$ 
    13231340          IGCM_debug_Exit "IGCM_sys_GetBuffer" 
    13241341        else 
    1325           \rm /tmp/out_command.$$ 
     1342          \rm /tmp/out_command_${LOGIN}.$$ 
    13261343        fi 
    13271344      done 
     
    13291346      i=0 
    13301347      while [ $i -lt $NB_ESSAI ] ; do 
    1331         \cp ${buf_liste} ${DEST} >> /tmp/out_command.$$ 2>&1 
     1348        \cp ${buf_liste} ${DEST} >> /tmp/out_command_${LOGIN}.$$ 2>&1 
    13321349        status=$? 
    13331350        if [ ${status} -gt 0 ]; then 
     
    13421359      if [ ${status} -gt 0 ] ; then 
    13431360        echo "IGCM_sys_Get : error" 
    1344         cat /tmp/out_command.$$ 
    1345         \rm /tmp/out_command.$$ 
     1361        cat /tmp/out_command_${LOGIN}.$$ 
     1362        \rm /tmp/out_command_${LOGIN}.$$ 
    13461363        IGCM_debug_Exit "IGCM_sys_GetBuffer" 
    13471364      else 
    1348         \rm /tmp/out_command.$$ 
     1365        \rm /tmp/out_command_${LOGIN}.$$ 
    13491366      fi 
    13501367    fi 
     
    13621379  if ( $DEBUG_sys ) ; then 
    13631380    echo "IGCM_sys_GetDate_FichWork :" $@ 
     1381  fi 
     1382 
     1383  if [ $# -ge 3 ] ; then 
     1384    mode=$3 
     1385    TimeStyle=$4 
     1386  else 
     1387    mode="default" 
     1388    TimeStyle="%Y%m%d%H%M%S" 
     1389  fi 
     1390 
     1391  typeset dateF 
     1392  set +A dateF -- $( ls -l --full-time --time-style=+"${TimeStyle}" ${1} ) 
     1393 
     1394  case $mode in 
     1395    "default") 
     1396      eval ${2}=${dateF[5]} 
     1397      ;; 
     1398    "SplitFields") 
     1399      eval ${2}="${dateF[5]}\ ${dateF[6]}" 
     1400      ;; 
     1401  esac 
     1402 
     1403 
     1404  # donne la date filesys d'un fichier sur la machine work 
     1405  IGCM_debug_PopStack "IGCM_sys_FichWork" 
     1406} 
     1407 
     1408#D-#================================================== 
     1409#D-function IGCM_sys_GetDate_FichArchive 
     1410#D-* Purpose: donne la date filesys d'un fichier sur le filesystem ARCHIVE 
     1411#D-* Examples: 
     1412#D- 
     1413function IGCM_sys_GetDate_FichArchive { 
     1414  IGCM_debug_PushStack "IGCM_sys_FichArchive" $@ 
     1415  if ( $DEBUG_sys ) ; then 
     1416    echo "IGCM_sys_GetDate_FichArchive :" $@ 
    13641417  fi 
    13651418  typeset dateF 
     
    13671420  eval ${2}=${dateF[5]} 
    13681421 
    1369   # donne la date filesys d'un fichier sur la machine work 
    1370   IGCM_debug_PopStack "IGCM_sys_FichWork" 
    1371 } 
    1372  
    1373 #D-#================================================== 
    1374 #D-function IGCM_sys_GetDate_FichArchive 
    1375 #D-* Purpose: donne la date filesys d'un fichier sur le filesystem ARCHIVE 
    1376 #D-* Examples: 
    1377 #D- 
    1378 function IGCM_sys_GetDate_FichArchive { 
    1379   IGCM_debug_PushStack "IGCM_sys_FichArchive" $@ 
    1380   if ( $DEBUG_sys ) ; then 
    1381     echo "IGCM_sys_GetDate_FichArchive :" $@ 
    1382   fi 
    1383   typeset dateF 
    1384   set +A dateF -- $( ls -l --full-time --time-style='+%Y%m%d%H%M%S' ${1} ) 
    1385   eval ${2}=${dateF[5]} 
    1386  
    13871422  IGCM_debug_PopStack "IGCM_sys_FichArchive" 
     1423} 
     1424 
     1425#D-#================================================== 
     1426#D-function IGCM_sys_GetDate_Monitoring 
     1427#D-* Purpose: get the last year for which the monitoring has been computed 
     1428#D-* Examples: 
     1429#D- 
     1430function IGCM_sys_GetDate_Monitoring { 
     1431  IGCM_debug_PushStack "IGCM_sys_GetDate_Monitoring" $@ 
     1432  if ( $DEBUG_sys ) ; then 
     1433    echo "IGCM_sys_GetDate_Monitoring :" $@ 
     1434  fi 
     1435 
     1436  eval ${2}=$( cdo showyear ${1} 2> /dev/null | gawk '{ print $NF }' ) 
     1437 
     1438  IGCM_debug_PopStack "IGCM_sys_GetDate_Monitoring" 
    13881439} 
    13891440 
     
    15371588  #  0  118 110.0000000000000   87.46478873239437 
    15381589  #  1  40  4.999999999999995   51.97183098591550 
     1590 
    15391591#  typeset iStation iProc list_opt file_in file_out prefix_invert 
    15401592#  typeset -Z4 j4 
     
    19041956          EXECUTION="time ./script_${ExeNameOut}.ksh" 
    19051957        fi 
     1958 
     1959        IGCM_debug_Print 1 "sys $( hostname ) : script_${ExeNameOut}.ksh contains" 
     1960        cat script_${ExeNameOut}.ksh 
     1961 
    19061962      fi 
    19071963    done 
     
    19842040  i=0 
    19852041  while [ $i -lt $NB_ESSAI ] ; do 
    1986     ncap2 -C "$@" > /tmp/out_command.$$ 2>&1 
     2042    ncap2 -C "$@" > /tmp/out_command_${LOGIN}.$$ 2>&1 
    19872043    status=$? 
    19882044    if [ ${status} -gt 0 ] ; then 
    19892045      IGCM_debug_Print 2 "IGCM_sys_ncap2 : error code ${status}" 
    1990       cat /tmp/out_command.$$ 
    1991       \rm /tmp/out_command.$$ 
     2046      cat /tmp/out_command_${LOGIN}.$$ 
     2047      \rm /tmp/out_command_${LOGIN}.$$ 
    19922048      IGCM_debug_Print 2 "IGCM_sys_ncap2 : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again." 
    19932049      sleep $DELAI 
    19942050    else 
    1995       \rm /tmp/out_command.$$ 
     2051      \rm /tmp/out_command_${LOGIN}.$$ 
    19962052      break 
    19972053    fi 
     
    20262082  i=0 
    20272083  while [ $i -lt $NB_ESSAI ] ; do 
    2028     ncatted "$@" > /tmp/out_command.$$ 2>&1 
     2084    ncatted "$@" > /tmp/out_command_${LOGIN}.$$ 2>&1 
    20292085    status=$? 
    20302086    if [ ${status} -gt 0 ] ; then 
    20312087      IGCM_debug_Print 2 "IGCM_sys_ncatted : error code ${status}" 
    2032       cat /tmp/out_command.$$ 
    2033       \rm /tmp/out_command.$$ 
     2088      cat /tmp/out_command_${LOGIN}.$$ 
     2089      \rm /tmp/out_command_${LOGIN}.$$ 
    20342090      IGCM_debug_Print 2 "IGCM_sys_ncatted : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again." 
    20352091      sleep $DELAI 
    20362092    else 
    2037       \rm /tmp/out_command.$$ 
     2093      \rm /tmp/out_command_${LOGIN}.$$ 
    20382094      break 
    20392095    fi 
     
    20682124  i=0 
    20692125  while [ $i -lt $NB_ESSAI ] ; do 
    2070     ncbo -C $@ > /tmp/out_command.$$ 2>&1 
     2126    ncbo -C $@ > /tmp/out_command_${LOGIN}.$$ 2>&1 
    20712127    status=$? 
    20722128    if [ ${status} -gt 0 ] ; then 
    20732129      IGCM_debug_Print 2 "IGCM_sys_ncbo : error code ${status}" 
    2074       cat /tmp/out_command.$$ 
    2075       \rm /tmp/out_command.$$ 
     2130      cat /tmp/out_command_${LOGIN}.$$ 
     2131      \rm /tmp/out_command_${LOGIN}.$$ 
    20762132      IGCM_debug_Print 2 "IGCM_sys_ncbo : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again." 
    20772133      sleep $DELAI 
    20782134    else 
    2079       \rm /tmp/out_command.$$ 
     2135      \rm /tmp/out_command_${LOGIN}.$$ 
    20802136      break 
    20812137    fi 
     
    21102166  i=0 
    21112167  while [ $i -lt $NB_ESSAI ] ; do 
    2112     ncdiff -C $@ > /tmp/out_command.$$ 2>&1 
     2168    ncdiff -C $@ > /tmp/out_command_${LOGIN}.$$ 2>&1 
    21132169    status=$? 
    21142170    if [ ${status} -gt 0 ] ; then 
    21152171      IGCM_debug_Print 2 "IGCM_sys_ncdiff : error code ${status}" 
    2116       cat /tmp/out_command.$$ 
    2117       \rm /tmp/out_command.$$ 
     2172      cat /tmp/out_command_${LOGIN}.$$ 
     2173      \rm /tmp/out_command_${LOGIN}.$$ 
    21182174      IGCM_debug_Print 2 "IGCM_sys_ncdiff : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again." 
    21192175      sleep $DELAI 
    21202176    else 
    2121       \rm /tmp/out_command.$$ 
     2177      \rm /tmp/out_command_${LOGIN}.$$ 
    21222178      break 
    21232179    fi 
     
    21522208  i=0 
    21532209  while [ $i -lt $NB_ESSAI ] ; do 
    2154     ncea -C $@ > /tmp/out_command.$$ 2>&1 
     2210    ncea -C $@ > /tmp/out_command_${LOGIN}.$$ 2>&1 
    21552211    status=$? 
    21562212    if [ ${status} -gt 0 ] ; then 
    21572213      IGCM_debug_Print 2 "IGCM_sys_ncea : error code ${status}" 
    2158       cat /tmp/out_command.$$ 
    2159       \rm /tmp/out_command.$$ 
     2214      cat /tmp/out_command_${LOGIN}.$$ 
     2215      \rm /tmp/out_command_${LOGIN}.$$ 
    21602216      IGCM_debug_Print 2 "IGCM_sys_ncea : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again." 
    21612217      sleep $DELAI 
    21622218    else 
    2163       \rm /tmp/out_command.$$ 
     2219      \rm /tmp/out_command_${LOGIN}.$$ 
    21642220      break 
    21652221    fi 
     
    21942250  i=0 
    21952251  while [ $i -lt $NB_ESSAI ] ; do 
    2196     ncecat -C $@ > /tmp/out_command.$$ 2>&1 
     2252    ncecat -C $@ > /tmp/out_command_${LOGIN}.$$ 2>&1 
    21972253    status=$? 
    21982254    if [ ${status} -gt 0 ] ; then 
    21992255      IGCM_debug_Print 2 "IGCM_sys_ncecat : error code ${status}" 
    2200       cat /tmp/out_command.$$ 
    2201       \rm /tmp/out_command.$$ 
     2256      cat /tmp/out_command_${LOGIN}.$$ 
     2257      \rm /tmp/out_command_${LOGIN}.$$ 
    22022258      IGCM_debug_Print 2 "IGCM_sys_ncecat : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again." 
    22032259      sleep $DELAI 
    22042260    else 
    2205       \rm /tmp/out_command.$$ 
     2261      \rm /tmp/out_command_${LOGIN}.$$ 
    22062262      break 
    22072263    fi 
     
    22362292  i=0 
    22372293  while [ $i -lt $NB_ESSAI ] ; do 
    2238     ncflint -C $@ > /tmp/out_command.$$ 2>&1 
     2294    ncflint -C $@ > /tmp/out_command_${LOGIN}.$$ 2>&1 
    22392295    status=$? 
    22402296    if [ ${status} -gt 0 ] ; then 
    22412297      IGCM_debug_Print 2 "IGCM_sys_ncflint : error code ${status}" 
    2242       cat /tmp/out_command.$$ 
    2243       \rm /tmp/out_command.$$ 
     2298      cat /tmp/out_command_${LOGIN}.$$ 
     2299      \rm /tmp/out_command_${LOGIN}.$$ 
    22442300      IGCM_debug_Print 2 "IGCM_sys_ncflint : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again." 
    22452301      sleep $DELAI 
    22462302    else 
    2247       \rm /tmp/out_command.$$ 
     2303      \rm /tmp/out_command_${LOGIN}.$$ 
    22482304      break 
    22492305    fi 
     
    22782334  i=0 
    22792335  while [ $i -lt $NB_ESSAI ] ; do 
    2280     ncks -C $@ > /tmp/out_command.$$ 2>&1 
     2336    ncks -C $@ > /tmp/out_command_${LOGIN}.$$ 2>&1 
    22812337    status=$? 
    22822338    if [ ${status} -gt 0 ] ; then 
    22832339      IGCM_debug_Print 2 "IGCM_sys_ncks : error code ${status}" 
    2284       cat /tmp/out_command.$$ 
    2285       \rm /tmp/out_command.$$ 
     2340      cat /tmp/out_command_${LOGIN}.$$ 
     2341      \rm /tmp/out_command_${LOGIN}.$$ 
    22862342      IGCM_debug_Print 2 "IGCM_sys_ncks : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again." 
    22872343      sleep $DELAI 
    22882344    else 
    2289       \rm /tmp/out_command.$$ 
     2345      \rm /tmp/out_command_${LOGIN}.$$ 
    22902346      break 
    22912347    fi 
     
    23202376  i=0 
    23212377  while [ $i -lt $NB_ESSAI ] ; do 
    2322     ncpdq -C $@ > /tmp/out_command.$$ 2>&1 
     2378    ncpdq -C $@ > /tmp/out_command_${LOGIN}.$$ 2>&1 
    23232379    status=$? 
    23242380    if [ ${status} -gt 0 ] ; then 
    23252381      IGCM_debug_Print 2 "IGCM_sys_ncpdq : error code ${status}" 
    2326       cat /tmp/out_command.$$ 
    2327       \rm /tmp/out_command.$$ 
     2382      cat /tmp/out_command_${LOGIN}.$$ 
     2383      \rm /tmp/out_command_${LOGIN}.$$ 
    23282384      IGCM_debug_Print 2 "IGCM_sys_ncpdq : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again." 
    23292385      sleep $DELAI 
    23302386    else 
    2331       \rm /tmp/out_command.$$ 
     2387      \rm /tmp/out_command_${LOGIN}.$$ 
    23322388      break 
    23332389    fi 
     
    23622418  i=0 
    23632419  while [ $i -lt $NB_ESSAI ] ; do 
    2364     ncra -C $@ > /tmp/out_command.$$ 2>&1 
     2420    ncra -C $@ > /tmp/out_command_${LOGIN}.$$ 2>&1 
    23652421    status=$? 
    23662422    if [ ${status} -gt 0 ] ; then 
    23672423      IGCM_debug_Print 2 "IGCM_sys_ncra : error code ${status}" 
    2368       cat /tmp/out_command.$$ 
    2369       \rm /tmp/out_command.$$ 
     2424      cat /tmp/out_command_${LOGIN}.$$ 
     2425      \rm /tmp/out_command_${LOGIN}.$$ 
    23702426      IGCM_debug_Print 2 "IGCM_sys_ncra : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again." 
    23712427      sleep $DELAI 
    23722428    else 
    2373       \rm /tmp/out_command.$$ 
     2429      \rm /tmp/out_command_${LOGIN}.$$ 
    23742430      break 
    23752431    fi 
     
    24042460  i=0 
    24052461  while [ $i -lt $NB_ESSAI ] ; do 
    2406     ncrcat -C $@ > /tmp/out_command.$$ 2>&1 
     2462    ncrcat -C $@ > /tmp/out_command_${LOGIN}.$$ 2>&1 
    24072463    status=$? 
    24082464    if [ ${status} -gt 0 ] ; then 
    24092465      IGCM_debug_Print 2 "IGCM_sys_ncrcat : error code ${status}" 
    2410       cat /tmp/out_command.$$ 
    2411       \rm /tmp/out_command.$$ 
     2466      cat /tmp/out_command_${LOGIN}.$$ 
     2467      \rm /tmp/out_command_${LOGIN}.$$ 
    24122468      IGCM_debug_Print 2 "IGCM_sys_ncrcat : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again." 
    24132469      sleep $DELAI 
    2414     elif [ ! "X$( grep "WARNING Intra-file non-monotonicity" /tmp/out_command.$$ )" = "X" ] ; then 
     2470    elif [ ! "X$( grep "WARNING Intra-file non-monotonicity" /tmp/out_command_${LOGIN}.$$ )" = "X" ] ; then 
    24152471      IGCM_debug_Print 2 "IGCM_sys_ncrcat : WARNING Intra-file non-monotonicity" 
    2416       cat /tmp/out_command.$$ 
     2472      cat /tmp/out_command_${LOGIN}.$$ 
    24172473      # remove files having corrupted time axis 
    24182474      eval lastArg=\${$#} 
    24192475      IGCM_debug_Print 2 "IGCM_sys_ncrcat : Delete ${lastArg}" 
    24202476      \rm ${lastArg} 
    2421       \rm /tmp/out_command.$$ 
     2477      \rm /tmp/out_command_${LOGIN}.$$ 
    24222478      IGCM_debug_Print 2 "IGCM_sys_ncrcat : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again." 
    24232479      sleep $DELAI 
    24242480    else 
    2425       \rm /tmp/out_command.$$ 
     2481      \rm /tmp/out_command_${LOGIN}.$$ 
    24262482      break 
    24272483    fi 
     
    24562512  i=0 
    24572513  while [ $i -lt $NB_ESSAI ] ; do 
    2458     ncrename $@ > /tmp/out_command.$$ 2>&1 
     2514    ncrename $@ > /tmp/out_command_${LOGIN}.$$ 2>&1 
    24592515    status=$? 
    24602516    if [ ${status} -gt 0 ] ; then 
    24612517      IGCM_debug_Print 2 "IGCM_sys_ncrename : error code ${status}" 
    2462       cat /tmp/out_command.$$ 
    2463       \rm /tmp/out_command.$$ 
     2518      cat /tmp/out_command_${LOGIN}.$$ 
     2519      \rm /tmp/out_command_${LOGIN}.$$ 
    24642520      IGCM_debug_Print 2 "IGCM_sys_ncrename : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again." 
    24652521      sleep $DELAI 
    24662522    else 
    2467       \rm /tmp/out_command.$$ 
     2523      \rm /tmp/out_command_${LOGIN}.$$ 
    24682524      break 
    24692525    fi 
     
    24982554  i=0 
    24992555  while [ $i -lt $NB_ESSAI ] ; do 
    2500     ncwa -C $@ > /tmp/out_command.$$ 2>&1 
     2556    ncwa -C $@ > /tmp/out_command_${LOGIN}.$$ 2>&1 
    25012557    status=$? 
    25022558    if [ ${status} -gt 0 ] ; then 
    25032559      IGCM_debug_Print 2 "IGCM_sys_ncwa : error code ${status}" 
    2504       cat /tmp/out_command.$$ 
    2505       \rm /tmp/out_command.$$ 
     2560      cat /tmp/out_command_${LOGIN}.$$ 
     2561      \rm /tmp/out_command_${LOGIN}.$$ 
    25062562      IGCM_debug_Print 2 "IGCM_sys_ncwa : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again." 
    25072563      sleep $DELAI 
    25082564    else 
    2509       \rm /tmp/out_command.$$ 
     2565      \rm /tmp/out_command_${LOGIN}.$$ 
    25102566      break 
    25112567    fi 
     
    25372593  typeset status 
    25382594 
    2539   \cdo $@ > /tmp/out_command.$$ 2>&1 
     2595  \cdo $@ > /tmp/out_command_${LOGIN}.$$ 2>&1 
    25402596  status=$? 
    25412597  if [ ${status} -gt 0 ] ; then 
    25422598    echo "IGCM_sys_cdo : error code ${status}" 
    2543     cat /tmp/out_command.$$ 
    2544     \rm /tmp/out_command.$$ 
     2599    cat /tmp/out_command_${LOGIN}.$$ 
     2600    \rm /tmp/out_command_${LOGIN}.$$ 
    25452601    IGCM_debug_PopStack "IGCM_sys_cdo" 
    25462602    return 1 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh

    r1163 r1178  
    213213function IGCM_sys_RshMaster { 
    214214  IGCM_debug_PushStack "IGCM_sys_RshMaster" $@ 
    215   /bin/ksh  <<-EOF 
     215  /bin/ksh <<-EOF 
    216216    export libIGCM=${libIGCM} 
    217217    export DEBUG_debug=${DEBUG_debug} 
     
    246246 
    247247#D-#================================================== 
     248#D-function IGCM_sys_RshArchive_NoError 
     249#D-* Purpose: Archive rsh command, without error 
     250#D-*          used only in monitoring.job 
     251#D-* Examples: 
     252#D- 
     253function IGCM_sys_RshArchive_NoError { 
     254  IGCM_debug_PushStack "IGCM_sys_RshArchive_NoError" $@ 
     255  /bin/ksh <<-EOF 
     256    ${@} 2> \dev\null 
     257EOF 
     258  IGCM_debug_PopStack "IGCM_sys_RshArchive_NoError" 
     259} 
     260 
     261#D-#================================================== 
    248262#D-function IGCM_sys_RshPost 
    249263#D-* Purpose: Post-process rsh command 
     
    255269    echo "IGCM_sys_RshPost :" $@ 
    256270  fi 
    257  
    258271  # keep standard input (stdin) for the loop onto temporary file 
    259   cat >tmp_IGCM_sys_RshPost_$$ 
    260  
    261 # ============ FRONTEND START ============ # 
    262  
    263   /bin/ksh <tmp_IGCM_sys_RshPost_$$ 
     272  cat >/tmp/tmp_IGCM_sys_RshPost_$$_${LOGNAME} 
     273 
     274  /bin/ksh </tmp/tmp_IGCM_sys_RshPost_$$_${LOGNAME} 
    264275  if [ $? -gt 0 ] ; then 
    265276    echo "IGCM_sys_RshPost : erreur." 
     
    267278  fi 
    268279  # delete temporary file 
    269   \rm tmp_IGCM_sys_RshPost_$$ 
     280  \rm /tmp/tmp_IGCM_sys_RshPost_$$_${LOGNAME} 
    270281  IGCM_debug_PopStack "IGCM_sys_RshPost" 
    271282} 
     
    299310 
    300311  if [ ! -z ${config_UserChoices_MailName} ] ; then 
    301     mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} < mail.txt 
     312    mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  mail.txt 
    302313  elif [ -f ~/.forward ] ; then 
    303314    mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < mail.txt 
     
    347358  #- creation de repertoire sur le serveur fichier 
    348359  if [ ! -d ${1} ]; then 
    349     mkdir -p $1 
     360    \mkdir -p $1 
    350361    status=$? 
    351362 
     
    930941  fi 
    931942  if [ $DRYRUN = 0 ]; then 
    932     if [ ! -d ${1} ] ; then 
    933       echo "WARNING : IGCM_sys_Get_Dir ${1} DOES NOT EXIST ." 
    934       IGCM_debug_PopStack "IGCM_sys_Get_Dir" 
    935       return 
    936     fi 
    937  
    938943    typeset status 
    939944 
     
    10261031    typeset status 
    10271032    # 
    1028     if [ X${JobType} = XRUN ] ; then 
    1029       IGCM_sys_Chmod 444 ${1} 
    1030     fi 
    1031     # 
    1032     # Only if we use rsync 
    1033     #IGCM_sys_MkdirArchive $( dirname $2 ) 
    1034     # 
    1035     #USUAL WAY 
    1036     \cp $1 $2 > /tmp/out_command_${LOGIN}.$$ 2>&1 
     1033    # USUAL WAY 
     1034    \cp $1 $2 > /tmp/out_command.$$ 2>&1 
    10371035    status=$? 
    10381036 
     
    10531051    if [ ${status} -gt 0 ] ; then 
    10541052      echo "IGCM_sys_Put_Rest : cp failed error code ${status}" 
    1055       cat /tmp/out_command_${LOGIN}.$$ 
     1053      [ -f ${1} ] && ls -l ${1} 
     1054      [ -f ${2} ] && ls -l ${2} 
     1055      [ -f ${2}/${1} ] && ls -l ${2}/${1} 
     1056      cat /tmp/out_command.$$ 
    10561057      IGCM_debug_Exit "IGCM_sys_Put_Rest" 
    10571058    else 
    1058       \rm /tmp/out_command_${LOGIN}.$$ 
     1059 
     1060      if [ X${JobType} = XRUN ] ; then 
     1061        [ -f ${2} ] && IGCM_sys_Chmod 444 ${2} 
     1062        [ -f ${2}/${1} ] && IGCM_sys_Chmod 444 ${2}/${1} 
     1063      fi 
     1064 
     1065      \rm /tmp/out_command.$$ 
    10591066    fi 
    10601067  fi 
     
    10801087 
    10811088    typeset status 
    1082     # 
    1083     if [ X${JobType} = XRUN ] ; then 
    1084       IGCM_sys_Chmod 444 ${1} 
    1085     fi 
    1086  
    10871089    # 
    10881090    # USUAL WAY 
     
    10971099      IGCM_debug_Exit "IGCM_sys_PutBuffer_Rest" 
    10981100    else 
    1099       \rm /tmp/out_command_${LOGIN}.$$ 
     1101 
     1102      if [ X${JobType} = XRUN ] ; then 
     1103        [ -f ${2} ] && IGCM_sys_Chmod 444 ${2} 
     1104        [ -f ${2}/${1} ] && IGCM_sys_Chmod 444 ${2}/${1} 
     1105      fi 
     1106 
     1107      \rm /tmp/out_command.$$ 
    11001108    fi 
    11011109  fi 
     
    12131221      i=0 
    12141222      while [ $i -lt $NB_ESSAI ] ; do 
    1215         # USUAL WAY 
    1216         \cp $1 $2 > /tmp/out_command_${LOGIN}.$$ 2>&1 
    1217         status=$? 
     1223        if [ $( stat -c %d $1 ) -ne $( stat -c %d $( dirname $2 ) ) ] ; then 
     1224          # USUAL WAY 
     1225          \cp $1 $2 > /tmp/out_command.$$ 2>&1 
     1226          status=$? 
     1227        else 
     1228          # NOT SO USUAL WAY 
     1229          \mv $1 $2 > /tmp/out_command.$$ 2>&1 
     1230          status=$? 
     1231        fi 
    12181232        if [ ${status} -gt 0 ]; then 
    12191233          IGCM_debug_Print 2 "IGCM_sys_PutBuffer_Out : cp failed error code ${status} ${i}/${NB_ESSAI}" 
     
    12331247      [ -f ${2} ] && ls -l ${2} 
    12341248      [ -f ${2}/${1} ] && ls -l ${2}/${1} 
    1235       cat /tmp/out_command_${LOGIN}.$$ 
     1249      cat /tmp/out_command.$$ 
    12361250      IGCM_debug_Exit "IGCM_sys_PutBuffer_Out" 
    12371251    else 
     
    13871401    echo "IGCM_sys_GetDate_FichWork :" $@ 
    13881402  fi 
     1403 
     1404  if [ $# -ge 3 ] ; then 
     1405    mode=$3 
     1406    TimeStyle=$4 
     1407  else 
     1408    mode="default" 
     1409    TimeStyle="%Y%m%d%H%M%S" 
     1410  fi 
     1411 
    13891412  typeset dateF 
    1390   set +A dateF -- $( ls -l --full-time --time-style='+%Y%m%d%H%M%S' ${1} ) 
    1391   eval ${2}=${dateF[5]} 
     1413  set +A dateF -- $( ls -l --full-time --time-style=+"${TimeStyle}" ${1} ) 
     1414 
     1415  case $mode in 
     1416    "default") 
     1417      eval ${2}=${dateF[5]} 
     1418      ;; 
     1419    "SplitFields") 
     1420      eval ${2}="${dateF[5]}\ ${dateF[6]}" 
     1421      ;; 
     1422  esac 
     1423 
    13921424 
    13931425  # donne la date filesys d'un fichier sur la machine work 
     
    15771609  #  0  118 110.0000000000000   87.46478873239437 
    15781610  #  1  40  4.999999999999995   51.97183098591550 
     1611 
    15791612#  typeset iStation iProc list_opt file_in file_out prefix_invert 
    15801613#  typeset -Z4 j4 
Note: See TracChangeset for help on using the changeset viewer.