Skip to content

Commit

Permalink
Vine: Fix disk accounting (#3515)
Browse files Browse the repository at this point in the history
* fix

* format
  • Loading branch information
tphung3 authored Sep 26, 2023
1 parent 754f385 commit 4998b05
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions taskvine/src/worker/vine_worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,12 @@ static void measure_worker_resources()
r->disk.total = MIN(r->disk.total, manual_disk_option);
} else {
/* Set the reporting disk to a fraction of the measured disk to avoid
* unnecessarily forsaking tasks with unspecified resources. */
r->disk.total = ceil(r->disk.total * disk_percent / 100);
* unnecessarily forsaking tasks with unspecified resources.
* Note that @vine_resources_measure_locally reports that
* disk.total = available_disk + disk.inuse, so we leave out disk.inuse in
* the discounting calculation, then add it back in. */
r->disk.total -= r->disk.inuse;
r->disk.total = ceil(r->disk.total * disk_percent / 100) + r->disk.inuse;
}

r->disk.inuse = measure_worker_disk();
Expand Down

0 comments on commit 4998b05

Please sign in to comment.