CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[Other] A computing time estimate script I've written.

Register Blogs Community New Posts Updated Threads Search

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 28, 2019, 03:50
Default A computing time estimate script I've written.
  #1
New Member
 
AndrewM4000's Avatar
 
Andrew M.
Join Date: Aug 2019
Posts: 1
Rep Power: 0
AndrewM4000 is on a distinguished road
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
Some sample output looks like this:
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
Any feedback on this software is appreciated.
Thanks,
- Andrew.
Attached Files
File Type: txt foamTime.py.txt (5.8 KB, 18 views)
AndrewM4000 is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


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