Removed --save-config option and added calibrate algo control options to config file

This commit is contained in:
MoneroOcean 2018-08-04 11:31:42 +02:00
parent f340ea69f2
commit 846eca9743
6 changed files with 7 additions and 12 deletions

View file

@ -142,7 +142,7 @@ int App::exec()
benchmark.start_perf_bench(xmrig::PerfAlgo::PA_CN); // start benchmarking from first PerfAlgo in the list benchmark.start_perf_bench(xmrig::PerfAlgo::PA_CN); // start benchmarking from first PerfAlgo in the list
} else { } else {
// save config here to have option to store automatically generated "threads" // save config here to have option to store automatically generated "threads"
if (m_controller->config()->isShouldSave() || m_controller->config()->isSaveConfig()) m_controller->config()->save(); if (m_controller->config()->isShouldSave()) m_controller->config()->save();
m_controller->network()->connect(); m_controller->network()->connect();
} }

View file

@ -48,7 +48,6 @@ xmrig::CommonConfig::CommonConfig() :
m_dryRun(false), m_dryRun(false),
m_calibrateAlgo(false), m_calibrateAlgo(false),
m_calibrateAlgoTime(60), m_calibrateAlgoTime(60),
m_saveConfig(false),
m_syslog(false), m_syslog(false),
# ifdef XMRIG_PROXY_PROJECT # ifdef XMRIG_PROXY_PROJECT
@ -191,10 +190,6 @@ bool xmrig::CommonConfig::parseBoolean(int key, bool enable)
m_calibrateAlgo = enable; m_calibrateAlgo = enable;
break; break;
case IConfig::SaveConfigKey: /* --save-config */
m_saveConfig = enable;
break;
default: default:
break; break;
} }

View file

@ -51,7 +51,6 @@ public:
inline bool isDryRun() const { return m_dryRun; } inline bool isDryRun() const { return m_dryRun; }
inline bool isCalibrateAlgo() const { return m_calibrateAlgo; } inline bool isCalibrateAlgo() const { return m_calibrateAlgo; }
inline int calibrateAlgoTime() const { return m_calibrateAlgoTime; } inline int calibrateAlgoTime() const { return m_calibrateAlgoTime; }
inline bool isSaveConfig() const { return m_saveConfig; }
inline bool isSyslog() const { return m_syslog; } inline bool isSyslog() const { return m_syslog; }
inline const char *apiToken() const { return m_apiToken.data(); } inline const char *apiToken() const { return m_apiToken.data(); }
inline const char *apiWorkerId() const { return m_apiWorkerId.data(); } inline const char *apiWorkerId() const { return m_apiWorkerId.data(); }
@ -93,7 +92,6 @@ protected:
bool m_dryRun; bool m_dryRun;
bool m_calibrateAlgo; bool m_calibrateAlgo;
int m_calibrateAlgoTime; int m_calibrateAlgoTime;
bool m_saveConfig;
bool m_syslog; bool m_syslog;
bool m_watch; bool m_watch;
int m_apiPort; int m_apiPort;

View file

@ -34,6 +34,8 @@
"safe": false, "safe": false,
"threads": null, "threads": null,
"algo-perf": null, "algo-perf": null,
"calibrate-algo": false,
"calibrate-algo-time": 60,
"user-agent": null, "user-agent": null,
"watch": false "watch": false
} }

View file

