Commit ed987526 authored by Kevin Harms's avatar Kevin Harms

Fix divide-by-zero error in cases where total i/o for either read or write is zero.


git-svn-id: https://svn.mcs.anl.gov/repos/darshan/trunk@282 3b7491f3-a168-0410-bf4b-c445ed680a29
parent 1260cc59
......@@ -653,8 +653,26 @@ foreach $key (keys %fs_data)
{
my $wr_total_mb = ($fs_data{$key}->[1] / (1024*1024));
my $rd_total_mb = ($fs_data{$key}->[0] / (1024*1024));
my $wr_total_rt = ($fs_data{$key}->[1] / ($cumul_write_bytes_shared + $cumul_write_bytes_indep));
my $rd_total_rt = ($fs_data{$key}->[0] / ($cumul_read_bytes_shared + $cumul_read_bytes_indep));
my $wr_total_rt;
if ($cumul_write_bytes_shared+$cumul_write_bytes_shared)
{
$wr_total_rt = ($fs_data{$key}->[1] / ($cumul_write_bytes_shared + $cumul_write_bytes_indep));
}
else
{
$wr_total_rt = 0;
}
my $rd_total_rt;
if ($cumul_write_bytes_shared+$cumul_read_bytes_indep)
{
$rd_total_rt = ($fs_data{$key}->[0] / ($cumul_read_bytes_shared + $cumul_read_bytes_indep));
}
else
{
$rd_total_rt = 0;
}
printf TABLES "%s \& %.5f \& %.5f \& %.5f \& %.5f \\\\\n",
$key, $wr_total_mb, $wr_total_rt, $rd_total_mb, $rd_total_rt;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment