From b6e17e062f66c0be694f0acb639da869ce50c455 Mon Sep 17 00:00:00 2001 From: JinZhou5042 Date: Wed, 11 Dec 2024 10:08:22 -0500 Subject: [PATCH] remove test comment --- taskvine/src/manager/vine_manager.c | 6 ++---- taskvine/src/manager/vine_schedule.c | 19 +++++++++++-------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/taskvine/src/manager/vine_manager.c b/taskvine/src/manager/vine_manager.c index d1ad3f5572..ffc62fa9a9 100644 --- a/taskvine/src/manager/vine_manager.c +++ b/taskvine/src/manager/vine_manager.c @@ -371,7 +371,7 @@ static int handle_cache_update(struct vine_manager *q, struct vine_worker_info * vine_txn_log_write_cache_update(q, w, size, transfer_time, start_time, cachename); - w->resources->disk.inuse += size / 1e6; + w->resources->disk.inuse += BYTES_TO_MEGABYTES(size); /* If the replica corresponds to a declared file. */ @@ -2615,9 +2615,7 @@ struct rmsummary *vine_manager_choose_resources_for_task(struct vine_manager *q, /* do not count the size of input files as available. * TODO: efficiently discount the size of files already at worker. */ - if (t->input_files_size > 0) { - available_disk -= t->input_files_size; - } + available_disk -= t->input_files_size; rmsummary_merge_override_basic(limits, max); diff --git a/taskvine/src/manager/vine_schedule.c b/taskvine/src/manager/vine_schedule.c index 42a272be1c..279e0d743e 100644 --- a/taskvine/src/manager/vine_schedule.c +++ b/taskvine/src/manager/vine_schedule.c @@ -137,17 +137,20 @@ int check_worker_have_enough_resources(struct vine_manager *q, struct vine_worke ok = 0; } - const char *filename = "resource_allocation.csv"; - FILE *file = fopen(filename, "a"); + /* TEST - if (file == NULL) { - perror("failed to open file"); - return EXIT_FAILURE; - } + const char *filename = "resource_allocation.csv"; + FILE *file = fopen(filename, "a"); + + if (file == NULL) { + perror("failed to open file"); + return EXIT_FAILURE; + } - fprintf(file, "%d,%f,%f,%f,%ld,%ld,%ld\n", t->task_id, tr->cores, tr->memory, tr->disk, worker_net_resources->cores.total - worker_net_resources->cores.inuse, worker_net_resources->memory.total - worker_net_resources->memory.inuse, worker_net_resources->disk.total - worker_net_resources->disk.inuse); + fprintf(file, "%d,%f,%f,%f,%ld,%ld,%ld\n", t->task_id, tr->cores, tr->memory, tr->disk, worker_net_resources->cores.total - worker_net_resources->cores.inuse, worker_net_resources->memory.total - worker_net_resources->memory.inuse, worker_net_resources->disk.total - worker_net_resources->disk.inuse); - fclose(file); + fclose(file); + */ vine_resources_delete(worker_net_resources); return ok;