Skip to content

[BUG]: Quadtree only considers nBlocks for the geo grid #170

@abukowski21

Description

@abukowski21

Quadtree is not splitting blocks as I would expect

When running with dipole4 and sphere, the quadtree sees that it needs to split the geographic grid, as expected. But then it also divides the magnetic grid into 4ths, leading to the magnetic grid only covering 1/4 of the globe.


from init_parallel

[...]
  int64_t nProcsPerNode = nGrids / quadtree.nRootNodes;


  quadtree.max_depth = round(log(nProcsPerNode) / log(4));
  quadtree_ion.max_depth = round(log(nProcsPerNode) / log(4));

  // Check to see if we have enough processors to do this stuff:
  int nBlocksLonGeo = pow(2, quadtree.max_depth); // input.get_nBlocksLonGeo();
  int nBlocksLatGeo = pow(2, quadtree.max_depth); // input.get_nBlocksLatGeo();
  nGrids = nBlocksLonGeo * nBlocksLatGeo * quadtree.nRootNodes;
  int nProcsNeeded = nMembers * nGrids;

  if (nProcsNeeded == nProcs) {

    // Get Ensemble member number and grid number:
    iMember = iProc / nGrids;
    iGrid = iProc % nGrids;
[...]

    quadtree.build("neuGrid"); 
    quadtree_ion.build("ionGrid");

  } else {
    if (iProc == 0) {
      std::cout << "Number of processors needed is not set correctly!\n";

It appears that we only check the geographic grid to determine if blocks need to be split. I can imagine a solution where we either:

  1. Check both the geographic and magnetic grids, or
  2. close the dipole 4/6 options off from the user and just pick which one is most appropriate. Or,
  3. something else?

Quick fix:

This needed quick attention, so I put in a hacky solution. I put in a "Sphere4" with the same structure as "Dipole4". That's 4 blocks in latitude, with one longitudinal block.

SO this isn't too urgent, but might need some attention eventually...

my commit: d64be6b

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions