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

Add parallelism to cloness_centrality #1392

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

IvanIsCoding
Copy link
Collaborator

This PR makes closeness_centrality and newman_weighted_closeness_centrality parallel for better performance. This is possible because the task is embarrassingly parallel.

We probably missed this in #593 but #1385 reminded me of it.

The parallelism is toggled via the parallel_threshold just like other centrality methods.

@coveralls
Copy link

coveralls commented Feb 28, 2025

Pull Request Test Coverage Report for Build 13946980567

Details

  • 89 of 89 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.5%) to 95.825%

Totals Coverage Status
Change from base Build 13938071754: 0.5%
Covered Lines: 18589
Relevant Lines: 19399

💛 - Coveralls

@IvanIsCoding
Copy link
Collaborator Author

Because #1387, I added a test to boost the coverage in the report. I am confident the Rust tests guarantee the correctness so for now that is a stop gap

@IvanIsCoding IvanIsCoding added this to the 0.17.0 milestone Mar 1, 2025
Copy link
Member

@mtreinish mtreinish left a comment

Choose a reason for hiding this comment

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

This LGTM, it makes a lot of sense to run this with rayon. Thanks for doing this. I just left a couple of comments inline the main one is I think we can do this without a mutex using a rayon iterator collection into the vec which should be faster..

@IvanIsCoding IvanIsCoding requested a review from mtreinish March 19, 2025 12:52
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.

3 participants