Quantcast
Channel: MATLAB Central Newsreader Recent Posts
Viewing all articles
Browse latest Browse all 19628

Re: labReceive goes to sleep

$
0
0
One good news and one not so good news.

The good news is that I found the solution. I suspected that the labReceive does not respond promptly and goes to sleep until all workers are done when the function is called without specific source. So I made the master worker to loop over the slave workers probing to see if there is any data ready to receive and call the labReceive with the specific source information. I tested this and it certainly works fine without any delay. Please see the additional code I put below.

            fprintf('[%1.1f] {%d} starts listening\n',toc(ticid),labindex);
            who = -1;
            is_data_available = 0;
            while ~is_data_available
                for i=2:numlabs
                   is_data_available = labProbe(i);
                   if is_data_available
                       who = i;
                       fprintf('%d is ready to send\n',who);
                       break;
                   end
                end
            end
            
            [data_large, source, tag] = labReceive(who);


The bad news is that this is clearly a bug in the labReceive function in the Parallel toolbox. Please check and fix he bug for the case when there is not specific source is an argument. And please keep me posted with the progress. Thank you so much.

Viewing all articles
Browse latest Browse all 19628

Trending Articles