CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   mpirun--> output be written in both Log file and Terminal (http://www.cfd-online.com/Forums/openfoam/84072-mpirun-output-written-both-log-file-terminal.html)

maysmech January 19, 2011 13:18

mpirun--> output be written in both Log file and Terminal
 
Hi,

How can i use parallel run and have output not only in log file, also in terminal window.

Only in log file:
Quote:

mpirun -np 8 icoFoam -parallel > log &
Only in terminal:
Quote:

mpirun -np 8 icoFoam -parallel

cnsidero January 19, 2011 13:31

Option 1) Try 'tee'. E.g.

Code:

mpirun -np 8 icoFoam -parallel | tee log
Check the man pages for 'tee'

Option 2) Redirect the output to a log file like for your first command:

Code:

mpirun -np 8 icoFoam -parallel  > log &
and then use the -f with 'tail' to view log file dynamically:

Code:

tail -f log
Option 3) Use screen:

Open an new screen:

Code:

screen
Launch your job:

Code:

mpirun -np 8 icoFoam -parallel
Detach your screen: CTRL+A+D

Reattach your screen to view your running job later:

Code:

screen -r
I prefer #2 if I'm running on a local workstation and #3 if I'm running remotely. 'screen' is the most flexible and powerful method - I would suggest spending some time to learn how to use 'screen'. Look in the man pages or check the web.

l_r_mcglashan January 19, 2011 13:37

Isn't dumping it all to both screen AND file a bit unnecessary? Why not output it to log and use 'tail log' to look at the log file? Or if you're interested in looking at residuals use foamLog / pyFoam.

maysmech January 19, 2011 15:30

Thanks, i will try to do your suggestions.


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