Skip to content

Commit 8796c3c

Browse files
authored
Vine: Source Code Clarifications (#4242)
* retrieve_output -> get_stdout_long * get_available_results -> get_watched_file_updates * Clarify comment about pruning.
1 parent 8625390 commit 8796c3c

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

taskvine/src/manager/vine_manager.c

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ static void reap_task_from_worker(struct vine_manager *q, struct vine_worker_inf
131131
static void reset_task_to_state(struct vine_manager *q, struct vine_task *t, vine_task_state_t new_state);
132132
static void count_worker_resources(struct vine_manager *q, struct vine_worker_info *w);
133133
static vine_result_code_t get_stdout(struct vine_manager *q, struct vine_worker_info *w, struct vine_task *t, int64_t output_length);
134-
static vine_result_code_t retrieve_output(struct vine_manager *q, struct vine_worker_info *w, struct vine_task *t);
134+
static vine_result_code_t get_stdout_long(struct vine_manager *q, struct vine_worker_info *w, struct vine_task *t);
135135

136136
static void find_max_worker(struct vine_manager *q);
137137
static void update_max_worker(struct vine_manager *q, struct vine_worker_info *w);
@@ -1425,7 +1425,7 @@ static int fetch_outputs_from_worker(struct vine_manager *q, struct vine_worker_
14251425
default:
14261426
/* Otherwise get all of the output files. */
14271427
if (!t->output_received) {
1428-
result = retrieve_output(q, w, t);
1428+
result = get_stdout_long(q, w, t);
14291429
if (result == VINE_SUCCESS) {
14301430
t->output_received = 1;
14311431
}
@@ -1704,7 +1704,7 @@ not line up with an expected task and file, then we discard it and keep
17041704
going.
17051705
*/
17061706

1707-
static vine_result_code_t get_update(struct vine_manager *q, struct vine_worker_info *w, const char *line)
1707+
static vine_result_code_t get_watched_file_update(struct vine_manager *q, struct vine_worker_info *w, const char *line)
17081708
{
17091709
int64_t task_id;
17101710
char path[VINE_LINE_MAX];
@@ -1763,10 +1763,11 @@ static vine_result_code_t get_update(struct vine_manager *q, struct vine_worker_
17631763
}
17641764

17651765
/*
1766-
make a synchronus connection with a worker to retrieve the stdout of a task
1766+
Make a synchronus connection with a worker to retrieve the stdout of a task
1767+
when it is too long to fit in a completion message.
17671768
*/
17681769

1769-
static vine_result_code_t retrieve_output(struct vine_manager *q, struct vine_worker_info *w, struct vine_task *t)
1770+
static vine_result_code_t get_stdout_long(struct vine_manager *q, struct vine_worker_info *w, struct vine_task *t)
17701771
{
17711772
int64_t output_length;
17721773
uint64_t task_id;
@@ -1888,12 +1889,13 @@ static vine_result_code_t get_stdout(struct vine_manager *q, struct vine_worker_
18881889
}
18891890

18901891
/*
1891-
Send to this worker a request for task results.
1892-
The worker will respond with all completed tasks and updates
1893-
on watched output files. Process those results as they come back.
1892+
Send to this worker a request for watched file updates.
1893+
The worker will respond with zero or more "update" messages
1894+
indicating changes to watched files.
1895+
Process those results as they come back.
18941896
*/
18951897

1896-
static vine_result_code_t get_available_results(struct vine_manager *q, struct vine_worker_info *w)
1898+
static vine_result_code_t get_watched_file_updates(struct vine_manager *q, struct vine_worker_info *w)
18971899
{
18981900
// max_count == -1, tells the worker to send all available results.
18991901
vine_manager_send(q, w, "send_results %d\n", -1);
@@ -1911,7 +1913,7 @@ static vine_result_code_t get_available_results(struct vine_manager *q, struct v
19111913
break;
19121914
}
19131915
if (string_prefix_is(line, "update")) {
1914-
result = get_update(q, w, line);
1916+
result = get_watched_file_update(q, w, line);
19151917
if (result != VINE_SUCCESS)
19161918
break;
19171919
} else if (!strcmp(line, "end")) {
@@ -5355,7 +5357,7 @@ static struct vine_task *vine_wait_internal(struct vine_manager *q, int timeout,
53555357
char *key;
53565358
HASH_TABLE_ITERATE(q->worker_table, key, w)
53575359
{
5358-
get_available_results(q, w);
5360+
get_watched_file_updates(q, w);
53595361
hash_table_remove(q->workers_with_watched_file_updates, w->hashkey);
53605362
}
53615363
}
@@ -6432,10 +6434,10 @@ int vine_set_task_id_min(struct vine_manager *q, int minid)
64326434

64336435
/*
64346436
Remove all replicas of a special file across the compute cluster.
6435-
6436-
While invoking outside, it is primarily used to remove replicas
6437-
from workers when the file is no longer needed by the manager.
6437+
Should be invoked by the application when a file will never
6438+
be needed again, to free up available space.
64386439
*/
6440+
64396441
void vine_prune_file(struct vine_manager *m, struct vine_file *f)
64406442
{
64416443
if (!f) {

0 commit comments

Comments
 (0)