11-01-2014 09:47 PM - edited 11-01-2014 09:57 PM
Hello all,
I'm doing some image processing within a for loop. The loop runs to carry out the same process on all videos in a certain folder. I'm trying to figure out a way to configure the loop for parrallelism to speed up processing (since each video is independent of the rest). The idea is to be processing 8 videos at one time instead of sequentially. The problem I'm encountering however is that the IMAQ Create VIs are in the loop so the memory locations are continiously overridden by another instance of the loop. How would I make sure that each loop had its own memory location for storing the images?
I attached my VI (with for loop parallelism disabled).
I appreciate any advice.
Thanks!
11-01-2014 10:19 PM
I can't open your 2014 VI at the moment 'cause I'm neck deep in a 2013 project but I believe what you need is to make the called VI "reentrant". Each instance should have it's own data space.
11-03-2014 04:56 PM
Just glancing at your code, it appears the easiest thing to do would be just making the name of the buffer vary on each loop iteration (tied to the iteration terminal, for example). That way you aren't duplicating buffer names.
11-03-2014 07:34 PM
I actually thought about that. I think that is a good idea. I'll probably end up doing it.
Thanks!
06-22-2017 08:19 PM
If each parallel worker needs his own image (ala a scratch image), you can right click the "P" box on the parallel for loop structure. Then change the output of the "P" box to current instance ID. Use this ID in creating the image name, and you will have a unique image for each parallel worker.
-D