LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Low Processor Utilization

Solved!
Go to solution

Hi,

 

I am trying to write code that does a little bit of array manipulation and some simple trig to do something fairly time critical. I noticed that the processor utilization on my machine was awfully low, never really exceeding 50%. Perplexed, I tried to write some very simple code (an infinitely run while loop doing some simple math to the iteration counter) and ran that. Even with this simple code, the processor utilization did not improve. As stated before, I'm trying to write something fairly time critical, so the higher utilization, the better.

 

The computer I'm running this code on is admittedly not the top of the line - an Intel Atom Z530 1.6GHz with 1GB of RAM. However, I'm fairly limited in my choice of hardware (note that memory utilization is no where close to pegged, either - with my code, and the simple loop).

 

Is there anything I can do to increase utilization? I've tried turning debugging off, with limited luck.

 

Thank you.

0 Kudos
Message 1 of 10
(4,292 Views)

By the way, I think this is related to the hyperthreading and Windows really reporting that I have full utilization on one thread. To take advantage of my hardware, I'm taking it running things in parallel would be necessary?

0 Kudos
Message 2 of 10
(4,287 Views)

It would help if you could post your code.  Guessing what might be happening is not very productive.

 

LV makes it very easy to run things in parallel.  To get the best performance from the parallel threads does require some care.

 

Lynn

0 Kudos
Message 3 of 10
(4,283 Views)

a very simple solution would be introducing a bit of time delay in your while loop would reduce the CPU usage.... try with just as less as 20 wired to a (wait for ms) vi..

LV 8.0, 8.6, 2011,2012,2013 WinXP
0 Kudos
Message 4 of 10
(4,274 Views)

check this..no delay.JPGdelay.JPG

LV 8.0, 8.6, 2011,2012,2013 WinXP
0 Kudos
Message 5 of 10
(4,273 Views)

@rcollins wrote:

I am trying to write code that does a little bit of array manipulation and some simple trig to do something fairly time critical. I noticed that the processor utilization on my machine was awfully low, never really exceeding 50%.



Well, 50% is within a factor of two of the max you can possibly get and that's not bad. ;).

 

In terms of math, that atom of course sucks. While it is hyperthreaded, it only has a single core and a very small cache (the advantage is that it only uses 2W of power). Trying to maximize CPU usage if of course the wrong approach. You might be able ot speed the time critical computations up by a factor of 10 by using a better algorithm. 😉

 

What is the exact OS version? Can you get it to 100% CPU if you run two parallel while loops without waits?

 

I agree with Lynn, show us some code....

0 Kudos
Message 6 of 10
(4,265 Views)

1 while loop will fully load 1 core. I assume you're running on a Core 2 Duo or similar, thus you get 50%, 1 at 100% + 1 at 0% ==> 50% total utilization.

 

If you make it a for loop you can r-click and set it up for parallell loops, thus loading all cores. However, spinning wildly isn't the best way to achieve "time criticality".

 

What is it you're trying to achieve?

 

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 10
(4,261 Views)

@Yamaeda wrote:

I assume you're running on a Core 2 Duo or similar,


He said Intel Atom Z530, which has only one core.

0 Kudos
Message 8 of 10
(4,257 Views)
Solution
Accepted by topic author rcollins

Yeah i noticed that afterwards, Altenbach. However, as a HT-processor, doesn't the OS think it's 2 logical processors and thus 50%?

 

As you mentioned in your previous post, 2 while loops should confirm that.

 

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 9 of 10
(4,254 Views)

Yes, that's why I was asking about the OS version. maybe the task manager misinterprets the CPU information and 50% is in fact 100%?

 

I have extensive set of benchmarking data for many processors for the purpose of fitting EPR spectra in LabVIEW, among them an Atom N450. Compared to a Intel I7, the atom is 7-8x slower than even a single I7 core, and the disadvantage is even worse once the I7 is allowed to use multiple cores. Of course once the I7 run on all cores, it is problaby clocked down for heat management (no more turboboost).

 

(If anyone has a fancy unlisted CPU, feel free to test and e-mail me the results ;)).

0 Kudos
Message 10 of 10
(4,227 Views)