How to find bottlenecks

Numerical methods and mathematical models of Elmer
Post Reply
spacedout
Posts: 177
Joined: 30 Mar 2020, 23:27
Antispam: Yes

How to find bottlenecks

Post by spacedout »

Hello

Is the following the best way to find where the program spends most of its time ???

.....
st = CPUTime()

.....
any desired section of code
.....

st = CPUTime() - st
WRITE( Message, * ) 'Solve (s) :',st
CALL Info( Caller, Message, Level=5 )
.....

repeating the above in all places of interest within all solvers called by the SIF.

Best to all
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: How to find bottlenecks

Post by raback »

Hi

This pair can also be used and it includes output.
CALL ResetTimer("mytimer")
! stuff done
CALL CheckTimer("mytimer",Delete=.TRUE.)

Also you can ask in any Solver section
Solver Timing = True
Linear System Timing = True

Generally the time is spent either in setting up the matrix equation or solving it. The 1st scales linearly and parallelizes trivially, the 2nd part not so.

-Peter
Post Reply