-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpatterntest.sh
More file actions
70 lines (58 loc) · 1.8 KB
/
patterntest.sh
File metadata and controls
70 lines (58 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
BASE=/home/pi/stest
# Pthreads
echo "Pthread Testing"
cd $BASE/CSinParallel/Patternlets/pthreads/07.barrier/ && make 2> /home/pi/err.txt > /dev/null
./barrier 2>> /home/pi/err.txt 1> /home/pi/outtest.txt
rm barrier
# MPI
echo "MPI testing"
cd $BASE/CSinParallel/Patternlets/MPI/01.masterWorker/ && make 2>> /home/pi/err.txt > /dev/null
mpirun -np 4 ./masterWorker 2>> /home/pi/err.txt 1>> /home/pi/outtest.txt
rm masterWorker
#mpi4py
echo "mpi4py testng"
cd $BASE/CSinParallel/Patternlets/mpi4py && python3 run.py 00spmd.py 4 2>> /home/pi/err.txt 1>> /home/pi/outtest.txt
#hybrid-MPI+OpenMP
echo "hybrid testing"
cd $BASE/CSinParallel/Patternlets/hybrid-MPI+OpenMP/01.spmd2 && make 2>> /home/pi/err.txt > /dev/null
mpirun -np 4 ./spmd2 2>> /home/pi/err.txt 1>> /home/pi/outtest.txt
rm spmd2
#openMP
echo "openMP testing"
cd $BASE/CSinParallel/Patternlets/openMP/08.reduction && make 2>> /home/pi/err.txt > /dev/null
./reduction 2>> /home/pi/err.txt 1>> /home/pi/outtest.txt
rm reduction
#check if the patternlets work
patternletsWork=true
# Search for lines in ~/outtest.txt
while IFS= read -r line
do
if ! grep "$line" ~/outtest.txt > /dev/null
then
echo -e "\e[1;31mFOLLOWING LINE NOT DETECTED: $line \e[0m"
patternletWork=false
fi
done < $BASE/testcheck.txt
#Output if all of the Patternlets worked
if $patternletWork
then
echo -e "\e[1;32mPatternlet testing showed no errors \e[0m"
rm /home/pi/outtest.txt
rm /home/pi/err.txt
else
echo -e "\e[1;33mTESTING RESULTED IN ERROR\e[0m"
fi
# In case any of the Patternlets didn't work
if ! $patternletWork
then
if [ ! -s ~/err.txt ]
then
echo -e "\e[1;33mNO ERROR MESSAGES\e[0m"
else
echo -e "\e[1;31mERROR MESSAGES PRESENT \e[0m"
echo "Showing error output"
echo "######################"
cat /home/pi/err.txt
fi
fi