Commit 1b33f69e authored by mattijs's avatar mattijs
Browse files

new option for normal running

parent c15ceeb6
......@@ -70,15 +70,17 @@ if [ ! -x "$exec" ]; then
exit 1
fi
if [ ! "$PWD" ]; then
PWD=`pwd`
fi
echo "run $args" > $PWD/gdbCommands
echo "where" >> $PWD/gdbCommands
echo "Constructed gdb initialization file $PWD/gdbCommands"
echo "run $args" > $HOME/gdbCommands
echo "where" >> $HOME/gdbCommands
echo "Constructed gdb initialization file $HOME/gdbCommands"
$ECHO "Choose running method: 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: \c"
read method
if [ "$method" -ne 1 -a "$method" -ne 2 -a "$method" -ne 3 -a "$method" -ne 4 -a "$method" -ne 5 ]; then
if [ "$method" -ne 0 -a "$method" -ne 1 -a "$method" -ne 2 -a "$method" -ne 3 -a "$method" -ne 4 -a "$method" -ne 5 ]; then
printUsage
exit 1
fi
......@@ -119,15 +121,15 @@ fi
echo "**sourceFoam:$sourceFoam"
rm -f $HOME/mpirun.schema
touch $HOME/mpirun.schema
rm -f $PWD/mpirun.schema
touch $PWD/mpirun.schema
proc=0
xpos=0
ypos=0
for ((proc=0; proc<$nProcs; proc++))
do
procCmdFile="$HOME/processor${proc}.sh"
procCmdFile="$PWD/processor${proc}.sh"
procLog="processor${proc}.log"
geom="-geometry 120x20+$xpos+$ypos"
node=""
......@@ -141,22 +143,25 @@ do
fi
echo "#!/bin/sh" > $procCmdFile
if [ "$method" -eq 1 ]; then
echo "$sourceFoam; cd $PWD; gdb -command $HOME/gdbCommands $exec 2>&1 | tee $procLog; read dummy" >> $procCmdFile
if [ "$method" -eq 0 ]; then
echo "$sourceFoam; cd $PWD; $exec $args | tee $procLog" >> $procCmdFile
echo "${node}$procCmdFile" >> $PWD/mpirun.schema
elif [ "$method" -eq 1 ]; then
echo "$sourceFoam; cd $PWD; gdb -command $PWD/gdbCommands $exec 2>&1 | tee $procLog; read dummy" >> $procCmdFile
#echo "$sourceFoam; cd $PWD; $exec $args; read dummy" >> $procCmdFile
echo "${node}xterm -font fixed -title 'processor'$proc $geom -e $procCmdFile" >> $HOME/mpirun.schema
echo "${node}xterm -font fixed -title 'processor'$proc $geom -e $procCmdFile" >> $PWD/mpirun.schema
elif [ "$method" -eq 2 ]; then
echo "$sourceFoam; cd $PWD; gdb -command $HOME/gdbCommands >& $procLog" >> $procCmdFile
echo "${node}$procCmdFile" >> $HOME/mpirun.schema
echo "$sourceFoam; cd $PWD; gdb -command $PWD/gdbCommands >& $procLog" >> $procCmdFile
echo "${node}$procCmdFile" >> $PWD/mpirun.schema
elif [ "$method" -eq 3 ]; then
echo "$sourceFoam; cd $PWD; $exec $args >& $procLog" >> $procCmdFile
echo "${node}$procCmdFile" >> $HOME/mpirun.schema
echo "${node}$procCmdFile" >> $PWD/mpirun.schema
elif [ "$method" -eq 4 ]; then
echo "$sourceFoam; cd $PWD; $exec $args 2>&1 | tee $procLog; read dummy" >> $procCmdFile
echo "${node}xterm -font fixed -title 'processor'$proc $geom -e $procCmdFile" >> $HOME/mpirun.schema
echo "${node}xterm -font fixed -title 'processor'$proc $geom -e $procCmdFile" >> $PWD/mpirun.schema
elif [ "$method" -eq 5 ]; then
echo "$sourceFoam; cd $PWD; valgrind $exec $args; read dummy" >> $procCmdFile
echo "${node}xterm -font fixed -title 'processor'$proc $geom -e $procCmdFile" >> $HOME/mpirun.schema
echo "${node}xterm -font fixed -title 'processor'$proc $geom -e $procCmdFile" >> $PWD/mpirun.schema
fi
chmod +x $procCmdFile
......@@ -176,10 +181,17 @@ do
echo " tail -f $procLog"
done
$ECHO "Constructed $HOME/mpirun.schema file. Press return to execute.\c"
read dummy
cmd=""
if [ .$WM_MPLIB = .OPENMPI ]; then
mpirun -app $HOME/mpirun.schema </dev/null
cmd="mpirun -app $PWD/mpirun.schema </dev/null"
elif [ .$WM_MPLIB = .LAM ]; then
mpirun $HOME/mpirun.schema </dev/null
cmd="mpirun $PWD/mpirun.schema </dev/null"
fi
echo "Constructed $PWD/mpirun.schema file."
echo ""
echo " $cmd"
echo ""
$ECHO "Press return to execute.\c"
read dummy
exec $cmd
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment