From b90e33d5fe74f563495dea40e9047c270c01d26a Mon Sep 17 00:00:00 2001 From: BenDroid Date: Sat, 2 Dec 2017 20:48:19 +0100 Subject: [PATCH] Fixed huge pages on Windows Cleanup of default config files Added single-double threads to summary printout --- src/Mem_win.cpp | 2 ++ src/Summary.cpp | 25 +++++++++++++++++++++++-- src/config.json | 2 +- src/default_config.json | 2 +- 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/Mem_win.cpp b/src/Mem_win.cpp index ad9744e9..2229c2ac 100644 --- a/src/Mem_win.cpp +++ b/src/Mem_win.cpp @@ -163,6 +163,8 @@ bool Mem::allocate(const Options* options) } } + m_memorySize = m_memorySize - (m_memorySize % MEMORY) + MEMORY; + if (!options->hugePages()) { m_memory = static_cast(_mm_malloc(m_memorySize, 16)); return true; diff --git a/src/Summary.cpp b/src/Summary.cpp index 503bb67e..84946709 100644 --- a/src/Summary.cpp +++ b/src/Summary.cpp @@ -91,9 +91,30 @@ static void print_cpu() static void print_threads() { - char dhtMaskBuf[64]; + char dhtMaskBuf[256]; if (Options::i()->doubleHashThreadMask() != -1L) { - snprintf(dhtMaskBuf, 64, ", doubleHashThreadMask=0x%" PRIX64, Options::i()->doubleHashThreadMask()); + + std::string singleThreads; + std::string doubleThreads; + + for (int i=0; i < Options::i()->threads(); i++) { + if (Mem::isDoubleHash(i)) { + if (!doubleThreads.empty()) { + doubleThreads.append(", "); + } + + doubleThreads.append(std::to_string(i)); + } else { + if (!singleThreads.empty()) { + singleThreads.append(" "); + } + + singleThreads.append(std::to_string(i)); + } + } + + snprintf(dhtMaskBuf, 256, ", doubleHashThreadMask=0x%" PRIX64 " [single threads: %s; double threads: %s]", + Options::i()->doubleHashThreadMask(), singleThreads.c_str(), doubleThreads.c_str()); } else { dhtMaskBuf[0] = '\0'; diff --git a/src/config.json b/src/config.json index 4c17dfe5..5d14d71b 100644 --- a/src/config.json +++ b/src/config.json @@ -1,7 +1,7 @@ { "algo": "cryptonight", // cryptonight (default) or cryptonight-lite "av": 0, // algorithm variation, 0 auto select - "doublehash-thread-mask" : null, // for av=2/4 only, limits doublehash to given threads (mask), (default: all threads) + "doublehash-thread-mask" : null, // for av=2/4 only, limits doublehash to given threads (mask), mask "0x3" means run doublehash on thread 0 and 1 only (default: all threads) "background": false, // true to run the miner in the background "colors": true, // false to disable colored output "cpu-affinity": null, // set process affinity to CPU core(s), mask "0x3" for cores 0 and 1 diff --git a/src/default_config.json b/src/default_config.json index 4c17dfe5..5d14d71b 100644 --- a/src/default_config.json +++ b/src/default_config.json @@ -1,7 +1,7 @@ { "algo": "cryptonight", // cryptonight (default) or cryptonight-lite "av": 0, // algorithm variation, 0 auto select - "doublehash-thread-mask" : null, // for av=2/4 only, limits doublehash to given threads (mask), (default: all threads) + "doublehash-thread-mask" : null, // for av=2/4 only, limits doublehash to given threads (mask), mask "0x3" means run doublehash on thread 0 and 1 only (default: all threads) "background": false, // true to run the miner in the background "colors": true, // false to disable colored output "cpu-affinity": null, // set process affinity to CPU core(s), mask "0x3" for cores 0 and 1