-
Notifications
You must be signed in to change notification settings - Fork 21
Setting default algorithm to discover the communication graph #213
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
Conversation
|
Hi @JordiManyer, Is is going to generate a Preferences.Toml file if a user does nothing? |
|
Hi @fverdugo , not at all. The local file only gets created if the defaults get changed, like for MPI.jl. Otherwise the package bahaviour is unchanged and the user does not notice. |
|
Good! Can you then fix the documentation? It is failing to build. |
|
Yes, Ill do some final changes if you are happy with the overall concept. Some questions:
|
|
Hi @JordiManyer The other option is changing the default method (1 line of code) if it has been well tested. |
|
Hi @fverdugo I would not do that. I believe the new function is robust and has been tested well, but I would still keep the old one as default. The new method is not compatible with non-distributed arrays (this includes |
|
OK. Then let us go with the preferences approach. The method can also be changed at runtime with the current API if needed, right? If so, it looks good to me. |
Yes! you can always provide an alternative to I have updated the documentation, hopefully everything is OK now. I've added a couple of docstrings to make everything a little more coherent and added it to the I would say this is ready for review and merge. |
|
Hi @JordiManyer If you update the Project.toml and CHANGELOG.md with a new patch version, I can then register it right away after the merge. |
The current default algorithm to discover non-symmetric communication graphs is based on a gather-scatter algorithm. This works great for small communicators, but becomes prohibitive for large problems. The other available algorithm works great, and greatly reduces the amount of memory needed on the master processor.
Although there is technically a way to choose which algorithm you are using, it is extremely tedious and you have to go very low-level to actually be able to change it.
The option I've been using is to overwrite the
default_find_rcv_idsfunction on my packages, but this breaks precompilation and is nothing more than a hack.Due to this, I propose adding a compile-time preference through the Julia-standard Preferences.jl package. This changes the default behaviour of PartitionedArrays and sets the other algorithm as default.
The changes have zero impact on performance, since everything is done at compile time by using @static if-else statements.
Let me know what you think @fverdugo