You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes one wants to choose whether to use multiple threads in a loop based on some runtime criteria. rayon-cond does the code duplication with a macro hidden behind a nice interface.
@mtreinish pointed to these sections that could be cleaned up this way.
Unfortunately, rayon's par_iter iterates over items in a collection, but rayon-cond's CondIterator iterates over references to items. So code has to be changed a bit when modifying to use rayon-cond.
Finished examples of making this work are here #815 and reference therein.
It looks like at least some of the items in the opening comment above are still relevant.
See this comment:
#428 (comment)
Sometimes one wants to choose whether to use multiple threads in a loop based on some runtime criteria. rayon-cond does the code duplication with a macro hidden behind a nice interface.
@mtreinish pointed to these sections that could be cleaned up this way.
https://github.com/Qiskit/retworkx/blob/main/src/shortest_path/floyd_warshall.rs#L189-L216
https://github.com/Qiskit/retworkx/blob/main/src/shortest_path/floyd_warshall.rs#L117-L140
https://github.com/Qiskit/retworkx/blob/main/src/shortest_path/average_length.rs#L65-L72
https://github.com/Qiskit/retworkx/blob/main/src/shortest_path/distance_matrix.rs#L73-L84
The text was updated successfully, but these errors were encountered: