Skip to content

Instantly share code, notes, and snippets.

@lionell
Last active December 7, 2017 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lionell/223822fb43ac521f25b8fb855bd9fdd8 to your computer and use it in GitHub Desktop.
Save lionell/223822fb43ac521f25b8fb855bd9fdd8 to your computer and use it in GitHub Desktop.
How to Derevyan

How to DEREVYAN

PLEASE READ Andrey Guide FIRST!!!

Generate SSH keypair on the localhost

  1. Run ssh-keygen -t rsa
  2. Enter filename for key(eg. )
  3. Leave password emtpy

Send our public key to the cloud instance(only master)

  1. Run scp <USER>.pub <USER>@<EXTERNAL_IP_OF_FIRST_INSANCE>:/home/<USER>/.ssh
  2. Add it to authorized_keys. To do this run cat .ssh/<USER>.pub >> .ssh/authorized_keys

Verify SSH connection

To do this try to SSH into machine ssh -i <USER> <USER>@<EXTERNAL_IP_OF_FIRST_INSANCE>. You should be greated with welcome message.

Make a copy of the instance

  1. Create snapshot based on the instance-1
  2. Create instance-2 based on the snapshot.

Verify SSH connection to instance-2

  1. Run ssh -i <USER> <USER>@<EXTERNAL_IP_OF_SECOND_INSTANCE>
  2. You should see welcome message.

Copy your private key to instance-1

We need this to be able to run mpirun on the instance-1.

  1. Run scp <USER> <USER>@<EXTERNAL_IP_OF_FIRST_INSANCE>:/home/<USER>/.ssh
  2. Rename key to id_rsa. Run mv .ssh/<USER> .ssh/id_rsa.
  3. To verify that everything works run ssh <INTERNAL_IP_OF_SECOND_INSTANCE>.
  4. You should see welcome message.

Create HOSTFILE

We need to provide IP addresses to MPI.

  1. Create hostfile on instance-1. Run touch hostfile.
  2. Run echo <INTERNAL_IP_OF_THE_INSTANCE> >> hostfile for each machine in the cluster.

Run MPI

Now you can run your program on the cluster.

mpirun -n <NUMBER_OF_PROCESSES> --hostfile hostfile ./<APPLICATION>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment