LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why is CPU usage low on an intensive application?

Ben posted this gem some time ago.  The info should still be valid. 

 

See This kb acticle for the inside scoop

 

The OS and some kernal level divers may impose limits unknown to LabVIEW.


"Should be" isn't "Is" -Jay
0 Kudos
Message 11 of 26
(1,082 Views)

sure, I'll post some code tonight.  Thanks!

0 Kudos
Message 12 of 26
(1,073 Views)

rothloup wrote:

I'll let you know that exact CPU model when I get back to the computer later tonight, but it's an 8-core Intel.


Thanks. I wonder if it is 8 real cores or 8 virtual cores (i.e. 4 hyperthreaded cores).

 

I have a Dual Xeon E5-2687W (16 cores total, 32 when counting hyperthreading) and have no problems keeping all cores busy using LabVIEW.

0 Kudos
Message 13 of 26
(1,055 Views)

ok, here is my CPU info:

 

Intel(R) Core (TM)

i7-2630QM CPU @ 2.00 GHz

 

Some more info:

Windows XP Pro, Service Pack 3

Labview 2012

0 Kudos
Message 14 of 26
(1,026 Views)

ok, here are some code snippets.

 

The first one is the main loop.  I've cut out the larger loop, which would just clutter things up.  This is where all the computation takes place.

 

The first two VIs, where one is stacked on top of the other, run in parrallel.  They simulate the various objects (one reader, lots of ID Tags) that exist in the simulation. The next two VIs (inside the diagram disable structure) essentially just loop over all of the objects and either read or write a single value to each object.  That code is shown in the 3rd and 4th snippets.  (4th snippet in next post - I guess I'm limited to three attachments).

 

The "Calc Num Threads.vi" is just a wrapper around the "CPU Information" vi that tells me how many logical processors are available.  It returns 8 on this system.

 

Thanks for any help.  Let me know if I should post any more code or information.

 

 

 

 

Download All
0 Kudos
Message 15 of 26
(1,023 Views)

4th snippet.

 

The read/write VIs in this snippet and in the previous posting titled "Response to ID Tags"  are the basic data-accessor VIs that LV automatically creates in an object-oriented program.

 

I've also included a snapshot of my task manager while the program is running.  Nothing else is running at the same time.

 

 

 

Download All
0 Kudos
Message 16 of 26
(1,020 Views)

rothloup wrote:

i7-2630QM CPU @ 2.00 GHz


That CPU has only 4 cores.

0 Kudos
Message 17 of 26
(998 Views)

Isn't the default in a parallell loop max 4 threads? That'd explain the 50%. Try changing some loop properties to 8 and see if there's any difference.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 18 of 26
(970 Views)

Yes, if I recall the default was 4, but I changed them all to be 8.  and I wire the number of logical processors to the "P" input, which in my code, is returned as a value of "8" by the Labview "CPUINFO" function.

 

I re-checked all the loops to confirm that none of them are set to less than 8.

 

but I wonder if there is another, more well-hidden setting somewhere which is limiting the number of parrallel loops?

 

Thanks for the suggestion.  

0 Kudos
Message 19 of 26
(947 Views)

ok, you're right, good catch!  I was just counting the number of graphs in the task manager.

 

I guess it's one graph per logical processor, right?  So i've got 4 cores but each core is shared across two CPUs?

 

If so, then it seems that the problem might be related to how well the OS and/or Labview is hyper-threading the work.

 

any clue as to how I can troubleshoot or improve that?  Or is that not the right path to explore?

 

Thanks!

0 Kudos
Message 20 of 26
(946 Views)