Glasgow Job Wrapper Guide

From GridPP Wiki
Jump to: navigation, search

Running executables with GANGA

First of all log in and initialise your proxy as normal:

  • Login to ppeui.
  • Initialise a proxy (grid-proxy-init)
 $ grid-proxy-init

Copy Necessary Files

  • Now copy over all the files necessary to run your job using gsisftp
 $ gsisftp -oPort=2222  svr020.gla.scotgrid.ac.uk

This will open up sftp, in this mode you can copy over files using 'put'

  sftp> put test.exe
  Uploading test.exe to /clusterhome/home/gla019/test.exe
  test.exe 

Remember to replace test.exe with your own files and gla019 with your username. Exit sftp using CTRL-D.

Now login to svr020.gla.scotgrid.ac.uk on port 222 using

 $ gsissh -p 2222 svr020.gla.scotgrid.ac.uk

and copy the file you transfered to your shared directory

 $ cp test.exe /cluster/share/gla019/

Run Ganga

If you are new to Ganga familiarise yourself with the Glasgow_Ganga_Quickstart_Guide. When ready activate Ganga as normal:

    $ganga

To run on the grid use

     $ In [4]:gridJob=Job(backend=LCG(),application=Executable(exe=File('/cluster/share/gla019/test.exe'), 
args=['1','2','3']))

This is equivalent to executing the command

   $/cluster/share/gla019/test.exe 1 2 3

and will run the job anywhere your VO is supported. However you can target specific sites if you wish, for instance to target glasgow you would use:

  $ In [5]:gridJob.backend.CE='svr016.gla.scotgrid.ac.uk:2119/jobmanager-lcgpbs-gridpp'

To actually submit the job use

In [6]:gridJob.submit()
Ganga.GPIDev.Lib.Job               : INFO     submitting job 3
Ganga.GPIDev.Adapters              : INFO     submitting job 3 to LCG backend
Ganga.GPIDev.Lib.Job               : INFO     job 3 status changed to "submitted"
Out[6]: 1

You can check on the output using

In [7]:!cat $gridJob.outputdir/stdout

The exclamation mark before the cat command above is the way to tell IPYTHON that you issue a shell command. The dollar sign indicates that you return to a python command. By default, ganga will store jobs' outputs in ~/gangadir/workspace/Local/JOB_ID/output, where JOB_ID is a sequential job number.

This mechanism is called an input sandbox and is designed to handle small files (up to few MB). More information about handling files can be found in the ganga documentation.