|
I am working on some scripts to preform image analysis on folders
containing multiple images. To speed things along I am using parfor
loops (the results of one images' analysis does not affect the
analysis of any other images, so this should work).
The problem I am having is that each analysis cycle generates fairly
large arrays of data that are only needed for a small portion each
analysis loop (basically arrays storing intermediary values). Before
using the parfor (when I was just using for loops) I would clear these
arrays once I was done with them, as to avoid potential memory
overflow. However, when I do this in parfor loops, I get the
following caution:
"The function CLEAR might make an invalid workspace access inside the
parfor loop."
What I am wondering is if this means the 'clear' command will clear
the variable in all of the cores (threads?) being used for parallell
processing, rather than in just the one core/thread where the clear
command is being called. By which I mean, if I'm using a dual-core
machine (with cores 'a' and 'b'), calling 'clear' on 'a' will also
clear the same variable in 'b'.
If the above is the case, is there another command that clears the
variable only in one core/thread?
Thanx
Bryan
|