NAME
Parallel::Pvm::Scheduler - Perl extension for distributing jobs through PVM
SYNOPSIS
use Parallel::Pvm::Scheduler;
my $prm = new Parallel::Pvm::Scheduler();
# Create an array of tasks:
$tasks[0][0] = "/myhome/program1";
$tasks[0][1] = "program1 parameter 1";
$tasks[0][2] = "program1 parameter 2";
$tasks[1][0] = "/myhome/program2_noparameters";
$tasks[2][0] = "/myhome/program1";
$tasks[2][1] = "program1 parameter 1";
# Submit the tasks
for ($i = 0; $i < $taskcount; $i++)
{
$prm->submit("user-defined task description", $args[$i]);
}
# Wait for the tasks to complete
$prm->recaptureHosts(1);
DESCRIPTION
Parallel-Pvm-Scheduler is a module designed to allow one to distribute a large number of independent jobs across a cluster using PVM. It first queries the number of available machines in the cluster, then submits exactly 1 jobs per available machine. When a job is finished, it recaptures the machine and submits the next job. It repeats this until all the jobs are complete.
If all the available machines are used, it will wait until 1 becomes free before submitting the next job, hence it will sleep until a task is complete.
EXPORT
None by default.
SEE ALSO
Parallel::Pvm perl module
AUTHOR
Ryan Golhar, <golharam@umdnj.edu<gt>
COPYRIGHT AND LICENSE
Copyright 2006 by Ryan Golhar
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
new
Title : new
Usage : my $prm = new Parallel::Pvm::Scheduler();
Function: Creates and initialized a PVM resource manager
Returns : Parallel::Pvm::Scheduler
getHostCount
Title : getHostCount
Usage : $hostcount = $prm->getHostCount();
Function: Returns the number of hosts within the PVM
Returns : integer
getFreeHostCount
Title : getFreeHostCount
Usage : $freehostcount = $prm->getFreeHostCount();
Function: Returns the number of free hosts within the PVM
Returns : integer
submit
Title : submit
Usage : $prm->getFreeHostCount($taskdesc, @argv);
Function: Submits a task contained with an argument vector
Args : $taskdesc is a taskdescription. It can be anything set by the user
@argv is an argument vector. The first element is the program to execute
the remaining elements are the parameters to the program.
Notes : To execute multiple programs in serial for a single task, make a perl script
and submit the perl script as the task.
recaptureHosts
Title : recaptureHosts
Usage : $prm->recaptureHosts($block);
Function: Checks tasks for completion and prints their output
Args : $block
= 0, then iterate through all the tasks and query for their completion.
if done, free the machine
= 1, then iterate through all tasks waiting for them to complete. Does not
return until the tasks are complete.
_allocateHost
Title : _allocateHost
Function: Internal Function: Used to allocate which host runs the next task
_deallocateHost
Title : _deallocateHost
Function: Internal Function: Frees a host making it available for another task