LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unexpected behavior when running parallel while loop on quad core

Hello,

 

I am working on a record and playback application. Well, I use the producer/consumer architecture to stream from hard drive to USRP. Surprisingly, the while-Loops do not to work parallely. Astoundingly, when both loop are running, just 3% of processor power is used. then, I turn the producer down and the consumer uses 25% of processor power; hence works properly.

 

How can I assign each loop to a processor?

Is it possible in labVIEW without the help of timed while loop? since even using timed while-loop do not solve the problem.

I am working on intel core i5-2500 @ 3,3GHz processor and LabVIEW 2013 SP1 is installed.

A similar issue was reported on the thread here. just that in my case LabVIEW doesn't crashes. Only the performance of individual loops drops.

 

You find my VI attached to this Post!

 

Thanks for your help

Bolivar

0 Kudos
Message 1 of 16
(3,450 Views)

Hi!

You can try using a parallelized for loop:

http://www.ni.com/white-paper/9393/en/

 

Regards,

Marco

0 Kudos
Message 2 of 16
(3,439 Views)

There's no VI attached to your post.

 

While loops will run in parallel if they have no inter-dependency. It will help greatly to see your code, so please try to attach your VI to a reply.

 

It is unlikely a parallelised for loop will help you unless your while loops are performing identical codes.

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 3 of 16
(3,433 Views)
0 Kudos
Message 4 of 16
(3,418 Views)

VIs sometimes have issues attaching to the forum.  Try zipping up the VI and post the zip file.


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 5 of 16
(3,414 Views)

Lets look at what you are doing.

 

From what I see you are reading from a file and streaming the data through a queue to a USRP.  Did I get that right?

 

And you want to stream large amounts of data from one core to another?

 

Now I'm not the expert on multiple core tech.. but I would not expect a data transfer produced by one core and consumed by another to be the fastest possible mechanism and, given that both loops are timed they cannot even share an "Execution" system.  The thread swapping must be unreal!

 

Now I'll sit back and wait for an expert so I can learn something today. 


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 16
(3,386 Views)

1.  Get rid of the Timed Loops.  You should be just fine with the normal While loops.  They will also run faster for you (ie: as fast as they can).

2.  What is happening inside of that Reset File.vi?  I'm hoping your just set the file pointer to 0 when you are at the end of the file.

3.  You have a comment in there about waiting to send another waveform to the queue.  That kind of breaks the point of the Producer/Consumer.  Why not just have it all in one loop?


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 7 of 16
(3,381 Views)

Hello Crossrulz,

I tried without timed loops as well and it doesn't work better.

The record process actually works with producer / consumer architecture. However, NI recommends this architecture when two or more processes running at different speeds exchange data among each other.

I'll try and see all together in one loop.

Thanks for your suggestion.

0 Kudos
Message 8 of 16
(3,366 Views)

Aristocrate wrote:owever, NI recommends this architecture when two or more processes running at different speeds exchange data among each other.

Is the read from file and the output to the USRP happening at different rates?  Based on that comment in your code, they are running at the same rate.  So it makes perfect sense to put them together and greatly simplify your VI.


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 9 of 16
(3,358 Views)

Hi Aristocrate,

can you post your Vi for Labview 2011SP1, please?

Thanks in advance,

Marco

0 Kudos
Message 10 of 16
(3,341 Views)