Using the DRMAA Perl Binding
By templedf on Apr 16, 2007
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:
/default/common/settings.csh or /default/common/settings.sh
- 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.
- If it's 64-bit and you're running Grid Engine 6.0, you're fine
- If it's 64-bit and you're running Grid Engine 6.1, you need to set your library path to include
- 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.
- 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.
- Make a local link to the DRMAA header file:
ln -s $SGE_ROOT/include/drmaa.h
- Create the makefile:
- Build the module:
- Test the module:
make test. Make sure that your Grid Engine grid is running before doing this step.
- Install the module as root:
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.