From 0fecd0fc8c395fa209a8a9bbd32c3a88c3281f49 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Tue, 15 Feb 2011 09:31:37 +0100 Subject: [PATCH 1/1] Change format for log messages. The expected load is not printed anymore in info loglevel. Is is only printed in verbose loglevel, bookkeeping being either enabled or not. --- README | 24 ++++++++++++------------ extract.pl | 29 +++-------------------------- process.cpp | 22 ++++++++-------------- 3 files changed, 23 insertions(+), 52 deletions(-) diff --git a/README b/README index ff7c6df..2d9059c 100644 --- a/README +++ b/README @@ -50,11 +50,10 @@ Sorties ======= * pendant la simulation : -[Bourassa 5.000000] [proc/INFO] (6:1) current load: 5 ; expected: 0.3125 - +------- +------- +-------- + + +-------------- +-------------- - | | | | | | \_ charge attendue - | | | | | | (en bookkeeping) - | | | | | \_ charge courante +[Bourassa 5.000000] [proc/INFO] (6:1) current load: 5 + +------- +------- +-------- + + -----+--------- + | | | | | | + | | | | | \_ charge courante | | | | | | | | | \_ nombre d'itérations de calculs | | | | @@ -67,16 +66,17 @@ Sorties \ nom du nœud * à la fin de la simulation : -[Bourassa 108.886866] [proc/INFO] Final load after 107:4 iterations: 1.04113 ; expected: 1 - +------- +--------- +-------- +-- + +------ +---------- - | | | | | | \_ charge attendue - | | | | | | (en bookkeeping) +[Bourassa 108.886866] [proc/INFO] Final load after 107:4 iterations: 1.04113 + +------- +--------- +-------- +-- + +------ | | | | | | - | | | | | \_ charge courante + | | | | | \_ charge + | | | | | courante | | | | | - | | | | \_ nombre d'itérations de calculs + | | | | \_ nombre d'itérations + | | | | de calculs | | | | - | | | \_ nombre d'itérations d'équilibrage + | | | \_ nombre d'itérations + | | | d'équilibrage | | | | | \_ catégorie de messages | | diff --git a/extract.pl b/extract.pl index 0521e94..a174a9e 100755 --- a/extract.pl +++ b/extract.pl @@ -7,31 +7,14 @@ my $bookkeeping; my $flt = '[+-]?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?'; my $pflt = "($flt)"; my $prefix = '^\[([^: ]+)(?::loba:\(\d+\))? ' . $pflt . '\] \[proc/INFO\] '; -my $initmatch = $prefix . 'Initial load: ' . $pflt . ''; -my $finalmatch; -my $plainmatch; +my $initmatch = $prefix . 'Initial load: ' . $pflt; +my $finalmatch = $prefix . 'Final load after (\d+):(\d+) iterations: ' . $pflt;; +my $plainmatch = $prefix . '\((\d+):(\d+)\) current load: ' . $pflt; my %alldata = (); while (<>) { chomp; - if (s{^(?:\[0\.0+\] )?\[main/INFO\] \| bookkeeping\.*: }{}) { - $bookkeeping = $_ eq "on"; - $finalmatch = $prefix . - 'Final load after (\d+):(\d+) iterations: ' . $pflt; - $plainmatch = $prefix . '\((\d+):(\d+)\) current load: ' . $pflt; - if ($bookkeeping) { - $finalmatch = $finalmatch . ' ; expected: ' . $pflt; - $plainmatch = $plainmatch . ' ; expected: ' . $pflt; - } - if (0) { - print STDERR "BOOKKEEPING: \"$_\" ($bookkeeping)\n"; - print STDERR "INITMATCH..: \"$initmatch\"\n"; - print STDERR "PLAINMATCH.: \"$plainmatch\"\n"; - print STDERR "FINALMATCH.: \"$finalmatch\"\n"; - } - } - next if not defined $bookkeeping; if (m{$plainmatch} or m{$finalmatch}) { my $host = $1; my $data = { @@ -40,11 +23,6 @@ while (<>) { comp => $4, load => $5, }; - if ($bookkeeping) { - $data->{expected} = $6; - } else { - $data->{expected} = $data->{load}; - } # print STDERR "PUSH $host $data->{time} $data->{load} (plain/final)\n"; push @{$alldata{$host}}, $data; } elsif (m{$initmatch}) { @@ -54,7 +32,6 @@ while (<>) { lb => 0, comp => 0, load => $3, - expected => $3, }; # print STDERR "PUSH $host $data->{time} $data->{load} (init)\n"; push @{$alldata{$host}}, $data; diff --git a/process.cpp b/process.cpp index 880bbd0..0c3f784 100644 --- a/process.cpp +++ b/process.cpp @@ -84,20 +84,18 @@ process::~process() total_load_exit += real_load; if (opt::log_rate < 0) return; - if (opt::bookkeeping) { - XBT_INFO("Final load after %d:%d iterations: %g ; expected: %g", - lb_iter, comp_iter, real_load, expected_load); - } else { - XBT_INFO("Final load after %d:%d iterations: %g", - lb_iter, comp_iter, real_load); - } + XBT_INFO("Final load after %d:%d iterations: %g", + lb_iter, comp_iter, real_load); + XBT_VERB("Expected load was: %g", expected_load); XBT_VERB("Total computation for this process: %g", comp); } int process::run() { - if (opt::log_rate >= 0) + if (opt::log_rate >= 0) { XBT_INFO("Initial load: %g", real_load); + XBT_VERB("Initial expected load: %g", expected_load); + } XBT_VERB("Starting..."); mutex.acquire(); lb_thread->start(); @@ -130,12 +128,8 @@ void process::load_balance_loop() } if (opt::log_rate && lb_iter % opt::log_rate == 0) { - if (opt::bookkeeping) - XBT_INFO("(%u:%u) current load: %g ; expected: %g", - lb_iter, comp_iter, real_load, expected_load); - else - XBT_INFO("(%u:%u) current load: %g", - lb_iter, comp_iter, real_load); + XBT_INFO("(%u:%u) current load: %g", lb_iter, comp_iter, real_load); + XBT_VERB("... expected load: %g", expected_load); } if (get_load() > 0.0) -- 2.39.5