-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck.sh
More file actions
41 lines (34 loc) · 840 Bytes
/
check.sh
File metadata and controls
41 lines (34 loc) · 840 Bytes
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
#!/bin/bash
echo ''
echo 'MPI VERSION:'
if ! mpirun --version; then
echo "Error: MPI is not installed or not working correctly."
fi
echo ""
echo 'GCC VERSION:'
if ! gcc --version; then
echo "Error: GCC is not installed or not working correctly."
fi
echo ""
echo 'MAKE VERSION:'
if ! make --version; then
echo "Error: Make is not installed or not working correctly."
fi
echo ''
echo 'GIT VERSION:'
if ! git --version; then
echo "Error: Git is not installed or not working correctly."
fi
echo ''
echo "We are running with 4 cores"
echo ''
# Compile test.c with error check
if ! mpicc test.c -o test; then
echo "Error: Compilation failed. Check test.c for errors."
exit 1
fi
# Run the compiled program with 4 processes
if ! mpirun -n 4 ./test; then
echo "Error: MPI program failed to execute."
exit 1
fi