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

Allow named index-rank pairs in parallel tests #816

Conversation

masterleinad
Copy link
Collaborator

Split from #737, addressing #737 (comment).

Currently, we are using Kokkos::pair<int, int> for all distributed tests to denote index and rank for found matches. This is error-prone since they can't easily be distinguished.

@masterleinad masterleinad force-pushed the use_strongly_typed_index_rank_in_tests branch from 9042f4c to 78fd0b6 Compare January 11, 2023 18:04
Copy link
Contributor

@aprokop aprokop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an awful lot going on in this PR, and I'm very confused. I thought the only thing that needed to be done was to introduce something like

struct PairIndexRank {
  int index;
  int rank;
};

@aprokop aprokop added the refactoring Code reorganization label Jan 11, 2023
@masterleinad
Copy link
Collaborator Author

masterleinad commented Jan 11, 2023

Everything in this pull request is a consequence/requirement for changing

using PairIndexRank = Kokkos::pair<int, int>;
using TupleIndexRankDistance = Kokkos::pair<Kokkos::pair<int, int>, float>;

to

struct PairIndexRank
{
  int index;
  int rank;
};
using TupleIndexRankDistance = Kokkos::pair<PairIndexRank, float>;

@aprokop
Copy link
Contributor

aprokop commented Jan 11, 2023

Everything in this pull request is a consequence/requirement for changing

I'm missing something. Why would you need to change the order of template arguments, for example, for this change?

@masterleinad
Copy link
Collaborator Author

masterleinad commented Jan 12, 2023

I'm missing something. Why would you need to change the order of template arguments, for example, for this change?

I need to specify all template arguments and if I revert the order I can at least omit the template parameters for Indexable and Predicates (at least for the non-parallel RTree; for the parallel Rtree the compiler picks the wrong overload when omitting those). So OK, this was a small drive-by improvement and not strictly necessary.

@aprokop
Copy link
Contributor

aprokop commented Jan 12, 2023

I need to specify all template arguments and if I revert the order

Again, why? For example, in Search_UnitTestHelpers.hpp you don't need ValueType template parameter, as you can do the same conditional as was done before, except for replacing Kokkos::Pair with a custom struct. I really don't understand why replacing Kokkos::pair<int,int> with IndexPair in some places requires these changes.

@aprokop aprokop closed this Jan 24, 2023
@masterleinad masterleinad deleted the use_strongly_typed_index_rank_in_tests branch January 24, 2023 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Code reorganization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants