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

unit tests repartitioner #152

Merged
merged 3 commits into from
Sep 27, 2024
Merged

Conversation

chihta-wang
Copy link
Collaborator

@chihta-wang chihta-wang commented Sep 10, 2024

This branch is based on impl/integration_06: https://github.com/hpsim/OGL/tree/impl/integration_06

Add 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.

ASSERT_EQ(res_spans_end, exp_spans_end[ranks_per_gpu][rank]);
}

TEST_P(RepartitionerFixture1D, can_repartition_sparsity_pattern_1D_for_n_ranks_unfused)
Copy link
Collaborator Author

@chihta-wang chihta-wang Sep 10, 2024

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?

Copy link
Collaborator

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

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;
Copy link
Collaborator Author

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?

Copy link
Collaborator

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.

return all_to_all_pattern.recv_offsets.back();
}

void fuse_sparsity(std::vector<label>& rows, std::vector<label>& cols,
Copy link
Collaborator Author

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?

};
};

/* @brief Test fixture class for 1D mesh
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
/* @brief Test fixture class for 1D mesh
/* @brief Test fixture class for 2D mesh

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}});
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
exp_local_spans_end.emplace(1, vec_vec{{5}, {5}, {5}, {5}});
exp_local_spans_end.emplace(1, vec_vec{{4}, {4}, {4}, {4}});

@chihta-wang chihta-wang requested a review from greole September 23, 2024 08:17
@greole greole changed the base branch from dev to impl/integration_06 September 23, 2024 18:23
Copy link
Collaborator

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

@chihta-wang chihta-wang force-pushed the impl/unit_tests_Repartitioner branch from 0bca61d to cedbeb3 Compare September 26, 2024 15:38
@greole greole merged commit 2901042 into impl/integration_06 Sep 27, 2024
6 of 15 checks passed
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 this pull request may close these issues.

2 participants