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 multithreading support? #59

Open
MikaelSlevinsky opened this issue Mar 13, 2018 · 3 comments
Open

Add multithreading support? #59

MikaelSlevinsky opened this issue Mar 13, 2018 · 3 comments

Comments

@MikaelSlevinsky
Copy link
Member

In Bogaert's paper, a billion GL nodes takes 11.0 seconds using his C++ implementation and 8 threads with 4 logical cores. Compare this to the 131 seconds for a billion and one GL nodes.

Threading should improve the computational times since all these methods are trivially parallel. Alternatively, this package could end up being a wrapper for low-level codes that have better thread support. For example, Bogaert's code is written in C++, but minor changes could have it rewritten as C.

@dlfivefifty
Copy link
Member

Have you done a profiling of the current gausslegendre? Is it Bogaert's method? (A citation should be added to the code.)

For single threads, there is pretty much no reason this kind of code would be faster in C than in Julia. But there seems to be some sillyness in the current implementation, e.g., constants like -65 / 1024 which may be evaluated every loop.

@MikaelSlevinsky
Copy link
Member Author

Note that issue is speculative since threading is still experimental in Julia. In my personal experience, Julia's experimental threading is still about a factor of 30% off from OpenMP paradigms and less flexible too.

As far as I can tell, the current implementation is a transliteration of Bogaert's method (though some terms in the series are pared down, and you're right about the constants that are fed into the macros).

For reference, here is the original C++ that appears to have been released in the public domain and here is a C version.

@AshtonSBradley
Copy link

are these threading comments still relevant? Julia's threading is pretty solid now. Anyone done any recent tests of timing?

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

No branches or pull requests

4 participants