02-11-2013 11:35 AM
@JÞB wrote:
@Intaris wrote:
Canyou even parallelise loops which don't have autoindexed inputs? I thought you could only properly paralellise a for this reason (As the loop is currently written).
Shane
Yes, you can. In all cases # of iterations must be determistic (No conditional terminal) but that is true for any for loop without a conditional terminal that does not break the compiler.
And there can't be any dependance of previous iterations. If doing in-place operations, the iterations are not dependant on the previous iterations.
02-11-2013 01:10 PM - edited 02-11-2013 01:12 PM
@crossrulz wrote:
And there can't be any dependance of previous iterations. If doing in-place operations, the iterations are not dependant on the previous iterations.
With 1 notable exception: You will get a warning if parallizing a for loop containing Random. because the seed is internal to the function there is a dependancy internal to the history of random calls. You'll still get the same values but in a different order in the output unless you enable debugging. (Forces sequential iterations) Trivia for the masses.
02-11-2013 01:22 PM
@JÞB wrote:
With 1 notable exception: You will get a warning if parallizing a for loop containing Random. because the seed is internal to the function there is a dependancy internal to the history of random calls. You'll still get the same values but in a different order in the output unless you enable debugging. (Forces sequential iterations) Trivia for the masses.
More than 1, there are a number of nodes that have side effects in parallel loops, not just Random. Off the top of my head I know of Get Date/Time in Seconds and Tick Count.
02-11-2013 01:26 PM
@JÞB wrote:
@crossrulz wrote:
And there can't be any dependance of previous iterations. If doing in-place operations, the iterations are not dependant on the previous iterations.
With 1 notable exception: You will get a warning if parallizing a for loop containing Random. because the seed is internal to the function there is a dependancy internal to the history of random calls. You'll still get the same values but in a different order in the output unless you enable debugging. (Forces sequential iterations) Trivia for the masses.
I wouldn't really consider Random to be dependent. You truely want something random after all. But it does make sense that it comes out as a warning due to random functions not truely being random.
02-11-2013 01:43 PM
Thank you everyone for the explanations. In the past I have just blindly looked at the shift registers and told myself that iteration parallelism would not be beneficial. I will be more attentive of the index and replace operation in future.
Thanks