<< Chapter < Page Chapter >> Page >

Profile the following program using gprof. Is there any way to tell how much of the time spent in routine c was due to recursive calls?


main() {int i, n=10; for (i=0; i<1000; i++) { c(n);a(n); }} c(n)int n; {if (n>0) { a(n-1);c(n-1); }} a(n)int n; {c(n); }
Got questions? Get instant answers now!

Profile an engineering code (floating-point intensive) with full optimization on and off. How does the profile change? Can you explain the change?

Got questions? Get instant answers now!

Write a program to determine the overhead of the getrusage and the etime calls. Other than consuming processor time, how can making a system call to check the time too often alter the application performance?

Got questions? Get instant answers now!

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, High performance computing. OpenStax CNX. Aug 25, 2010 Download for free at http://cnx.org/content/col11136/1.5
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'High performance computing' conversation and receive update notifications?

Ask