|
[Sponsors] |
[Other] A computing time estimate script I've written. |
View Poll Results: Did you find this tool useful? | |||
Yes, I found it useful, thanks. | 2 | 100.00% | |
It is useful but I use a different tool for estimating times. | 0 | 0% | |
No, it is not useful at all. | 0 | 0% | |
I don't know, I was unable to use this tool on my system. | 0 | 0% | |
Voters: 2. You may not vote on this poll |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 28, 2019, 03:50 |
A computing time estimate script I've written.
|
#1 |
New Member
Andrew M.
Join Date: Aug 2019
Posts: 1
Rep Power: 0 |
Hello, fellow foamers!
When I began using rhoPimpleFoam for transient simulations that were taking a long time to finish, I was always trying to estimate what time of day it would finish based on how quickly it was getting through the first couple of (virtual) milliseconds. So I decided to automate that step with a script which parses the output of rhoPimpleFoam and gives you a running estimate of time remaining and the date & time it will finish. It assumes that the solving rate will remain roughly same up until the simulation endTime, but this seems valid for rhoPimpleFoam in the models that I've been using. This was only designed to work with rhoPimpleFoam and it has been well tested on that. Today I also tried it on interFoam in the damBreak tutorial and it works okay on that too. So you may find this works on several transient solvers besides rhoPimpleFoam. There is not much point in using it on any steady-state solvers since they will end whenever the solution converges, which is often long before the endTime stated in the controlDict file. However I did try it on a simpleFoam case today and while the log text is compatible with this script, it is only going to estimate how long it would take to get to the maximum iteration limit (endTime) and it cannot tell when the simulation will really end. I've found the estimation accuracy for rhoPimpleFoam is quite good. As an example, in one simulation which took 20 hours to run its first estimate was wrong by less than 25 minutes. But this accuracy is system load dependent, so when OpenFOAM does not have 100% capacity of your computer/cluster the initial estimate can be thrown off later by a change in system load. I thought I should post it here in case others find this useful. Please find it attached to this message. You will need Python 2.7 (or later) installed to use it. There is some parameters documentation built in to the source code, so you can read that or run foamTime.py --help Using this tool may require changing your case's Allrun script to read the log file during the simulation. On Linux you could use it in a bash script for a parallel run this way: Code:
# Get application name application=$(getApplication) rm "log.mpirun" 2>/dev/null endTime=3.3 ( sleep 10 ; tail --follow=name log.mpirun | ~/Documents/foamTime.py ${endTime} -filter -singleServe ) & runApplication mpirun -np 6 $application -parallel mv log.mpirun "log.mpirun.backup" sleep 2 # Ensures that tail ends by noticing the disappearance of the log file name Code:
* Estimating time remaining until OpenFOAM timestep reaches 3.3. simTime=0.9948 simTime=0.995 * Estimated time remaining: 12.81 hours * ETA approximately 2019-07-31, 11:05AM. simTime=0.9952 * Estimated time remaining: 12.80 hours * ETA approximately 2019-07-31, 11:05AM. simTime=0.9954 * Estimated time remaining: 12.80 hours * ETA approximately 2019-07-31, 11:05AM. simTime=0.9956 Thanks, - Andrew. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
bash script for pseudo-parallel usage of reconstructPar | kwardle | OpenFOAM Post-Processing | 42 | May 7, 2024 23:17 |
[solidMechanics] Support thread for "Solid Mechanics Solvers added to OpenFOAM Extend" | bigphil | OpenFOAM CC Toolkits for Fluid-Structure Interaction | 686 | December 22, 2022 09:10 |
AMI speed performance | danny123 | OpenFOAM | 21 | October 24, 2020 04:13 |
pimpleDyMFoam computation randomly stops | babapeti | OpenFOAM Running, Solving & CFD | 5 | January 24, 2018 05:28 |
Could anybody help me see this error and give help | liugx212 | OpenFOAM Running, Solving & CFD | 3 | January 4, 2006 18:07 |