필터 지우기
필터 지우기

How do I suppress this warning from spmd?

조회 수: 3 (최근 30일)
Dom
Dom 2014년 1월 14일
답변: Peiyuan Zhai 2022년 3월 20일
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?
  댓글 수: 3
Dom
Dom 2014년 1월 14일
I'm running R2011a and actual warnings don't appear in orange text, only errors. When I run that command I get:
The last warning issued had an empty warning identifier, or no
warnings have yet been issued.
Niklas Nylén
Niklas Nylén 2014년 1월 14일
I also run 2011b and warnings appear in orange text. You can set the color in the matlab preferences.
By the looks of the output you provided, the message is not a usual matlab warning, and even if it is it does not have an identifier, which means you can not turn it off, if it does not work with the 'all' input.

댓글을 달려면 로그인하십시오.

채택된 답변

Edric Ellis
Edric Ellis 2014년 1월 14일
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.
  댓글 수: 2
Dom
Dom 2014년 1월 14일
Are there detrimental effects to having some workers not receive broadcasts?
Should I be using some other worker communication functions if I don't expect some workers to recieve communications, or will this happen for any method I try?
Edric Ellis
Edric Ellis 2014년 1월 14일
편집: Edric Ellis 2014년 1월 14일
You've already encountered the first detrimental effect - the warning. However, there's a more serious problem which you might encounter later. labBroadcast is built on top of MPI, and the MPI standard doesn't define when a method such as broadcast will block and when it will use buffering. Because you're using the default error-detecting mode of lab* communication, labBroadcast is using the implementation based on labSend and labReceieve; and fortunately for you the labSend portion is able to complete without the matching labReceive because of buffering.
If you ever get to the point where labSend cannot buffer the message because it's too large, you'll get deadlock (which may or may not be detected) or an erroring communication mismatch. In R2013b, this gives me an error:
parpool('local', 2);
spmd
if labindex == 1
labBroadcast(1, rand(1000));
end
end

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Ammar
Ammar 2017년 4월 21일
Hi guys, I have the same problem, any suggestion ?
This is the message:
Warning: An incoming message was discarded from lab 3 (tag: 0)
Kind regards Ammar

Peiyuan Zhai
Peiyuan Zhai 2022년 3월 20일
Try to add
warning('off','all')
after
spmd
but not before it. This works for me.

카테고리

Help CenterFile Exchange에서 Parallel Computing Fundamentals에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by