From d1331ddb8252144d5ba3aaf45d45c0dc0469f00f Mon Sep 17 00:00:00 2001 From: Vulpine05 Date: Mon, 12 Jun 2023 21:05:58 -0500 Subject: [PATCH 1/4] feat: check for condition where idle time to resume computing is greater than idle time to suspend computing. Partial fix to #4939 --- client/cs_prefs.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/client/cs_prefs.cpp b/client/cs_prefs.cpp index dedbe47eee9..21bc5b5feb2 100644 --- a/client/cs_prefs.cpp +++ b/client/cs_prefs.cpp @@ -1,6 +1,6 @@ // This file is part of BOINC. // http://boinc.berkeley.edu -// Copyright (C) 2008 University of California +// Copyright (C) 2023 University of California // // BOINC is free software; you can redistribute it and/or modify it // under the terms of the GNU Lesser General Public License @@ -740,6 +740,13 @@ void CLIENT_STATE::print_global_prefs() { global_prefs.suspend_if_no_recent_input ); } + // It is possible that computing (CPU or GPU) could be suspended indefinitely if the idle time required before continuing computing + // is longer than the time required to suspend computing when the computer is idle. In this case an alert message will be sent. + // + if ((!global_prefs.run_if_user_active || !global_prefs.run_gpu_if_user_active) && + ((global_prefs.idle_time_to_run - global_prefs.suspend_if_no_recent_input) >= 0)) { + msg_printf(0, MSG_USER_ALERT, "Idle time required to resume computing is greater than idle time required to suspend computing and will suspend CPU and/or GPU computing indefinitely. Please edit time settings under Computing Preferences."); + } // general // From 81ac34d0ef05796f524f7d15bcd8d9cb7cc7e117 Mon Sep 17 00:00:00 2001 From: Vulpine05 Date: Tue, 13 Jun 2023 20:45:21 -0500 Subject: [PATCH 2/4] fix: revise conditional statement and message If statement was missing that suspend_if_no_recent_input has to be enabled. Also revised message to be shorter. --- client/cs_prefs.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/client/cs_prefs.cpp b/client/cs_prefs.cpp index 21bc5b5feb2..a4eeb77ebcd 100644 --- a/client/cs_prefs.cpp +++ b/client/cs_prefs.cpp @@ -743,9 +743,12 @@ void CLIENT_STATE::print_global_prefs() { // It is possible that computing (CPU or GPU) could be suspended indefinitely if the idle time required before continuing computing // is longer than the time required to suspend computing when the computer is idle. In this case an alert message will be sent. // - if ((!global_prefs.run_if_user_active || !global_prefs.run_gpu_if_user_active) && + if ((!global_prefs.run_if_user_active || !global_prefs.run_gpu_if_user_active) && (global_prefs.suspend_if_no_recent_input > 0) && ((global_prefs.idle_time_to_run - global_prefs.suspend_if_no_recent_input) >= 0)) { - msg_printf(0, MSG_USER_ALERT, "Idle time required to resume computing is greater than idle time required to suspend computing and will suspend CPU and/or GPU computing indefinitely. Please edit time settings under Computing Preferences."); + msg_printf(0, MSG_USER_ALERT, + "Preference settings don't allow computing (%.2f > %.2f). Please review.", + global_prefs.idle_time_to_run, global_prefs.suspend_if_no_recent_input + ); } // general From 5588cf2ef15dcd3938874629699cbae035e0dc00 Mon Sep 17 00:00:00 2001 From: Vulpine05 Date: Wed, 14 Jun 2023 20:31:11 -0500 Subject: [PATCH 3/4] Revised to print to hundredths --- client/cs_prefs.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/cs_prefs.cpp b/client/cs_prefs.cpp index a4eeb77ebcd..a3358bb8c6e 100644 --- a/client/cs_prefs.cpp +++ b/client/cs_prefs.cpp @@ -675,7 +675,7 @@ void CLIENT_STATE::print_global_prefs() { // msg_printf(NULL, MSG_INFO, "- When computer is in use"); msg_printf(NULL, MSG_INFO, - "- 'In use' means mouse/keyboard input in last %.1f minutes", + "- 'In use' means mouse/keyboard input in last %.2f minutes", global_prefs.idle_time_to_run ); if (!global_prefs.run_if_user_active) { @@ -736,7 +736,7 @@ void CLIENT_STATE::print_global_prefs() { ); if (global_prefs.suspend_if_no_recent_input > 0) { msg_printf(NULL, MSG_INFO, - "- Suspend if no input in last %f minutes", + "- Suspend if no input in last %2f minutes", global_prefs.suspend_if_no_recent_input ); } From aab5bae193195ecaf213540fe224a4af38e7658c Mon Sep 17 00:00:00 2001 From: Vulpine05 Date: Wed, 14 Jun 2023 22:09:24 -0500 Subject: [PATCH 4/4] Fixed missing period to round to hundredths --- client/cs_prefs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/cs_prefs.cpp b/client/cs_prefs.cpp index a3358bb8c6e..b266d7dece3 100644 --- a/client/cs_prefs.cpp +++ b/client/cs_prefs.cpp @@ -736,7 +736,7 @@ void CLIENT_STATE::print_global_prefs() { ); if (global_prefs.suspend_if_no_recent_input > 0) { msg_printf(NULL, MSG_INFO, - "- Suspend if no input in last %2f minutes", + "- Suspend if no input in last %.2f minutes", global_prefs.suspend_if_no_recent_input ); }