<<

NAME

Inca::Reporter::GlobusUnit - Convenience module for creating simple unit reporters that submit a test via globus

SYNOPSIS

  use Inca::Reporter::GlobusUnit;
  my $reporter = new Inca::Reporter::GlobusUnit(
    name => 'Reporter Name',
    version => 0.1,
    description => 'A really helpful reporter description',
    url => 'http://url.to.more.reporter.info'
    unit_name => 'What this reporter tests'
  );

DESCRIPTION

This module is a subclass of Inca::Reporter::SimpleUnit which provides convenience methods for submitting a unit test via globus.

CLASS METHODS

new

Class constructor which returns a new GlobusUnit object. See Inca::Reporter::SimpleUnit for parameters.

submitCSource(%attrs)

Submit a small C program to execute via a local GRAM. In addition to the parameters recognized by submitJob, the required $attrs{code} specifies the source to compile.

submitJob(%attrs)

Submit a job to execute a command via Globus. Recognized parameters:

arguments

arguments to pass to executable; default ''

check

poll job for completion every this many seconds; default 30

cleanup

remove temporary files after run; default true

count

number of hosts to use; default 1

debug

log the submision command and the result with -dumprsl; default false

duroc

add (resourceManagerContact=xx) to rsl; default false

executable

the program to run; required

env

environment variable to set; default ''

host

host where run takes place; default localhost

mpi

execute as an MPI program; default false

queue

name of batch queue to submit job to; default none

remote

executable is already on the jobmanager resource; default 1

service

the Globus service to invoke; default to Globus default

timeout

kill the job and report an error after this many seconds; default 3600 (1 hr)

EXAMPLE

  my $reporter = new Inca::Reporter::GlobusUnit(
    name => 'Globus hello',
    version => 1,
    description => 'Verifies local Globus exec of hello world',
    url => 'http://www.globus.org',
    unit_name => 'Globus hello'
  );

  my ($output, $err) = $reporter->submitCSource(
    code =>
  "#include <stdio.h>
   int main() {
      printf(\"Hello world\\n\");
      return 0;
   }
  "
  );

  if(!defined($output) || $output !~ /Hello/) {
    $reporter->unitFailure
      ("test failed" . (defined($err) ? ": $err" : ''));
  } else {
    $reporter->unitSuccess();
  }
  $reporter->print();

AUTHOR

Shava Smallen <ssmallen@sdsc.edu>

SEE ALSO

Inca::Reporter::SimpleUnit

<<