How to run solvers in the background
Hi all,
Is there any way to make openfoam run the solver in the background without outputting information on the terminal, nor outputting it to the log file? Especially when computing in parallel. Thanks in advance! |
i use the foamJob command. e.g. foamJob -parallel *solvername* then it runs in the Background, creating a log file. Type foamJob -help
Regards, fanta |
Quote:
In my colleague's opinion, writing the output information may slow down the calculation efficiency. However, using foamJob command still redirects the output to a log file. Therefore, I still wonder if there is a possible way to make solvers run in the background without writing output information neither to the terminal nor a log file? Or in OpenFOAM, the output information must be written into a log file while running solvers in the background? |
as i wrote, type foamJob -help, there is a command running it in the background without logfile:
foamJob -parallel -no-log |
Quote:
-case<dir>; -parallel; -screen; -append; -wait; -version<ver> and -help. The solver I used is olaFlow. After 'decomposePar', I tried ' foamJob -parallel olaFlow -no-log'. The information in the terminal is: Parallel processing using SYSTEMOPENMPI with 4 processors Executing: /home/zhr/OpenFOAM/OpenFOAM-4.1/bin/mpirun -np 4 -x FOAM_SETTINGS /home/zhr/OpenFOAM/OpenFOAM-4.1/bin/foamExec -prefix /home/zhr/OpenFOAM olaFlow -no-log -parallel > log 2>&1 At the same time, there is still a log file in the case directory which includes FOAM FATAL ERROR: Invalid option: -no-log FOAM parallel run exiting Thanks |
Hi,
im am using OpenFOAM v2012 and i am not familiar with OLAFLOW, but are you using OpenFOAM 4.1? I might be wrong, but as far as i remember the option -no-log was introduced in later versions of OpenFOAM. I am sorry i cannot help. |
Quote:
Best regards, Stan |
I don't think that there is any significant loss in efficiency by writing to the log files, for the vast majority of real-life simulations. Remember, much of your run time is typically spent solving the pressure equation, and the time taken to write to a disk log file should be negligible compared to this, unless your model size is tiny and the pressure solver is not doing anything, in which case the simulation will finish rapidly anyway!
If you really want to do this, then you can redirect the screen output to /dev/null, eg: Code:
simpleFoam > /dev/null |
In fact, out of interest, I ran the pitzDaily tutorial case 3 different ways:
1. outputing the log file to screen: 11.1sec 2. redirecting into a disk log file: 9.9sec 3. redirecting into /dev/null: 9.8sec Remember that this case is tiny, requires little work from the pressure solver and therefore prints out the iteration data very regularly - it did 500 iterations in 10secs, ie 50 iterations a second. The data above shows that in this case, printing to screen is holding the run back, but printing to disk file is not. With a more normal simulation, where each iteration will take more than a second, then even printing to screen will not hold the run back. |
Quote:
Best regards, Stan |
Sounds like a good plan. By the way, the simplest way to time the runs is with the "time" command, e.g.
Code:
time simpleFoam > /dev/null Quote:
|
All times are GMT -4. The time now is 18:51. |