svn path=/trunk/boinc/; revision=24961

This commit is contained in:
David Anderson 2012-01-01 03:35:29 +00:00
parent 324f24b4c4
commit 8b4df3817e
4 changed files with 29 additions and 17 deletions

View File

@ -56,7 +56,7 @@ $fanout = parse_config(get_config(), "<uldl_dir_fanout>");
//
function sandbox_physical_path($user, $md5) {
global $fanout;
$f = "sb_".$user->id.$md5;
$f = "sb_".$user->id."_".$md5;
return dir_hier_path($f, "../../download", $fanout);
}

View File

@ -91,15 +91,16 @@ function prepare_batch($user) {
page_tail();
}
function submit_job($app, $batch_id, $rsc_fpops_est, $cmdline, $i) {
$cmd = "cd ../..; ./bin/create_work --appname $app->name --batch $batch_id --rsc_fpops_est $rsc_fpops_est";
function submit_job($app, $batch_id, $info, $cmdline, $i) {
$cmd = "cd ../..; ./bin/create_work --appname $app->name --batch $batch_id --rsc_fpops_est $info->rsc_fpops_est";
if ($cmdline) {
$cmd .= " --command_line \"$cmdline\"";
}
$cmd .= " --wu_name batch_".$batch_id."_".$i;
foreach ($job->input_files as $file) {
$cmd .= " $file->name";
}
$cmd .= " $info->structure_file_path";
$cmd .= " $info->command_file_path";
echo "<br> $cmd\n"; return;
$ret = system($cmd);
if ($ret === FALSE) {
error_page("can't create job");
@ -108,21 +109,23 @@ function submit_job($app, $batch_id, $rsc_fpops_est, $cmdline, $i) {
function submit_batch($user, $app) {
$tmpfile = get_str('tmpfile');
$x = file_get_contents("/tmp/$tmpfile");
$info = deserialize($x);
$x = file_get_contents("$tmpfile");
$info = unserialize($x);
$cmdlines = file($info->cmdline_file_path);
$njobs = count($cmdlines);
$now = time();
$batch_name = time_str($now);
$batch_id = BoincBatch::insert(
"(user_id, create_time, njobs, name, app_id) values ($user->id, $now, $njobs, '$batch_name', $app->id)"
);
// $batch_id = BoincBatch::insert(
// "(user_id, create_time, njobs, name, app_id) values ($user->id, $now, $njobs, '$batch_name', $app->id)"
// );
$batch_id=99;
$i = 0;
foreach ($cmdlines as $cmdline) {
submit_job($app, $batch_id, $info->rsc_fpops_est, $cmdline, $i);
submit_job($app, $batch_id, $info, $cmdline, $i);
$i++;
}
}

View File

@ -19,6 +19,7 @@
require_once("../inc/submit_db.inc");
require_once("../inc/util.inc");
require_once("../inc/result.inc");
require_once("../inc/submit_util.inc");
require_once("../project/project.inc");
@ -41,6 +42,12 @@ function handle_main($user) {
$wus = BoincWorkunit::enum("batch = $batch->id");
$batch = get_batch_params($batch, $wus);
}
$app = BoincApp::lookup_id($batch->app_id);
if ($app) {
$batch->app_name = $app->name;
} else {
$batch->app_name = "unknown";
}
}
foreach ($batches as $batch) {
@ -74,11 +81,12 @@ function handle_main($user) {
$first = false;
echo "<h2>Completed batches</h2>\n";
start_table();
table_header("name", "ID", "# jobs", "submitted");
table_header("name", "ID", "app", "# jobs", "submitted");
}
table_row(
"<a href=submit.php?action=query_batch&batch_id=$batch->id>$batch->name</a>",
"<a href=submit.php?action=query_batch&batch_id=$batch->id>$batch->id</a>",
$batch->app_name,
$batch->njobs,
local_time_str($batch->create_time)
);
@ -96,11 +104,12 @@ function handle_main($user) {
$first = false;
echo "<h2>Aborted batches</h2>\n";
start_table();
table_header("name", "ID", "# jobs", "submitted");
table_header("name", "ID", "app", "# jobs", "submitted");
}
table_row(
"<a href=submit.php?action=query_batch&batch_id=$batch->id>$batch->name</a>",
"<a href=submit.php?action=query_batch&batch_id=$batch->id>$batch->id</a>",
$batch->app_name,
$batch->njobs,
local_time_str($batch->create_time)
);
@ -163,7 +172,7 @@ function handle_query_batch($user) {
);
$wus = BoincWorkunit::enum("batch = $batch->id");
foreach($wus as $wu) {
$resultid = $wu->canonical_instance_id;
$resultid = $wu->canonical_resultid;
if ($resultid) {
$x = "<a href=result.php?resultid=$resultid>$resultid</a>";
$y = "completed";
@ -173,7 +182,7 @@ function handle_query_batch($user) {
}
echo "<tr>
<td><a href=submit.php?action=query_job&job_id=$id>$id</a></td>
<td><a href=submit.php?action=query_job&wuid=$wu->id>$wu->id</a></td>
<td>$y</td>
<td>$x</td>
</tr>
@ -197,7 +206,7 @@ function handle_query_job() {
"Instance ID<br><span class=note>click for result page</span>",
"State", "Output files"
);
$results = BoincResult::enum("workunitid=$job_id");
$results = BoincResult::enum("workunitid=$wuid");
foreach($results as $result) {
echo "<tr>
<td><a href=result.php?resultid=$result->id>$result->id</a></td>