Skip to content

Commit

Permalink
Merge pull request #237 from intel/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
chuckyount authored Sep 14, 2019
2 parents c81392e + 8357c5d commit f68d2ac
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/common/common_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
14 changes: 7 additions & 7 deletions src/kernel/lib/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand All @@ -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);
Expand All @@ -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).",
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion src/kernel/lib/soln_apis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/yask.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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; $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
Expand Down
13 changes: 10 additions & 3 deletions utils/bin/yask_log_to_csv.pl
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,16 @@
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";
}
else {
warn "Warning: log file '$fn' does not seem to contain a successful YASK run; ignoring.\n";
}
}
}
40 changes: 37 additions & 3 deletions utils/lib/YaskUtils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -88,13 +90,19 @@ our @log_keys =
'L2 prefetch distance',
'num temporal block steps',
'num wave front steps',
'use shm',
'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',
Expand Down Expand Up @@ -213,7 +221,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/) {
Expand All @@ -234,6 +241,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 ':');

Expand All @@ -248,6 +257,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;
Expand Down Expand Up @@ -288,15 +305,32 @@ sub getResultsFromFile($$) {
my $results = shift; # ref to hash.
my $fname = shift; # filename.

# Init values.
$results->{$auto_tuner_key} = 'false';
$results->{'use shm'} = 'false';
$results->{'overlap comms'} = '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/;
if (/^Setup for validation/) {
$ok = 1;
last;
}

getResultsFromLine($results, $_);
}
$fh->close();
}

return $ok;
}

# Print standard CSV header to given file.
Expand All @@ -317,8 +351,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);
Expand Down

0 comments on commit f68d2ac

Please sign in to comment.