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; ...@@ -12,41 +12,17 @@ using TugType = double;
int main(int argc, char **argv) { int main(int argc, char **argv) {
double timings[3]; 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 << "BARITE_LARGE started with output... ";
std::cout << "Printing output to .csv files\n"; timings[1] = run_bench(barite_large_input, "barite_large_output.csv");
with_output = true; std::cout << "Runtime: " << timings[1] << " [ms]\n";
} else {
std::cout << "No output to .csv files\n";
std::cout << "Set env variable 'BENCH_OUTPUT=1' to enable it\n";
}
if (with_output) { std::cout << "SURFEX started with output... ";
std::cout << "BARITE_200 started with output... "; timings[2] = run_bench(surfex_input, "surfex_output.csv");
timings[0] = run_bench(barite_200_input, "barite_200_output.csv"); std::cout << "Runtime: " << timings[2] << " [ms]\n";
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";
}
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
...@@ -3,6 +3,6 @@ ...@@ -3,6 +3,6 @@
#include <bench_defs.hpp> #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 #endif // _RUN_HPP
\ No newline at end of file
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