Browse Source

restore divided hashrate for quark and jackpot

The previous way it was done was not correct (hashdone divided/2)

So add a factor 0.5 to the computed hashrate... to stay comparable
2upstream
Tanguy Pruvot 10 years ago
parent
commit
e82f5d4d75
  1. 5
      README.txt
  2. 16
      ccminer.cpp
  3. 7
      util.cpp

5
README.txt

@ -160,9 +160,12 @@ features. @@ -160,9 +160,12 @@ features.
api: Fix multi gpus stats, bump API v1.1
Nov. 12th 2014 v1.4.8
Add a basic API and sample php json wrapper
Add a basic API and sample php json wrapper + ui
Add Nvidia monitoring (nvapi/nvml) support
Add statsavg (def 20) and api-bind parameters
Add support of telnet queries to the api
Fix displayed hashrate for multi gpus systems
Restore quark/jackpot previous speed (differently)
Nov. 11th 2014 v1.4.7
Average hashrate (based on the 20 last scans)

16
ccminer.cpp

@ -1317,16 +1317,32 @@ continue_scan: @@ -1317,16 +1317,32 @@ continue_scan:
applog(LOG_NOTICE, CL_CYN "found => %08x" CL_GRN " %08x", *nonceptr, swab32(*nonceptr));
timeval_subtract(&diff, &tv_end, &tv_start);
if (diff.tv_usec || diff.tv_sec) {
/* hashrate factors for some algos */
double rate_factor = 1.0;
switch (opt_algo) {
case ALGO_JACKPOT:
case ALGO_QUARK:
// to stay comparable to other ccminer forks or pools
rate_factor = 0.5;
break;
}
/* store thread hashrate */
pthread_mutex_lock(&stats_lock);
if (diff.tv_sec + 1e-6 * diff.tv_usec > 0.0) {
thr_hashrates[thr_id] = hashes_done / (diff.tv_sec + 1e-6 * diff.tv_usec);
if (rc > 1)
thr_hashrates[thr_id] = (rc * hashes_done) / (diff.tv_sec + 1e-6 * diff.tv_usec);
thr_hashrates[thr_id] *= rate_factor;
stats_remember_speed(thr_id, hashes_done, thr_hashrates[thr_id]);
}
pthread_mutex_unlock(&stats_lock);
}
/* output */
if (!opt_quiet) {
sprintf(s, thr_hashrates[thr_id] >= 1e6 ? "%.0f" : "%.2f",
1e-3 * thr_hashrates[thr_id]);

7
util.cpp

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
/*
* Copyright 2010 Jeff Garzik
* Copyright 2012-2014 pooler
* Copyright 2014 ccminer team
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@ -8,7 +9,7 @@ @@ -8,7 +9,7 @@
* any later version. See COPYING for more details.
*/
#define _GNU_SOURCE
//#define _GNU_SOURCE
#include "cpuminer-config.h"
#include <stdio.h>
@ -493,8 +494,8 @@ void *aligned_calloc(int size) @@ -493,8 +494,8 @@ void *aligned_calloc(int size)
memset(res, 0, size);
return res;
#else
void *mem = calloc(1, size+ALIGN+sizeof(void*));
void **ptr = (void**)((size_t)(mem+ALIGN+sizeof(void*)) & ~(ALIGN-1));
void *mem = calloc(1, size+ALIGN+sizeof(uintptr_t));
void **ptr = (void**)((size_t)(((uintptr_t)(mem))+ALIGN+sizeof(uintptr_t)) & ~(ALIGN-1));
ptr[-1] = mem;
return ptr;
#endif

Loading…
Cancel
Save