diff --git a/README.txt b/README.txt index dcdd6a4..6add69a 100644 --- a/README.txt +++ b/README.txt @@ -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) diff --git a/ccminer.cpp b/ccminer.cpp index 5a3ef8e..00a6c3c 100644 --- a/ccminer.cpp +++ b/ccminer.cpp @@ -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]); diff --git a/util.cpp b/util.cpp index 245f2cc..e06b476 100644 --- a/util.cpp +++ b/util.cpp @@ -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 @@ * any later version. See COPYING for more details. */ -#define _GNU_SOURCE +//#define _GNU_SOURCE #include "cpuminer-config.h" #include @@ -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