Re: Recommendation for parallelism with nested for loops?

2022-08-20 Thread Christian Köstlin via Digitalmars-d-learn
On 20.08.22 12:28, Christian Köstlin wrote: On 19.08.22 03:49, Shriramana Sharma wrote: Hello. I want to parallelize a computation which has two for loops, one nested within another. All inner-loop-param+outer-loop-param combinations can be computed independent of one another. As I suspected,

Re: Recommendation for parallelism with nested for loops?

2022-08-20 Thread Christian Köstlin via Digitalmars-d-learn
On 19.08.22 03:49, Shriramana Sharma wrote: Hello. I want to parallelize a computation which has two for loops, one nested within another. All inner-loop-param+outer-loop-param combinations can be computed independent of one another. As I suspected, [https://forum.dlang.org/post/xysyidbkjdinc

Re: Recommendation for parallelism with nested for loops?

2022-08-19 Thread bachmeier via Digitalmars-d-learn
On Friday, 19 August 2022 at 02:02:57 UTC, Adam D Ruppe wrote: Even if they aren't equal, you'll get decent benefit from parallel on the outer one alone, but not as good since the work won't be balanced. Unless there's some kind of blocking going on in D's implementation, if the number of pa

Re: Recommendation for parallelism with nested for loops?

2022-08-18 Thread Ali Çehreli via Digitalmars-d-learn
On 8/18/22 18:49, Shriramana Sharma wrote: > Hello. I want to parallelize a computation which has two for loops An option is to add tasks individually but I am not sure how wise doing this and I don't know how to determine whether all tasks are completed. In any case, Roy Margalit's DConf 2022

Re: Recommendation for parallelism with nested for loops?

2022-08-18 Thread Adam D Ruppe via Digitalmars-d-learn
On Friday, 19 August 2022 at 01:49:43 UTC, Shriramana Sharma wrote: Also, what is the best way to do parallelism in such a situation? If the inner loops are about the same size for each pass of the outer loop, you can just simply parallel on the outer loop and get the same benefit. Even if

Recommendation for parallelism with nested for loops?

2022-08-18 Thread Shriramana Sharma via Digitalmars-d-learn
Hello. I want to parallelize a computation which has two for loops, one nested within another. All inner-loop-param+outer-loop-param combinations can be computed independent of one another. As I suspected, [https://forum.dlang.org/post/xysyidbkjdinclmrx...@forum.dlang.org](this forum post) sa