-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·81 lines (60 loc) · 1.67 KB
/
test.sh
File metadata and controls
executable file
·81 lines (60 loc) · 1.67 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
71
72
73
74
75
76
77
78
79
80
81
#!/bin/bash
echo "Waiting up to 60 seconds for the cluster to settle..."
sleep 60
NTOTAL="`cat /etc/hosts.vcc | wc -l`"
NWORKERS="`cat /var/spool/torque/server_priv/nodes | wc -l`"
echo "Total hosts: $NTOTAL"
echo "Worker nodes: $NWORKERS"
echo -n "TORQUE node check "
CHECK_NWORKERS="`pbsnodes -l free | wc -l`"
if [ "$CHECK_NWORKERS" == "$NWORKERS" ]; then
echo "[OK]"
else
echo "[FAILED]"
fi
echo "SSH test head->node"
PDSH_SSH_ARGS_APPEND="-oLogLevel=ERROR" pdsh -a "echo [OK]"
echo "SSH test head<-node"
PDSH_SSH_ARGS_APPEND="-oLogLevel=ERROR" pdsh -a "ssh -oLogLevel=ERROR headnode echo [OK]"
# example mpi code
cat <<EOF > /tmp/mpi-test.c
#include <mpi.h>
#include <stdio.h>
#include <unistd.h>
int main(int argc, char **argv)
{
int rank;
char hostname[256];
MPI_Init(&argc,&argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
gethostname(hostname,255);
printf("%s / %d [OK]\n", hostname, rank);
MPI_Finalize();
return 0;
}
EOF
cat /etc/hosts.vcc | awk '{print $1}' > /root/machines
module load mpi/mpich-x86_64
echo -n "MPICH compile "
mpicc -o /cluster/mpi-test.mpich /tmp/mpi-test.c
if [ $? -eq 0 ]; then
echo "[OK]"
else
echo "[FAILED]"
fi
echo "MPICH test (via mpirun)"
mpirun -machinefile /root/machines /cluster/mpi-test.mpich
module unload mpi/mpich-x86_64
#module load mpi/openmpi-x86_64
#echo -n "openMPI compile "
#mpicc -o /cluster/mpi-test.ompi /tmp/mpi-test.c
#if [ $? -eq 0 ]; then
# echo "[OK]"
#else
# echo "[FAILED]"
#fi
#echo "openMPI test (via mpirun)"
#mpirun --allow-run-as-root -machinefile /tmp/test.machinefile /cluster/mpi-test.ompi
echo ""
echo "Cluster test complete."
echo "If all tests passed with [OK] the cluster is ready."