LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

parallel simulation

I have two sub VIs to run, which take a little longer to run.

What i mean is for example when both the blocks are given input signals at the same time, block A takes 10sec to run and then block B is taking 8sec to run.

What i want is to run the two blocks in parallel. That is, while block A is running block B should run in parallel so that over all it takes only 10sec for getting the output.

 Is it possible to do so and how?

I have a dual core processor.

0 Kudos
Message 1 of 6
(2,198 Views)

Vanteru,

 

By placing the sub vi's in parralel instead of in series they will run as quickly as the processor can handle them.

What I mean by parralel is that neither vi requires an input from the other.  The picture below shows two Means being calculated at the same time because neither requires an input that is an output from the other function.

 

Parallel subVIs.JPG

0 Kudos
Message 2 of 6
(2,188 Views)

What i meant was some thing like this.(as shown).

 

I want the mean and variance blocks to run parallel.Capture.PNG

0 Kudos
Message 3 of 6
(2,185 Views)

They should already be running in parralel since the variance does not depend on any outputs from the mean, and the mean does not depend on any outputs from the variance.

0 Kudos
Message 4 of 6
(2,166 Views)

No its not running in parallel. Check for your self. Just place a sin and cos blocks and check with bulb symbol on. One of them is run first and then runs the second.

I want them both run at same time.

0 Kudos
Message 5 of 6
(2,161 Views)

The "bulb" symbol may cause the execution to be serialized. Have you tried just running the VI as fast as possible (no debugging) and then watching the cores to see if they are both getting activity?

 

Other things affect parallelism as well. For example, all of the sub VIs should be reentrant to ensure the sub VIs code does not behave like a critical section and block other callers. If those are native LabVIEW functions, they should probably already be reentrant.

0 Kudos
Message 6 of 6
(2,148 Views)