Add support for running jobs locally

Add a quick workaround allowing to run jobs locally making use of
multiple cores. One sub-process is spawned for each core to be used
stearing the running of the jobs.

The behaviour can be configured by two options "shell" and "cores".
"shell" defines the shell that is used to process the job commands.
"cores" defines the number of cores that should be occupied in parallel,
if "cores" is 0, all cores available on the system are used.

The following restrictions apply:
* it is not possible to delete running jobs, only those still waiting
  for execution can be removed
* cancelling (e.g. CTRL+C) the main program/script will also cancel the
  sub-processes
* no job tracking across program restarts, non-finished jobs are lost
* in case the program/script finishes normally, the sub-processes are
  not properly terminated
Merge pull request #14 from suhlatwork/local

Add support for running jobs locally
Add function to submit multiple jobs at once

Add a function to be able to submit several jobs with one call to
batchelor. The argument to the new 'submitJobs' function is a list of
the arguments of the 'submitJob' function. In case an implementation
does not provide a 'submitJobs' function itself, 'submitJob' is called
for each job to be submitted.

The return value of 'submitJobs' is a list of the job IDs. An ID of -1
means that there was an error while submitting. Unfortunately the
exceptions cannot be passed through if 'submitJobs' is not implemented.
Bugfix: Remove 'self' outside a class

Remove two occurences of 'self' outside of any class, must have been a
C&P error.
Remove not needed 'self's

Remove a couple of unneeded 'self's concerning the information shared
between the various processes. Apparently the manager takes care that
those variables are accessible from anywhere, so do not bother to store
a link in the 'Worker' class.
Add 'shutdown' method

Add a 'shutdown' method that should be called if the program using
batchelor is closed. By default this method does not do anything.
Implement 'shutdown' function for 'Local' implementation

Implement a 'shutdown' function for the 'Local' implementation which
takes care to finish all jobs in the queue, and gracefully stop the
spawned subprocesses, getting rid of a number of messages at the end of
a program connected to the hard stopping of those.
Implement 'submitJobs' for C2PAP

Implement the 'submitJobs' function for C2PAP. Fo rthis cluster, the
execution of the submit program takes exceedingly long, so do this in
parallel for all job sto be submitted.
Set default job name in 'submitJobs'

In accordance with what is done for the 'submitJob' method of the
'Batchelor' class, set a default job name of 'None', if no job name is
explicitely specified. This way the 'submitJobs' functions of the actual
implementation can rely on always having this information.
Add documentation to 'submitJobs' method

Add some documentation explaining the arguments and return values of
'submitJobs' of the 'Batchelor' class.
Clean shutdown for Local option

If a SIGINT (e.g., CTRL+C) was send to the main process, it was also
send to all its child processes. This could be ignored for the worker
processes, but not for the Manager process (at least with python 2.6).
With a missing Manager process, also the worker processes stoppped.
Using threads instead of processes seems to cure this problem.
Merge pull request #15 from suhlatwork/master

Improvements for 'Local' and 'C2PAP'.
Prevent batchelor from changing arguments.

In C2PAP's submitJobs function, the list of job arguments which was passed to
it was changed. Prevent this by creating a new list with the altered arguments
instead so that the list given by the user can be recycled.
Merge pull request #16 from legordian/master

Prevent batchelor from changing arguments.
Implement submit array jobs.

Implement submit array jobs in main batchelor class. It is independent
of the classic submitJobs command. Currently the jobName parameter has
to be specified.
Add full support for job Arrays in E18 submodule.

Add return value list(tuple) to getListOfActiveJobs and add support
for this list throughout the module. Rewrite getListOfActiveJobs.
Add full support for job Arrays in lxplus submodule.

Add return value list(tuple) to getListOfActiveJobs and add support
for this list throughout the module.
Add full support for job Arrays in gridka submodule.

Add return value list(tuple) to getListOfActiveJobs and add support
for this list throughout the module.
Fixed functions which use getListOfActiveJobs

The function getListOfActiveJobs now returns a list of tuples
(jobId, jobTaksId, jobStatus), therefore simple tests whether a job ID is in
the list do no longer work. Create a temporary list containing only the
job ID from the tuple.
Removed default array parameters

Removed default array parameters in submitArrayJob, also moved jobName to the
last parameter, as it now is the only parameter without a default value.