Browse Source

info

master
test2 5 years ago
parent
commit
b4e7c6b4d4
  1. 15
      examples/run
  2. 2
      examples/runbefore

15
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

2
examples/runbefore

@ -1,4 +1,4 @@
#!/bin/bash
get_hosts > /ubuntu/hosts
#swarmlab-getworkers > /home/ubuntu/hosts

Loading…
Cancel
Save