02-05-2009 02:49 PM - edited 02-05-2009 02:51 PM
The following two code segments work faster on my 1.75ghz single core processor (1gb ram) than it does on another computer with 4 1.87ghz processors (8gb ram), and I cannot figure out why for the life of me.
In the first bit of code I made the smooth vi reentrant, and they do not depend on each other in anyway, so I would expect them to be running in parallel.
In the second bit of code I have 3 mathscripts which are not dependant on each other, so I would also expect them to run in parallel.
Does anyone have any ideas/suggestions on why it doesn't work?
Thanks,
Tim
02-05-2009 03:36 PM - edited 02-05-2009 03:38 PM
How do you measure execution time? What is the actual speed difference? How large are the arrays (how long does each subVI take)? What's inside the subVIs? What is the CPU usage? What is the exact model of each processor? (Intel vs. AMD, cache size, etc.). What else is different between the two PCs (I assume the one with 8GB if RAM uses a 64 bit OS, for example). What is your LabVIEW version?
Can you attach some code?
02-05-2009 03:53 PM
The contents of the subvi are actually just the mathscripts that you see under them. I have the code configured in two ways. One way uses the 4 subvi calls on 4 separate arrays. The other way calls the subvi once on one array which is a combination of the other four.
The attached vi is what is pictured as smooth. It contains three mathscript structures which operate on the beginning, middle and end of the input array. This is the second configuration I described above.
Another way I do it, to see if it works better or runs faster, is to take the components that go into the 1d array above, and run the algorithm on each of them. The interesting portion of the code is pictured above.
Details:
The arrays are 283x129.
I measure execution time by running them and seeing which one finishes first. They take a very long time to run. A couple minutes generally.
The processor on the single processor computer is a 1.73 GHz Intel Pentium M, it's in my laptop.
The multicore processor is a I.87 GHz Intel Xeon dual core
Both computers are running 32 bit OS. The laptop is XP, the big one is Vista.
Assume the big one has at least as much cache as my laptop, I'm sure it has much more.
Both computers are running LV8.6
02-05-2009 05:47 PM
Well, I also get only a very small speed increase with reentrant settings on a dual core (~5%) so it seems that the bulk of the mathscript code is not reentrant and setting the subVI to reentrant does not do much. What are typical values for the scalar inputs? (I get errors unless they are zero, but I have not really looked into this)
For further clarification, you might want to discuss this in the Mathschript forum).
When speed matters, mathscript should not be the first choice anyway. Can you tell us a little more about the algorithm? Smoothing a signal should not require that much code!!! I am sure this could be done orders of magnitude faster with a built-in functions or some simple graphical code. How big are your input arrays?
02-05-2009 05:53 PM
The algorithm is what I was describing in this other thread you were replying in http://forums.ni.com/ni/board/message?board.id=170&message.id=384152&query.id=203192#M384152
I know this can possibly be done much faster but I don't know anything about the smoothing functions within labview, or convolutions that you mentioned in the other thread.
If you have any suggestions I'd be very grateful.
The scalars you asked about r and c stand for row and columns. Therefore they should be (for my purposes) 283 and 129, which is the size of my arrays.
02-06-2009 03:01 PM
Hi else91,
Can you please answer the following questions?
1. How do you measure execution time?
2. How are you measuring the actual speed difference?
3. What processors are you using?
4. Do you have any other applications running at the same time?
02-06-2009 03:05 PM
I measure execution time by running them and seeing which one finishes first. They take a very long time to run, so it is easy to see which one finishes first. They usually take about 2 minutes to execute
The processor on the single processor computer is a 1.73 GHz Intel Pentium M, it's in my laptop.
The multicore processor is a I.87 GHz Intel Xeon, and there are two of them.
The other applications cpu usage is negligible.
02-09-2009 03:21 PM
Hi Else,
Thanks,
Karunya
02-09-2009 04:23 PM
02-09-2009 05:13 PM