Changeset 1858


Ignore:
Timestamp:
09/03/12 17:46:44 (12 years ago)
Author:
gpincka
Message:

modif : pas de chargement de certaines var d env si execution du script de liste

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TOOLS/PACK_IPSL/load_ipslPack_env.sh

    r1853 r1858  
    99export OUTPUT_PROGRESS="/ccc/dmfbuf/import_data.2/ccrt/dmnfs12/cont003/bacasable/GUILLAUME/PSEUDO_DMNFS_PROGRESS" 
    1010 
     11# Sur curie en sequentiel 
     12# export OUTPUT_PROGRESS="/ccc/dmfbuf/import_data.2/ccrt/dmnfs12/cont003/bacasable/GUILLAUME/PSEUDO_DMNFS_PROGRESS_SEQ" 
     13# export OUTPUT_STORE="/ccc/dmfbuf/import_data.2/ccrt/dmnfs12/cont003/bacasable/GUILLAUME/PSEUDO_DMNFS_STORE_SEQ" 
     14# export OUTPUT_WORK="/ccc/dmfbuf/import_data.2/ccrt/dmnfs12/cont003/bacasable/GUILLAUME/PSEUDO_DMNFS_WORK_SEQ" 
     15 
     16 
    1117# Pour titane 
    1218#export IGCM_DEM="/scratch/cont003/pierreg/IGCM_DEM" 
     
    1723#export OUTPUT_PROGRESS="/scratch/cont003/pierreg/PSEUDO_DMNFS_PROGRESS" 
    1824 
     25scriptCallingThisOne="$scriptCallingLoad" 
     26# echo "scriptCallingThisOne=$scriptCallingThisOne" 
    1927 
    20 # Determination du chemin pour le rep ${PSEUDO_DMNFS_PROGRESS}/USER 
    21 # ------------------------------------------------------------------ 
    22 # Le rep ${OUTPUT_PROGRESS} contiendra des sous rep USER 
    23 # ${OUTPUT_PROGRESS}/USER contiendra, pour l'utilisateur USER : 
    24 #    * la liste des taches a executer en parallele par le prog c/mpi 
    25 #    * la nouvelle liste des taches qui n'ont pas ete reussies dans un premier temps 
    26 #    * les sorties des taches executees en parallele (traitement des liste de fichiers) 
    27 # L'idee est de regrouper ces elements dans un rep ${OUTPUT_PROGRESS}/USER 
    28 # Pour determiner le rep USER, on parcourt ${IGCM_DEM}/config_card.liste.  
    29 # La chaine de caract commune a toutes les lignes de ce fichier est le rep USER,  
    30 # que l'on cree ensuite dans ${OUTPUT_PROGRESS} 
     28if [ "x${scriptCallingThisOne}" == "xlaunch_ipsl_pack.sh" ] 
     29then 
    3130 
    32 function find_intersection 
    33 { 
    34     # Trouve la sous chaine commune de 2 chaines de caract 
    35     local string1=$1 
    36     local string2=$2 
    37      
    38     local lengthString1=${#string1} 
    39     local lengthString2=${#string2} 
    40      
    41     local longestString= 
    42     local smallestString= 
    43     if [ $lengthString1 -ge $lengthString2 ] 
    44     then 
    45        longestString=$string1 
    46        smallestString=$string2 
    47     else 
    48        longestString=$string2 
    49        smallestString=$string1   
    50     fi 
    51      
    52     while [ "x`echo $longestString | grep $smallestString `" == "x" ] 
    53     do 
    54         smallestString=$( dirname $smallestString ) 
     31    echo "blabla" 
     32    # Determination du chemin pour le rep ${PSEUDO_DMNFS_PROGRESS}/USER (seulement pour la partie de pack) 
     33    # ------------------------------------------------------------------ 
     34    # Le rep ${OUTPUT_PROGRESS} contiendra des sous rep USER 
     35    # ${OUTPUT_PROGRESS}/USER contiendra, pour l'utilisateur USER : 
     36    #    * la liste des taches a executer en parallele par le prog c/mpi 
     37    #    * la nouvelle liste des taches qui n'ont pas ete reussies dans un premier temps 
     38    #    * les sorties des taches executees en parallele (traitement des liste de fichiers) 
     39    # L'idee est de regrouper ces elements dans un rep ${OUTPUT_PROGRESS}/USER 
     40    # Pour determiner le rep USER, on parcourt ${IGCM_DEM}/config_card.liste.  
     41    # La chaine de caract commune a toutes les lignes de ce fichier est le rep USER,  
     42    # que l'on cree ensuite dans ${OUTPUT_PROGRESS} 
     43 
     44    function find_intersection 
     45    { 
     46        # Trouve la sous chaine commune de 2 chaines de caract 
     47        local string1=$1 
     48        local string2=$2 
     49 
     50        local lengthString1=${#string1} 
     51        local lengthString2=${#string2} 
     52 
     53        local longestString= 
     54        local smallestString= 
     55        if [ $lengthString1 -ge $lengthString2 ] 
     56        then 
     57           longestString=$string1 
     58           smallestString=$string2 
     59        else 
     60           longestString=$string2 
     61           smallestString=$string1   
     62        fi 
     63 
     64        while [ "x`echo $longestString | grep $smallestString `" == "x" ] 
     65        do 
     66            smallestString=$( dirname $smallestString ) 
     67        done 
     68        echo "$smallestString" 
     69    } 
     70 
     71    COMMON_STRING=`head -n 1 ${IGCM_DEM}/config_card.liste | awk '{print $1}' | xargs dirname ` 
     72    for CONFIG in $( awk '{print $1}' ${IGCM_DEM}/config_card.liste ) ; do 
     73 
     74       PATH_SIMU=$( dirname $CONFIG ) 
     75       INTERSECT=$( find_intersection  $PATH_SIMU $COMMON_STRING ) 
     76       COMMON_STRING=$INTERSECT 
     77 
    5578    done 
    56     echo "$smallestString" 
    57 } 
    5879 
    59 COMMON_STRING=`head -n 1 ${IGCM_DEM}/config_card.liste | awk '{print $1}' | xargs dirname ` 
    60 for CONFIG in $( awk '{print $1}' ${IGCM_DEM}/config_card.liste ) ; do 
     80    # echo "COMMON_STRING=$COMMON_STRING" 
    6181 
    62    PATH_SIMU=$( dirname $CONFIG ) 
    63    INTERSECT=$( find_intersection  $PATH_SIMU $COMMON_STRING ) 
    64    COMMON_STRING=$INTERSECT 
    65    
    66 done 
     82    PATH_TO_ADD=`echo $COMMON_STRING | sed "s;${IGCM_DEM};;" | sed 's;^/;;' ` 
     83    # echo "PATH_TO_ADD=$PATH_TO_ADD" 
    6784 
    68 # echo "COMMON_STRING=$COMMON_STRING" 
     85    USER_OUTPUT_PROGRESS="${OUTPUT_PROGRESS}/${PATH_TO_ADD}" 
     86    export USER_OUTPUT_PROGRESS=`echo $USER_OUTPUT_PROGRESS | sed 's;/$;;' ` 
     87    export DETAILLED_OUTPUT="${USER_OUTPUT_PROGRESS}/detailed_pack_output" 
    6988 
    70 PATH_TO_ADD=`echo $COMMON_STRING | sed "s;${IGCM_DEM};;" | sed 's;^/;;' ` 
    71 # echo "PATH_TO_ADD=$PATH_TO_ADD" 
     89    # creation du rep ${IGCM_DEM}/PSEUDO_DMNFS_PROGRESS/USER 
     90    mkdir -p ${USER_OUTPUT_PROGRESS} 
    7291 
    73 USER_OUTPUT_PROGRESS="${OUTPUT_PROGRESS}/${PATH_TO_ADD}" 
    74 export USER_OUTPUT_PROGRESS=`echo $USER_OUTPUT_PROGRESS | sed 's;/$;;' ` 
    75 export DETAILLED_OUTPUT="${USER_OUTPUT_PROGRESS}/detailed_pack_output" 
     92    # creation d'un rep specifique pour les sorties detaillees des operations de pack 
     93    mkdir -p ${DETAILLED_OUTPUT} 
    7694 
    77 # creation du rep ${IGCM_DEM}/PSEUDO_DMNFS_PROGRESS/USER 
    78 mkdir -p ${USER_OUTPUT_PROGRESS} 
    79  
    80 # creation d'un rep specifique pour les sorties detaillees des operations de pack 
    81 mkdir -p ${DETAILLED_OUTPUT} 
    82  
    83  
     95fi 
Note: See TracChangeset for help on using the changeset viewer.