test2
5 years ago
2 changed files with 10 additions and 7 deletions
@ -1,17 +1,20 @@ |
|||
#!/bin/bash |
|||
|
|||
# compile |
|||
mpicc -o /ubuntu/mpi_hello_world i./mpi_hello_world.c |
|||
DIRhosts=/home/ubuntu/mpitmp/hosts |
|||
DIR=/home/ubuntu/mpitmp |
|||
|
|||
mkdir -p $DIR |
|||
mpicc -o $DIR/mpi_hello_world ./mpi_hello_world.c |
|||
|
|||
# scp hello wrold to all clients. sudo -u mpi for auto scp connect. see /home/mpi/.ssh |
|||
swarmlab-getworkers > $DIRhosts |
|||
while read -r line; |
|||
do |
|||
scp /ubuntu/mpi_hello_world ubuntu@$line:/ubuntu/mpi_hello_world |
|||
done < /ubuntu/hosts |
|||
scp $DIR/mpi_hello_world ubuntu@$line:$DIR/mpi_hello_world |
|||
done < $DIRhosts |
|||
|
|||
# cd to work dir |
|||
cd /ubuntu |
|||
|
|||
# run it! |
|||
mpirun -n 10 -f /ubuntu/hosts /ubuntu/mpi_hello_world 2>&1 | tee /tmp/output.log |
|||
mpirun -n 10 -f $DIRhosts $DIR/mpi_hello_world 2>&1 | tee /tmp/output.log |
|||
|
|||
|
@ -1,4 +1,4 @@ |
|||
#!/bin/bash |
|||
|
|||
get_hosts > /ubuntu/hosts |
|||
#swarmlab-getworkers > /home/ubuntu/hosts |
|||
|
|||
|
Loading…
Reference in new issue