# Silence debug output from Parallelize?

I have this script, which does a bunch of image aligning in parallel: https://gist.github.com/8848a25a15da013ed1ad

However, on EVERY print, Mathematica also prints from what Kernel the message came and what the kernel's status is, etc. Is there a way to supress these debug messages?

Edit: The messages in question are these: https://gist.github.com/e8ae961dc46c66ed809f And example images are available here: http://dl.dropbox.com/u/10190786/done.zip

-
Have you tried Quiet[]? –  Ｊ. Ｍ. Feb 2 '12 at 10:59
I looked at its documentation, but i'm unsure where and how i would add it to my script. –  Mithaldu Feb 2 '12 at 11:44

It is the Check function which is throwing the error. Try using:

ParallelDo[
Do[Quiet@Check[{i[[1]], j[[1]],
FindGeometricTransform[i[[2]], j[[2]],
Transformation -> "Translation"]}, {i[[1]], j[[1]], err}], {i,
files}],
{j, files}]


If you leave off the Print command, it will silence all kernel outputs, and also speed up your computation (I'm sure other's could expound on this, but displaying outputs while running loops tends to slow things down). If you want to monitor the output of a parallel computation while it's running, check this SO post.

Edit Just realized that putting Quiet on Check kills the whole point of your computation. I think it would be best if you just do the calculation as a Table and extract the data at the end:

Quiet@ParallelTable[{i[[1]], j[[1]],
Quiet[FindGeometricTransform[i[[2]], j[[2]],
Transformation -> "Translation"]]}, {i, files}, {j, files}];


I'm not completely sure why I need both of those Quiet commands, but it seems to need it.

-
This looks promising. I used print because the goal here is to run these things on the command line and capture the output and because i know nothing about Mathematica. I only use it because it can do a single algorithm i need. Edit: Figured out that the ParallelTable bit needed a check to supress output on non-matches, now it's perfect. Thanks! :) –  Mithaldu Feb 2 '12 at 18:26
Once that table is generated, you can always Export or Put or DumpSave to get at the results. –  Eli Lansey Feb 2 '12 at 20:02
I just Printed it, since i post-process with Perl it's all fine. :) –  Mithaldu Feb 2 '12 at 20:17

Have you tried

Quiet[Parallelize[
Do[Do[Print@
Check[{i[[1]], j[[1]],
FindGeometricTransform[i[[2]], j[[2]],
Transformation -> "Translation"]}, {i[[1]], j[[1]], err}], {i,
files}], {j, files}]]]


in your code? (ie, just silence all messages)?

-
if this does not work, could you provide examples of files that do give the error? Because I tried with files = {{"n1", Polygon[{{1, 0}, {0, Sqrt[3]}, {-1, 0}}]}, {"n2", Polygon[{{1, 0}, {0, Sqrt[3] - 0.5}, {-0.5, 0}}]}} and I get no messages. Also, it is possible to prevent only certain messages from being displayed (which is probably best so that you can see if something actually goes wrong) –  acl Feb 2 '12 at 14:06
Example images are available here: dl.dropbox.com/u/10190786/done.zip I also added a link to a paste of the messages that are annoying me. And well, adding Quiet around the Parallelize did nothing for me. :/ If it makes any difference, i'm using Mathematica 8 on Windows. –  Mithaldu Feb 2 '12 at 14:47

For anyone coming here looking for how to get rid of seemingly garbage messages like this when running parallel kernels in -script mode:

StringForm[From 1:, ParallelKernelskernel[ParallelKernelsPrivatebk[
SubKernelsLocalKernelslocalKernel[SubKernelsLocalKernelsPrivatelk[
-noinit -mathlink, SubKernelsLocalKernelsLowerPriority -> True},
SubKernelsLocalKernelsPrivatespeed$2381]], ParallelKernelsPrivateid$2384, ParallelKernelsPrivatename$2384], ParallelKernelsPrivateek [ParallelKernelsPrivatenev$2385, ParallelKernelsPrivatepb$2385, ParallelKernelsPrivaterd$2385], ParallelKernelsPrivatesk
[ParallelKernelsPrivateq$2386, ParallelKernelsPrivaten0$2386,
ParallelKernelsPrivaten1$2386]]]  This is because the -script mode defaults to returning everything in InputForm mode, which does not work to well in this case. The workaround, add this at the beginning of your script: SetOptions[$Output, FormatType->OutputForm];
`