run.sh 2.28 KB
Newer Older
1
2
3
4
5
6
#! /bin/bash

# Make a directory in /tmp/OpenFPM_pdata

echo "Directory: $1"
echo "Machine: $2"
Pietro Incardona's avatar
Pietro Incardona committed
7
echo "Num of processors: $4"
Pietro Incardona's avatar
Pietro Incardona committed
8
echo "Branch: $6"
9

Pietro Incardona's avatar
Pietro Incardona committed
10
11
exit 1

12
13
if [ "$2" == "gin" ]
then
Pietro Incardona's avatar
Pietro Incardona committed
14
 source "$HOME/.bashrc"
15
16
17
18
19
20
 module load gcc/4.9.2
 if [ $? -ne 0 ]; then
   curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\"  , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
   exit 1 ;
 fi

Pietro Incardona's avatar
Pietro Incardona committed
21
22
23
24
25
 if [ x"$6" != x"" ]; then
   source $HOME/openfpm_vars_$6
 else
   source $HOME/openfpm_vars_master
 fi
26

Pietro Incardona's avatar
Pietro Incardona committed
27

28
29
30
31
 if [ x"$3" == x"no_test" ]; then
   exit 0;
 fi

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

elif [ "$2" == "taurus" ]
then

 source /etc/profile
 echo "$PATH"
Pietro Incardona's avatar
Pietro Incardona committed
43
44
 module load gcc/5.5.0
 module load openmpi/3.0.0-gnu5.5
45
46
 module unload bullxmpi

47
48
49
50
51
 if [ x"$6" != x"" ]; then
   source $HOME/openfpm_vars_$6
 else
   source $HOME/openfpm_vars_master
 fi
52

53
 salloc --nodes=$4 --ntasks-per-node=$5 --time=00:35:00 --mem-per-cpu=1900 --partition=haswell bash -c "ulimit -s unlimited && mpirun -np $3 src/pdata --report_level=no"
54
55
56
57
58
59
60
61
62
63
64
 if [ $? -ne 0 ]; then
   curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\"  , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
   exit 1 ; 
 fi

else

 if [ x"$3" == x"no_test" ]; then
   exit 0;
 fi

Pietro Incardona's avatar
Pietro Incardona committed
65
 source $HOME/openfpm_vars_$6
66

Pietro Incardona's avatar
Pietro Incardona committed
67
 mpirun -np $3 ./build/src/pdata
68
69
70
71
72
73
74
 if [ $? -ne 0 ]; then
   curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\"  , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
   exit 1 ;
 fi
fi