CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   I want OpenFOAM to email me when it's done, is this too much to ask?!? (https://www.cfd-online.com/Forums/openfoam-post-processing/117621-i-want-openfoam-email-me-when-its-done-too-much-ask.html)

immortality September 7, 2013 08:16

its the result of "mail" command.
Code:

ehsan@Ehsan-com:~$ mail
Mail version 8.1.2 01/15/2001.  Type ? for help.
"/var/mail/ehsan": 6 messages 6 new
>N  1 MAILER-DAEMON@gma  Wed Sep  4 15:50  73/2146  Undelivered Mail Returned t
 N  2 MAILER-DAEMON@gma  Thu Sep  5 01:39  127/4777  Undelivered Mail Returned t
 N  3 MAILER-DAEMON@gma  Thu Sep  5 01:40  193/5449  Undelivered Mail Returned t
 N  4 MAILER-DAEMON@gma  Thu Sep  5 01:44  193/8041  Undelivered Mail Returned t
 N  5 MAILER-DAEMON@gma  Sat Sep  7 15:44  67/2088  Undelivered Mail Returned t
 N  6 MAILER-DAEMON@gma  Sat Sep  7 16:32  67/2069  Undelivered Mail Returned t
&


karlamora March 19, 2014 05:37

Quote:

Originally Posted by wyldckat (Post 426987)
Hi Jose,

Well, it all depends on how you ran the case in the first place... if you used an Allrun script, identical to OpenFOAM's tutorials, then you can try adding this to the end of the script:
Code:

echo "Sending separate email with the simulation status..."
  (
    echo "Case in question:"
    head -n 20 log.$application
    echo
    echo
    echo
    echo
    echo "Last 100 lines of the output for the solver $application:"
    echo
    tail -n 100 log.$application
  ) | mail -s "Summary Report from the case $PWD" yourname@email.address

The mail application can be one of several. In my case, I use the package "bsd-mailx" on Ubuntu.

The "$application" variable is sometimes defined in Allrun scripts... for example in "tutorials/incompressible/pimpleFoam/TJunctionFan/Allrun": https://github.com/OpenFOAM/OpenFOAM...tionFan/Allrun

Best regards,
Bruno

Hi Bruno,

I am not using the Allrun option because the university server doesn't allow it. What other option do I can use to send me an email? Is there another script where I can add this command?

Regards

Karla

wyldckat March 23, 2014 15:46

Greetings Karla,

You should ask about this to the system administrator for the server you're using, because the job scheduler that the server uses should have an option to send you an email when the simulation is complete.

If not, it's possible that the server doesn't even allow sending emails from the master node. But if it does, it's a matter of unravelling the code on the example you've quoted, into something like this:
Code:

mpirun -np $NPROCS mySolver -parallel > log.mySolver 2>&1

mail -s "Summary Report from the case $PWD" yourname@email.address < log.mySolver

Best regards,
Bruno


All times are GMT -4. The time now is 15:37.