http://www.eastchem.ac.uk http://www.eastchem.ac.uk/rcf http://www.st-andrews.ac.uk http://www.ed.ac.uk


Support Pages | User Guides


Perl and SSH Submission (PaSS) User Guide

Contents

  1. Definitions

  2. Prerequisites

  3. SSH Setup

  4. rsub

  5. rstat

  6. rdel

  7. rlist

1. Definitions

This section defines the terms that are used throughout the rest of this document.

local host
The host from which your jobs will originate
remote host
The host to which you wish send jobs

2. Prerequisites

3. SSH Setup

As mentioned above, PaSS is based on having password-less access between the local and remote hosts. To allow this you must generate a public-private key pair for any hosts that you wish to submit jobs from and transfer the public key to the remote host you want to submit jobs to. This has to work in both directions so you will need to perform the steps below on both hosts that you would like to use together in the grid.

The first step is to generate a public-private key pair for the local host. On the local host:

my_user@local> ssh-keygen -t rsa

You should accept all the defaults at any questions (i.e. just press return without entering anything). The pass phrase can be left blank if you wish.

You must now check that the public part of the key contains the fully qualified domain name (FQDN) of the local host. List the contents of the public key:

my_user@local> cat .ssh/id_rsa.pub
ssh-rsa <some long string of letters and numbers> = my_user@local.host.com

If you see output like that above with the FQDN (local.host.com) instead of just the local name (local) then you are OK and can skip on to the transfer step. If not, you need to go in and edit the file to include the FQDN (you can get this from hostname -f).

Now you need to transfer the public key to the remote host. You can do this any way you like. Here, I am using scp:

my_user@local> scp .ssh/id_rsa.pub me@remote.host.com:.ssh/id_rsa.local

(You will need your password on remote.host.com for this step.) Finally, you need to transfer the contents of the public key to the authorized hosts file so the remote host knows to trust a connection from the local host. You can log in to the remote host to do this but I am going to use ssh from the local host (again, I will need my password for remote.host.com):

my_user@local> ssh me@remote.host.com 'cat .ssh/id_rsa.local >> .ssh/authorized_keys'

Now you should not need your password for remote.host.com. You can test this by issuing the following command:

my_user@local> ssh me@remote.host.com 'hostname -f'

This should not ask you for a password and should return the hostname of the remote machine.

Now you should log into remote.host.com and repeat the above process for transfers in the reverse direction.

The final step is to create a directory on remote.host.com where the files for grid jobs will be temporarily stored (called remote_jobs. Here, I do this using ssh from local.host.com

my_user@local> ssh me@remote.host.com 'mkdir remote_jobs'

Congratulations, you are now ready to use the grid!

4. rsub

rsub is the heart of the PaSS system. This utility allows the submission of batch jobs to the remote facility. It perform three functions:

  1. Transfer the input files and submission script to the remote filesystem
  2. Submit the job to the remote batch submission system (e.g. SGE)

  3. Retrieve the output files from the calculation back to the local filesystem

The simple syntax of the command is:

rsub <job script>

In order to determine the hostname and the names of files to transfer, options to rsub are specified in the job script. Options are specified by lines beginning with #% and valid options are

-user
The username to use to connect to the remote host. Defaults to username on loacl host.
-host
The FQDN of the host to submit the jobs to. No default.
-input
The names of the input files to send. Relative or absolute names. No default.
-output
Names of the output files to retrieve at the end of the job. Relative names only. Default is to get all files in the working directory.

For example:

#!/bin/bash
#
# Here are the batch system options
#$ -q serial.q
#$ -A rcf

# Here are the PaSS options
#% -user me
#% -host remote.host.com
#% -input test.in
#% -output test1.out test2.out

# Run the code
my-code < test.in

5. rstat

rstat allows the querying of the remote batch submission system to determine whether resources are free or to check the status of submitted jobs. The syntax is:

rstat <hostname> [options for remote batch system]

The options are simply the options that you would use if you were querying the local batch submission system. For example:

my_user@local> rstat me@remote.host.com -f

6. rdel

rdel allows the removal of a previously submitted job from the remote batch submission system. The syntax is:

rdel <hostname> [options for remote batch system] <jobid>

7. rlist

rlist allows the listing of useful information about the remote system. The syntax is:

rlist <hostname> [options]

Options:

-q
List the queues available on the remote host
-c
List the codes (and location of executables) for the remote host

Top

ComputationalChemistryActivity/SupportPages/EaStCHEMPaSS (last edited 2007-07-06 12:48:37 by AndrewTurner)