Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

topology_check_resort inconsistent type #3616

Closed
hirschsn opened this issue Apr 1, 2020 · 1 comment · Fixed by #3617
Closed

topology_check_resort inconsistent type #3616

hirschsn opened this issue Apr 1, 2020 · 1 comment · Fixed by #3617

Comments

@hirschsn
Copy link
Contributor

hirschsn commented Apr 1, 2020

Introduced in 7f4caf7, topology_check_resort returns true as default. This was used in cells_update_ghosts to decide if resorting is necessary or not. Later in 4e468e9, the function was changed to return an unsigned and is currently defined as follows:

unsigned topology_check_resort(int cs, unsigned local_resort) {
  switch (cs) {
  case CELL_STRUCTURE_DOMDEC:
  case CELL_STRUCTURE_NSQUARE:
    return boost::mpi::all_reduce(comm_cart, local_resort,
                                  std::bit_or<unsigned>());
  default:
    return true; // <----
  }
}

Results should semantically be values of enum Cells::Resort.

Now I don't directly do a PR because I don't know what you @fweik intend to be returned here: Cells::Resort::LOCAL or Cells::Resort::GLOBAL. In my opinion it should be GLOBAL. Because if this case would ever happen, we need to return a value v s.t. v >= local_resort on all processes. And this we can guarantee only for GLOBAL.

@fweik
Copy link
Contributor

fweik commented Apr 1, 2020

Yes, I agree it should be GLOBAL. The implicit integer conversion rules are great stuff ^^

@kodiakhq kodiakhq bot closed this as completed in #3617 Apr 1, 2020
kodiakhq bot added a commit that referenced this issue Apr 1, 2020
Fixes #3616 

Description of changes:
- Return GLOBAL as a default.

(Edit: Sorry, wrong issue referenced.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants