source: TOOLS/PACK_IPSL/load_ipslPack_env.sh @ 1869

Last change on this file since 1869 was 1863, checked in by gpincka, 12 years ago

Traitement des listes ncrcat_output ==> output_tar + modif affichage du bilan dans showPack + suppression de IGCM_DEM dans launch_ipsl_pack

  • Property svn:executable set to *
File size: 3.9 KB
Line 
1#!/bin/bash
2
3# Variables d'environnement
4export IGCM_DEM="/ccc/dmfbuf/import_data.2/ccrt/dmnfs12/cont003/bacasable/GUILLAUME/IGCM_DEM"
5export INPUT_DMF_DATA="/ccc/dmfbuf/import_data.2/ccrt/dmnfs12/cont003/bacasable/GUILLAUME_DATAS"
6export OUTPUT_STORE="/ccc/dmfbuf/import_data.2/ccrt/dmnfs12/cont003/bacasable/GUILLAUME/PSEUDO_DMNFS_STORE"
7export OUTPUT_WORK="/ccc/dmfbuf/import_data.2/ccrt/dmnfs12/cont003/bacasable/GUILLAUME/PSEUDO_DMNFS_WORK"
8export OUTPUT_CHECK="/ccc/dmfbuf/import_data.2/ccrt/dmnfs12/cont003/bacasable/GUILLAUME/PSEUDO_DMNFS_CHECK"
9export OUTPUT_PROGRESS="/ccc/dmfbuf/import_data.2/ccrt/dmnfs12/cont003/bacasable/GUILLAUME/PSEUDO_DMNFS_PROGRESS"
10
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
17# Pour titane
18#export IGCM_DEM="/scratch/cont003/pierreg/IGCM_DEM"
19#export INPUT_DMF_DATA="/scratch/cont003/pierreg/datasLabo/dataDMNFS_simple1"
20#export OUTPUT_STORE="/scratch/cont003/pierreg/PSEUDO_DMNFS_STORE"
21#export OUTPUT_WORK="/scratch/cont003/pierreg/PSEUDO_DMNFS_WORK"
22#export OUTPUT_CHECK="/scratch/cont003/pierreg/PSEUDO_DMNFS_CHECK"
23#export OUTPUT_PROGRESS="/scratch/cont003/pierreg/PSEUDO_DMNFS_PROGRESS"
24
25
26
27# Determination du chemin pour le rep ${PSEUDO_DMNFS_PROGRESS}/USER (seulement pour la partie de pack)
28# ------------------------------------------------------------------
29# Le rep ${OUTPUT_PROGRESS} contiendra des sous rep USER
30# ${OUTPUT_PROGRESS}/USER contiendra, pour l'utilisateur USER :
31#    * la liste des taches a executer en parallele par le prog c/mpi
32#    * la nouvelle liste des taches qui n'ont pas ete reussies dans un premier temps
33#    * les sorties des taches executees en parallele (traitement des liste de fichiers)
34# L'idee est de regrouper ces elements dans un rep ${OUTPUT_PROGRESS}/USER
35# Pour determiner le rep USER, on parcourt ${IGCM_DEM}/config_card.liste.
36# La chaine de caract commune a toutes les lignes de ce fichier est le rep USER,
37# que l'on cree ensuite dans ${OUTPUT_PROGRESS}
38
39function find_intersection
40{
41    # Trouve la sous chaine commune de 2 chaines de caract
42    local string1=$1
43    local string2=$2
44
45    local lengthString1=${#string1}
46    local lengthString2=${#string2}
47
48    local longestString=
49    local smallestString=
50    if [ $lengthString1 -ge $lengthString2 ]
51    then
52       longestString=$string1
53       smallestString=$string2
54    else
55       longestString=$string2
56       smallestString=$string1 
57    fi
58
59    while [ "x`echo $longestString | grep $smallestString `" == "x" ]
60    do
61        smallestString=$( dirname $smallestString )
62    done
63    echo "$smallestString"
64}
65
66
67scriptCallingThisOne="$scriptCallingLoad"
68# echo "scriptCallingThisOne=$scriptCallingThisOne"
69
70if [ "x${scriptCallingThisOne}" != "xlaunch_ipsl_pack.sh" ]
71then
72
73    echo "specific loading for pack script."
74   
75    COMMON_STRING=`head -n 1 ${IGCM_DEM}/config_card.liste | awk '{print $1}' | xargs dirname `
76    for CONFIG in $( awk '{print $1}' ${IGCM_DEM}/config_card.liste ) ; do
77
78       PATH_SIMU=$( dirname $CONFIG )
79       INTERSECT=$( find_intersection  $PATH_SIMU $COMMON_STRING )
80       COMMON_STRING=$INTERSECT
81
82    done
83
84    # echo "COMMON_STRING=$COMMON_STRING"
85
86    PATH_TO_ADD=`echo $COMMON_STRING | sed "s;${IGCM_DEM};;" | sed 's;^/;;' `
87    # echo "PATH_TO_ADD=$PATH_TO_ADD"
88
89    USER_OUTPUT_PROGRESS="${OUTPUT_PROGRESS}/${PATH_TO_ADD}"
90    export USER_OUTPUT_PROGRESS=`echo $USER_OUTPUT_PROGRESS | sed 's;/$;;' `
91    export DETAILLED_OUTPUT="${USER_OUTPUT_PROGRESS}/detailed_pack_output"
92
93    # creation du rep ${IGCM_DEM}/PSEUDO_DMNFS_PROGRESS/USER
94    mkdir -p ${USER_OUTPUT_PROGRESS}
95
96    # creation d'un rep specifique pour les sorties detaillees des operations de pack
97    mkdir -p ${DETAILLED_OUTPUT}
98
99fi
Note: See TracBrowser for help on using the repository browser.