|
[Sponsors] |
January 7, 2021, 21:37 |
How to run solvers in the background
|
#1 |
Member
Haoran Zhou
Join Date: Nov 2019
Posts: 49
Rep Power: 6 |
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! |
|
January 8, 2021, 01:03 |
|
#2 |
Member
Join Date: Oct 2011
Posts: 49
Rep Power: 14 |
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 |
|
January 8, 2021, 01:56 |
|
#3 | |
Member
Haoran Zhou
Join Date: Nov 2019
Posts: 49
Rep Power: 6 |
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? |
||
January 8, 2021, 02:53 |
|
#4 |
Member
Join Date: Oct 2011
Posts: 49
Rep Power: 14 |
as i wrote, type foamJob -help, there is a command running it in the background without logfile:
foamJob -parallel -no-log |
|
January 8, 2021, 04:09 |
|
#5 | |
Member
Haoran Zhou
Join Date: Nov 2019
Posts: 49
Rep Power: 6 |
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 |
||
January 8, 2021, 05:21 |
|
#6 |
Member
Join Date: Oct 2011
Posts: 49
Rep Power: 14 |
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. |
|
January 8, 2021, 06:46 |
|
#7 | |
Member
Haoran Zhou
Join Date: Nov 2019
Posts: 49
Rep Power: 6 |
Quote:
Best regards, Stan |
||
January 8, 2021, 09:06 |
|
#8 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 668
Rep Power: 14 |
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 |
|
January 8, 2021, 09:15 |
|
#9 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 668
Rep Power: 14 |
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. |
|
January 8, 2021, 09:47 |
|
#10 | |
Member
Haoran Zhou
Join Date: Nov 2019
Posts: 49
Rep Power: 6 |
Quote:
Best regards, Stan |
||
January 8, 2021, 10:40 |
|
#11 | |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 668
Rep Power: 14 |
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:
|
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
linear solver crashing during transient run on HPC cluster | Geoff67 | CFX | 3 | August 28, 2020 18:53 |
[snappyHexMesh] How to run snappyhexmesh without changing background | atieh | OpenFOAM Meshing & Mesh Conversion | 0 | December 16, 2015 17:25 |
Pinning the processors in cluster to run a solver | coolcrasher | OpenFOAM Running, Solving & CFD | 0 | November 5, 2015 06:11 |
Ignition fails in parallel run combustion solvers | msha | OpenFOAM Bugs | 17 | January 17, 2009 03:49 |
How to run Fluent on the background? | David | FLUENT | 4 | January 17, 2004 02:20 |