cctools
taskvine.h
Go to the documentation of this file.
1/*
2Copyright (C) 2022- The University of Notre Dame
3This software is distributed under the GNU General Public License.
4See the file COPYING for details.
5*/
6
7#ifndef TASKVINE_H
8#define TASKVINE_H
9
10#include "category.h"
11#include "rmsummary.h"
12#include "timestamp.h"
13#include <sys/types.h>
14
15struct vine_manager;
16struct vine_task;
17struct vine_file;
18
37#define VINE_DEFAULT_PORT 9123
38#define VINE_RANDOM_PORT 0
39#define VINE_WAIT_FOREVER -1
56
64
72
82
110
139
148
149
152 /* Stats for the current state of workers: */
160 /* Cumulative stats for workers: */
171 /* Stats for the current state of tasks: */
177 /* Cumulative stats for tasks: */
186 /* All times in microseconds */
187 /* A time_when_* refers to an instant in time, otherwise it refers to a length of time. */
188
189 /* Master time statistics: */
207 /* Workers time statistics: */
214 /* BW statistics */
215 int64_t bytes_sent;
219 double bandwidth;
222 /* resources statistics */
234 int64_t total_cores;
235 int64_t total_memory;
236 int64_t total_disk;
237 int64_t total_gpus;
244 int64_t max_cores;
245 int64_t max_memory;
246 int64_t max_disk;
247 int64_t max_gpus;
249 int64_t min_cores;
250 int64_t min_memory;
251 int64_t min_disk;
252 int64_t min_gpus;
254 int64_t inuse_cache;
255};
256
260
269struct vine_task *vine_task_create(const char *full_command);
270
275void vine_task_delete(struct vine_task *t);
276
282void vine_task_set_command(struct vine_task *t, const char *cmd);
283
288void vine_task_set_library_required(struct vine_task *t, const char *name);
289
294const char *vine_task_get_library_required(struct vine_task *t);
295
300void vine_task_set_library_provided(struct vine_task *t, const char *name);
301
306const char *vine_task_get_library_provided(struct vine_task *t);
307
313void vine_task_set_function_slots(struct vine_task *t, int nslots);
314
324int vine_task_add_input(struct vine_task *t, struct vine_file *f, const char *remote_name, vine_mount_flags_t flags);
325
334int vine_task_add_output(struct vine_task *t, struct vine_file *f, const char *remote_name, vine_mount_flags_t flags);
335
343void vine_task_set_retries(struct vine_task *t, int64_t max_retries);
344
352void vine_task_set_max_forsaken(struct vine_task *t, int64_t max_forsaken);
353
359void vine_task_set_memory(struct vine_task *t, int64_t memory);
360
366void vine_task_set_disk(struct vine_task *t, int64_t disk);
367
373void vine_task_set_cores(struct vine_task *t, int cores);
374
380void vine_task_set_gpus(struct vine_task *t, int gpus);
381
389void vine_task_set_time_end(struct vine_task *t, int64_t useconds);
390
398void vine_task_set_time_start(struct vine_task *t, int64_t useconds);
399
407void vine_task_set_time_max(struct vine_task *t, int64_t seconds);
408
415void vine_task_set_time_min(struct vine_task *t, int64_t seconds);
416
423void vine_task_set_tag(struct vine_task *t, const char *tag);
424
430void vine_task_set_category(struct vine_task *t, const char *category);
431
437void vine_task_add_feature(struct vine_task *t, const char *name);
438
446void vine_task_set_priority(struct vine_task *t, double priority);
447
453void vine_task_set_env_var(struct vine_task *t, const char *name, const char *value);
454
460void vine_task_set_scheduler(struct vine_task *t, vine_schedule_t algorithm);
461
469int vine_task_set_monitor_output(struct vine_task *t, const char *monitor_output);
470
476const char *vine_task_get_command(struct vine_task *t);
477
483const char *vine_task_get_tag(struct vine_task *t);
484
490const char *vine_task_get_category(struct vine_task *t);
491
497int vine_task_get_id(struct vine_task *t);
498
511
517
526int vine_task_get_exit_code(struct vine_task *t);
527
535const char *vine_task_get_stdout(struct vine_task *t);
536
544const char *vine_task_get_addrport(struct vine_task *t);
545
553const char *vine_task_get_hostname(struct vine_task *t);
554
573int64_t vine_task_get_metric(struct vine_task *t, const char *name);
574
580void vine_task_set_resources(struct vine_task *t, const struct rmsummary *rm);
581
588const struct rmsummary *vine_task_get_resources(struct vine_task *t, const char *name);
589
640int vine_task_set_snapshot_file(struct vine_task *t, struct vine_file *monitor_snapshot_file);
641
650int vine_task_add_starch_package(struct vine_task *t, struct vine_file *f);
651
660int vine_task_add_poncho_package(struct vine_task *t, struct vine_file *f);
661
677int vine_task_add_execution_context(struct vine_task *t, struct vine_file *f);
678
679/* Deprecated alias for vine_task_add_execution_context. */
680int vine_task_add_environment(struct vine_task *t, struct vine_file *f);
681
683
687
696const char *vine_file_contents(struct vine_file *f);
697
702size_t vine_file_size(struct vine_file *f);
703
709const char *vine_file_source(struct vine_file *f);
710
715vine_file_type_t vine_file_type(struct vine_file *f);
716
728struct vine_file *vine_declare_file(
729 struct vine_manager *m, const char *source, vine_cache_level_t cache, vine_file_flags_t flags);
730
742struct vine_file *vine_declare_url(
743 struct vine_manager *m, const char *url, vine_cache_level_t cache, vine_file_flags_t flags);
744
761struct vine_file *vine_declare_xrootd(struct vine_manager *m, const char *source, struct vine_file *proxy,
762 struct vine_file *env, vine_cache_level_t cache, vine_file_flags_t flags);
763
779struct vine_file *vine_declare_chirp(struct vine_manager *m, const char *server, const char *source,
780 struct vine_file *ticket, struct vine_file *env, vine_cache_level_t cache, vine_file_flags_t flags);
781
788struct vine_file *vine_declare_temp(struct vine_manager *m);
789
802struct vine_file *vine_declare_buffer(struct vine_manager *m, const char *buffer, size_t size, vine_cache_level_t cache,
803 vine_file_flags_t flags);
804
822struct vine_file *vine_declare_mini_task(struct vine_manager *m, struct vine_task *mini_task, const char *name,
824
838struct vine_file *vine_declare_untar(
839 struct vine_manager *m, struct vine_file *f, vine_cache_level_t cache, vine_file_flags_t flags);
840
852struct vine_file *vine_declare_poncho(
853 struct vine_manager *m, struct vine_file *f, vine_cache_level_t cache, vine_file_flags_t flags);
854
866struct vine_file *vine_declare_starch(
867 struct vine_manager *m, struct vine_file *f, vine_cache_level_t cache, vine_file_flags_t flags);
868
878const char *vine_fetch_file(struct vine_manager *m, struct vine_file *f);
879
889void vine_undeclare_file(struct vine_manager *m, struct vine_file *f);
890
897void vine_prune_file(struct vine_manager *m, struct vine_file *f);
898
900
904
928struct vine_manager *vine_create(int port);
929
940struct vine_manager *vine_ssl_create(int port, const char *key, const char *cert);
941
946void vine_delete(struct vine_manager *m);
947
957int vine_submit(struct vine_manager *m, struct vine_task *t);
958
965void vine_manager_install_library(struct vine_manager *m, struct vine_task *t, const char *name);
966
971void vine_manager_remove_library(struct vine_manager *m, const char *name);
972
977struct vine_task *vine_manager_find_library_template(struct vine_manager *q, const char *library_name);
978
997struct vine_task *vine_wait(struct vine_manager *m, int timeout);
998
1010struct vine_task *vine_wait_for_tag(struct vine_manager *m, const char *tag, int timeout);
1011
1023struct vine_task *vine_wait_for_task_id(struct vine_manager *m, int task_id, int timeout);
1024
1036int vine_hungry(struct vine_manager *m);
1037
1045int vine_empty(struct vine_manager *m);
1046
1053int vine_port(struct vine_manager *m);
1054
1059void vine_set_name(struct vine_manager *m, const char *name);
1060
1065const char *vine_get_name(struct vine_manager *m);
1066
1076int vine_enable_monitoring(struct vine_manager *m, int watchdog, int time_series);
1077
1079int vine_enable_peer_transfers(struct vine_manager *m);
1080
1082int vine_disable_peer_transfers(struct vine_manager *m);
1083
1094int vine_set_task_id_min(struct vine_manager *m, int minid);
1095
1100void vine_block_host(struct vine_manager *m, const char *hostname);
1101
1109void vine_block_host_with_timeout(struct vine_manager *m, const char *hostname, time_t seconds);
1110
1115void vine_unblock_host(struct vine_manager *m, const char *hostname);
1116
1120void vine_unblock_all(struct vine_manager *m);
1121
1126void vine_get_stats(struct vine_manager *m, struct vine_stats *s);
1127
1133void vine_get_stats_category(struct vine_manager *m, const char *c, struct vine_stats *s);
1134
1139char *vine_get_status(struct vine_manager *m, const char *request);
1140
1146struct rmsummary **vine_summarize_workers(struct vine_manager *m);
1147
1152void vine_set_bandwidth_limit(struct vine_manager *m, const char *bandwidth);
1153
1158double vine_get_effective_bandwidth(struct vine_manager *m);
1159
1170int vine_enable_disconnect_slow_workers(struct vine_manager *m, double multiplier);
1171
1181int vine_enable_disconnect_slow_workers_category(struct vine_manager *m, const char *category, double multiplier);
1182
1191int vine_set_draining_by_hostname(struct vine_manager *m, const char *hostname, int drain_flag);
1192
1200int vine_set_category_mode(struct vine_manager *m, const char *category, vine_category_mode_t mode);
1201
1208void vine_set_category_max_concurrent(struct vine_manager *m, const char *category, int max_concurrent);
1209
1218int vine_enable_category_resource(struct vine_manager *m, const char *category, const char *resource, int autolabel);
1219
1225void vine_set_scheduler(struct vine_manager *m, vine_schedule_t algorithm);
1226
1231void vine_set_priority(struct vine_manager *m, int priority);
1232
1241void vine_set_tasks_left_count(struct vine_manager *m, int ntasks);
1242
1247void vine_set_catalog_servers(struct vine_manager *m, const char *hosts);
1248
1249/* Send updates to the catalog server.
1250@param m A manager object
1251*/
1252void vine_update_catalog(struct vine_manager *m);
1253
1264void vine_set_property(struct vine_manager *m, const char *name, const char *value);
1265
1272int vine_cancel_by_task_id(struct vine_manager *m, int id);
1273
1280int vine_cancel_by_task_tag(struct vine_manager *m, const char *tag);
1281
1287int vine_cancel_all(struct vine_manager *m);
1288
1295int vine_enable_debug_log(const char *logfile);
1296
1302int vine_enable_perf_log(struct vine_manager *m, const char *logfile);
1303
1309int vine_enable_transactions_log(struct vine_manager *m, const char *logfile);
1310
1316int vine_enable_taskgraph_log(struct vine_manager *m, const char *logfile);
1317
1323int vine_workers_shutdown(struct vine_manager *m, int n);
1324
1330void vine_set_password(struct vine_manager *m, const char *password);
1331
1338int vine_set_password_file(struct vine_manager *m, const char *file);
1339
1344void vine_set_keepalive_interval(struct vine_manager *m, int interval);
1345
1350void vine_set_keepalive_timeout(struct vine_manager *m, int timeout);
1351
1358void vine_set_manager_preferred_connection(struct vine_manager *m, const char *preferred_connection);
1359
1403int vine_tune(struct vine_manager *m, const char *name, double value);
1404
1410void vine_set_resources_max(struct vine_manager *m, const struct rmsummary *rm);
1411
1417void vine_set_resources_min(struct vine_manager *m, const struct rmsummary *rm);
1418
1424void vine_set_category_resources_max(struct vine_manager *m, const char *category, const struct rmsummary *rm);
1425
1431void vine_set_category_resources_min(struct vine_manager *m, const char *category, const struct rmsummary *rm);
1432
1438void vine_set_category_first_allocation_guess(struct vine_manager *m, const char *category, const struct rmsummary *rm);
1439
1445void vine_initialize_categories(struct vine_manager *m, struct rmsummary *max, const char *summaries_file);
1446
1450void vine_set_runtime_info_path(const char *path);
1451
1456void vine_log_debug_app(struct vine_manager *q, const char *entry);
1457
1462void vine_log_txn_app(struct vine_manager *q, const char *entry);
1463
1468
1473
1478char *vine_get_path_log(struct vine_manager *m, const char *path);
1479
1484char *vine_get_path_staging(struct vine_manager *m, const char *path);
1485
1490char *vine_get_path_library_log(struct vine_manager *m, const char *path);
1491
1496char *vine_get_path_cache(struct vine_manager *m, const char *path);
1497
1499
1500#endif
Implements bookkeeping for categories of tasks and their resources.
@ CATEGORY_ALLOCATION_MODE_MIN_WASTE
As above, but tasks are first tried with an automatically computed allocation to minimize resource wa...
Definition category.h:55
@ CATEGORY_ALLOCATION_MODE_FIXED
When monitoring is disabled, all tasks run as WORK_QUEUE_ALLOCATION_MODE_FIXED.
Definition category.h:36
@ CATEGORY_ALLOCATION_MODE_GREEDY_BUCKETING
Use the greedy bucketing algorithm to label resources.
Definition category.h:61
@ CATEGORY_ALLOCATION_MODE_EXHAUSTIVE_BUCKETING
Use the exhaustive bucketing algorithm to label resources.
Definition category.h:64
@ CATEGORY_ALLOCATION_MODE_MAX_THROUGHPUT
As above, but maximizing throughput.
Definition category.h:59
@ CATEGORY_ALLOCATION_MODE_MAX
When monitoring is enabled, tasks are tried with maximum specified values of cores,...
Definition category.h:43
Definition buffer.h:26
Definition category.h:69
Definition rmsummary.h:27
Statistics describing a manager.
Definition taskvine.h:151
int tasks_running
Number of tasks currently executing at some worker.
Definition taskvine.h:174
timestamp_t time_internal
Total time the manager spents in internal processing.
Definition taskvine.h:201
int tasks_exhausted_attempts
Total number of task executions that failed given resource exhaustion.
Definition taskvine.h:184
int workers_joined
Total number of worker connections that were established to the manager.
Definition taskvine.h:161
int64_t committed_cores
Committed number of cores aggregated across the connected workers.
Definition taskvine.h:239
int workers_blocked
Total number of workers blocked by the manager.
Definition taskvine.h:167
timestamp_t time_workers_execute_exhaustion
Total time workers spent executing tasks that exhausted resources.
Definition taskvine.h:211
timestamp_t time_scheduling
Total time spend matching tasks to workers.
Definition taskvine.h:205
timestamp_t time_status_msgs
Total time spent sending and receiving status messages to and from workers, including workers' standa...
Definition taskvine.h:198
timestamp_t time_workers_execute_good
Total time workers spent executing done tasks with result VINE_RESULT_SUCCESS.
Definition taskvine.h:209
int workers_connected
Number of workers currently connected to the manager.
Definition taskvine.h:153
int workers_released
Total number of worker connections that were asked by the manager to disconnect.
Definition taskvine.h:163
int capacity_instantaneous
The estimated number of tasks that this manager can support considering only the most recently comple...
Definition taskvine.h:229
int workers_init
Number of workers connected, but that have not send their available resources report yet.
Definition taskvine.h:154
int workers_slow
Total number of workers disconnected for being too slow.
Definition taskvine.h:165
int64_t min_gpus
The smallest number of gpus observed among the connected workers.
Definition taskvine.h:252
int workers_idle
Number of workers that are not running a task.
Definition taskvine.h:156
int workers_idled_out
Total number of worker that disconnected for being idle.
Definition taskvine.h:164
int64_t max_disk
The largest disk space in MB observed among the connected workers.
Definition taskvine.h:246
int64_t total_cores
Total number of cores aggregated across the connected workers.
Definition taskvine.h:234
timestamp_t time_when_started
Absolute time at which the manager started.
Definition taskvine.h:190
int workers_removed
Total number of worker connections that were terminated.
Definition taskvine.h:162
int tasks_cancelled
Total number of tasks cancelled.
Definition taskvine.h:183
int capacity_tasks
The estimated number of tasks that this manager can effectively support.
Definition taskvine.h:223
int64_t committed_disk
Committed disk space in MB aggregated across the connected workers.
Definition taskvine.h:241
int64_t total_disk
Total disk space in MB aggregated across the connected workers.
Definition taskvine.h:236
int workers_able
Number of workers on which the largest task can run.
Definition taskvine.h:158
int64_t min_cores
The lowest number of cores observed among the connected workers.
Definition taskvine.h:249
int64_t bytes_sent
Total number of file bytes (not including protocol control msg bytes) sent out to the workers by the ...
Definition taskvine.h:215
int64_t committed_gpus
Committed number of gpus aggregated across the connected workers.
Definition taskvine.h:242
int64_t bytes_received
Total number of file bytes (not including protocol control msg bytes) received from the workers by th...
Definition taskvine.h:217
int tasks_waiting
Number of tasks waiting to be dispatched.
Definition taskvine.h:172
int64_t committed_memory
Committed memory in MB aggregated across the connected workers.
Definition taskvine.h:240
timestamp_t time_receive_good
Total time spent in sending data to workers for tasks with result VINE_RESULT_SUCCESS.
Definition taskvine.h:196
int tasks_dispatched
Total number of tasks dispatch to workers.
Definition taskvine.h:179
int tasks_failed
Total number of tasks completed and returned to user with result other than VINE_RESULT_SUCCESS.
Definition taskvine.h:181
int workers_lost
Total number of worker connections that were unexpectedly lost.
Definition taskvine.h:168
int64_t total_memory
Total memory in MB aggregated across the connected workers.
Definition taskvine.h:235
int workers_busy
Number of workers that are running at least one task.
Definition taskvine.h:157
int capacity_memory
The estimated number of workers' MB of RAM that this manager can effectively support.
Definition taskvine.h:225
int64_t min_memory
The smallest memory size in MB observed among the connected workers.
Definition taskvine.h:250
int tasks_done
Total number of tasks completed and returned to user.
Definition taskvine.h:180
int capacity_disk
The estimated number of workers' MB of disk that this manager can effectively support.
Definition taskvine.h:227
int tasks_with_results
Number of tasks with retrieved results and waiting to be returned to user.
Definition taskvine.h:175
timestamp_t time_send
Total time spent in sending tasks to workers (tasks descriptions, and input files....
Definition taskvine.h:191
int64_t max_cores
The highest number of cores observed among the connected workers.
Definition taskvine.h:244
timestamp_t time_application
Total time spent outside vine_wait.
Definition taskvine.h:204
timestamp_t time_receive
Total time spent in receiving results from workers (output files.).
Definition taskvine.h:193
int64_t total_gpus
Total number of gpus aggregated across the connected workers.
Definition taskvine.h:237
double bandwidth
Average network bandwidth in MB/S observed by the manager when transferring to workers.
Definition taskvine.h:219
timestamp_t time_workers_execute
Total time workers spent executing done tasks.
Definition taskvine.h:208
int64_t max_gpus
The highest number of gpus observed among the connected workers.
Definition taskvine.h:247
timestamp_t time_polling
Total time blocking waiting for worker communications (i.e., manager idle waiting for a worker messag...
Definition taskvine.h:202
int64_t min_disk
The smallest disk space in MB observed among the connected workers.
Definition taskvine.h:251
int capacity_gpus
The estimated number of workers' GPUs that this manager can effectively support.
Definition taskvine.h:228
int64_t max_memory
The largest memory size in MB observed among the connected workers.
Definition taskvine.h:245
int tasks_on_workers
Number of tasks currently dispatched to some worker.
Definition taskvine.h:173
int tasks_submitted
Total number of tasks submitted to the manager.
Definition taskvine.h:178
int64_t inuse_cache
Used disk space of declared files in MB aggregated across the connected workers.
Definition taskvine.h:254
int capacity_weighted
The estimated number of tasks that this manager can support placing greater weight on the most recent...
Definition taskvine.h:231
timestamp_t time_send_good
Total time spent in sending data to workers for tasks with result VINE_RESULT_SUCCESS.
Definition taskvine.h:194
int capacity_cores
The estimated number of workers' cores that this manager can effectively support.
Definition taskvine.h:224
void vine_task_set_memory(struct vine_task *t, int64_t memory)
Specify the amount of disk space required by a task.
void vine_task_set_scheduler(struct vine_task *t, vine_schedule_t algorithm)
Select the scheduling algorithm for a single task.
char * vine_version_string()
Return a string with the current version of taskvine.
void vine_task_set_disk(struct vine_task *t, int64_t disk)
Specify the amount of disk space required by a task.
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.
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 t...
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.
int vine_task_add_starch_package(struct vine_task *t, struct vine_file *f)
Add a Starch package as an execution context.
int vine_set_task_id_min(struct vine_manager *m, int minid)
Set the minimum task_id of future submitted tasks.
int vine_task_set_monitor_output(struct vine_task *t, const char *monitor_output)
Specify a custom name for the monitoring summary.
const char * vine_file_source(struct vine_file *f)
Get the filename of the file if the file is local to the manager.
void vine_unblock_host(struct vine_manager *m, const char *hostname)
Unblock host from a manager.
const char * vine_task_get_category(struct vine_task *t)
Get the category associated with the task.
void vine_task_set_tag(struct vine_task *t, const char *tag)
Attach a user defined string tag to the task.
int vine_cancel_by_task_id(struct vine_manager *m, int id)
Cancel a submitted task using its task id.
int vine_hungry(struct vine_manager *m)
Determine whether the manager is 'hungry' for more tasks.
void vine_manager_remove_library(struct vine_manager *m, const char *name)
Indicate the library to be removed from all connected workers.
struct vine_file * vine_declare_temp(struct vine_manager *m)
Create a scratch file object.
void vine_set_catalog_servers(struct vine_manager *m, const char *hosts)
Specify the catalog server(s) the manager should report to.
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).
struct rmsummary ** vine_summarize_workers(struct vine_manager *m)
Summary data for all workers in buffer.
void vine_set_runtime_info_path(const char *path)
Sets the path where runtime info directories (logs and staging) are created.
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.
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.
int vine_enable_monitoring(struct vine_manager *m, int watchdog, int time_series)
Enables resource monitoring for tasks.
vine_result_t vine_task_get_result(struct vine_task *t)
Get the end result of the task.
const char * vine_fetch_file(struct vine_manager *m, struct vine_file *f)
Fetch the contents of a file.
int vine_tune(struct vine_manager *m, const char *name, double value)
Tune advanced parameters for manager.
vine_mount_flags_t
Select optional handling for input and output files: caching, unpacking, watching,...
Definition taskvine.h:43
@ VINE_TRANSFER_ALWAYS
Always transfer this file when needed.
Definition taskvine.h:44
@ VINE_RETRACT_ON_RESET
Remove this file from the mount lists if the task is reset.
Definition taskvine.h:51
@ VINE_WATCH
Watch the output file and send back changes as the task runs.
Definition taskvine.h:47
@ VINE_MOUNT_SYMLINK
Permit this directory to be mounted via symlink instead of hardlink.
Definition taskvine.h:53
@ VINE_MOUNT_MKDIR
Create this empty output directory in the task sandbox prior to execution.
Definition taskvine.h:54
@ VINE_SUCCESS_ONLY
Only return this output file if the task succeeded.
Definition taskvine.h:50
@ VINE_FIXED_LOCATION
Never transfer input files with this flag to a worker for execution.
Definition taskvine.h:45
@ VINE_FAILURE_ONLY
Only return this output file if the task failed.
Definition taskvine.h:48
const char * vine_task_get_tag(struct vine_task *t)
Get the tag associated with the task.
double vine_get_effective_bandwidth(struct vine_manager *m)
Get current manager bandwidth.
void vine_task_set_library_required(struct vine_task *t, const char *name)
Set the library name required by this task.
void vine_get_stats(struct vine_manager *m, struct vine_stats *s)
Get manager statistics (only from manager)
void vine_task_set_command(struct vine_task *t, const char *cmd)
Indicate the command to be executed.
vine_file_flags_t
Control sharing and garbage collection behavior of file objects.
Definition taskvine.h:66
@ VINE_PEER_NOSHARE
Schedule this file to be shared between peers where available.
Definition taskvine.h:67
@ VINE_UNLINK_WHEN_DONE
Whether to delete the file when its reference count is 0.
Definition taskvine.h:69
int vine_enable_debug_log(const char *logfile)
Turn on the debugging log output and send to the named file.
void vine_unblock_all(struct vine_manager *m)
Unblock all host.
void vine_task_set_function_slots(struct vine_task *t, int nslots)
Set the number of concurrent functions a library can run.
vine_file_type_t
The type of an input or output file to attach to a task.
Definition taskvine.h:141
@ VINE_URL
A file obtained by downloading from a URL.
Definition taskvine.h:143
@ VINE_BUFFER
A file obtained from data in the manager's memory space.
Definition taskvine.h:145
@ VINE_MINI_TASK
A file obtained by executing a Unix command line.
Definition taskvine.h:146
@ VINE_FILE
A file or directory present at the manager.
Definition taskvine.h:142
@ VINE_TEMP
A temporary file created as an output of a task.
Definition taskvine.h:144
size_t vine_file_size(struct vine_file *f)
Get the length of a vine file.
char * vine_get_status(struct vine_manager *m, const char *request)
Get manager information as json.
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.
void vine_set_priority(struct vine_manager *m, int priority)
Change the priority for a given manager.
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).
void vine_log_debug_app(struct vine_manager *q, const char *entry)
Adds a custom APPLICATION entry to the debug log.
int vine_disable_peer_transfers(struct vine_manager *m)
Disable taskvine peer transfers to be scheduled by the manager.
void vine_task_add_feature(struct vine_task *t, const char *name)
Label the task with a user-defined feature.
vine_schedule_t
Select overall scheduling algorithm for matching tasks to workers.
Definition taskvine.h:74
@ VINE_SCHEDULE_WORST
Select the worst fit worker (the worker with more unused resources).
Definition taskvine.h:80
@ VINE_SCHEDULE_FILES
Select worker that has the most data required by the task.
Definition taskvine.h:77
@ VINE_SCHEDULE_UNSET
Internal use only.
Definition taskvine.h:75
@ VINE_SCHEDULE_TIME
Select worker that has the fastest execution time on previous tasks.
Definition taskvine.h:78
@ VINE_SCHEDULE_FCFS
Select worker on a first-come-first-serve basis.
Definition taskvine.h:76
@ VINE_SCHEDULE_RAND
Select a random worker.
Definition taskvine.h:79
const char * vine_task_get_hostname(struct vine_task *t)
Get the hostname of the worker on which the task ran.
void vine_task_set_cores(struct vine_task *t, int cores)
Specify the number of cores required by a task.
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.
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...
vine_result_t
Possible outcomes for a task, returned by vine_task_get_result.
Definition taskvine.h:87
@ VINE_RESULT_RESOURCE_EXHAUSTION
The task used more resources than requested.
Definition taskvine.h:94
@ VINE_RESULT_MAX_RETRIES
Currently unused.
Definition taskvine.h:98
@ VINE_RESULT_FORSAKEN
The task failed, but it was not a task error.
Definition taskvine.h:97
@ VINE_RESULT_FIXED_LOCATION_MISSING
The task failed because no worker could satisfy the fixed location input file requirements.
Definition taskvine.h:105
@ VINE_RESULT_LIBRARY_EXIT
Task is a library that has terminated.
Definition taskvine.h:108
@ VINE_RESULT_OUTPUT_MISSING
The task ran but failed to generate a specified output file.
Definition taskvine.h:91
@ VINE_RESULT_SUCCESS
The task ran successfully, and its Unix exit code is given by vine_task_get_exit_code.
Definition taskvine.h:88
@ VINE_RESULT_UNKNOWN
The result could not be classified.
Definition taskvine.h:96
@ VINE_RESULT_SIGNAL
The task was terminated with a signal.
Definition taskvine.h:93
@ VINE_RESULT_MAX_WALL_TIME
The task ran for more than the specified time (relative since running in a worker).
Definition taskvine.h:99
@ VINE_RESULT_STDOUT_MISSING
The task ran but its stdout has been truncated.
Definition taskvine.h:92
@ VINE_RESULT_MAX_END_TIME
The task ran after the specified (absolute since epoch) end time.
Definition taskvine.h:95
@ VINE_RESULT_OUTPUT_TRANSFER_ERROR
The task failed because an output could be transfered to the manager (not enough disk space,...
Definition taskvine.h:103
@ VINE_RESULT_INPUT_MISSING
The task cannot be run due to a missing input file.
Definition taskvine.h:90
@ VINE_RESULT_CANCELLED
The task was cancelled by the caller.
Definition taskvine.h:107
@ VINE_RESULT_RMONITOR_ERROR
The task failed because the monitor did not produce a summary report.
Definition taskvine.h:101
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.
void vine_task_set_gpus(struct vine_task *t, int gpus)
Specify the number of gpus required by a task.
void vine_delete(struct vine_manager *m)
Delete a manager.
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.
void vine_task_set_priority(struct vine_task *t, double priority)
Specify the priority of this task relative to others in the manager.
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.
char * vine_get_path_cache(struct vine_manager *m, const char *path)
Returns path relative to the cache runtime directory.
int vine_task_get_id(struct vine_task *t)
Get the unique ID of the task.
const char * vine_result_string(vine_result_t result)
Explain result codes from tasks.
const char * vine_file_contents(struct vine_file *f)
Get the contents of a vine file.
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 catego...
int vine_set_password_file(struct vine_manager *m, const char *file)
Add a mandatory password file that each worker must present.
void vine_task_set_library_provided(struct vine_task *t, const char *name)
Set the library name provided by this task.
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.
vine_cache_level_t
Control caching and sharing behavior of file objects.
Definition taskvine.h:58
@ VINE_CACHE_LEVEL_TASK
Do not cache file at worker.
Definition taskvine.h:59
@ VINE_CACHE_LEVEL_FOREVER
File remains at execution site when worker terminates.
Definition taskvine.h:62
@ VINE_CACHE_LEVEL_WORKER
File remains in cache of worker until worker terminates.
Definition taskvine.h:61
@ VINE_CACHE_LEVEL_WORKFLOW
File remains in cache of worker until workflow ends.
Definition taskvine.h:60
void vine_set_tasks_left_count(struct vine_manager *m, int ntasks)
Specify the number of tasks not yet submitted to the manager.
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).
void vine_set_password(struct vine_manager *m, const char *password)
Add a mandatory password that each worker must present.
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.
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.
struct vine_manager * vine_create(int port)
Create a new manager.
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.
const char * vine_task_get_library_required(struct vine_task *t)
Get the library name required by this task.
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.
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.
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.
void vine_task_delete(struct vine_task *t)
Delete a task.
const char * vine_task_get_stdout(struct vine_task *t)
Get the standard output of the task.
int vine_workers_shutdown(struct vine_manager *m, int n)
Shut down workers connected to the manager.
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.
struct vine_task * vine_manager_find_library_template(struct vine_manager *q, const char *library_name)
Find a library template on the manager.
char * vine_get_path_log(struct vine_manager *m, const char *path)
Returns path relative to the logs runtime directory.
vine_file_type_t vine_file_type(struct vine_file *f)
Get the type of file.
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.
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.
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.
void vine_log_txn_app(struct vine_manager *q, const char *entry)
Adds a custom APPLICATION entry to the transactions log.
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.
void vine_set_keepalive_interval(struct vine_manager *m, int interval)
Change the keepalive interval for a given manager.
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.
void vine_task_set_resources(struct vine_task *t, const struct rmsummary *rm)
Set the expected resource consumption of a task before execution.
int vine_cancel_all(struct vine_manager *m)
Cancel all submitted tasks and remove them from the manager.
int64_t vine_task_get_metric(struct vine_task *t, const char *name)
Get a performance metric of a completed task.
struct vine_task * vine_wait(struct vine_manager *m, int timeout)
Wait for a task to complete.
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.
const char * vine_task_get_command(struct vine_task *t)
Get the command line of the task.
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.
void vine_get_stats_category(struct vine_manager *m, const char *c, struct vine_stats *s)
Get the task statistics for the given category.
void vine_counters_print()
Display internal reference counts for troubleshooting purposes.
const char * vine_task_get_library_provided(struct vine_task *t)
Get the library name provided by this task.
int vine_port(struct vine_manager *m)
Get the listening port of the manager.
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).
void vine_block_host(struct vine_manager *m, const char *hostname)
Block workers in hostname from working for manager q.
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...
struct vine_manager * vine_ssl_create(int port, const char *key, const char *cert)
Create a new manager using SSL.
int vine_task_get_exit_code(struct vine_task *t)
Get the Unix exit code of the task.
void vine_set_bandwidth_limit(struct vine_manager *m, const char *bandwidth)
Limit the manager bandwidth when transferring files to and from workers.
int vine_empty(struct vine_manager *m)
Determine whether the manager is empty.
vine_category_mode_t
Select how to allocate resources for similar tasks with vine_set_category_mode.
Definition taskvine.h:113
@ VINE_ALLOCATION_MODE_FIXED
When monitoring is disabled, all tasks run as VINE_ALLOCATION_MODE_FIXED.
Definition taskvine.h:117
@ VINE_ALLOCATION_MODE_MIN_WASTE
As above, but tasks are first tried with an automatically computed allocation to minimize resource wa...
Definition taskvine.h:130
@ VINE_ALLOCATION_MODE_MAX_THROUGHPUT
As above, but maximizing throughput.
Definition taskvine.h:133
@ VINE_ALLOCATION_MODE_MAX
When monitoring is enabled, tasks are tried with maximum specified values of cores,...
Definition taskvine.h:126
void vine_prune_file(struct vine_manager *m, struct vine_file *f)
Prune a file among the cluster.
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.
void vine_set_name(struct vine_manager *m, const char *name)
Change the project name for a given manager.
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.
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.
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.
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...
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.
char * vine_get_path_staging(struct vine_manager *m, const char *path)
Returns path relative to the staging runtime directory.
void vine_task_set_category(struct vine_task *t, const char *category)
Label the task with the given category.
struct vine_task * vine_task_create(const char *full_command)
Create a new task object.
void vine_set_scheduler(struct vine_manager *m, vine_schedule_t algorithm)
Change the worker selection algorithm.
void vine_initialize_categories(struct vine_manager *m, struct rmsummary *max, const char *summaries_file)
Initialize first value of categories.
int vine_task_add_execution_context(struct vine_task *t, struct vine_file *f)
Adds an execution context to the task.
int vine_enable_peer_transfers(struct vine_manager *m)
Enable taskvine peer transfers to be scheduled by the manager.
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.
int vine_submit(struct vine_manager *m, struct vine_task *t)
Submit a task to a manager.
const char * vine_task_get_addrport(struct vine_task *t)
Get the address and port of the worker on which the task ran.
int vine_set_draining_by_hostname(struct vine_manager *m, const char *hostname, int drain_flag)
Set the draining mode per worker hostname.
const char * vine_get_name(struct vine_manager *m)
Get the project name of the manager.
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.
char * vine_get_path_library_log(struct vine_manager *m, const char *path)
Returns path relative to the library logs runtime directory.
int vine_enable_taskgraph_log(struct vine_manager *m, const char *logfile)
Add an output log that produces the taskgraph in Grapvhiz Dot format.
void vine_set_keepalive_timeout(struct vine_manager *m, int timeout)
Change the keepalive timeout for identifying dead workers for a given manager.
int vine_task_add_poncho_package(struct vine_task *t, struct vine_file *f)
Add a Poncho package as an execution context.
Portable routines for high resolution timing.
UINT64_T timestamp_t
A type to hold the current time, in microseconds since January 1st, 1970.
Definition timestamp.h:20