浏览代码

starpupy/examples/execute.sh: allow to launch mpi with gdb

Nathalie Furmento 4 年之前
父节点
当前提交
41d7803065
共有 1 个文件被更改,包括 18 次插入4 次删除
  1. 18 4
      starpupy/examples/execute.sh.in

+ 18 - 4
starpupy/examples/execute.sh.in

@@ -22,6 +22,13 @@ pypath=@STARPU_BUILD_DIR@/starpupy/src/build:$PYTHONPATH
 
 LOADER=@PYTHON@
 
+if test -z "$MPI_LAUNCHER"
+then
+    MPI_LAUNCHER="mpiexec -np 2"
+fi
+mpi=""
+gdb=""
+
 read_arg()
 {
     do_shift=0
@@ -32,15 +39,22 @@ read_arg()
 	do_shift=1
     elif test "$1" == "--gdb"
     then
-	LOADER="gdb --args @PYTHON@"
+	gdb="gdb"
+	if test "$mpi" == "mpi"
+	then
+	    LOADER="$MPI_LAUNCHER xterm -sl 10000 -hold -e gdb --args @PYTHON@"
+	else
+	    LOADER="gdb --args @PYTHON@"
+	fi
 	do_shift=1
     elif test "$1" == "--mpirun"
     then
-	if test "$MPI_LAUNCHER"
+	mpi="mpi"
+	if test "$gdb" == "gdb"
 	then
-	    LOADER="$MPI_LAUNCHER @PYTHON@"
+	    LOADER="$MPI_LAUNCHER xterm -sl 10000 -hold -e gdb --args @PYTHON@"
 	else
-	    LOADER="mpiexec -np 2 @PYTHON@"
+	    LOADER="$MPI_LAUNCHER @PYTHON@"
 	fi
 	do_shift=1
     fi