source: trunk/libIGCM/libIGCM_sys/libIGCM_sys_ulam.ksh @ 61

Last change on this file since 61 was 61, checked in by sdipsl, 15 years ago
  • Add UnixMaxLimit? variables inside libIGCM_sys
  • Don't use module with ulam for the moment
  • Adapt llsubmit procedure to have post-process job output when we want to
File size: 33.6 KB
Line 
1#!/bin/ksh
2
3#**************************************************************
4# Author: Sebastien Denvil
5# Contact: sebastien.denvil.@ipsl.jussieu.fr
6# $Date: 2008-12-15 16:00:58 +0100 (Mon, 15 Dec 2008) $
7# $Author: sdipsl $
8# $Revision: 44 $
9# IPSL (2006)
10#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
11# History:
12# Modification:
13#
14#**************************************************************
15
16#=========================================================
17# The documentation of this file can be automatically generated
18# if you use the prefix #D- for comments to be extracted.
19# Extract with command: cat lib* | grep "^#D-" | cut -c "4-"
20#=========================================================
21
22#D-#==================================================
23#D-LibIGCM_sys for Ulam
24#D-#==================================================
25#D-
26#D- This ksh library if a layer under some usefull
27#D-environment variables and shell commands.
28#D-All those definitions depend on host particularities.
29#D-It manages a stack mechanism and test validity of operations.
30#D-All function described bellow must be prefixed by IGCM_sys.
31
32#====================================================
33# libIGCM_sys PARAMETERS
34#====================================================
35
36#====================================================
37# set DEBUG_sys to true to output calls of function
38typeset -r DEBUG_sys=${DEBUG_sys:=true}
39
40#====================================================
41# Turn in dry run mode ? (sys_Put_Rest, sys_Put_Out, sys_Get)
42typeset -r DRYRUN=${DRYRUN:=0}
43
44# YOU MUST COMPILE YOUR EXE FILES FOR DRYRUN MODE !
45# -------------------------------------------------------------------------------------
46# | DRYRUN=  |  Date computations, | sys_Get    |  Exe    | sys_Put_Out; sys_Put_Rest |
47# |          |  Cp/Exe param files |            |  Chmod  |                           |
48# |          |      Qsub           |            |         |                           |
49# -------------------------------------------------------------------------------------
50# |    0     |       yes           |    yes     |  yes    |      yes                  |
51# -------------------------------------------------------------------------------------
52# |    1     |       yes           |    yes     |  yes    |      no                   |
53# -------------------------------------------------------------------------------------
54# |    2     |       yes           |    yes     |  no     |      no                   |
55# -------------------------------------------------------------------------------------
56# |    3     |       yes           |    no      |  no     |      no                   |
57# -------------------------------------------------------------------------------------
58
59#=====================================================
60# Global Variables :
61#=====================================================
62# Language : "fr" or "en"
63typeset -r MYLANG="fr"
64
65#=====================================================
66# Host and user names
67# $hostname ou hostname
68typeset -r HOST=$( hostname )
69# $username ou whoami
70typeset -r LOGIN=$( whoami )
71
72#D-
73#D-#==================================================
74#D-Program used in libIGCM
75#D-#==================================================
76
77# rsync with path
78typeset -r RSYNC=/usr/bin/rsync
79# RSYNC_opt args to rsync
80typeset -r RSYNC_opt="-Lt -v"
81# RSYNC_opt args to "remote rsync"
82# ie storage filesystem
83typeset -r RHOST=gaya.idris.fr
84typeset -r REMOTE_RSYNC=/u/rech/ces/rces452/RSYNC/bin/rsync
85
86#====================================================
87# Source Ferret
88source /home/rech/psl/rpsl655/.atlas_env_ulam_bash
89
90#====================================================
91# Source tools
92#module load netcdf
93#module load nco
94#module load cdo
95
96export PATH=/usr/local/pub/NetCDF/3.6.3/bin:/usr/local/pub/cdo/1.3.0/bin:/usr/local/pub/nco/3.9.6/bin:$PATH
97
98#====================================================
99# Specific for ocean additionnal diagnostic
100#export FER_GO="$FER_GO /home/rech/ces/rces599/Cpl/TKE /home/rech/ces/rces599/Cpl/TKE/GO /home/rech/ces/rces452/IGCM_POST_UTIL/JNL"
101#export FER_PALETTE="$FER_PALETTE /home/rech/ces/rces599/Cpl/TKE/PALET"
102#export DISPLAY=:1
103
104#=========================================================
105# Host specific DIRECTORIES
106#====================================================
107
108#====================================================
109#- R_EXE   (==> BIN_DIR = ${MODIPSL}/bin )
110typeset -r R_EXE="${MODIPSL}/bin"
111
112#====================================================
113#- SUBMIT_DIR : submission dir
114typeset SUBMIT_DIR=${SUBMIT_DIR:=${LOADL_STEP_INITDIR}}
115
116#====================================================
117#- ARCHIVE
118typeset -r ARCHIVE=$( rsh gaya -n env | grep PWD | awk "-F=" '{print $2}' )
119
120#====================================================
121#- IN
122typeset -r R_IN=${R_IN:=/u/rech/psl/rpsl035/IGCM}
123
124#====================================================
125#- OUT
126typeset -r R_OUT=${ARCHIVE}/IGCM_OUT
127
128#====================================================
129#- OUT_POST
130typeset -r R_OUT_POST=${WORKDIR}/IGCM_OUT
131
132#====================================================
133#- RUN_DIR_PATH : Temporary working directory (=> TMP)
134typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=${TMPDIR}}
135
136#====================================================
137#- Max number of arguments passed to nco operator or demigration command
138UNIX_MAX_LIMIT=12
139
140#D-#==================================================
141#D-function IGCM_sys_RshMaster
142#D-* Purpose: Master rsh command
143#D-* Examples:
144#D-
145function IGCM_sys_RshMaster {
146    #set -vx
147    IGCM_debug_PushStack "IGCM_sys_RshMaster" $@
148    rsh brodie exec /bin/ksh <<-EOF
149    export libIGCM=${libIGCM_SX}
150    . ${libIGCM_SX}/libIGCM_debug/libIGCM_debug.ksh
151    . ${libIGCM_SX}/libIGCM_card/libIGCM_card.ksh
152    ${@}
153EOF
154    if [ $? -gt 0 ] ; then
155        echo "IGCM_sys_RshMaster : erreur."
156        IGCM_debug_Exit "IGCM_sys_RshMaster"
157    fi
158    IGCM_debug_PopStack "IGCM_sys_RshMaster"
159}
160
161#D-#==================================================
162#D-function IGCM_sys_RshArchive
163#D-* Purpose: Archive rsh command
164#D-* Examples:
165#D-
166function IGCM_sys_RshArchive {
167    IGCM_debug_PushStack "IGCM_sys_RshArchive" $@
168    rsh gaya exec /bin/ksh <<-EOF
169    ${@}
170EOF
171    if [ $? -gt 0 ] ; then
172        echo "IGCM_sys_RshArchive : erreur."
173        IGCM_debug_Exit "IGCM_sys_RshArchive"
174    fi
175    IGCM_debug_PopStack "IGCM_sys_RshArchive"
176}
177
178#D-#==================================================
179#D-function IGCM_sys_Nb_files_archive
180#D-* Purpose: Count files on Archive filesystem
181#D-* Examples:
182#D-
183function IGCM_sys_Nb_files_archive {
184   ls ${@} 2>/dev/null | wc -l
185   if [ $? -gt 0 ] ; then
186       echo "IGCM_sys_RshArchive : erreur."
187   fi
188}
189
190#D-#==================================================
191#D-function IGCM_sys_RshPost
192#D-* Purpose: Master rsh command
193#D-* Examples:
194#D-
195function IGCM_sys_RshPost {
196    IGCM_debug_PushStack "IGCM_sys_RshPost" $@
197    if ( $DEBUG_sys ) ; then
198        echo "IGCM_sys_RshPost :" $@
199    fi
200    /bin/ksh ${@}
201    if [ $? -gt 0 ] ; then
202        echo "IGCM_sys_RshPost : erreur."
203        IGCM_debug_Exit "IGCM_sys_RshPost"
204    fi
205    IGCM_debug_PopStack "IGCM_sys_RshPost"
206}
207
208#D-#==================================================
209#D-function IGCM_sys_Mkdir
210#D-* Purpose: Master locale mkdir command
211#D-* Examples:
212#D-
213function IGCM_sys_Mkdir {
214    IGCM_debug_PushStack "IGCM_sys_Mkdir" $@
215    if ( $DEBUG_sys ) ; then
216        echo "IGCM_sys_Mkdir :" $@
217    fi
218    if [ ! -d ${1} ]; then
219        \mkdir -p $1
220        if [ $? -gt 0 ] ; then
221            echo "IGCM_sys_Mkdir : erreur."
222            IGCM_debug_Exit "IGCM_sys_Mkdir"
223        fi
224    fi
225    # vérification :
226    if [ ! -d ${1} ] ; then
227        echo "IGCM_sys_Mkdir : erreur."
228        IGCM_debug_Exit "IGCM_sys_Mkdir"
229    fi
230    IGCM_debug_PopStack "IGCM_sys_Mkdir"
231}
232
233#D-#==================================================
234#D-function IGCM_sys_MkdirArchive
235#D-* Purpose: Mkdir on Archive
236#D-* Examples:
237#D-
238function IGCM_sys_MkdirArchive {
239    IGCM_debug_PushStack "IGCM_sys_MkdirArchive" $@
240    if ( $DEBUG_sys ) ; then
241        echo "IGCM_sys_MkdirArchive :" $@
242    fi
243    #- creation de repertoire sur le serveur fichier
244    if [ ! -d ${1} ]; then 
245        \mkdir -p $1
246        if [ $? -gt 0 ] ; then
247            echo "IGCM_sys_MkdirArchive : erreur."
248            IGCM_debug_Exit "IGCM_sys_MkdirArchive"
249        fi
250    fi
251    # vérification ?? :
252    if [ ! -d ${1} ] ; then
253        echo "IGCM_sys_MkdirArchive : erreur."
254        IGCM_debug_Exit "IGCM_sys_MkdirArchive"
255    fi
256    IGCM_debug_PopStack "IGCM_sys_MkdirArchive"
257}
258
259#D-#==================================================
260#D-function IGCM_sys_MkdirWork
261#D-* Purpose: Mkdir on Work
262#D-* Examples:
263#D-
264function IGCM_sys_MkdirWork {
265    IGCM_debug_PushStack "IGCM_sys_MkdirWork" $@
266    if ( $DEBUG_sys ) ; then
267        echo "IGCM_sys_MkdirWork :" $@
268    fi
269    #- creation de repertoire sur le serveur fichier
270    if [ ! -d ${1} ]; then 
271        \mkdir -p $1
272        if [ $? -gt 0 ] ; then
273            echo "IGCM_sys_MkdirWork : erreur."
274            IGCM_debug_Exit "IGCM_sys_MkdirWork"
275        fi
276    fi
277    # vérification ?? :
278    if [ ! -d ${1} ] ; then
279        echo "IGCM_sys_MkdirWork : erreur."
280        IGCM_debug_Exit "IGCM_sys_MkdirWork"
281    fi
282    IGCM_debug_PopStack "IGCM_sys_MkdirWork"
283}
284#IGCM_sys_MkdirWork ${RUN_DIR_PATH}
285#echo "RUN_DIR_PATH ${RUN_DIR_PATH} ok."
286
287#D-#==================================================
288#D-function IGCM_sys_Cd
289#D-* Purpose: master cd command
290#D-* Examples:
291#D-
292function IGCM_sys_Cd {
293    IGCM_debug_PushStack "IGCM_sys_Cd" $@
294    if ( $DEBUG_sys ) ; then
295        echo "IGCM_sys_Cd :" $@
296    fi
297    \cd $1
298    if [ $? -gt 0 ] ; then
299        echo "IGCM_sys_Cd : erreur."
300        IGCM_debug_Exit "IGCM_sys_Cd"
301    fi
302    IGCM_debug_PopStack "IGCM_sys_Cd"
303}
304
305#D-#==================================================
306#D-function IGCM_sys_Chmod
307#D-* Purpose: Chmod
308#D-* Examples:
309#D-
310function IGCM_sys_Chmod {
311    IGCM_debug_PushStack "IGCM_sys_Chmod" $@
312    if ( $DEBUG_sys ) ; then
313        echo "IGCM_sys_Chmod :" $@
314    fi
315    if [ $DRYRUN -le 1 ]; then
316        \chmod $@
317        if [ $? -gt 0 ] ; then
318            echo "IGCM_sys_Chmod : erreur."
319            IGCM_debug_Exit "IGCM_sys_Chmod"
320        fi
321    else
322        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
323    fi
324    IGCM_debug_PopStack "IGCM_sys_Chmod"
325}
326
327#D-#==================================================
328#D-function IGCM_sys_FileSize
329#D-* Purpose: Filesize
330#D-* Examples:
331#D-
332function IGCM_sys_FileSize {
333    IGCM_debug_PushStack "IGCM_sys_FileSize" $@
334
335    typeset sizeF
336    set +A sizeF -- $( ls -la ${1} )
337    if [ $? -gt 0 ] ; then
338        IGCM_debug_Exit "IGCM_sys_FileSize"
339    fi
340    eval ${2}=${sizeF[4]}
341
342    IGCM_debug_PopStack "IGCM_sys_FileSize"
343}
344
345#D-#==================================================
346#D-function IGCM_sys_TestDir
347#D-* Purpose: Test Directory that must exists
348#D-* Examples:
349#D-
350function IGCM_sys_TestDir {
351    IGCM_debug_PushStack "IGCM_sys_TestDir" $@
352    if ( $DEBUG_sys ) ; then
353        echo "IGCM_sys_TestDir :" $@
354    fi
355    if [ ! -d ${1} ]; then
356        echo "IGCM_sys_TestDir : Directory $1 does not exist."
357        IGCM_debug_Exit "IGCM_sys_TestDir"
358    fi
359    IGCM_debug_PopStack "IGCM_sys_TestDir"
360}
361
362#D-#==================================================
363#D-function IGCM_sys_TestDirArchive
364#D-* Purpose: Test Directory that must exists on Archive
365#D-* Examples:
366#D-
367function IGCM_sys_TestDirArchive {
368    IGCM_debug_PushStack "IGCM_sys_TestDirArchive" $@
369    if ( $DEBUG_sys ) ; then
370        echo "IGCM_sys_TestDirArchive :" $@
371    fi
372    if [ ! -d ${1} ]; then
373        echo "IGCM_sys_TestDirArchive : Directory $1 does not exist on ${ARCHIVE}."
374        IGCM_debug_Exit "IGCM_sys_TestDirArchive"
375    fi
376    IGCM_debug_PopStack "IGCM_sys_TestDirArchive"
377}
378
379#D-#==================================================
380#D-function IGCM_sys_TestFileArchive
381#D-* Purpose: Test file that must NOT EXISTS on Archive
382#D-* Examples:
383#D-
384function IGCM_sys_TestFileArchive {
385    IGCM_debug_PushStack "IGCM_sys_TestFileArchive" $@
386    if ( $DEBUG_sys ) ; then
387        echo "IGCM_sys_TestFileArchive :" $@
388    fi
389    typeset RET
390
391    mfls ${1} | grep ${1} > /dev/null 2>&1
392    RET=$?
393    if [ ${RET} -gt 0 ]; then
394        IGCM_debug_PopStack "IGCM_sys_TestFileArchive"
395        return 1
396    else
397        IGCM_debug_PopStack "IGCM_sys_TestFileArchive"
398        return 0
399    fi
400}
401
402#D-#==================================================
403#D-function IGCM_sys_Tree
404#D-* Purpose: Tree directories with files on ${ARCHIVE}
405#D-* Examples: IGCM_sys_Tree ${R_IN} ${R_OUT}
406#D-
407function IGCM_sys_Tree {
408    IGCM_debug_PushStack "IGCM_sys_Tree" $@
409    if ( $DEBUG_sys ) ; then
410        echo "IGCM_sys_Tree :" $@
411    fi
412
413    \mfls -r $@
414
415    IGCM_debug_PopStack "IGCM_sys_Tree"
416}
417
418#D-#==================================================
419#D-function IGCM_sys_Tar
420#D-* Purpose: master un-tar command
421#D-* Examples:
422#D-
423function IGCM_sys_Tar {
424    IGCM_debug_PushStack "IGCM_sys_Tar" $@
425    if ( $DEBUG_sys ) ; then
426        echo "IGCM_sys_Tar :" $@
427    fi
428    \tar cvf $@
429    if [ $? -gt 0 ] ; then
430        echo "IGCM_sys_Tar : erreur."
431        IGCM_debug_Exit "IGCM_sys_Tar"
432    fi
433    \tar tvf $1
434
435    IGCM_debug_PopStack "IGCM_sys_Tar"
436}
437
438#D-#==================================================
439#D-function IGCM_sys_UnTar
440#D-* Purpose: master un-tar command
441#D-* Examples:
442#D-
443function IGCM_sys_UnTar {
444    IGCM_debug_PushStack "IGCM_sys_UnTar" $@
445    if ( $DEBUG_sys ) ; then
446        echo "IGCM_sys_UnTar :" $@
447    fi
448    \tar xvf $1
449    if [ $? -gt 0 ] ; then
450        echo "IGCM_sys_UnTar : erreur."
451        IGCM_debug_Exit "IGCM_sys_UnTar"
452    fi
453    IGCM_debug_PopStack "IGCM_sys_UnTar"
454}
455
456#D-#==================================================
457#D-function IGCM_sys_QsubPost
458#D-* Purpose: Qsub new job on scalaire
459#D-* Examples:
460#D-
461function IGCM_sys_QsubPost {
462    IGCM_debug_PushStack "IGCM_sys_QsubPost" $@
463    if ( $DEBUG_sys ) ; then
464        echo "IGCM_sys_QsubPost :" $@
465    fi
466    cd ${POST_DIR}
467    /opt/ibmll/LoadL/full/bin/llsubmit ${libIGCM}/$1.job
468    cd -
469    if [ $? -gt 0 ] ; then
470        echo "IGCM_sys_QsubPost : erreur."
471        IGCM_debug_Exit "IGCM_sys_QsubPost"
472    fi
473    IGCM_debug_PopStack "IGCM_sys_QsubPost"
474}
475
476#D-*************************
477#D- File transfer functions
478#D-*************************
479#D-
480
481#D-#==================================================
482#D-function IGCM_sys_Rsync_out
483#D-* Purpose: treat return val of rsync
484#D-* Examples: IGCM_sys_Rsync_out out_RET_rsync
485#D-  Error values and explanations can depend on your system version.
486function IGCM_sys_Rsync_out {
487    RET=$1
488    if [ ! $RET ] ; then
489        echo "rsync error !"
490    fi
491
492    if [ $MYLANG = "fr" ]; then
493        case $RET in
494            0)  return ;;
495            1)  echo "Erreur de rsync ; RERR_SYNTAX : "
496                echo "Erreur de syntaxe ou d'utilisation."
497                return;;
498            2)  echo "Erreur de rsync ; RERR_PROTOCOL : "
499                echo "Incompatibilité de protocole."
500                return;;
501            3)  echo "Erreur de rsync ; RERR_FILESELECT 3"
502                echo "Erreurs  lors  de  la  sélection des fichiers d'entrée sortie et"
503                echo "répertoires"
504                return;;
505            4)  echo "Erreur de rsync ; RERR_UNSUPPORTED"
506                echo "Action demandée non supportée : une tentative de manipulation de"
507                echo "fichiers  64-bits  sur une plate-forme qui ne les supporte pas a"
508                echo "été faite ; ou une option qui est supportée par le  client  mais"
509                echo "pas par le serveur a été spécifiée."
510                return;;
511            10) echo "Erreur de rsync ; RERR_SOCKETIO"
512                echo "Erreur dans le socket d'entrée sortie"
513                return;;
514            11) echo "Erreur de rsync ; RERR_FILEIO"
515                echo "Erreur d'entrée sortie fichier"
516                return;;
517            12) echo "Erreur de rsync ; RERR_STREAMIO"
518                echo "Erreur dans flux de donnée du protocole rsync"
519                return;;
520            13) echo "Erreur de rsync ; RERR_MESSAGEIO"
521                echo "Erreur avec les diagnostics du programme"
522                return;;
523            14) echo "Erreur de rsync ; RERR_IPC"
524                echo "Erreur dans le code IPC"
525                return;;
526            20) echo "Erreur de rsync ; RERR_SIGNAL"
527                echo "SIGUSR1 ou SIGINT reçu"
528                return;;
529            21) echo "Erreur de rsync ; RERR_WAITCHILD"
530                echo "Une erreur retournée par waitpid()"
531                return;;
532            22) echo "Erreur de rsync ; RERR_MALLOC"
533                echo "Erreur lors de l'allocation des tampons de mémoire de coeur"
534                return;;
535            23) echo ""
536                echo "Erreur fichier inexistant"
537                return;;
538            30) echo "Erreur de rsync ; RERR_TIMEOUT"
539                echo "Temps d'attente écoulé dans l'envoi/réception de données"
540                return;;
541            *)  echo "Erreur de rsync : code de retour de rsync inconnu :" $RET
542                return;;
543        esac
544    elif [ $MYLANG = "en" ] ; then
545        case $RET in
546            0)  return;;               
547            1)  echo "rsync error : Syntax or usage error "
548                return;;
549            2)  echo "rsync error : Protocol incompatibility "
550                return;;
551            3)  echo "rsync error : Errors selecting input/output files, dirs"
552                return;;
553            4)  echo "rsync error : Requested action not supported: an attempt"
554                echo "was made to manipulate 64-bit files on a platform that cannot support"
555                echo "them; or an option was specified that is supported by the client and"
556                echo "not by the server."
557                return;;
558            5)  echo "rsync error : Error starting client-server protocol"
559                return;;
560            10) echo "rsync error : Error in socket I/O "
561                return;;
562            11) echo "rsync error : Error in file I/O "
563                return;;
564            12) echo "rsync error : Error in rsync protocol data stream "
565                return;;
566            13) echo "rsync error : Errors with program diagnostics "
567                return;;
568            14) echo "rsync error : Error in IPC code "
569                return;;
570            20) echo "rsync error : Received SIGUSR1 or SIGINT "
571                return;;
572            21) echo "rsync error : Some error returned by waitpid() "
573                return;;
574            22) echo "rsync error : Error allocating core memory buffers "
575                return;;
576            23) echo "rsync error : Partial transfer due to error"
577                return;;
578            24) echo "rsync error : Partial transfer due to vanished source files"
579                return;;
580            30) echo "rsync error : Timeout in data send/receive "
581                return;;
582            *)  echo "rsync error : return code of rsync unknown :" $RET
583                return;;
584        esac
585    else
586        echo "unknown language $MYLANG."
587        return
588    fi
589}
590   
591#D-#==================================================
592#D-function IGCM_sys_Cp
593#D-* Purpose: generic cp
594#D-* Examples:
595#D-
596function IGCM_sys_Cp {
597    IGCM_debug_PushStack "IGCM_sys_Cp" $@
598    if ( $DEBUG_sys ) ; then
599        echo "IGCM_sys_Cp :" $@
600    fi
601
602    typeset RET
603
604    echo cp $@ > out_rsync 2>&1
605    \cp $@ >> out_rsync 2>&1
606    RET=$?
607
608    if [ ${RET} -gt 0 ] ; then
609        echo "IGCM_sys_Cp : error."
610        cat out_rsync
611        IGCM_debug_Exit "IGCM_sys_Cp"
612    fi
613    IGCM_debug_PopStack "IGCM_sys_Cp"
614}
615
616#D-#==================================================
617#D-function IGCM_sys_Rm
618#D-* Purpose: generic rm
619#D-* Examples:
620#D-
621function IGCM_sys_Rm {
622    IGCM_debug_PushStack "IGCM_sys_Rm" -- $@
623    if ( $DEBUG_sys ) ; then
624        echo "IGCM_sys_Rm :" $@
625    fi
626
627    typeset RET
628
629    echo rm $@ > out_rsync 2>&1
630    \rm $@ >> out_rsync 2>&1
631    RET=$?
632
633    if [ ${RET} -gt 0 ] ; then
634        echo "IGCM_sys_Rm : error."
635        cat out_rsync
636        IGCM_debug_Exit "IGCM_sys_Rm"
637    fi
638    IGCM_debug_PopStack "IGCM_sys_Rm"
639}
640
641#D-#==================================================
642#D-function IGCM_sys_Mv
643#D-* Purpose: generic move
644#D-* Examples:
645#D-
646function IGCM_sys_Mv {
647    IGCM_debug_PushStack "IGCM_sys_Mv" $@
648    if ( $DEBUG_sys ) ; then
649        echo "IGCM_sys_Mv :" $@
650    fi
651
652    typeset RET
653
654    echo mv $@ > out_rsync 2>&1
655    \mv $@ >> out_rsync 2>&1
656    RET=$?
657
658    if [ ${RET} -gt 0 ] ; then
659        echo "IGCM_sys_Mv : error in mv."
660        cat out_rsync
661        IGCM_debug_Exit "IGCM_sys_Mv"
662    fi
663
664    IGCM_debug_PopStack "IGCM_sys_Mv"
665}
666
667#D-#==================================================
668#D-function IGCM_sys_Put_Dir
669#D-* Purpose: Copy a complete directory on $(ARCHIVE)
670#D-* Examples:
671#D-
672function IGCM_sys_Put_Dir {
673    IGCM_debug_PushStack "IGCM_sys_Put_Dir" $@
674    if ( $DEBUG_sys ) ; then
675        echo "IGCM_sys_Put_Dir :" $@
676    fi
677    if [ $DRYRUN = 0 ]; then
678        if [ ! -d ${1} ] ; then
679            echo "WARNING : IGCM_sys_Put_Dir ${1} DOES NOT EXIST ."
680            IGCM_debug_PopStack "IGCM_sys_Put_Dir"
681            return
682        fi
683
684        typeset RET
685
686        # Only if we use rsync
687        #IGCM_sys_TestDirArchive $( dirname $2 )
688        #
689        #USUAL WAY
690        rcp -r $1 gaya:$2 > out_rsync 2>&1
691        RET=$?
692
693        if [ ${RET} -gt 0 ] ; then
694            echo "IGCM_sys_Put_Dir : error."
695            cat out_rsync
696            IGCM_debug_Exit "IGCM_sys_Put_Dir"
697        fi
698    else
699        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
700    fi
701    IGCM_debug_PopStack "IGCM_sys_Put_Dir"
702}
703
704#D-#==================================================
705#D-function IGCM_sys_Get_Dir
706#D-* Purpose: Copy a complete directory from $(ARCHIVE)
707#D-* Examples:
708#D-
709function IGCM_sys_Get_Dir {
710    IGCM_debug_PushStack "IGCM_sys_Get_Dir" $@
711    if ( $DEBUG_sys ) ; then
712        echo "IGCM_sys_Get_Dir :" $@
713    fi
714    if [ $DRYRUN = 0 ]; then
715#       if [ ! -d ${1} ] ; then
716#           echo "WARNING : IGCM_sys_Get_Dir ${1} DOES NOT EXIST ."
717#           IGCM_debug_PopStack "IGCM_sys_Get_Dir"
718#           return
719#       fi
720
721        typeset RET
722
723        #USUAL WAY
724        rcp -rp gaya:$1 $2 > out_rsync 2>&1
725        RET=$?
726
727        if [ ${RET} -gt 0 ] ; then
728            echo "IGCM_sys_Get_Dir : error."
729            cat out_rsync
730            IGCM_debug_Exit "IGCM_sys_Get_Dir"
731        fi
732    else
733        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
734    fi
735    IGCM_debug_PopStack "IGCM_sys_Get_Dir"
736}
737
738#D-#==================================================
739#D-function IGCM_sys_Get_Master
740#D-* Purpose: Copy a complete directory from MASTER filesystem
741#D-* Examples:
742#D-
743function IGCM_sys_Get_Master {
744    IGCM_debug_PushStack "IGCM_sys_Get_Master" $@
745    if ( $DEBUG_sys ) ; then
746        echo "IGCM_sys_Get_Master :" $@
747    fi
748    if [ $DRYRUN = 0 ]; then
749        TEST=$( rsh brodie -n "[ -d $1 ] && echo 1 || echo 0" )
750        if [ ${TEST} -ne 1 ] ; then
751            echo "WARNING : IGCM_sys_Get_Master ${1} DOES NOT EXIST ON BRODIE."
752            IGCM_debug_PopStack "IGCM_sys_Get_Master"
753            return
754        fi
755
756        typeset RET
757        sleep 60
758
759        #USUAL WAY
760        rcp -r brodie:$1 $2 > out_rsync 2>&1
761        RET=$?
762
763        if [ ${RET} -gt 0 ] ; then
764            echo "IGCM_sys_Get_Master : error."
765            cat out_rsync
766            IGCM_debug_Exit "IGCM_sys_Get_Master"
767        fi
768    else
769        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
770    fi
771    IGCM_debug_PopStack "IGCM_sys_Get_Master"
772}
773
774#D-#==================================================
775#D-function IGCM_sys_Put_Out
776#D-* Purpose: Copy a file on $(ARCHIVE) after have chmod it in readonly
777#D-* Examples:
778#D-
779function IGCM_sys_Put_Out {
780    IGCM_debug_PushStack "IGCM_sys_Put_Out" $@
781    if ( $DEBUG_sys ) ; then
782        echo "IGCM_sys_Put_Out :" $@
783    fi
784    if [ $DRYRUN = 0 ]; then
785        if [ ! -f ${1} ] ; then
786            echo "WARNING : IGCM_sys_Put_Out ${1} DOES NOT EXIST ."
787            IGCM_debug_PopStack "IGCM_sys_Put_Out"
788            return 1
789        fi
790
791        typeset RET
792        #
793        IGCM_sys_Chmod 444 ${1}
794        #
795        # Only if we use rsync
796        #IGCM_sys_TestDirArchive $( dirname $2 )
797        #
798        #USUAL WAY
799        mfput $1 $2 > out_rsync 2>&1
800        RET=$?
801
802#       #RSYNC WITH NETWORK RSH CALL
803#       echo ${RSYNC_FRONT} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${RUN_DIR}/$1 ${RHOST}:${2} > out_rsync 2>&1
804#       ${RSYNC_FRONT} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${RUN_DIR}/$1 ${RHOST}:${2} >> out_rsync 2>&1
805
806#       #RSYNC WITH NFS USE
807#       echo ${RSYNC_FRONT} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
808#       ${RSYNC_FRONT} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
809
810#       RET=$?
811#       IGCM_sys_Rsync_out $RET
812
813#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
814#       (( RET=RET+$? ))
815
816        if [ ${RET} -gt 0 ] ; then
817            echo "IGCM_sys_Put_Out : error."
818            cat out_rsync
819            IGCM_debug_Exit "IGCM_sys_Put_Out"
820        fi
821    else
822        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
823    fi
824    IGCM_debug_PopStack "IGCM_sys_Put_Out"
825    return 0
826}
827
828#D-#==================================================
829#D-function IGCM_sys_Get
830#D-* Purpose: Get a file from ${ARCHIVE}
831#D-* Examples: IGCM_sys_Get myfile /destpath/myfile_with_PREFIX
832#D-            IGCM_sys_Get /l Array_contain_myfiles /destpath/
833function IGCM_sys_Get {
834    IGCM_debug_PushStack "IGCM_sys_Get" $@
835
836    typeset DEST RET dm_liste ifile target
837
838    if ( $DEBUG_sys ) ; then
839        echo "IGCM_sys_Get :" $@
840    fi
841    if [ $DRYRUN -le 2 ]; then
842        if [ X${1} = X'/l' ] ; then
843            # test if the first file is present in the old computation :
844            eval set +A dm_liste \${${2}}
845        else
846            dm_liste=${1}
847        fi
848        eval DEST=\${${#}}
849
850        # test if the (first) file is present in the old computation :
851        IGCM_sys_TestFileArchive ${dm_liste[0]}
852        RET=$?
853        if [ ${RET} -gt 0 ] ; then
854            echo "IGCM_sys_Get, ERROR : regular file ${dm_liste[0]} DOES NOT EXIST ."
855            IGCM_debug_Exit "IGCM_sys_Get"
856            IGCM_debug_PopStack "IGCM_sys_Get"
857            return
858        fi
859
860        # SD : dm_liste is not suited for computing job
861        #      because we change filename during transfert
862        #      dm_liste is better suited for post-treatment
863        # SD : dm_liste necessary only with RSYNC
864
865        #dm_liste=" "
866        #(( ifile=1 ))
867        #while [ $ifile -lt $# ] ; do
868        #    dm_liste=$( eval echo ${dm_liste[*]} " "\${${ifile}} )
869        #    (( ifile = ifile + 1 ))
870        #done
871        #DEST=$( eval echo \${${#}} )
872
873        #USUAL WAY
874        mfget ${dm_liste[*]} ${DEST} > out_rsync 2>&1
875        RET=$?
876
877#       #RSYNC WITH NETWORK RSH CALL
878#       echo ${RSYNC_FRONT} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${RHOST}:"${dm_liste}" ${RHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1
879#       ${RSYNC_FRONT} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${RHOST}:"${dm_liste}" ${RHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1
880
881#       #RSYNC WITH NFS USE
882#       echo ${RSYNC_FRONT} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1
883#       ${RSYNC_FRONT} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1
884
885#       RET=$?
886#       IGCM_sys_Rsync_out $RET
887
888#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
889#       (( RET=RET+$? ))
890
891        if [ ${RET} -gt 0 ] ; then
892            echo "IGCM_sys_Get : copy error."
893            cat out_rsync
894            IGCM_debug_Exit "IGCM_sys_Get"
895        fi
896    else
897        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
898    fi
899    IGCM_debug_PopStack "IGCM_sys_Get"
900}
901
902#D-#==================================================
903#D-function IGCM_sys_Put_Dods
904#D-* Purpose: Put $(ARCHIVE) files on DODS internet protocole.
905#D-* Examples:
906#D-
907function IGCM_sys_Put_Dods {
908    IGCM_debug_PushStack "IGCM_sys_Put_Dods" $@
909    if ( $DEBUG_sys ) ; then
910        echo "IGCM_sys_Put_Dods :" $@
911    fi
912    if [ $DRYRUN = 0 ]; then
913        if [ ! -d ${R_SAVE}/${1} ] ; then
914            echo "WARNING : IGCM_sys_Put_Dods ${R_SAVE}/${1} DOES NOT EXIST ."
915            IGCM_debug_PopStack "IGCM_sys_Put_Dods"
916            return
917        fi
918
919        typeset RET
920        #
921        rsh gaya exec /bin/ksh <<EOF
922        cd ${R_SAVE}
923        /usr/local/bin/dods_rm DODS/pub/${LOGIN}/${config_UserChoices_TagName}/${config_UserChoices_JobName}/${1} > /dev/null 2>&1
924        /sbin/chmod -R u+w ${R_SAVE}/${1}
925        /usr/local/bin/dods_cp ${1} DODS/pub/${LOGIN}/${config_UserChoices_TagName}/${config_UserChoices_JobName} > /dev/null 2>&1
926        /sbin/chmod -R +rX ${R_SAVE}/${1}
927        /sbin/chmod -R u+w ${R_SAVE}/${1}
928EOF
929        RET=$?
930
931        if [ ${RET} -gt 0 ] ; then
932            echo "IGCM_sys_Put_Dods : error."
933            cat out_dods
934            IGCM_debug_Exit "IGCM_sys_Put_Dods"
935        fi
936    else
937        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
938    fi
939    IGCM_debug_PopStack "IGCM_sys_Put_Dods"
940}
941
942############################################################## A REVOIR !!
943
944#D-#==================================================
945#D-function IGCM_sys_Rapatrie
946#D-* Purpose: Rapatrie
947#D-* Examples:
948#D-
949function IGCM_sys_Rapatrie {
950    IGCM_debug_PushStack "IGCM_sys_Rapatrie" $@
951    if ( $DEBUG_sys ) ; then
952        echo "IGCM_sys_Rapatrie :" $@
953    fi
954
955    typeset RET=0
956
957    IGCM_sys_Get ${R_STOCKAGE}/$2 $1 ;
958    let $(( RET=RET+$? ))
959    IGCM_sys_Cd $1 ;
960    let $(( RET=RET+$? ))
961    IGCM_sys_UnTar $2 ;
962    let $(( RET=RET+$? ))
963
964    if [ ${RET} -gt 0 ] ; then
965        echo "IGCM_sys_Rapatrie : erreur."
966        IGCM_debug_Exit "IGCM_sys_Rapatrie"
967    fi
968    IGCM_debug_PopStack "IGCM_sys_Rapatrie"
969}
970
971############################################################## A FINIR !!
972
973#D-#==================================================
974#D-function IGCM_sys_GetDate_FichWork
975#D-* Purpose: donne la date filesys d'un fichier sur le filesystem WORK
976#D-* Examples:
977#D-
978function IGCM_sys_GetDate_FichWork {
979    IGCM_debug_PushStack "IGCM_sys_FichWork" $@
980    if ( $DEBUG_sys ) ; then
981        echo "IGCM_sys_GetDate_FichWork :" $@
982    fi
983    # donne la date filesys d'un fichier sur la machine work
984    IGCM_debug_PopStack "IGCM_sys_FichWork"
985}
986
987#D-#==================================================
988#D-function IGCM_sys_GetDate_FichArchive
989#D-* Purpose: donne la date filesys d'un fichier sur le filesystem ARCHIVE
990#D-* Examples:
991#D-
992function IGCM_sys_GetDate_FichArchive {
993    IGCM_debug_PushStack "IGCM_sys_FichArchive" $@
994    if ( $DEBUG_sys ) ; then
995        echo "IGCM_sys_GetDate_FichArchive :" $@
996    fi
997    IGCM_debug_PopStack "IGCM_sys_FichArchive"
998}
999
1000##############################################################
1001# REBUILD OPERATOR
1002
1003function IGCM_sys_rebuild {
1004    IGCM_debug_PushStack "IGCM_sys_rebuild" -- $@
1005    if ( $DEBUG_sys ) ; then
1006        echo "IGCM_sys_rebuild :" $@
1007    fi
1008    /home/rech/ces/rces452/REBUILD/bin/rebuild -f -o $@
1009    if [ $? -gt 0 ] ; then
1010       echo "IGCM_sys_rebuild : erreur ${@}."
1011       IGCM_debug_Exit "rebuild"
1012    fi
1013
1014    IGCM_debug_PopStack "IGCM_sys_rebuild"
1015}
1016##############################################################
1017# NCO OPERATOR
1018
1019function IGCM_sys_ncap {
1020    IGCM_debug_PushStack "IGCM_sys_ncap" -- $@
1021    if ( $DEBUG_sys ) ; then
1022        echo "IGCM_sys_ncap :" $@
1023    fi
1024    /usr/local/pub/nco/3.9.6/bin/ncap $@
1025    if [ $? -gt 0 ] ; then
1026       echo "IGCM_sys_ncap : erreur ${@}."
1027       IGCM_debug_Exit "ncap"
1028    fi
1029
1030    IGCM_debug_PopStack "IGCM_sys_ncap"
1031}
1032
1033ncatted=/usr/local/pub/nco/3.9.6/bin/ncatted
1034# Problem with ksh and string passed in this function to ncatted !
1035# function IGCM_sys_ncatted {
1036#     IGCM_debug_PushStack "IGCM_sys_ncatted" -- $@
1037#     if ( $DEBUG_sys ) ; then
1038#       echo "IGCM_sys_ncatted :" $@
1039#     fi
1040#     /usr/local/pub/nco/3.9.6/bin/ncatted $@
1041#     if [ $? -gt 0 ] ; then
1042#        echo "IGCM_sys_ncatted : erreur ${@}."
1043#        IGCM_debug_Exit "ncatted"
1044#     fi
1045
1046#     IGCM_debug_PopStack "IGCM_sys_ncatted"
1047# }
1048
1049function IGCM_sys_ncbo {
1050    IGCM_debug_PushStack "IGCM_sys_ncbo" -- $@
1051    if ( $DEBUG_sys ) ; then
1052        echo "IGCM_sys_ncbo :" $@
1053    fi
1054    /usr/local/pub/nco/3.9.6/bin/ncbo $@
1055    if [ $? -gt 0 ] ; then
1056       echo "IGCM_sys_ncbo : erreur ${@}."
1057       IGCM_debug_Exit "ncbo"
1058    fi
1059
1060    IGCM_debug_PopStack "IGCM_sys_ncbo"
1061}
1062
1063function IGCM_sys_ncdiff {
1064    IGCM_debug_PushStack "IGCM_sys_ncdiff" -- $@
1065    if ( $DEBUG_sys ) ; then
1066        echo "IGCM_sys_ncdiff :" $@
1067    fi
1068    /usr/local/pub/nco/3.9.6/bin/ncdiff $@
1069    if [ $? -gt 0 ] ; then
1070       echo "IGCM_sys_ncdiff : erreur ${@}."
1071       IGCM_debug_Exit "ncdiff"
1072    fi
1073
1074    IGCM_debug_PopStack "IGCM_sys_ncdiff"
1075}
1076
1077function IGCM_sys_ncea {
1078    IGCM_debug_PushStack "IGCM_sys_ncea" -- $@
1079    if ( $DEBUG_sys ) ; then
1080        echo "IGCM_sys_ncea :" $@
1081    fi
1082    /usr/local/pub/nco/3.9.6/bin/ncea $@
1083    if [ $? -gt 0 ] ; then
1084       echo "IGCM_sys_ncea : erreur ${@}."
1085       IGCM_debug_Exit "ncea"
1086    fi
1087
1088    IGCM_debug_PopStack "IGCM_sys_ncea"
1089}
1090
1091function IGCM_sys_ncecat {
1092    IGCM_debug_PushStack "IGCM_sys_ncecat" -- $@
1093    if ( $DEBUG_sys ) ; then
1094        echo "IGCM_sys_ncecat :" $@
1095    fi
1096    /usr/local/pub/nco/3.9.6/bin/ncecat $@
1097    if [ $? -gt 0 ] ; then
1098       echo "IGCM_sys_ncecat : erreur ${@}."
1099       IGCM_debug_Exit "ncecat"
1100    fi
1101
1102    IGCM_debug_PopStack "IGCM_sys_ncecat"
1103}
1104
1105function IGCM_sys_ncflint {
1106    IGCM_debug_PushStack "IGCM_sys_ncflint" -- $@
1107    if ( $DEBUG_sys ) ; then
1108        echo "IGCM_sys_ncflint :" $@
1109    fi
1110    /usr/local/pub/nco/3.9.6/bin/ncflint $@
1111    if [ $? -gt 0 ] ; then
1112       echo "IGCM_sys_ncflint : erreur ${@}."
1113       IGCM_debug_Exit "ncflint"
1114    fi
1115
1116    IGCM_debug_PopStack "IGCM_sys_ncflint"
1117}
1118
1119function IGCM_sys_ncks {
1120    IGCM_debug_PushStack "IGCM_sys_ncks" -- $@
1121    if ( $DEBUG_sys ) ; then
1122        echo "IGCM_sys_ncks :" $@
1123    fi
1124    /usr/local/pub/nco/3.9.6/bin/ncks $@
1125    if [ $? -gt 0 ] ; then
1126       echo "IGCM_sys_ncks : erreur ${@}."
1127       IGCM_debug_Exit "ncks"
1128    fi
1129
1130    IGCM_debug_PopStack "IGCM_sys_ncks"
1131}
1132
1133function IGCM_sys_ncpdq {
1134    IGCM_debug_PushStack "IGCM_sys_ncpdq" -- $@
1135    if ( $DEBUG_sys ) ; then
1136        echo "IGCM_sys_ncpdq :" $@
1137    fi
1138    /usr/local/pub/nco/3.9.6/bin/ncpdq $@
1139    if [ $? -gt 0 ] ; then
1140       echo "IGCM_sys_ncpdq : erreur ${@}."
1141       IGCM_debug_Exit "ncpdq"
1142    fi
1143
1144    IGCM_debug_PopStack "IGCM_sys_ncpdq"
1145}
1146
1147function IGCM_sys_ncra {
1148    IGCM_debug_PushStack "IGCM_sys_ncra" -- $@
1149    if ( $DEBUG_sys ) ; then
1150        echo "IGCM_sys_ncra :" $@
1151    fi
1152    /usr/local/pub/nco/3.9.6/bin/ncra $@
1153    if [ $? -gt 0 ] ; then
1154       echo "IGCM_sys_ncra : erreur ${@}."
1155       IGCM_debug_Exit "ncra"
1156    fi
1157
1158    IGCM_debug_PopStack "IGCM_sys_ncra"
1159}
1160
1161function IGCM_sys_ncrcat {
1162    IGCM_debug_PushStack "IGCM_sys_ncrcat" -- $@
1163    if ( $DEBUG_sys ) ; then
1164        echo "IGCM_sys_ncrcat :" $@
1165    fi
1166    /usr/local/pub/nco/3.9.6/bin/ncrcat $@
1167    if [ $? -gt 0 ] ; then
1168       echo "IGCM_sys_ncrcat : erreur ${@}."
1169       IGCM_debug_Exit "ncrcat"
1170    fi
1171
1172    IGCM_debug_PopStack "IGCM_sys_ncrcat"
1173}
1174
1175function IGCM_sys_ncrename {
1176    IGCM_debug_PushStack "IGCM_sys_ncrename" -- $@
1177    if ( $DEBUG_sys ) ; then
1178        echo "IGCM_sys_ncrename :" $@
1179    fi
1180    /usr/local/pub/nco/3.9.6/bin/ncrename $@
1181    if [ $? -gt 0 ] ; then
1182       echo "IGCM_sys_ncrename : erreur ${@}."
1183       IGCM_debug_Exit "ncrename"
1184    fi
1185
1186    IGCM_debug_PopStack "IGCM_sys_ncrename"
1187}
1188
1189function IGCM_sys_ncwa {
1190    IGCM_debug_PushStack "IGCM_sys_ncwa" -- $@
1191    if ( $DEBUG_sys ) ; then
1192        echo "IGCM_sys_ncwa :" $@
1193    fi
1194    /usr/local/pub/nco/3.9.6/bin/ncwa $@
1195    if [ $? -gt 0 ] ; then
1196       echo "IGCM_sys_ncwa : erreur ${@}."
1197       IGCM_debug_Exit "ncwa"
1198    fi
1199
1200    IGCM_debug_PopStack "IGCM_sys_ncwa"
1201}
1202
1203############################################################
1204# Activate Running Environnment Variables
1205
1206function IGCM_sys_activ_variables {
1207    IGCM_debug_PushStack "IGCM_sys_activ_variables"
1208    if ( $DEBUG_sys ) ; then
1209        echo "IGCM_sys_activ_variables"
1210    fi
1211    IGCM_debug_PopStack "IGCM_sys_activ_variables"
1212}
1213
1214############################################################
1215# Desactivate Running Environnment Variables
1216
1217function IGCM_sys_desactiv_variables {
1218    IGCM_debug_PushStack "IGCM_sys_desactiv_variables"
1219    if ( $DEBUG_sys ) ; then
1220        echo "IGCM_sys_desactiv_variables"
1221    fi
1222    IGCM_debug_PopStack "IGCM_sys_desactiv_variables"
1223}
1224
1225############################################################
1226# Build run file
1227
1228function IGCM_sys_build_run_file {
1229    IGCM_debug_PushStack "IGCM_sys_build_run_file"
1230    if ( $DEBUG_sys ) ; then
1231        echo "IGCM_sys_build_run_file "
1232    fi
1233    IGCM_debug_PopStack "IGCM_sys_build_run_file "
1234}
Note: See TracBrowser for help on using the repository browser.