Changeset 670
- Timestamp:
- 05/14/12 18:03:21 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libIGCM/libIGCM_sys/IGCM_add_out.awk
r373 r670 55 55 Information_found=0 56 56 Information_ksh_SX_found=0 57 vargas_found=058 57 59 58 RealTime=0. … … 110 109 # printf("RealTime = %10.5f\n",Res) 111 110 if ( Res > RealTime ) { 112 RealTime=Res 111 myprint( "NEC Real Time updated" ) 112 RealTime=Res 113 113 } 114 114 next … … 116 116 117 117 if( info=="User Time (sec)" ) { 118 myprint( "NEC User Time " ) 118 119 UserTime=UserTime+Res 119 120 next … … 210 211 211 212 # csh time 213 # 0.000+u 0.000+s 0:00.00 0.0% 0+0k 0+0io 0pf+0w 212 214 else if (match($0, "[0-9.]+u [0-9.]+s .+")) 213 215 { … … 217 219 UserTime=(substr($1,1,match($1, "u")-1)) 218 220 SysTime=(substr($2,1,match($2, "s")-1)) 221 # si hours ? 219 222 RealTime=(substr($3,1,match($3, ":")-1)*60. + substr($3,match($3, ":")+1)) 220 223 221 224 } 222 225 # linux system time 226 ### example : 227 ### 2.02user 6.60system 12:41.62elapsed 1%CPU (0avgtext+0avgdata 25520maxresident)k 228 ### 2.02user 6.60system 5:12:41.62elapsed 1%CPU (0avgtext+0avgdata 25520maxresident)k 223 229 else if (match($0, ".*user .*system .*elapsed .*CPU .*")) 224 230 { … … 228 234 UserTime=(substr($1,1,match($1, "user")-1)) 229 235 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) 236 ### RealTime=(substr($3,1,match($3, ":")-1)*60.+substr($3, match($3, ":")+1, match($3, "elapsed"))) what for hours???? 237 238 RealTime=0 239 if (match($3, "[0-9]*:[0-9]*:[0-9]*\\.[0-9]*elapsed")) 240 { 241 #### $3= 5:12:41.62elapsed 242 myprint( "linux elapsed in hours " ) 243 sub1=(match($3, ":")-1) 244 sub2=sub1+2 245 min=(substr($3,sub2)) 246 sub3=(match(min, ":")-1) 247 sub4=sub3+2 248 fin=(substr(min,sub4)) 249 sub5=(match(fin, "elapsed")-1) 250 RealTime=((substr($3,1,sub1))*60+substr(min,1,sub3))*60+(substr(min,sub4,sub5)) 251 myprint( " real time seconds " RealTime ) 252 } 253 else if (match($3, "[0-9]*:[0-9]*\\.[0-9]*elapsed")) 254 { 255 #### $3=12:41.62elapsed 256 myprint( "linux elapsed in minutes " ) 257 sub1=(match($3, ":")-1) 258 sub2=sub1+2 259 fin=(substr($3,sub2)) 260 sub3=(match(fin, "elapsed")-1) 261 RealTime=(substr($3,1,sub1))*60+(substr($3,sub2,sub3)) 262 myprint( " real time seconds " RealTime ) 263 } 264 else if (match($3, "[0-9]*\\.[0-9]*elapsed")) 265 { 266 #### $3=41.62elapsed 267 myprint( "linux elapsed in second " ) 268 RealTime=(substr($3,1,match($3, "elapsed")-1)) 269 myprint( " real time seconds " RealTime ) 270 } 241 271 next 242 272 } 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 } 273 # curie system time (if not linux) or vargas 274 ### curie (with tab) 275 ### real 9m38.96s 276 ### user 0m4.45s 277 ### sys 0m6.41s 278 ### vargas (with space) 279 ### real 2891.80 280 ### user 0.28 281 ### sys 0.45 282 283 else if (match($1, "real")) 284 { 285 myprint( "curie ou vargas ?" ) 286 287 # real 9m38.96s or real 2891.80 288 if (match($2, ".*s.*")) 289 { 290 myprint( "curie" ) 291 counter=counter+1 292 ### real 9m38.96s 293 ### real 5h9m38.96s 294 RealTime=((substr($2,1,match($2, "h")-1)*60.)+substr($2,match($2, "h")+1,match($2, "m")-1))*60.+substr($2,match($2, "m")+1,match($2, "s")) 295 next 296 } 297 else 298 { 299 myprint( "vargas" ) 300 counter=counter+1 301 302 ### real 2891.80 303 RealTime=$2 304 next 305 } 306 } 307 else if (match($1, "user")) 308 { 309 # user(tab)0m4.45s or user 0.28 310 if (match($2, ".*s.*")) 311 { 312 myprint( "curie user" ) 313 UserTime=((substr($2,1,match($2, "h")-1)*60.)+substr($2,match($2, "h")+1,match($2, "m")-1))*60.+substr($2,match($2, "m")+1,match($2, "s")) 314 next 315 } 316 else 317 { 318 myprint( "vargas user" ) 319 UserTime=$2 320 next 321 } 322 } 323 else if (match($1, "sys")) 324 { 325 # 0m6.41s or 0.45 326 if (match($2, ".*s.*")) 327 { 328 myprint( "curie sys" ) 329 SysTime=((substr($2,1,match($2, "h")-1)*60.)+substr($2,match($2, "h")+1,match($2, "m")-1))*60.+substr($2,match($2, "m")+1,match($2, "s")) 330 next 331 } 332 else 333 { 334 myprint( "vargas sys" ) 335 SysTime=$2 336 next 337 } 338 } 339 256 340 # Get information with time output on SX hosts 257 341 # ksh time
Note: See TracChangeset
for help on using the changeset viewer.