CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   OpenFoam profiling the solver simpleFoam (https://www.cfd-online.com/Forums/openfoam-programming-development/60847-openfoam-profiling-solver-simplefoam.html)

andre February 4, 2008 07:16

OpenFoam profiling the solver simpleFoam
 
Hi guys,

I am new to OpenFoam and I want to profile the simpleFoam solver. In order to this, I included -pg at EXE_INC and EXE_LIBS in the option file located in $FOAM_SOLVERS/incompressible/simpleFoam/Make/

After recompiling this solver, I run the pitzDaily case by:
simpleFoam . pitzDaily (am already in the $FOAM_RUN/tutorials/simpleFoam directory)
After that it takes a long time to finish the calculations. If I watch the gprof results, by:
gprof $FOAM_APPBIN/simpleFoam gmon.out and watch the total execution time, it tells me it took almost 20 seconds to finish, but the real execution time took 190 seconds. (BTW i changed the endtime in the controlDict file to 200 in stead of 1000, otherwise it took to long to wait)

My questions are: Should I include the -pg flag in more option files? and why is there a difference in the real execution time and the results of gprof?

Greetings, Andre

andre February 6, 2008 06:37

Anyone with ideas plz?
 
Anyone with ideas plz?

andre February 11, 2008 07:10

I recompiled OpenFoam with WM_
 
I recompiled OpenFoam with WM_COMPILE_OPTION=Prof to enable profiling.

Again, if i run
simpleFoam . pitzDaily and profile the result, I find out that the real execution time takes 192 seconds, but Gprof profiles only 23 seconds.

I am still wondering what the CPU is doing for 192-23 = 169 seconds.

Can anyone help me with this?

Thanks

andre February 27, 2008 08:35

Is this somehow related with t
 
Is this somehow related with the ldl and math library that are included?

I would appreciate any kind of help.
Thanks

andre March 10, 2008 08:39

I have a feeling that I am tal
 
I have a feeling that I am talking to myself http://www.cfd-online.com/OpenFOAM_D...part/happy.gif
Can anyone please give me some hints, or help me solving this issue.

Thanks.

gschaider March 10, 2008 11:01

192s is the wall-clock time of
 
192s is the wall-clock time of the profiling-enabled executable? How long does the executable without profiling run? My guess ist, that it would be approx 23 seconds. Maybe the 169s is the administrative effort of the profiling? (But I'm not an expert on profiling, I only know that a profiling executable runs significantly slower)

mattijs March 10, 2008 13:34

Have you tried valgrind/kcache
 
Have you tried valgrind/kcachegrind (which emulates your processor). Produces amazing pictures ;-)

andre March 11, 2008 09:36

Kcachegrind is indeed useful i
 
Kcachegrind is indeed useful if memory/cache usage must be investigated, but I want to profile for timing and to find out in which function most CPU-time is spend.

Thanks for the replies.

rob3rt 0ng April 7, 2011 21:39

Hi Andrea,

I think what Mattijs meant is to run your simulation using this command
valgrind --tool=callgrind <executableName>

then you can obtain block diagrams (along with its executable time) and graph using

kcachegrind <callgrindFileName>

Thanks and regards,
Robert

savee April 29, 2017 08:51

how to optimize simpleFoam solver in OpenFOAM
 
Hello,

I am trying to optimize simpleFoam solver in OpenFOAM. I have tried with the optimization flags available like O2, O3. The error here is that it is not able to include .h files which are included in the .C file.
If suppose in simpleFoam.C file, the .h file included is fvCFD.H. It is not including that file. Even if I give the full path of that file from /home/...upto that file/fvCFD.H. Then, the next error is like, it will include that file, but in that fvCFD.H, we have again another number of .h files to include.

So, how can we resolve this problem.. Any idea?


All times are GMT -4. The time now is 12:16.