#!/bin/bash

echo " "
echo " NOTE: MPI has to be installed (e.g. mpich-3.0.2 up to 3.1.4) for MPI programs"
echo "       and process number >1"
echo " NOTE: Programs will overwrite old results with identical names"
echo "       without warning"
echo " "
echo " computation started   $(date)"

echo " "
echo " ---tins---"
echo " "
echo "   ---tins selected reference and test set, all combinations (here 100)"
echo "   ---MPI , 4 processes"
echo " "
mpiexec -n 4 ./tins_mpi ./data.txt ./data.mapping.txt ./results/tins_mpi4_100_b_6_mpi.result ./results/tins_mpi4_100_b_6_mpi.log 100 6 6
echo " "
echo "   ---tins selected reference and test set, all combinations (here 100)"
echo "   ---OpenMP , 4 threads"
echo " "
./tins_omp ./data.txt ./data.mapping.txt ./results/tins_omp4_100_b_6_omp.result ./results/tins_omp4_100_b_6_omp.log 100 6 6 4

echo " "
echo " ---tins_s---"
echo " "
echo "   ---tins selected reference and test set, resampling (here 10)"
echo "   ---MPI , 1 process (will work without MPI libraries)"
echo " "
./tins_s_mpi ./data.txt ./data.mapping.txt ./results/tins_s_mpi1_10_b_6_single.result ./results/tins_s_mpi1_10_b_6_single.log 10 b 6
echo " "
echo "   ---tins selected reference and test set, resampling (here 10)"
echo "   ---MPI , 4 processes"
echo " "
mpiexec -n 4 ./tins_s_mpi ./data.txt ./data.mapping.txt ./results/tins_s_mpi4_10_b_6_mpi.result ./results/tins_s_mpi4_10_b_6_mpi.log 10 b 6
echo " "
echo "   ---tins selected reference and test set, resampling (here 10)"
echo "   ---OpenMP , 4 threads"
echo " "
./tins_s_omp ./data.txt ./data.mapping.txt ./results/tins_s_omp4_10_b_6_omp.result ./results/tins_s_omp4_10_b_6_omp.log 10 b 6 4

echo " "
echo " "
echo " computation finished   $(date)"
echo " "

