Changeset 1911


Ignore:
Timestamp:
11/08/12 09:53:43 (11 years ago)
Author:
aclsce
Message:
  • Modified to not create tmp files in current directory
Location:
TOOLS/PACK_IPSL
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • TOOLS/PACK_IPSL/DEM_utilities.sh

    r1910 r1911  
    11#!/bin/bash 
    2  
    32# 
    43# Fonctions utiles pour les scripts de Pack IPSL 
     
    232231   PROGNAME="DEM_utilities.sh" ######### 
    233232   . /etc/profile  
    234    module list >& myModuleList.txt 
     233   module list >& ${JOB_DIR}/myModuleList.txt 
    235234    
    236235   if [ "x$?" != "x0" ] 
     
    240239   fi 
    241240    
    242    if [ ! -e myModuleList.txt ] 
     241   if [ ! -e ${JOB_DIR}/myModuleList.txt ] 
    243242   then 
    244243       # echo "Le fichier 'myModuleList.txt'  n existe pas" 
     
    247246    
    248247   # Presence de la chaine "n) nco/" ou n est un nombre   
    249    ncoLines=` grep -e '[[:digit:]]*) nco/' myModuleList.txt ` 
     248   ncoLines=` grep -e '[[:digit:]]*) nco/' ${JOB_DIR}/myModuleList.txt ` 
    250249   # ncoLines=` grep -e '[[:digit:]]*) nco/' moduleList.txt ` 
    251250   # echo "ncoLines=${ncoLines}|" 
     
    253252 
    254253   # Plus besoin du myModuleList.txt 
    255    rm -f myModuleList.txt 
     254   rm -f ${JOB_DIR}/myModuleList.txt 
    256255  
    257256   # La chaine "nco" est remplacee par le caractere "#" 
     
    331330   PROGNAME="DEM_utilities.sh" ######### 
    332331   . /etc/profile  
    333    module list >& myModuleList.txt 
     332   module list >& ${JOB_DIR}/myModuleList.txt 
    334333    
    335334   if [ "x$?" != "x0" ] 
     
    339338   fi 
    340339    
    341    if [ ! -e myModuleList.txt ] 
     340   if [ ! -e ${JOB_DIR}/myModuleList.txt ] 
    342341   then 
    343342       # echo "Le fichier 'myModuleList.txt'  n existe pas" 
     
    346345    
    347346   # Presence de la chaine "n) nco/" ou n est un nombre   
    348    ncoLines=` grep -e '[[:digit:]]*) nco/' myModuleList.txt ` 
     347   ncoLines=` grep -e '[[:digit:]]*) nco/' ${JOB_DIR}/myModuleList.txt ` 
    349348   # ncoLines=` grep -e '[[:digit:]]*) nco/' moduleList.txt ` 
    350349   # echo "ncoLines=${ncoLines}|" 
     
    352351 
    353352   # Plus besoin du myModuleList.txt 
    354    rm -f myModuleList.txt 
     353   rm -f ${JOB_DIR}/myModuleList.txt 
    355354  
    356355   # La chaine "nco" est remplacee par le caractere "#" 
     
    427426   PROGNAME="DEM_utilities.sh" ######### 
    428427   . /etc/profile  
    429    module list >& myModuleList.txt 
     428   module list >& ${JOB_DIR}/myModuleList.txt 
    430429    
    431430   if [ "x$?" != "x0" ] 
     
    435434   fi 
    436435    
    437    if [ ! -e myModuleList.txt ] 
     436   if [ ! -e ${JOB_DIR}/myModuleList.txt ] 
    438437   then 
    439438       # echo "Le fichier 'myModuleList.txt'  n existe pas" 
     
    442441    
    443442   # Presence de la chaine "n) nco/" ou n est un nombre   
    444    nb_of_libLines=` grep -e '[[:digit:]]*) netcdf/' myModuleList.txt | wc -l ` 
     443   nb_of_libLines=` grep -e '[[:digit:]]*) netcdf/' ${JOB_DIR}/myModuleList.txt | wc -l ` 
    445444 
    446445   if [ "x${nb_of_libLines}" == "x0" ] 
     
    450449 
    451450   # Plus besoin du myModuleList.txt 
    452    rm -f myModuleList.txt 
     451   rm -f ${JOB_DIR}/myModuleList.txt 
    453452} 
    454453 
     
    458457   PROGNAME="DEM_utilities.sh" ######### 
    459458   . /etc/profile  
    460    module list >& myModuleList.txt 
     459   module list >& ${JOB_DIR}/myModuleList.txt 
    461460    
    462461   if [ "x$?" != "x0" ] 
     
    466465   fi 
    467466    
    468    if [ ! -e myModuleList.txt ] 
     467   if [ ! -e ${JOB_DIR}/myModuleList.txt ] 
    469468   then 
    470469       # echo "Le fichier 'myModuleList.txt'  n existe pas" 
     
    473472    
    474473   # Presence de la chaine "n) nco/" ou n est un nombre   
    475    nb_of_libLines=` grep -e '[[:digit:]]*) libccc_user/' myModuleList.txt | wc -l ` 
     474   nb_of_libLines=` grep -e '[[:digit:]]*) libccc_user/' ${JOB_DIR}/myModuleList.txt | wc -l ` 
    476475 
    477476   if [ "x${nb_of_libLines}" == "x0" ] 
     
    481480 
    482481   # Plus besoin du myModuleList.txt 
    483    rm -f myModuleList.txt 
     482   rm -f ${JOB_DIR}/myModuleList.txt 
    484483 
    485484} 
     
    491490   PROGNAME="DEM_utilities.sh" ######### 
    492491   . /etc/profile  
    493    module list >& myModuleList.txt 
     492   module list >& ${JOB_DIR}/myModuleList.txt 
    494493    
    495494   if [ "x$?" != "x0" ] 
     
    499498   fi 
    500499    
    501    if [ ! -e myModuleList.txt ] 
     500   if [ ! -e ${JOB_DIR}/myModuleList.txt ] 
    502501   then 
    503502       # echo "Le fichier 'myModuleList.txt'  n existe pas" 
     
    506505    
    507506   # Presence de la chaine "n) nco/" ou n est un nombre   
    508    nb_of_libLines=` grep -e '[[:digit:]]*) cdo/' myModuleList.txt | wc -l ` 
     507   nb_of_libLines=` grep -e '[[:digit:]]*) cdo/' ${JOB_DIR}/myModuleList.txt | wc -l ` 
    509508 
    510509   if [ "x${nb_of_libLines}" == "x0" ] 
     
    514513 
    515514   # Plus besoin du myModuleList.txt 
    516    rm -f myModuleList.txt 
     515   rm -f ${JOB_DIR}/myModuleList.txt 
    517516 
    518517} 
  • TOOLS/PACK_IPSL/archive_debug.sh

    r1900 r1911  
    5858 
    5959cd ${STORE_DEBUG} 
     60if [ "x${STORE_DEBUG}" != "x" ] 
     61then 
    6062rm -rf * 
     63fi 
    6164 
    6265# On copie les fichiers de Debug sur le scratchdir en changeant le nom et conservant la date 
  • TOOLS/PACK_IPSL/archive_restart.sh

    r1900 r1911  
    7474 
    7575cd ${STORE_RESTART} 
     76if [ "x${STORE_RESTART}" != "x" ] 
     77then 
    7678rm -rf * 
     79fi 
    7780 
    7881# On les copie sur le scratchdir en changeant le nom et conservant la date 
  • TOOLS/PACK_IPSL/check_libccc_user.sh

    r1867 r1911  
    33function check_cdo 
    44{ 
    5    module list >& myModuleList.txt  
     5   . load_ipslPack_env.sh 
     6   module list >& ${TMP_MIGR_DATA}/myModuleList.txt  
    67    
    78   # Presence de la chaine "n) nco/" ou n est un nombre   
    8    nb_of_libLines=` grep -e '[[:digit:]]*) libccc_user/' myModuleList.txt | wc -l ` 
     9   nb_of_libLines=` grep -e '[[:digit:]]*) libccc_user/' ${TMP_MIGR_DATA}/myModuleList.txt | wc -l ` 
    910 
    1011   if [ "x${nb_of_libLines}" == "x0" ] 
     
    1516 
    1617   # Plus besoin du myModuleList.txt 
    17    rm -f myModuleList.txt > /dev/null 2>&1 
     18   rm -f ${TMP_MIGR_DATA}/myModuleList.txt > /dev/null 2>&1 
    1819   # echo "0" 
    1920   exit 0 
  • TOOLS/PACK_IPSL/diff.bash

    r1882 r1911  
    1616fi 
    1717 
    18 cdo -s $delname $1 out_tmp1.nc 
    19 cdo -s $delname $2 out_tmp2.nc 
     18cdo -s $delname $1 ${JOB_DIR}/out_tmp1.nc 
     19cdo -s $delname $2 ${JOB_DIR}/out_tmp2.nc 
    2020 
    21 cdo -s diff out_tmp1.nc out_tmp2.nc > diff_$$.tmp 2>&1 
    22 result2=`cat diff_$$.tmp | grep -i "records differ" | tr -s " " | cut -f2 -d" "` 
     21cdo -s diff ${JOB_DIR}/out_tmp1.nc ${JOB_DIR}/out_tmp2.nc > ${JOB_DIR}/diff_$$.tmp 2>&1 
     22result2=`cat ${JOB_DIR}/diff_$$.tmp | grep -i "records differ" | tr -s " " | cut -f2 -d" "` 
    2323 
    2424if [ "$result2" = "0" ] ; then 
     
    2828        echo "$2"  
    2929        echo "are the same" 
    30         rm -f diff_$$.tmp out_tmp1.nc out_tmp2.nc 
     30        rm -f ${JOB_DIR}/diff_$$.tmp ${JOB_DIR}/out_tmp1.nc ${JOB_DIR}/out_tmp2.nc 
    3131        exit 0 
    3232else 
     
    3636        echo "$2"  
    3737        echo "differ"    
    38         cat diff_$$.tmp | grep -i "records differ" 
    39         rm -f diff_$$.tmp out_tmp1.nc out_tmp2.nc 
     38        cat ${JOB_DIR}/diff_$$.tmp | grep -i "records differ" 
     39        rm -f ${JOB_DIR}/diff_$$.tmp ${JOB_DIR}/out_tmp1.nc ${JOB_DIR}/out_tmp2.nc 
    4040        echo "==============> ERROR" 
    4141        exit 1  
  • TOOLS/PACK_IPSL/find_directory_simul.sh

    r1900 r1911  
    104104DEM_log -1 "Suppression des doublons" 
    105105 
    106 awk '{if (x[$0] != "") next ; print $0 ; x[$0]=$0}' <${IGCM_TMP}/${$}.path_simul.txt  >> liste_simul_${LISTE_SIMUL_NAME} 
    107 awk '{if (x[$0] != "") next ; print $0 ; x[$0]=$0}' <liste_simul_${LISTE_SIMUL_NAME}  >> liste_simul_${LISTE_SIMUL_NAME}.tmp${$} 
    108 mv liste_simul_${LISTE_SIMUL_NAME}.tmp${$} ${IGCM_DEM}/liste_simul_${LISTE_SIMUL_NAME} 
    109 rm -f liste_simul_${LISTE_SIMUL_NAME} 
     106awk '{if (x[$0] != "") next ; print $0 ; x[$0]=$0}' <${IGCM_TMP}/${$}.path_simul.txt  >> ${JOB_DIR}/liste_simul_${LISTE_SIMUL_NAME} 
     107awk '{if (x[$0] != "") next ; print $0 ; x[$0]=$0}' <${JOB_DIR}/liste_simul_${LISTE_SIMUL_NAME}  >> ${JOB_DIR}/liste_simul_${LISTE_SIMUL_NAME}.tmp${$} 
     108mv ${JOB_DIR}/liste_simul_${LISTE_SIMUL_NAME}.tmp${$} ${IGCM_DEM}/liste_simul_${LISTE_SIMUL_NAME} 
     109rm -f ${JOB_DIR}/liste_simul_${LISTE_SIMUL_NAME} 
    110110 
    111111# gpdebug : envoi du nombre de simu dans un "nbSimu.txt" du rep de suivi 
  • TOOLS/PACK_IPSL/launch_and_measureTime.sh

    r1900 r1911  
    5858    
    5959   # Il peut arriver que 2 listes soient identiques, on empeche ce cas 
    60    cat ${tasksListFile} | sort | uniq > taskFile.txt 
    61    cat taskFile.txt > ${tasksListFile}   
     60   cat ${tasksListFile} | sort | uniq > ${JOB_DIR}/taskFile.txt 
     61   cat ${JOB_DIR}/taskFile.txt > ${tasksListFile}   
    6262 
    6363} 
     
    343343#MSUB -r pack_ipsl          # Nom du job                 
    344344### mutable directives ### 
    345 #MSUB -o /ccc/dmfbuf/ipsl_logs/dsm/bacasable/ARNAUD/PSEUDO_DMNFS_PROGRESS/ARNAUD/IPSLCM5/detailed_pack_output/pack_ipsl_%I.o 
    346 #MSUB -e /ccc/dmfbuf/ipsl_logs/dsm/bacasable/ARNAUD/PSEUDO_DMNFS_PROGRESS/ARNAUD/IPSLCM5/detailed_pack_output/pack_ipsl_%I.e 
     345#MSUB -o /ccc/dmfbuf/ipsl_logs/dsm/bacasable/ARNAUD/PSEUDO_DMNFS_PROGRESS/ARNAUD/IPSLCM5/R55C/detailed_pack_output/pack_ipsl_%I.o 
     346#MSUB -e /ccc/dmfbuf/ipsl_logs/dsm/bacasable/ARNAUD/PSEUDO_DMNFS_PROGRESS/ARNAUD/IPSLCM5/R55C/detailed_pack_output/pack_ipsl_%I.e 
    347347#MSUB -n 16 
    348348#MSUB -T 1500 
     
    352352########## batch directives : end ########## 
    353353set +x 
    354  
    355354export JOB_DIR=${TMP_MIGR_DATA} 
    356355export EXE_DIR=${LS_SUBCWD:-${PWD}} 
     
    376375export reportFile="${progressDir}/report__try__${numCurrentTry}__instance__${numNewInstance}.log" 
    377376export checkFile="${progressDir}/check__try__${numCurrentTry}__instance__${numNewInstance}.log" 
    378 export checkFileTmp="checkTmp__try__${numCurrentTry}__instance__${numNewInstance}.txt" 
     377export checkFileTmp="${JOB_DIR}/checkTmp__try__${numCurrentTry}__instance__${numNewInstance}.txt" 
    379378 
    380379export listsOfFilesToRemove="${progressDir}/listsToRmv__try__${numCurrentTry}__instance__${numNewInstance}.txt" 
  • TOOLS/PACK_IPSL/process_list.sh

    r1900 r1911  
    5050for file in `cat $1` ; do 
    5151 #   ncdump -h ${file} | gawk '{if (match($0, /(byte|char|short|int|float|double) (.*)\(/, arr)) print arr[2] }' >> tmp_$$.txt 
    52     ncdump -h ${file} | grep -Ew "byte|char|short|int|float|double"  | awk -F\( '{split($1,a," ") ; split($2,b,")") ; if (a[2] != b[1]) print a[2]}'  >> tmp_$$.txt 
     52    ncdump -h ${file} | grep -Ew "byte|char|short|int|float|double"  | awk -F\( '{split($1,a," ") ; split($2,b,")") ; if (a[2] != b[1]) print a[2]}'  >> ${JOB_DIR}/tmp_$$.txt 
    5353    let nbfile=nbfile+1 
    5454done 
    5555 
    56 varstoexclude=`cat tmp_$$.txt | sort | uniq -c | awk -v nbfile=$nbfile '{if ($1 != nbfile) {print $2}}' | paste -s -d','` 
    57 varstoexcludefiltered=`cat tmp_$$.txt | sort | uniq -c | awk -v nbfile=$nbfile '{if (($1 != nbfile) && !(match($2, /t_inst_(.*)/))) {print $2}}' | paste -s -d','` 
     56varstoexclude=`cat ${JOB_DIR}/tmp_$$.txt | sort | uniq -c | awk -v nbfile=$nbfile '{if ($1 != nbfile) {print $2}}' | paste -s -d','` 
     57varstoexcludefiltered=`cat ${JOB_DIR}/tmp_$$.txt | sort | uniq -c | awk -v nbfile=$nbfile '{if (($1 != nbfile) && !(match($2, /t_inst_(.*)/))) {print $2}}' | paste -s -d','` 
    5858nbvars=`echo $varstoexcludefiltered | gawk -F',' '{print NF}'` 
    5959 
  • TOOLS/PACK_IPSL/showListsProgress.sh

    r1900 r1911  
    5353# Main program ######## 
    5454####################### 
    55  
     55. load_ipslPack_env.sh 
    5656# fichier de progression d'execution 
    5757# Le seul arg du script doit etre un fichier param 
    58  
    59 paramFile=${1} 
    60 paramFileBasename=$(basename ${1}) 
    61  
    62 if [ ! -e $paramFile ] || [ "x${paramFile}" == "x" ] 
     58# paramFile=${1} 
     59# paramFileBasename=$(basename ${1}) 
     60 
     61# if [ ! -e $paramFile ] || [ "x${paramFile}" == "x" ] 
     62# then 
     63#     echo "Le fichier en argument n existe pas" 
     64#     exit 0 
     65# fi 
     66 
     67if [ ! -e ${1} ] || [ "x${1}" == "x" ] 
    6368then 
    6469    echo "Le fichier en argument n existe pas" 
    6570    exit 0 
    66 fi 
     71else 
     72    paramFile=${1} 
     73    paramFileBasename=$(basename ${1}) 
     74fi 
     75 
     76 
    6777extSuiviListes=`echo ${paramFileBasename} | sed 's;\.[[:alnum:]]*$;;' ` 
    6878export MonitoringDir="${TMP_MIGR_DATA}/SuiviListes_${extSuiviListes}" 
  • TOOLS/PACK_IPSL/showPackProgress.sh

    r1900 r1911  
    5555{ 
    5656   statFile=$1 
    57    echo "statFile=$1" >> showPackProgress.log 
     57   echo "statFile=$1" >> ${JOB_DIR}/showPackProgress.log 
    5858   if [ ! -e $statFile ] 
    5959   then 
     
    6161      return 
    6262   fi 
    63    echo "blabla" >> showPackProgress.log 
    64    echo "----------------------------------------------" >> showPackProgress.log 
     63   echo "blabla" >> ${JOB_DIR}/showPackProgress.log 
     64   echo "----------------------------------------------" >> ${JOB_DIR}/showPackProgress.log 
    6565   # echo "progressStatus..." # gpdebug : a virer 
    6666    
     
    266266     fi 
    267267 
    268      echo "       $listName : $status | time : $timeTaken" >> simuPrint.txt 
     268     echo "       $listName : $status | time : $timeTaken" >> ${JOB_DIR}/simuPrint.txt 
    269269      
    270270     timeInSecondsOK=`echo $timeTaken | grep -e '^[[:digit:].]*$' | wc -l ` 
     
    339339 
    340340 
    341 > showPackProgress.log # vider le fichier de log 
     341> ${JOB_DIR}/showPackProgress.log # vider le fichier de log 
    342342 
    343343 
     
    399399    simuName=$( getSimuName $CONFIG ) 
    400400     
    401     > simuPrint.txt 
     401    > ${JOB_DIR}/simuPrint.txt 
    402402 
    403403    export PATH_SIMU=$( dirname $CONFIG ) 
     
    413413         for dir in $listOfDir 
    414414         do 
    415              echo "   ${dir} :" >> simuPrint.txt 
     415             echo "   ${dir} :" >> ${JOB_DIR}/simuPrint.txt 
    416416             if [ ! -d $PATH_SIMU/${dir} ] 
    417417             then 
    418                 echo "      ${dir} n'existe pas pour cette simu" >> simuPrint.txt 
     418                echo "      ${dir} n'existe pas pour cette simu" >> ${JOB_DIR}/simuPrint.txt 
    419419#               simuOK=$(( $simuOK && 0 )) # marque une simu pas OK 
    420420                continue 
     
    424424             if [ "x$listFilesInDir" == "x0" ] 
    425425             then 
    426                 echo "       -- no list --" >> simuPrint.txt 
     426                echo "       -- no list --" >> ${JOB_DIR}/simuPrint.txt 
    427427                continue            
    428428             fi 
     
    468468        if [ "x${detailed_mode}" == "x1" ] 
    469469        then 
    470             cat simuPrint.txt  $outRedirectStatement 
     470            cat ${JOB_DIR}/simuPrint.txt  $outRedirectStatement 
    471471        fi 
    472472    else 
     
    478478        if [ "x${detailed_mode}" == "x1" ] 
    479479        then 
    480             cat simuPrint.txt  $outRedirectStatement               >> ${outputFile} 
     480            cat ${JOB_DIR}/simuPrint.txt  $outRedirectStatement               >> ${outputFile} 
    481481        fi      
    482482        else 
     
    486486            then 
    487487                simuName_modif=$( echo $simuName | sed s%"/"%"_"%g ) 
    488                 cat simuPrint.txt $outRedirectStatemen > ${USER}_SIMUS/${simuName_modif}".log" 
     488                cat ${JOB_DIR}/simuPrint.txt $outRedirectStatemen > ${USER}_SIMUS/${simuName_modif}".log" 
    489489            fi 
    490490        fi 
    491491    fi  
    492     rm simuPrint.txt 
     492    rm ${JOB_DIR}/simuPrint.txt 
    493493done 
    494494 
Note: See TracChangeset for help on using the changeset viewer.