Is there a way to skip serializing for specific objects in a parfor loop
4 views (last 30 days)
Show older comments
I am running a parfor loop from a gui that utilizes check a widget called checkboxtree. The loop executes normally as a for loop. However in the parfor transfer to local workers. Data is serialized before it is transferred. In this process everything is being serialized. I am getting null pointing errors when serializing the checkboxtree. The checkboxtree is unused in the parfor loop. Is there a way to only serialize what I will be using in the parfor loop?
0 Comments
Answers (1)
Edric Ellis
on 17 Jul 2018
Recent versions of MATLAB (R2015b and later if my memory serves correctly) are usually pretty good at only sending stuff to the body of the parfor loop that is actually needed there. It might help further to "hide" your parfor loop inside a function, and make sure that function doesn't get passed the problematic data (i.e. ensure it's not present as a field of an object or struct).
0 Comments
See Also
Categories
Find more on Parallel for-Loops (parfor) in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!