From 5c72304497c06ae13b73c10a6b08dc362f5277d9 Mon Sep 17 00:00:00 2001 From: Earle Lowe Date: Thu, 17 Aug 2023 11:44:38 -0700 Subject: [PATCH] fix --- src/prover_disk.hpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/prover_disk.hpp b/src/prover_disk.hpp index 8fd18ce8c..e3a967447 100644 --- a/src/prover_disk.hpp +++ b/src/prover_disk.hpp @@ -112,7 +112,8 @@ class ContextQueue { // throw std::runtime_error(err.str()); // } // } - printf( "[ContextQueue] Timeout time: %d\n", (int)context_queue_timeout); fflush( stdout ); + printf("[ContextQueue] Timeout time: %d\n", (int)context_queue_timeout); + fflush(stdout); GreenReaperConfig cfg = {}; cfg.apiVersion = GR_API_VERSION; cfg.threadCount = thread_count; @@ -128,6 +129,12 @@ class ContextQueue { } cfg.gpuDeviceIndex = gpu_index; + std::cout << " [ContextQueue] Setting this->context_queue_timeout to: " + << context_queue_timeout << std::endl + << std::flush; + + this->context_queue_timeout = context_queue_timeout; + for (uint32_t i = 0; i < context_count; i++) { cfg.cpuOffset = i * thread_count; @@ -151,6 +158,7 @@ class ContextQueue { // Destroy contexts that were already created while (!queue.empty()) { grDestroyContext( queue.front() ); + // does it matter that the timeout is active at this time? queue.pop(); } if (error_msg.length() < 1) { @@ -169,15 +177,6 @@ class ContextQueue { } } } - std::cout << " Setting this->context_queue_timeout to: " << context_queue_timeout - << std::endl - << std::flush; - - this->context_queue_timeout = context_queue_timeout; - - std::cout << " this->context_queue_timeout is now: " << this->context_queue_timeout - << std::endl - << std::flush; return false; }