- remote job submission: bug fixes, and avoid divide by zero

in adjust_user_priority.  From Niclas Lockner.
This commit is contained in:
David Anderson 2013-02-14 20:31:35 -08:00 committed by Oliver Bock
parent 0a75353fb7
commit 48e1de5348
2 changed files with 4 additions and 2 deletions

View File

@ -160,7 +160,6 @@ function xml_get_jobs($r) {
}
function submit_batch($r) {
print_r($r);
$app = get_app($r);
list($user, $user_submit) = authenticate_user($r, $app);
$template = read_input_template($app);
@ -201,7 +200,7 @@ function submit_batch($r) {
}
}
$cmd = "cd ../../bin; ./adjust_user_priority --user $user->id --flops $total_flops --app $app->name";
$x = system($cmd);
$x = exec($cmd);
if (!is_numeric($x) || (double)$x == 0) {
xml_error(-1, "$cmd returned $x");
}

View File

@ -622,6 +622,9 @@ double user_priority_delta(
double total_quota,
double project_flops
) {
if (total_quota == 0) return 0;
if (project_flops == 0) return 0;
double runtime = flop_count / project_flops;
double share = us.quota / total_quota;
#if 0