Changed CPU threads format.

This commit is contained in:
XMRig 2019-08-07 21:47:42 +07:00
parent fd9039928b
commit 97192f224d
6 changed files with 68 additions and 52 deletions

View file

@ -1,5 +1,7 @@
# CPU backend
**Information in this document actual to version 2.99.5+**
All CPU related settings contains in one `cpu` object in config file, CPU backend allow specify multiple profiles and allow switch between them without restrictions by pool request or config change. Default auto-configuration create reasonable minimum of profiles which cover all supported algorithms.
### Example
@ -9,7 +11,7 @@ Example below demonstrate all primary ideas of flexible profiles configuration:
* `"rx/wow"` Exact match to algorithm `rx/wow`, defined 4 threads without CPU affinity.
* `"cn"` Default failback profile for all `cn/*` algorithms, defined 2 threads with CPU affinity, another failback profiles is `cn-lite`, `cn-heavy` and `rx`.
* `"cn-lite"` Default failback profile for all `cn-lite/*` algorithms, defined 2 double threads with CPU affinity.
* `"cn-pico"` Alternative short object format, since 2.99.5.
* `"cn-pico"` Alternative short object format.
* `"custom-profile"` Custom user defined profile.
* `"*"` Failback profile for all unhandled by other profiles algorithms.
* `"cn/r"` Exact match, alias to profile `custom-profile`.
@ -24,16 +26,13 @@ Example below demonstrate all primary ideas of flexible profiles configuration:
"priority": null,
"asm": true,
"rx/wow": [-1, -1, -1, -1],
"cn": [0, 2],
"cn": [
[1, 0],
[1, 2]
],
"cn-lite": [
{
"intensity": 2,
"affinity": 0
},
{
"intensity": 2,
"affinity": 2
}
[2, 0],
[2, 2]
],
"cn-pico": {
"intensity": 2,
@ -48,8 +47,35 @@ Example below demonstrate all primary ideas of flexible profiles configuration:
}
```
### Intensity
This option was known as `low_power_mode`, possible values is range from 1 to 5, for convinient if value 1 used, possible omit this option and specify CPU thread config by only one number: CPU affinity, instead of object.
## Threads definition
Threads can be defined in 3 formats.
#### Array format
```json
[
[1, 0],
[1, 2],
[1, -1],
[2, -1]
]
```
Each line represent one thread, first element is intensity, this option was known as `low_power_mode`, possible values is range from 1 to 5, second element is CPU affinity, special value `-1` means no affinity.
#### Short array format
```json
[-1, -1, -1, -1]
```
Each number represent one thread and means CPU affinity, this is default format for algorithm with maximum intensity 1, currently it all RandomX variants and cryptonight-gpu.
#### Short object format
```json
{
"intensity": 2,
"threads": 8,
"affinity": -1
}
```
Internal format, but can be user defined.
## Shared options