ComputationalChemistryActivity
RemoteSubmission | GlobusToolkitTog | PerlAndSSHSubmission
Perl and SSH Submission (PaSS) User Guide
Contents
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
- A username on both the local host and the remote host
- Perl installed on both hosts
- SSH installed on both hosts
3. SSH Setup
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.
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
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
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:
my_user@local> ssh me@remote.host.com 'cat .ssh/id_rsa.local >> authorized_keys'
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:
- Transfer the input files and submission script to the remote filesystem
Submit the job to the remote batch submission system (e.g. SGE)
- 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