diff options
author | Erik Schnetter <schnetter@gmail.com> | 2013-08-06 18:19:26 -0400 |
---|---|---|
committer | Erik Schnetter <schnetter@gmail.com> | 2013-08-06 18:19:26 -0400 |
commit | 1843ac6e88b63d8eeaadfca723f4b2d13698cd62 (patch) | |
tree | 26be928e543c7c836213c3366fb009591609ddb4 | |
parent | 94a4c0d3883162bdd70a70f1e044450b9f54c925 (diff) |
LoopControl: Output LoopControl's memory usage
-rw-r--r-- | Carpet/LoopControl/src/loopcontrol.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Carpet/LoopControl/src/loopcontrol.cc b/Carpet/LoopControl/src/loopcontrol.cc index ec5ab219e..6f3ad7fe5 100644 --- a/Carpet/LoopControl/src/loopcontrol.cc +++ b/Carpet/LoopControl/src/loopcontrol.cc @@ -1166,6 +1166,13 @@ void lc_statistics(CCTK_ARGUMENTS) time_actual += setup_count * setup.stats.avg_point(); } } + const size_t nbytes = + (nloops * + (sizeof(lc_descr_t*) + sizeof(lc_descr_t))) + + (nsetups * + (sizeof(lc_setup_key_t) + sizeof(lc_setup_t*) + sizeof(lc_setup_t))) + + (nparams * + (sizeof(lc_params_key_t) + sizeof (lc_params_t*) + sizeof(lc_params_t))); CCTK_VInfo(CCTK_THORNSTRING, " Loops traversed: %td", nloops); CCTK_VInfo(CCTK_THORNSTRING, " Setups encountered: %td", nsetups); CCTK_VInfo(CCTK_THORNSTRING, " Params explored: %td", nparams); @@ -1178,6 +1185,7 @@ void lc_statistics(CCTK_ARGUMENTS) CCTK_VInfo(CCTK_THORNSTRING, " Ideal time could have been: %g s (%+.1f%%)", time_best, 100.0 * (time_best / time_actual - 1.0)); + CCTK_VInfo(CCTK_THORNSTRING, " Memory allocated: %g MB", nbytes / 1.0e+6); } |