22 #define WORK_QUEUE_DEFAULT_PORT 9123
23 #define WORK_QUEUE_RANDOM_PORT -1
24 #define WORK_QUEUE_LINE_MAX 1024
26 #define WORK_QUEUE_WAITFORTASK -1
28 #define WORK_QUEUE_RETURN_STATUS_UNSET -1
30 #define WORK_QUEUE_RESULT_UNSET 0
31 #define WORK_QUEUE_RESULT_INPUT_FAIL 1
32 #define WORK_QUEUE_RESULT_INPUT_MISSING 2
33 #define WORK_QUEUE_RESULT_FUNCTION_FAIL 4
34 #define WORK_QUEUE_RESULT_OUTPUT_FAIL 8
35 #define WORK_QUEUE_RESULT_OUTPUT_MISSING 16
36 #define WORK_QUEUE_RESULT_LINK_FAIL 32
38 #define WORK_QUEUE_SCHEDULE_UNSET 0
39 #define WORK_QUEUE_SCHEDULE_FCFS 1
40 #define WORK_QUEUE_SCHEDULE_FILES 2
41 #define WORK_QUEUE_SCHEDULE_TIME 3
42 #define WORK_QUEUE_SCHEDULE_DEFAULT 3
43 #define WORK_QUEUE_SCHEDULE_PREFERRED_HOSTS 4
44 #define WORK_QUEUE_SCHEDULE_RAND 5
45 #define WORK_QUEUE_SCHEDULE_MAX 5
47 #define WORK_QUEUE_INPUT 0
48 #define WORK_QUEUE_OUTPUT 1
50 #define WORK_QUEUE_NOCACHE 0
51 #define WORK_QUEUE_CACHE 1
52 #define WORK_QUEUE_SYMLINK 2
53 #define WORK_QUEUE_PREEXIST 4
54 #define WORK_QUEUE_THIRDGET 8
55 #define WORK_QUEUE_THIRDPUT 8
57 #define WORK_QUEUE_MASTER_MODE_STANDALONE 0
58 #define WORK_QUEUE_MASTER_MODE_CATALOG 1
59 #define WORK_QUEUE_NAME_MAX 256
60 #define WORK_QUEUE_MASTER_PRIORITY_MAX 100
61 #define WORK_QUEUE_MASTER_PRIORITY_DEFAULT 10
62 #define WORK_QUEUE_WORKER_MODE_SHARED 0
63 #define WORK_QUEUE_WORKER_MODE_EXCLUSIVE 1
64 #define WORK_QUEUE_CATALOG_LINE_MAX 1024
65 #define WORK_QUEUE_CATALOG_UPDATE_INTERVAL 60
66 #define WORK_QUEUE_CATALOG_LIFETIME 180
68 #define WORK_QUEUE_FS_CMD 1
69 #define WORK_QUEUE_FS_PATH 2
70 #define WORK_QUEUE_FS_SYMLINK 3
void work_queue_task_specify_output_file_do_not_cache(struct work_queue_task *t, const char *rname, const char *fname)
Add an output file to a task without caching.
void work_queue_task_specify_output_file(struct work_queue_task *t, const char *rname, const char *fname)
Add an output file to a task.
double wq_option_fast_abort_multiplier
Initial setting for fast abort multiplier upon creating queue.
A task description.
Definition: work_queue.h:78
int work_queue_task_specify_algorithm(struct work_queue_task *t, int alg)
Further define a task specification.
int tasks_running
Number of tasks currently running.
Definition: work_queue.h:106
int total_workers_joined
Total number of times a worker joined the queue.
Definition: work_queue.h:111
int work_queue_specify_master_mode(struct work_queue *q, int mode)
Specify the master mode for a given queue.
void work_queue_get_stats(struct work_queue *q, struct work_queue_stats *s)
Get queue statistics.
int total_tasks_dispatched
Total number of tasks dispatch to workers.
Definition: work_queue.h:109
struct work_queue * work_queue_create(int port)
Create a new work queue.
int workers_init
Number of workers initializing.
Definition: work_queue.h:103
int work_queue_specify_algorithm(struct work_queue *q, int alg)
Change the worker selection algorithm for a given queue.
int status
Current status of the task.
Definition: work_queue.h:87
void work_queue_task_specify_input_buf(struct work_queue_task *t, const char *buf, int length, const char *rname)
Add an input buffer to a task.
int tasks_waiting
Number of tasks waiting for a CPU.
Definition: work_queue.h:107
void work_queue_task_specify_preferred_host(struct work_queue_task *t, const char *hostname)
Indicate that the task would be optimally run on a given host.
void work_queue_task_specify_buffer(struct work_queue_task *t, const char *data, int length, const char *remote_name, int flags)
Add an input buffer to a task.
Portable routines for high resolution timing.
struct list * output_files
The output files (other than the standard output stream) created by the program expected to be retrie...
Definition: work_queue.h:84
void work_queue_delete(struct work_queue *q)
Delete a work queue.
UINT64_T timestamp_t
A type to hold the current time, in microseconds since January 1st, 1970.
Definition: timestamp.h:19
INT64_T total_bytes_sent
Total number of file bytes (not including protocol control msg bytes) sent out to the workers by the ...
Definition: work_queue.h:113
int tasks_complete
Number of tasks waiting to be returned to user.
Definition: work_queue.h:108
struct list * input_files
The files to transfer to the worker and place in the executing directory.
Definition: work_queue.h:83
timestamp_t submit_time
The time the task was submitted.
Definition: work_queue.h:91
int total_tasks_complete
Total number of tasks returned complete.
Definition: work_queue.h:110
struct work_queue_task * work_queue_wait(struct work_queue *q, int timeout)
Wait for tasks to complete.
char * command_line
The program(s) to execute, as a shell command line.
Definition: work_queue.h:80
int total_workers_removed
Total number of times a worker was removed from the queue.
Definition: work_queue.h:112
INT64_T total_bytes_received
Total number of file bytes (not including protocol control msg bytes) received from the workers by th...
Definition: work_queue.h:114
int work_queue_specify_name(struct work_queue *q, const char *name)
Change the project name for a given queue.
int work_queue_specify_worker_mode(struct work_queue *q, int mode)
Specify the worker mode for a given queue.
char * host
The name of the host on which it ran.
Definition: work_queue.h:90
int work_queue_port(struct work_queue *q)
Get the listening port of the queue.
Definition: work_queue.binding.py:1
int taskid
A unique task id number.
Definition: work_queue.h:86
int workers_busy
Number of workers running tasks.
Definition: work_queue.h:105
struct work_queue_task * work_queue_task_create(const char *full_command)
Create a new task specification.
int work_queue_specify_priority(struct work_queue *q, int priority)
Change the priority for a given queue.
void work_queue_task_specify_input_file_do_not_cache(struct work_queue_task *t, const char *fname, const char *rname)
Add an input file to a task, without caching.
void work_queue_task_specify_tag(struct work_queue_task *t, const char *tag)
Attach a user defined logical name to the task.
int work_queue_empty(struct work_queue *q)
Determine whether there are any known tasks queued, running, or waiting to be collected.
void work_queue_task_specify_file(struct work_queue_task *t, const char *local_name, const char *remote_name, int type, int flags)
Add a file to a task.
int work_queue_shut_down_workers(struct work_queue *q, int n)
Shut down workers connected to the work_queue system.
timestamp_t transfer_start_time
The time at which it started to transfer input files.
Definition: work_queue.h:92
const char * work_queue_name(struct work_queue *q)
Get the project name of the queue.
INT64_T total_bytes_transferred
Number of bytes transferred since task has last started transferring input data.
Definition: work_queue.h:96
Statistics describing a work queue.
Definition: work_queue.h:102
int return_status
The exit code of the command line.
Definition: work_queue.h:88
void work_queue_task_specify_file_command(struct work_queue_task *t, const char *remote_name, const char *cmd, int type, int flags)
Add a file created or handled by an arbitrary command to a task (eg: wget, ftp, chirp_get|put).
void work_queue_task_specify_input_file(struct work_queue_task *t, const char *fname, const char *rname)
Add an input file to a task.
timestamp_t total_receive_time
Total time in microseconds spent in receiving data from workers.
Definition: work_queue.h:116
int work_queue_hungry(struct work_queue *q)
Determine whether the queue can support more tasks.
int result
The result of the task (successful, failed return_status, missing input file, missing output file)...
Definition: work_queue.h:89
timestamp_t finish_time
The time representing the end of the task.
Definition: work_queue.h:94
timestamp_t total_transfer_time
Time comsumed in microseconds for transferring total_bytes_transferred.
Definition: work_queue.h:97
void work_queue_submit(struct work_queue *q, struct work_queue_task *t)
Submit a job to a work queue.
int work_queue_activate_fast_abort(struct work_queue *q, double multiplier)
Turn on or off fast abort functionality for a given queue.
char * tag
An optional user-defined logical name for the task.
Definition: work_queue.h:79
int worker_selection_algorithm
How to choose worker to run the task.
Definition: work_queue.h:81
timestamp_t start_time
The time representing the start of the task.
Definition: work_queue.h:93
int wq_option_scheduler
Initial setting for algorithm to assign tasks to workers upon creating queue .
timestamp_t total_send_time
Total time in microseconds spent in sending data to workers.
Definition: work_queue.h:115
timestamp_t computation_time
Elapsed time between start_time and the beginning of the transfer of output files.
Definition: work_queue.h:95
char * preferred_host
The hostname where the task should preferrentially be run.
Definition: work_queue.h:85
void work_queue_task_delete(struct work_queue_task *t)
Delete a task specification.
char * output
The standard output of the task.
Definition: work_queue.h:82
int workers_ready
Number of workers ready for tasks.
Definition: work_queue.h:104