Is there a way to skip serializing for specific objects in a parfor loop

4 views (last 30 days)
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?

Answers (1)

Edric Ellis
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).

Categories

Find more on Parallel for-Loops (parfor) in Help Center and File Exchange

Products


Release

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!