Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I am using ParallelMap for my code,however, it gives some messages that don't affect the evaluation process but fill up the memory and take some more time. So, I want to turn off all messages on all kernels. I used Quiet but it doesn't work.

Is there a way to switch off messages on all kernels?

Any help is appreciated. Thanks in advance.

share|improve this question
3  
One way is to include Quiet in the function that you are mapping. –  Szabolcs Jun 26 '13 at 8:56
    
Does Off[your message] help? –  Sjoerd C. de Vries Jun 26 '13 at 9:58
    
@Szabolcs Thank you, I don't get any more. –  cesm Jun 26 '13 at 12:27
    
@SjoerdC.deVries I tried it but it works only for the first kernel. –  cesm Jun 26 '13 at 12:28
    
@cesm To use Sjoerd's solution, you need to evaluate the Off[...] in each kernel separately, i.e. do ParallelEvaluate[Off[...]]. Don't forget to turn it back on if it might be useful! (I'd feel safer with using Quiet) –  Szabolcs Jun 26 '13 at 15:51

1 Answer 1

up vote 6 down vote accepted

You do it exactly as you would do it on the main kernel. Following example which throws a message when it divides by zero:

ParallelMap[1/# &, Mod[Range[30], 3]]

Some people prefer to switch specific messages off beforehand. This can be done with

ParallelEvaluate[Off[Power::infy]]
ParallelMap[1/# &, Mod[Range[30], 3]]

Or you use Quiet as suggested by Szabolcs directly in the function

ParallelEvaluate[On[Power::infy]]
ParallelMap[Quiet[1/#] &, Mod[Range[30], 3]]
share|improve this answer
    
Thank you,it's working :) –  cesm Jun 26 '13 at 12:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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