diff options
author | schnetter <> | 2004-03-23 18:52:00 +0000 |
---|---|---|
committer | schnetter <> | 2004-03-23 18:52:00 +0000 |
commit | d7e2cc479e6499cc6acbec217a8b1f97acc25a0f (patch) | |
tree | bddbf3830c3c8d8da8d9573033ee147576b30c05 | |
parent | 6b9718c1c5d5273cebe24abd9bfdbbda07cf3c06 (diff) |
Output some statistics about the number of grid variables.
darcs-hash:20040323185223-07bb3-993fe7b41765b5cfb4839b22bfb4b58dce6bd009.gz
-rw-r--r-- | Carpet/Carpet/src/SetupGH.cc | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/Carpet/Carpet/src/SetupGH.cc b/Carpet/Carpet/src/SetupGH.cc index d6f9c3d39..e2e300f2a 100644 --- a/Carpet/Carpet/src/SetupGH.cc +++ b/Carpet/Carpet/src/SetupGH.cc @@ -24,7 +24,7 @@ #include "carpet.hh" extern "C" { - static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/src/SetupGH.cc,v 1.72 2004/03/23 19:51:38 schnetter Exp $"; + static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/src/SetupGH.cc,v 1.73 2004/03/23 19:52:23 schnetter Exp $"; CCTK_FILEVERSION(Carpet_Carpet_SetupGH_cc); } @@ -810,6 +810,48 @@ namespace Carpet { + // Some statistics + if (verbose || veryverbose) { + int num_gf_groups, num_gf_vars; + vector<int> num_array_groups(4), num_array_vars(4); + for (int group=0; group<CCTK_NumGroups(); ++group) { + + cGroup data; + const int ierr = CCTK_GroupData (group, &data); + assert (!ierr); + + switch (data.grouptype) { + case CCTK_GF: + num_gf_groups += 1; + num_gf_vars += data.numvars * data.numtimelevels; + break; + case CCTK_SCALAR: + case CCTK_ARRAY: + num_array_groups.at(data.dim) += 1; + num_array_vars.at(data.dim) += data.numvars * data.numtimelevels; + break; + default: + assert (0); + } + } + CCTK_INFO ("Group and variable statistics:"); + CCTK_VInfo (CCTK_THORNSTRING, + " There are %d grid functions in %d groups", + num_gf_vars, num_gf_groups); + CCTK_VInfo (CCTK_THORNSTRING, + " There are %d grid scalars in %d groups", + num_array_vars.at(0), num_array_groups.at(0)); + for (int dim=1; dim<=3; ++dim) { + CCTK_VInfo (CCTK_THORNSTRING, + " There are %d %d-dimensional grid arrays in %d groups", + num_array_vars.at(dim), dim, num_array_groups.at(dim)); + } + CCTK_VInfo (CCTK_THORNSTRING, + " (The number of variables counts all time levels)"); + } + + + // Enable storage for all groups if desired if (true || enable_all_storage) { BEGIN_MGLEVEL_LOOP(cgh) { |