Skip to content

Commit

Permalink
Cleanup debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
lroberts36 committed Aug 17, 2023
1 parent e64ed3f commit f2c4284
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
13 changes: 4 additions & 9 deletions src/mesh/mesh-gmg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ void Mesh::BuildGMGHierarchy(int nbs, ParameterInput *pin, ApplicationInput *app
}
}

printf("Root grid nrb=(%i, %i) block_size=(%i, %i) level=%i\n", nrbx[0], nrbx[0],
printf("Root grid nrb=(%i, %i) block_size=(%i, %i) level=%i\n", nrbx[0], nrbx[1],
block_size_default.nx(X1DIR), block_size_default.nx(X2DIR), root_level);
const int gmg_min_level = root_level - gmg_level_offset;

Expand All @@ -153,8 +153,6 @@ void Mesh::BuildGMGHierarchy(int nbs, ParameterInput *pin, ApplicationInput *app
// Build most refined GMG grid from already known grid
int gmg_gid = 0;
for (auto loc : loclist) {
std::cout << gmg_gid << " " << loc.level() << " "
<< gmg_grid_locs[gmg_levels - 1].size() << std::endl;
gmg_grid_locs[gmg_levels - 1].insert(
{loc, std::pair<int, int>(gmg_gid, ranklist[gmg_gid])});
gmg_gid++;
Expand All @@ -166,12 +164,9 @@ void Mesh::BuildGMGHierarchy(int nbs, ParameterInput *pin, ApplicationInput *app
printf("gmg_levels = %i gmg_min_level = %i\n", gmg_levels, gmg_min_level);
// Build meshes and blocklists for increasingly coarsened grids
for (int gmg_level = gmg_levels - 2; gmg_level >= 0; --gmg_level) {
printf("gmg level = %i\n", gmg_level);
// Determine mesh structure for this level on all ranks
for (auto &[loc, gid_rank] : gmg_grid_locs[gmg_level + 1]) {
auto &rank = gid_rank.second;
printf("loc.level()=%i gmg_level + gmg_min_level + 1 = %i\n", loc.level(),
gmg_level + gmg_min_level + 1);
if (loc.level() == gmg_level + gmg_min_level + 1) {
auto parent = loc.GetParent();
if (parent.morton() == loc.morton()) {
Expand All @@ -188,9 +183,9 @@ void Mesh::BuildGMGHierarchy(int nbs, ParameterInput *pin, ApplicationInput *app
BoundaryFlag block_bcs[6];
auto block_size = block_size_default;
SetBlockSizeAndBoundaries(loc, block_size, block_bcs);
printf("level = %i root_level = %i nx = (%i, %i) l=(%i, %i) x1=(%e, %e) x2=(%e, "
"%e)\n",
loc.level(), root_level, block_size.nx(X1DIR), block_size.nx(X2DIR),
printf("gid = %i gmg_level = %i loc.level() = %i nx = (%i, %i) l=(%i, %i) x1=(%e, %e) x2=(%e, "
"%e)\n", gid_rank.first,
gmg_level, loc.level(), block_size.nx(X1DIR), block_size.nx(X2DIR),
loc.lx1(), loc.lx2(), block_size.xmin(X1DIR), block_size.xmax(X1DIR),
block_size.xmin(X2DIR), block_size.xmax(X2DIR));
gmg_block_lists[gmg_level].push_back(
Expand Down
4 changes: 0 additions & 4 deletions src/mesh/mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1177,10 +1177,6 @@ RegionSize Mesh::GetBlockSize(const LogicalLocation &loc) const {
std::int64_t loc_hi = (loc.l(dir - 1) + 1) << (root_level - loc.level());
if (block_size.nx(dir) * (nrbx[dir - 1] - loc_low) % (loc_hi - loc_low) != 0)
valid_region = false;
printf("dir = %i nx = %i fac = %i loc_low = %i loc_hi = %i nrbx = %i "
"valid_region = %i\n",
dir, block_size.nx(dir), nrbx[dir - 1] / (loc_hi - loc_low), loc_low,
loc_hi, nrbx[dir - 1], valid_region);
block_size.nx(dir) =
block_size.nx(dir) * (nrbx[dir - 1] - loc_low) / (loc_hi - loc_low);
block_size.xmax(dir) = mesh_size.xmax(dir);
Expand Down

0 comments on commit f2c4284

Please sign in to comment.