Changeset 122 for trunk/oarutils
- Timestamp:
- Apr 3, 2017, 5:31:53 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/oarutils/oar-parexec
r121 r122 55 55 chomp $oar_version; 56 56 57 # global time 58 my $global_time_atstart = time; 59 my $global_time_total = 0; 60 my $global_time_cumulative = 0; 61 57 62 # re-run, keep trace of job already done 58 63 my %state; … … 62 67 or die "error: can't read log file: $!"; 63 68 while (<$log_h>) { 69 # log version 1 64 70 $state{$1} = 'start' if m/^start\s+job\s+([^\s]+)\s/; 65 71 $state{$1} = 'end' if m/^end\s+job\s+([^\s]+)\s/; 72 # log version 2 73 $state{$1} = 'start' if m/^start\s+subjob\s+([^\s]+)\s/; 74 $state{$1} = 'end' if m/^end\s+subjob\s+([^\s]+)\s/; 75 ($global_time_total, $global_time_cumulative) = ($1, $2) if m/^global-time\s.*total\s+(\d+)\s+cumulative\s+(\d+)/; 66 76 } 67 77 $log_h->close(); … … 260 270 $fh = unblock $fh; 261 271 262 my $msg = sprintf "start job %${job_name_maxlen}s / %5i at %s oar job %i on node %s\n", 263 $job_name, $job_pid, time, $ENV{OAR_JOB_ID}, $job_ressource; 272 my $begin_at = time; 273 #my $msg = sprintf "start job %${job_name_maxlen}s / %5i at %s oar job %i on node %s\n", 274 my $msg = sprintf "start subjob %${job_name_maxlen}s pid %5i at %s oarjob %i onnode %s\n", 275 $job_name, $job_pid, $begin_at, $ENV{OAR_JOB_ID}, $job_ressource; 264 276 $log_h->print($msg) if $logtrace; 265 277 print($msg) if $verbose; … … 279 291 name => $job_name, 280 292 pidfile => $job_pidfile, 293 begin_at => $begin_at, 281 294 }; 282 295 … … 328 341 #print "ERREUR0 $job_pid $job_retcode0\n" if $job_retcode0; 329 342 330 my $msg = sprintf "end job %${job_name_maxlen}s / %5i at %s oar job %i on node %s\n", 343 # job time 344 my $end_at = time; 345 my $duration = $end_at - $scheduled{$job_pid}->{begin_at}; 346 my $global_time_cumulative += $duration; 347 348 #my $msg = sprintf "end job %${job_name_maxlen}s / %5i at %s oar job %i on node %s\n", 349 my $msg = sprintf "end subjob %${job_name_maxlen}s pid %5i at %s oarjob %i onnode %s duration %i status %i\n", 331 350 $scheduled{$job_pid}->{name}, 332 $job_pid, time, $ENV{OAR_JOB_ID}, $scheduled{$job_pid}->{ressource}; 351 $job_pid, $end_at, $ENV{OAR_JOB_ID}, $scheduled{$job_pid}->{ressource}, 352 $duration, $job_retcode0; 333 353 334 354 # Job error 335 $msg =~ s/^end\s+ job/error:$job_retcode0job/355 $msg =~ s/^end\s+subjob/error subjob/ 336 356 if $job_retcode0 > 0 and $job_retcode0 != 99; 337 357 338 358 # Job non finish, just suspend if received checkpoint signal 339 $msg =~ s/^end\s+ job/suspendjob/359 $msg =~ s/^end\s+subjob/suspend subjob/ 340 360 if $sig_transmit and $oar_checkpoint->count() > 0; 341 361 … … 364 384 $finished->wait; 365 385 386 # global time 387 $global_time_total += (time - $global_time_atstart); 388 $log_h->print("global-time total $global_time_total cumulative $global_time_cumulative\n") if $logtrace; 389 print("global-time total $global_time_total cumulative $global_time_cumulative\n") if $verbose; 390 366 391 # close log trace file 367 392 $log_h->close() if $logtrace; … … 696 721 error subjob 1 pid 101468 at 1450482556 oarjob 71725 onnode cl7n001 duration 657 status 0 697 722 suspend subjob 1 pid 101468 at 1450482556 oarjob 71725 onnode cl7n001 duration 657 status 0 723 global-time total 555 cumulative 44444 698 724 699 725 =item B<Version 1> … … 702 728 start job 1 / 101468 at 1450482228 oar job 71725 on node cl7n001 703 729 end job 1 / 101468 at 1450482556 oar job 71725 on node cl7n001 730 end job 1 / 101468 at 1450482556 oar job 71725 on node cl7n001 731 error:retcode job 1 / 101468 at 1450482556 oar job 71725 on node cl7n00 704 732 705 733 =back 734 706 735 707 736 =head1 SEE ALSO
Note: See TracChangeset
for help on using the changeset viewer.