#!/bin/sh
./misc/hooks/pre-commit-diff-check || exit 1 # check patch formatting
make check || exit 1 # check sawsim execution
-nosetests --with-doctest --doctest-tests pysawsim || exit 1
+./misc/hooks/pre-commit-pysawsim-check || exit 1
</file>
--- /dev/null
+#!/bin/sh
+
+HAS_MPD=$(which mpdallexit 2>/dev/null)
+
+if [ -n "$HAS_MPD" ]; then
+
+ LOCAL_MPD=''
+
+ mpdtrace >/dev/null 2>&1
+ if [ "$?" != 0 ]; then
+ LOCAL_MPD='1'
+ mpd & # start an mpd instance
+ sleep 1 # give mpd some time to start up
+ fi # otherwise there is an mpd instance already running
+
+ mpiexec -n 1 nosetests --with-doctest --doctest-tests pysawsim || exit 1
+
+ if [ -n "$LOCAL_MPD" ]; then
+ mpdallexit
+ fi
+
+else # no MPD
+
+ nosetests --with-doctest --doctest-tests pysawsim || exit 1
+
+fi
])
if worker_pool == None:
worker_pool = MPI.COMM_WORLD.Get_size()
- comm = MPI.COMM_SELF.Spawn(
+ comm = MPI.COMM_SELF.Spawn( # locks with mpich2 if no mpd running
sys.executable, args=['-c', spawn_script], maxprocs=worker_pool)
rank = comm.Get_rank()
assert rank == 0, rank