YALMIP permits you to define variables using calls such as
and it expects that variable to be distinguished from
That can only happen if YALMIP is retaining state about which variables have been created and what their properties are.
In MATLAB, the methods of recording state like this are:
- in graphics objects (not likely at all to be the case here)
- in the base workspace
- in persistent variables
- in global variables
- in handle objects
- in class variables
However, graphics objects, base workspace, persistent variables, and global variables are not copied to parallel workers.
Objects (that are plainly referenced) are copied to parallel workers, but through a method equivalent of "save" and "load" --- a process that copies only serializable data, and loses dynamic properties, and effectively disconnects the copied clones from the original objects.
I suspect that the code was not designed with parallel use in mind.