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.

18 lines
443B

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