#!/bin/bash # compile mpicc -o /ubuntu/mpi_hello_world i./mpi_hello_world.c # scp hello wrold to all clients. sudo -u mpi for auto scp connect. see /home/mpi/.ssh while read -r line; do scp /ubuntu/mpi_hello_world ubuntu@$line:/ubuntu/mpi_hello_world done < /ubuntu/hosts # cd to work dir cd /ubuntu # run it! mpirun -n 10 -f /ubuntu/hosts /ubuntu/mpi_hello_world 2>&1 | tee /tmp/output.log