Setting up a MPI cluster on Ubuntu machines

  1. Bring up your machines and ensure you have SSH access to them. I'm using two Ubuntu 14.04 LTS VMs.
  2. Install MPI on each machine by running sudo apt-get install libcr-dev mpich2 mpich2-doc
  3. Create an MPI user using sudo adduser mpiuser
  4. Log into mpiuser with su - mpiuser
  5. Generate an ssh key for mpiuser: ssh-keygen
  6. Append the newly generated public key (~/.ssh/ to the other machine's ~/.ssh/authorized_keys file
  7. Set up NFS for a shared file system
    1. On one machine:
      1. sudo apt-get install nfs-kernel-server
      2. mkdir mpi_shared
      3. Add /home/mpiuser/mpi_shared *(rw,sync,no_root_squash,no_subtree_check) to /etc/exports
      4. exportfs -a
      5. sudo service nfs-kernel-server restart
    2. On the other:
      1. sudo apt-get install nfs-common
      2. mkdir mpi_shared
      3. Add <other machine hostname>:/home/mpiuser/mpi_shared /home/mpiuser/mpi_shared cloud nfs to /etc/fstab