|
[Sponsors] |
measuring the performance of some fragments of codes |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 23, 2014, 05:32 |
measuring the performance of some fragments of codes
|
#1 |
Member
Join Date: Feb 2012
Posts: 49
Rep Power: 14 |
Hi FOAMers,
I added some lines of code to a solver and would like to measure the performance of each part, e.g pressure solver, momentum solver and so on, Would it be the EXACT way of measuring? double a = clock::getTime(); THE CODE; double b = clock::getTime(); elapsed cpu time for that part of code EXACTLY is : (b-a) ? ( I expected to get nearly same value, but using the above method,sometimes provides strange results. e.g for a particular fragment of code, it gives performance of 9%, and sometimes 15% (the simulation is converged) actually when i print out the value of the scalar/double a or b, it seems that it can be 9 precision number ,so subtraction may lead to some errors due to that range of accuracy ) Thanks in advance. UPDATE : using 'elapsedCpuTime' gave accurate time and solved the problem. Last edited by ooo; April 23, 2014 at 09:18. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Help! Delete the UDM codes in the UDF | Messi | Fluent UDF and Scheme Programming | 2 | January 28, 2014 09:01 |
parallel performance on BX900 | uzawa | OpenFOAM Installation | 3 | September 5, 2011 15:52 |
Is it worth it? | Jason Bardis | Main CFD Forum | 47 | July 27, 2011 04:52 |
Comparison of CFD Codes | Kerem | Main CFD Forum | 9 | May 9, 2003 04:29 |
Anyone used Ansys/Flotran - cf. with other codes? | S. Langsford | Main CFD Forum | 3 | October 19, 1998 20:51 |