mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-08-23 09:27:25 +00:00
benchs: ignore if already too much data per chip/algo
This commit is contained in:
parent
80c53c8a6e
commit
e47e40aea6
2 changed files with 22 additions and 3 deletions
|
@ -25,16 +25,30 @@ function BenchUpdateChips()
|
|||
$dups = getdbocount('db_benchmarks', "vendorid=:vid AND client=:client AND os=:os AND driver=:drv AND throughput=:thr AND userid=:uid",
|
||||
array(':vid'=>$bench->vendorid, ':client'=>$bench->client, ':os'=>$bench->os, ':drv'=>$bench->driver,':thr'=>$bench->throughput,':uid'=>$bench->userid)
|
||||
);
|
||||
if ($dups > 10) {
|
||||
if ($dups > 10 || round($bench->khps,3) == 0) {
|
||||
//debuglog("bench: {$bench->device} ignored ($dups records already present)");
|
||||
$bench->delete();
|
||||
continue;
|
||||
}
|
||||
|
||||
$chip = getChipName($bench->attributes);
|
||||
debuglog("bench: {$bench->device} ($chip)...");
|
||||
if (!empty($chip) && $chip != '-') {
|
||||
$bench->chip = $chip;
|
||||
$rates = dborow("SELECT AVG(khps) AS avg, COUNT(id) as cnt FROM benchmarks WHERE algo=:algo AND chip=:chip",
|
||||
array(':algo'=>$bench->algo, ':chip'=>$chip)
|
||||
);
|
||||
$avg = (double) $rates['avg'];
|
||||
$cnt = intval($rates['cnt']);
|
||||
if ($cnt > 250) {
|
||||
$bench->delete();
|
||||
continue;
|
||||
} elseif ($cnt > 5 && $bench->khps < $avg / 2) {
|
||||
$user = getdbo('db_accounts', $bench->userid);
|
||||
debuglog("bench: {$bench->device} ignored, bad {$bench->algo} hashrate {$bench->khps} kHs by {$user->username}");
|
||||
$bench->delete();
|
||||
continue;
|
||||
}
|
||||
debuglog("bench: {$bench->device} ($chip)...");
|
||||
$bench->save();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -154,7 +154,7 @@ function getChipName($row)
|
|||
if (strpos($device, 'AMD Athlon ')) {
|
||||
return str_replace('AMD ', '', $device);
|
||||
}
|
||||
$device = preg_replace('/AMD (A6\-[1-9]+) APU .+/','\1', $device);
|
||||
$device = preg_replace('/AMD (A6\-[1-9]+[KM]*) APU .+/','\1', $device);
|
||||
$device = preg_replace('/AMD (E[\d]*\-[\d]+) APU .+/','\1', $device);
|
||||
$device = preg_replace('/AMD (A[\d]+\-[\d]+[KP]*) Radeon .+/','\1', $device);
|
||||
$words = explode(' ', $device);
|
||||
|
@ -174,7 +174,10 @@ function getChipName($row)
|
|||
$chip = str_replace('GT ','', $chip);
|
||||
$chip = str_replace('GTX ','', $chip);
|
||||
$chip = str_replace('650 Ti BOOST','650 Ti', $chip);
|
||||
$chip = str_replace('760 Ti OEM','760 Ti', $chip);
|
||||
$chip = str_replace(' (Pascal)',' Pascal', $chip);
|
||||
$chip = str_replace('Tesla P100-SXM2-16GB','Tesla P100', $chip);
|
||||
$chip = str_replace('Tesla V100-SXM2-16GB','Tesla V100', $chip);
|
||||
$chip = preg_replace('/ASUS ([6-9]\d\dM)/','\1', $chip); // ASUS 940M
|
||||
$chip = preg_replace('/MSI ([6-9]\d\dM)/','\1', $chip); // MSI 840M
|
||||
$chip = preg_replace('/MSI ([6-9]\d\dMX)/','\1', $chip); // MSI 940MX
|
||||
|
@ -183,6 +186,8 @@ function getChipName($row)
|
|||
if (strpos($chip, 'P104-100') !== false || strpos($chip, 'CMP4-1') !== false)
|
||||
$chip = 'P104-100';
|
||||
}
|
||||
// Quadro 600 - Quadro 2000
|
||||
if (strstr($row['device'], 'Quadro') && !strstr($chip, 'Quadro')) $chip = "Quadro $chip";
|
||||
}
|
||||
|
||||
return $chip;
|
||||
|
|
Loading…
Add table
Reference in a new issue