From 06c9f31bcd79bab5bab2df415048de41c95180a4 Mon Sep 17 00:00:00 2001 From: Alejandro Gallo Date: Wed, 13 Oct 2021 15:36:51 +0200 Subject: [PATCH] Update printing in test_main --- bench/test_main.cxx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/bench/test_main.cxx b/bench/test_main.cxx index ae0a472..2d32bd8 100644 --- a/bench/test_main.cxx +++ b/bench/test_main.cxx @@ -3,14 +3,26 @@ #include #include +#define _print_size(what, size) \ + if (rank == 0) { \ + std::cout << #what \ + << " => " \ + << (double)size * elem_to_gb \ + << "GB" \ + << std::endl; \ + } + int main(int argc, char** argv) { MPI_Init(&argc, &argv); CTF::World world(argc, argv); - + int rank; + MPI_Comm_rank(world.comm, &rank); + constexpr double elem_to_gb = 8.0 / 1024.0 / 1024.0 / 1024.0; const int no(hauta::option(argc, argv, "--no")) , nv(hauta::option(argc, argv, "--nv")) ; + std::vector symmetries(4, NS) , vo({nv, no}) , vvoo({nv, nv, no, no}) @@ -28,6 +40,10 @@ int main(int argc, char** argv) { , Vppph(4, vvvo.data(), symmetries.data(), world) ; + _print_size(Vabci, no*nv*nv*nv) + _print_size(Vabij, no*no*nv*nv) + _print_size(Vijka, no*no*no*nv) + ei.fill_random(-40.0, -2); ea.fill_random(2, 50); Tpphh.fill_random(0, 1);