source: TOOLS/PACK_IPSL/load_ipslPack_env.sh @ 1854

Last change on this file since 1854 was 1853, checked in by gpincka, 12 years ago

principalement : enchainement du launcher parallele + gestion reprise du code parallele

  • Property svn:executable set to *
File size: 3.3 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# Pour titane
12#export IGCM_DEM="/scratch/cont003/pierreg/IGCM_DEM"
13#export INPUT_DMF_DATA="/scratch/cont003/pierreg/datasLabo/dataDMNFS_simple1"
14#export OUTPUT_STORE="/scratch/cont003/pierreg/PSEUDO_DMNFS_STORE"
15#export OUTPUT_WORK="/scratch/cont003/pierreg/PSEUDO_DMNFS_WORK"
16#export OUTPUT_CHECK="/scratch/cont003/pierreg/PSEUDO_DMNFS_CHECK"
17#export OUTPUT_PROGRESS="/scratch/cont003/pierreg/PSEUDO_DMNFS_PROGRESS"
18
19
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}
31
32function 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 )
55    done
56    echo "$smallestString"
57}
58
59COMMON_STRING=`head -n 1 ${IGCM_DEM}/config_card.liste | awk '{print $1}' | xargs dirname `
60for CONFIG in $( awk '{print $1}' ${IGCM_DEM}/config_card.liste ) ; do
61
62   PATH_SIMU=$( dirname $CONFIG )
63   INTERSECT=$( find_intersection  $PATH_SIMU $COMMON_STRING )
64   COMMON_STRING=$INTERSECT
65 
66done
67
68# echo "COMMON_STRING=$COMMON_STRING"
69
70PATH_TO_ADD=`echo $COMMON_STRING | sed "s;${IGCM_DEM};;" | sed 's;^/;;' `
71# echo "PATH_TO_ADD=$PATH_TO_ADD"
72
73USER_OUTPUT_PROGRESS="${OUTPUT_PROGRESS}/${PATH_TO_ADD}"
74export USER_OUTPUT_PROGRESS=`echo $USER_OUTPUT_PROGRESS | sed 's;/$;;' `
75export DETAILLED_OUTPUT="${USER_OUTPUT_PROGRESS}/detailed_pack_output"
76
77# creation du rep ${IGCM_DEM}/PSEUDO_DMNFS_PROGRESS/USER
78mkdir -p ${USER_OUTPUT_PROGRESS}
79
80# creation d'un rep specifique pour les sorties detaillees des operations de pack
81mkdir -p ${DETAILLED_OUTPUT}
82
83
Note: See TracBrowser for help on using the repository browser.