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

OpenFoam profiling the solver simpleFoam

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

Reply
 
LinkBack Thread Tools Display Modes
Old   February 4, 2008, 08:16
Default Hi guys, I am new to OpenFo
  #1
New Member
 
Andre
Join Date: Mar 2009
Posts: 19
Rep Power: 8
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: 8
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: 8
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: 8
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: 8
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: 3,912
Rep Power: 40
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
Super Moderator
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,416
Rep Power: 16
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: 8
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, 21:39
Default
  #9
Member
 
Robert Ong
Join Date: Aug 2010
Posts: 45
Rep Power: 6
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
rob3rt 0ng is offline   Reply With Quote

Reply

Thread Tools
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 On
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 11:35
MPI profiling OpenFOAM damBreak3D application mellanoxuser OpenFOAM Pre-Processing 0 April 13, 2008 23:15
MPI profiling OpenFOAM damBreak3D application mellanoxuser OpenFOAM Running, Solving & CFD 0 April 13, 2008 23:04
SimpleFoam as laminar solver anja OpenFOAM Pre-Processing 3 April 5, 2007 09:28


All times are GMT -4. The time now is 13:40.