Debian Codegraph @

extras/music_mpirun

raw
1 #! /bin/sh
2
3 if [ $# -ne 2 ]; then
4 echo "Usage: musicrun <number of tasks> <configuration file (*.music)>"
5 exit 1
6 fi
7
8 abspath="$(cd "${0%/*}" 2>/dev/null; echo "$PWD"/"${0##*/}")"
9 path="`dirname $abspath`"
10
11 binary=`mpirun -np $1 $path/music $2`
12 exitcode=$?
13
14 if [ $exitcode -ne 0 ]; then
15 echo "$binary"
16 exit $exitcode
17 fi
18
19 echo "$binary"
20 exit $exitcode