Skip to content

Commit

Permalink
Merge branch 'master' of github.com:pc2/StencilStream
Browse files Browse the repository at this point in the history
  • Loading branch information
JOOpdenhoevel committed Dec 7, 2020
2 parents 49ff992 + af8c86b commit 6a8b207
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 34 deletions.
2 changes: 1 addition & 1 deletion examples/conway/build_nalla.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
#SBATCH --mem=90GB
#SBATCH --time=3-00:00:00

../build.sh nalla_pcie 10 conway
../build.sh nalla_pcie/19.4.0_max 10 conway
2 changes: 1 addition & 1 deletion examples/fdtd/build_nalla.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
#SBATCH --exclusive
#SBATCH --time=3-00:00:00

../build.sh nalla_pcie 35 fdtd
../build.sh nalla_pcie/19.4.0_max 35 fdtd
8 changes: 3 additions & 5 deletions examples/fdtd/src/fdtd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,20 +95,18 @@ int main(int argc, char **argv)
std::cout << "Run " << i << " with " << (i + 1) * parameters.n_sample_steps << " passes took " << runtimes.back() << " seconds" << std::endl;
}

double delta_passes = parameters.n_sample_steps / pipeline_length;

// Actually the mean delta seconds per pass.
double delta_seconds_per_pass = 0.0;
for (uindex_t i = 0; i < runtimes.size() - 1; i++)
{
delta_seconds_per_pass += abs(double(runtimes[i + 1]) - double(runtimes[i])) / delta_passes;
delta_seconds_per_pass += abs(double(runtimes[i + 1]) - double(runtimes[i]));
}
delta_seconds_per_pass /= runtimes.size() - 1;
delta_seconds_per_pass = (delta_seconds_per_pass / (runtimes.size() - 1)) * (pipeline_length / paraemeters.n_sample_steps);

std::cout << "Time per buffer pass: " << delta_seconds_per_pass << "s" << std::endl;

double loops_per_pass = n_buffer_rows * n_buffer_columns;
double seconds_per_loop = delta_seconds_per_pass * loops_per_pass;
double seconds_per_loop = delta_seconds_per_pass / loops_per_pass;
double cycles_per_loop = seconds_per_loop * clock_frequency;

std::cout << "Cycles per Loop, aka II.: " << cycles_per_loop << std::endl;
Expand Down
23 changes: 3 additions & 20 deletions examples/hotspot/analyze_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
automatically. The output is formatted like a Python dict, but you need to remove error and output
messages. Lastly, you need to copy the cycle frequency and the pipeline length from the reports into this script.
"""
from matplotlib import pyplot
import numpy as np

from benchmark import runtime
from verify_benchmark import value_derivation

cycle_frequency = 79.63 * 10**6
pipeline_length = 225
step_size = 900

height = width = 1024
radius = 1
Expand All @@ -29,7 +27,7 @@
offset_runtime = [original_runtime[0]] + original_runtime

delta = [current_sample - next_sample for (current_sample, next_sample) in zip(original_runtime, offset_runtime)]
mean_delta = sum(delta) / len(delta)
mean_delta = (sum(delta) / len(delta)) * (pipeline_length / step_size)

print("\tDelta Time per Grid Pass: {:.2f} milliseconds".format(mean_delta * 10**3))

Expand All @@ -47,19 +45,4 @@

throughput = (2 * cell_size * width * height) / mean_delta * 10**-9

print("\tGlobal Memory Throughput: {:.2f} GB/s".format(throughput))

pyplot.title("Ratio of correct values")
for length in value_derivation:
pyplot.plot([deriv[0] for deriv in value_derivation[length]])
pyplot.show()

pyplot.title("Mean result derivation")
for length in value_derivation:
pyplot.plot([deriv[1] for deriv in value_derivation[length]])
pyplot.show()

pyplot.title("Maximal absolute result derivation")
for length in value_derivation:
pyplot.plot([deriv[2] for deriv in value_derivation[length]])
pyplot.show()
print("\tGlobal Memory Throughput: {:.2f} GB/s".format(throughput))
2 changes: 1 addition & 1 deletion examples/hotspot/build_nalla.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
#SBATCH --exclusive
#SBATCH --time=3-00:00:00

../build.sh nalla_pcie 225 hotspot
../build.sh nalla_pcie/19.4.0_max 200 hotspot
8 changes: 3 additions & 5 deletions examples/hotspot/hotspot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,20 +276,18 @@ int main(int argc, char **argv)
std::cout << "Run " << i << " with " << (i + 1) * sim_time << " passes took " << runtimes[i] << " seconds" << std::endl;
}

double delta_passes = sim_time / pipeline_length;

// Actually the mean delta seconds per pass.
double delta_seconds_per_pass = 0.0;
for (uindex_t i = 0; i < n_simulations - 1; i++)
{
delta_seconds_per_pass += abs(double(runtimes[i + 1]) - double(runtimes[i])) / delta_passes;
delta_seconds_per_pass += abs(double(runtimes[i + 1]) - double(runtimes[i]));
}
delta_seconds_per_pass /= n_simulations - 1;
delta_seconds_per_pass = (delta_seconds_per_pass / (n_simulations - 1)) * (pipeline_length / sim_time);

std::cout << "Time per buffer pass: " << delta_seconds_per_pass << "s" << std::endl;

double loops_per_pass = max_width * max_height;
double seconds_per_loop = delta_seconds_per_pass * loops_per_pass;
double seconds_per_loop = delta_seconds_per_pass / loops_per_pass;
double cycles_per_loop = seconds_per_loop * clock_frequency;

std::cout << "Cycles per Loop, aka II.: " << cycles_per_loop << std::endl;
Expand Down
2 changes: 1 addition & 1 deletion examples/main/build_nalla.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
#SBATCH --mem=60GB
#SBATCH --time=3-00:00:00

../build.sh nalla_pcie 10 main
../build.sh nalla_pcie/19.4.0_max 10 main

0 comments on commit 6a8b207

Please sign in to comment.