MATLAB: How to suppress this warning from spmd

MATLABparallel computingspmdwarning

I have an spmd statement running in a loop where one worker will use labBroadcast to send a message to the other workers. Occasionally the other workers will finish what they're doing before they receive the message. This isn't a problem except that when spmd finishes Matlab gives an warning of the form:
Lab 1:
Warning: An incoming message was discarded from lab 2 (tag: 400003)
I've tried using lastwarn to identify the warning after stopping execution, but it gives no output. I've also tried
pctRunOnAll warning('off','all')
outside the spmd statement and warning('off','all') inside the statement and yet the warning keeps being thrown. Because the spmd statement is in a loop, this message can appear hundreds of times during the execution of the script. How do I suppress these warnings?

Best Answer

I believe you can only hit this warning if you don't ensure that all workers call labBroadcast together. So, rather than suppress this warning, you should ensure that all workers make the same labBroadcast calls.