Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Parallel analysis using Particle Filter 2 (LV 8.2 Vision 8.2)

Hi
 
Im trying to optimize a slow vision analysis where the slowest part i a series of particle filter 2 (area) calls. Since it is running on a quad core computer I have been trying to make the code parallel - but with no speed gains.
 
Attached is an image of a test code I made. The parallel analysis is just as slow as the serial. I naturally set the vi property for particle filter 2 to reentrant and tried running the Dll in both UI thread and reentrant. I even tried to save particle filter 2 with two different file names (and calling each one). None of these things made the parallel code run faster than the serial.
 
Its currently running on a Intel core 2 duo (T7200) cpu.
 
The image is a 6 megapixel U8 image.
 
The execution time is almost equal (withing 10%) for the two parts, so I dont think it is memory limited.
 
Hope you can help me
 
/Simon
 
 
0 Kudos
Message 1 of 7
(4,046 Views)
The only other thing I can think of to try is to put each particle filter in its own timed sequence block so you can assign it a processor to use.  This way at least you know for sure that you are using more than one processor.

Have you timed the two in parallel particle filters independently to verify they are still processing sequentially?




Randall Pursley
0 Kudos
Message 2 of 7
(4,037 Views)

Thanks for the quick responce.

The serial processing is ensured by the error cluster in the first two filters.

Putting the two parallel filters in two separate sequence structures does not help on execution speed (just tried it).

/Simon

0 Kudos
Message 3 of 7
(4,034 Views)
How do I assing the timed sequence to a particular cpu?
0 Kudos
Message 4 of 7
(4,032 Views)

Having converted to 8.5 (where it is possible to assign to a cpu) and using timed sequence selecting cpu 0 and 1 respectively I found no performance improvements.

Again reentrant execution was selected and the dll run in the UI thread (it was very slow in the parallel case when any thread was selected)

I wonder why this seems so hard. Is reentrant execution not posible for this dll? (or just the function in the dll)

By the way I corrected the error in the image naming scheme, and wired i into "Number to decimal string". It didnt change anything though (speed vise).

/Simon

0 Kudos
Message 5 of 7
(4,029 Views)
I also did a little testing and found when the vi is not reentrant, it only took ~15 ms to run (so for two filters it took 30 ms).  I timed each separately and the second took approximately twice as long to execute which is what would be expected.

When I switched them to reentrant mode, they did run in parallel, but they each took ~35 ms to run.  I haven't figured out why it took longer to execute in reentrant mode, but it appears that it does.  Maybe the dll call cannot be reentrant.

This is with a dual dual-core Xeon processor computer with 3 GB of RAM.


Randall Pursley
0 Kudos
Message 6 of 7
(4,019 Views)
In desperation I tried making two copies of the dll linked to by two copies of particle filter 2, it did however not work - LV gave an error "The procedure entry point IsImage could not be located in the dynamic link library nivissvc.dll".
Im all out of idears by now....
 
Thanks for looking into my little issue
 
/Simon
 
0 Kudos
Message 7 of 7
(3,995 Views)