Commit d37885e1 authored by Mac Newbold's avatar Mac Newbold
Browse files

Show staleness of idle data in more places, since the only place it showed

before was idle view of the expt list. Now it shows in all (non-thumb)
views.

I also added it to the right hand table in the expt page.

It also shows in the little expt lists in the user, group, and proj pages.
(I'm already really glad those got consolidated into a single function.)

Also cleaned up idle view a bit. Now that we show staleness and idle
ignore anyway, we don't need text tags for them, and we no longer need the
red dot that links to swap requests because of idlemail. So there's no
longer the weird double-column thing in idle view.

I'm still looking for a good way to non-intrusively mark expts in the expt
list as being unswappable, so if you think of anything, let me know.
(Maybe boldface, or a little lock icon or something?)
parent 6fe06696
......@@ -299,6 +299,9 @@ Include idle-ignore experiments</a></center></p><br />\n";
}
$idlemark = "<b>*</b>";
$stalemark = "<b>?</b>";
$parens = 0;
#
# Okay, I decided to do this as one big query instead of a zillion
# per-exp queries in the loop below. No real reason, except my personal
......@@ -478,16 +481,16 @@ if ($thumb && !$idle) {
EID</a></th>
<th align=center width=3%>
<a class='static' href='showexp_list.php3?showtype=$showtype&sortby=pcs$ni'>
PCs</a><br>[<b>1</b>]</th>
PCs</a> [1]</th>
<th align=center width=3%>
<a class='static' href='showexp_list.php3?showtype=$showtype&sortby=idle$ni'>
Hours Idle</th>\n";
Hours Idle</a> [2]</th>\n";
if ($showlastlogin)
echo "<th width=17% align=center>Last Login</th>\n";
if ($idle) {
# "<th width=4% align=center>Days Idle</th>\n";
echo "<th width=4% align=center colspan=2>Swap Request</th>\n";
#echo "<th width=4% align=center colspan=2>Swap Requests</th>\n";
echo "<th width=4% align=center>Swap Requests</th>\n";
}
echo " <th width=60%>
......@@ -509,8 +512,11 @@ if ($thumb && !$idle) {
$idlesec= $row["idlesec"];
$swapreqs = $row["swap_requests"];
$isidle = ($idlesec >= 3600*$idlehours);
$stale = TBGetExptIdleStale($pid,$eid);
$daysidle=0;
$idletime = ($idlesec > 300 ? round($idlesec/3600,1) : 0);
# reset pcs
$pcs=0;
if ($swapreqs && !$isidle) {
$swapreqs = "";
......@@ -518,8 +524,6 @@ if ($thumb && !$idle) {
"where pid='$pid' and eid='$eid'");
}
if ($ignore) { $isidle=0; }
if ($isadmin) {
$swappable= $row["swappable"];
$swapreq=$row["swap_requests"];
......@@ -547,39 +551,42 @@ if ($thumb && !$idle) {
$lastlogin.="</td>\n";
if ($lastlogin=="<td></td>\n") { $lastlogin="<td>&nbsp;</td>\n"; }
}
if ($idle) {
$stale = TBGetExptIdleStale($pid,$eid);
# If it is ignored, skip it now.
if ($ignore && !$noignore) { continue; }
#$lastlogin .= "<td align=center>$daysidle</td>\n";
if (isset($perexp_usage["$pid:$eid"]) &&
isset($perexp_usage["$pid:$eid"]["pc"])) {
$pcs = $perexp_usage["$pid:$eid"]["pc"];
} else { $pcs=0; }
$foo = "<td align=center valign=center>\n";
$label = "";
if ($stale) { $label .= "stale "; }
if ($ignore) { $label .= "ignore "; }
if (!$swappable) { $label .= "unswap. "; }
if ($label == "") { $label = "&nbsp;"; }
if ($isidle && !$stale && !$ignore && !$toosoon && $pcs) {
$fooswap = "<td><a ".
"href=\"request_swapexp.php3?pid=$pid&eid=$eid\">".
"<img border=0 src=\"redball.gif\"></a> $label</td>\n" ;
} else {
$fooswap = "<td>$label</td>";
if (!$pcs) { $foo .= "(no PCs)\n"; }
else { $foo .="&nbsp;"; }
}
$foo = "<td align=center valign=center>\n";
#$label = "";
# Probably don't need this when we're using stalemark
#if ($stale) { $label .= "stale "; }
# Don't really need this if we're marking ignore with ()
#if ($ignore) { $label .= "ignore "; }
#if (!$swappable) { $label .= "unswap. "; }
#if ($isidle && !$stale && !$ignore && !$toosoon && $pcs) {
# $fooswap = "<td><a ".
# "href=\"request_swapexp.php3?pid=$pid&eid=$eid\">".
# "<img border=0 src=\"redball.gif\"></a> $label</td>\n" ;
#} else {
# if ($label == "") { $label = "&nbsp;"; }
# $fooswap = "<td>$label</td>";
# if (!$pcs) { $foo .= "(no PCs)\n"; }
# else { $foo .="&nbsp;"; }
#}
if ($swapreq > 0) {
$foo .= "&nbsp;$swapreq&nbsp;sent<br />".
$foo .= "$swapreq&nbsp;sent<br>".
"<font size=-2>(${lastswapreq}&nbsp;hrs&nbsp;ago)</font>\n";
}
$foo .= "</td>" . $fooswap . "\n";
#$foo .= "</td>".$fooswap."\n";
if (!$swappable) { $foo .= "unswap.\n"; }
}
if ($idle && ($str=="&nbsp;" || !$pcs || !$isidle)) { continue; }
if ($idle && (!$pcs || !$isidle)) { continue; }
$nodes = 0;
$special = 0;
......@@ -612,22 +619,29 @@ if ($thumb && !$idle) {
<td><A href='showexp.php3?pid=$pid&eid=$eid'>
$eid</A></td>\n";
if ($isidle) { $nodes = $nodes.$idlemark; }
if ($isidle && !$ignore) { $nodes = $nodes.$idlemark; }
# If multiple classes, then hightlight the number.
if ($special)
echo "<td><font color=red>$nodes</font></td>\n";
if ($idle)
echo "<td><font color=red>$nodes</font> ($pcs)</td>\n";
else
echo "<td><font color=red>$nodes</font></td>\n";
else
echo "<td>$nodes</td>\n";
if ($idletime == -1) {
echo "<td>&nbsp;</td>\n";
$idlestr = "&nbsp;";
} else {
$idlestr = "$idletime";
# Order between the next two lines determines if the
# stalemark goes inside or outside the parens
if ($stale && $pcs > 0) { $idlestr .= $stalemark; }
if ($ignore && $idletime !=0) {
echo "<td>($idletime)</td>\n";
} else {
echo "<td>$idletime</td>\n";
$idlestr = "($idlestr)";
$parens = 1;
}
}
echo "<td>$idlestr</td>";
if ($showlastlogin) echo "$lastlogin\n";
if ($idle) echo "$foo\n";
......@@ -639,11 +653,20 @@ if ($thumb && !$idle) {
}
echo "</table>\n";
echo "<ol>
echo "<font size=-1><ol>
<li><font color=red>Red</font> indicates nodes other than PCs.
A $idlemark mark by the node count indicates that the
experiment is currently considered idle.
</ol>\n";
<li>A $stalemark indicates that the data is stale, and
at least one node in the experiment has not reported
on its proper schedule.\n";
if ($parens) {
# don't show this unless we did it... most users shouldn't ever
# need to know that you can set expts to have their idleness ignored
echo "Values are in parenthesis for idle-ignore experiments.\n";
}
echo "</ol></font>\n";
echo "<center><b>Node Totals</b></center>\n";
echo "<table border=0
......
......@@ -679,16 +679,19 @@ function SHOWEXP($pid, $eid) {
$lastact = TBGetExptLastAct($pid,$eid);
$idletime = TBGetExptIdleTime($pid,$eid);
$stale = TBGetExptIdleStale($pid,$eid);
if ($lastact != -1) {
echo "<tr>
<td>Last Activity: </td>
<td class=\"left\">$lastact</td>
</tr>\n";
if ($stale) { $str = "(stale)"; } else { $str = ""; }
echo "<tr>
<td>Idle Time: </td>
<td class=\"left\">$idletime hours</td>
<td class=\"left\">$idletime hours $str</td>
</tr>\n";
}
......@@ -767,11 +770,14 @@ function SHOWEXPLIST($type,$id) {
echo "<tr>$pidrow
<th>EID</th>
<th>State</th>
<th align=center>Nodes*</th>
<th align=center>Hours Idle</th>
<th align=center>Nodes [1]</th>
<th align=center>Hours Idle [2]</th>
<th>Description</th>
</tr>\n";
$idlemark = "<b>*</b>";
$stalemark = "<b>?</b>";
while ($row = mysql_fetch_array($query_result)) {
$pid = $row[pid];
$eid = $row[eid];
......@@ -779,13 +785,13 @@ function SHOWEXPLIST($type,$id) {
$nodes= $row["nodes"];
$minnodes = $row["min_nodes"];
$idlehours = TBGetExptIdleTime($pid,$eid);
if ($idlehours == -1) { $idlehours = "&nbsp;"; }
$stale = TBGetExptIdleStale($pid,$eid);
$ignore = $row["idle_ignore"];
$name = stripslashes($row[expt_name]);
if ($row[swap_requests] > 0) {
$state .= "&nbsp;(idle)";
}
if ($nodes==0) {
$nodes = "<font color=green>$minnodes</font>";
} elseif ($row[swap_requests] > 0) {
$nodes .= $idlemark;
}
if ($nopid) {
......@@ -794,22 +800,38 @@ function SHOWEXPLIST($type,$id) {
$pidrow="\n<td>".
"<A href='showproject.php3?pid=$pid'>$pid</A></td>";
}
$idlestr = $idlehours;
if ($idlehours > 0) {
if ($stale) { $idlestr .= $stalemark; }
if ($ignore) { $idlestr = "($idlestr)"; $parens=1; }
} elseif ($idlehours == -1) { $idlestr = "&nbsp;"; }
echo "<tr>$pidrow
<td><A href='showexp.php3?pid=$pid&eid=$eid'>$eid</A></td>
<td>$state</td>
<td align=center>$nodes</td>
<td align=center>$idlehours</td>
<td align=center>$idlestr</td>
<td>$name</td>
</tr>\n";
}
echo "</table>\n";
echo "<center><font size=-1><b>*</b> Node counts in \n".
"<font color=green><b>green</b></font>\n".
echo "<table align=center cellpadding=0 class=stealth><tr>\n".
"<td class=stealth align=left><font size=-1><ol>\n".
"<li>Node counts in <font color=green><b>green</b></font>\n".
"show a rough estimate of the minimum number of \n".
"nodes required to swap in.\n".
"<br>They account for delay nodes, but not for node \n".
"types, etc.</font></center>\n";
"nodes <br>required to swap in.\n".
"They account for delay nodes, but not for node types, etc.\n".
"<li>A $stalemark indicates that the data is stale, and ".
"at least one node in the experiment has not <br>reported ".
"on its proper schedule.\n";
if ($parens) {
# don't show this unless we did it... most users shouldn't ever
# need to know that some expts have their idleness ignored
echo "Values are in parenthesis for idle-ignore experiments.\n";
}
echo "</ol></font></td></tr></table>\n";
}
}
......
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