Basic advanced config reader, only single hash supported.
This commit is contained in:
parent
c44b299750
commit
c81401ab2d
7 changed files with 62 additions and 11 deletions
|
@ -197,6 +197,24 @@ xmrig::CpuThread *xmrig::CpuThread::createFromAV(size_t index, Algo algorithm, A
|
|||
}
|
||||
|
||||
|
||||
xmrig::CpuThread *xmrig::CpuThread::createFromData(size_t index, Algo algorithm, const CpuThread::Data &data, int priority, bool softAES)
|
||||
{
|
||||
int av = AV_AUTO;
|
||||
const Multiway multiway = data.multiway;
|
||||
|
||||
if (multiway <= DoubleWay) {
|
||||
av = softAES ? (multiway + 2) : multiway;
|
||||
}
|
||||
else {
|
||||
av = softAES ? (multiway + 5) : (multiway + 2);
|
||||
}
|
||||
|
||||
assert(av > AV_AUTO && av < AV_MAX);
|
||||
|
||||
return new CpuThread(index, algorithm, static_cast<AlgoVariant>(av), multiway, data.affinity, priority, softAES, false);
|
||||
}
|
||||
|
||||
|
||||
xmrig::CpuThread::Data xmrig::CpuThread::parse(const rapidjson::Value &object)
|
||||
{
|
||||
Data data;
|
||||
|
|
|
@ -72,6 +72,7 @@ public:
|
|||
|
||||
static cn_hash_fun fn(Algo algorithm, AlgoVariant av, Variant variant);
|
||||
static CpuThread *createFromAV(size_t index, Algo algorithm, AlgoVariant av, int64_t affinity, int priority);
|
||||
static CpuThread *createFromData(size_t index, Algo algorithm, const CpuThread::Data &data, int priority, bool softAES);
|
||||
static Data parse(const rapidjson::Value &object);
|
||||
|
||||
inline bool isPrefetch() const { return m_prefetch; }
|
||||
|
|
|
@ -112,6 +112,8 @@ void Workers::start(xmrig::Controller *controller)
|
|||
{
|
||||
const std::vector<xmrig::IThread *> &threads = controller->config()->threads();
|
||||
|
||||
LOG_NOTICE("- %d", std::this_thread::get_id());
|
||||
|
||||
size_t totalWays = 0;
|
||||
for (const xmrig::IThread *thread : threads) {
|
||||
totalWays += thread->multiway();
|
||||
|
@ -165,6 +167,9 @@ void Workers::submit(const JobResult &result)
|
|||
void Workers::onReady(void *arg)
|
||||
{
|
||||
auto handle = static_cast<Handle*>(arg);
|
||||
|
||||
LOG_NOTICE("%zu %d", handle->threadId(), std::this_thread::get_id());
|
||||
|
||||
if (Mem::isDoubleHash()) {
|
||||
handle->setWorker(new DoubleWorker(handle));
|
||||
}
|
||||
|
@ -175,9 +180,7 @@ void Workers::onReady(void *arg)
|
|||
const bool rc = handle->worker()->start();
|
||||
|
||||
if (!rc) {
|
||||
uv_mutex_lock(&m_mutex);
|
||||
LOG_ERR("thread %zu error: \"hash self-test failed\".", handle->worker()->id());
|
||||
uv_mutex_unlock(&m_mutex);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue