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

multi-thread for-loop in hasTickets #596

Open
ultra-sonic opened this issue Mar 21, 2024 · 2 comments
Open

multi-thread for-loop in hasTickets #596

ultra-sonic opened this issue Mar 21, 2024 · 2 comments

Comments

@ultra-sonic
Copy link

Hey Timur,

we are still chasing performance over here at RISE and I think we have spotted a part of the afserver code that can potentially be mutli-threaded easily.

I am talking about the for-loop in the hasTickets function over here:

for (auto const& it : i_tickets)

This is one of the largest bottlenecks in the performance analysis from @sebastianelsner in #592

what do you think?

cheers
Oli

@timurhai
Copy link
Member

timurhai commented Mar 25, 2024

Hello, Oli!
If most time solving finds out tickets and this is read-only function, we can try to slit solving on reading and writing sections. Launch several threads to solve (for the entire solve and to read and to write) and block writing secions to run only by thie one thread at the same time. Yes, this is the easiest way, i think.

@ultra-sonic
Copy link
Author

we have just tried using OpenMP to multithread the hasTickets function but it seems that the overhead of spawning new threads is bigger than the benefit that the multi-threading would give.

Another solution could be a thread-pool to mitigate the overhead of frequent thread creation and destruction, especially with small task sizes.

Do you think this is a viable way to go?

cheers
Oli

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

No branches or pull requests

2 participants