test2
4 years ago
2 changed files with 10 additions and 7 deletions
@ -1,17 +1,20 @@ |
|||||
#!/bin/bash |
#!/bin/bash |
||||
|
|
||||
# compile |
# 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 |
# scp hello wrold to all clients. sudo -u mpi for auto scp connect. see /home/mpi/.ssh |
||||
|
swarmlab-getworkers > $DIRhosts |
||||
while read -r line; |
while read -r line; |
||||
do |
do |
||||
scp /ubuntu/mpi_hello_world ubuntu@$line:/ubuntu/mpi_hello_world |
scp $DIR/mpi_hello_world ubuntu@$line:$DIR/mpi_hello_world |
||||
done < /ubuntu/hosts |
done < $DIRhosts |
||||
|
|
||||
# cd to work dir |
|
||||
cd /ubuntu |
|
||||
|
|
||||
# run it! |
# 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 |
#!/bin/bash |
||||
|
|
||||
get_hosts > /ubuntu/hosts |
#swarmlab-getworkers > /home/ubuntu/hosts |
||||
|
|
||||
|
Loading…
Reference in new issue