From 295e8fbdb4ebdab2cc83314afcde275aaa4cf17e Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 30 Nov 2010 22:12:14 +0000 Subject: [PATCH] - client: on startup, generate a notice if any jobs require more RAM than is allowed by prefs svn path=/trunk/boinc/; revision=22779 --- checkin_notes | 8 ++++++++ client/client_state.cpp | 26 ++++++++++++++++++++++++++ client/cpu_sched.cpp | 6 ++++++ doc/sim_form.php | 7 ++++++- 4 files changed, 46 insertions(+), 1 deletion(-) diff --git a/checkin_notes b/checkin_notes index 26520180f3..bb7bdc1300 100644 --- a/checkin_notes +++ b/checkin_notes @@ -8510,3 +8510,11 @@ David 30 Nov 2010 sched_types.h sched_customize.cpp sched_version.cpp + +David 30 Nov 2010 + - client: on startup, generate a notice if any jobs require more RAM + than is allowed by prefs + + client/ + client_state.cpp + cpu_sched.cpp diff --git a/client/client_state.cpp b/client/client_state.cpp index 0c1cbc9843..906dcce8fc 100644 --- a/client/client_state.cpp +++ b/client/client_state.cpp @@ -216,6 +216,25 @@ static void check_no_apps(PROJECT* p) { } } +// alert user if any jobs need more RAM than available +// +static void check_too_large_jobs() { + double m = gstate.max_available_ram(); + bool found = false; + for (unsigned int i=0; iwup->rsc_memory_bound > m) { + found = true; + break; + } + } + if (found) { + msg_printf(0, MSG_USER_ALERT, + _("Some tasks need more memory than allowed by your preferences. Please check the preferences.") + ); + } +} + // Sometime has failed N times. // Calculate an exponential backoff between MIN and MAX // @@ -527,11 +546,18 @@ int CLIENT_STATE::init() { http_ops->cleanup_temp_files(); + // get list of BOINC projects occasionally, + // and initialize notice RSS feeds + // if (!config.no_info_fetch) { all_projects_list_check(); notices.init_rss(); } + // warn user if some jobs need more memory than available + // + check_too_large_jobs(); + initialized = true; return 0; } diff --git a/client/cpu_sched.cpp b/client/cpu_sched.cpp index b9d03d32af..62267d0d42 100644 --- a/client/cpu_sched.cpp +++ b/client/cpu_sched.cpp @@ -786,6 +786,9 @@ void add_coproc_jobs(int rsc_type, PROC_RESOURCES& proc_rsc) { RESULT* rp; bool can_run; +#ifdef SIM + if (!cpu_sched_rr_only) { +#endif // choose coproc jobs from projects with coproc deadline misses // while (!proc_rsc.stop_scan_coproc(rsc_type)) { @@ -806,6 +809,9 @@ void add_coproc_jobs(int rsc_type, PROC_RESOURCES& proc_rsc) { rp->edf_scheduled = true; gstate.ordered_scheduled_results.push_back(rp); } +#ifdef SIM + } +#endif // then coproc jobs in FIFO order // diff --git a/doc/sim_form.php b/doc/sim_form.php index 2756281923..9d661a4136 100644 --- a/doc/sim_form.php +++ b/doc/sim_form.php @@ -119,7 +119,12 @@ if ($_POST['submit']) { $rr_only = '--cpu_sched_rr_only'; } - $cmd = "./sim --duration $duration --delta $delta $suw --file_prefix $prefix $rr_only $llflag"; + $prog = "./sim_debt"; + if ($_POST['use_rec']) { + $prog = "./sim_rec"; + } + + $cmd = "$prog --duration $duration --delta $delta $suw --file_prefix $prefix $rr_only $llflag"; $x = system($cmd);