Commit da4eab96 authored by Leigh Stoller's avatar Leigh Stoller

After discussion with Rob and Mac about state machines, make some

temporary changes to avoid user confusion.

* Show just the batchstate variable to mere users.

* Change the label we print from "terminating" to "swapping" and from
  "paused" to "swapped".

When I get some time I will make these changes in the DB and we can
take out the little bit of code that changes the labels.
parent 7a430866
......@@ -539,6 +539,7 @@ function SHOWUSER($uid) {
#
function SHOWEXP($pid, $eid, $short = 0) {
global $TBDBNAME, $TBDOCBASE;
global $TB_EXPTSTATE_SWAPPED, $TB_EXPTSTATE_SWAPPING;
$nodecounts = array();
# Node counts, by class.
......@@ -627,6 +628,14 @@ function SHOWEXP($pid, $eid, $short = 0) {
else
$expt_locked = "";
#
# XXX - Temporary until we clear up the state machine stuff.
#
if (!strcmp($batchstate, TBDB_BATCHSTATE_PAUSED))
$batchstate = $TB_EXPTSTATE_SWAPPED;
elseif (!strcmp($batchstate, TBDB_BATCHSTATE_TERMINATING))
$batchstate = $TB_EXPTSTATE_SWAPPING;
#
# Generate the table.
#
......@@ -708,10 +717,12 @@ function SHOWEXP($pid, $eid, $short = 0) {
<td class=left>$exp_path</td>
</tr>\n";
echo "<tr>
<td>Status: </td>
<td class=\"left\">$exp_status</td>
</tr>\n";
if (ISADMIN()) {
echo "<tr>
<td>Status: </td>
<td class=\"left\">$exp_status</td>
</tr>\n";
}
}
if (count($nodecounts)) {
......@@ -790,7 +801,7 @@ function SHOWEXP($pid, $eid, $short = 0) {
</tr>\n";
echo "<tr>
<td>Batch Status: </td>
<td>State: </td>
<td class=\"left\">$batchstate $expt_locked</td>
</tr>\n";
......@@ -801,7 +812,7 @@ function SHOWEXP($pid, $eid, $short = 0) {
}
else {
echo "<tr>
<td>Swap State: </td>
<td>State: </td>
<td class=\"left\">$batchstate $expt_locked</td>
</tr>\n";
}
......@@ -828,6 +839,8 @@ function SHOWEXP($pid, $eid, $short = 0) {
# Show a listing of experiments by user/pid/gid
#
function SHOWEXPLIST($type,$id,$gid = "") {
global $TB_EXPTSTATE_SWAPPED, $TB_EXPTSTATE_SWAPPING;
if ($type == "USER") {
$where = "expt_head_uid='$id'";
$title = "Current";
......@@ -878,7 +891,7 @@ function SHOWEXPLIST($type,$id,$gid = "") {
while ($row = mysql_fetch_array($query_result)) {
$pid = $row[pid];
$eid = $row[eid];
$state= $row[state];
$bstate= $row[batchstate];
$nodes= $row["nodes"];
$minnodes = $row["min_nodes"];
$idlehours = TBGetExptIdleTime($pid,$eid);
......@@ -891,6 +904,14 @@ function SHOWEXPLIST($type,$id,$gid = "") {
$nodes .= $idlemark;
}
#
# XXX - Temporary until we clear up the state machine stuff.
#
if (!strcmp($bstate, TBDB_BATCHSTATE_PAUSED))
$bstate = $TB_EXPTSTATE_SWAPPED;
elseif (!strcmp($bstate, TBDB_BATCHSTATE_TERMINATING))
$bstate = $TB_EXPTSTATE_SWAPPING;
if ($nopid) {
$pidrow="";
} else {
......@@ -906,7 +927,7 @@ function SHOWEXPLIST($type,$id,$gid = "") {
echo "<tr>$pidrow
<td><A href='showexp.php3?pid=$pid&eid=$eid'>$eid</A></td>
<td>$state</td>
<td>$bstate</td>
<td align=center>$nodes</td>
<td align=center>$idlestr</td>
<td>$name</td>
......
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