Subsections

GROWL LIBRARY

Chapter to be updated.

This chapter provides an introduction to the GROWL Library.


Quick Reference

This section provides a quick reference for the current list of functions included with GROWL. It is based on annotation of the contents of growl.h. The GROWL library is modular, so this list can expand with time. The remaining chapters document each module and illustrate its use.

Authentication

int growl_getDelegation(char *uid, char *passPrase, int ttl, char *oldId, char **sessionId); get a delegated proxy from MyProxy and associate it with a unique session key.

int growl_testDelegation(char *oldId, char **sessionId); test if the proxy associated with the given session key is still valid.

int growl_rmDelegation(char *oldId); delete proxy associated with the session key.

Resources

int growl_xmlAll(char **result); get XML description of all resources known to GROWL.

int growl_xmlDescription(char *target, char **result); get an XML description of a given target.

int growl_mdsLast(char *target, char **result); get cached values of MDS description of target.a

int growl_mdsCurrent(char *target, char **result); get description of target from live MDS server.

Jobs

int growl_jobRun(char *sessionId, char *target, char *directory, char *environment, char *executable, char *arguments, char **response); submit a job to target compute resource via Globus GRAM.

Files

SRB

Netsolve

R

int growl_testR(char *input1, char *input2, char **result); runs a remote test job written in R.

Example

This section contains and example of components of a code which a typical user might write to integrate with an existing application or to form the basis for a new one. We will walk through this code.

[frame=single]

#include 'growl.h' 

int main(int argc, char **argv) { 
   char uid[]="rja";
   char passPhrase[]="new passwd";
   int ttl=2; 
   char oldId[]="f6a6d3fe-1b36-4131-8dbe-dd29a5c483c5";
   char *sessionId;

   char target[]="login.hpcx.ac.uk";
   char directory[]="/home/rja/tempdir";
   char environment[]="";
   char executable[]="/home/rja/appdir/myApp";
   char arguments[]="inputFile.dat";
   char *response;

   int res;

// first make sure a valid poxy is available and obtain a session id
   res = growl_testDelegation(oldId, &sessionId);
   if(strcmp(oldId,sessionId)) {
       printf("Need to renew session\n");
       strcpy(oldId, sessionId);
       res = growl_getDelegation(uid, passPhrase, ttl, oldId, &sessionId);
   }

// now submit an application to run on a computer
   res = growl_jobRun(sessionId, target, directory, 
                      environment, executable, arguments, &response);
   if(res == 0) {
     printf("Response from job: %s\n", response);
   } else
     printf("GROWL call failed\n");

// tidy up and quit
   free(response);
   res = growl_rmDelegation(sessionId);
}
Rob Allan 2009-11-10