wuwj sandbox file selection filter

svn path=/trunk/boinc/; revision=25363
This commit is contained in:
Wenjing Wu 2012-03-02 06:12:36 +00:00
parent 64a371173b
commit 048b43b544
3 changed files with 12 additions and 9 deletions

1
.vimrc
View File

@ -6,4 +6,5 @@ set sts=4
set sw=4 set sw=4
set expandtab set expandtab
set smarttab set smarttab
set backspace=indent,eol,start
syntax off syntax off

View File

@ -79,7 +79,9 @@ function sandbox_file_select($user, $select_name) {
$x = "<select name=$select_name>\n"; $x = "<select name=$select_name>\n";
$files = sandbox_file_names($user); $files = sandbox_file_names($user);
foreach ($files as $f) { foreach ($files as $f) {
$x .= "<option value=\"$f\">$f</option>\n"; if(preg_match("/$select_name/",$f)){
$x .= "<option value=\"$f\">$f</option>\n";
}
} }
$x .= "</select>\n"; $x .= "</select>\n";
return $x; return $x;

View File

@ -178,11 +178,11 @@ function show_submit_form($user) {
<input type=hidden name=action value=prepare> <input type=hidden name=action value=prepare>
"; ";
start_table(); start_table();
row2("Structure file", sandbox_file_select($user, "structure_file")); row2("<strong>structure_file</strong><br><span class=note>structure_file*</span>", sandbox_file_select($user, "structure_file"));
row2("Script file", sandbox_file_select($user, "command_file")); row2("<strong>lammps_script</strong><br><span class=note>lammps_script*</span>", sandbox_file_select($user, "lammps_script"));
row2("Command-line file<br><span class=note>List of command lines, one per job</span>", sandbox_file_select($user, "cmdline_file")); row2("<strong>cmdline_file</strong><br><span class=note>cmdline_file*</span><span class=note> ( List of command lines, one per job )</span>", sandbox_file_select($user, "cmdline_file"));
row2("Zipped potential files", sandbox_file_select($user, "pot_files")); row2("<strong>pot.zip</strong><br><span class=note>*.zip</span><span class-note> ( Zipped Potential files )</span>", sandbox_file_select($user, "zip"));
row2("Area", area_select()); row2("<strong>Area</strong>", area_select());
row2("", "<input type=submit value=Prepare>"); row2("", "<input type=submit value=Prepare>");
end_table(); end_table();
echo "</form> echo "</form>
@ -244,9 +244,9 @@ function estimated_makespan($njobs, $flops_per_job) {
function prepare_batch($user) { function prepare_batch($user) {
$structure_file_path = get_file_path($user, 'structure_file'); $structure_file_path = get_file_path($user, 'structure_file');
$command_file_path = get_file_path($user, 'command_file'); $command_file_path = get_file_path($user, 'lammps_script');
$cmdline_file_path = get_file_path($user, 'cmdline_file'); $cmdline_file_path = get_file_path($user, 'cmdline_file');
$pot_files_path = get_file_path($user, 'pot_files'); $pot_files_path = get_file_path($user, 'zip');
$info = null; $info = null;
$info->structure_file_path = $structure_file_path; $info->structure_file_path = $structure_file_path;
@ -293,7 +293,7 @@ function prepare_batch($user) {
$secs_est = estimated_makespan($njobs, $info->rsc_fpops_est); $secs_est = estimated_makespan($njobs, $info->rsc_fpops_est);
$hrs_est = number_format($secs_est/3600, 1); $hrs_est = number_format($secs_est/3600, 1);
$client_mb = number_format($info->rsc_disk_bound/1e6,1); $client_mb = number_format($info->rsc_disk_bound/1e6,1);
$server_mb = $njobs*$client_mb; $server_mb = number_format($njobs*$info->rsc_disk_bound/1e6,1);
page_head("Batch prepared"); page_head("Batch prepared");
echo " echo "