source: TOOLS/PACK_IPSL/launch_ipsl_enlarge.sh @ 1867

Last change on this file since 1867 was 1862, checked in by gpincka, 12 years ago

simplification mesure du temps de calcul

  • Property svn:executable set to *
File size: 3.7 KB
Line 
1#!/bin/bash
2######################
3## TITANE   CEA ##
4######################
5#MSUB -r ipsl_pack      # Nom du job               
6#MSUB -eo
7#MSUB -n 1              # Reservation du processus
8#MSUB -T 86400          # Limite de temps elapsed du job
9#MSUB -p gen2211
10#MSUB -q mono
11
12# ex : ./launch_ipsl_enlarge.sh
13
14# gpdebug : pour option -f
15restartExecFromZero=0
16while [ $# -gt 0 ]
17do
18   echo "boucle sur les arguments du script ..."
19   echo "@=$@"
20   case $1 in
21   -f)  restartExecFromZero=1
22        echo "force restart from the beginning ..."
23        ;;
24   esac
25   shift
26done
27export restartExecFromZero=${restartExecFromZero}
28# gpdebug : end
29
30export JOB_DIR=${LS_SUBCWD:-${PWD}}
31export EXE_DIR=${JOB_DIR}
32
33# export INPUT_DMF_DATA=/ccc/dmfbuf/import_data.2/ccrt/dmnfs12/cont003/bacasable # gpdebug : suppr
34# export OUTPUT_STORE=${SCRATCHDIR}/PSEUDO_DMNFS_STORE # gpdebug : suppr
35# export OUTPUT_WORK=${SCRATCHDIR}/PSEUDO_DMNFS_WORK # gpdebug : suppr
36
37SCRIPT_NAME=$(basename ${0} )
38
39# export IGCM_DEM=${SCRATCHDIR}/IGCM_DEM # gpdebug : suppr
40# export IGCM_TMP=${SCRATCHDIR}/IGCM_DEM/tmp # gpdebug : suppr
41
42# On renseigne les variables d'environnement
43export scriptCallingLoad=$SCRIPT_NAME # sert a renseigner "load_ipslPack_env.sh" sur le script l'appelant
44. load_ipslPack_env.sh
45export IGCM_TMP="${IGCM_DEM}/tmp"  # gpdebug : added
46
47
48export clean_tmp=${clean_tmp:-yes}
49export DEM_LOG=${JOB_DIR}/dem_${LSB_JOBID:-${$}}.log
50export LOG_LEV=2
51
52export config_card=${IGCM_DEM}/config_card.liste
53
54
55############## gpdebug : Pour gestion des erreurs #########################################
56# Execute la function errorReceive() si reception d'un signal TERM
57trap 'DEM_errorReceive' TERM
58# liste des processus à détruire en cas d'erreur bloquante
59export listPID=$$
60# fichier pour la transmission des messages d'erreur d'un fils au prog principal
61export errorMsgFile="${PWD}/errorMsg.txt"
62############## gpdebug : fin ##############################################################
63
64source ${EXE_DIR}/DEM_utilities.sh
65
66DEM_log -0 "Demarrage de ${SCRIPT_NAME}"
67
68check_nco_version # gpdebug : verification de la version de nco #######################
69
70# gpdebug : si l'option -f est activee, on detruit tous les fichiers status
71if [ "x$restartExecFromZero" == "x1" ]
72then
73    echo "Deleting  all status files ..."
74    for CONFIG in $( awk '{print $1}' ${IGCM_DEM}/config_card.liste )
75    do
76       PATH_SIMU=$( dirname $CONFIG )
77       ListStatFileInSimu=`find $PATH_SIMU -type f -name "*status" `
78       if [ "x$ListStatFileInSimu" != "x" ]
79       then
80           for file in $ListStatFileInSimu
81           do
82              if [ -e $file ]
83              then
84                 rm -f $file
85              fi
86       
87           done     
88       fi   
89    done
90    echo "Deletion done."
91fi
92# gpdebug : end
93
94export timeLaunchStartFile="${USER_OUTPUT_PROGRESS}/timeLaunchStartFile.txt"
95> $timeLaunchStartFile
96startTime=$( getDateMilliSeconds )
97echo "launch time:$startTime" > $timeLaunchStartFile
98
99
100for CONFIG in $( awk '{print $1}' ${IGCM_DEM}/config_card.liste ) ; do
101
102    DEM_state=$( DEM_read_state ${IGCM_DEM}/config_card.liste ${CONFIG} )
103
104    if [[ "${DEM_state}" != "WriteListTarDone" ]] ; then
105
106        DEM_write_state ${IGCM_DEM}/config_card.liste ${CONFIG} PackRunning
107        export PATH_SIMU=$( dirname $CONFIG )
108        ${EXE_DIR}/enlarge_my_files.sh ${INPUT_DMF_DATA} ${OUTPUT_STORE} ${OUTPUT_WORK}
109   
110        DEM_write_state ${IGCM_DEM}/config_card.liste ${CONFIG} PackDone
111
112    else
113        DEM_write_state ${IGCM_DEM}/config_card.liste ${CONFIG} TarRunning
114        export PATH_SIMU=$( dirname $CONFIG )
115        ${EXE_DIR}/tar_full_simu.sh  ${INPUT_DMF_DATA} ${OUTPUT_STORE} ${CONFIG}
116       
117        DEM_write_state ${IGCM_DEM}/config_card.liste ${CONFIG} TarDone
118
119
120    fi
121
122done
123
124export timeEndFile="${USER_OUTPUT_PROGRESS}/timeEndFile.txt"
125> $timeEndFile
126
127DEM_log -0 "Fin de ${SCRIPT_NAME}"
Note: See TracBrowser for help on using the repository browser.