Skip to content

Commit

Permalink
check libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
JinZhou5042 committed Feb 5, 2025
1 parent 2baf535 commit bb34b00
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions taskvine/src/manager/vine_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -2842,6 +2842,16 @@ static int is_resource_fully_allocated(struct vine_manager *q, struct vine_resou
}
static int worker_has_free_resources(struct vine_manager *q, struct vine_worker_info *w)
{
/* If there are free slots on any libraries */
uint64_t task_id;
struct vine_task *t;
ITABLE_ITERATE(w->current_libraries, task_id, t)
{
if (t->function_slots_inuse < t->function_slots_total) {
return 1;
}
}

/* Always check memory and disk */
if (is_resource_fully_allocated(q, w->resources->memory) || is_resource_fully_allocated(q, w->resources->disk)) {
return 0;
Expand Down

0 comments on commit bb34b00

Please sign in to comment.