CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

OpenFoam profiling the solver simpleFoam

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree3Likes
  • 3 Post By rob3rt 0ng

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 4, 2008, 08:16
Default OpenFoam profiling the solver simpleFoam
  #1
New Member
 
Andre
Join Date: Mar 2009
Posts: 19
Rep Power: 17
andre is on a distinguished road
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 is offline   Reply With Quote

Old   February 6, 2008, 07:37
Default Anyone with ideas plz?
  #2
New Member
 
Andre
Join Date: Mar 2009
Posts: 19
Rep Power: 17
andre is on a distinguished road
Anyone with ideas plz?
andre is offline   Reply With Quote

Old   February 11, 2008, 08:10
Default I recompiled OpenFoam with WM_
  #3
New Member
 
Andre
Join Date: Mar 2009
Posts: 19
Rep Power: 17
andre is on a distinguished road
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 is offline   Reply With Quote

Old   February 27, 2008, 09:35
Default Is this somehow related with t
  #4
New Member
 
Andre
Join Date: Mar 2009
Posts: 19
Rep Power: 17
andre is on a distinguished road
Is this somehow related with the ldl and math library that are included?

I would appreciate any kind of help.
Thanks
andre is offline   Reply With Quote

Old   March 10, 2008, 09:39
Default I have a feeling that I am tal
  #5
New Member
 
Andre
Join Date: Mar 2009
Posts: 19
Rep Power: 17
andre is on a distinguished road
I have a feeling that I am talking to myself
Can anyone please give me some hints, or help me solving this issue.

Thanks.
andre is offline   Reply With Quote

Old   March 10, 2008, 12:01
Default 192s is the wall-clock time of
  #6
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
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)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   March 10, 2008, 14:34
Default Have you tried valgrind/kcache
  #7
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
Have you tried valgrind/kcachegrind (which emulates your processor). Produces amazing pictures ;-)
mattijs is offline   Reply With Quote

Old   March 11, 2008, 10:36
Default Kcachegrind is indeed useful i
  #8
New Member
 
Andre
Join Date: Mar 2009
Posts: 19
Rep Power: 17
andre is on a distinguished road
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.
andre is offline   Reply With Quote

Old   April 7, 2011, 22:39
Default
  #9
Member
 
Robert Ong
Join Date: Aug 2010
Posts: 86
Rep Power: 15
rob3rt 0ng is on a distinguished road
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
louisgag, Tobi and serles like this.
rob3rt 0ng is offline   Reply With Quote

Old   April 29, 2017, 09:51
Default how to optimize simpleFoam solver in OpenFOAM
  #10
New Member
 
Savita Mane
Join Date: Mar 2017
Posts: 4
Rep Power: 9
savee is on a distinguished road
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?
savee is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
SimpleFoam as Newtonian laminar flow solver titio OpenFOAM Running, Solving & CFD 2 March 8, 2013 05:44
Dimension change in solver like simpleFoam booz OpenFOAM Running, Solving & CFD 2 August 21, 2008 12:35
MPI profiling OpenFOAM damBreak3D application mellanoxuser OpenFOAM Pre-Processing 0 April 14, 2008 00:15
MPI profiling OpenFOAM damBreak3D application mellanoxuser OpenFOAM Running, Solving & CFD 0 April 14, 2008 00:04
SimpleFoam as laminar solver anja OpenFOAM Pre-Processing 3 April 5, 2007 10:28


All times are GMT -4. The time now is 18:39.