Sep 23, 2009

Monitor Mathematica computation with email

One of the new features in Mathematica 7.0 is allowing the sending of email directly from  any Mathematica program. It turns out very convenient for the certain situation. We have some computation tasks take long time to finish, so we  let it run on the server. The problem is that once a while I have to ssh to the server to check the outputs to make sure nothing wrong with the computation. Now with the email function, I can get the update immediately for each computation step. This is really helpful, especially now days you can check the email almost everywhere.

Picture 1

If you don’t need to check the detail, sending the update through the twitter is probably more cool.

One thing I am not sure is that how to catch the error. If there is an error raised during the computation, the math kernel can automatically send out the email with the error message, this function will be perfect.

By the way, this week I am working on an algorithm related with the Traveling Salesman Problem. If you check TSP on MathWolrd, download the notebook, you will notice it is created by a newer version of Mathematica. Open the file with any text editor, you will see:

(* CreatedBy='Mathematica 8.0' *).

3 comments:

Sander Huisman said...

Mathematica 8.0 => Nice find! Although we'll knew that some time Mathematica 8 would be released ;-)

Croninfam100 said...

This is great! Could you please email me?

Anonymous said...

You could do something like this,

Quiet@NDSolve[{x'[t]==x[t,s],x[0]==0},x,{t,0,1}];

err = Messages[NDSolve]
{HoldPattern[NDSolve::dvlen]:>The function `1` does not have the same number of arguments as independent variables (`2`).}

Email the error messages in err. You could also wrap Messages in Dynamic[] and get the updated error messages.