@ -91,7 +91,6 @@ Options:\n\
--api-worker-id=ID custom worker-id for API\n\ --api-worker-id=ID custom worker-id for API\n\
--api-ipv6 enable IPv6 support for API\n\ --api-ipv6 enable IPv6 support for API\n\
--api-no-restricted enable full remote access (only if API token set)\n\ --api-no-restricted enable full remote access (only if API token set)\n\
--save-config save config file including generated configuration\n\
-h, --help display this help and exit\n\ -h, --help display this help and exit\n\
-V, --version output version information and exit\n\ -V, --version output version information and exit\n\
"; ";
@ -114,9 +113,8 @@ static struct option const options[] = {
{ "cpu-priority", 1, nullptr, xmrig::IConfig::CPUPriorityKey }, { "cpu-priority", 1, nullptr, xmrig::IConfig::CPUPriorityKey },
{ "donate-level", 1, nullptr, xmrig::IConfig::DonateLevelKey }, { "donate-level", 1, nullptr, xmrig::IConfig::DonateLevelKey },
{ "dry-run", 0, nullptr, xmrig::IConfig::DryRunKey }, { "dry-run", 0, nullptr, xmrig::IConfig::DryRunKey },
{ "calibrate-algo", 0, nullptr, xmrig::IConfig::CalibrateAlgoKey }, { "calibrate-algo", 0, nullptr, xmrig::IConfig::CalibrateAlgoKey },
{ "calibrate-algo-time", 1, nullptr, xmrig::IConfig::CalibrateAlgoTimeKey }, { "calibrate-algo-time", 1, nullptr, xmrig::IConfig::CalibrateAlgoTimeKey },
{ "save-config", 0, nullptr, xmrig::IConfig::SaveConfigKey },
{ "help", 0, nullptr, xmrig::IConfig::HelpKey }, { "help", 0, nullptr, xmrig::IConfig::HelpKey },
{ "keepalive", 0, nullptr, xmrig::IConfig::KeepAliveKey }, { "keepalive", 0, nullptr, xmrig::IConfig::KeepAliveKey },
{ "log-file", 1, nullptr, xmrig::IConfig::LogFileKey }, { "log-file", 1, nullptr, xmrig::IConfig::LogFileKey },
@ -151,6 +149,8 @@ static struct option const config_options[] = {
{ "cpu-priority", 1, nullptr, xmrig::IConfig::CPUPriorityKey }, { "cpu-priority", 1, nullptr, xmrig::IConfig::CPUPriorityKey },
{ "donate-level", 1, nullptr, xmrig::IConfig::DonateLevelKey }, { "donate-level", 1, nullptr, xmrig::IConfig::DonateLevelKey },
{ "dry-run", 0, nullptr, xmrig::IConfig::DryRunKey }, { "dry-run", 0, nullptr, xmrig::IConfig::DryRunKey },
{ "calibrate-algo", 0, nullptr, xmrig::IConfig::CalibrateAlgoKey },
{ "calibrate-algo-time", 1, nullptr, xmrig::IConfig::CalibrateAlgoTimeKey },
{ "huge-pages", 0, nullptr, xmrig::IConfig::HugePagesKey }, { "huge-pages", 0, nullptr, xmrig::IConfig::HugePagesKey },
{ "log-file", 1, nullptr, xmrig::IConfig::LogFileKey }, { "log-file", 1, nullptr, xmrig::IConfig::LogFileKey },
{ "max-cpu-usage", 1, nullptr, xmrig::IConfig::MaxCPUUsageKey }, { "max-cpu-usage", 1, nullptr, xmrig::IConfig::MaxCPUUsageKey },

View file

@ -80,7 +80,7 @@ void Benchmark::onJobResult(const JobResult& result) {
start_perf_bench(next_pa); start_perf_bench(next_pa);
} else { // end of benchmarks and switching to jobs from the pool (network) } else { // end of benchmarks and switching to jobs from the pool (network)
m_pa = xmrig::PA_INVALID; m_pa = xmrig::PA_INVALID;
if (m_controller->config()->isShouldSave() || m_controller->config()->isSaveConfig()) m_controller->config()->save(); // save config with measured algo-perf if (m_controller->config()->isShouldSave()) m_controller->config()->save(); // save config with measured algo-perf
Workers::pause(); // do not compute anything before job from the pool Workers::pause(); // do not compute anything before job from the pool
m_controller->network()->connect(); m_controller->network()->connect();
} }