Browse Source

Implement runtime selectable numbers of GPU threads and rename CPU threads option.

nfactor-troky
Con Kolivas 14 years ago
parent
commit
063adc6434
  1. 40
      cpu-miner.c

40
cpu-miner.c

@ -160,10 +160,6 @@ static struct option_help options_help[] = {
{ "help", { "help",
"(-h) Display this help text" }, "(-h) Display this help text" },
{ "config FILE",
"(-c FILE) JSON-format configuration file (default: none)\n"
"See example-cfg.json for an example configuration." },
{ "algo XXX", { "algo XXX",
"(-a XXX) Specify sha256 implementation:\n" "(-a XXX) Specify sha256 implementation:\n"
"\tc\t\tLinux kernel sha256, implemented in C (default)" "\tc\t\tLinux kernel sha256, implemented in C (default)"
@ -182,17 +178,24 @@ static struct option_help options_help[] = {
#endif #endif
}, },
{ "quiet", { "config FILE",
"(-q) Disable per-thread hashmeter output (default: off)" }, "(-c FILE) JSON-format configuration file (default: none)\n"
"See example-cfg.json for an example configuration." },
{ "cpu-threads N",
"(-t N) Number of miner CPU threads (default: number of processors or 0 if GPU mining)" },
{ "debug", { "debug",
"(-D) Enable debug output (default: off)" }, "(-D) Enable debug output (default: off)" },
{ "gpu-threads N",
"(-g N) Number of threads per-GPU (1 - 10, default: 2)" },
{ "intensity", { "intensity",
"(-I) Intensity of scanning (0 - 10, default 4)" }, "(-I) Intensity of scanning (0 - 10, default 4)" },
{ "log", { "log",
"(-l) Interval in seconds between log output (default 5)" }, "(-l) Interval in seconds between log output (default: 5)" },
{ "ndevs", { "ndevs",
"(-n) Display number of detected GPUs" }, "(-n) Display number of detected GPUs" },
@ -200,9 +203,16 @@ static struct option_help options_help[] = {
{ "no-longpoll", { "no-longpoll",
"Disable X-Long-Polling support (default: enabled)" }, "Disable X-Long-Polling support (default: enabled)" },
{ "pass PASSWORD",
"(-p PASSWORD) Password for bitcoin JSON-RPC server "
"(default: " DEF_RPC_PASSWORD ")" },
{ "protocol-dump", { "protocol-dump",
"(-P) Verbose dump of protocol-level activities (default: off)" }, "(-P) Verbose dump of protocol-level activities (default: off)" },
{ "quiet",
"(-q) Disable per-thread hashmeter output (default: off)" },
{ "retries N", { "retries N",
"(-r N) Number of times to retry, if JSON-RPC call fails\n" "(-r N) Number of times to retry, if JSON-RPC call fails\n"
"\t(default: 10; use -1 for \"never\")" }, "\t(default: 10; use -1 for \"never\")" },
@ -220,9 +230,6 @@ static struct option_help options_help[] = {
"Use system log for output messages (default: standard error)" }, "Use system log for output messages (default: standard error)" },
#endif #endif
{ "threads N",
"(-t N) Number of miner CPU threads (default: number of processors or 0 if GPU mining)" },
{ "url URL", { "url URL",
"URL for bitcoin JSON-RPC server " "URL for bitcoin JSON-RPC server "
"(default: " DEF_RPC_URL ")" }, "(default: " DEF_RPC_URL ")" },
@ -241,14 +248,13 @@ static struct option_help options_help[] = {
{ "worksize N", { "worksize N",
"(-w N) Override detected optimal worksize (default: detected)" }, "(-w N) Override detected optimal worksize (default: detected)" },
{ "pass PASSWORD",
"(-p PASSWORD) Password for bitcoin JSON-RPC server "
"(default: " DEF_RPC_PASSWORD ")" },
}; };
static struct option options[] = { static struct option options[] = {
{ "algo", 1, NULL, 'a' }, { "algo", 1, NULL, 'a' },
{ "config", 1, NULL, 'c' }, { "config", 1, NULL, 'c' },
{ "cpu-threads", 1, NULL, 't' },
{ "gpu-threads", 1, NULL, 'g' },
{ "debug", 0, NULL, 'D' }, { "debug", 0, NULL, 'D' },
{ "help", 0, NULL, 'h' }, { "help", 0, NULL, 'h' },
{ "intensity", 1, NULL, 'I' }, { "intensity", 1, NULL, 'I' },
@ -258,7 +264,6 @@ static struct option options[] = {
{ "pass", 1, NULL, 'p' }, { "pass", 1, NULL, 'p' },
{ "protocol-dump", 0, NULL, 'P' }, { "protocol-dump", 0, NULL, 'P' },
{ "quiet", 0, NULL, 'q' }, { "quiet", 0, NULL, 'q' },
{ "threads", 1, NULL, 't' },
{ "retries", 1, NULL, 'r' }, { "retries", 1, NULL, 'r' },
{ "retry-pause", 1, NULL, 'R' }, { "retry-pause", 1, NULL, 'R' },
{ "scantime", 1, NULL, 's' }, { "scantime", 1, NULL, 's' },
@ -1128,6 +1133,13 @@ static void parse_arg (int key, char *arg)
} }
break; break;
} }
case 'g':
v = atoi(arg);
if (v < 1 || v > 10)
show_usage();
opt_g_threads = v;
break;
case 'D': case 'D':
opt_debug = true; opt_debug = true;
break; break;

Loading…
Cancel
Save