Commit 17472a43 authored by Leigh Stoller's avatar Leigh Stoller

Quickie abort run ...

parent 9136bff3
......@@ -380,6 +380,18 @@ if (defined($instance->runidx())) {
$instance->StopCurrentRun() == 0
or fatal(-1, "Could not stop experiment run for $instance!");
if ($action eq "abort") {
# XXX What about the tag?
$instance->FinalizeCurrentRun() == 0
or fatal(-1, "Could not finalize experiment run for $instance!");
print "Experiment run has been aborted!\n";
# Send completion event only on "stop/abort"; otherwise it gets lost.
SendCompletionEvent();
goto done;
}
# This runs loghole.
print "Asking loghole to sync the logfiles ... this will take a minute.\n";
$instance->LogHole() == 0
......@@ -617,7 +629,8 @@ sub ParseArgs()
$action = $options{"a"};
if ($action ne "start" && $action ne "stop" &&
$action ne "pause" && $action ne "continue") {
$action ne "pause" && $action ne "continue" &&
$action ne "abort") {
tbdie("Improper -a argument: $action.");
}
# Need the equiv of a taint check.
......
......@@ -371,6 +371,9 @@ if ($expstate) {
WRITESUBMENUBUTTON("Stop Current Experiment Run",
"template_exprun.php?action=stop&guid=$guid".
"&version=$vers&eid=$exp_eid");
WRITESUBMENUBUTTON("Abort Current Experiment Run",
"template_exprun.php?action=abort&guid=$guid".
"&version=$vers&eid=$exp_eid");
}
WRITESUBMENUBUTTON("Start New Experiment Run",
......
......@@ -1243,6 +1243,8 @@ class TemplateInstance
$row = mysql_fetch_array($query_result);
$start = $row['start_time'];
$stop = $row['stop_time'];
$start_tag = $row['starting_archive_tag'];
$end_tag = $row['ending_archive_tag'];
$description = $row['description'];
if (!isset($stop))
......@@ -1270,6 +1272,8 @@ class TemplateInstance
ShowItem("ID", $runidx);
ShowItem("Started", $start);
ShowItem("Stopped", $stop);
ShowItem("Start Tag", $start_tag);
ShowItem("End Tag", $end_tag);
if (isset($description) && $description != "") {
echo "<tr>
......
......@@ -41,6 +41,11 @@ function DOIT($instance, $action, $command_options)
$message = "Starting new experiment run";
$command_options = "-a start " . $command_options;
}
elseif ($action == "abort") {
PAGEHEADER("Abort Experiment Run");
$message = "Aborting experiment run";
$command_options = "-a abort " . $command_options;
}
else {
PAGEHEADER("Stop current Experiment Run");
$message = "Stopping current experiment run";
......@@ -391,7 +396,7 @@ if (!$instance) {
"a valid experiment template instance!", 1);
}
if (isset($action) && $action == "stop") {
if (isset($action) && ($action == "stop" || $action == "abort")) {
# Run the backend script.
DOIT($instance, $action, "");
PAGEFOOTER();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment