Alexandre Masselot > BatchSystem-SBS > BatchSystem::SBS::DefaultScheduler

Download:
BatchSystem-SBS-0.41.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  2
Open  0
View/Report Bugs
Source  

NAME ^

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

DESCRIPTION ^

A light, file based batch system.

SYNOPSIS ^

EXPORT ^

FUNCTIONS ^

scheduling_methodList()

return an array with the name of the different methods

METHODS ^

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 ^

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

BUGS ^

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 ^

COPYRIGHT & LICENSE ^

Copyright (C) 2004-2006 Geneva Bioinformatics (www.genebio.com) & Jacques Colinge (Upper Austria University of Applied Science at Hagenberg)

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

syntax highlighting: