09-13-2012 07:50 AM
Hi!
I'm in the process of updating a system from LV8.6 running on Linux Ubuntu. At the beginning of the summer I tried to update to LV2011 but noticed a significant increase in CPU load when running a built application on computers with two processors (this was discussed on LAVA). I've now tried this with LV2012 with similar results.
To investigate further I made up a small example just doing simple math on random number in a loop and presenting the result, and I still see this increase in CPU load in LV2012 RTE compared to 8.6 RTE. With a wait value of 1ms in my while loop I get a load of 32% with 8.6 RTE and 69% with 2012 RTE (using "top" to measure). The findings from the LAVA thread shows that on a single processor computer the load goes down instead after the update, although I haven't tried that with my small example.
Attached is the code of the example in LV8.6.
Now to the questions:
Why does the CPU load increase on computer with multiple processors after the update from LV8.6?
Can this be reproduced on other platforms (Win or supported Linux distros)?
Do I need to be concerned if the program runs smoothly all the same (the computer is dedicated to this task)?
Thankful for any insights, thoughts or comments.
BR
Martin
09-18-2012 10:33 AM
What's the value of "milliseconds to wait" when you get 69% ?
On a Windows XP machine and Labview 2011 I have 69% load if I put a zero in "milliseconds to wait"
but, as expectied the load drops dramatically even waiting for 1 ms.
Marco
09-18-2012 10:34 AM - edited 09-18-2012 10:35 AM
Ops... you are waiting 1 ms.
What if you don't update indicators?
09-19-2012 07:04 AM
Thanks for you reply Marco!
It's not the absolute values of the CPU loads that concerns me, it's the increase in CPU load when updating from 8.6. I tried stopping the GUI updates in the experiments in the LAVA thread I mentioned, that still showed a large increase after the update.
Martin
09-21-2012 01:24 AM - edited 09-21-2012 01:25 AM
Unfortunately I don't have a Linux box at hand now...
May I ask you to perform a couple of test starting from the vi you posted here?
1) Use a loop without any function inside except Wait(ms). Is the CPU load still high?
2) Increase "milliseconds to wait" to higher values (10,100,1000ms). How does the cpu load change?
In the applications I've developed in Labview 2010 for Linux I didn't have any issue with CPU load.
Marco
09-21-2012 02:55 AM
This might have to do with the way the "Wait" function works.
In 8.5 (I don't have 8.6 to test) a wait of 1ms actually waits nearly 2ms (at least on my system). A loop with 1ms wait running 1000 times takes 1.953s on my system.
In 2011/2012 the wait function seems to work correctly using a wait time of 1ms. The loop now takes 1.005s.
So I think what you see is a bug in the Wait function in older LV versions.
09-21-2012 04:36 AM
I tried with the same application but without the graph, this time on my development machine as my target isn't available right now. However, with the graph my development machine shows the same behaviour as earlier on the target, i.e. CPU load is heavier with LV2012 RTE than 8.6 RTE.
Without the graph I get very similar results between 2012 and 8.6 RTE:s, so the increase that I saw is in the GUI updating. I also tried with removing the math, just leaving an empty loop, which led to the same load as with the math function. In the tests in the LAVA thread i still had the graphs and some more GUI details although they were not updated, I never tried with a blank GUI. This feels reassuring, but raises a few other questions.
Has the scheduling of the GUI updates been changed a lot since 8.6?
Does LV RTE somehow know how much resources are available and will change the scedule for GUI updates once performance gets limited?
Dan_u, I tried to replicate your findings but I got similar results between 8.6 and 2012 (1.099 and 1.086 respectively).
Thanks Marco and dan_u for your help and suggestions.
Some measurements on CPU load on different RTE:s:
td p { margin-bottom: 0in; }p { margin-bottom: 0.08in; }
Wait |
8.6 |
2012 |
Graph and maths |
||
0 ms |
53.00% |
60.00% |
1 ms |
9.00% |
19.00% |
10 ms |
4.00% |
6.00% |
100 ms |
1.00% |
1.00% |
No graph |
||
0 ms |
50.00% |
49.00% |
1 ms |
2.00% |
3.00% |
10 ms |
0.00% |
0.00% |
100 ms |
0.00% |
0.00% |
Empty loop |
||
0 ms |
50.00% |
49.00% |
1 ms |
2.00% |
2.00% |
10 ms |
0.00% |
0.00% |
100 ms |
0.00% |
0.00% |