source: trunk/libIGCM/libIGCM_sys/IGCM_analyse_rsync_out.awk

Last change on this file was 373, checked in by sdipsl, 14 years ago

Remove libIGCM_sys_claude.ksh and libIGCM_sys_calculo.ksh
Update/homogenize all headers usgin the new fixed-length keyword syntax regarding properties keywords
$Rev:: 13 i $: Revision of last commit
$Author:: harry $: Author of last commit
$Date:: 2006-03-15 02:33:03 -0500 (Wed, 15 Mar 2006) $: Date of last commit
Add / update original author and contact when missing

  • Property licence set to
    The following licence information concerns ONLY the libIGCM tools
    ==================================================================

    Copyright © Centre National de la Recherche Scientifique CNRS
    Commissariat à l'Énergie Atomique CEA

    libIGCM : Library for Portable Models Computation of IGCM Group.

    IGCM Group is the french IPSL Global Climate Model Group.

    This library is a set of shell scripts and functions whose purpose is
    the management of the initialization, the launch, the transfer of
    output files, the post-processing and the monitoring of datas produce
    by any numerical program on any plateforme.

    This software is governed by the CeCILL license under French law and
    abiding by the rules of distribution of free software. You can use,
    modify and/ or redistribute the software under the terms of the CeCILL
    license as circulated by CEA, CNRS and INRIA at the following URL
    "http://www.cecill.info".

    As a counterpart to the access to the source code and rights to copy,
    modify and redistribute granted by the license, users are provided only
    with a limited warranty and the software's author, the holder of the
    economic rights, and the successive licensors have only limited
    liability.

    In this respect, the user's attention is drawn to the risks associated
    with loading, using, modifying and/or developing or reproducing the
    software by the user in light of its specific status of free software,
    that may mean that it is complicated to manipulate, and that also
    therefore means that it is reserved for developers and experienced
    professionals having in-depth computer knowledge. Users are therefore
    encouraged to load and test the software's suitability as regards their
    requirements in conditions enabling the security of their systems and/or
    data to be ensured and, more generally, to use and operate it in the
    same conditions as regards security.

    The fact that you are presently reading this means that you have had
    knowledge of the CeCILL license and that you accept its terms.
  • Property svn:keywords set to Revision Author Date
File size: 2.7 KB
Line 
1#!/usr/bin/awk -f
2# IGCM_analyse_rsync_out - filter rsync output in a job output :
3# command :
4# IGCM_analyse_rsync_out.awk [-d] job_output.out
5
6#**************************************************************
7# Author: Martial.Mancip
8# Contact: Martial.Mancip__at__ipsl.jussieu.fr
9# $Revision::                                          $ Revision of last commit
10# $Author::                                            $ Author of last commit
11# $Date::                                              $ Date of last commit
12# IPSL (2006)
13#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
14#
15#**************************************************************
16
17#==========================
18function myprint(str) {
19  if (debug) {
20     print str
21  }
22}
23
24
25#==========================
26BEGIN {
27#  print "traitement de " ARGV[1]
28
29  nbarg=ARGC
30
31  if (ARGV[1] == "-d") {
32    debug=1
33    file=ARGV[2]
34    delete ARGV[1] 
35    nbarg--
36  } else {
37    debug=0
38    file=ARGV[1]
39  }
40
41  exit_value=0
42  if (nbarg != 2) {
43        print "Usage: analyse_rsync_out.awk [-d] file"
44        exit_value=-1
45        exit
46  }
47   
48  rsync_found=0
49  speedup_found=0
50  counter=0
51  thisfile[1]=""
52  errcounter=0
53  errorfile[1]=""
54}
55
56#==========================
57{
58
59  myprint($0) 
60
61  if (rsync_found == 0 && match($0, ".*/rsync .*")) {
62    speedup_found = 0
63    rsync_found=1
64    counter=counter+1
65
66    nb=split($0,felts, " ")
67    myprint("nb  :" nb)
68    for (elt in felts) {
69        myprint(elt "- elt  :" felts[elt])
70    }
71    myprint("elts_split  :" felts[4])
72
73    thisfile[counter]=felts[4]
74  }
75  else if (rsync_found == 1 && match($0, ".* speedup is .*")) {
76    myprint("speedup_found = 1")
77    speedup_found = 1
78  }
79  else if (speedup_found == 1 && match($0, "rsync error:.*")) {
80    errcounter=errcounter+1
81    errorfile[errcounter]=thisfile[counter]
82    myprint("=============================================")
83    myprint("WARNING : Rsync ERROR for " ARGV[1])
84    myprint("counter  :" counter)
85    myprint("file  :" thisfile[counter])
86    thisfile[counter]=""
87    counter=counter-1
88  } 
89  else {
90    if ( speedup_found == 1 ) {
91      rsync_found=0
92      speedup_found=0
93    }
94  }
95}
96
97#==========================
98END {
99  if ( exit_value != -1 ) {
100
101    myprint("=============================================")
102    myprint("Rsync for " ARGV[1])
103    myprint("counter  :" counter)
104    for (i=1; i<=counter; i++) { 
105      myprint("file  :" thisfile[i])
106    }
107    if (errcounter > 0) {
108      debug=1
109      myprint("Error counter  :" errcounter)
110      for (i=1; i<=errcounter; i++) { 
111        myprint("Error file  :" errorfile[i])
112      }
113      exit_value=errcounter
114      print exit_value
115      exit exit_value
116    } 
117    exit_value=0
118    exit 0
119  }
120}
Note: See TracBrowser for help on using the repository browser.