openmp performance measurement

General OpenMP discussion

openmp performance measurement

Postby freephys » Wed Oct 16, 2013 9:11 am

Hi, I am applying openmp to parallel legacy fortran code, and in order to do performance test, i apply

/usr/bin/time -v ./main <
and get following output

since i requested 8 cores by
export OMP_NUM_THREADS=<number of threads to use> at the shell environment
while Percent of CPU this job got: 555% < 8, so it is indicating that i can reduce to
6 cores?

In general, what are the strategy/tool(free one) of performance tuning and measurement people are using?
User time (seconds): 3416.60
System time (seconds): 70.97
Percent of CPU this job got: 555%
Elapsed (wall clock) time (h:mm:ss or m:ss): 10:27.50
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 136144
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 3242354
Voluntary context switches: 1849642
Involuntary context switches: 369563
Swaps: 0
File system inputs: 0
File system outputs: 21464
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
Posts: 2
Joined: Tue Oct 15, 2013 2:42 pm

Re: openmp performance measurement

Postby MarkB » Thu Oct 17, 2013 2:57 am

Hi there,

The key to tuning OpenMP codes is to understand both where in the code the performance bottlenecks are, and also what is causing them (e.g. sequential code, load imbalance, cache misses, synchronisation, false sharing, etc).

To begin with, you could do a set of runs on, say, 1, 2, 4, 6 and 8 threads to get a feel for the scaling behaviour.

You might then consider using omp_get_wtime() calls around the whole code, and to accumulate the time spent in each parallel construct.
This can tell you how well/badly each parallel construct is scaling, and also (by subtraction) how much time is spent in the sequential part of the program.

For a free performance analysis tool I would recommend Scalasca though as is usual with such tools there is something of a learning curve to get it working and to understand the output.

Hope that helps,
Posts: 719
Joined: Thu Jan 08, 2009 10:12 am
Location: EPCC, University of Edinburgh

Return to Using OpenMP

Who is online

Users browsing this forum: No registered users and 2 guests