BatchSystem::SBS::DefaultScheduler - a scheduler for the Simple Batch System


BatchSystem-SBS documentation  | view source Contained in the BatchSystem-SBS distribution.

Index


NAME

Top

BatchSystem::SBS::DefaultScheduler - a scheduler for the Simple Batch System

DESCRIPTION

Top

A light, file based batch system.

SYNOPSIS

Top

EXPORT

Top

FUNCTIONS

Top

scheduling_methodList()

return an array with the name of the different methods

METHODS

Top

my $scheduler=BatchSystem::SBS::DefaultScheduler->new();

Accessors

$scheduler->

Misc

$scheduler->__lockdata()

Lock joblist and resourcedata dump files at once

$scheduler->__unlockdata()

Unlock joblist and resourcedata dump files at once

Job action

$scheduler->job_submit(id=>val, dir=>dir, command=>cmd, queue=>queue)

$scheduler->job_status(id=>val [,status=>STATUS])

$scheduler->job_remove(id=>val)

Remove the job #jobid from the list (maybe kill its processe if running

$scheduler->job_signal(id=>val, signal=>SIG)

Send a signal to a running job

$scheduler->job_action(id=>val, action=>ACTION)

Send an action to a registered job.

ACTION can be of

KILL kill the processe or just take the joib out of the queue is it is PENDING

$scheduler->job_info(id=>val);

returns a hash ref to all the info on the job

$scheduler->job_infoStr(id=>val);

returns a simple string with a job info

$sheduler->job_properties(id=>val);

Return a reference to a Util::Properties object, stored into a "batch.properties" files in the job directory;

$sheduler->job_execute(id=>val);

$sheduler->__job_execute_scriptmorfer(id=>val, script=>scriptfile)

It is an internal command that transform the submit script (if it was not just a command) into the ready to execute script.

It meas that it will replace expression with the runtime value

${jobid}
${machinefile}
${host}
${queue}

Jobs List action

$sbs->joblist_index();

Return the job list index file

$sbs->joblist_size();

return number of jobs in the joblist

$scheduler->__joblist_dump();

Write the joblist on disk

$scheduler->__joblist_pump();

Read the joblist from the disk

Resources

All what concerns the machine & cluster ready to make computations

$scheduler->resources_check()

Make a coherence check of the resources status (if a resource is attributed to a dead job, for example, it will be freed). This should not be called, except to solve some spurious locking problems - that shoould anyway not exist anymore...

$scheduler->resources_removenull()

remove null ID job (well, that's not the cleverest piece of code design...)

$scheduler->resourcesStatus_init()

Synchronize resources defined in the configuration with the one in resourcesStatus()

$scheduler->__resourcesStatus_dump();

Write the resourcesStatus on disk

$scheduler->__resourcesStatus_pump();

Read the resourcesStatus from the disk

Scheduling

$scheduler->scheduling_update()

Run a scheduler->scheduling_next_reserve() + a submition on returned jobs

$scheduler->scheduling_method(name)

Set the scehduling method (see BatchSystem::SBS::DefaultScheduler::scheduling_methodList() to have a list of all possible methods)

Scheduling method sorting methods take a list of pending jobs an reorder them by priority (warning: it may happen that the returned list is shorter than the input one (in case there is a limit on the number of submission for one queue, for example).

Scheduling available are:

fifo

First in/first out

lifo

Last in /first out (better be late)

random
priorityfifo

Based on priority & fifo

prioritylimit

based on priority + fifo + maxConcurentJob per queues (if a queue is generated via a regular expression, eaxch queue is counted separately).

scheduler->scheduling_next_reserve()

Find the next job to be submited, according to the scheduling method_name. It does not start the job, but status it as READY, and reserve the resourceStatus and attribute it the job id

Queues

$scheduler->queues_check()

Make a tour of the queue and see that if they are attributed to a job, the job is no ended...

$scheduler->__queues_exist($qname)

Check if the queue exists. It is not straight forwards because of queue that can be dynamically defined at runtime. In this case, regexp must be checked, and queue duplicated...

For example, if a queue was defined in the config file with name "default_user_\w+", it will be possible to submit to queues "default_user_joe", "default_user_jack" etc. These queues will be dynamically created when $scheduler->__queues_exist($qname) is called

$scheduler->__queue_validResource($qname, \%resource)

Check if the given resource correspond to the queue needs

$scheduler->__queue_insert(job=>\%job, queue=>$queuename, resourceStatus=\%resourceStatus);

Insert a job in a queue, deal with all labeling, queue counter etc. etc.

$scheduler->__queue_remove(job=>\%job [, jobstatus=>(COMPLETED|ERROR)]);

Remove a job from a queue, deal with all labeling, queue counter etc. etc.

Default jobstatus is EXIT

Queues status

stores the queuse status (last acession time...)

$scheduler->queuesStatus_init()

Synchronize data with dump file

IO

$scheduler->readConfig(twigelt=>XML::Twig::Elt)

Read its config from an xml file (see examples/ dir)

overloading "$scheduler"

just a call to $scheduler->toString()

$scheduler->toString([skip_joblist=>1],[,skip_resources=>1][,skip_resourcesStatus=>1]

Returns a string with the status for the different components

$scheduler->dataRequest(request=>'req1,req2...')

request data (rpc oriented)

AUTHOR

Top

Alexandre Masselot, <alexandre.masselot@genebio.com>

BUGS

Top

Please report any bugs or feature requests to bug-batchsystem-sbs@rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=BatchSystem-SBS. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

ACKNOWLEDGEMENTS

Top

COPYRIGHT & LICENSE

Top


BatchSystem-SBS documentation  | view source Contained in the BatchSystem-SBS distribution.