Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions taskvine/src/manager/taskvine.h
Original file line number Diff line number Diff line change
Expand Up @@ -1388,6 +1388,12 @@ void vine_set_password(struct vine_manager *m, const char *password);

int vine_set_password_file(struct vine_manager *m, const char *file);

/** Get the number of recovery tasks submitted to the manager.
@param m A manager object
@return The number of recovery tasks submitted to the manager.
*/
int vine_get_num_submitted_recovery_tasks(struct vine_manager *m);

/** Change the keepalive interval for a given manager.
@param m A manager object
@param interval The minimum number of seconds to wait before sending new keepalive checks to workers.
Expand Down
12 changes: 10 additions & 2 deletions taskvine/src/manager/vine_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -3519,7 +3519,7 @@ static void vine_manager_consider_recovery_task(struct vine_manager *q, struct v
case VINE_TASK_INITIAL:
/* The recovery task has never been run, so submit it now. */
vine_submit(q, rt);
notice(D_VINE, "Submitted recovery task %d (%s) to re-create lost temporary file %s.", rt->task_id, rt->command_line, lost_file->cached_name);
debug(D_VINE, "Submitted recovery task %d (%s) to re-create lost temporary file %s.", rt->task_id, rt->command_line, lost_file->cached_name);
break;
case VINE_TASK_READY:
case VINE_TASK_RUNNING:
Expand All @@ -3533,7 +3533,7 @@ static void vine_manager_consider_recovery_task(struct vine_manager *q, struct v
* here. */
vine_task_reset(rt);
vine_submit(q, rt);
notice(D_VINE, "Submitted recovery task %d (%s) to re-create lost temporary file %s.", rt->task_id, rt->command_line, lost_file->cached_name);
debug(D_VINE, "Submitted recovery task %d (%s) to re-create lost temporary file %s.", rt->task_id, rt->command_line, lost_file->cached_name);
break;
}
}
Expand Down Expand Up @@ -4440,6 +4440,11 @@ int vine_set_password_file(struct vine_manager *q, const char *file)
return copy_file_to_buffer(file, &q->password, NULL) > 0;
}

int vine_get_num_submitted_recovery_tasks(struct vine_manager *q)
{
return q->num_submitted_recovery_tasks;
}

static void delete_task_at_exit(struct vine_task *t)
{
if (!t) {
Expand Down Expand Up @@ -4869,6 +4874,7 @@ int vine_submit(struct vine_manager *q, struct vine_task *t)
* this distinction is important when many files are lost and the workflow is effectively rerun from scratch. */
if (t->type == VINE_TASK_TYPE_RECOVERY) {
vine_task_set_priority(t, t->priority + priority_queue_get_top_priority(q->ready_tasks) + 1);
q->num_submitted_recovery_tasks++;
}

if (t->has_fixed_locations) {
Expand Down Expand Up @@ -5375,6 +5381,8 @@ static struct vine_task *vine_wait_internal(struct vine_manager *q, int timeout,

q->nothing_happened_last_wait_cycle = 0;

q->num_submitted_recovery_tasks = 0;

// Retrieve results from workers. We do a worker at a time to be more efficient.
// We get a known worker with results from the first task in the waiting_retrieval_list,
// and get as many tasks as possible under the q->max_retrievals constraint.
Expand Down
1 change: 1 addition & 0 deletions taskvine/src/manager/vine_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ struct vine_manager {
int num_tasks_left; /* Optional: Number of tasks remaining, if given by user. @ref vine_set_num_tasks */
int nothing_happened_last_wait_cycle; /* Set internally in main loop if no messages or tasks were processed during the last wait loop.
If set, poll longer to avoid wasting cpu cycles, and growing log files unnecessarily.*/
int num_submitted_recovery_tasks; /* Number of recovery tasks submitted to restore lost temp files. */

/* Accumulation of statistics for reporting to the caller. */

Expand Down
Loading