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



Annotate this POD


New  2
Open  0
View/Report Bugs


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


A light, file based batch system.





return an array with the name of the different methods


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





Lock joblist and resourcedata dump files at once


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])


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


returns a hash ref to all the info on the job


returns a simple string with a job info


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


$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


Jobs List action


Return the job list index file


return number of jobs in the joblist


Write the joblist on disk


Read the joblist from the disk


All what concerns the machine & cluster ready to make computations


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...


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


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


Write the resourcesStatus on disk


Read the resourcesStatus from the disk



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


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:


First in/first out


Last in /first out (better be late)


Based on priority & fifo


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


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



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


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...)


Synchronize data with dump file



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

overloading "$scheduler"

just a call to $scheduler->toString()


Returns a string with the status for the different components


request data (rpc oriented)


Alexandre Masselot, <>


Please report any bugs or feature requests to, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.



Copyright (C) 2004-2006 Geneva Bioinformatics ( & 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: