From b4e7c6b4d447fb8c2c4c7cd1a97ccfaa60769186 Mon Sep 17 00:00:00 2001 From: test2 Date: Wed, 17 Jun 2020 13:56:22 +0300 Subject: [PATCH] info --- examples/run | 15 +++++++++------ examples/runbefore | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) 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