Skip to content
Snippets Groups Projects
Verified Commit 343d1042 authored by Dorian Stoll's avatar Dorian Stoll
Browse files

tug: cpp: Always output CSV files

parent 21dcaa0d
No related branches found
No related tags found
No related merge requests found
......@@ -12,41 +12,17 @@ using TugType = double;
int main(int argc, char **argv) {
double timings[3];
bool with_output = false;
std::cout << "BARITE_200 started with output... ";
timings[0] = run_bench(barite_200_input, "barite_200_output.csv");
std::cout << "Runtime: " << timings[0] << " [ms]\n";
if (const char *out = std::getenv("BENCH_OUTPUT")) {
std::cout << "Printing output to .csv files\n";
with_output = true;
} else {
std::cout << "No output to .csv files\n";
std::cout << "Set env variable 'BENCH_OUTPUT=1' to enable it\n";
}
std::cout << "BARITE_LARGE started with output... ";
timings[1] = run_bench(barite_large_input, "barite_large_output.csv");
std::cout << "Runtime: " << timings[1] << " [ms]\n";
if (with_output) {
std::cout << "BARITE_200 started with output... ";
timings[0] = run_bench(barite_200_input, "barite_200_output.csv");
std::cout << "Runtime: " << timings[0] << " [ms]\n";
std::cout << "BARITE_LARGE started with output... ";
timings[1] = run_bench(barite_large_input, "barite_large_output.csv");
std::cout << "Runtime: " << timings[1] << " [ms]\n";
std::cout << "SURFEX started with output... ";
timings[2] = run_bench(surfex_input, "surfex_output.csv");
std::cout << "Runtime: " << timings[2] << " [ms]\n";
} else {
std::cout << "BARITE_200 started with no output... ";
timings[0] = run_bench(barite_200_input);
std::cout << " Runtime: " << timings[0] << " [ms]\n";
std::cout << "BARITE_LARGE started with no output... ";
timings[1] = run_bench(barite_large_input);
std::cout << "Runtime: " << timings[1] << " [ms]\n";
std::cout << "SURFEX started with no output... ";
timings[2] = run_bench(surfex_input);
std::cout << "Runtime: " << timings[2] << " [ms]\n";
}
std::cout << "SURFEX started with output... ";
timings[2] = run_bench(surfex_input, "surfex_output.csv");
std::cout << "Runtime: " << timings[2] << " [ms]\n";
return EXIT_SUCCESS;
}
......@@ -3,6 +3,6 @@
#include <bench_defs.hpp>
double run_bench(const bench_input &input, const std::string &output_file = "");
double run_bench(const bench_input &input, const std::string &output_file);
#endif // _RUN_HPP
\ No newline at end of file
#endif // _RUN_HPP
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment