Python DRMAA

From wiki
Revision as of 11:55, 21 December 2016 by Rf (talk | contribs)
Jump to: navigation, search

Introduction

A python interface that uses the DRMAA C-binding API to automate parts of running queue jobs, to make the process a bit more mangeable.

It is not terribly sophisticated, so is not capable of miracles, though one or two of its abilities may come in handy.

Key Points

Necessary environment variable

The user must have the following line in their .bashrc

export DRMAA_LIBRARY_PATH=/opt/sge/lib/lx-amd64/libdrmaa.so.1.0

This should be checked with

echo $DRMAA_LIBRARY_PATH

nativeSpecification

When a jobTemplate is defined, the queue options under which the job will be run are put into an opaque string, similar to how you would enter the details to qsub on the command line. You set it like this:

s = drmaa.Session()
s.initialize()
jt = s.createJobTemplate()
jt.nativeSpecification='-q single.q -pe multi 2'

So this will run the script on the single.q queue with two threads per script.

So the script can be a normal bash without any pragma (i.e. #$ ) options for the script.