Skip to content

Commit 8b4df38

Browse files
svn path=/trunk/boinc/; revision=24961
1 parent 324f24b commit 8b4df38

File tree

4 files changed

+29
-17
lines changed

4 files changed

+29
-17
lines changed

checkin_notes checkin_notes_2011

File renamed without changes.

html/inc/sandbox.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ $fanout = parse_config(get_config(), "<uldl_dir_fanout>");
5656
//
5757
function sandbox_physical_path($user, $md5) {
5858
global $fanout;
59-
$f = "sb_".$user->id.$md5;
59+
$f = "sb_".$user->id."_".$md5;
6060
return dir_hier_path($f, "../../download", $fanout);
6161
}
6262

html/user/lammps.php

+14-11
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,16 @@ function prepare_batch($user) {
9191
page_tail();
9292
}
9393

94-
function submit_job($app, $batch_id, $rsc_fpops_est, $cmdline, $i) {
95-
$cmd = "cd ../..; ./bin/create_work --appname $app->name --batch $batch_id --rsc_fpops_est $rsc_fpops_est";
94+
function submit_job($app, $batch_id, $info, $cmdline, $i) {
95+
$cmd = "cd ../..; ./bin/create_work --appname $app->name --batch $batch_id --rsc_fpops_est $info->rsc_fpops_est";
9696
if ($cmdline) {
9797
$cmd .= " --command_line \"$cmdline\"";
9898
}
9999
$cmd .= " --wu_name batch_".$batch_id."_".$i;
100-
foreach ($job->input_files as $file) {
101-
$cmd .= " $file->name";
102-
}
100+
$cmd .= " $info->structure_file_path";
101+
$cmd .= " $info->command_file_path";
102+
echo "<br> $cmd\n"; return;
103+
103104
$ret = system($cmd);
104105
if ($ret === FALSE) {
105106
error_page("can't create job");
@@ -108,21 +109,23 @@ function submit_job($app, $batch_id, $rsc_fpops_est, $cmdline, $i) {
108109

109110
function submit_batch($user, $app) {
110111
$tmpfile = get_str('tmpfile');
111-
$x = file_get_contents("/tmp/$tmpfile");
112-
$info = deserialize($x);
112+
$x = file_get_contents("$tmpfile");
113+
$info = unserialize($x);
113114

114115
$cmdlines = file($info->cmdline_file_path);
115116
$njobs = count($cmdlines);
116117

117118
$now = time();
118119
$batch_name = time_str($now);
119-
$batch_id = BoincBatch::insert(
120-
"(user_id, create_time, njobs, name, app_id) values ($user->id, $now, $njobs, '$batch_name', $app->id)"
121-
);
120+
121+
// $batch_id = BoincBatch::insert(
122+
// "(user_id, create_time, njobs, name, app_id) values ($user->id, $now, $njobs, '$batch_name', $app->id)"
123+
// );
124+
$batch_id=99;
122125

123126
$i = 0;
124127
foreach ($cmdlines as $cmdline) {
125-
submit_job($app, $batch_id, $info->rsc_fpops_est, $cmdline, $i);
128+
submit_job($app, $batch_id, $info, $cmdline, $i);
126129
$i++;
127130
}
128131
}

html/user/submit.php

+14-5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
require_once("../inc/submit_db.inc");
2121
require_once("../inc/util.inc");
22+
require_once("../inc/result.inc");
2223
require_once("../inc/submit_util.inc");
2324
require_once("../project/project.inc");
2425

@@ -41,6 +42,12 @@ function handle_main($user) {
4142
$wus = BoincWorkunit::enum("batch = $batch->id");
4243
$batch = get_batch_params($batch, $wus);
4344
}
45+
$app = BoincApp::lookup_id($batch->app_id);
46+
if ($app) {
47+
$batch->app_name = $app->name;
48+
} else {
49+
$batch->app_name = "unknown";
50+
}
4451
}
4552

4653
foreach ($batches as $batch) {
@@ -74,11 +81,12 @@ function handle_main($user) {
7481
$first = false;
7582
echo "<h2>Completed batches</h2>\n";
7683
start_table();
77-
table_header("name", "ID", "# jobs", "submitted");
84+
table_header("name", "ID", "app", "# jobs", "submitted");
7885
}
7986
table_row(
8087
"<a href=submit.php?action=query_batch&batch_id=$batch->id>$batch->name</a>",
8188
"<a href=submit.php?action=query_batch&batch_id=$batch->id>$batch->id</a>",
89+
$batch->app_name,
8290
$batch->njobs,
8391
local_time_str($batch->create_time)
8492
);
@@ -96,11 +104,12 @@ function handle_main($user) {
96104
$first = false;
97105
echo "<h2>Aborted batches</h2>\n";
98106
start_table();
99-
table_header("name", "ID", "# jobs", "submitted");
107+
table_header("name", "ID", "app", "# jobs", "submitted");
100108
}
101109
table_row(
102110
"<a href=submit.php?action=query_batch&batch_id=$batch->id>$batch->name</a>",
103111
"<a href=submit.php?action=query_batch&batch_id=$batch->id>$batch->id</a>",
112+
$batch->app_name,
104113
$batch->njobs,
105114
local_time_str($batch->create_time)
106115
);
@@ -163,7 +172,7 @@ function handle_query_batch($user) {
163172
);
164173
$wus = BoincWorkunit::enum("batch = $batch->id");
165174
foreach($wus as $wu) {
166-
$resultid = $wu->canonical_instance_id;
175+
$resultid = $wu->canonical_resultid;
167176
if ($resultid) {
168177
$x = "<a href=result.php?resultid=$resultid>$resultid</a>";
169178
$y = "completed";
@@ -173,7 +182,7 @@ function handle_query_batch($user) {
173182
}
174183

175184
echo "<tr>
176-
<td><a href=submit.php?action=query_job&job_id=$id>$id</a></td>
185+
<td><a href=submit.php?action=query_job&wuid=$wu->id>$wu->id</a></td>
177186
<td>$y</td>
178187
<td>$x</td>
179188
</tr>
@@ -197,7 +206,7 @@ function handle_query_job() {
197206
"Instance ID<br><span class=note>click for result page</span>",
198207
"State", "Output files"
199208
);
200-
$results = BoincResult::enum("workunitid=$job_id");
209+
$results = BoincResult::enum("workunitid=$wuid");
201210
foreach($results as $result) {
202211
echo "<tr>
203212
<td><a href=result.php?resultid=$result->id>$result->id</a></td>

0 commit comments

Comments
 (0)