Updates and Results
Talks and Posters
Advice
Ideas
Important Figures
Write-Ups
Outreach
How-To
Funding Opportunities
GENETIS
Place to document instructions for how to do things
Draft saved at 00:00:00
Fields marked with
*
are required
Entry time:
Tue Feb 3 10:53:30 2026
Author
*
:
Subject:
Project:
- please select -
Hardware
Software
Analysis
Other
<p>This guide is modified from section (d) of the worksheet inside Module 10 of Phys 6810 Computational Physics (Spring 2023).</p> <p>NOTE: gprof does <strong>not</strong> work on macOS. Please use a linux machine (such as OSC)</p> <p>To use gprof, compile and link the relevant codes with the <strong>-pg</strong> option:<br /> Take a look at the Makefile <strong>make_hello_world</strong> and modify both the <strong>CFLAGS</strong> and <strong>LDFLAGS</strong> lines to include <strong>-pg</strong><br /> <br /> Compile and link the script by typing<br /> make -f make_hello_world</p> <p>Execute the program<br /> ./hello_world.x</p> <p>With the <strong>-pg</strong> flags, the execution will generate a file called <strong>gmon.out</strong> that is used by gprof.<br /> The program has to exit normally (e.g. we can't stop with a ctrl-C).<br /> <strong>Warning: </strong>Any existing gmon.out file will be overwritten.</p> <p>Run gprof and save the output to a file (e.g., gprof.out) by<br /> gprof hello_world.x > gprof.out</p> <p>We should at this point see a text file called <strong>gprof.out</strong> which contains the profile of hello_world.cpp<br /> vim gprof.out</p>
Encoding
:
HTML
ELCode
plain
Suppress Email notification
Attachment 1:
Drop attachments here...
Draft saved at 00:00:00
ELOG V3.1.5-fc6679b