Preparation for #1.4.0 (#30)

- Fixed CPU affinity on Windows for NUMA and CPUs with lot of cores
- Implemented per thread configurable Multihash mode (double, triple, quadruple, quintuple)
- Rebased from XMRig 2.4.4
This commit is contained in:
Ben Gräf 2018-01-19 19:42:06 +01:00 committed by GitHub
parent 5f8ea98764
commit acf27e9341
41 changed files with 2575 additions and 1104 deletions

View file

@ -92,29 +92,29 @@ static void print_cpu()
static void print_threads()
{
char dhtMaskBuf[256];
if (Options::i()->doubleHash() && Options::i()->doubleHashThreadMask() != -1L) {
if (Options::i()->hashFactor() > 1 && Options::i()->multiHashThreadMask() != -1L) {
std::string singleThreads;
std::string doubleThreads;
std::string multiThreads;
auto addThread = [](std::string& threads, int id) {
if (!threads.empty()) {
threads.append(", ");
}
threads.append(std::to_string(id));
};
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));
if (Mem::getThreadHashFactor(i) > 1) {
addThread(multiThreads, i);
}
else {
addThread(singleThreads, i);
}
}
snprintf(dhtMaskBuf, 256, ", doubleHashThreadMask=0x%" PRIX64 " [single threads: %s; double threads: %s]",
Options::i()->doubleHashThreadMask(), singleThreads.c_str(), doubleThreads.c_str());
snprintf(dhtMaskBuf, 256, ", multiHashThreadMask=0x%" PRIX64 " [single threads: %s; multihash threads: %s]",
Options::i()->multiHashThreadMask(), singleThreads.c_str(), multiThreads.c_str());
}
else {
dhtMaskBuf[0] = '\0';
@ -128,10 +128,13 @@ static void print_threads()
affBuf[0] = '\0';
}
Log::i()->text(Options::i()->colors() ? "\x1B[01;32m * \x1B[01;37mTHREADS: \x1B[01;36m%d\x1B[01;37m, %s, av=%d, %sdonate=%d%%\x1B[01;37m%s%s" : " * THREADS: %d, %s, av=%d, %sdonate=%d%%%s%s",
Log::i()->text(Options::i()->colors() ?
"\x1B[01;32m * \x1B[01;37mTHREADS: \x1B[01;36m%d\x1B[01;37m, %s, aes=%d, hf=%zu, %sdonate=%d%%\x1B[01;37m%s%s" :
" * THREADS: %d, %s, aes=%d, hf=%zu, %sdonate=%d%%\x1B[01;37m%s%s",
Options::i()->threads(),
Options::i()->algoName(),
Options::i()->algoVariant(),
Options::i()->aesni(),
Options::i()->hashFactor(),
Options::i()->colors() && Options::i()->donateLevel() == 0 ? "\x1B[01;31m" : "",
Options::i()->donateLevel(),
affBuf,