You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
465 B

5 years ago
#!/bin/bash
# compile
4 years ago
DIRhosts=/home/ubuntu/mpitmp/hosts
DIR=/home/ubuntu/mpitmp
mkdir -p $DIR
mpicc -o $DIR/mpi_hello_world ./mpi_hello_world.c
5 years ago
# scp hello wrold to all clients. sudo -u mpi for auto scp connect. see /home/mpi/.ssh
4 years ago
swarmlab-getworkers > $DIRhosts
5 years ago
while read -r line;
do
4 years ago
scp $DIR/mpi_hello_world ubuntu@$line:$DIR/mpi_hello_world
done < $DIRhosts
5 years ago
# run it!
4 years ago
mpirun -n 10 -f $DIRhosts $DIR/mpi_hello_world 2>&1 | tee /tmp/output.log
5 years ago