diff --git a/examples/run b/examples/run index d9d9873..a53cd5f 100644 --- a/examples/run +++ b/examples/run @@ -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 diff --git a/examples/runbefore b/examples/runbefore index defd5ad..946d5dd 100644 --- a/examples/runbefore +++ b/examples/runbefore @@ -1,4 +1,4 @@ #!/bin/bash -get_hosts > /ubuntu/hosts +#swarmlab-getworkers > /home/ubuntu/hosts