From 78cf4351d9130b7ceac5dca700afdf742111941d Mon Sep 17 00:00:00 2001 From: ChaosMarc Date: Fri, 5 Jan 2018 12:08:12 +0100 Subject: #125: separate hashrate sums for each component --- xmrstak/misc/executor.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'xmrstak/misc') diff --git a/xmrstak/misc/executor.cpp b/xmrstak/misc/executor.cpp index f0b6e0e..680f045 100644 --- a/xmrstak/misc/executor.cpp +++ b/xmrstak/misc/executor.cpp @@ -761,6 +761,7 @@ void executor::hashrate_report(std::string& out) else out.append(1, '\n'); + double fTotalCur[3] = { 0.0, 0.0, 0.0}; for (i = 0; i < nthd; i++) { double fHps[3]; @@ -779,6 +780,10 @@ void executor::hashrate_report(std::string& out) fTotal[0] += fHps[0]; fTotal[1] += fHps[1]; fTotal[2] += fHps[2]; + + fTotalCur[0] += fHps[0]; + fTotalCur[1] += fHps[1]; + fTotalCur[2] += fHps[2]; if((i & 0x1) == 1) //Odd i's out.append("|\n"); @@ -786,21 +791,25 @@ void executor::hashrate_report(std::string& out) if((i & 0x1) == 1) //We had odd number of threads out.append("|\n"); - - if(nthd != 1) - out.append("-----------------------------------------------------\n"); - else - out.append("---------------------------\n"); + + out.append("Totals (").append(name).append("): "); + out.append(hps_format(fTotalCur[0], num, sizeof(num))); + out.append(hps_format(fTotalCur[1], num, sizeof(num))); + out.append(hps_format(fTotalCur[2], num, sizeof(num))); + out.append(" H/s\n"); + + out.append("-----------------------------------------------------------------\n"); } } - out.append("Totals: "); + out.append("Totals (ALL): "); out.append(hps_format(fTotal[0], num, sizeof(num))); out.append(hps_format(fTotal[1], num, sizeof(num))); out.append(hps_format(fTotal[2], num, sizeof(num))); out.append(" H/s\nHighest: "); out.append(hps_format(fHighestHps, num, sizeof(num))); out.append(" H/s\n"); + out.append("-----------------------------------------------------------------\n"); } char* time_format(char* buf, size_t len, std::chrono::system_clock::time_point time) -- cgit v1.1 From 7b3f2942d3dafa042fe5b99aec209b200a3071d9 Mon Sep 17 00:00:00 2001 From: ChaosMarc Date: Fri, 5 Jan 2018 12:30:25 +0100 Subject: display 0.0 instead of (na) for totals --- xmrstak/misc/executor.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'xmrstak/misc') diff --git a/xmrstak/misc/executor.cpp b/xmrstak/misc/executor.cpp index 680f045..6d06411 100644 --- a/xmrstak/misc/executor.cpp +++ b/xmrstak/misc/executor.cpp @@ -776,14 +776,14 @@ void executor::hashrate_report(std::string& out) out.append(hps_format(fHps[0], num, sizeof(num))).append(" |"); out.append(hps_format(fHps[1], num, sizeof(num))).append(" |"); out.append(hps_format(fHps[2], num, sizeof(num))).append(1, ' '); - - fTotal[0] += fHps[0]; - fTotal[1] += fHps[1]; - fTotal[2] += fHps[2]; - fTotalCur[0] += fHps[0]; - fTotalCur[1] += fHps[1]; - fTotalCur[2] += fHps[2]; + fTotal[0] += (std::isnormal(fHps[0])) ? fHps[0] : 0.0; + fTotal[0] += (std::isnormal(fHps[1])) ? fHps[1] : 0.0; + fTotal[0] += (std::isnormal(fHps[2])) ? fHps[2] : 0.0; + + fTotalCur[0] += (std::isnormal(fHps[0])) ? fHps[0] : 0.0; + fTotalCur[0] += (std::isnormal(fHps[1])) ? fHps[1] : 0.0; + fTotalCur[0] += (std::isnormal(fHps[2])) ? fHps[2] : 0.0; if((i & 0x1) == 1) //Odd i's out.append("|\n"); -- cgit v1.1 From 6d21de7f7d38324e980255ed116d21f86ba740e5 Mon Sep 17 00:00:00 2001 From: ChaosMarc Date: Mon, 8 Jan 2018 10:14:43 +0100 Subject: fixed messed up array indexes --- xmrstak/misc/executor.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'xmrstak/misc') diff --git a/xmrstak/misc/executor.cpp b/xmrstak/misc/executor.cpp index 6d06411..055739b 100644 --- a/xmrstak/misc/executor.cpp +++ b/xmrstak/misc/executor.cpp @@ -778,12 +778,12 @@ void executor::hashrate_report(std::string& out) out.append(hps_format(fHps[2], num, sizeof(num))).append(1, ' '); fTotal[0] += (std::isnormal(fHps[0])) ? fHps[0] : 0.0; - fTotal[0] += (std::isnormal(fHps[1])) ? fHps[1] : 0.0; - fTotal[0] += (std::isnormal(fHps[2])) ? fHps[2] : 0.0; + fTotal[1] += (std::isnormal(fHps[1])) ? fHps[1] : 0.0; + fTotal[2] += (std::isnormal(fHps[2])) ? fHps[2] : 0.0; fTotalCur[0] += (std::isnormal(fHps[0])) ? fHps[0] : 0.0; - fTotalCur[0] += (std::isnormal(fHps[1])) ? fHps[1] : 0.0; - fTotalCur[0] += (std::isnormal(fHps[2])) ? fHps[2] : 0.0; + fTotalCur[1] += (std::isnormal(fHps[1])) ? fHps[1] : 0.0; + fTotalCur[2] += (std::isnormal(fHps[2])) ? fHps[2] : 0.0; if((i & 0x1) == 1) //Odd i's out.append("|\n"); -- cgit v1.1