-
Notifications
You must be signed in to change notification settings - Fork 12
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
unit tests repartitioner #152
Conversation
unitTests/Repartitioner.C
Outdated
ASSERT_EQ(res_spans_end, exp_spans_end[ranks_per_gpu][rank]); | ||
} | ||
|
||
TEST_P(RepartitionerFixture1D, can_repartition_sparsity_pattern_1D_for_n_ranks_unfused) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are unfused case and fused case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fused means that all interfaces/submatrices are recombined into a single local and non-local matrix
unitTests/Repartitioner.C
Outdated
exp_local_dim_rows.emplace(2, vec{2 * local_size, 0, 2 * local_size, 0}); | ||
exp_local_dim_rows.emplace(4, vec{4 * local_size, 0, 0, 0}); | ||
|
||
std::map<label, vec_vec> exp_local_mapping; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does local_mapping
mean in this context?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the mapping maps between the order on the OpenFOAM side and the ginkgo matrix.
src/Repartitioner.C
Outdated
return all_to_all_pattern.recv_offsets.back(); | ||
} | ||
|
||
void fuse_sparsity(std::vector<label>& rows, std::vector<label>& cols, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this function is not complete?
unitTests/Repartitioner.C
Outdated
}; | ||
}; | ||
|
||
/* @brief Test fixture class for 1D mesh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* @brief Test fixture class for 1D mesh | |
/* @brief Test fixture class for 2D mesh |
unitTests/Repartitioner.C
Outdated
4, vec_vec{{0, 16, 17, 18, 19, 20, 21}, {}, {}, {}}); | ||
|
||
std::map<label, vec_vec> exp_local_spans_end; | ||
exp_local_spans_end.emplace(1, vec_vec{{5}, {5}, {5}, {5}}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exp_local_spans_end.emplace(1, vec_vec{{5}, {5}, {5}, {5}}); | |
exp_local_spans_end.emplace(1, vec_vec{{4}, {4}, {4}, {4}}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also made a lot of edits to this file on a separate branch. Now I figured that it might make sense to create separate implementation files for the tests because otherwise the files will grow quite a lot. Please move your implementation to unitTests/Repartitioner2D.C
2D Repartitioner Fixture.
…te file named Repartitioner2D.C
0bca61d
to
cedbeb3
Compare
This branch is based on
impl/integration_06
: https://github.com/hpsim/OGL/tree/impl/integration_06Add a unit test for repartitioning of 2D sparsity pattern for the unfused case.
In the unit test, the Act and Assert sections are the same as they are in the unit test for repartitioning 1D sparsity pattern for the unfused case.
Some assert statements failed, but it seems that expected results are correct.