3
$\begingroup$

I have an evaluation inside a Paralleltable which sometimes gives me warning messages. After a certain amount of warning messages it will say:

 General::stop :  "Further output of "General::munfl", "MessageName" will be suppressed during this calculation

Unfortunately, this message number limit seems to apply for each parallel kernel separately.

Now, since I calculate on a lot of parallel kernels and the specific message I get is kind of long, I get 10 pages worth of warnings (if I were to print them), so I was wondering whether there is some setting where I can customize how many error messages I want before the General::stop message.

I don't want to completely disable these warnings, which is the only advice I found so far, as it is helpful to know some warnings occured, but as it is now it is very cumbersome to delete all the messages manually each time.

If there is a way to have one kernel print the messages, and mute the others, that would also be a possible solution (At least in my use case, because if one kernel produces error messages, they all do, but this way of solving it might be less useful to other users who search for this problem). Is there a way to do that?

$\endgroup$
3
  • 2
    $\begingroup$ You could redirect your messages to a file instead of the front end - reference.wolfram.com/language/ref/$Messages.html - that way you can still view them but the front end won't become cluttered. $\endgroup$ – flinty Aug 26 '20 at 13:29
  • $\begingroup$ I don't have time to dig in, but a thought: Quiet[Check[{0^0, 0^0},"ERROR",Power::indet]] suppresses the message, but returns "ERROR" since Check is inside Quiet - this might be a way to generate one message for the whole calculation. $\endgroup$ – N.J.Evans Aug 26 '20 at 13:30
  • 6
    $\begingroup$ With the menu Mathematica | Preferences ... | Advanced | Open Option Inspector | Global Preferences | Global Options | Message Options | "MaxMessageCount" set value to 1 or whatever value you desire. $\endgroup$ – Bob Hanlon Aug 26 '20 at 14:21
0
$\begingroup$

As no one seems interested in answering (in an actual answer), I'll report what I did.

From another question, I got this tip:

ParallelTable[Off[General::munfl];your code here,{your iterator here}]

This turns off all messages unfortunately, but it's the best thing I found in my case.

The suggestion from Bob Hanlon in the comments

With the menu Mathematica | Preferences ... | Advanced | Open Option Inspector | Global Preferences | Global Options | Message Options | "MaxMessageCount" set value to 1

still yielded too much output in my case, but may be the better option for others.

The suggestion to redirect $Messages unfortunately only redirected output from the main kernel, not from the parallel kernels, which is my main problem here.

$\endgroup$
1
  • $\begingroup$ A few days ago I did something like what you seek here, but not in a parallelized evaluation. See the first code block that ends with Tally[Flatten@messages]. $\endgroup$ – Michael E2 Jan 2 at 5:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.