ソースを参照

port r14672 from 1.1: Add starpu_paje_sort

Samuel Thibault 10 年 前
コミット
cb5bd9d3fc

+ 1 - 0
ChangeLog

@@ -176,6 +176,7 @@ Small features:
     numbers.
   * New function starpu_mpi_cache_set() to enable or disable the
     communication cache at runtime
+  * Add starpu_paje_sort which sorts Pajé traces.
 
 Changes:
   * Fix complexity of implicit task/data dependency, from quadratic to linear.

+ 5 - 0
configure.ac

@@ -2534,6 +2534,7 @@ AC_CONFIG_COMMANDS([executable-scripts], [
   chmod +x tools/starpu_paje_draw_histogram
   chmod +x tools/starpu_paje_state_stats
   chmod +x tools/starpu_paje_summary
+  chmod +x tools/starpu_paje_sort
   chmod +x tools/starpu_smpirun
   chmod +x doc/doxygen/doxygen_filter.sh
 ])
@@ -2577,7 +2578,11 @@ AC_OUTPUT([
 	tools/starpu_paje_draw_histogram
 	tools/starpu_paje_state_stats
 	tools/starpu_paje_summary
+<<<<<<< .working
 	tools/starpu_smpirun
+=======
+	tools/starpu_paje_sort
+>>>>>>> .merge-right.r14672
 	socl/Makefile
 	socl/src/Makefile
 	socl/examples/Makefile

+ 8 - 0
doc/doxygen/chapters/13offline_performance_tools.doxy

@@ -376,6 +376,14 @@ $ starpu_paje_summary native.trace simgrid.trace
 it includes gantt charts, execution summaries, as well as state duration charts
 and time distribution histograms.
 
+Other external Pajé analysis tools can be used on these traces, one just needs
+to sort the traces by timestamp order (which not guaranteed to make recording
+more efficient):
+
+\verbatim
+$ starpu_paje_sort paje.trace
+\endverbatim
+
 \section TheoreticalLowerBoundOnExecutionTime Theoretical Lower Bound On Execution Time
 
 StarPU can record a trace of what tasks are needed to complete the

+ 3 - 3
tools/starpu_paje_draw_histogram.in

@@ -3,7 +3,7 @@
 # StarPU --- Runtime system for heterogeneous multicore architectures.
 # 
 # Copyright (C) 2014  Université Joseph Fourier
-# Copyright (C) 2014  Université Bordeaux
+# Copyright (C) 2014-2015  Université Bordeaux
 # 
 # StarPU is free software; you can redistribute it and/or modify
 # it under the terms of the GNU Lesser General Public License as published by
@@ -109,8 +109,8 @@ for file in $inputfiles; do
 	exit 5
     fi
 # Sorting traces
-    grep -e '^\(\(%\)\|\(\(1\|2\|3\|4\|5\|6\|7\)\>\)\)' $file > start.trace
-    grep -e '^\(\(%\)\|\(\(1\|2\|3\|4\|5\|6\|7\)\>\)\)' -v $file > end.trace
+    grep -e '^\(\(%\)\|\(\(0\|1\|2\|3\|4\|5\|6\|7\)\>\)\)' $file > start.trace
+    grep -e '^\(\(%\)\|\(\(0\|1\|2\|3\|4\|5\|6\|7\)\>\)\)' -v $file > end.trace
     sort -s -V --key=2,2 end.trace > endSorted.trace
     if grep -q start_profiling endSorted.trace
     then

+ 105 - 0
tools/starpu_paje_sort.in

@@ -0,0 +1,105 @@
+#!/bin/bash
+
+# StarPU --- Runtime system for heterogeneous multicore architectures.
+# 
+# Copyright (C) 2014  Université Joseph Fourier
+# Copyright (C) 2014-2015  Université Bordeaux
+# 
+# StarPU is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+# 
+# StarPU is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# 
+# See the GNU Lesser General Public License in COPYING.LGPL for more details.
+
+# Script for sorting paje traces
+
+set -e # fail fast
+
+# File names
+basename="$PWD"
+
+inputfiles=""
+
+help_script()
+{
+cat << EOF
+Give statistical analysis of the paje trace
+
+$0 [ options ] paje.trace [paje.trace2 ...]
+
+Options:
+   -h      Show this message
+
+Examples:
+
+$0 example.trace
+
+Report bugs to <@PACKAGE_BUGREPORT@>
+EOF
+}
+
+if [ "$1" = "--version" ] ; then
+    echo "$PROGNAME (@PACKAGE_NAME@) @PACKAGE_VERSION@"
+    exit 0
+fi
+
+if [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "" ] ; then
+    help_script
+    exit 0
+fi
+
+while getopts "h" opt; do
+  case $opt in
+     h)
+      help_script
+      exit 4
+      ;;
+    \?)
+      echo "Invalid option: -$OPTARG"
+      help_script
+      exit 3
+      ;;
+  esac
+done
+
+# Reading files that need to be analyzed
+shift $((OPTIND - 1))
+inputfiles=$@
+if [[ $# < 1 ]]; then
+    echo "Error!"
+    help_script
+    exit 2
+fi
+
+#####################################
+# Transforming input files into .csv
+for file in $inputfiles; do
+    if [ ! -s $file ]
+	then
+	echo "Error: file $file does not exist!"
+	exit 5
+    fi
+# Sorting traces
+    grep -e '^\(\(%\)\|\(\(0\|1\|2\|3\|4\|5\|6\|7\)\>\)\)' $file > start.trace
+    grep -e '^\(\(%\)\|\(\(0\|1\|2\|3\|4\|5\|6\|7\)\>\)\)' -v $file > end.trace
+    sort -s -V --key=2,2 end.trace > endSorted.trace
+    if grep -q start_profiling endSorted.trace
+    then
+	echo Using start_profiling/stop_profiling trace selection.
+	sed -ne '/start_profiling/,/stop_profiling/p' < endSorted.trace > endSorted2.trace
+    else
+	cp endSorted.trace endSorted2.trace
+    fi
+    cat start.trace endSorted2.trace > $file
+done
+
+# Cleanup: delete temporary files
+rm -f start.trace
+rm -f end.trace
+rm -f endSorted.trace
+rm -f endSorted2.trace

+ 3 - 3
tools/starpu_paje_state_stats.in

@@ -3,7 +3,7 @@
 # StarPU --- Runtime system for heterogeneous multicore architectures.
 # 
 # Copyright (C) 2014  Université Joseph Fourier
-# Copyright (C) 2014  Université Bordeaux
+# Copyright (C) 2014-2015  Université Bordeaux
 # 
 # StarPU is free software; you can redistribute it and/or modify
 # it under the terms of the GNU Lesser General Public License as published by
@@ -110,8 +110,8 @@ for file in $inputfiles; do
 	exit 5
     fi
 # Sorting traces
-    grep -e '^\(\(%\)\|\(\(1\|2\|3\|4\|5\|6\|7\)\>\)\)' $file > start.trace
-    grep -e '^\(\(%\)\|\(\(1\|2\|3\|4\|5\|6\|7\)\>\)\)' -v $file > end.trace
+    grep -e '^\(\(%\)\|\(\(0\|1\|2\|3\|4\|5\|6\|7\)\>\)\)' $file > start.trace
+    grep -e '^\(\(%\)\|\(\(0\|1\|2\|3\|4\|5\|6\|7\)\>\)\)' -v $file > end.trace
     sort -s -V --key=2,2 end.trace > endSorted.trace
     if grep -q start_profiling endSorted.trace
     then

+ 3 - 3
tools/starpu_paje_summary.in

@@ -3,7 +3,7 @@
 # StarPU --- Runtime system for heterogeneous multicore architectures.
 # 
 # Copyright (C) 2014  Université Joseph Fourier
-# Copyright (C) 2014  Université Bordeaux
+# Copyright (C) 2014-2015  Université Bordeaux
 # 
 # StarPU is free software; you can redistribute it and/or modify
 # it under the terms of the GNU Lesser General Public License as published by
@@ -84,8 +84,8 @@ for file in $inputfiles; do
 	exit 5
     fi
 # Sorting traces
-    grep -e '^\(\(%\)\|\(\(1\|2\|3\|4\|5\|6\|7\|9\)\>\)\)' $file > start.trace
-    grep -e '^\(\(%\)\|\(\(1\|2\|3\|4\|5\|6\|7\|9\|18\|19\)\>\)\)' -v  $file > end.trace
+    grep -e '^\(\(%\)\|\(\(0\|1\|2\|3\|4\|5\|6\|7\|9\)\>\)\)' $file > start.trace
+    grep -e '^\(\(%\)\|\(\(0\|1\|2\|3\|4\|5\|6\|7\|9\|18\|19\)\>\)\)' -v  $file > end.trace
     sort -s -V --key=2,2 end.trace > endSorted.trace
     cat start.trace endSorted.trace > outputSorted.trace