host merge, credit fix

svn path=/trunk/boinc/; revision=1089
This commit is contained in:
David Anderson 2003-03-21 21:45:34 +00:00
parent 1650b58e75
commit 3b5e7442e5
5 changed files with 27 additions and 19 deletions

View File

@ -3931,3 +3931,6 @@ David Mar 20 2003
edit_host_action.php
edit_host_form.php
David Mar 21 2003
- fixed bugs in host merge
- (Eric) fix secs-per-day problem in credit

View File

@ -22,15 +22,9 @@ This version of the client has no GUI,
and writes to stderr and stdout.
Please include any suspicious-looking text in your bug reports.
<p>
<b>January 23, 2003</b><br>
The <a href=http://maggie.ssl.berkeley.edu/ap_cgi/stripchart.cgi>stripchart diagnostic program</a> is now available for public use.
Right now we only have 4 charts, but more will be added shortly.
For more information, <a href=http://boinc.berkeley.edu/stripchart.html>read the documentation</a>.
<p>
<p>
<b>January 16, 2003</b><br>
BOINC 0.08 is released, which should fix some of the reported bugs.
For news on BOINC, visit
<a href=http://boinc.berkeley.edu>http://boinc.berkeley.edu</a>
<p>
Please report bugs by sending email to the boinc-beta mailing list on SourceForge.net.
To join this list, go to <a href=http://lists.sourceforge.net/lists/listinfo/boinc-beta>http://lists.sourceforge.net/lists/listinfo/boinc-beta</a>.
";

View File

@ -28,10 +28,20 @@
exit();
}
$result = mysql_query("update result set hostid=$targetid where hostid=$hostid");
// update the database:
// - add credit from old to new host
// - change results to refer to new host
// - delete old host
$t = $old_host->total_credit + $new_host->total_credit;
$a = $old_host->expavg_credit + $new_host->expavg_credit;
$result = mysql_query("update host set total_credit=$t, expavg_credit=$a where id=$new_host->id");
if ($result) {
if ($hostid != $targetid) {
$result = mysql_query("delete from host where id=$hostid");
$result = mysql_query("update result set hostid=$targetid where hostid=$hostid");
if ($result) {
if ($hostid != $targetid) {
$result = mysql_query("delete from host where id=$hostid");
}
}
}
if ($result) {

View File

@ -17,24 +17,25 @@ if (!$host || $host->userid != $user->id) {
exit();
}
$t = time_str($host->create_time);
echo "
Sometimes BOINC assigns separate identities to the same host.
You can correct this by merging the old
identity with the newer one
(the one that has contacted the server most recently).
You can correct this by merging old identities with the newest one.
<form action=host_edit_action.php>
<input type=hidden name=hostid value=$hostid>
<p>
Merge $host->domain_name (ID $host->id) with
Merge $host->domain_name (created $t) with
<select name=targetid>
<option value=0> -
";
$result = mysql_query("select * from host where userid=$user->id");
while ($host2 = mysql_fetch_object($result)) {
//if ($host->id == $host2->id) continue;
if ($host->id == $host2->id) continue;
if ($host2->create_time < $host->create_time) continue;
if (!hosts_compatible($host, $host2)) continue;
echo "<option value=$host2->id> $host2->domain_name (ID $host2->id)\n";
$t = time_str($host2->create_time);
echo "<option value=$host2->id> $host2->domain_name (created $t)\n";
}
echo "
</select>

View File

@ -259,7 +259,7 @@ new_host:
//
static void compute_credit_rating(HOST& host) {
host.credit_per_cpu_sec =
(host.p_fpops/1e9 + host.p_iops/1e9 + host.p_membw/4e9)/3;
(host.p_fpops/1e9 + host.p_iops/1e9 + host.p_membw/4e9)/(3*SECONDS_PER_DAY);
}
// Update host record based on request.