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

OpenMP schedule dynamic for parallelForEdges #819

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

angriman
Copy link
Member

I recently used parallelForEdges to generate random weights on large graphs (1-2 billion edges). On a 36-cores machine, the performance was very poor (it took >1h) due to bad load balancing (during the last 30 minutes only a few threads were running).
The loop iterates over the nodes in parallel and each thread iterates over the neighbors of the current node, so the workload of a thread depends on the degrees of the nodes it processes (which might vary a lot).

Changing the schedule from guided to dynamic improved the load balancing and the performance significantly (the time dropped to a few minutes), which makes sense because with guided some thread might end up processing many more edges than others. So I think we should use dynamic as the default scheduling strategy for this loop.

@hmeyerhenke
Copy link

Have you tried other use cases with benchmarking results as well? Back then, we used guided because it was slightly faster than dynamic for the use case back then.

@angriman
Copy link
Member Author

I don't have detailed benchmark data. I can imagine that, on smaller graphs than the ones I am considering, the dynamic schedule has more synchronization costs so it performs slightly worse (but I am not sure about that).
It's probably worth investigating more on this aspect.

@hmeyerhenke
Copy link

I am not opposed to the change in principle. I would simply suggest to investigate and benchmark more use cases. Probably something for Lucas, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants