Context
I am trying to parallelize a function which is verbose, and which as a consequence Mathematica does not seem to treat in parallel when doing something
like ParallelTable[fun[i],{i,16}]
, which does not run faster than Table[fun[i],{i,16}]
even though the evaluation of fun[i]
should be independent.
I think I have pinned down the problem to not being able to prevent subKernels to
talk to the masterKernel when the function fun
wants to Print
and/or Monitor
things.
Question
Let's say I have a function
fun[x_] := (Print[x]; x)
I would like to be able to do something like
Table[fun[i] // Quiet, {i, 6}]
and get
{1,2,3,4,5,6}
Rather than
1
2
3
4
5
6
{1,2,3,4,5,6}
I other words is there a
SuperQuiet
function which catches all outputs from it argument?
I hope this makes sense?
Update
What about the situation where the dialog proceeds via
Monitor
?
Say if I have a function
fun[x_] := Monitor[x,x];
Can I also prevent the Call to Monitor to operate so that I can efficiently do
ParallelTable[f[x],{x,10^4}];