source: trunk/libIGCM/libIGCM_sys/IGCM_add_out.awk @ 136

Last change on this file since 136 was 132, checked in by sdipsl, 15 years ago

Minimize rsh from vargas to others machine
Reflect the fact that Ulam can see Gaya filesystem
Manage AIX vargas system time soi that run.card is filled properly.

  • 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 Date Author Revision
File size: 6.5 KB
Line 
1#!/usr/bin/awk -f
2# IGCM_add_out - filter of output of the job :
3# command :
4# IGCM_add_out.awk job_output.out REALTIME USERTIME SYSTIME
5
6#**************************************************************
7# Author: Martial.Mancip
8# Contact: Martial.Mancip@ipsl.jussieu.fr
9# $Date$
10# $Author$
11# $Revision$
12# IPSL (2006)
13#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
14# History:
15# Modification: Patrick.Brockmann@cea.fr
16#
17#**************************************************************
18
19#==========================
20function myprint(str) {
21  if (debug) {
22     print str
23  }
24}
25
26
27#==========================
28BEGIN {
29#  print "traitement de " ARGV[1]
30
31  nbarg=ARGC
32  if (match(ARGV[1],"-d")) {
33    debug=1
34    file=ARGV[2]
35    delete ARGV[1] 
36    nbarg--
37  } else {
38    debug=0
39    file=ARGV[1]
40  }
41
42# When exit statement, 'END' rule is always executed, so defined a exit_value to manage this
43  exit_value=0
44  if (nbarg != 2) {
45    print "Usage: IGCM_add_out.awk [-d] file.output" 
46    print 
47    print "Args:"
48    print "      file.output = output file of at Job to be parsed" 
49    print 
50    print "Options:" 
51    print "       -d = debug mode" 
52    print 
53    exit_value=1
54    exit
55  }
56
57  Information_found=0
58  vargas_found=0
59
60  RealTime=0.
61  UserTime=-1.
62  SysTime=0.
63  VectorTime=0.
64  InstCount=0.
65  VInstCount=0.
66  VElementCount=0.
67  FLOPCount=0.
68  MOPS=0.
69  MFLOPS=0.
70  AVLength=0.
71  VOpRatio=0.
72  MemorySize=0.
73  MIPS=0.
74  ICache=0.
75  OCache=0.
76  Bank=0.
77
78  counter=0
79
80  RunDateBegin="2000-01-01T00:00:00"
81  RunDateEnd="2000-01-01T00:00:00"
82
83}
84
85#==========================
86{
87  myprint($0) 
88
89# Get information with MPI Program Information output on NEC
90  if (match($0, "     \\*\\*\\*\\*\\*\\*  Program Information  \\*\\*\\*\\*\\*\\*")) 
91  {
92    Information_found=1
93    counter=counter+1
94#   print $0     
95#    print counter
96    next
97  }
98  else if (Information_found == 1 && (match($0, ".*:.*"))) 
99  {
100    where=(match($0,"[a-zA-Z]"))
101    Length=(match($0, " *:"))-where
102    whereDot=(match($0, ":"))
103    info=substr($0,where,Length)
104    whereNum=(match($0, "[0-9]"))
105    Res=substr($0,whereNum)
106#    print where "," Length "," whereDot "," whereNum " '" info "' :" Res
107
108    if( info=="Real Time (sec)" ) {
109#      print "|" Res "|"
110#      printf("RealTime = %10.5f\n",0.037600)
111#      printf("RealTime = %10.5f\n",Res)
112      if ( Res > RealTime ) {
113        RealTime=Res
114      }
115      next
116    }
117         
118    if( info=="User Time (sec)" ) {
119      UserTime=UserTime+Res
120      next
121    }
122
123    if( info=="Sys  Time (sec)" ) {
124      SysTime=SysTime+Res
125      next
126    }
127
128    if( info=="Vector Time (sec)" ) {
129      VectorTime=VectorTime+Res
130      next 
131    }
132
133    if( info=="Inst. Count" ) {
134      InstCount=InstCount+Res
135      next
136    }
137
138    if( info=="V. Element Count" ) {
139      VInstCount=VInstCount+Res
140      next 
141    }
142
143    if( info=="V. Element Count" ) {
144      VElementCount=VElementCount+Res
145      next
146    }
147
148    if( info=="FLOP Count" ) {
149      FLOPCount=FLOPCount+Res
150      next 
151    }
152
153    if( info=="MOPS" ) {
154      MOPS=MOPS+Res
155      next
156    }
157
158    if( info=="MFLOPS" ) {
159      MFLOPS=MFLOPS+Res
160      next 
161    }
162
163    if( info=="A.V. Length" ) {
164      AVLength=AVLength+Res
165      next
166    }
167
168    if( info=="V. Op. Ratio (%)" ) {
169      VOpRatio=VOpRatio+Res
170      next 
171    }
172
173    if( info=="Memory Size (MB)" ) {
174      MemorySize=MemorySize+Res
175      next
176    }
177
178    if( info=="MIPS" ) {
179      MIPS=MIPS+Res
180      next 
181    }
182
183    if( info=="I-Cache (sec)" ) {
184      ICache=ICache+Res
185      next
186    }
187
188    if( info=="O-Cache (sec)" ) {
189      OCache=OCache+Res
190      next 
191    }
192
193    if( info=="Bank (sec)" ) {
194      Bank=Bank+Res
195      next
196    }
197
198  }
199# Get information with time output on other hosts
200# ksh time
201  else if (match($0, ".*s real .*s user .*s system"))
202  {
203    myprint( "ksh" )
204    counter=counter+1
205
206    RealTime=(substr($1,1,match($1, "s")-1))
207    UserTime=(substr($3,1,match($3, "s")-1))
208    SysTime=(substr($5,1,match($5, "s")-1))
209
210  }
211# csh time
212  else if (match($0, "[0-9.]+u [0-9.]+s .+"))
213  {
214    myprint( "csh" )
215    counter=counter+1
216
217    UserTime=(substr($1,1,match($1, "u")-1))
218    SysTime=(substr($2,1,match($2, "s")-1))
219    RealTime=(substr($3,1,match($3, ":")-1)*60. + substr($3,match($3, ":")+1))
220
221  }
222# linux system time
223  else if (match($0, ".*user .*system .*elapsed .*CPU .*"))
224  {
225    myprint( "linux" )
226    counter=counter+1
227
228    UserTime=(substr($1,1,match($1, "user")-1))
229    SysTime=(substr($2,1,match($2, "system")-1))
230    RealTime=(substr($3,1,match($3, ":")-1)*60.+substr($3, match($3, ":")+1, match($3, "elapsed")))
231
232  }
233# AIX vargas system time
234  else if (match($0, "real\ \ \ [0-9]*"))
235  {
236    myprint( "vargas" )
237    vargas_found=1 
238    counter=counter+1
239
240    RealTime=substr($0,8)
241    next
242  }
243  else if (vargas_found=1 )
244  {
245    if (match($0, "user\ \ \ [0-9]*"))
246      {
247        UserTime=substr($0,8)
248        next
249      }
250    if (match($0, "sys\ \ \ \ [0-9]*"))
251      {
252        SysTime=substr($0,7)
253        next
254      }
255  }
256
257# RUN_DATE_BEGIN
258if ($0 ~ /RunDateBegin.*=/) {
259    myprint( "start date" )
260    split($0,a,"=")
261    RunDateBegin=a[2]
262}
263
264# RUN_DATE_END
265if ($0 ~ /RunDateEnd.*=/) {
266    myprint( "end date" )
267    split($0,a,"=")
268    RunDateEnd=a[2]
269  }
270
271}
272
273#==========================
274END {
275
276  if (! exit_value ) {
277    if (counter > 0) { 
278      myprint("=============================================")
279      myprint("Additionnal results on Program Informations for " ARGV[1])
280      myprint("Real Time (sec)        :" RealTime)
281      myprint("User Time (sec)        :" UserTime)
282      myprint("Sys  Time (sec)        :" SysTime)
283      myprint("Vector Time (sec)      :" VectorTime)
284      myprint("Inst. Count            :" InstCount)
285      myprint("V. Inst. Count         :" VInstCount)
286      myprint("V. Element Count       :" VElementCount)
287      myprint("FLOP Count             :" FLOPCount)
288      myprint("MOPS                   :" MOPS)
289      myprint("MFLOPS                 :" MFLOPS)
290      myprint("A.V. Length            :" AVLength)
291      myprint("V. Op. Ratio (%)       :" VOpRatio)
292      myprint("Memory Size (MB)       :" MemorySize)
293      myprint("MIPS                   :" MIPS)
294      myprint("I-Cache (sec)          :" ICache)
295      myprint("O-Cache (sec)          :" OCache)
296      myprint("Bank (sec)             :" Bank)
297
298      myprint("Date of executables :")
299      myprint("Start Time             :" RunDateBegin)
300      myprint("End   Time             :" RunDateEnd)
301
302      printf("%s %s %.5f %.5f %.5f", RunDateBegin, RunDateEnd, RealTime, UserTime, SysTime) 
303      exit(0)
304    }
305    else
306    { 
307      exit(1)
308    }
309  }
310  else
311  { 
312    exit(2)
313  }
314 
315}
Note: See TracBrowser for help on using the repository browser.