Using the DRMAA Perl Binding

I'm flying out to a customer site this week to help with a trial integration between their application and Tim Harsch's DRMAA Perl binding for Grid Engine. This trip finally gave me an excuse to pull down Tim's binding and play with it a little. What follows is my helpful guide to the DRMAA Perl binding.

First thing you have to do is get a copy of Tim's module. You can find it at CPAN as Schedule-DRMAAc-0.81. In the upper right corner you'll find the download link. Once you've downloaded the link, you'll have to build the module. Tim was nice enough to include the pregenerated SWIG file, so you don't need to have SWIG, but you will need a perl interpreter.

In the module directory, there's a README that details the steps for building the module. Below is my annotated version of those steps:

  1. Source /default/common/settings.csh or /default/common/settings.sh
  2. If you're using Solaris, determine whether your Perl binary is 32-bit or 64-bit. The easiest way is to run file `which perl`, assuming Perl is in your path.
    1. If it's 64-bit and you're running Grid Engine 6.0, you're fine
    2. If it's 64-bit and you're running Grid Engine 6.1, you need to set your library path to include $SGE_ROOT/lib/`$SGE_ROOT/util/arch`
    3. If it's 32-bit and you're on an AMD machine, you need to set your library path to start with $SGE_ROOT/lib/sol-x86. Note that you will probably have to download the x86 Grid Engine binaries and install them.
    4. If it's 32-bit and you're on a SPARC machine, you need to set your library path to start with $SGE_ROOT/lib/sol-sparc. Note that you will probably have to download the 32-bit SPARC Grid Engine binaries and install them.
  3. Make a local link to the DRMAA header file: ln -s $SGE_ROOT/include/drmaa.h
  4. Create the makefile: perl Makefile.PL
  5. Build the module: make
  6. Test the module: make test. Make sure that your Grid Engine grid is running before doing this step.
  7. Install the module as root: make install

Once you have the module installed, you're ready to give it a try. In the module directory you'll find an examples subdirectory. Try running one or two of these scripts. If you're successful, you're ready to start writing code! Documentation for the module gets installed in the perl man directory when you install the module. To view the module docs, run man -M /usr/perl5/man Schedule::DRMAAc. (On my machine it's actually /usr/perl5/5.8.4/man.) As the docs are a little hard to read, you might want to also check out the C binding howto. It's for C, not Perl, but the Perl binding is a wrapper around the C binding, so all the same rules still apply. In any case there should be enough examples in the examples directory and the C binding howto to get you started with whatever project you have planned.

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

templedf

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today