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

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)

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

Products

Release

R2018a

Asked:

on 16 Jul 2018

Answered:

on 17 Jul 2018

Community Treasure Hunt

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

Start Hunting!