From dbce7e0721062ade5692e7009fe79ebc1200126a Mon Sep 17 00:00:00 2001 From: Jay D Dee Date: Sat, 22 Feb 2020 18:06:39 -0500 Subject: [PATCH] v3.12.4.1 --- RELEASE_NOTES | 7 +++++++ configure | 20 ++++++++++---------- configure.ac | 2 +- cpu-miner.c | 44 ++++++++++++++++++++++++++++++++++++-------- 4 files changed, 54 insertions(+), 19 deletions(-) diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 3da8ee8..80e3eb9 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -65,6 +65,13 @@ If not what makes it happen or not happen? Change Log ---------- +v3.12.4.1 + +Issue #245: fix scantime when mining solo with getwork. + +Added debug logs for creation of stratum and longpoll threads, use -D to +enable. + v3.12.4 Issue #244: Change longpoll to ignore job id. diff --git a/configure b/configure index 477f673..baf7320 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for cpuminer-opt 3.12.4. +# Generated by GNU Autoconf 2.69 for cpuminer-opt 3.12.4.1. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -577,8 +577,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='cpuminer-opt' PACKAGE_TARNAME='cpuminer-opt' -PACKAGE_VERSION='3.12.4' -PACKAGE_STRING='cpuminer-opt 3.12.4' +PACKAGE_VERSION='3.12.4.1' +PACKAGE_STRING='cpuminer-opt 3.12.4.1' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1332,7 +1332,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures cpuminer-opt 3.12.4 to adapt to many kinds of systems. +\`configure' configures cpuminer-opt 3.12.4.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1404,7 +1404,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of cpuminer-opt 3.12.4:";; + short | recursive ) echo "Configuration of cpuminer-opt 3.12.4.1:";; esac cat <<\_ACEOF @@ -1509,7 +1509,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -cpuminer-opt configure 3.12.4 +cpuminer-opt configure 3.12.4.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2012,7 +2012,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by cpuminer-opt $as_me 3.12.4, which was +It was created by cpuminer-opt $as_me 3.12.4.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2993,7 +2993,7 @@ fi # Define the identity of the package. PACKAGE='cpuminer-opt' - VERSION='3.12.4' + VERSION='3.12.4.1' cat >>confdefs.h <<_ACEOF @@ -6690,7 +6690,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by cpuminer-opt $as_me 3.12.4, which was +This file was extended by cpuminer-opt $as_me 3.12.4.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -6756,7 +6756,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -cpuminer-opt config.status 3.12.4 +cpuminer-opt config.status 3.12.4.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index e3b7f58..895f5a9 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([cpuminer-opt], [3.12.4]) +AC_INIT([cpuminer-opt], [3.12.4.1]) AC_PREREQ([2.59c]) AC_CANONICAL_SYSTEM diff --git a/cpu-miner.c b/cpu-miner.c index ef80492..8664682 100644 --- a/cpu-miner.c +++ b/cpu-miner.c @@ -2074,12 +2074,28 @@ static void *miner_thread( void *userdata ) sleep(5); continue; } - // adjust max_nonce to meet target scan time + +// LP_SCANTIME overrides opt_scantime option, is this right? + + // adjust max_nonce to meet target scan time. Startum and longpoll + // can go longer because they can rely on restart_threads to signal + // an early abort. get_work on the other hand can't rely on + // restart_threads so need a much shorter scantime + if ( have_stratum ) + max64 = 60 * thr_hashrates[thr_id]; + else if ( have_longpoll ) + max64 = LP_SCANTIME * thr_hashrates[thr_id]; + else // getwork inline + max64 = opt_scantime * thr_hashrates[thr_id]; + +/* if ( have_stratum ) max64 = LP_SCANTIME; else max64 = g_work_time + ( have_longpoll ? LP_SCANTIME : opt_scantime ) - time(NULL); +*/ + // time limit if ( unlikely( opt_time_limit && firstwork_time ) ) { @@ -2106,17 +2122,20 @@ static void *miner_thread( void *userdata ) } if ( remain < max64 ) max64 = remain; } - // Select nonce range for approx 1 min duration based - // on hashrate, initial value arbitrarilly set to 1000 just to get + + // Select nonce range based on max64, the estimated number of hashes + // to meet the desired scan time. + // Initial value arbitrarilly set to 1000 just to get // a sample hashrate for the next time. uint32_t work_nonce = *nonceptr; - max64 = 60 * thr_hashrates[thr_id]; +// max64 = 60 * thr_hashrates[thr_id]; if ( max64 <= 0) max64 = 1000; if ( work_nonce + max64 > end_nonce ) max_nonce = end_nonce; else max_nonce = work_nonce + (uint32_t)max64; + // init time if ( firstwork_time == 0 ) firstwork_time = time(NULL); @@ -3677,7 +3696,10 @@ int main(int argc, char *argv[]) /* ESET-NOD32 Detects these 2 thread_create... */ if (want_longpoll && !have_stratum) { - /* init longpoll thread info */ + if ( opt_debug ) + applog(LOG_INFO,"Creating long poll thread"); + + /* init longpoll thread info */ longpoll_thr_id = opt_n_threads + 1; thr = &thr_info[longpoll_thr_id]; thr->id = longpoll_thr_id; @@ -3693,7 +3715,10 @@ int main(int argc, char *argv[]) } if (want_stratum) { - /* init stratum thread info */ + if ( opt_debug ) + applog(LOG_INFO,"Creating stratum thread"); + + /* init stratum thread info */ stratum_thr_id = opt_n_threads + 2; thr = &thr_info[stratum_thr_id]; thr->id = stratum_thr_id; @@ -3713,7 +3738,10 @@ int main(int argc, char *argv[]) if ( opt_api_enabled ) { - /* api thread */ + if ( opt_debug ) + applog(LOG_INFO,"Creating API thread"); + + /* api thread */ api_thr_id = opt_n_threads + 3; thr = &thr_info[api_thr_id]; thr->id = api_thr_id; @@ -3723,7 +3751,7 @@ int main(int argc, char *argv[]) err = thread_create( thr, api_thread ); if ( err ) { - applog( LOG_ERR, "api thread create failed" ); + applog( LOG_ERR, "API thread create failed" ); return 1; } if ( !opt_quiet )