run.sh 1.07 KB
Newer Older
1 2 3 4
#! /bin/bash

# Make a directory in /tmp/OpenFPM_pdata

incardon's avatar
incardon committed
5
workspace=$1
incardon's avatar
incardon committed
6
hostname=$(hostname)
incardon's avatar
incardon committed
7 8 9 10 11
nproc=$3
ntask_per_node=$5
nodes=$4
branch=$6

incardon's avatar
incardon committed
12 13 14 15
if [ x"$branch" == x"" ]; then
  branch=$(git ls-remote --heads origin | grep $(git rev-parse HEAD) | cut -d / -f 3)
fi

incardon's avatar
incardon committed
16 17 18 19 20
echo "Directory: workspace"
echo "Machine: $hostname"
echo "Num of processors: $nproc"
echo "Branch: $branch"

incardon's avatar
incardon committed
21 22 23 24 25 26 27 28 29
if [ x"$hostname" == x"cifarm-mac-node.mpi-cbg.de"  ]; then
        mpi_options="--oversubscribe"
fi

if [ x"$hostname" == x"cifarm-ubuntu-node.mpi-cbg.de"  ]; then
        mpi_options="--mca btl self,vader"
fi


incardon's avatar
incardon committed
30 31
echo "Running general machine"
if [ x"$hostname" == x"no_test" ]; then
32
   exit 0;
incardon's avatar
incardon committed
33
fi
34

incardon's avatar
incardon committed
35
source $HOME/openfpm_vars_$branch
36

incardon's avatar
incardon committed
37 38
mpirun $mpi_options -np $nproc ./build/src/pdata
if [ $? -ne 0 ]; then
incardon's avatar
incardon committed
39
   curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\"  , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$hostname failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
40 41 42 43
   exit 1 ;
fi