From 537c1ec01720554a37d3255c927fbf6fe1deb699 Mon Sep 17 00:00:00 2001 From: Chuck Yount Date: Fri, 6 Sep 2019 15:03:23 -0700 Subject: [PATCH 1/7] Add cpuinfo to log. --- src/kernel/yask.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kernel/yask.sh b/src/kernel/yask.sh index f726e897..57361214 100755 --- a/src/kernel/yask.sh +++ b/src/kernel/yask.sh @@ -317,7 +317,7 @@ else fi # Commands to capture some important system status and config info for benchmark documentation. -config_cmds="sleep 1; uptime; lscpu; sed '/^$/q' /proc/cpuinfo; uname -a; $dump /etc/system-release; $dump /proc/cmdline; $dump /proc/meminfo; free -gt; numactl -H; ulimit -a" +config_cmds="sleep 1; uptime; lscpu; cpuinfo -A; sed '/^$/q' /proc/cpuinfo; uname -a; $dump /etc/system-release; $dump /proc/cmdline; $dump /proc/meminfo; free -gt; numactl -H; ulimit -a" # Command sequence to be run in a shell. # Captures From 3910073adb7010fc244c7ece08a3681c6c209d2b Mon Sep 17 00:00:00 2001 From: Chuck Yount Date: Fri, 6 Sep 2019 15:04:26 -0700 Subject: [PATCH 2/7] Add col for auto-tuner and filter out incomplete runs. --- utils/bin/yask_log_to_csv.pl | 10 +++++++--- utils/lib/YaskUtils.pm | 19 ++++++++++++++++--- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/utils/bin/yask_log_to_csv.pl b/utils/bin/yask_log_to_csv.pl index bd5922ba..49bfd213 100755 --- a/utils/bin/yask_log_to_csv.pl +++ b/utils/bin/yask_log_to_csv.pl @@ -51,9 +51,13 @@ for my $arg (@ARGV) { for my $fn (glob $arg) { my %results; - YaskUtils::getResultsFromFile(\%results, $fn); - YaskUtils::printCsvValues(\%results, $outFH); - print $outFH ",\"$fn\"\n"; + # Parse file. + if (YaskUtils::getResultsFromFile(\%results, $fn)) { + + # Print results if ok. + YaskUtils::printCsvValues(\%results, $outFH); + print $outFH ",\"$fn\"\n"; + } } } diff --git a/utils/lib/YaskUtils.pm b/utils/lib/YaskUtils.pm index 7bbfb218..a9c7c478 100644 --- a/utils/lib/YaskUtils.pm +++ b/utils/lib/YaskUtils.pm @@ -32,10 +32,12 @@ use Carp; # Special keys. my $linux_key = "Linux kernel"; my $nodes_key = "MPI node(s)"; +my $auto_tuner_key = "auto-tuner used"; our @special_log_keys = ( $linux_key, $nodes_key, + $auto_tuner_key, ); # Values to get from log file. @@ -213,7 +215,6 @@ sub getResultsFromLine($$) { $line =~ s/target.ISA/target/g; # special cases for manual parsing... - # TODO: catch output of auto-tuner and update relevant results. # Output of 'uname -a' if ($line =~ /^\s*Linux\s/) { @@ -234,6 +235,8 @@ sub getResultsFromLine($$) { elsif ($line =~ /^auto-tuner(.).*size:/) { my $c = $1; + $results->{$auto_tuner_key} = 'TRUE'; + # If colon found above, tuner is global. my $onep = ($c eq ':'); @@ -288,15 +291,25 @@ sub getResultsFromFile($$) { my $results = shift; # ref to hash. my $fname = shift; # filename. + # Init values. + $results->{$auto_tuner_key} = 'FALSE'; + my $ok = 0; + + # Open file. my $fh = new FileHandle; if (!$fh->open("<$fname")) { carp "error: cannot open '$fname'"; } else { + + # Parse each line. while (<$fh>) { + $ok = 1 if /DONE/; getResultsFromLine($results, $_); } $fh->close(); } + + return $ok; } # Print standard CSV header to given file. @@ -317,8 +330,8 @@ sub printCsvValues($$) { for my $m (@all_log_keys) { my $r = $results->{$m}; $r = '' if !defined $r; - $r = '"'.$r.'"' # add quotes if not a number. - if $r !~ /^[0-9.e+-]+$/ || $r =~ /[.].*[.]/; + $r = '"'.$r.'"' # add quotes if not simple chars. + if $r !~ /^[\w.]+$/ || $r =~ /[.].*[.]/; push @cols, $r; } print $fh join(',', @cols); From 3cd444b98bbb3ac086049ab2f90baf1bf9d8d656 Mon Sep 17 00:00:00 2001 From: Chuck Yount Date: Fri, 6 Sep 2019 15:17:14 -0700 Subject: [PATCH 3/7] Update version. --- src/common/common_utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/common_utils.cpp b/src/common/common_utils.cpp index 6cb82a63..6a16f055 100644 --- a/src/common/common_utils.cpp +++ b/src/common/common_utils.cpp @@ -43,7 +43,7 @@ namespace yask { // for numbers above 9 (at least up to 99). // Format: "major.minor.patch". - const string version = "3.02.00"; + const string version = "3.02.01"; string yask_get_version_string() { return version; From 014f1f45c87008246d728b9048c60201ad350596 Mon Sep 17 00:00:00 2001 From: Chuck Yount Date: Fri, 6 Sep 2019 15:53:21 -0700 Subject: [PATCH 4/7] Report shm and comm-overlap settings. --- src/kernel/lib/soln_apis.cpp | 4 +++- utils/lib/YaskUtils.pm | 21 +++++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/kernel/lib/soln_apis.cpp b/src/kernel/lib/soln_apis.cpp index d126d03a..1f69e479 100644 --- a/src/kernel/lib/soln_apis.cpp +++ b/src/kernel/lib/soln_apis.cpp @@ -272,7 +272,9 @@ namespace yask { #ifdef USE_MPI DEBUG_MSG(" num-ranks: " << opts->_num_ranks.makeDimValStr(" * ") << endl << " rank-indices: " << opts->_rank_indices.makeDimValStr() << endl << - " local-domain-offsets: " << rank_domain_offsets.makeDimValStr(dims->_domain_dims)); + " local-domain-offsets: " << rank_domain_offsets.makeDimValStr(dims->_domain_dims) << endl << + " use-shm: " << opts->use_shm << endl << + " overlap-comms: " << opts->overlap_comms); if (opts->overlap_comms) DEBUG_MSG(" mpi-interior: " << mpi_interior.make_range_string(domain_dims)); #endif diff --git a/utils/lib/YaskUtils.pm b/utils/lib/YaskUtils.pm index a9c7c478..171d4dd0 100644 --- a/utils/lib/YaskUtils.pm +++ b/utils/lib/YaskUtils.pm @@ -90,6 +90,8 @@ our @log_keys = 'L2 prefetch distance', 'num temporal block steps', 'num wave front steps', + 'use shm', + 'overlap comms', # other values from log file. 'model name', @@ -235,7 +237,7 @@ sub getResultsFromLine($$) { elsif ($line =~ /^auto-tuner(.).*size:/) { my $c = $1; - $results->{$auto_tuner_key} = 'TRUE'; + $results->{$auto_tuner_key} = 'true'; # If colon found above, tuner is global. my $onep = ($c eq ':'); @@ -251,6 +253,14 @@ sub getResultsFromLine($$) { } } + # Shared-mem & overlap backward-compat. + elsif ($line =~ /^Allocating.*MPI buffer/) { + $results->{'use shm'} = ($line =~ /using MPI shm/) ? 'true' : 'false'; + } + elsif ($line =~ /^\s*mpi-interior:/) { + $results->{'overlap comms'} = 'true'; + } + # look for matches to all other keys. else { my ($key, $val) = split /:/,$line,2; @@ -292,7 +302,9 @@ sub getResultsFromFile($$) { my $fname = shift; # filename. # Init values. - $results->{$auto_tuner_key} = 'FALSE'; + $results->{$auto_tuner_key} = 'false'; + $results->{'use shm'} = 'false'; + $results->{'overlap comms'} = 'false'; my $ok = 0; # Open file. @@ -304,6 +316,11 @@ sub getResultsFromFile($$) { # Parse each line. while (<$fh>) { $ok = 1 if /DONE/; + if (/^Setup for validation/) { + $ok = 1; + last; + } + getResultsFromLine($results, $_); } $fh->close(); From faddaee717d5f9aa8415db75641b909220a0c4a9 Mon Sep 17 00:00:00 2001 From: Chuck Yount Date: Sat, 7 Sep 2019 16:53:14 -0700 Subject: [PATCH 5/7] Warn on bad log file. --- utils/bin/yask_log_to_csv.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/bin/yask_log_to_csv.pl b/utils/bin/yask_log_to_csv.pl index 49bfd213..808f8c63 100755 --- a/utils/bin/yask_log_to_csv.pl +++ b/utils/bin/yask_log_to_csv.pl @@ -59,5 +59,8 @@ YaskUtils::printCsvValues(\%results, $outFH); print $outFH ",\"$fn\"\n"; } + else { + warn "Warning: log file '$fn' does not seem to contain a successful YASK run; ignoring.\n"; + } } } From 8746820058803e459fe03efcf7a318edf88bbdd6 Mon Sep 17 00:00:00 2001 From: Chuck Yount Date: Fri, 13 Sep 2019 16:34:18 -0700 Subject: [PATCH 6/7] Clean up some help messages. --- src/kernel/lib/settings.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/kernel/lib/settings.cpp b/src/kernel/lib/settings.cpp index 6ff9f65b..f4acd09f 100644 --- a/src/kernel/lib/settings.cpp +++ b/src/kernel/lib/settings.cpp @@ -325,7 +325,7 @@ namespace yask { // Following options are in the 'yask' namespace, i.e., no object. parser.add_option(new CommandLineParser::BoolOption ("print_suffixes", - "Format output with suffixes for human readibility, e.g., 6.15K, 12.3GiB, 7.45m." + "Format output with suffixes for human readibility, e.g., 6.15K, 12.3G, 7.45m." " If disabled, prints without suffixes for computer parsing, e.g., 6150, 1.23e+10, 7.45e-3.", yask::is_suffix_print_enabled)); @@ -344,11 +344,6 @@ namespace yask { #endif _add_domain_option(parser, "mp", "Minimum var-padding size (including halo)", _min_pad_sizes); _add_domain_option(parser, "ep", "Extra var-padding size (beyond halo)", _extra_pad_sizes); - parser.add_option(new CommandLineParser::BoolOption - ("allow_addl_padding", - "Allow automatic extension of padding beyond what is needed for" - " vector alignment for additional performance reasons", - _allow_addl_pad)); #ifdef USE_MPI _add_domain_option(parser, "nr", "Num ranks", _num_ranks); _add_domain_option(parser, "ri", "This rank's logical index (0-based)", _rank_indices); @@ -365,6 +360,11 @@ namespace yask { "Minimum width of MPI exterior section to compute before starting MPI communication.", _min_exterior)); #endif + parser.add_option(new CommandLineParser::BoolOption + ("allow_addl_padding", + "Allow automatic extension of padding beyond what is needed for" + " vector alignment for additional performance reasons.", + _allow_addl_pad)); parser.add_option(new CommandLineParser::BoolOption ("force_scalar", "Evaluate every var point with scalar stencil operations (for debug).", @@ -400,7 +400,7 @@ namespace yask { "This setting may increase cache locality when using multiple " "block-threads when scratch vars are used and/or " "when temporal blocking is active. " - "This option is ignored if there are fewer than two block threads.", + "This option is ignored if there is only one thread per block.", bind_block_threads)); #ifdef USE_NUMA stringstream msg; From 8357c5daa902b3b36e7c1a2d233bc4da7b3b1161 Mon Sep 17 00:00:00 2001 From: Chuck Yount Date: Fri, 13 Sep 2019 16:35:10 -0700 Subject: [PATCH 7/7] Capture more info about turbo and threads. --- src/kernel/yask.sh | 2 +- utils/lib/YaskUtils.pm | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/kernel/yask.sh b/src/kernel/yask.sh index 57361214..0e3e25aa 100755 --- a/src/kernel/yask.sh +++ b/src/kernel/yask.sh @@ -317,7 +317,7 @@ else fi # Commands to capture some important system status and config info for benchmark documentation. -config_cmds="sleep 1; uptime; lscpu; cpuinfo -A; sed '/^$/q' /proc/cpuinfo; uname -a; $dump /etc/system-release; $dump /proc/cmdline; $dump /proc/meminfo; free -gt; numactl -H; ulimit -a" +config_cmds="sleep 1; uptime; lscpu; cpuinfo -A; sed '/^$/q' /proc/cpuinfo; $dump /sys/devices/system/cpu/cpufreq/boost; uname -a; $dump /etc/system-release; $dump /proc/cmdline; $dump /proc/meminfo; free -gt; numactl -H; ulimit -a" # Command sequence to be run in a shell. # Captures diff --git a/utils/lib/YaskUtils.pm b/utils/lib/YaskUtils.pm index 171d4dd0..917d5c34 100644 --- a/utils/lib/YaskUtils.pm +++ b/utils/lib/YaskUtils.pm @@ -94,11 +94,15 @@ our @log_keys = 'overlap comms', # other values from log file. + 'vendor ID', 'model name', 'CPU(s)', + 'thread(s) per core', 'core(s) per socket', 'socket(s)', 'NUMA node(s)', + 'CPU MHz', + 'CPU max MHz', 'MemTotal', 'MemFree', 'ShMem',