LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CLA-R Sample Exam Question 22


@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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 11 of 15
(576 Views)

@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.


"Should be" isn't "Is" -Jay
0 Kudos
Message 12 of 15
(552 Views)

@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.

0 Kudos
Message 13 of 15
(544 Views)

@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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 14 of 15
(538 Views)

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

Herrlin

Just trying to spread the LabVIEW love.
0 Kudos
Message 15 of 15
(528 Views)