浏览代码

tools/starpu_workers_activity: deal with -h, --help or missing or wrong argument

Nathalie Furmento 13 年之前
父节点
当前提交
0cc7cf6c5d
共有 1 个文件被更改,包括 23 次插入2 次删除
  1. 23 2
      tools/starpu_workers_activity

+ 23 - 2
tools/starpu_workers_activity

@@ -3,7 +3,7 @@
 # StarPU --- Runtime system for heterogeneous multicore architectures.
 # 
 # Copyright (C) 2010  Université de Bordeaux 1
-# Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+# Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
 # 
 # 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
@@ -16,7 +16,28 @@
 # 
 # See the GNU Lesser General Public License in COPYING.LGPL for more details.
 
-# TODO display help if -h is passed
+usage()
+{
+    echo "Offline tool to display the activity of the workers during the execution."
+    echo ""
+    echo "  The fxt_tool utility now generates a file named 'activity.data' which can"
+    echo "  be processed by this script to generate a plot named activity.eps"
+    echo ""
+    echo "  Typical usage:"
+    echo "     ./fxt_tool -i /tmp/prof_file_foo"
+    echo "     $0 activity.data"
+    exit 1
+}
+
+if [ "$1" == "-h" ] || [ "$1" == "-help" ] || [ "$1" == "" ] ; then
+    usage
+fi
+
+if [ ! -f $1 ] ; then
+    echo "Error. File <$1> not found"
+    echo ""
+    usage
+fi
 
 # The input file must be generated by the starpu_fxt_tool command
 inputfile_with_counters=$1