Add memory consumption in bench

This commit is contained in:
Alejandro Gallo 2022-09-08 15:44:29 +02:00
parent 0558148937
commit 4277c07cc2

View File

@ -58,8 +58,9 @@ int main(int argc, char** argv) {
CLI11_PARSE(app, argc, argv); CLI11_PARSE(app, argc, argv);
CTF::World world(argc, argv); CTF::World world(argc, argv);
int rank; int rank, nranks;
MPI_Comm_rank(world.comm, &rank); MPI_Comm_rank(world.comm, &rank);
MPI_Comm_size(world.comm, &nranks);
constexpr double elem_to_gb = 8.0 / 1024.0 / 1024.0 / 1024.0; constexpr double elem_to_gb = 8.0 / 1024.0 / 1024.0 / 1024.0;
// USER PRINTING TEST BEGIN // USER PRINTING TEST BEGIN
@ -108,6 +109,43 @@ int main(int argc, char** argv) {
} }
} }
size_t
f = sizeof(double)
, n_tuples = nv * (nv + 1) * (nv + 2) / 6 - nv
, atrip_memory
= /* tuples_memory */ 3 * sizeof(size_t) * n_tuples
//
// one dimensional slices (all ranks)
//
+ /* taphh */ f * nranks * 6 * nv * no * no
+ /* hhha */ f * nranks * 6 * no * no * no
//
// two dimensional slices (all ranks)
//
+ /* abph */ f * nranks * 12 * nv * no
+ /* abhh */ f * nranks * 6 * no * no
+ /* tabhh */ f * nranks * 6 * no * no
//
// distributed sources (all ranks)
//
+ /* tpphh */ f * nv * nv * no * no
+ /* vhhhp */ f * no * no * no * nv
+ /* vppph */ f * nv * nv * nv * no
+ /* vpphh */ f * nv * nv * no * no
+ /* tpphh2 */ f * nv * nv * no * no
//
// tensors in every rank
//
+ /* tijk */ f * nranks * no * no * no
+ /* zijk */ f * nranks * no * no * no
+ /* epsp */ f * nranks * (no + nv)
+ /* tai */ f * nranks * no * nv
;
if (atrip::Atrip::rank == 0)
std::cout << "Tentative MEMORY USAGE: " << atrip_memory << "\n";
std::vector<int> symmetries(4, NS) std::vector<int> symmetries(4, NS)
, vo({nv, no}) , vo({nv, no})
, vvoo({nv, nv, no, no}) , vvoo({nv, nv, no, no})