Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

batch_job.h File Reference


Detailed Description

Batch job submission.

This module implements batch job submission to multiple systems, currently Condor and plain Unix processes. The simplifies the construction of parallel abstractions that need a simple form of parallel process execution.

#include <time.h>

Go to the source code of this file.

Data Structures

struct  batch_job_info
 Describes a batch job when it has completed. More...

Typedefs

typedef int batch_job_id_t
 An integer type indicating a unique batch job number.

Enumerations

enum  batch_queue_type_t {
  BATCH_QUEUE_TYPE_UNIX,
  BATCH_QUEUE_TYPE_CONDOR,
  BATCH_QUEUE_TYPE_SGE,
  BATCH_QUEUE_TYPE_WORK_QUEUE
}
 Indicates which type of batch submission to use. More...

Functions

batch_queue * batch_queue_create (batch_queue_type_t type)
 Create a new batch queue.
void batch_queue_delete (struct batch_queue *q)
 Delete a batch queue.
batch_job_id_t batch_job_submit (struct batch_queue *q, const char *cmd, const char *args, const char *infile, const char *outfile, const char *errfile, const char *extra_input_files, const char *extra_output_files)
 Submit a batch job..
batch_job_id_t batch_job_wait (struct batch_queue *q, struct batch_job_info *info)
 Wait for any batch job to complete.
int batch_job_remove (struct batch_queue *q, batch_job_id_t jobid)
 Remove a batch job.


Typedef Documentation

typedef int batch_job_id_t
 

An integer type indicating a unique batch job number.


Enumeration Type Documentation

enum batch_queue_type_t
 

Indicates which type of batch submission to use.

Enumeration values:
BATCH_QUEUE_TYPE_UNIX  Batch jobs will run as local Unix processes.
BATCH_QUEUE_TYPE_CONDOR  Batch jobs will be sent to Condor pool.
BATCH_QUEUE_TYPE_SGE  Batch jobs will be sent to Sun Grid Engine.
BATCH_QUEUE_TYPE_WORK_QUEUE  Batch jobs will be send to the Work Queue.


Function Documentation

struct batch_queue* batch_queue_create batch_queue_type_t  type  ) 
 

Create a new batch queue.

Parameters:
type The type of the queue.
Returns:
A new batch queue object.

void batch_queue_delete struct batch_queue *  q  ) 
 

Delete a batch queue.

Parameters:
q The batch queue to delete.

batch_job_id_t batch_job_submit struct batch_queue *  q,
const char *  cmd,
const char *  args,
const char *  infile,
const char *  outfile,
const char *  errfile,
const char *  extra_input_files,
const char *  extra_output_files
 

Submit a batch job..

Parameters:
q The queue to submit to.
cmd The command to execute.
args The command line arguments.
infile The standard input file.
outfile The standard output file.
errfile The standard error file.
extra_input_files A comma separated list of extra input files that will be required by the job. Null pointer is equivalent to empty string.
extra_output_files A comma separated list of extra output files to retrieve from the job. Null pointer is equivalent to empty string.
Returns:
A unique identifier for the batch job.

batch_job_id_t batch_job_wait struct batch_queue *  q,
struct batch_job_info info
 

Wait for any batch job to complete.

Blocks until a batch job completes.

Parameters:
q The queue to wait on.
info Pointer to a batch_job_info structure that will be filled in with the details of the completed job.
Returns:
If greater than zero, indicates the job id number of the completed job. If equal to zero, there were no more jobs to wait for. If less than zero, an error occurred while waiting, but the operation may be tried again.

int batch_job_remove struct batch_queue *  q,
batch_job_id_t  jobid
 

Remove a batch job.

This call will start the removal process. You must still call batch_job_wait to wait for the removal to complete.

Parameters:
q The queue to remove from.
jobid The job to be removed.
Returns:
Greater than zero if the job exists and was removed, zero otherwise.


Generated on Fri Jun 5 11:10:54 2009 for cctools by  doxygen 1.3.9.1