The work queue provides an implementation of the master-worker computing model using TCP sockets, Unix applications, and files as intermediate buffers. A master process uses work_queue_create to create a queue, then work_queue_submit to submit tasks. Once tasks are running, call work_queue_wait to wait for completion. The generic worker
program can be run on any machine, and simply needs to be told the host and port of the master.
#include "timestamp.h"
Go to the source code of this file.
Data Structures | |
struct | task_file |
A file for input to a task. More... | |
struct | work_queue_task |
A task description. More... | |
struct | work_queue_stats |
Statistics describing a work queue. More... | |
Functions | |
work_queue * | work_queue_create (int port) |
Create a new work queue. | |
void | work_queue_delete (struct work_queue *q) |
Delete a work queue. | |
void | work_queue_submit (struct work_queue *q, struct work_queue_task *t) |
Submit a job to a work queue. | |
work_queue_task * | work_queue_wait (struct work_queue *q) |
Wait for tasks to complete. | |
work_queue_task * | work_queue_wait_time (struct work_queue *q, time_t stoptime) |
Wait for tasks to complete. | |
work_queue_task * | work_queue_task_create (const char *tag, const char *command, const struct task_file *input_files, const int num_inputs, const char *output_files, int priority) |
Create a new task specification. | |
void | work_queue_task_delete (struct work_queue_task *t) |
Delete a task specification. | |
void | work_queue_get_stats (struct work_queue *q, struct work_queue_stats *s) |
Get queue statistics. |
|
Create a new work queue.
|
|
Delete a work queue.
|
|
Submit a job to a work queue.
|
|
Wait for tasks to complete. This call will block indefinitely until a task completes.
|
|
Wait for tasks to complete. This call will block indefinitely until a task completes.
|
|
Create a new task specification. Once created, the task may be passed to work_queue_submit.
|
|
Delete a task specification. This may be called on tasks after they are returned from work_queue_wait.
|
|
Get queue statistics.
|