new()set_bin_dir()get_status()update_status()get_error()get_jobid()set_contact()set_executable()set_cpus()set_queue()set_maxtime()set_timeout()set_jobid()get_delegation()submit()cancel()get_stderr()get_stdout()
Cog::Globus::Job
This module is used to submit, monitor, and crontrol batch jobs using a globus gatekeeper. Job objects are created with new(), then the other subroutines are used to work with the job. A working globus gatekeeper is required to be running already. This module also assumes that you will set the required environment variables and have a valid proxy on hand.
use Cog::Globus::Job;
use Cog::Globus::Job; my $job = Cog::Globus::Job->new( contact => $host, executable => $exe, maxtime => $maxtime, cpus => $cpus, queue => $queue );
$job->submit();
$stat = $job->get_status();
my @stdout = $job->get_stdout();
print $job->to_string();
Maytal Dahan, maytal@tacc.utexas.edu Catherine Mills, cmills@sdsc.edu Stephen Mock, mock@sdsc.edu
new()
Description/Usage:
Used to instantiate a Job object with parameters describing the
Globus job.
$job = Cog::Globus::Job->new(
contact=>'tfglobus.sdsc.edu/jobmanager-loadleveler',
executable=>'/home/user/mpijob -arg 1234',
maxtime=>'120',
cpus=>'16',
queue=>'normal'
);
Required Arguments:
contact - the globus job gatekeeper contact
executable - the executable plus optional arguements
cpus - the nuber of cpus the job will run on
queue - the queue to run the job in
Returns: a Cog::Globus::Job object or undef
set_bin_dir()
Description/Usage:
Internal sub to find and set the binary directory
$self->set_bin_dir($Cog::Config::globus_bin_dir);
Required Arguments:
-the directory you'd like to set
Returns: the directory set or undef
get_status()
Description/Usage:
Returns the status of a globus job. (runs update_status to refresh it)
$job = Cog::Globus::Job->new(
contact=>'tfglobus.sdsc.edu/jobmanager-loadleveler',
executable=>'/home/user/mpijob -arg 1234',
maxtime=>'120',
cpus=>'16',
queue=>'normal'
);
$job->submit()
$status = $job->get_status();
Required Arguments:
none
Returns: a job status string or undef
update_status()
Description/Usage:
Used internally to contact the jobmanger and get the current status of a job
Required Arguments:
Returns: the status string
get_error()
Description/Usage:
Used to get the error set within a job object
$job = Cog::Globus::Job->new(
....etc....
);
$job->submit();
print $job->get_error();
Required Arguments: none. called on the job object
Returns: a error or undef
get_jobid()
Description/Usage:
Used to get the jobid of a Job object
$job = Cog::Globus::Job->new(
....etc....
);
$job->submit();
print $job->get_jobid();
Required Arguments: none. called on the job object
Returns: the jobid or undef
set_contact()
Description/Usage:
Internal sub used to set the contact string of a Job object
$self->set_contact('tfglobus.sdsc.edu');
Required Arguments:
-the contact string you wish to set
Returns: nothing
set_executable()
Description/Usage:
Internal sub used to set the executable to run of a Job object
$self->set_executable('/bin/ls');
Required Arguments:
-the executable to be set
Returns: nothing
set_cpus()
Description/Usage:
Internal sub used to set the number of cpus to run on of a Job object
$self->set_cpus('8');
Required Arguments:
-the number of cpus to be set
Returns: nothing
set_queue()
Description/Usage:
Internal sub used to set the job queue of a Job object
$self->set_queue('Express');
Required Arguments:
-the name of the queue
Returns: nothing
set_maxtime()
Description/Usage:
Internal sub used to set the maximum runtime of a job in a Job object
$self->set_maxtime('120'); #minutes
Required Arguments:
-the time in minutes
Returns: nothing
set_timeout()
Description/Usage:
Internal sub used to set the timeout for launching a job in a Job object
$self->set_timeout('30'); #seconds
Required Arguments:
-the timeout in seconds before the attempt to submit the job will fail
Returns: nothing
set_jobid()
Description/Usage:
Internal sub used to set the jobid of a Job object
$self->set_jobid('http://tfglobus.sdsc.edu/12354234/2465323456');
Required Arguments:
-the globus jobid
Returns: nothing
get_delegation()
Description/Usage:
Returns a string representation of a job.
$job = Cog::Globus::Job->new( ... );
print $job->to_string();
Returns:
A string containing
host contact
executable + args
cpus
queue
maxtime
timeout
error
submit()
Description/Usage:
Used to submit the job created in the job object
$job = Cog::Globus::Job->new ( ... );
$job->submit();
Returns:
-the jobid of the submitted job
cancel()
Description/Usage:
Used to submit the job created in the job object
$job = Cog::Globus::Job->new ( ... );
$job->submit();
$job->cancel();
Required Arguments: none
Returns: nothing
get_stderr()
Description/Usage:
Used to submit the job created in the job object
$job = Cog::Globus::Job->new ( ... );
$job->submit();
$job->get_stderr();
Required Arguments: none
Returns:
-the stderr from the job
get_stdout()
Description/Usage:
Used to submit the job created in the job object
$job = Cog::Globus::Job->new ( ... );
$job->submit();
$job->get_stdout();
Required Arguments: none
Returns:
-the stdout of the submitted job
Cog::lib::Cog::Globus::Job, Cog::lib::Cog::Globus::RSL, Cog::lib::Cog::Globus::Run, Cog::lib::Cog::Globus::URLCopy, Cog::lib::Cog::MDS::Search, Cog::lib::Cog::Security::Cacl, Cog::lib::Cog::Security::Myproxy, Cog::lib::Cog::Security::Proxy, Cog::src::Config, CogUtil::lib::CogUtil::Log, CogUtil::lib::CogUtil::UnixRun, Gridport::lib::Gridport::Authentication, Gridport::lib::Gridport::FileTransfer, Gridport::lib::Gridport::Job, Gridport::lib::Gridport::ProxyForward, Gridport::lib::Gridport::SRB, NWS::lib::NWS, SRB::lib::SRB