From 657c0f9730f0796724875433f12a3d92494b2973 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 11 Jan 2013 13:39:13 -0800 Subject: [PATCH] - show_shmem: show more stuff, and improve display - job prioritization tweaks --- html/user/submit_rpc_handler.php | 9 +++++--- sched/adjust_user_priority.cpp | 28 ++++++++++++----------- sched/sched_shmem.cpp | 39 ++++++++++++++++++++++++++++---- 3 files changed, 56 insertions(+), 20 deletions(-) diff --git a/html/user/submit_rpc_handler.php b/html/user/submit_rpc_handler.php index 1edaff458f..953cbc774a 100644 --- a/html/user/submit_rpc_handler.php +++ b/html/user/submit_rpc_handler.php @@ -191,9 +191,12 @@ function submit_batch($r) { // TODO: if rsc_fpops_est not defined here, get it from template } $cmd = "cd ../../bin; ./adjust_user_priority --user $user->id --flops $total_flops --app $app->name"; - system($cmd); - $us = BoincUserSubmit::lookup_userid($user->id); - $let = $us->logical_start_time; + $x = system($cmd); + if (!is_numeric($x) || (double)$x == 0) { + echo adjust_user_priority returned $x\n"; + exit; + } + $let = (double)$x; $batch_id = BoincBatch::insert( "(user_id, create_time, njobs, name, app_id, logical_end_time, state) values ($user->id, $now, $njobs, '$batch_name', $app->id, $let, ".BATCH_STATE_IN_PROGRESS.")" diff --git a/sched/adjust_user_priority.cpp b/sched/adjust_user_priority.cpp index a2408c76e4..ac64af4bba 100644 --- a/sched/adjust_user_priority.cpp +++ b/sched/adjust_user_priority.cpp @@ -15,11 +15,13 @@ // You should have received a copy of the GNU Lesser General Public License // along with BOINC. If not, see . -// adjust_user_priority [--print] --user userid --flops flop_count --app app_name +// adjust_user_priority [--no_update] --user userid --flops flop_count --app app_name // // adjust user priority (i.e. logical start time) // to reflect a certain amount of computing -// --print: don't update DB; write LST increment to stdout +// and write the new value to stdout +// +// --no_update: don't update DB #include #include @@ -29,7 +31,7 @@ void usage(const char* msg="") { fprintf(stderr, - "%susage: adjust_user_priority [--print] --user userid --flops flop_count --app app_name\n", + "%susage: adjust_user_priority [--no_update] --user userid --flops flop_count --app app_name\n", msg ); exit(1); @@ -37,14 +39,14 @@ void usage(const char* msg="") { int main(int argc, char** argv) { char buf[256]; - bool print = false; + bool no_update = false; int userid=0; char* app_name = NULL; double flop_count = 0; for (int i=1; iname:"missing"; + delta_t = dtime() - wu_result.time_added_to_shared_memory; + fprintf(f, + "%4d %12.12s %10d %10d %10d %8d %10d %7ds %12f %12s %9d\n", + i, + appname, + wu_result.workunit.id, + wu_result.resultid, + wu_result.workunit.batch, + wu_result.workunit.hr_class, + wu_result.res_priority, + delta_t, + wu_result.fpops_size, + wu_result.need_reliable?"yes":"no", + wu_result.infeasible_count ); break; case WR_STATE_EMPTY: