Other useful
Computing resources
|
Gprof code profiling tool.
Gprof is a tool for profiling the performance of code when it is being run. The following is a quick guide to using it.
- To add gprof support at compilation time, add the -pg flag to the makefile or command line.
- Creates file 'gmon.out' after running the code.
- Running gprof: gprof program_name [datafile][> outfile]
where datafile is the gmon.out file.
- Analysing gprofs output - two kinds of analysis:
the flat profile,
the call graph.
- Interpreting the flat profile: total amount of time your program spent executing each function.
- Interpreting the call graph: how much time was spent in each function and its children.
FFTW - Fastest Foutrier Transform in the West.
- C subroutine library for computing the discrete Fourier Transform (DFT) in one or more dimensions.
- Very Fast.
- Works on all platforms with a C compiler.
- Version 2.1.5 contains an MPI parallel version of the FFT routine.
- Can be found at: www.fftw.org.
Gnuplot - Plotting program.
- Example Code: (for Gnuplot 4.0 or higher)
set style data lines
set style line 1 lt 1 lw 2
set style line 2 lt 2 lw 2
set style line 3 lt 3 lw 2
set style line 4 lt 4 lw 2
set style line 5 lt 5 lw 2
set xlabel "log velocity (km/s)"
set term postscript enh color
set output "temp.ps"
set xrange [0:1.5]
set yrange [*:*]
set ylabel "log mass (dM/dv)"
plot \
"mviv_t4_012_30.dat" u (log10($1)):(log10($2)) w l ls 1 title "240 years", \
"mviv_t4_024_30.dat" u (log10($1)):(log10($2)) w l ls 2 title "480 years", \
"mviv_t4_036_30.dat" u (log10($1)):(log10($2)) w l ls 3 title "720 years", \
"mviv_t4_046_30.dat" u (log10($1)):(log10($2)) w l ls 4 title "1000 years", \
"mviv_t4_046_30.dat" u (log10($1)):(log10($1**-2.3)+29) w l ls 5 title "{/Symbol g=2.3}"
set term x11