diff options
author | fireice-uk <fireice-uk@users.noreply.github.com> | 2018-05-30 21:18:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-30 21:18:45 +0100 |
commit | c0ab1734332d6472225d8ac7394f6fcba71aabc9 (patch) | |
tree | b53a4c37905a0cb5dfa6a66f514cf3dc1ea94a21 /xmrstak/cli | |
parent | 26a5d65f12b2f19a0a3ece39a2bc64718796367b (diff) | |
parent | 4f34bd18024fa71a8cab81d5a0b86cf5c7d9370e (diff) | |
download | xmr-stak-2.4.4.zip xmr-stak-2.4.4.tar.gz |
Merge pull request #1610 from fireice-uk/dev2.4.4
release 2.4.4
Diffstat (limited to 'xmrstak/cli')
-rw-r--r-- | xmrstak/cli/cli-miner.cpp | 82 | ||||
-rw-r--r-- | xmrstak/cli/xmr-stak.manifest | 12 |
2 files changed, 67 insertions, 27 deletions
diff --git a/xmrstak/cli/cli-miner.cpp b/xmrstak/cli/cli-miner.cpp index 6118682..ae39d25 100644 --- a/xmrstak/cli/cli-miner.cpp +++ b/xmrstak/cli/cli-miner.cpp @@ -55,7 +55,7 @@ # include "xmrstak/misc/uac.hpp" #endif // _WIN32 -int do_benchmark(int block_version); +int do_benchmark(int block_version, int wait_sec, int work_sec); void help() { @@ -72,7 +72,9 @@ void help() #ifdef _WIN32 cout<<" --noUAC disable the UAC dialog"<<endl; #endif - cout<<" --benchmark BLOCKVERSION ONLY do a 60-second benchmark and exit"<<endl; + cout<<" --benchmark BLOCKVERSION ONLY do a benchmark and exit"<<endl; + cout<<" --benchwait WAIT_SEC ... benchmark wait time"<<endl; + cout<<" --benchwork WORK_SEC ... benchmark work time"<<endl; #ifndef CONF_NO_CPU cout<<" --noCPU disable the CPU miner backend"<<endl; cout<<" --cpu FILE CPU backend miner config file"<<endl; @@ -110,7 +112,7 @@ void help() #endif std::string algos; jconf::GetAlgoList(algos); - cout<< "Supported coin opitons: " << endl << algos << endl; + cout<< "Supported coin options: " << endl << algos << endl; cout<< "Version: " << get_version_str_short() << endl; cout<<"Brought to by fireice_uk and psychocrypt under GPLv3."<<endl; } @@ -150,7 +152,7 @@ std::string get_multipool_entry(bool& final) std::cin.clear(); std::cin.ignore(INT_MAX,'\n'); std::cout<<"- Password (mostly empty or x):"<<std::endl; getline(std::cin, passwd); - + std::string rigid; std::cout<<"- Rig identifier for pool-side statistics (needs pool support). Can be empty:"<<std::endl; getline(std::cin, rigid); @@ -174,7 +176,7 @@ std::string get_multipool_entry(bool& final) final = !read_yes_no("- Do you want to add another pool? (y/n)"); return "\t{\"pool_address\" : \"" + pool +"\", \"wallet_address\" : \"" + userName + "\", \"rig_id\" : \"" + rigid + - "\", \"pool_password\" : \"" + passwd + "\", \"use_nicehash\" : " + bool_to_str(nicehash) + ", \"use_tls\" : " + + "\", \"pool_password\" : \"" + passwd + "\", \"use_nicehash\" : " + bool_to_str(nicehash) + ", \"use_tls\" : " + bool_to_str(tls) + ", \"tls_fingerprint\" : \"\", \"pool_weight\" : " + std::to_string(pool_weight) + " },\n"; } @@ -213,7 +215,7 @@ void do_guided_pool_config() std::cout << "- Please enter the currency that you want to mine: "<<std::endl; std::cout << list << std::endl; std::cin >> tmp; - } + } currency = tmp; } @@ -301,7 +303,7 @@ void do_guided_pool_config() std::cout << "Miner will mine mostly at the pool with the highest weight, unless the pool fails." << std::endl; std::cout << "Weight must be an integer larger than 0." << std::endl; std::cout << "- Please enter a weight for this pool: "<<std::endl; - + while(!(std::cin >> pool_weight) || pool_weight <= 0) { std::cin.clear(); @@ -314,7 +316,7 @@ void do_guided_pool_config() std::string pool_table; pool_table += "\t{\"pool_address\" : \"" + pool +"\", \"wallet_address\" : \"" + userName + "\", \"rig_id\" : \"" + rigid + - "\", \"pool_password\" : \"" + passwd + "\", \"use_nicehash\" : " + bool_to_str(nicehash) + ", \"use_tls\" : " + + "\", \"pool_password\" : \"" + passwd + "\", \"use_nicehash\" : " + bool_to_str(nicehash) + ", \"use_tls\" : " + bool_to_str(tls) + ", \"tls_fingerprint\" : \"\", \"pool_weight\" : " + std::to_string(pool_weight) + " },\n"; if(multipool) @@ -391,20 +393,20 @@ int main(int argc, char *argv[]) using namespace xmrstak; std::string pathWithName(argv[0]); - std::string seperator("/"); - auto pos = pathWithName.rfind(seperator); + std::string separator("/"); + auto pos = pathWithName.rfind(separator); if(pos == std::string::npos) { // try windows "\" - seperator = "\\"; - pos = pathWithName.rfind(seperator); + separator = "\\"; + pos = pathWithName.rfind(separator); } params::inst().binaryName = std::string(pathWithName, pos + 1, std::string::npos); if(params::inst().binaryName.compare(pathWithName) != 0) { params::inst().executablePrefix = std::string(pathWithName, 0, pos); - params::inst().executablePrefix += seperator; + params::inst().executablePrefix += separator; } params::inst().minerArg0 = argv[0]; @@ -599,7 +601,7 @@ int main(int argc, char *argv[]) win_exit(); return 1; } - + params::inst().userSetRigid = true; params::inst().poolRigid = argv[i]; } @@ -674,6 +676,44 @@ int main(int argc, char *argv[]) } params::inst().benchmark_block_version = bversion; } + else if(opName.compare("--benchwait") == 0) + { + ++i; + if( i >= argc ) + { + printer::inst()->print_msg(L0, "No argument for parameter '--benchwait' given"); + win_exit(); + return 1; + } + char* wait_sec = nullptr; + long int waitsec = strtol(argv[i], &wait_sec, 10); + + if(waitsec < 0 || waitsec >= 300) + { + printer::inst()->print_msg(L0, "Benchmark wait seconds must be in the range [0,300]"); + return 1; + } + params::inst().benchmark_wait_sec = waitsec; + } + else if(opName.compare("--benchwork") == 0) + { + ++i; + if( i >= argc ) + { + printer::inst()->print_msg(L0, "No argument for parameter '--benchwork' given"); + win_exit(); + return 1; + } + char* work_sec = nullptr; + long int worksec = strtol(argv[i], &work_sec, 10); + + if(worksec < 10 || worksec >= 300) + { + printer::inst()->print_msg(L0, "Benchmark work seconds must be in the range [10,300]"); + return 1; + } + params::inst().benchmark_work_sec = worksec; + } else { printer::inst()->print_msg(L0, "Parameter unknown '%s'",argv[i]); @@ -752,9 +792,9 @@ int main(int argc, char *argv[]) if(params::inst().benchmark_block_version >= 0) { printer::inst()->print_str("!!!! Doing only a benchmark and exiting. To mine, remove the '--benchmark' option. !!!!\n"); - return do_benchmark(params::inst().benchmark_block_version); + return do_benchmark(params::inst().benchmark_block_version, params::inst().benchmark_wait_sec, params::inst().benchmark_work_sec); } - + executor::inst()->ex_start(jconf::inst()->DaemonMode()); uint64_t lastTime = get_timestamp_ms(); @@ -789,7 +829,7 @@ int main(int argc, char *argv[]) return 0; } -int do_benchmark(int block_version) +int do_benchmark(int block_version, int wait_sec, int work_sec) { using namespace std::chrono; std::vector<xmrstak::iBackend*>* pvThreads; @@ -805,18 +845,18 @@ int do_benchmark(int block_version) xmrstak::miner_work oWork = xmrstak::miner_work(); pvThreads = xmrstak::BackendConnector::thread_starter(oWork); - printer::inst()->print_msg(L0, "Wait 30 sec until all backends are initialized"); - std::this_thread::sleep_for(std::chrono::seconds(30)); + printer::inst()->print_msg(L0, "Wait %d sec until all backends are initialized",wait_sec); + std::this_thread::sleep_for(std::chrono::seconds(wait_sec)); /* AMD and NVIDIA is currently only supporting work sizes up to 84byte * \todo fix this issue */ xmrstak::miner_work benchWork = xmrstak::miner_work("", work, 84, 0, false, 0); - printer::inst()->print_msg(L0, "Start a 60 second benchmark..."); + printer::inst()->print_msg(L0, "Start a %d second benchmark...",work_sec); xmrstak::globalStates::inst().switch_work(benchWork, dat); uint64_t iStartStamp = get_timestamp_ms(); - std::this_thread::sleep_for(std::chrono::seconds(60)); + std::this_thread::sleep_for(std::chrono::seconds(work_sec)); xmrstak::globalStates::inst().switch_work(oWork, dat); double fTotalHps = 0.0; diff --git a/xmrstak/cli/xmr-stak.manifest b/xmrstak/cli/xmr-stak.manifest index ed65c97..5735693 100644 --- a/xmrstak/cli/xmr-stak.manifest +++ b/xmrstak/cli/xmr-stak.manifest @@ -13,22 +13,22 @@ <requestedExecutionLevel level="asInvoker" uiAccess="false" - /> + /> </requestedPrivileges> </security> </trustInfo> - <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> - <application> - <!-- Windows 10 --> + <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> + <application> + <!-- Windows 10 --> <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/> <!-- Windows 8.1 --> <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/> <!-- Windows Vista --> - <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/> + <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/> <!-- Windows 7 --> <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/> <!-- Windows 8 --> <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/> - </application> + </application> </compatibility> </assembly> |