Skip to content
Snippets Groups Projects
Commit e2b6b242 authored by Matteo Cicuttin's avatar Matteo Cicuttin
Browse files

Report maxrss at exit.

parent a5068e3a
No related branches found
No related tags found
Loading
......@@ -7,6 +7,9 @@
#include <filesystem>
#endif
#include <sys/time.h>
#include <sys/resource.h>
#ifdef USE_MPI
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
......@@ -364,6 +367,9 @@ register_lua_usertypes_bystate(maxwell::parameter_loader& mpl,
*/
int main(int argc, char *argv[])
{
struct rusage ru_start, ru_end;
getrusage(RUSAGE_SELF, &ru_start);
#ifdef USE_MPI
MPI_Init(&argc, &argv);
......@@ -489,5 +495,9 @@ int main(int argc, char *argv[])
MPI_Finalize();
#endif
getrusage(RUSAGE_SELF, &ru_end);
std::cout << "Max RSS: " << (ru_end.ru_maxrss - ru_start.ru_maxrss) << std::endl;
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment