#!/bin/sh NP=4 music_conf="$( echo "${0##*/}" | sed 's/\.test//' ).music" abspath="$(cd "${0%/*}" 2>/dev/null; echo "$PWD"/"${0##*/}")" path="`dirname $abspath`" . ${path}/run_test write_configuration () { method=$1 echo "Communication method: ${method}" # this is music configuration file cat < "${MUSIC_DATA_PATH}/${music_conf}" np=2 stoptime=1.0 [from] binary=${TEST_BINDIR}/messagesource args=-b 1 ${MUSIC_DATA_PATH}/messages [to] binary=${TEST_BINDIR}/eventlogger args=-b 2 from.out -> to.message [10, ${method}] EOF } # this is input data cat <<\EOF > "${MUSIC_DATA_PATH}/messages0.dat" 0.3 Hello 0.7 ! EOF cat <<\EOF > "${MUSIC_DATA_PATH}/messages1.dat" 0.5 World 0.71 Hello World 0.72 ! EOF # this is the output we should expect to see cat <<\EOF > "${MUSIC_DATA_PATH}/ok" Rank 0: Message (0.3, Hello) detected at 0.28 Rank 1: Message (0.3, Hello) detected at 0.28 Rank 0: Message (0.5, World) detected at 0.49 Rank 1: Message (0.5, World) detected at 0.49 Rank 0: Message (0.7, !) detected at 0.68 Rank 1: Message (0.7, !) detected at 0.68 Rank 0: Message (0.71, Hello World) detected at 0.69 Rank 1: Message (0.71, Hello World) detected at 0.69 Rank 0: Message (0.72, !) detected at 0.7 Rank 1: Message (0.72, !) detected at 0.7 EOF # sort the file using locale specified by current environment sort "${MUSIC_DATA_PATH}/ok" -o "${MUSIC_DATA_PATH}/ok" cat <<\EOF > "${MUSIC_DATA_PATH}/errok" EOF for method in point-to-point collective ; do write_configuration "${method}" run_test "${NP}" "${music_conf}" exit_code=$? if test "${exit_code}" -gt 0 ; then exit "${exit_code}" fi done exit 0