$workunitname = "<font color='red'>WORKUNIT NOT FOUND IN DATABASE</font>"; $status = "<font color='red'>UNKNOWN</font>"; $jobsubmittime = "<font color='red'>UNKNOWN</font>"; } mysql_free_result($workunitquery); } $workunitstring = "<a href=workunit.php?wuid=" . $job->workunit . ">" . $job->workunit . "</a>"; row5($jobindex + 1, $jobsubmittime, $status, $workunitname, $workunitstring); } } else { row1("You have NO jobs listed !<br>"); } end_table(); $max_jobs = max_nr_of_jobs_of_user($user); if ($max_jobs > $njobs) { if ($max_jobs - $njobs > 1) { $line = 'You can submit ' . ($max_jobs - $njobs) . ' more jobs: '; } else { $line = 'You can submit one more job: '; } start_table(); row1("Commands"); row2($line, '<a href="queue_new_job_form.php">Submit a job</a>'); row2("", '<a href="home.php">Your account</a>'); row2("", '<a href="hosts_user.php">Your computers</a>'); row2("", '<a href="logout.php">Log out</a>'); end_table(); } else { exit_with_text("You cannot submit any more jobs, you have reached your limit, clean up first !"); } page_tail();
include_once "../inc/db.inc"; include_once "../inc/util.inc"; include_once "../inc/prefs.inc"; include_once "../inc/queue.inc"; $timestr = time_str(time(0)); db_init(); $user = get_logged_in_user(); $workunitid = get_int('workunitid'); $workunit = mysql_fetch_object(mysql_query("SELECT * FROM workunit WHERE id=" . $workunitid)); $job = mysql_fetch_object(mysql_query("SELECT * FROM q_list WHERE workunit=" . $workunitid)); $title = "Job '" . workunit_name($workunit) . "' (" . $workunitid . ") of " . $user->name . " at " . $timestr; $jobname = workunit_name($workunit); if ($user->id != $job->user) { $title = "Job '" . $jobname . "' (" . $workunitid . ")"; page_head($title); exit_with_text("You are not the owner of this job !"); } $config = get_config(); $jobapplication = mysql_fetch_object(mysql_query("SELECT * FROM app WHERE id=" . $workunit->appid)); $jobapplicationname = $jobapplication->name; $jobapplicationfriendlyname = $jobapplication->user_friendly_name; $jobfops = $workunit->rsc_fpops_est; $jobmem = $workunit->rsc_memory_bound; $jobdisk = $workunit->rsc_disk_bound; $jobstatusstring = workunit_status_string($workunit); $coloredjobstatusstring = $jobstatusstring; if ($jobstatusstring == "running") { $coloredjobstatusstring = "<font color='green'><b>" . $jobstatusstring . "</b></font>"; } if ($jobstatusstring == "queued") { $coloredjobstatusstring = "<font color='blue'><b>" . $jobstatusstring . "</b></font>";
$selection .= '<option value="5535297824400"> 1 h. </option>'; $selection .= '<option value="16605893473200"> 3 h. </option>'; $selection .= '<option value="33211786946400"> 6 h. </option>'; $selection = "<select name=\"fops\">" . $selection . "</select>"; row2("Estimated time to completion: ", $selection); $selection = '<option value="2097152"> 2 Mb. </option>'; $selection .= '<option value="4194304"> 4 Mb. </option>'; $selection .= '<option value="16777216"> 16 Mb. </option>'; $selection .= '<option value="67108864"> 64 Mb. </option>'; $selection .= '<option value="134217728"> 128 Mb. </option>'; $selection = "<select name=\"mem\">" . $selection . "</select>"; row2("Estimated memory usage: ", $selection); $selection = '<option value="2097152"> 2 Mb. </option>'; $selection .= '<option value="4194304"> 4 Mb. </option>'; $selection .= '<option value="16777216"> 16 Mb. </option>'; $selection .= '<option value="67108864"> 64 Mb. </option>'; $selection .= '<option value="134217728"> 128 Mb. </option>'; $selection .= '<option value="536870912"> 512 Mb. </option>'; $selection = "<select name=\"disk\">" . $selection . "</select>"; row2("Estimated disk usage: ", $selection); row2("", '<input type="submit" value=" Submit Job ">'); row1("Commands"); row2("", '<a href="queue_show_queue.php">Go back to your queue</a>'); row2("", '<a href="logout.php">Log out</a>'); end_table(); echo '</form>'; } else { exit_with_text("You are not allowed to submit any jobs !"); } } page_tail();
// if( $errorline != 0 ) // { // $errorstring = "Your input had an error on line ".$errorline." ! The job was not submitted !"; // unlink( $temporaryinputfile ); // exit_with_text( $errorstring ); // } // } system($command_to_submit); unlink($temporaryinputfile); $workunit = mysql_fetch_object(mysql_query("SELECT * FROM workunit WHERE name='" . $extendedjobname . "'")); if (!$workunit) { exit_with_text("Error during submition of the workunit associated with your job !"); } $qlistentry = mysql_query("INSERT INTO q_list VALUES('','" . $user->id . "','" . $workunit->id . "')"); if (!$qlistentry) { exit_with_text("Error during submition of your job !"); } $jobidlink = '<a href="queue_show_job.php?workunitid=' . $workunit->id . '">' . $jobname . ' (' . $workunit->id . ')</a>'; start_table(); row1("Your job has been submitted !"); row2("Job status: ", workunit_status_string($workunit)); row2("Job id: ", $jobidlink); row1("Commands"); row2("Status of this job: ", '<a href="queue_show_job.php?workunitid=' . $workunit->id . '">Show job status</a>'); $max_jobs = max_nr_of_jobs_of_user($user); $njobs = nr_of_jobs_of_user($user); if ($njobs < $max_jobs) { if ($max_jobs - $njobs > 1) { $line = "You can submit " . ($max_jobs - $njobs) . " more jobs: "; } else { $line = "You can submit one more job: ";