浏览代码

tools/starpu_smpirun.in: add option -gdb to start application within gdb

Nathalie Furmento 5 年之前
父节点
当前提交
ce2235bd41
共有 1 个文件被更改,包括 9 次插入4 次删除
  1. 9 4
      tools/starpu_smpirun.in

+ 9 - 4
tools/starpu_smpirun.in

@@ -1,9 +1,9 @@
 #!/bin/bash
 # StarPU --- Runtime system for heterogeneous multicore architectures.
 #
-# Copyright (C) 2017                                     CNRS
+# Copyright (C) 2017, 2020                               CNRS
 # Copyright (C) 2016                                     Inria
-# Copyright (C) 2014-2016,2019                            Université de Bordeaux
+# Copyright (C) 2014-2016,2019                           Université de 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
@@ -55,6 +55,7 @@ fi
 MPI_PLATFORM=""
 MPI_HOSTFILE=""
 NP=""
+GDB=""
 while true; do
 	case "$1" in
 		"-platform")
@@ -77,6 +78,10 @@ while true; do
 			NP=$2
 			shift 2
 			;;
+		"-gdb")
+			GDB="-gdb"
+			shift 1
+			;;
 		*)
 			break
 			;;
@@ -84,7 +89,7 @@ while true; do
 done
 
 if [ -z "$MPI_PLATFORM" ] || [ -z "$MPI_HOSTFILE" ]; then
-	echo "$0 -platform PLATFORM -hostfile HOSTFILE [ -np N ] [ ... ] program [ args ]"
+	echo "$0 -platform PLATFORM -hostfile HOSTFILE [ -np N ] [ -gdb ] [ ... ] program [ args ]"
 	exit 2
 fi
 
@@ -122,7 +127,7 @@ EOF
 
 STACKSIZE=$(ulimit -s)
 [ "$STACKSIZE" != unlimited ] || STACKSIZE=8192
-$SMPIRUN -platform $PLATFORM -hostfile $MPI_HOSTFILE -np $NP "$@" $PRIV_OPT --cfg=smpi/simulate${DASH}computation:no --cfg=contexts/stack${DASH}size:$STACKSIZE
+$SMPIRUN $GDB -platform $PLATFORM -hostfile $MPI_HOSTFILE -np $NP "$@" $PRIV_OPT --cfg=smpi/simulate${DASH}computation:no --cfg=contexts/stack${DASH}size:$STACKSIZE
 RET=$?
 
 rm -f $PLATFORM