cctools
|
Go to the source code of this file.
Data Structures | |
struct | vine_stats |
Statistics describing a manager. More... | |
Macros | |
#define | VINE_DEFAULT_PORT 9123 |
Default taskvine port number. More... | |
#define | VINE_RANDOM_PORT 0 |
Indicates that any port may be chosen. More... | |
#define | VINE_WAIT_FOREVER -1 |
Timeout value to wait for a task to complete before returning. More... | |
Functions | |
Functions - Tasks | |
struct vine_task * | vine_task_create (const char *full_command) |
Create a new task object. More... | |
void | vine_task_delete (struct vine_task *t) |
Delete a task. More... | |
void | vine_task_set_command (struct vine_task *t, const char *cmd) |
Indicate the command to be executed. More... | |
void | vine_task_set_library_required (struct vine_task *t, const char *name) |
Set the library name required by this task. More... | |
const char * | vine_task_get_library_required (struct vine_task *t) |
Get the library name required by this task. More... | |
void | vine_task_set_library_provided (struct vine_task *t, const char *name) |
Set the library name provided by this task. More... | |
const char * | vine_task_get_library_provided (struct vine_task *t) |
Get the library name provided by this task. More... | |
void | vine_task_set_function_slots (struct vine_task *t, int nslots) |
Set the number of concurrent functions a library can run. More... | |
void | vine_task_set_function_exec_mode_from_string (struct vine_task *t, const char *exec_mode) |
Set the execution mode of functions inside a library. More... | |
int | vine_task_add_input (struct vine_task *t, struct vine_file *f, const char *remote_name, vine_mount_flags_t flags) |
Add a general file object as a input to a task. More... | |
int | vine_task_add_output (struct vine_task *t, struct vine_file *f, const char *remote_name, vine_mount_flags_t flags) |
Add a general file object as a output of a task. More... | |
void | vine_task_set_retries (struct vine_task *t, int64_t max_retries) |
Specify the number of times this task is retried on worker errors. More... | |
void | vine_task_set_max_forsaken (struct vine_task *t, int64_t max_forsaken) |
Specify the total number of times this task can be return to the manager without being executed. More... | |
void | vine_task_set_memory (struct vine_task *t, int64_t memory) |
Specify the amount of disk space required by a task. More... | |
void | vine_task_set_disk (struct vine_task *t, int64_t disk) |
Specify the amount of disk space required by a task. More... | |
void | vine_task_set_cores (struct vine_task *t, int cores) |
Specify the number of cores required by a task. More... | |
void | vine_task_set_gpus (struct vine_task *t, int gpus) |
Specify the number of gpus required by a task. More... | |
void | vine_task_set_time_end (struct vine_task *t, int64_t useconds) |
Specify the maximum end time allowed for the task (in microseconds since the Epoch). More... | |
void | vine_task_set_time_start (struct vine_task *t, int64_t useconds) |
Specify the minimum start time allowed for the task (in microseconds since the Epoch). More... | |
void | vine_task_set_time_max (struct vine_task *t, int64_t seconds) |
Specify the maximum time (in seconds) the task is allowed to run in a worker. More... | |
void | vine_task_set_time_min (struct vine_task *t, int64_t seconds) |
Specify the minimum time (in seconds) the task is expected to run in a worker. More... | |
void | vine_task_set_tag (struct vine_task *t, const char *tag) |
Attach a user defined string tag to the task. More... | |
void | vine_task_set_category (struct vine_task *t, const char *category) |
Label the task with the given category. More... | |
void | vine_task_add_feature (struct vine_task *t, const char *name) |
Label the task with a user-defined feature. More... | |
void | vine_task_set_priority (struct vine_task *t, double priority) |
Specify the priority of this task relative to others in the manager. More... | |
void | vine_task_set_env_var (struct vine_task *t, const char *name, const char *value) |
Specify an environment variable to be added to the task. More... | |
void | vine_task_set_scheduler (struct vine_task *t, vine_schedule_t algorithm) |
Select the scheduling algorithm for a single task. More... | |
int | vine_task_set_monitor_output (struct vine_task *t, const char *monitor_output) |
Specify a custom name for the monitoring summary. More... | |
const char * | vine_task_get_state (struct vine_task *t) |
Get the state line of the task. More... | |
const char * | vine_task_get_command (struct vine_task *t) |
Get the command line of the task. More... | |
const char * | vine_task_get_tag (struct vine_task *t) |
Get the tag associated with the task. More... | |
const char * | vine_task_get_category (struct vine_task *t) |
Get the category associated with the task. More... | |
int | vine_task_get_id (struct vine_task *t) |
Get the unique ID of the task. More... | |
vine_result_t | vine_task_get_result (struct vine_task *t) |
Get the end result of the task. More... | |
const char * | vine_result_string (vine_result_t result) |
Explain result codes from tasks. More... | |
int | vine_task_get_exit_code (struct vine_task *t) |
Get the Unix exit code of the task. More... | |
const char * | vine_task_get_stdout (struct vine_task *t) |
Get the standard output of the task. More... | |
const char * | vine_task_get_addrport (struct vine_task *t) |
Get the address and port of the worker on which the task ran. More... | |
const char * | vine_task_get_hostname (struct vine_task *t) |
Get the hostname of the worker on which the task ran. More... | |
int64_t | vine_task_get_metric (struct vine_task *t, const char *name) |
Get a performance metric of a completed task. More... | |
void | vine_task_set_resources (struct vine_task *t, const struct rmsummary *rm) |
Set the expected resource consumption of a task before execution. More... | |
const struct rmsummary * | vine_task_get_resources (struct vine_task *t, const char *name) |
Get resource information (e.g., cores, memory, and disk) of a completed task. More... | |
int | vine_task_set_snapshot_file (struct vine_task *t, struct vine_file *monitor_snapshot_file) |
When monitoring, indicates a json-encoded file that instructs the monitor to take a snapshot of the task resources. More... | |
int | vine_task_add_starch_package (struct vine_task *t, struct vine_file *f) |
Add a Starch package as an execution context. More... | |
int | vine_task_add_poncho_package (struct vine_task *t, struct vine_file *f) |
Add a Poncho package as an execution context. More... | |
int | vine_task_add_execution_context (struct vine_task *t, struct vine_file *f) |
Adds an execution context to the task. More... | |
int | vine_task_add_environment (struct vine_task *t, struct vine_file *f) |
Functions - Files | |
const char * | vine_file_contents (struct vine_file *f) |
Get the contents of a vine file. More... | |
size_t | vine_file_size (struct vine_file *f) |
Get the length of a vine file. More... | |
const char * | vine_file_source (struct vine_file *f) |
Get the filename of the file if the file is local to the manager. More... | |
vine_file_type_t | vine_file_type (struct vine_file *f) |
Get the type of file. More... | |
int | vine_file_replica_count (struct vine_manager *m, struct vine_file *f) |
Get the number of replicas of a file. More... | |
struct vine_file * | vine_declare_file (struct vine_manager *m, const char *source, vine_cache_level_t cache, vine_file_flags_t flags) |
Declare a file object from a local file. More... | |
struct vine_file * | vine_declare_url (struct vine_manager *m, const char *url, vine_cache_level_t cache, vine_file_flags_t flags) |
Declare a file object from a remote URL. More... | |
struct vine_file * | vine_declare_xrootd (struct vine_manager *m, const char *source, struct vine_file *proxy, struct vine_file *env, vine_cache_level_t cache, vine_file_flags_t flags) |
Create a file object of a remote file accessible from an xrootd server. More... | |
struct vine_file * | vine_declare_chirp (struct vine_manager *m, const char *server, const char *source, struct vine_file *ticket, struct vine_file *env, vine_cache_level_t cache, vine_file_flags_t flags) |
Create a file object of a remote file accessible from a chirp server. More... | |
struct vine_file * | vine_declare_temp (struct vine_manager *m) |
Create a scratch file object. More... | |
struct vine_file * | vine_declare_buffer (struct vine_manager *m, const char *buffer, size_t size, vine_cache_level_t cache, vine_file_flags_t flags) |
Create a file object from a data buffer. More... | |
struct vine_file * | vine_declare_mini_task (struct vine_manager *m, struct vine_task *mini_task, const char *name, vine_cache_level_t cache, vine_file_flags_t flags) |
Create a file object produced from a mini-task Attaches a task definition to produce an input file by running a Unix command. More... | |
struct vine_file * | vine_declare_untar (struct vine_manager *m, struct vine_file *f, vine_cache_level_t cache, vine_file_flags_t flags) |
Create a file object by unpacking a tar archive. More... | |
struct vine_file * | vine_declare_poncho (struct vine_manager *m, struct vine_file *f, vine_cache_level_t cache, vine_file_flags_t flags) |
Create a file object by unpacking a poncho package. More... | |
struct vine_file * | vine_declare_starch (struct vine_manager *m, struct vine_file *f, vine_cache_level_t cache, vine_file_flags_t flags) |
Create a file object by unpacking a starch package. More... | |
const char * | vine_fetch_file (struct vine_manager *m, struct vine_file *f) |
Fetch the contents of a file. More... | |
void | vine_undeclare_file (struct vine_manager *m, struct vine_file *f) |
Un-declare a file that was created by vine_declare_file or similar functions. More... | |
void | vine_prune_file (struct vine_manager *m, struct vine_file *f) |
Prune a file among the cluster. More... | |
Functions - Managers | |
struct vine_manager * | vine_create (int port) |
Create a new manager. More... | |
struct vine_manager * | vine_ssl_create (int port, const char *key, const char *cert) |
Create a new manager using SSL. More... | |
void | vine_delete (struct vine_manager *m) |
Delete a manager. More... | |
int | vine_submit (struct vine_manager *m, struct vine_task *t) |
Submit a task to a manager. More... | |
void | vine_manager_install_library (struct vine_manager *m, struct vine_task *t, const char *name) |
Indicate the library to be installed on all workers connected to the manager. More... | |
void | vine_manager_remove_library (struct vine_manager *m, const char *name) |
Indicate the library to be removed from all connected workers. More... | |
struct vine_task * | vine_manager_find_library_template (struct vine_manager *q, const char *library_name) |
Find a library template on the manager. More... | |
struct vine_task * | vine_wait (struct vine_manager *m, int timeout) |
Wait for a task to complete. More... | |
struct vine_task * | vine_wait_for_tag (struct vine_manager *m, const char *tag, int timeout) |
Wait for a task with a given task to complete. More... | |
struct vine_task * | vine_wait_for_task_id (struct vine_manager *m, int task_id, int timeout) |
Wait for a task with a given task_id to complete. More... | |
int | vine_hungry (struct vine_manager *m) |
Determine whether the manager is 'hungry' for more tasks. More... | |
int | vine_empty (struct vine_manager *m) |
Determine whether the manager is empty. More... | |
int | vine_port (struct vine_manager *m) |
Get the listening port of the manager. More... | |
void | vine_set_name (struct vine_manager *m, const char *name) |
Change the project name for a given manager. More... | |
const char * | vine_get_name (struct vine_manager *m) |
Get the project name of the manager. More... | |
int | vine_enable_monitoring (struct vine_manager *m, int watchdog, int time_series) |
Enables resource monitoring for tasks. More... | |
int | vine_enable_peer_transfers (struct vine_manager *m) |
Enable taskvine peer transfers to be scheduled by the manager. More... | |
int | vine_disable_peer_transfers (struct vine_manager *m) |
Disable taskvine peer transfers to be scheduled by the manager. More... | |
int | vine_enable_proportional_resources (struct vine_manager *m) |
When enabled, resources to tasks in are assigned in proportion to the size of the worker. More... | |
int | vine_disable_proportional_resources (struct vine_manager *m) |
Disable proportional resources. More... | |
int | vine_set_task_id_min (struct vine_manager *m, int minid) |
Set the minimum task_id of future submitted tasks. More... | |
void | vine_block_host (struct vine_manager *m, const char *hostname) |
Block workers in hostname from working for manager q. More... | |
void | vine_block_host_with_timeout (struct vine_manager *m, const char *hostname, time_t seconds) |
Block workers in hostname from a manager, but remove block after timeout seconds. More... | |
void | vine_unblock_host (struct vine_manager *m, const char *hostname) |
Unblock host from a manager. More... | |
void | vine_unblock_all (struct vine_manager *m) |
Unblock all host. More... | |
void | vine_get_stats (struct vine_manager *m, struct vine_stats *s) |
Get manager statistics (only from manager) More... | |
void | vine_get_stats_category (struct vine_manager *m, const char *c, struct vine_stats *s) |
Get the task statistics for the given category. More... | |
char * | vine_get_status (struct vine_manager *m, const char *request) |
Get manager information as json. More... | |
struct rmsummary ** | vine_summarize_workers (struct vine_manager *m) |
Summary data for all workers in buffer. More... | |
void | vine_set_bandwidth_limit (struct vine_manager *m, const char *bandwidth) |
Limit the manager bandwidth when transferring files to and from workers. More... | |
double | vine_get_effective_bandwidth (struct vine_manager *m) |
Get current manager bandwidth. More... | |
int | vine_enable_disconnect_slow_workers (struct vine_manager *m, double multiplier) |
Enable disconnect slow workers functionality for a given manager for tasks without an explicit category. More... | |
int | vine_enable_disconnect_slow_workers_category (struct vine_manager *m, const char *category, double multiplier) |
Enable disconnect slow workers functionality for a given category. More... | |
int | vine_set_draining_by_hostname (struct vine_manager *m, const char *hostname, int drain_flag) |
Set the draining mode per worker hostname. More... | |
int | vine_set_category_mode (struct vine_manager *m, const char *category, vine_category_mode_t mode) |
Turn on or off first-allocation labeling for a given category. More... | |
void | vine_set_category_max_concurrent (struct vine_manager *m, const char *category, int max_concurrent) |
Set a maximum number of tasks of this category that can execute concurrently. More... | |
int | vine_enable_category_resource (struct vine_manager *m, const char *category, const char *resource, int autolabel) |
Turn on or off first-allocation labeling for a given category and resource. More... | |
void | vine_set_scheduler (struct vine_manager *m, vine_schedule_t algorithm) |
Change the worker selection algorithm. More... | |
void | vine_set_priority (struct vine_manager *m, int priority) |
Change the priority for a given manager. More... | |
void | vine_set_tasks_left_count (struct vine_manager *m, int ntasks) |
Specify the number of tasks not yet submitted to the manager. More... | |
void | vine_set_catalog_servers (struct vine_manager *m, const char *hosts) |
Specify the catalog server(s) the manager should report to. More... | |
void | vine_update_catalog (struct vine_manager *m) |
void | vine_set_property (struct vine_manager *m, const char *name, const char *value) |
Add a global property to the manager which will be included in periodic reports to the catalog server and other telemetry destinations. More... | |
int | vine_cancel_by_task_id (struct vine_manager *m, int id) |
Cancel a submitted task using its task id. More... | |
int | vine_cancel_by_task_tag (struct vine_manager *m, const char *tag) |
Cancel a submitted task using its tag and remove it from manager. More... | |
int | vine_cancel_all (struct vine_manager *m) |
Cancel all submitted tasks and remove them from the manager. More... | |
int | vine_enable_debug_log (const char *logfile) |
Turn on the debugging log output and send to the named file. More... | |
int | vine_enable_perf_log (struct vine_manager *m, const char *logfile) |
Add a performance log file that records cummulative statistics of the connected workers and submitted tasks. More... | |
int | vine_enable_transactions_log (struct vine_manager *m, const char *logfile) |
Add a log file that records the states of the connected workers and tasks. More... | |
int | vine_enable_taskgraph_log (struct vine_manager *m, const char *logfile) |
Add an output log that produces the taskgraph in Grapvhiz Dot format. More... | |
int | vine_workers_shutdown (struct vine_manager *m, int n) |
Shut down workers connected to the manager. More... | |
void | vine_set_password (struct vine_manager *m, const char *password) |
Add a mandatory password that each worker must present. More... | |
int | vine_set_password_file (struct vine_manager *m, const char *file) |
Add a mandatory password file that each worker must present. More... | |
void | vine_set_keepalive_interval (struct vine_manager *m, int interval) |
Change the keepalive interval for a given manager. More... | |
void | vine_set_keepalive_timeout (struct vine_manager *m, int timeout) |
Change the keepalive timeout for identifying dead workers for a given manager. More... | |
void | vine_set_manager_preferred_connection (struct vine_manager *m, const char *preferred_connection) |
Set the preference for using hostname over IP address to connect. More... | |
int | vine_tune (struct vine_manager *m, const char *name, double value) |
Tune advanced parameters for manager. More... | |
void | vine_set_resources_max (struct vine_manager *m, const struct rmsummary *rm) |
Sets the maximum resources a task without an explicit category ("default" category). More... | |
void | vine_set_resources_min (struct vine_manager *m, const struct rmsummary *rm) |
Sets the minimum resources a task without an explicit category ("default" category). More... | |
void | vine_set_category_resources_max (struct vine_manager *m, const char *category, const struct rmsummary *rm) |
Sets the maximum resources a task in the category may use. More... | |
void | vine_set_category_resources_min (struct vine_manager *m, const char *category, const struct rmsummary *rm) |
Sets the minimum resources a task in the category may use. More... | |
void | vine_set_category_first_allocation_guess (struct vine_manager *m, const char *category, const struct rmsummary *rm) |
Set the initial guess for resource autolabeling for the given category. More... | |
void | vine_initialize_categories (struct vine_manager *m, struct rmsummary *max, const char *summaries_file) |
Initialize first value of categories. More... | |
void | vine_set_runtime_info_path (const char *path) |
Sets the path where runtime info directories (logs and staging) are created. More... | |
void | vine_log_debug_app (struct vine_manager *q, const char *entry) |
Adds a custom APPLICATION entry to the debug log. More... | |
void | vine_log_txn_app (struct vine_manager *q, const char *entry) |
Adds a custom APPLICATION entry to the transactions log. More... | |
void | vine_counters_print () |
Display internal reference counts for troubleshooting purposes. More... | |
char * | vine_version_string () |
Return a string with the current version of taskvine. More... | |
char * | vine_get_path_log (struct vine_manager *m, const char *path) |
Returns path relative to the logs runtime directory. More... | |
char * | vine_get_path_staging (struct vine_manager *m, const char *path) |
Returns path relative to the staging runtime directory. More... | |
char * | vine_get_path_library_log (struct vine_manager *m, const char *path) |
Returns path relative to the library logs runtime directory. More... | |
char * | vine_get_path_cache (struct vine_manager *m, const char *path) |
Returns path relative to the cache runtime directory. More... | |
The public API for the taskvine distributed application framework. A taskvine application consists of a manager process and a larger number of worker processes, typically running in a high performance computing cluster, or a cloud facility. Both the manager and worker processes run with ordinary user privileges and require no special capabilities.
From the application perspective, the programmer creates a manager with vine_create, defines a number of tasks with vine_task_create, submits the tasks to the manager with vine_submit, and then monitors completion with vine_wait. Tasks are further described by attaching data objects via vine_task_add_input, vine_task_add_output and related functions.
The taskvine framework provides a large number of fault tolerance, resource management, and performance monitoring features that enable the construction of applications that run reliably on tens of thousands of nodes in the presence of failures and other expected events.
#define VINE_DEFAULT_PORT 9123 |
Default taskvine port number.
#define VINE_RANDOM_PORT 0 |
Indicates that any port may be chosen.
#define VINE_WAIT_FOREVER -1 |
Timeout value to wait for a task to complete before returning.
enum vine_mount_flags_t |
Select optional handling for input and output files: caching, unpacking, watching, etc.
enum vine_cache_level_t |
Control caching and sharing behavior of file objects.
enum vine_file_flags_t |
Control sharing and garbage collection behavior of file objects.
enum vine_schedule_t |
Select overall scheduling algorithm for matching tasks to workers.
enum vine_result_t |
Possible outcomes for a task, returned by vine_task_get_result.
These results can be converted to a string with vine_result_string.
Enumerator | |
---|---|
VINE_RESULT_SUCCESS | The task ran successfully, and its Unix exit code is given by vine_task_get_exit_code. |
VINE_RESULT_INPUT_MISSING | The task cannot be run due to a missing input file. |
VINE_RESULT_OUTPUT_MISSING | The task ran but failed to generate a specified output file. |
VINE_RESULT_STDOUT_MISSING | The task ran but its stdout has been truncated. |
VINE_RESULT_SIGNAL | The task was terminated with a signal. |
VINE_RESULT_RESOURCE_EXHAUSTION | The task used more resources than requested. |
VINE_RESULT_MAX_END_TIME | The task ran after the specified (absolute since epoch) end time. |
VINE_RESULT_UNKNOWN | The result could not be classified. |
VINE_RESULT_FORSAKEN | The task failed, but it was not a task error. |
VINE_RESULT_MAX_RETRIES | Currently unused. |
VINE_RESULT_MAX_WALL_TIME | The task ran for more than the specified time (relative since running in a worker). |
VINE_RESULT_RMONITOR_ERROR | The task failed because the monitor did not produce a summary report. |
VINE_RESULT_OUTPUT_TRANSFER_ERROR | The task failed because an output could be transfered to the manager (not enough disk space, incorrect write permissions. |
VINE_RESULT_FIXED_LOCATION_MISSING | The task failed because no worker could satisfy the fixed location input file requirements. |
VINE_RESULT_CANCELLED | The task was cancelled by the caller. |
VINE_RESULT_LIBRARY_EXIT | Task is a library that has terminated. |
VINE_RESULT_SANDBOX_EXHAUSTION | The task used more disk than the allowed sandbox. |
enum vine_category_mode_t |
Select how to allocate resources for similar tasks with vine_set_category_mode.
enum vine_file_type_t |
The type of an input or output file to attach to a task.
struct vine_task* vine_task_create | ( | const char * | full_command | ) |
Create a new task object.
Once created and elaborated with functions such as vine_task_add_input and vine_task_add_output, the task should be passed to vine_submit.
full_command | The shell command line or coprocess functions to be executed by the task. If null, the command will be given later by vine_task_set_command |
void vine_task_delete | ( | struct vine_task * | t | ) |
Delete a task.
This may be called on tasks after they are returned from vine_wait.
t | The task to delete. |
void vine_task_set_command | ( | struct vine_task * | t, |
const char * | cmd | ||
) |
Indicate the command to be executed.
t | A task object. |
cmd | The command to be executed. This string will be duplicated by this call, so the argument may be freed or re-used afterward. |
void vine_task_set_library_required | ( | struct vine_task * | t, |
const char * | name | ||
) |
Set the library name required by this task.
t | A task object. |
name | The name of the library coprocess name that will be used by this task. |
const char* vine_task_get_library_required | ( | struct vine_task * | t | ) |
Get the library name required by this task.
t | A task object. |
void vine_task_set_library_provided | ( | struct vine_task * | t, |
const char * | name | ||
) |
Set the library name provided by this task.
t | A task object. |
name | The name of the library coprocess that this task implements. |
const char* vine_task_get_library_provided | ( | struct vine_task * | t | ) |
Get the library name provided by this task.
t | A task object. |
void vine_task_set_function_slots | ( | struct vine_task * | t, |
int | nslots | ||
) |
Set the number of concurrent functions a library can run.
If unset, the library will runs as many functions as it has cores available.
t | A task object. |
nslots | The maximum number of concurrent functions this library can run. |
void vine_task_set_function_exec_mode_from_string | ( | struct vine_task * | t, |
const char * | exec_mode | ||
) |
Set the execution mode of functions inside a library.
A mode can either be "fork" where the library forks and executes functions, or "direct" where the library executes a function in its memory space. Note that "direct" will limit the number of function slots in a library to 1.
t | A library object. |
exec_mode | A string denoting the execution mode of the library. |
int vine_task_add_input | ( | struct vine_task * | t, |
struct vine_file * | f, | ||
const char * | remote_name, | ||
vine_mount_flags_t | flags | ||
) |
Add a general file object as a input to a task.
t | A task object. |
f | A file object, created by vine_declare_file, vine_declare_url, vine_declare_buffer, vine_declare_mini_task. |
remote_name | The name of the file as it should appear in the task's sandbox. |
flags | May be zero or more vine_mount_flags_t or'd together. See vine_task_add_output. |
int vine_task_add_output | ( | struct vine_task * | t, |
struct vine_file * | f, | ||
const char * | remote_name, | ||
vine_mount_flags_t | flags | ||
) |
Add a general file object as a output of a task.
t | A task object. |
f | A file object, created by vine_declare_file or vine_declare_buffer. |
remote_name | The name of the file as it will appear in the task's sandbox. |
flags | May be zero or more vine_mount_flags_t or'd together. See vine_task_add_input. |
void vine_task_set_retries | ( | struct vine_task * | t, |
int64_t | max_retries | ||
) |
Specify the number of times this task is retried on worker errors.
If less than one, the task is retried indefinitely (this the default). A task that did not succeed after the given number of retries is returned with the result of its last attempt.
t | A task object. |
max_retries | The number of retries. |
void vine_task_set_max_forsaken | ( | struct vine_task * | t, |
int64_t | max_forsaken | ||
) |
Specify the total number of times this task can be return to the manager without being executed.
If less than zero, the task is tried indefinitely (this the default). A task that did not succeed after the given number is returned with the result VINE_RESULT_FORSAKEN.
t | A task object. |
max_retries | The number of retries. |
void vine_task_set_memory | ( | struct vine_task * | t, |
int64_t | memory | ||
) |
Specify the amount of disk space required by a task.
t | A task object. |
memory | The amount of disk space required by the task, in megabytes. |
void vine_task_set_disk | ( | struct vine_task * | t, |
int64_t | disk | ||
) |
Specify the amount of disk space required by a task.
t | A task object. |
disk | The amount of disk space required by the task, in megabytes. |
void vine_task_set_cores | ( | struct vine_task * | t, |
int | cores | ||
) |
Specify the number of cores required by a task.
t | A task object. |
cores | The number of cores required by the task. |
void vine_task_set_gpus | ( | struct vine_task * | t, |
int | gpus | ||
) |
Specify the number of gpus required by a task.
t | A task object. |
gpus | The number of gpus required by the task. |
void vine_task_set_time_end | ( | struct vine_task * | t, |
int64_t | useconds | ||
) |
Specify the maximum end time allowed for the task (in microseconds since the Epoch).
If less than 1, then no end time is specified (this is the default). This is useful, for example, when the task uses certificates that expire.
t | A task object. |
useconds | Number of useconds since the Epoch. |
void vine_task_set_time_start | ( | struct vine_task * | t, |
int64_t | useconds | ||
) |
Specify the minimum start time allowed for the task (in microseconds since the Epoch).
The task will only be submitted to workers after the specified time. If less than 1, then no minimum start time is specified (this is the default).
t | A task object. |
useconds | Number of useconds since the Epoch. |
void vine_task_set_time_max | ( | struct vine_task * | t, |
int64_t | seconds | ||
) |
Specify the maximum time (in seconds) the task is allowed to run in a worker.
This time is accounted since the the moment the task starts to run in a worker. If less than 1, then no maximum time is specified (this is the default).
t | A task object. |
seconds | Maximum number of seconds the task may run in a worker. |
void vine_task_set_time_min | ( | struct vine_task * | t, |
int64_t | seconds | ||
) |
Specify the minimum time (in seconds) the task is expected to run in a worker.
This time is accounted since the moment the task starts to run in a worker. If less than 1, then no minimum time is specified (this is the default).
t | A task object. |
seconds | Minimum number of seconds the task may run in a worker. |
void vine_task_set_tag | ( | struct vine_task * | t, |
const char * | tag | ||
) |
Attach a user defined string tag to the task.
This field is not interpreted by the manager, but is provided for the user's convenience in identifying tasks when they complete.
t | A task object. |
tag | The tag to attach to task t. |
void vine_task_set_category | ( | struct vine_task * | t, |
const char * | category | ||
) |
Label the task with the given category.
It is expected that tasks with the same category have similar resources requirements (e.g. to disconnect slow workers).
t | A task object. |
category | The name of the category to use. |
void vine_task_add_feature | ( | struct vine_task * | t, |
const char * | name | ||
) |
Label the task with a user-defined feature.
The task will only run on a worker that provides (–feature option) such feature.
t | A task object. |
name | The name of the feature. |
void vine_task_set_priority | ( | struct vine_task * | t, |
double | priority | ||
) |
Specify the priority of this task relative to others in the manager.
Tasks with a higher priority value run first. If no priority is given, a task is placed at the end of the ready list, regardless of the priority.
t | A task object. |
priority | The priority of the task. |
void vine_task_set_env_var | ( | struct vine_task * | t, |
const char * | name, | ||
const char * | value | ||
) |
Specify an environment variable to be added to the task.
t | A task object |
name | Name of the variable. |
value | Value of the variable. |
void vine_task_set_scheduler | ( | struct vine_task * | t, |
vine_schedule_t | algorithm | ||
) |
Select the scheduling algorithm for a single task.
To change the scheduling algorithm for all tasks, use vine_set_scheduler instead.
t | A task object. |
algorithm | The algorithm to use in assigning this task to a worker. For possible values, see vine_schedule_t. |
int vine_task_set_monitor_output | ( | struct vine_task * | t, |
const char * | monitor_output | ||
) |
Specify a custom name for the monitoring summary.
If vine_enable_monitoring is also enabled, the summary is also written to that directory.
t | A task object. |
monitor_output | Resource summary file. |
const char* vine_task_get_state | ( | struct vine_task * | t | ) |
Get the state line of the task.
t | A task object. |
const char* vine_task_get_command | ( | struct vine_task * | t | ) |
Get the command line of the task.
t | A task object. |
const char* vine_task_get_tag | ( | struct vine_task * | t | ) |
Get the tag associated with the task.
t | A task object. |
const char* vine_task_get_category | ( | struct vine_task * | t | ) |
Get the category associated with the task.
t | A task object. |
int vine_task_get_id | ( | struct vine_task * | t | ) |
Get the unique ID of the task.
t | A task object. |
vine_result_t vine_task_get_result | ( | struct vine_task * | t | ) |
Get the end result of the task.
If the result is VINE_RESULT_SUCCESS, then the task ran to completion and the exit code of the process can be obtained from vine_task_get_exit_code. For any other result, the task could not be run to completion. Use vine_result_string to convert the result code into a readable string.
t | A task object. |
const char* vine_result_string | ( | vine_result_t | result | ) |
Explain result codes from tasks.
result | Result from a task returned by vine_wait. |
int vine_task_get_exit_code | ( | struct vine_task * | t | ) |
Get the Unix exit code of the task.
t | A task object. |
const char* vine_task_get_stdout | ( | struct vine_task * | t | ) |
Get the standard output of the task.
t | A task object. |
const char* vine_task_get_addrport | ( | struct vine_task * | t | ) |
Get the address and port of the worker on which the task ran.
t | A task object. |
const char* vine_task_get_hostname | ( | struct vine_task * | t | ) |
Get the hostname of the worker on which the task ran.
t | A task object. |
int64_t vine_task_get_metric | ( | struct vine_task * | t, |
const char * | name | ||
) |
Get a performance metric of a completed task.
t | A task object. |
name | The name of an integer performance metric:
|
void vine_task_set_resources | ( | struct vine_task * | t, |
const struct rmsummary * | rm | ||
) |
Set the expected resource consumption of a task before execution.
t | A task object. |
rm | A resource summary object. |
const struct rmsummary* vine_task_get_resources | ( | struct vine_task * | t, |
const char * | name | ||
) |
Get resource information (e.g., cores, memory, and disk) of a completed task.
t | A task object. |
name | One of: "allocated", "requested", or "measured". For measured resources see vine_enable_monitoring. |
int vine_task_set_snapshot_file | ( | struct vine_task * | t, |
struct vine_file * | monitor_snapshot_file | ||
) |
When monitoring, indicates a json-encoded file that instructs the monitor to take a snapshot of the task resources.
Snapshots appear in the JSON summary file of the task, under the key "snapshots". Snapshots are taken on events on files described in the monitor_snapshot_file. The monitor_snapshot_file is a json encoded file with the following format:
{ "FILENAME": { "from-start":boolean, "from-start-if-truncated":boolean, "delete-if-found":boolean, "events": [ { "label":"EVENT_NAME", "on-create":boolean, "on-truncate":boolean, "pattern":"REGEXP", "count":integer }, { "label":"EVENT_NAME", ... } ] }, "FILENAME": { ... }
All fields but label are optional.
from-start:boolean If FILENAME exits when task starts running, process from line 1. Default: false,
as the task may be appending to an already existing file. from-start-if-truncated If FILENAME is truncated, process from line 1. Default: true, to account for log rotations. delete-if-found Delete FILENAME when found. Default: false
events: label Name that identifies the snapshot. Only alphanumeric, -, and _ characters are allowed. on-create Take a snapshot every time the file is created. Default: false on-truncate Take a snapshot when the file is truncated. Default: false pattern Take a snapshot when a line matches the regexp pattern. Default: none count Maximum number of snapshots for this label. Default: -1 (no limit)
For more information, consult the manual of the resource_monitor.
t | A vine_task object. |
monitor_snapshot_file | A filename. |
int vine_task_add_starch_package | ( | struct vine_task * | t, |
struct vine_file * | f | ||
) |
Add a Starch package as an execution context.
The file given must refer to a (unpacked) package containing libraries captured by the starch
command. The task will execute using this package as its environment.
t | A task object. |
f | A file containing an unpacked Starch package. |
int vine_task_add_poncho_package | ( | struct vine_task * | t, |
struct vine_file * | f | ||
) |
Add a Poncho package as an execution context.
The file given must refer to a (unpacked) PONCHO package, containing a set of Python modules needed by the task. The task will execute using this package as its Python environment.
t | A task object. |
f | A file containing an unpacked Poncho package. |
int vine_task_add_execution_context | ( | struct vine_task * | t, |
struct vine_file * | f | ||
) |
Adds an execution context to the task.
The context file given must expand to a directory containing (at a minimum) a file named bin/run_in_env that will perform any desired setup (e.g. setting PATH, LD_LIBRARY_PATH, PYTHONPATH), execute the given command, and then perform any desired cleanup. The context directory may also include any support files or libraries needed by the task. If specified multiple times, execution contexts are nested in the order given (i.e. first added is the first applied).
t | A task object. |
f | The execution context file. |
const char* vine_file_contents | ( | struct vine_file * | f | ) |
Get the contents of a vine file.
Typically used to examine an output buffer returned from a file. Note that the vfile contents may not be available unless vine_fetch_file has previously been called on this object.
m | A manager object |
f | A file object created by vine_declare_buffer. |
size_t vine_file_size | ( | struct vine_file * | f | ) |
Get the length of a vine file.
f | A file object. |
const char* vine_file_source | ( | struct vine_file * | f | ) |
Get the filename of the file if the file is local to the manager.
NULL otherwise.
f | A file object. |
vine_file_type_t vine_file_type | ( | struct vine_file * | f | ) |
Get the type of file.
f | A file object. |
int vine_file_replica_count | ( | struct vine_manager * | m, |
struct vine_file * | f | ||
) |
Get the number of replicas of a file.
m | A manager object |
f | A file object. |
struct vine_file* vine_declare_file | ( | struct vine_manager * | m, |
const char * | source, | ||
vine_cache_level_t | cache, | ||
vine_file_flags_t | flags | ||
) |
Declare a file object from a local file.
m | A manager object |
source | The path of the file on the local filesystem |
cache | Method for caching file at the workers: never, the default (VINE_CACHE_LEVEL_TASK), to cache only for the current manager (VINE_CACHE_LEVEL_WORKFLOW), to cache for the lifetime of the worker (VINE_CACHE_LEVEL_WORKER), or to cache at execution site even when worker terminates (VINE_CACHE_LEVEL_FOREVER). |
flags | Flags that can be or'ed (|) to indicate whether a file should not be transferred among workers (VINE_PEER_NOSHARE) when peer transfers are enabled (vine_enable_peer_transfers), or whether a file should be delete at the manager's site after it is not needed by the workflow (vine_undeclare_file). |
struct vine_file* vine_declare_url | ( | struct vine_manager * | m, |
const char * | url, | ||
vine_cache_level_t | cache, | ||
vine_file_flags_t | flags | ||
) |
Declare a file object from a remote URL.
m | A manager object |
url | The URL address of the object in text form. |
cache | Method for caching file at the workers: never, the default (VINE_CACHE_LEVEL_TASK), to cache only for the current manager (VINE_CACHE_LEVEL_WORKFLOW), to cache for the lifetime of the worker (VINE_CACHE_LEVEL_WORKER), or to cache at execution site even when worker terminates (VINE_CACHE_LEVEL_FOREVER). |
flags | Flags that can be or'ed (|) to indicate whether a file should not be transferred among workers (VINE_PEER_NOSHARE) when peer transfers are enabled (vine_enable_peer_transfers), or whether a file should be delete at the manager's site after it is not needed by the workflow (vine_undeclare_file). |
struct vine_file* vine_declare_xrootd | ( | struct vine_manager * | m, |
const char * | source, | ||
struct vine_file * | proxy, | ||
struct vine_file * | env, | ||
vine_cache_level_t | cache, | ||
vine_file_flags_t | flags | ||
) |
Create a file object of a remote file accessible from an xrootd server.
m | A manager object |
source | The URL address of the root file in text form as: "root://XROOTSERVER[:port]//path/to/file" |
proxy | A proxy file object (e.g. from vine_declare_file) of a X509 proxy to use. If NULL, the environment variable X509_USER_PROXY and the file "$TMPDIR/$UID" are considered in that order. If no proxy is present, the transfer is tried without authentication. |
env | If not NULL, an environment file (e.g poncho or starch, see vine_task_add_environment) that contains the xrootd executables. Otherwise assume xrootd is available at the worker. |
cache | Method for caching file at the workers: never, the default (VINE_CACHE_LEVEL_TASK), to cache only for the current manager (VINE_CACHE_LEVEL_WORKFLOW), to cache for the lifetime of the worker (VINE_CACHE_LEVEL_WORKER), or to cache at execution site even when worker terminates (VINE_CACHE_LEVEL_FOREVER). |
flags | Flags that can be or'ed (|) to indicate whether a file should not be transferred among workers (VINE_PEER_NOSHARE) when peer transfers are enabled (vine_enable_peer_transfers), or whether a file should be delete at the manager's site after it is not needed by the workflow (vine_undeclare_file). |
struct vine_file* vine_declare_chirp | ( | struct vine_manager * | m, |
const char * | server, | ||
const char * | source, | ||
struct vine_file * | ticket, | ||
struct vine_file * | env, | ||
vine_cache_level_t | cache, | ||
vine_file_flags_t | flags | ||
) |
Create a file object of a remote file accessible from a chirp server.
m | A manager object |
server | The chirp server address of the form "hostname[:port"]" |
source | The name of the file in the server |
ticket | If not NULL, a file object that provides a chirp an authentication ticket |
env | If not NULL, an environment file (e.g poncho or starch, see vine_task_add_environment) that contains the chirp executables. Otherwise assume chirp is available at the worker. |
cache | Method for caching file at the workers: never, the default (VINE_CACHE_LEVEL_TASK), to cache only for the current manager (VINE_CACHE_LEVEL_WORKFLOW), to cache for the lifetime of the worker (VINE_CACHE_LEVEL_WORKER), or to cache at execution site even when worker terminates (VINE_CACHE_LEVEL_FOREVER). |
flags | Flags that can be or'ed (|) to indicate whether a file should not be transferred among workers (VINE_PEER_NOSHARE) when peer transfers are enabled (vine_enable_peer_transfers), or whether a file should be delete at the manager's site after it is not needed by the workflow (vine_undeclare_file). |
struct vine_file* vine_declare_temp | ( | struct vine_manager * | m | ) |
Create a scratch file object.
A scratch file has no initial content, but is created as the output of a task, and may be consumed by other tasks.
m | A manager object |
struct vine_file* vine_declare_buffer | ( | struct vine_manager * | m, |
const char * | buffer, | ||
size_t | size, | ||
vine_cache_level_t | cache, | ||
vine_file_flags_t | flags | ||
) |
Create a file object from a data buffer.
m | A manager object |
buffer | The contents of the buffer. |
size | The length of the buffer, in bytes. |
cache | Method for caching file at the workers: never, the default (VINE_CACHE_LEVEL_TASK), to cache only for the current manager (VINE_CACHE_LEVEL_WORKFLOW), to cache for the lifetime of the worker (VINE_CACHE_LEVEL_WORKER), or to cache at execution site even when worker terminates (VINE_CACHE_LEVEL_FOREVER). |
flags | Flags that can be or'ed (|) to indicate whether a file should not be transferred among workers (VINE_PEER_NOSHARE) when peer transfers are enabled (vine_enable_peer_transfers), or whether a file should be delete at the manager's site after it is not needed by the workflow (vine_undeclare_file). |
struct vine_file* vine_declare_mini_task | ( | struct vine_manager * | m, |
struct vine_task * | mini_task, | ||
const char * | name, | ||
vine_cache_level_t | cache, | ||
vine_file_flags_t | flags | ||
) |
Create a file object produced from a mini-task Attaches a task definition to produce an input file by running a Unix command.
This mini-task will be run on demand in order to produce the desired input file. This is useful if an input requires some prior step such as transferring, renaming, or unpacking to be useful. A mini-task should be a short-running activity with minimal resource consumption.
m | A manager object |
mini_task | The task which produces the file |
name | The name of the file in the task's sandbox to extract. |
cache | Method for caching file at the workers: never, the default (VINE_CACHE_LEVEL_TASK), to cache only for the current manager (VINE_CACHE_LEVEL_WORKFLOW), to cache for the lifetime of the worker (VINE_CACHE_LEVEL_WORKER), or to cache at execution site even when worker terminates (VINE_CACHE_LEVEL_FOREVER). |
flags | Flags that can be or'ed (|) to indicate whether a file should not be transferred among workers (VINE_PEER_NOSHARE) when peer transfers are enabled (vine_enable_peer_transfers), or whether a file should be delete at the manager's site after it is not needed by the workflow (vine_undeclare_file). |
struct vine_file* vine_declare_untar | ( | struct vine_manager * | m, |
struct vine_file * | f, | ||
vine_cache_level_t | cache, | ||
vine_file_flags_t | flags | ||
) |
Create a file object by unpacking a tar archive.
The archive may be compressed in any of the ways supported by tar, and so this function supports extensions .tar, .tar.gz, .tgz, tar.bz2, and so forth.
m | A manager object |
f | A file object corresponding to an archive packed by the tar command. |
cache | Method for caching file at the workers: never, the default (VINE_CACHE_LEVEL_TASK), to cache only for the current manager (VINE_CACHE_LEVEL_WORKFLOW), to cache for the lifetime of the worker (VINE_CACHE_LEVEL_WORKER), or to cache at execution site even when worker terminates (VINE_CACHE_LEVEL_FOREVER). |
flags | Flags that can be or'ed (|) to indicate whether a file should not be transferred among workers (VINE_PEER_NOSHARE) when peer transfers are enabled (vine_enable_peer_transfers), or whether a file should be delete at the manager's site after it is not needed by the workflow (vine_undeclare_file). |
struct vine_file* vine_declare_poncho | ( | struct vine_manager * | m, |
struct vine_file * | f, | ||
vine_cache_level_t | cache, | ||
vine_file_flags_t | flags | ||
) |
Create a file object by unpacking a poncho package.
m | A manager object |
f | A file object corresponding to poncho or conda-pack tarball |
cache | Method for caching file at the workers: never, the default (VINE_CACHE_LEVEL_TASK), to cache only for the current manager (VINE_CACHE_LEVEL_WORKFLOW), to cache for the lifetime of the worker (VINE_CACHE_LEVEL_WORKER), or to cache at execution site even when worker terminates (VINE_CACHE_LEVEL_FOREVER). |
flags | Flags that can be or'ed (|) to indicate whether a file should not be transferred among workers (VINE_PEER_NOSHARE) when peer transfers are enabled (vine_enable_peer_transfers), or whether a file should be delete at the manager's site after it is not needed by the workflow (vine_undeclare_file). |
struct vine_file* vine_declare_starch | ( | struct vine_manager * | m, |
struct vine_file * | f, | ||
vine_cache_level_t | cache, | ||
vine_file_flags_t | flags | ||
) |
Create a file object by unpacking a starch package.
m | A manager object |
f | A file object representing a sfx archive. |
cache | Method for caching file at the workers: never, the default (VINE_CACHE_LEVEL_TASK), to cache only for the current manager (VINE_CACHE_LEVEL_WORKFLOW), to cache for the lifetime of the worker (VINE_CACHE_LEVEL_WORKER), or to cache at execution site even when worker terminates (VINE_CACHE_LEVEL_FOREVER). |
flags | Flags that can be or'ed (|) to indicate whether a file should not be transferred among workers (VINE_PEER_NOSHARE) when peer transfers are enabled (vine_enable_peer_transfers), or whether a file should be delete at the manager's site after it is not needed by the workflow (vine_undeclare_file). |
const char* vine_fetch_file | ( | struct vine_manager * | m, |
struct vine_file * | f | ||
) |
Fetch the contents of a file.
The contents of the given file will be loaded from disk or pulled back from the cluster and loaded into manager memory. This is particularly useful for temporary files and mini-tasks whose contents are not returned to the manager by default.
m | A manager object |
f | A file object. |
void vine_undeclare_file | ( | struct vine_manager * | m, |
struct vine_file * | f | ||
) |
Un-declare a file that was created by vine_declare_file or similar functions.
The given file or directory object is deleted from all worker's caches, and is no longer available for use as an input file. Completed tasks waiting for retrieval are not affected. Note that all declared files are automatically undeclared by vine_delete, however this function can be used for earlier cleanup of unneeded file objects.
m | A manager object |
f | Any file object. |
void vine_prune_file | ( | struct vine_manager * | m, |
struct vine_file * | f | ||
) |
Prune a file among the cluster.
The given file or directory object is deleted from all worker's caches, but is still available on the manager's site, and can be recovered by submitting a recovery task.
m | A manager object |
f | Any file object. |
struct vine_manager* vine_create | ( | int | port | ) |
Create a new manager.
Users may modify the behavior of vine_create by setting the following environmental variables before calling the function:
If the manager has a project name, then manager statistics and information will be reported to a catalog server. To set the catalog server, the user may set the CATALOG_HOST and CATALOG_PORT environmental variables as described in catalog_query_create.
port | The port number to listen on. If zero is specified, then the port stored in the VINE_PORT environment variable is used if available. If it isn't, or if -1 is specified, the first unused port between VINE_LOW_PORT and VINE_HIGH_PORT (1024 and 32767 by default) is chosen. |
struct vine_manager* vine_ssl_create | ( | int | port, |
const char * | key, | ||
const char * | cert | ||
) |
Create a new manager using SSL.
Like vine_create, but all communications with the manager are encoded using TLS with they key and certificate provided. If key or cert are NULL, then TLS is not activated.
port | The port number to listen on. If zero is specified, then the port stored in the VINE_PORT environment variable is used if available. If it isn't, or if -1 is specified, the first unused port between VINE_LOW_PORT and VINE_HIGH_PORT (1024 and 32767 by default) is chosen. |
key | A key in pem format. |
cert | A certificate in pem format. |
void vine_delete | ( | struct vine_manager * | m | ) |
Delete a manager.
This function should only be called after vine_empty returns true.
m | A manager to delete. |
int vine_submit | ( | struct vine_manager * | m, |
struct vine_task * | t | ||
) |
Submit a task to a manager.
Once a task is submitted to a manager, it is not longer under the user's control and should not be inspected until returned via vine_wait. Once returned, it is safe to re-submit the same take object via vine_submit.
m | A manager object |
t | A task object returned from vine_task_create. |
void vine_manager_install_library | ( | struct vine_manager * | m, |
struct vine_task * | t, | ||
const char * | name | ||
) |
Indicate the library to be installed on all workers connected to the manager.
The library is expected to run on all workers until they disconnect from the manager.
m | A manager object |
t | A task object. |
name | The library to be installed |
void vine_manager_remove_library | ( | struct vine_manager * | m, |
const char * | name | ||
) |
Indicate the library to be removed from all connected workers.
m | A manager object |
name | The library to be removed |
struct vine_task* vine_manager_find_library_template | ( | struct vine_manager * | q, |
const char * | library_name | ||
) |
Find a library template on the manager.
m | A manager object |
name | The name of the library of interest |
struct vine_task* vine_wait | ( | struct vine_manager * | m, |
int | timeout | ||
) |
Wait for a task to complete.
This call will block until either a task has completed, the timeout has expired, or the manager is empty. If a task has completed, the corresponding task object will be returned by this function. The caller may examine the task and then dispose of it using vine_task_delete.
If the task ran to completion, then the result
field will be zero and the return_status
field will contain the Unix exit code of the task. If the task could not, then the result
field will be non-zero and the return_status
field will be undefined.
m | A manager object |
timeout | The number of seconds to wait for a completed task before returning. Use an integer time to set the timeout or the constant VINE_WAIT_FOREVER to block until a task has completed. If timeout is zero, return immediately a completed task, if one available, without performing any more manager's work. |
struct vine_task* vine_wait_for_tag | ( | struct vine_manager * | m, |
const char * | tag, | ||
int | timeout | ||
) |
Wait for a task with a given task to complete.
Similar to vine_wait, but guarantees that the returned task has the specified tag.
m | A manager object |
tag | The desired tag. If NULL, then tasks are returned regardless of their tag. |
timeout | The number of seconds to wait for a completed task before returning. Use an integer time to set the timeout or the constant VINE_WAIT_FOREVER to block until a task has completed. If timeout is zero, return immediately a completed task, if one available, without performing any more manager's work. |
struct vine_task* vine_wait_for_task_id | ( | struct vine_manager * | m, |
int | task_id, | ||
int | timeout | ||
) |
Wait for a task with a given task_id to complete.
Similar to vine_wait, but guarantees that the returned task has the specified task_id.
m | A manager object |
task_id | The desired task_id. If -1, then tasks are returned regardless of their task_id. |
timeout | The number of seconds to wait for a completed task before returning. Use an integer time to set the timeout or the constant VINE_WAIT_FOREVER to block until a task has completed. If timeout is zero, return immediately a completed task, if one available, without performing any more manager's work. |
int vine_hungry | ( | struct vine_manager * | m | ) |
Determine whether the manager is 'hungry' for more tasks.
While the manager can handle a very large number of tasks, it runs most efficiently when the number of tasks is slightly larger than the number of active workers. This function gives the user of a flexible application a hint about whether it would be better to submit more tasks via vine_submit or wait for some to complete via vine_wait.
m | A manager object |
int vine_empty | ( | struct vine_manager * | m | ) |
Determine whether the manager is empty.
When all of the desired tasks have been submitted to the manager, the user should continue to call vine_wait until this function returns true.
m | A manager object |
int vine_port | ( | struct vine_manager * | m | ) |
Get the listening port of the manager.
As noted in vine_create, there are many controls that affect what TCP port the manager will listen on. Rather than assuming a specific port, the user should simply call this function to determine what port was selected.
m | A manager object |
void vine_set_name | ( | struct vine_manager * | m, |
const char * | name | ||
) |
Change the project name for a given manager.
m | A manager object |
name | The new project name. |
const char* vine_get_name | ( | struct vine_manager * | m | ) |
Get the project name of the manager.
m | A manager object |
int vine_enable_monitoring | ( | struct vine_manager * | m, |
int | watchdog, | ||
int | time_series | ||
) |
Enables resource monitoring for tasks.
The resources measured are available in the resources_measured member of the respective vine_task.
m | A manager object |
watchdog | If not 0, kill tasks that exhaust declared resources. |
time_series | If not 0, generate a time series of resources per task in VINE_RUNTIME_INFO_DIR/vine-logs/time-series/ (WARNING: for long running tasks these files may reach gigabyte sizes. This function is mostly used for debugging.) |
int vine_enable_peer_transfers | ( | struct vine_manager * | m | ) |
Enable taskvine peer transfers to be scheduled by the manager.
int vine_disable_peer_transfers | ( | struct vine_manager * | m | ) |
Disable taskvine peer transfers to be scheduled by the manager.
int vine_enable_proportional_resources | ( | struct vine_manager * | m | ) |
When enabled, resources to tasks in are assigned in proportion to the size of the worker.
If a resource is specified (e.g. with vine_task_set_cores), proportional resources never go below explicit specifications. This mode is most useful when only some of the resources are explicitely specified, or with automatic resource allocation. By default it is enabled.
m | A manager object |
int vine_disable_proportional_resources | ( | struct vine_manager * | m | ) |
Disable proportional resources.
See vine_enable_proportional_resources. Proportional resources are enabled by default.
m | A manager object |
int vine_set_task_id_min | ( | struct vine_manager * | m, |
int | minid | ||
) |
Set the minimum task_id of future submitted tasks.
Further submitted tasks are guaranteed to have a task_id larger or equal to minid. This function is useful to make task_ids consistent in a workflow that consists of sequential managers. (Note: This function is rarely used). If the minimum id provided is smaller than the last task_id computed, the minimum id provided is ignored.
m | A manager object |
minid | Minimum desired task_id |
void vine_block_host | ( | struct vine_manager * | m, |
const char * | hostname | ||
) |
Block workers in hostname from working for manager q.
m | A manager object |
hostname | A string for hostname. |
void vine_block_host_with_timeout | ( | struct vine_manager * | m, |
const char * | hostname, | ||
time_t | seconds | ||
) |
Block workers in hostname from a manager, but remove block after timeout seconds.
If timeout is less than 1, then the hostname is blocked indefinitely, as if vine_block_host was called instead.
m | A manager object |
hostname | A string for hostname. |
seconds | Number of seconds to the hostname will be blocked. |
void vine_unblock_host | ( | struct vine_manager * | m, |
const char * | hostname | ||
) |
Unblock host from a manager.
m | A manager object |
hostname | A string for hostname. |
void vine_unblock_all | ( | struct vine_manager * | m | ) |
Unblock all host.
m | A manager object |
void vine_get_stats | ( | struct vine_manager * | m, |
struct vine_stats * | s | ||
) |
Get manager statistics (only from manager)
m | A manager object |
s | A pointer to a buffer that will be filed with statistics |
void vine_get_stats_category | ( | struct vine_manager * | m, |
const char * | c, | ||
struct vine_stats * | s | ||
) |
Get the task statistics for the given category.
m | A manager object |
c | A category name |
s | A pointer to a buffer that will be filed with statistics |
char* vine_get_status | ( | struct vine_manager * | m, |
const char * | request | ||
) |
Get manager information as json.
m | A manager object |
request | One of: manager, tasks, workers, or categories |
struct rmsummary** vine_summarize_workers | ( | struct vine_manager * | m | ) |
Summary data for all workers in buffer.
m | A manager object |
void vine_set_bandwidth_limit | ( | struct vine_manager * | m, |
const char * | bandwidth | ||
) |
Limit the manager bandwidth when transferring files to and from workers.
m | A manager object |
bandwidth | The bandwidth limit in bytes per second. |
double vine_get_effective_bandwidth | ( | struct vine_manager * | m | ) |
Get current manager bandwidth.
m | A manager object |
int vine_enable_disconnect_slow_workers | ( | struct vine_manager * | m, |
double | multiplier | ||
) |
Enable disconnect slow workers functionality for a given manager for tasks without an explicit category.
Given the multiplier, disconnect a worker when it is executing a task with a running time is larger than the average times the multiplier. The average is s computed per task category. The value specified here applies to all the categories for which vine_enable_disconnect_slow_workers_category was not explicitely called.
m | A manager object |
multiplier | The multiplier of the average task time at which point to disconnect; Disabled if less than 1. |
int vine_enable_disconnect_slow_workers_category | ( | struct vine_manager * | m, |
const char * | category, | ||
double | multiplier | ||
) |
Enable disconnect slow workers functionality for a given category.
As vine_enable_disconnect_slow_workers, but for a single task category. (Note: vine_enable_disconnect_slow_workers_category(q, "default", n) is the same as vine_enable_disconnect_slow_workers(q, n).)
m | A manager object |
category | A category name. |
multiplier | The multiplier of the average task time at which point to disconnect; If less than one (default), use the multiplier of the "default" category. |
int vine_set_draining_by_hostname | ( | struct vine_manager * | m, |
const char * | hostname, | ||
int | drain_flag | ||
) |
Set the draining mode per worker hostname.
If drain_flag is 0, workers at hostname receive tasks as usual. If drain_flag is not 1, no new tasks are dispatched to workers at hostname, and if empty they are shutdown.
m | A manager object |
hostname | The hostname running the worker. |
drain_flag | Draining mode. |
int vine_set_category_mode | ( | struct vine_manager * | m, |
const char * | category, | ||
vine_category_mode_t | mode | ||
) |
Turn on or off first-allocation labeling for a given category.
By default, cores, memory, and disk are labeled, and gpus are unlabeled. Turn on/off other specific resources use vine_enable_category_resource
m | A manager object |
category | A category name. |
mode | One of vine_category_mode_t. |
void vine_set_category_max_concurrent | ( | struct vine_manager * | m, |
const char * | category, | ||
int | max_concurrent | ||
) |
Set a maximum number of tasks of this category that can execute concurrently.
If less than 0, unlimited (this is the default).
q | A manager object. |
category | A category name. |
max_concurrent | Number of maximum concurrent tasks. |
int vine_enable_category_resource | ( | struct vine_manager * | m, |
const char * | category, | ||
const char * | resource, | ||
int | autolabel | ||
) |
Turn on or off first-allocation labeling for a given category and resource.
This function should be use to fine-tune the defaults from vine_set_category_mode.
m | A manager object |
category | A category name. |
resource | A resource name. |
autolabel | 0 off, 1 on. |
void vine_set_scheduler | ( | struct vine_manager * | m, |
vine_schedule_t | algorithm | ||
) |
Change the worker selection algorithm.
This function controls which worker will be selected for a given task.
m | A manager object |
algorithm | The algorithm to use in assigning a task to a worker. See vine_schedule_t for possible values. |
void vine_set_priority | ( | struct vine_manager * | m, |
int | priority | ||
) |
Change the priority for a given manager.
m | A manager object |
priority | The new priority of the manager. Higher priority managers will attract workers first. |
void vine_set_tasks_left_count | ( | struct vine_manager * | m, |
int | ntasks | ||
) |
Specify the number of tasks not yet submitted to the manager.
It is used by vine_factory to determine the number of workers to launch. If not specified, it defaults to 0. vine_factory considers the number of tasks as: num tasks left + num tasks running + num tasks read.
m | A manager object |
ntasks | Number of tasks yet to be submitted. |
void vine_set_catalog_servers | ( | struct vine_manager * | m, |
const char * | hosts | ||
) |
Specify the catalog server(s) the manager should report to.
m | A manager object |
hosts | The catalog servers given as a comma delimited list of hostnames or hostname:port |
void vine_set_property | ( | struct vine_manager * | m, |
const char * | name, | ||
const char * | value | ||
) |
Add a global property to the manager which will be included in periodic reports to the catalog server and other telemetry destinations.
This is helpful for distinguishing higher level information about the entire run, such as the name of the framework being used, or the logical name of the dataset being processed.
m | A manager object |
name | The name of the property. |
value | The value of the property. |
int vine_cancel_by_task_id | ( | struct vine_manager * | m, |
int | id | ||
) |
Cancel a submitted task using its task id.
The cancelled task will be returned in the normal way via vine_wait with a result of VINE_RESULT_CANCELLED.
m | A manager object |
id | The task_id returned from vine_submit. |
int vine_cancel_by_task_tag | ( | struct vine_manager * | m, |
const char * | tag | ||
) |
Cancel a submitted task using its tag and remove it from manager.
The cancelled task will be returned in the normal way via vine_wait with a result of VINE_RESULT_CANCELLED.
m | A manager object |
tag | The tag name assigned to task using vine_task_set_tag. |
int vine_cancel_all | ( | struct vine_manager * | m | ) |
Cancel all submitted tasks and remove them from the manager.
Each cancelled task will be returned in the normal way via vine_wait with a result of VINE_RESULT_CANCELLED.
m | A manager object |
int vine_enable_debug_log | ( | const char * | logfile | ) |
Turn on the debugging log output and send to the named file.
(Note it does not need the vine_manager structure, as it is enabled before the manager is created.)
logfile | The filename. |
int vine_enable_perf_log | ( | struct vine_manager * | m, |
const char * | logfile | ||
) |
Add a performance log file that records cummulative statistics of the connected workers and submitted tasks.
m | A manager object |
logfile | The filename. |
int vine_enable_transactions_log | ( | struct vine_manager * | m, |
const char * | logfile | ||
) |
Add a log file that records the states of the connected workers and tasks.
m | A manager object |
logfile | The filename. |
int vine_enable_taskgraph_log | ( | struct vine_manager * | m, |
const char * | logfile | ||
) |
Add an output log that produces the taskgraph in Grapvhiz Dot format.
m | A manager object |
logfile | The filename. |
int vine_workers_shutdown | ( | struct vine_manager * | m, |
int | n | ||
) |
Shut down workers connected to the manager.
Gives a best effort and then returns the number of workers given the shut down order.
m | A manager object |
n | The number to shut down. All workers if given "0". |
void vine_set_password | ( | struct vine_manager * | m, |
const char * | password | ||
) |
Add a mandatory password that each worker must present.
m | A manager object |
password | The password to require. |
int vine_set_password_file | ( | struct vine_manager * | m, |
const char * | file | ||
) |
Add a mandatory password file that each worker must present.
m | A manager object |
file | The name of the file containing the password. |
void vine_set_keepalive_interval | ( | struct vine_manager * | m, |
int | interval | ||
) |
Change the keepalive interval for a given manager.
m | A manager object |
interval | The minimum number of seconds to wait before sending new keepalive checks to workers. |
void vine_set_keepalive_timeout | ( | struct vine_manager * | m, |
int | timeout | ||
) |
Change the keepalive timeout for identifying dead workers for a given manager.
m | A manager object |
timeout | The minimum number of seconds to wait for a keepalive response from worker before marking it as dead. |
void vine_set_manager_preferred_connection | ( | struct vine_manager * | m, |
const char * | preferred_connection | ||
) |
Set the preference for using hostname over IP address to connect.
'by_ip' uses IP addresses from the network interfaces of the manager (standard behavior), 'by_hostname' to use the hostname at the manager, or 'by_apparent_ip' to use the address of the manager as seen by the catalog server.
m | A manager object |
preferred_connection | An string to indicate using 'by_ip' or a 'by_hostname'. |
int vine_tune | ( | struct vine_manager * | m, |
const char * | name, | ||
double | value | ||
) |
Tune advanced parameters for manager.
m | A manager object |
name | The name of the parameter to tune
|
value | The value to set the parameter to. |
void vine_set_resources_max | ( | struct vine_manager * | m, |
const struct rmsummary * | rm | ||
) |
Sets the maximum resources a task without an explicit category ("default" category).
rm specifies the maximum resources a task in the default category may use.
m | Reference to the current manager object. |
rm | Structure indicating maximum values. See rmsummary for possible fields. |
void vine_set_resources_min | ( | struct vine_manager * | m, |
const struct rmsummary * | rm | ||
) |
Sets the minimum resources a task without an explicit category ("default" category).
rm specifies the maximum resources a task in the default category may use.
m | Reference to the current manager object. |
rm | Structure indicating maximum values. See rmsummary for possible fields. |
void vine_set_category_resources_max | ( | struct vine_manager * | m, |
const char * | category, | ||
const struct rmsummary * | rm | ||
) |
Sets the maximum resources a task in the category may use.
m | Reference to the current manager object. |
category | Name of the category. |
rm | Structure indicating minimum values. See rmsummary for possible fields. |
void vine_set_category_resources_min | ( | struct vine_manager * | m, |
const char * | category, | ||
const struct rmsummary * | rm | ||
) |
Sets the minimum resources a task in the category may use.
m | Reference to the current manager object. |
category | Name of the category. |
rm | Structure indicating minimum values. See rmsummary for possible fields. |
void vine_set_category_first_allocation_guess | ( | struct vine_manager * | m, |
const char * | category, | ||
const struct rmsummary * | rm | ||
) |
Set the initial guess for resource autolabeling for the given category.
m | Reference to the current manager object. |
category | Name of the category. |
rm | Structure indicating maximum values. Autolabeling available for cores, memory, disk, and gpus |
void vine_initialize_categories | ( | struct vine_manager * | m, |
struct rmsummary * | max, | ||
const char * | summaries_file | ||
) |
Initialize first value of categories.
m | Reference to the current manager object. |
max | Structure indicating maximum values. Autolabeling available for cores, memory, disk, and gpus |
summaries_file | JSON file with resource summaries. |
void vine_set_runtime_info_path | ( | const char * | path | ) |
Sets the path where runtime info directories (logs and staging) are created.
path | A directory |
void vine_log_debug_app | ( | struct vine_manager * | q, |
const char * | entry | ||
) |
Adds a custom APPLICATION entry to the debug log.
m | Reference to the current manager object. |
entry | A custom debug message. |
void vine_log_txn_app | ( | struct vine_manager * | q, |
const char * | entry | ||
) |
Adds a custom APPLICATION entry to the transactions log.
m | Reference to the current manager object. |
entry | A custom transaction message. |
void vine_counters_print | ( | ) |
Display internal reference counts for troubleshooting purposes.
char* vine_version_string | ( | ) |
Return a string with the current version of taskvine.
char* vine_get_path_log | ( | struct vine_manager * | m, |
const char * | path | ||
) |
Returns path relative to the logs runtime directory.
m | Reference to the current manager object. |
char* vine_get_path_staging | ( | struct vine_manager * | m, |
const char * | path | ||
) |
Returns path relative to the staging runtime directory.
m | Reference to the current manager object. |
char* vine_get_path_library_log | ( | struct vine_manager * | m, |
const char * | path | ||
) |
Returns path relative to the library logs runtime directory.
m | Reference to the current manager object. |
char* vine_get_path_cache | ( | struct vine_manager * | m, |
const char * | path | ||
) |
Returns path relative to the cache runtime directory.
m | Reference to the current manager object. |