[GE users] Python DRMAA

Sean Davis sdavis2 at mail.nih.gov
Fri May 16 19:39:40 BST 2008


    [ The following text is in the "UTF-8" character set. ]
    [ Your display is set for the "ISO-8859-10" character set.  ]
    [ Some characters may be displayed incorrectly. ]

On Fri, May 16, 2008 at 10:03 AM, Enrico Sirola <enrico.sirola at gmail.com> wrote:
> Hello Sean,
>
> Il giorno 16/mag/08, alle ore 11:16, Sean Davis ha scritto:
>
>> I am interested in potentially using the python DRMAA library for some
>> simple scripted job control.  All I could find was a set of source
>> files from 2005.  Could anyone comment on DRMAA and python with SGE
>> 6.1u2?
>
> The drmaa module for python is used in a production system since 2005 and
> behaved well until now. The SGE version I use is 6.0u8, however I'm
> interested in having feedback from the GE 6.1 series.
> If you decide to use it, please let me know how it behaves,

Enrico,

The module seems to work OK.  I made a couple of small changes to
setup.py to use os.environ['SGE_ROOT'] rather than the hard-coded path
that is in the download from the grid engine site.

Might I ask another question?  Submitting the "sleeper.sh" job works
fine from python using the simple code below.  However, if I replace
that with a script that runs fine using qsub, I am getting a
permissions error from shepherd.  Any idea why that might be?

Thanks,
Sean

#!/usr/bin/env python
import DRMAA
import os

def main():
    s=DRMAA.Session()
    print 'A DRMAA object was created'
    s.init()
    print 'A session was started successfully'

    jt = s.createJobTemplate()
    jt.remoteCommand = '/usr/local/sge/examples/jobs/sleeper.sh'
    jobid = s.runJob(jt)
    print 'Your job has been submitted with id ' + jobid

    print 'Cleaning up'
    s.deleteJobTemplate(jt)
    s.exit()

if __name__=='__main__':
    main()

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe at gridengine.sunsource.net
For additional commands, e-mail: users-help at gridengine.sunsource.net




More information about the gridengine-users mailing list