From e4a3348ca2002c74ccd171e87cbe3bacbe11852e Mon Sep 17 00:00:00 2001 From: laurence Date: Tue, 16 Oct 2012 14:34:38 +0100 Subject: [PATCH] ENH: mpirunDebug: Add gperftools option gperftools comes with a profiler. It should be installed in ThirdParty. Then link the executable to libprofiler.so, run it and view the output using kcachegrind. --- bin/mpirunDebug | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/mpirunDebug b/bin/mpirunDebug index a7a0cb32b0..7911e06e98 100755 --- a/bin/mpirunDebug +++ b/bin/mpirunDebug @@ -100,10 +100,10 @@ echo "run $args" > $PWD/gdbCommands echo "where" >> $PWD/gdbCommands echo "Constructed gdb initialization file $PWD/gdbCommands" -$ECHO "Choose running method: 0)normal 1)gdb+xterm 2)gdb 3)log 4)log+xterm 5)xterm+valgrind: \c" +$ECHO "Choose running method: 0)normal 1)gdb+xterm 2)gdb 3)log 4)log+xterm 5)xterm+valgrind 6)gperftools(callgrind): \c" read method case "$method" in -0 | 1 | 2 | 3 | 4 | 5 ) +0 | 1 | 2 | 3 | 4 | 5 | 6) # okay ;; *) @@ -199,6 +199,11 @@ do echo "$sourceFoam; cd $PWD; valgrind $exec $args; read dummy" >> $procCmdFile echo "${node}xterm -font fixed -title 'processor'$proc $geom -e $procCmdFile" >> $PWD/mpirun.schema ;; + 6) + echo "$sourceFoam; cd $PWD; CPUPROFILE=log.profiler_$proc $exec $args; \ + pprof --callgrind $exec log.profiler_$proc > log.profiler_$proc.callgrind;" >> $procCmdFile + echo "${node}$procCmdFile" >> $PWD/mpirun.schema + ;; esac chmod +x $procCmdFile