Skip to content

Commit

Permalink
benchs: unique function to format devices labels
Browse files Browse the repository at this point in the history
+ some new devices chips rules
  • Loading branch information
tpruvot committed Apr 10, 2018
1 parent 2f6d74d commit 580801f
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 12 deletions.
9 changes: 9 additions & 0 deletions web/yaamp/core/backend/bench.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ function BenchUpdateChips()
// bug in nvml 378.x and 381.x (linux + win) fixed in 382.05
dborun("UPDATE benchmarks SET realfreq=NULL WHERE realfreq<=200 AND driver LIKE '% 378.%'");
dborun("UPDATE benchmarks SET realfreq=NULL WHERE realfreq<=200 AND driver LIKE '% 381.%'");
// sanity check on long fields (no html wanted)
dborun("DELETE FROM benchmarks WHERE device LIKE '%<%' OR client LIKE '%<%'");

$benchs = getdbolist('db_benchmarks', "IFNULL(chip,'')=''");
foreach ($benchs as $bench) {
Expand All @@ -27,6 +29,13 @@ function BenchUpdateChips()
continue;
}

$rawdata = json_encode($bench->attributes);
if (strpos($rawdata,"script")) {
debuglog("bench record deleted : $rawdata");
$bench->delete();
continue;
}

$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)
);
Expand Down
6 changes: 1 addition & 5 deletions web/yaamp/modules/bench/devices.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,7 @@
$chip = CHtml::link($chip, '/bench?chip='.$row['idchip'].'&algo=all');
}
echo '<td>'.$chip.'</td>';

if ($row['type'] == 'gpu')
echo '<td>'.$row['device'].getProductIdSuffix($row).'</td>';
else
echo '<td>'.formatCPU($row).'</td>';
echo '<td>'.formatDevice($row).'</td>';

if (substr($vendorid,0,4) == '10de')
echo '<td><span class="generic" title="nVidia product id">'.$vendorid.'</span></td>';
Expand Down
16 changes: 16 additions & 0 deletions web/yaamp/modules/bench/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,20 @@ function formatCPU($row)
return trim($device);
}

function formatGPU($row)
{
$label = $row['device'].getProductIdSuffix($row);
return strip_tags($label);
}

function formatDevice($row)
{
if ($row['type'] == 'gpu')
return formatGPU($row);
else
return formatCPU($row);
}

function getChipName($row)
{
if ($row['type'] == 'cpu') {
Expand Down Expand Up @@ -179,6 +193,8 @@ function getChipName($row)
$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('Quadro M6000 24GB','Quadro M6000', $chip);
$chip = str_replace('Tesla P100 (PCIe)','Tesla P100', $chip);
$chip = str_replace('Tesla P100-SXM2-16GB','Tesla P100', $chip);
$chip = str_replace('Tesla P100-PCIE-16GB','Tesla P100', $chip);
$chip = str_replace('Tesla V100-SXM2-16GB','Tesla V100', $chip);
Expand Down
12 changes: 5 additions & 7 deletions web/yaamp/modules/bench/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,12 @@
echo '<td class="algo">'.CHtml::link($row['algo'],'/bench?algo='.$row['algo']).'</td>';
echo '<td data="'.$row['time'].'">'.$age.'</td>';
echo '<td>'.($row['idchip'] ? CHtml::link($row['chip'],'/bench?chip='.$row['idchip']) : $row['chip']).'</td>';
if ($row['type'] == 'cpu') {
echo '<td>'.formatCPU($row).'</td>';
echo '<td>'.CHtml::link($row['vendorid'],'/bench?vid='.$row['vendorid']).'</td>';
echo '<td>'.$row['arch'].'</td>';
} else {
echo '<td>'.$row['device'].getProductIdSuffix($row).'</td>';
echo '<td>'.CHtml::link($row['vendorid'],'/bench?vid='.$row['vendorid']).'</td>';
echo '<td>'.formatDevice($row).'</td>';
echo '<td>'.CHtml::link($row['vendorid'],'/bench?vid='.$row['vendorid']).'</td>';
if ($row['type'] == 'gpu') {
echo '<td>'.formatCudaArch($row['arch']).'</td>';
} else {
echo '<td>'.$row['arch'].'</td>';
}

echo '<td data="'.$row['khps'].'">'.$hashrate.'</td>';
Expand Down

0 comments on commit 580801f

Please sign in to comment.