Compare commits
371 Commits
v2.12.0
...
v2.99.3-be
Author | SHA1 | Date | |
---|---|---|---|
|
5351288fbc | ||
|
f2dca8193b | ||
|
5a88ed7ead | ||
|
aabf183462 | ||
|
bd739d217b | ||
|
6b3b1c3fc4 | ||
|
0ae1e5f1d4 | ||
|
c13c62bf48 | ||
|
3ab8a16cef | ||
|
4f1dee14ba | ||
|
cb814921d4 | ||
|
bde89abc15 | ||
|
28cb6f67e1 | ||
|
ab02bd9847 | ||
|
ef2454b025 | ||
|
30ed5b33c0 | ||
|
d7b087d78a | ||
|
25f051abaa | ||
|
b915fa97f2 | ||
|
bbcacbc1d4 | ||
|
2fb88f10b8 | ||
|
2b29b81b89 | ||
|
a39e0e05e9 | ||
|
d10527036e | ||
|
9df9275120 | ||
|
828fc065b0 | ||
|
e53ae0c15e | ||
|
35d9c755e0 | ||
|
ffa6bda106 | ||
|
11614c287f | ||
|
35b3377d45 | ||
|
a5e8b31d55 | ||
|
d4772cbd5d | ||
|
ccd5fae5e1 | ||
|
4a32494060 | ||
|
2876702ea2 | ||
|
f8108cf6bc | ||
|
888a42951a | ||
|
a007fae8f1 | ||
|
837cf8fa90 | ||
|
7200d754c2 | ||
|
39948484bd | ||
|
107f378f7c | ||
|
fc58795e8f | ||
|
02d7c2f977 | ||
|
a6a0995d54 | ||
|
73558a0eaa | ||
|
91f732794b | ||
|
4263c6c381 | ||
|
b27fc6fd5d | ||
|
42460b8805 | ||
|
b02e596853 | ||
|
02c03b0465 | ||
|
741c7c16e8 | ||
|
8600d8ee96 | ||
|
ac849ea996 | ||
|
2d719a28c4 | ||
|
9660dfc7b3 | ||
|
370be64f30 | ||
|
162c3f3d32 | ||
|
c7ba4f8f2f | ||
|
7119e4c64c | ||
|
83f0f2bcad | ||
|
d1705a7f74 | ||
|
484253bf68 | ||
|
c4388fa74c | ||
|
e2a5bfa0b4 | ||
|
3d7598b28d | ||
|
71300fa852 | ||
|
31ca1a1b6f | ||
|
3fb180f04e | ||
|
dc2c0552e0 | ||
|
d2ca254789 | ||
|
222cebba71 | ||
|
2fc54d240a | ||
|
ca7fb33848 | ||
|
1d78e7d60d | ||
|
fa2c9df075 | ||
|
d9164c0b7b | ||
|
691b2fabbf | ||
|
88edde804f | ||
|
0ab26a1619 | ||
|
f590cf58fb | ||
|
871bc3e180 | ||
|
6f93b7b38d | ||
|
630a5dce67 | ||
|
8ce00adda4 | ||
|
4f49533e98 | ||
|
bcae974ea1 | ||
|
2bf5ffb2df | ||
|
20313cbc56 | ||
|
5699147aab | ||
|
27f3008d79 | ||
|
dff59fabc2 | ||
|
ee434a5708 | ||
|
dc87ef6062 | ||
|
8b3f2d8fff | ||
|
4643742d13 | ||
|
be7ff62c48 | ||
|
6f27037f07 | ||
|
8e2219b7c4 | ||
|
270d3ba6a2 | ||
|
3bebf778da | ||
|
f42adafee0 | ||
|
ea1149a971 | ||
|
9bf4c2c98f | ||
|
9b14caa9f9 | ||
|
8c02e20828 | ||
|
b92807e8d8 | ||
|
ee9538ab22 | ||
|
02410fa084 | ||
|
915729bec6 | ||
|
6eb9d0963b | ||
|
83fdbbf29c | ||
|
e10671fa51 | ||
|
62edb2fc0a | ||
|
dd875c7c37 | ||
|
66d62de681 | ||
|
188338c493 | ||
|
0aaf2d38d4 | ||
|
baa75569e2 | ||
|
f7fe0a9ac3 | ||
|
c2d662ff4c | ||
|
6813657891 | ||
|
ee93095e06 | ||
|
b0a1481909 | ||
|
f7f2c09e89 | ||
|
cf61f49746 | ||
|
1a2f9fb160 | ||
|
187e55e28e | ||
|
41e0be111d | ||
|
e743301a79 | ||
|
7a6c7aac29 | ||
|
53c9e5fe0e | ||
|
e8ac01d289 | ||
|
2a07cf391d | ||
|
3d17ba6af6 | ||
|
34e39e9946 | ||
|
2b26874f11 | ||
|
b38e432647 | ||
|
50ace41766 | ||
|
d0ce60a73a | ||
|
202d44c147 | ||
|
ac1b554282 | ||
|
6990324681 | ||
|
b73c204e73 | ||
|
088587fa72 | ||
|
1f0e3e501c | ||
|
d7f42d54ad | ||
|
725c767928 | ||
|
b684150336 | ||
|
d9eb700e03 | ||
|
09cdddc7f6 | ||
|
bd8370951f | ||
|
d587eebaf2 | ||
|
ac43cd4f9c | ||
|
f620ffe899 | ||
|
242ece7222 | ||
|
36fcdf3f9d | ||
|
ba94c08bf5 | ||
|
8dc586283f | ||
|
fc655d1b8d | ||
|
4b3592f60f | ||
|
cd32677ad4 | ||
|
277f188cd5 | ||
|
e28c3db019 | ||
|
5dde5dbf4e | ||
|
9726f8cf9d | ||
|
833a532e7a | ||
|
3dde8cacff | ||
|
84b359f29c | ||
|
2d8e8c92ab | ||
|
651009e1b9 | ||
|
1d4bc030fb | ||
|
809efb4700 | ||
|
10165da53e | ||
|
51b92f66cf | ||
|
6fb014d0b1 | ||
|
ffb282a11a | ||
|
a000544fdc | ||
|
378bc504fc | ||
|
304d7bd09a | ||
|
e9e2d7d152 | ||
|
8b0d35b619 | ||
|
e46a2a508a | ||
|
fe9aa9f3c4 | ||
|
552858b9e3 | ||
|
ff6544a14c | ||
|
d77e404439 | ||
|
ff4d54dc4c | ||
|
699269bbae | ||
|
9137f59ec1 | ||
|
f9f7ef26b8 | ||
|
32c3d4b9f6 | ||
|
ee1d61d117 | ||
|
a3b303e885 | ||
|
074b3869d2 | ||
|
c0e668f36f | ||
|
21798edb8b | ||
|
23b0e3799e | ||
|
83a7a88b11 | ||
|
60f6817d21 | ||
|
867478b983 | ||
|
5e369a5af8 | ||
|
62012a1a50 | ||
|
54a1c614f7 | ||
|
cf7ce13986 | ||
|
0d496aaf2f | ||
|
9a6944d694 | ||
|
1bd8d63508 | ||
|
c41889477c | ||
|
c823c54f9b | ||
|
6812d22d63 | ||
|
241383068c | ||
|
35d868fb48 | ||
|
d6da0652ce | ||
|
9561570c50 | ||
|
466aad8543 | ||
|
db456a3e63 | ||
|
09df8c3846 | ||
|
5d9648956b | ||
|
1774b42345 | ||
|
fa2a0b9b79 | ||
|
85ee55f309 | ||
|
4aa7f01f13 | ||
|
496870a59d | ||
|
89d7e84f88 | ||
|
29f683b01f | ||
|
1e3e8df43c | ||
|
1f45e77848 | ||
|
356fd04b0f | ||
|
5a4720cf4a | ||
|
c0e2a15614 | ||
|
cf7245b469 | ||
|
3b91817caf | ||
|
4457089502 | ||
|
40d9f53743 | ||
|
24e4328915 | ||
|
0245ce5f35 | ||
|
96f5bd32b5 | ||
|
e759ccf385 | ||
|
ca249f1f1c | ||
|
f8f9d6c0ef | ||
|
e39ddeeea2 | ||
|
d8aba7da7d | ||
|
bd6c7c64aa | ||
|
106e149324 | ||
|
c9f9e6787c | ||
|
9c66c9b30f | ||
|
dd036368e2 | ||
|
9cb43f9883 | ||
|
3f1eefb131 | ||
|
202b74367a | ||
|
9daa5874f5 | ||
|
01ad6bf2d9 | ||
|
725796a1ab | ||
|
1e0c410eea | ||
|
034720e888 | ||
|
22483dd231 | ||
|
5db458efd4 | ||
|
3f4886bb86 | ||
|
82bbef614e | ||
|
933c0d40b7 | ||
|
cad3e7a101 | ||
|
d7795ca990 | ||
|
ba910a46ba | ||
|
f43929db98 | ||
|
17e9e036f1 | ||
|
ced25c3fa0 | ||
|
0a893c2172 | ||
|
177e0c9c26 | ||
|
a891d2a590 | ||
|
cf7df3f629 | ||
|
453443a2f1 | ||
|
8d61a47040 | ||
|
4c95136e6a | ||
|
0907d1eb0c | ||
|
55686c7d57 | ||
|
9a6a5a94b5 | ||
|
bbf0d11a51 | ||
|
c94c0210f7 | ||
|
1b9fbf1132 | ||
|
0d86e53a32 | ||
|
1f77b049e3 | ||
|
ba68fb6c53 | ||
|
29373c4226 | ||
|
1e62943010 | ||
|
af3655c27e | ||
|
3094741c64 | ||
|
f5077cadbd | ||
|
9808fbe396 | ||
|
8c362411ef | ||
|
ba01f2a9c4 | ||
|
be5d609856 | ||
|
d57b41c673 | ||
|
fb62ee938a | ||
|
1bb8f77b52 | ||
|
5d9ebb0b91 | ||
|
d4f6eaa371 | ||
|
08ef94486b | ||
|
1042f23dd5 | ||
|
80a7aa2497 | ||
|
5cd48f483e | ||
|
8aa4c8f19b | ||
|
c8b1f176e7 | ||
|
31e40943d0 | ||
|
538c8fc9e1 | ||
|
fb3129c67d | ||
|
6a77a27e7f | ||
|
0bbeafde65 | ||
|
6052da3c43 | ||
|
8800219cf4 | ||
|
7ed840016a | ||
|
21d9ad6dbc | ||
|
154806ac74 | ||
|
10eb579270 | ||
|
123e7cf0b8 | ||
|
9f2d821970 | ||
|
18a9803e5e | ||
|
f2574c2a41 | ||
|
4ebfc135e0 | ||
|
d135bdd87e | ||
|
bde77ebab4 | ||
|
a261fe8c75 | ||
|
b1700d270a | ||
|
26e4859740 | ||
|
9685496ce0 | ||
|
7e83fb306e | ||
|
fc1bbbba6e | ||
|
d6788e4c46 | ||
|
3ab7c8344e | ||
|
9155e6a2a0 | ||
|
948f23c7d9 | ||
|
d4d0c69b5d | ||
|
488cec09dd | ||
|
a5dcd6dd1f | ||
|
d9066dc817 | ||
|
cac240104e | ||
|
eec5ca5535 | ||
|
060655fc6c | ||
|
5bd2b8fd3f | ||
|
ac58ece16e | ||
|
a0553264a4 | ||
|
1c16cfedfc | ||
|
1ea34b31a1 | ||
|
55c8ac6736 | ||
|
601453bff6 | ||
|
1bd51dcf2e | ||
|
41feb756bf | ||
|
3393ea346b | ||
|
84f85b4200 | ||
|
415600b8c9 | ||
|
b7c17cf1a0 | ||
|
de975adb8a | ||
|
764767d317 | ||
|
9c088eabc2 | ||
|
7c789a0d3c | ||
|
bdff4064a2 | ||
|
3a0fdcac6f | ||
|
ee4f6e28f0 | ||
|
f6699b5929 | ||
|
ee667144e8 | ||
|
dbdcc14672 | ||
|
4f188a2cd8 | ||
|
70d6e0e62c | ||
|
14e7c82512 | ||
|
f4d2dec628 | ||
|
0450c31449 | ||
|
b368ffacdb | ||
|
2df204f8a8 | ||
|
d554f1c12a |
78
CHANGELOG.md
78
CHANGELOG.md
@ -1,3 +1,81 @@
|
||||
# v2.99.3-beta
|
||||
- [#1082](https://github.com/xmrig/xmrig/issues/1082) Fixed hwloc auto configuration on AMD FX CPUs.
|
||||
- Added command line option `--export-topology` for export hwloc topology to a XML file.
|
||||
|
||||
# v2.99.2-beta
|
||||
- [#1077](https://github.com/xmrig/xmrig/issues/1077) Added NUMA support via **hwloc**.
|
||||
- Fixed miner freeze when switch between RandomX variants.
|
||||
- Fixed dataset initialization speed on Linux if thread affinity was used.
|
||||
|
||||
# v2.99.1-beta
|
||||
- [#1072](https://github.com/xmrig/xmrig/issues/1072) Fixed RandomX `seed_hash` re-initialization.
|
||||
|
||||
# v2.99.0-beta
|
||||
- [#1050](https://github.com/xmrig/xmrig/pull/1050) Added RandomXL algorithm for [Loki](https://loki.network/), algorithm name used by miner is `randomx/loki` or `rx/loki`.
|
||||
- Added [flexible](https://github.com/xmrig/xmrig/blob/evo/doc/CPU.md) multi algorithm configuration.
|
||||
- Added unlimited switching between incompatible algorithms, all mining options can be changed in runtime.
|
||||
- Breaked backward compatibility with previous configs and command line, `variant` option replaced to `algo`, global option `algo` removed, all CPU related settings moved to `cpu` object.
|
||||
- Options `av`, `safe` and `max-cpu-usage` removed.
|
||||
- Algorithm `cn/msr` renamed to `cn/fast`.
|
||||
- Algorithm `cn/xtl` removed.
|
||||
- API endpoint `GET /1/threads` replaced to `GET /2/backends`.
|
||||
|
||||
# v2.16.0-beta
|
||||
- [#1036](https://github.com/xmrig/xmrig/pull/1036) Added RandomWOW (RandomX with different preferences) algorithm support for [Wownero](http://wownero.org/).
|
||||
- Algorithm name used by miner is `randomx/wow` or `rx/wow`.
|
||||
- Currently runtime algorithm switching NOT supported with other algorithms.
|
||||
|
||||
# v2.15.4-beta
|
||||
- Added global uptime and extended connection information in API.
|
||||
- API now return current algorithm instead of global algorithm specified in config.
|
||||
- This version also include all changes from stable version v2.14.4.
|
||||
|
||||
# v2.15.3-beta
|
||||
- [#1014](https://github.com/xmrig/xmrig/issues/1014) Fixed regression, default value for `algo` option was not applied.
|
||||
|
||||
# v2.15.2-beta
|
||||
- [#1010](https://github.com/xmrig/xmrig/pull/1010#issuecomment-482632107) Added daemon support (solo mining).
|
||||
- [#1012](https://github.com/xmrig/xmrig/pull/1012) Fixed compatibility with clang 9.
|
||||
- Config subsystem was rewritten, internally JSON is primary format now.
|
||||
- Fixed regression, big HTTP responses was truncated.
|
||||
|
||||
# v2.15.1-beta
|
||||
- [#1007](https://github.com/xmrig/xmrig/issues/1007) Old HTTP API backend based on libmicrohttpd, replaced to custom HTTP server (libuv + http_parser).
|
||||
- [#257](https://github.com/xmrig/xmrig-nvidia/pull/257) New logging subsystem, file and syslog now always without colors.
|
||||
|
||||
# v2.15.0-beta
|
||||
- [#314](https://github.com/xmrig/xmrig-proxy/issues/314) Added donate over proxy feature.
|
||||
- Added new option `donate-over-proxy`.
|
||||
- Added real graceful exit.
|
||||
|
||||
# v2.14.4
|
||||
- [#992](https://github.com/xmrig/xmrig/pull/992) Fixed compilation with Clang 3.5.
|
||||
- [#1012](https://github.com/xmrig/xmrig/pull/1012) Fixed compilation with Clang 9.0.
|
||||
- In HTTP API for unknown hashrate now used `null` instead of `0.0`.
|
||||
- Fixed MSVC 2019 version detection.
|
||||
- Removed obsolete automatic variants.
|
||||
|
||||
# v2.14.1
|
||||
* [#975](https://github.com/xmrig/xmrig/issues/975) Fixed crash on Linux if double thread mode used.
|
||||
|
||||
# v2.14.0
|
||||
- **[#969](https://github.com/xmrig/xmrig/pull/969) Added new algorithm `cryptonight/rwz`, short alias `cn/rwz` (also known as CryptoNight ReverseWaltz), for upcoming [Graft](https://www.graft.network/) fork.**
|
||||
- **[#931](https://github.com/xmrig/xmrig/issues/931) Added new algorithm `cryptonight/zls`, short alias `cn/zls` for [Zelerius Network](https://zelerius.org) fork.**
|
||||
- **[#940](https://github.com/xmrig/xmrig/issues/940) Added new algorithm `cryptonight/double`, short alias `cn/double` (also known as CryptoNight HeavyX), for [X-CASH](https://x-cash.org/).**
|
||||
- [#951](https://github.com/xmrig/xmrig/issues/951#issuecomment-469581529) Fixed crash if AVX was disabled on OS level.
|
||||
- [#952](https://github.com/xmrig/xmrig/issues/952) Fixed compile error on some Linux.
|
||||
- [#957](https://github.com/xmrig/xmrig/issues/957#issuecomment-468890667) Added support for embedded config.
|
||||
- [#958](https://github.com/xmrig/xmrig/pull/958) Fixed incorrect user agent on ARM platforms.
|
||||
- [#968](https://github.com/xmrig/xmrig/pull/968) Optimized `cn/r` algorithm performance.
|
||||
|
||||
# v2.13.1
|
||||
- [#946](https://github.com/xmrig/xmrig/pull/946) Optimized software AES implementations for CPUs without hardware AES support. `cn/r`, `cn/wow` up to 2.6 times faster, 4-9% improvements for other algorithms.
|
||||
|
||||
# v2.13.0
|
||||
- **[#938](https://github.com/xmrig/xmrig/issues/938) Added support for new algorithm `cryptonight/r`, short alias `cn/r` (also known as CryptoNightR or CryptoNight variant 4), for upcoming [Monero](https://www.getmonero.org/) fork on March 9, thanks [@SChernykh](https://github.com/SChernykh).**
|
||||
- [#939](https://github.com/xmrig/xmrig/issues/939) Added support for dynamic (runtime) pools reload.
|
||||
- [#932](https://github.com/xmrig/xmrig/issues/932) Fixed `cn-pico` hashrate drop, regression since v2.11.0.
|
||||
|
||||
# v2.12.0
|
||||
- [#929](https://github.com/xmrig/xmrig/pull/929) Added support for new algorithm `cryptonight/wow`, short alias `cn/wow` (also known as CryptonightR), for upcoming [Wownero](http://wownero.org) fork on February 14.
|
||||
|
||||
|
329
CMakeLists.txt
329
CMakeLists.txt
File diff suppressed because it is too large
Load Diff
@ -13,7 +13,7 @@ Originally based on cpuminer-multi with heavy optimizations/rewrites and removin
|
||||
* This is the **CPU-mining** version, there is also a [NVIDIA GPU version](https://github.com/xmrig/xmrig-nvidia) and [AMD GPU version]( https://github.com/xmrig/xmrig-amd).
|
||||
* [Roadmap](https://github.com/xmrig/xmrig/issues/106) for next releases.
|
||||
|
||||
<img src="http://i.imgur.com/OKZRVDh.png" width="619" >
|
||||
<img src="http://i.imgur.com/Ymumes5.png" width="670" >
|
||||
|
||||
#### Table of contents
|
||||
* [Features](#features)
|
||||
|
25
cmake/FindHWLOC.cmake
Normal file
25
cmake/FindHWLOC.cmake
Normal file
@ -0,0 +1,25 @@
|
||||
find_path(
|
||||
HWLOC_INCLUDE_DIR
|
||||
NAMES hwloc.h
|
||||
PATHS "${XMRIG_DEPS}" ENV "XMRIG_DEPS"
|
||||
PATH_SUFFIXES "include"
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
find_path(HWLOC_INCLUDE_DIR NAMES hwloc.h)
|
||||
|
||||
find_library(
|
||||
HWLOC_LIBRARY
|
||||
NAMES hwloc.a hwloc libhwloc
|
||||
PATHS "${XMRIG_DEPS}" ENV "XMRIG_DEPS"
|
||||
PATH_SUFFIXES "lib"
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
find_library(HWLOC_LIBRARY NAMES hwloc.a hwloc libhwloc)
|
||||
|
||||
set(HWLOC_LIBRARIES ${HWLOC_LIBRARY})
|
||||
set(HWLOC_INCLUDE_DIRS ${HWLOC_INCLUDE_DIR})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(HWLOC DEFAULT_MSG HWLOC_LIBRARY HWLOC_INCLUDE_DIR)
|
@ -1,49 +0,0 @@
|
||||
# - Try to find MHD
|
||||
# Once done this will define
|
||||
#
|
||||
# MHD_FOUND - system has MHD
|
||||
# MHD_INCLUDE_DIRS - the MHD include directory
|
||||
# MHD_LIBRARY - Link these to use MHD
|
||||
|
||||
find_path(
|
||||
MHD_INCLUDE_DIR
|
||||
NAMES microhttpd.h
|
||||
PATHS "${XMRIG_DEPS}" ENV "XMRIG_DEPS"
|
||||
PATH_SUFFIXES "include"
|
||||
DOC "microhttpd include dir"
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
find_path(MHD_INCLUDE_DIR NAMES microhttpd.h)
|
||||
|
||||
find_library(
|
||||
MHD_LIBRARY
|
||||
NAMES libmicrohttpd.a microhttpd libmicrohttpd
|
||||
PATHS "${XMRIG_DEPS}" ENV "XMRIG_DEPS"
|
||||
PATH_SUFFIXES "lib"
|
||||
DOC "microhttpd library"
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
find_library(MHD_LIBRARY NAMES microhttpd libmicrohttpd)
|
||||
|
||||
set(MHD_INCLUDE_DIRS ${MHD_INCLUDE_DIR})
|
||||
set(MHD_LIBRARIES ${MHD_LIBRARY})
|
||||
|
||||
# debug library on windows
|
||||
# same naming convention as in qt (appending debug library with d)
|
||||
# boost is using the same "hack" as us with "optimized" and "debug"
|
||||
# official MHD project actually uses _d suffix
|
||||
if (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
|
||||
find_library(
|
||||
MHD_LIBRARY_DEBUG
|
||||
NAMES microhttpd_d microhttpd-10_d libmicrohttpd_d libmicrohttpd-dll_d
|
||||
DOC "mhd debug library"
|
||||
)
|
||||
set(MHD_LIBRARIES optimized ${MHD_LIBRARIES} debug ${MHD_LIBRARY_DEBUG})
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(MHD DEFAULT_MSG MHD_LIBRARY MHD_INCLUDE_DIR)
|
||||
mark_as_advanced(MHD_INCLUDE_DIR MHD_LIBRARY)
|
||||
|
@ -11,15 +11,21 @@ if (WITH_TLS)
|
||||
find_package(OpenSSL)
|
||||
|
||||
if (OPENSSL_FOUND)
|
||||
set(TLS_SOURCES src/common/net/Tls.h src/common/net/Tls.cpp)
|
||||
set(TLS_SOURCES src/base/net/stratum/Tls.h src/base/net/stratum/Tls.cpp)
|
||||
include_directories(${OPENSSL_INCLUDE_DIR})
|
||||
|
||||
if (WITH_HTTP)
|
||||
set(TLS_SOURCES ${TLS_SOURCES} src/base/net/http/HttpsClient.h src/base/net/http/HttpsClient.cpp)
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "OpenSSL NOT found: use `-DWITH_TLS=OFF` to build without TLS support")
|
||||
endif()
|
||||
|
||||
add_definitions(/DXMRIG_FEATURE_TLS)
|
||||
else()
|
||||
set(TLS_SOURCES "")
|
||||
set(OPENSSL_LIBRARIES "")
|
||||
add_definitions(/DXMRIG_NO_TLS)
|
||||
remove_definitions(/DXMRIG_FEATURE_TLS)
|
||||
|
||||
set(CMAKE_PROJECT_NAME "${CMAKE_PROJECT_NAME}-notls")
|
||||
endif()
|
||||
|
@ -5,41 +5,48 @@ if (WITH_ASM AND NOT XMRIG_ARM AND CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
enable_language(ASM_MASM)
|
||||
|
||||
if (MSVC_TOOLSET_VERSION GREATER_EQUAL 141)
|
||||
set(XMRIG_ASM_FILE
|
||||
"src/crypto/asm/cn_main_loop.asm"
|
||||
"src/crypto/asm/CryptonightR_template.asm"
|
||||
set(XMRIG_ASM_FILES
|
||||
"src/crypto/cn/asm/cn_main_loop.asm"
|
||||
"src/crypto/cn/asm/CryptonightR_template.asm"
|
||||
)
|
||||
else()
|
||||
set(XMRIG_ASM_FILE
|
||||
"src/crypto/asm/win64/cn_main_loop.asm"
|
||||
"src/crypto/asm/win64/CryptonightR_template.asm"
|
||||
set(XMRIG_ASM_FILES
|
||||
"src/crypto/cn/asm/win64/cn_main_loop.asm"
|
||||
"src/crypto/cn/asm/win64/CryptonightR_template.asm"
|
||||
)
|
||||
endif()
|
||||
|
||||
set_property(SOURCE ${XMRIG_ASM_FILE} PROPERTY ASM_MASM)
|
||||
set_property(SOURCE ${XMRIG_ASM_FILES} PROPERTY ASM_MASM)
|
||||
else()
|
||||
enable_language(ASM)
|
||||
|
||||
if (WIN32 AND CMAKE_C_COMPILER_ID MATCHES GNU)
|
||||
set(XMRIG_ASM_FILE
|
||||
"src/crypto/asm/win64/cn_main_loop.S"
|
||||
"src/crypto/asm/win64/CryptonightR_template.S"
|
||||
set(XMRIG_ASM_FILES
|
||||
"src/crypto/cn/asm/win64/cn_main_loop.S"
|
||||
"src/crypto/cn/asm/CryptonightR_template.S"
|
||||
)
|
||||
else()
|
||||
set(XMRIG_ASM_FILE
|
||||
"src/crypto/asm/cn_main_loop.S"
|
||||
"src/crypto/asm/CryptonightR_template.S"
|
||||
set(XMRIG_ASM_FILES
|
||||
"src/crypto/cn/asm/cn_main_loop.S"
|
||||
"src/crypto/cn/asm/CryptonightR_template.S"
|
||||
)
|
||||
endif()
|
||||
|
||||
set_property(SOURCE ${XMRIG_ASM_FILE} PROPERTY C)
|
||||
set_property(SOURCE ${XMRIG_ASM_FILES} PROPERTY C)
|
||||
endif()
|
||||
|
||||
add_library(${XMRIG_ASM_LIBRARY} STATIC ${XMRIG_ASM_FILE})
|
||||
set(XMRIG_ASM_SOURCES src/crypto/Asm.h src/crypto/Asm.cpp)
|
||||
add_library(${XMRIG_ASM_LIBRARY} STATIC ${XMRIG_ASM_FILES})
|
||||
set(XMRIG_ASM_SOURCES
|
||||
src/crypto/common/Assembly.h
|
||||
src/crypto/common/Assembly.cpp
|
||||
src/crypto/cn/r/CryptonightR_gen.cpp
|
||||
)
|
||||
set_property(TARGET ${XMRIG_ASM_LIBRARY} PROPERTY LINKER_LANGUAGE C)
|
||||
|
||||
add_definitions(/DXMRIG_FEATURE_ASM)
|
||||
else()
|
||||
set(XMRIG_ASM_SOURCES "")
|
||||
set(XMRIG_ASM_LIBRARY "")
|
||||
add_definitions(/DXMRIG_NO_ASM)
|
||||
|
||||
remove_definitions(/DXMRIG_FEATURE_ASM)
|
||||
endif()
|
||||
|
@ -1,23 +1,25 @@
|
||||
if (WITH_CN_GPU AND CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
|
||||
if (XMRIG_ARM)
|
||||
set(CN_GPU_SOURCES src/crypto/cn_gpu_arm.cpp)
|
||||
set(CN_GPU_SOURCES src/crypto/cn/gpu/cn_gpu_arm.cpp)
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES GNU OR CMAKE_CXX_COMPILER_ID MATCHES Clang)
|
||||
set_source_files_properties(src/crypto/cn_gpu_arm.cpp PROPERTIES COMPILE_FLAGS "-O3")
|
||||
set_source_files_properties(src/crypto/cn/gpu/cn_gpu_arm.cpp PROPERTIES COMPILE_FLAGS "-O3")
|
||||
endif()
|
||||
else()
|
||||
set(CN_GPU_SOURCES src/crypto/cn_gpu_avx.cpp src/crypto/cn_gpu_ssse3.cpp)
|
||||
set(CN_GPU_SOURCES src/crypto/cn/gpu/cn_gpu_avx.cpp src/crypto/cn/gpu/cn_gpu_ssse3.cpp)
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES GNU OR CMAKE_CXX_COMPILER_ID MATCHES Clang)
|
||||
set_source_files_properties(src/crypto/cn_gpu_avx.cpp PROPERTIES COMPILE_FLAGS "-O3 -mavx2")
|
||||
set_source_files_properties(src/crypto/cn_gpu_ssse3.cpp PROPERTIES COMPILE_FLAGS "-O3")
|
||||
set_source_files_properties(src/crypto/cn/gpu/cn_gpu_avx.cpp PROPERTIES COMPILE_FLAGS "-O3 -mavx2")
|
||||
set_source_files_properties(src/crypto/cn/gpu/cn_gpu_ssse3.cpp PROPERTIES COMPILE_FLAGS "-O3")
|
||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
||||
set_source_files_properties(src/crypto/cn_gpu_avx.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX")
|
||||
set_source_files_properties(src/crypto/cn/gpu/cn_gpu_avx.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_definitions(/DXMRIG_ALGO_CN_GPU)
|
||||
else()
|
||||
set(CN_GPU_SOURCES "")
|
||||
|
||||
add_definitions(/DXMRIG_NO_CN_GPU)
|
||||
remove_definitions(/DXMRIG_ALGO_CN_GPU)
|
||||
endif()
|
||||
|
@ -10,12 +10,14 @@ if (CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
add_definitions(/DNDEBUG)
|
||||
endif()
|
||||
|
||||
include(CheckSymbolExists)
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-strict-aliasing")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Ofast")
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fno-exceptions -fno-rtti -Wno-class-memaccess")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fexceptions -fno-rtti -Wno-class-memaccess")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Ofast -s")
|
||||
|
||||
if (XMRIG_ARMv8)
|
||||
@ -27,6 +29,8 @@ if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
|
||||
else()
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -maes")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maes")
|
||||
|
||||
add_definitions(/DHAVE_ROTR)
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
@ -50,13 +54,14 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
||||
add_definitions(/D_CRT_SECURE_NO_WARNINGS)
|
||||
add_definitions(/D_CRT_NONSTDC_NO_WARNINGS)
|
||||
add_definitions(/DNOMINMAX)
|
||||
add_definitions(/DHAVE_ROTR)
|
||||
|
||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang)
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Ofast -funroll-loops -fmerge-all-constants")
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fno-exceptions -fno-rtti -Wno-missing-braces")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fexceptions -fno-rtti -Wno-missing-braces")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Ofast -funroll-loops -fmerge-all-constants")
|
||||
|
||||
if (XMRIG_ARMv8)
|
||||
@ -68,6 +73,18 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang)
|
||||
else()
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -maes")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maes")
|
||||
|
||||
check_symbol_exists("_rotr" "x86intrin.h" HAVE_ROTR)
|
||||
if (HAVE_ROTR)
|
||||
add_definitions(/DHAVE_ROTR)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
if (NOT WIN32)
|
||||
check_symbol_exists("__builtin___clear_cache" "stdlib.h" HAVE_BUILTIN_CLEAR_CACHE)
|
||||
if (HAVE_BUILTIN_CLEAR_CACHE)
|
||||
add_definitions(/DHAVE_BUILTIN_CLEAR_CACHE)
|
||||
endif()
|
||||
endif()
|
||||
|
@ -1,22 +1,14 @@
|
||||
# Algorithms
|
||||
|
||||
XMRig uses a different way to specify algorithms, compared to other miners.
|
||||
|
||||
Algorithm selection splitted to 2 parts:
|
||||
|
||||
* Global base algorithm per miner or proxy instance, `algo` option. Possible values: `cryptonight`, `cryptonight-lite`, `cryptonight-heavy`.
|
||||
* Algorithm variant specified separately for each pool, `variant` option.
|
||||
* [Full table for supported algorithm and variants.](https://github.com/xmrig/xmrig-proxy/blob/master/doc/STRATUM_EXT.md#14-algorithm-names-and-variants)
|
||||
Since version 3 mining [algorithm](#algorithm-names) should specified for each pool separately (`algo` option), earlier versions was use one global `algo` option and per pool `variant` option (this option was removed in v3). If your pool support [mining algorithm negotiation](https://github.com/xmrig/xmrig-proxy/issues/168) you may not specify this option at all.
|
||||
|
||||
#### Example
|
||||
```json
|
||||
{
|
||||
"algo": "cryptonight",
|
||||
...
|
||||
"pools": [
|
||||
{
|
||||
"url": "...",
|
||||
"variant": 1,
|
||||
"algo": "cn/r",
|
||||
...
|
||||
}
|
||||
],
|
||||
@ -24,8 +16,34 @@ Algorithm selection splitted to 2 parts:
|
||||
}
|
||||
```
|
||||
|
||||
## Mining algorithm negotiation
|
||||
If your pool support [mining algorithm negotiation](https://github.com/xmrig/xmrig-proxy/issues/168) miner will choice proper variant automaticaly and if you choice wrong base algorithm you will see error message.
|
||||
#### Pools with mining algorithm negotiation support.
|
||||
|
||||
Pools with mining algorithm negotiation support.
|
||||
* [www.hashvault.pro](https://www.hashvault.pro/)
|
||||
* [moneroocean.stream](https://moneroocean.stream)
|
||||
|
||||
## Algorithm names
|
||||
|
||||
| Name | Memory | Notes |
|
||||
|-----------------|--------|--------------------------------------------------------------------------------------|
|
||||
| `cn/0` | 2 MB | CryptoNight (original) |
|
||||
| `cn/1` | 2 MB | CryptoNight variant 1 also known as `Monero7` and `CryptoNightV7`. |
|
||||
| `cn/2` | 2 MB | CryptoNight variant 2. |
|
||||
| `cn/r` | 2 MB | CryptoNightR (Monero's variant 4). |
|
||||
| `cn/wow` | 2 MB | CryptoNightR (Wownero). |
|
||||
| `cn/fast` | 2 MB | CryptoNight variant 1 with half iterations. |
|
||||
| `cn/half` | 2 MB | CryptoNight variant 2 with half iterations (Masari/Torque) |
|
||||
| `cn/xao` | 2 MB | CryptoNight variant 0 (modified, Alloy only) |
|
||||
| `cn/rto` | 2 MB | CryptoNight variant 1 (modified, Arto only) |
|
||||
| `cn/rwz` | 2 MB | CryptoNight variant 2 with 3/4 iterations and reversed shuffle operation (Graft). |
|
||||
| `cn/zls` | 2 MB | CryptoNight variant 2 with 3/4 iterations (Zelerius). |
|
||||
| `cn/double` | 2 MB | CryptoNight variant 2 with double iterations (X-CASH). |
|
||||
| `cn/gpu` | 2 MB | CryptoNight-GPU (RYO). |
|
||||
| `cn-lite/0` | 1 MB | CryptoNight-Lite variant 0. |
|
||||
| `cn-lite/1` | 1 MB | CryptoNight-Lite variant 1. |
|
||||
| `cn-heavy/0` | 4 MB | CryptoNight-Heavy . |
|
||||
| `cn-heavy/xhv` | 4 MB | CryptoNight-Heavy (modified, TUBE only). |
|
||||
| `cn-heavy/tube` | 4 MB | CryptoNight-Heavy (modified, Haven Protocol only). |
|
||||
| `cn-pico` | 256 KB | TurtleCoin (TRTL) |
|
||||
| `rx/0` | 2 MB | RandomX (reference configuration), reserved for future use. |
|
||||
| `rx/wow` | 1 MB | RandomWOW (Wownero). |
|
||||
| `rx/loki` | 2 MB | RandomXL (Loki). |
|
||||
|
76
doc/CPU.md
Normal file
76
doc/CPU.md
Normal file
@ -0,0 +1,76 @@
|
||||
# CPU backend
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
* `"custom-profile"` Custom user defined profile.
|
||||
* `"*"` Failback profile for all unhandled by other profiles algorithms.
|
||||
* `"cn/r"` Exact match, alias to profile `custom-profile`.
|
||||
* `"cn/0"` Exact match, disabled algorithm.
|
||||
|
||||
```json
|
||||
{
|
||||
"cpu": {
|
||||
"enabled": true,
|
||||
"huge-pages": true,
|
||||
"hw-aes": null,
|
||||
"priority": null,
|
||||
"asm": true,
|
||||
"rx/wow": [
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
],
|
||||
"cn": [
|
||||
0,
|
||||
2
|
||||
],
|
||||
"cn-lite": [
|
||||
{
|
||||
"intensity": 2,
|
||||
"affinity": 0
|
||||
},
|
||||
{
|
||||
"intensity": 2,
|
||||
"affinity": 2
|
||||
}
|
||||
],
|
||||
"custom-profile": [
|
||||
0,
|
||||
2,
|
||||
],
|
||||
"*": [
|
||||
-1
|
||||
],
|
||||
"cn/r": "custom-profile",
|
||||
"cn/0": false
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 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.
|
||||
|
||||
## Shared options
|
||||
|
||||
#### `enabled`
|
||||
Enable (`true`) or disable (`false`) CPU backend, by default `true`.
|
||||
|
||||
#### `huge-pages`
|
||||
Enable (`true`) or disable (`false`) huge pages support, by default `true`.
|
||||
|
||||
#### `hw-aes`
|
||||
Force enable (`true`) or disable (`false`) hardware AES support. Default value `null` means miner autodetect this feature. Usually don't need change this option, this option useful for some rare cases when miner can't detect hardware AES, but it available. If you force enable this option, but your hardware not support it, miner will crash.
|
||||
|
||||
#### `priority`
|
||||
Mining threads priority, value from `1` (lowest priority) to `5` (highest possible priority). Default value `null` means miner don't change threads priority at all.
|
||||
|
||||
#### `asm`
|
||||
Enable/configure or disable ASM optimizations. Possible values: `true`, `false`, `"intel"`, `"ryzen"`, `"bulldozer"`.
|
@ -1,7 +1,7 @@
|
||||
#include <windows.h>
|
||||
#include "../src/version.h"
|
||||
|
||||
IDI_ICON1 ICON DISCARDABLE "app.ico"
|
||||
101 ICON "app.ico"
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION APP_VER_MAJOR,APP_VER_MINOR,APP_VER_PATCH,0
|
||||
|
68
src/3rdparty/http-parser/AUTHORS
vendored
Normal file
68
src/3rdparty/http-parser/AUTHORS
vendored
Normal file
@ -0,0 +1,68 @@
|
||||
# Authors ordered by first contribution.
|
||||
Ryan Dahl <ry@tinyclouds.org>
|
||||
Jeremy Hinegardner <jeremy@hinegardner.org>
|
||||
Sergey Shepelev <temotor@gmail.com>
|
||||
Joe Damato <ice799@gmail.com>
|
||||
tomika <tomika_nospam@freemail.hu>
|
||||
Phoenix Sol <phoenix@burninglabs.com>
|
||||
Cliff Frey <cliff@meraki.com>
|
||||
Ewen Cheslack-Postava <ewencp@cs.stanford.edu>
|
||||
Santiago Gala <sgala@apache.org>
|
||||
Tim Becker <tim.becker@syngenio.de>
|
||||
Jeff Terrace <jterrace@gmail.com>
|
||||
Ben Noordhuis <info@bnoordhuis.nl>
|
||||
Nathan Rajlich <nathan@tootallnate.net>
|
||||
Mark Nottingham <mnot@mnot.net>
|
||||
Aman Gupta <aman@tmm1.net>
|
||||
Tim Becker <tim.becker@kuriositaet.de>
|
||||
Sean Cunningham <sean.cunningham@mandiant.com>
|
||||
Peter Griess <pg@std.in>
|
||||
Salman Haq <salman.haq@asti-usa.com>
|
||||
Cliff Frey <clifffrey@gmail.com>
|
||||
Jon Kolb <jon@b0g.us>
|
||||
Fouad Mardini <f.mardini@gmail.com>
|
||||
Paul Querna <pquerna@apache.org>
|
||||
Felix Geisendörfer <felix@debuggable.com>
|
||||
koichik <koichik@improvement.jp>
|
||||
Andre Caron <andre.l.caron@gmail.com>
|
||||
Ivo Raisr <ivosh@ivosh.net>
|
||||
James McLaughlin <jamie@lacewing-project.org>
|
||||
David Gwynne <loki@animata.net>
|
||||
Thomas LE ROUX <thomas@november-eleven.fr>
|
||||
Randy Rizun <rrizun@ortivawireless.com>
|
||||
Andre Louis Caron <andre.louis.caron@usherbrooke.ca>
|
||||
Simon Zimmermann <simonz05@gmail.com>
|
||||
Erik Dubbelboer <erik@dubbelboer.com>
|
||||
Martell Malone <martellmalone@gmail.com>
|
||||
Bertrand Paquet <bpaquet@octo.com>
|
||||
BogDan Vatra <bogdan@kde.org>
|
||||
Peter Faiman <peter@thepicard.org>
|
||||
Corey Richardson <corey@octayn.net>
|
||||
Tóth Tamás <tomika_nospam@freemail.hu>
|
||||
Cam Swords <cam.swords@gmail.com>
|
||||
Chris Dickinson <christopher.s.dickinson@gmail.com>
|
||||
Uli Köhler <ukoehler@btronik.de>
|
||||
Charlie Somerville <charlie@charliesomerville.com>
|
||||
Patrik Stutz <patrik.stutz@gmail.com>
|
||||
Fedor Indutny <fedor.indutny@gmail.com>
|
||||
runner <runner.mei@gmail.com>
|
||||
Alexis Campailla <alexis@janeasystems.com>
|
||||
David Wragg <david@wragg.org>
|
||||
Vinnie Falco <vinnie.falco@gmail.com>
|
||||
Alex Butum <alexbutum@linux.com>
|
||||
Rex Feng <rexfeng@gmail.com>
|
||||
Alex Kocharin <alex@kocharin.ru>
|
||||
Mark Koopman <markmontymark@yahoo.com>
|
||||
Helge Heß <me@helgehess.eu>
|
||||
Alexis La Goutte <alexis.lagoutte@gmail.com>
|
||||
George Miroshnykov <george.miroshnykov@gmail.com>
|
||||
Maciej Małecki <me@mmalecki.com>
|
||||
Marc O'Morain <github.com@marcomorain.com>
|
||||
Jeff Pinner <jpinner@twitter.com>
|
||||
Timothy J Fontaine <tjfontaine@gmail.com>
|
||||
Akagi201 <akagi201@gmail.com>
|
||||
Romain Giraud <giraud.romain@gmail.com>
|
||||
Jay Satiro <raysatiro@yahoo.com>
|
||||
Arne Steen <Arne.Steen@gmx.de>
|
||||
Kjell Schubert <kjell.schubert@gmail.com>
|
||||
Olivier Mengué <dolmen@cpan.org>
|
19
src/3rdparty/http-parser/LICENSE-MIT
vendored
Normal file
19
src/3rdparty/http-parser/LICENSE-MIT
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
Copyright Joyent, Inc. and other Node contributors.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to
|
||||
deal in the Software without restriction, including without limitation the
|
||||
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
sell copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
IN THE SOFTWARE.
|
246
src/3rdparty/http-parser/README.md
vendored
Normal file
246
src/3rdparty/http-parser/README.md
vendored
Normal file
@ -0,0 +1,246 @@
|
||||
HTTP Parser
|
||||
===========
|
||||
|
||||
[![Build Status](https://api.travis-ci.org/nodejs/http-parser.svg?branch=master)](https://travis-ci.org/nodejs/http-parser)
|
||||
|
||||
This is a parser for HTTP messages written in C. It parses both requests and
|
||||
responses. The parser is designed to be used in performance HTTP
|
||||
applications. It does not make any syscalls nor allocations, it does not
|
||||
buffer data, it can be interrupted at anytime. Depending on your
|
||||
architecture, it only requires about 40 bytes of data per message
|
||||
stream (in a web server that is per connection).
|
||||
|
||||
Features:
|
||||
|
||||
* No dependencies
|
||||
* Handles persistent streams (keep-alive).
|
||||
* Decodes chunked encoding.
|
||||
* Upgrade support
|
||||
* Defends against buffer overflow attacks.
|
||||
|
||||
The parser extracts the following information from HTTP messages:
|
||||
|
||||
* Header fields and values
|
||||
* Content-Length
|
||||
* Request method
|
||||
* Response status code
|
||||
* Transfer-Encoding
|
||||
* HTTP version
|
||||
* Request URL
|
||||
* Message body
|
||||
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
One `http_parser` object is used per TCP connection. Initialize the struct
|
||||
using `http_parser_init()` and set the callbacks. That might look something
|
||||
like this for a request parser:
|
||||
```c
|
||||
http_parser_settings settings;
|
||||
settings.on_url = my_url_callback;
|
||||
settings.on_header_field = my_header_field_callback;
|
||||
/* ... */
|
||||
|
||||
http_parser *parser = malloc(sizeof(http_parser));
|
||||
http_parser_init(parser, HTTP_REQUEST);
|
||||
parser->data = my_socket;
|
||||
```
|
||||
|
||||
When data is received on the socket execute the parser and check for errors.
|
||||
|
||||
```c
|
||||
size_t len = 80*1024, nparsed;
|
||||
char buf[len];
|
||||
ssize_t recved;
|
||||
|
||||
recved = recv(fd, buf, len, 0);
|
||||
|
||||
if (recved < 0) {
|
||||
/* Handle error. */
|
||||
}
|
||||
|
||||
/* Start up / continue the parser.
|
||||
* Note we pass recved==0 to signal that EOF has been received.
|
||||
*/
|
||||
nparsed = http_parser_execute(parser, &settings, buf, recved);
|
||||
|
||||
if (parser->upgrade) {
|
||||
/* handle new protocol */
|
||||
} else if (nparsed != recved) {
|
||||
/* Handle error. Usually just close the connection. */
|
||||
}
|
||||
```
|
||||
|
||||
`http_parser` needs to know where the end of the stream is. For example, sometimes
|
||||
servers send responses without Content-Length and expect the client to
|
||||
consume input (for the body) until EOF. To tell `http_parser` about EOF, give
|
||||
`0` as the fourth parameter to `http_parser_execute()`. Callbacks and errors
|
||||
can still be encountered during an EOF, so one must still be prepared
|
||||
to receive them.
|
||||
|
||||
Scalar valued message information such as `status_code`, `method`, and the
|
||||
HTTP version are stored in the parser structure. This data is only
|
||||
temporally stored in `http_parser` and gets reset on each new message. If
|
||||
this information is needed later, copy it out of the structure during the
|
||||
`headers_complete` callback.
|
||||
|
||||
The parser decodes the transfer-encoding for both requests and responses
|
||||
transparently. That is, a chunked encoding is decoded before being sent to
|
||||
the on_body callback.
|
||||
|
||||
|
||||
The Special Problem of Upgrade
|
||||
------------------------------
|
||||
|
||||
`http_parser` supports upgrading the connection to a different protocol. An
|
||||
increasingly common example of this is the WebSocket protocol which sends
|
||||
a request like
|
||||
|
||||
GET /demo HTTP/1.1
|
||||
Upgrade: WebSocket
|
||||
Connection: Upgrade
|
||||
Host: example.com
|
||||
Origin: http://example.com
|
||||
WebSocket-Protocol: sample
|
||||
|
||||
followed by non-HTTP data.
|
||||
|
||||
(See [RFC6455](https://tools.ietf.org/html/rfc6455) for more information the
|
||||
WebSocket protocol.)
|
||||
|
||||
To support this, the parser will treat this as a normal HTTP message without a
|
||||
body, issuing both on_headers_complete and on_message_complete callbacks. However
|
||||
http_parser_execute() will stop parsing at the end of the headers and return.
|
||||
|
||||
The user is expected to check if `parser->upgrade` has been set to 1 after
|
||||
`http_parser_execute()` returns. Non-HTTP data begins at the buffer supplied
|
||||
offset by the return value of `http_parser_execute()`.
|
||||
|
||||
|
||||
Callbacks
|
||||
---------
|
||||
|
||||
During the `http_parser_execute()` call, the callbacks set in
|
||||
`http_parser_settings` will be executed. The parser maintains state and
|
||||
never looks behind, so buffering the data is not necessary. If you need to
|
||||
save certain data for later usage, you can do that from the callbacks.
|
||||
|
||||
There are two types of callbacks:
|
||||
|
||||
* notification `typedef int (*http_cb) (http_parser*);`
|
||||
Callbacks: on_message_begin, on_headers_complete, on_message_complete.
|
||||
* data `typedef int (*http_data_cb) (http_parser*, const char *at, size_t length);`
|
||||
Callbacks: (requests only) on_url,
|
||||
(common) on_header_field, on_header_value, on_body;
|
||||
|
||||
Callbacks must return 0 on success. Returning a non-zero value indicates
|
||||
error to the parser, making it exit immediately.
|
||||
|
||||
For cases where it is necessary to pass local information to/from a callback,
|
||||
the `http_parser` object's `data` field can be used.
|
||||
An example of such a case is when using threads to handle a socket connection,
|
||||
parse a request, and then give a response over that socket. By instantiation
|
||||
of a thread-local struct containing relevant data (e.g. accepted socket,
|
||||
allocated memory for callbacks to write into, etc), a parser's callbacks are
|
||||
able to communicate data between the scope of the thread and the scope of the
|
||||
callback in a threadsafe manner. This allows `http_parser` to be used in
|
||||
multi-threaded contexts.
|
||||
|
||||
Example:
|
||||
```c
|
||||
typedef struct {
|
||||
socket_t sock;
|
||||
void* buffer;
|
||||
int buf_len;
|
||||
} custom_data_t;
|
||||
|
||||
|
||||
int my_url_callback(http_parser* parser, const char *at, size_t length) {
|
||||
/* access to thread local custom_data_t struct.
|
||||
Use this access save parsed data for later use into thread local
|
||||
buffer, or communicate over socket
|
||||
*/
|
||||
parser->data;
|
||||
...
|
||||
return 0;
|
||||
}
|
||||
|
||||
...
|
||||
|
||||
void http_parser_thread(socket_t sock) {
|
||||
int nparsed = 0;
|
||||
/* allocate memory for user data */
|
||||
custom_data_t *my_data = malloc(sizeof(custom_data_t));
|
||||
|
||||
/* some information for use by callbacks.
|
||||
* achieves thread -> callback information flow */
|
||||
my_data->sock = sock;
|
||||
|
||||
/* instantiate a thread-local parser */
|
||||
http_parser *parser = malloc(sizeof(http_parser));
|
||||
http_parser_init(parser, HTTP_REQUEST); /* initialise parser */
|
||||
/* this custom data reference is accessible through the reference to the
|
||||
parser supplied to callback functions */
|
||||
parser->data = my_data;
|
||||
|
||||
http_parser_settings settings; /* set up callbacks */
|
||||
settings.on_url = my_url_callback;
|
||||
|
||||
/* execute parser */
|
||||
nparsed = http_parser_execute(parser, &settings, buf, recved);
|
||||
|
||||
...
|
||||
/* parsed information copied from callback.
|
||||
can now perform action on data copied into thread-local memory from callbacks.
|
||||
achieves callback -> thread information flow */
|
||||
my_data->buffer;
|
||||
...
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
In case you parse HTTP message in chunks (i.e. `read()` request line
|
||||
from socket, parse, read half headers, parse, etc) your data callbacks
|
||||
may be called more than once. `http_parser` guarantees that data pointer is only
|
||||
valid for the lifetime of callback. You can also `read()` into a heap allocated
|
||||
buffer to avoid copying memory around if this fits your application.
|
||||
|
||||
Reading headers may be a tricky task if you read/parse headers partially.
|
||||
Basically, you need to remember whether last header callback was field or value
|
||||
and apply the following logic:
|
||||
|
||||
(on_header_field and on_header_value shortened to on_h_*)
|
||||
------------------------ ------------ --------------------------------------------
|
||||
| State (prev. callback) | Callback | Description/action |
|
||||
------------------------ ------------ --------------------------------------------
|
||||
| nothing (first call) | on_h_field | Allocate new buffer and copy callback data |
|
||||
| | | into it |
|
||||
------------------------ ------------ --------------------------------------------
|
||||
| value | on_h_field | New header started. |
|
||||
| | | Copy current name,value buffers to headers |
|
||||
| | | list and allocate new buffer for new name |
|
||||
------------------------ ------------ --------------------------------------------
|
||||
| field | on_h_field | Previous name continues. Reallocate name |
|
||||
| | | buffer and append callback data to it |
|
||||
------------------------ ------------ --------------------------------------------
|
||||
| field | on_h_value | Value for current header started. Allocate |
|
||||
| | | new buffer and copy callback data to it |
|
||||
------------------------ ------------ --------------------------------------------
|
||||
| value | on_h_value | Value continues. Reallocate value buffer |
|
||||
| | | and append callback data to it |
|
||||
------------------------ ------------ --------------------------------------------
|
||||
|
||||
|
||||
Parsing URLs
|
||||
------------
|
||||
|
||||
A simplistic zero-copy URL parser is provided as `http_parser_parse_url()`.
|
||||
Users of this library may wish to use it to parse URLs constructed from
|
||||
consecutive `on_url` callbacks.
|
||||
|
||||
See examples of reading in headers:
|
||||
|
||||
* [partial example](http://gist.github.com/155877) in C
|
||||
* [from http-parser tests](http://github.com/joyent/http-parser/blob/37a0ff8/test.c#L403) in C
|
||||
* [from Node library](http://github.com/joyent/node/blob/842eaf4/src/http.js#L284) in Javascript
|
2501
src/3rdparty/http-parser/http_parser.c
vendored
Normal file
2501
src/3rdparty/http-parser/http_parser.c
vendored
Normal file
File diff suppressed because it is too large
Load Diff
439
src/3rdparty/http-parser/http_parser.h
vendored
Normal file
439
src/3rdparty/http-parser/http_parser.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
44
src/3rdparty/hwloc/AUTHORS
vendored
Normal file
44
src/3rdparty/hwloc/AUTHORS
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
hwloc Authors
|
||||
=============
|
||||
|
||||
The following cumulative list contains the names of most individuals
|
||||
who have committed code to the hwloc repository
|
||||
(either directly or through a third party).
|
||||
|
||||
Name Affiliation(s)
|
||||
--------------------------- --------------------
|
||||
Grzegorz Andrejczuk Intel
|
||||
Cédric Augonnet University of Bordeaux
|
||||
Guillaume Beauchamp Inria
|
||||
Ahmad Boissetri Binzagr Inria
|
||||
Cyril Bordage Inria
|
||||
Nicholas Buroker UWL
|
||||
Christopher M. Cantalupo Intel
|
||||
Jérôme Clet-Ortega University of Bordeaux
|
||||
Ludovic Courtès Inria
|
||||
Clément Foyer Inria
|
||||
Nathalie Furmento CNRS
|
||||
Bryon Gloden
|
||||
Brice Goglin Inria
|
||||
Gilles Gouaillardet RIST
|
||||
Joshua Hursey UWL
|
||||
Alexey Kardashevskiy IBM
|
||||
Rob Latham ANL
|
||||
Douglas MacFarland UWL
|
||||
Marc Marí BSC
|
||||
Jonathan L Peyton Intel
|
||||
Piotr Luc Intel
|
||||
Antoine Rougier intern from University of Bordeaux
|
||||
Jeff Squyres Cisco
|
||||
Samuel Thibault University of Bordeaux
|
||||
Jean-Yves VET DDN
|
||||
Benjamin Worpitz
|
||||
Jeff Zhao Zhaoxin
|
||||
|
||||
Affiliaion abbreviations:
|
||||
-------------------------
|
||||
ANL = Argonne National Lab
|
||||
BSC = Barcelona Supercomputing Center
|
||||
Cisco = Cisco Systems, Inc.
|
||||
CNRS = Centre national de la recherche scientifique (France)
|
||||
UWL = University of Wisconsin-La Crosse
|
38
src/3rdparty/hwloc/CMakeLists.txt
vendored
Normal file
38
src/3rdparty/hwloc/CMakeLists.txt
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
cmake_minimum_required (VERSION 2.8)
|
||||
project (hwloc C)
|
||||
|
||||
include_directories(include)
|
||||
include_directories(src)
|
||||
|
||||
add_definitions(/D_CRT_SECURE_NO_WARNINGS)
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT")
|
||||
|
||||
set(HEADERS
|
||||
include/hwloc.h
|
||||
src/static-components.h
|
||||
)
|
||||
|
||||
set(SOURCES
|
||||
src/base64.c
|
||||
src/bind.c
|
||||
src/bitmap.c
|
||||
src/components.c
|
||||
src/diff.c
|
||||
src/distances.c
|
||||
src/misc.c
|
||||
src/pci-common.c
|
||||
src/shmem.c
|
||||
src/topology.c
|
||||
src/topology-noos.c
|
||||
src/topology-synthetic.c
|
||||
src/topology-windows.c
|
||||
src/topology-x86.c
|
||||
src/topology-xml.c
|
||||
src/topology-xml-nolibxml.c
|
||||
src/traversal.c
|
||||
)
|
||||
|
||||
add_library(hwloc STATIC
|
||||
${HEADERS}
|
||||
${SOURCES}
|
||||
)
|
39
src/3rdparty/hwloc/COPYING
vendored
Normal file
39
src/3rdparty/hwloc/COPYING
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
Copyright © 2004-2006 The Trustees of Indiana University and Indiana University Research and Technology Corporation. All rights reserved.
|
||||
Copyright © 2004-2005 The University of Tennessee and The University of Tennessee Research Foundation. All rights reserved.
|
||||
Copyright © 2004-2005 High Performance Computing Center Stuttgart, University of Stuttgart. All rights reserved.
|
||||
Copyright © 2004-2005 The Regents of the University of California. All rights reserved.
|
||||
Copyright © 2009 CNRS
|
||||
Copyright © 2009-2016 Inria. All rights reserved.
|
||||
Copyright © 2009-2015 Université Bordeaux
|
||||
Copyright © 2009-2015 Cisco Systems, Inc. All rights reserved.
|
||||
Copyright © 2009-2012 Oracle and/or its affiliates. All rights reserved.
|
||||
Copyright © 2010 IBM
|
||||
Copyright © 2010 Jirka Hladky
|
||||
Copyright © 2012 Aleksej Saushev, The NetBSD Foundation
|
||||
Copyright © 2012 Blue Brain Project, EPFL. All rights reserved.
|
||||
Copyright © 2013-2014 University of Wisconsin-La Crosse. All rights reserved.
|
||||
Copyright © 2015 Research Organization for Information Science and Technology (RIST). All rights reserved.
|
||||
Copyright © 2015-2016 Intel, Inc. All rights reserved.
|
||||
See COPYING in top-level directory.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. The name of the author may not be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
1599
src/3rdparty/hwloc/NEWS
vendored
Normal file
1599
src/3rdparty/hwloc/NEWS
vendored
Normal file
File diff suppressed because it is too large
Load Diff
85
src/3rdparty/hwloc/README
vendored
Normal file
85
src/3rdparty/hwloc/README
vendored
Normal file
@ -0,0 +1,85 @@
|
||||
Introduction
|
||||
|
||||
The Hardware Locality (hwloc) software project aims at easing the process of
|
||||
discovering hardware resources in parallel architectures. It offers
|
||||
command-line tools and a C API for consulting these resources, their locality,
|
||||
attributes, and interconnection. hwloc primarily aims at helping
|
||||
high-performance computing (HPC) applications, but is also applicable to any
|
||||
project seeking to exploit code and/or data locality on modern computing
|
||||
platforms.
|
||||
|
||||
hwloc is actually made of two subprojects distributed together:
|
||||
|
||||
* The original hwloc project for describing the internals of computing nodes.
|
||||
It is described in details starting at section Hardware Locality (hwloc)
|
||||
Introduction.
|
||||
* The network-oriented companion called netloc (Network Locality), described
|
||||
in details starting with section Network Locality (netloc).
|
||||
|
||||
See also the Related pages tab above for links to other sections.
|
||||
|
||||
Netloc may be disabled, but the original hwloc cannot. Both hwloc and netloc
|
||||
APIs are documented after these sections.
|
||||
|
||||
Installation
|
||||
|
||||
hwloc (http://www.open-mpi.org/projects/hwloc/) is available under the BSD
|
||||
license. It is hosted as a sub-project of the overall Open MPI project (http://
|
||||
www.open-mpi.org/). Note that hwloc does not require any functionality from
|
||||
Open MPI -- it is a wholly separate (and much smaller!) project and code base.
|
||||
It just happens to be hosted as part of the overall Open MPI project.
|
||||
|
||||
Basic Installation
|
||||
|
||||
Installation is the fairly common GNU-based process:
|
||||
|
||||
shell$ ./configure --prefix=...
|
||||
shell$ make
|
||||
shell$ make install
|
||||
|
||||
hwloc- and netloc-specific configure options and requirements are documented in
|
||||
sections hwloc Installation and Netloc Installation respectively.
|
||||
|
||||
Also note that if you install supplemental libraries in non-standard locations,
|
||||
hwloc's configure script may not be able to find them without some help. You
|
||||
may need to specify additional CPPFLAGS, LDFLAGS, or PKG_CONFIG_PATH values on
|
||||
the configure command line.
|
||||
|
||||
For example, if libpciaccess was installed into /opt/pciaccess, hwloc's
|
||||
configure script may not find it be default. Try adding PKG_CONFIG_PATH to the
|
||||
./configure command line, like this:
|
||||
|
||||
./configure PKG_CONFIG_PATH=/opt/pciaccess/lib/pkgconfig ...
|
||||
|
||||
Running the "lstopo" tool is a good way to check as a graphical output whether
|
||||
hwloc properly detected the architecture of your node. Netloc command-line
|
||||
tools can be used to display the network topology interconnecting your nodes.
|
||||
|
||||
Installing from a Git clone
|
||||
|
||||
Additionally, the code can be directly cloned from Git:
|
||||
|
||||
shell$ git clone https://github.com/open-mpi/hwloc.git
|
||||
shell$ cd hwloc
|
||||
shell$ ./autogen.sh
|
||||
|
||||
Note that GNU Autoconf >=2.63, Automake >=1.11 and Libtool >=2.2.6 are required
|
||||
when building from a Git clone.
|
||||
|
||||
Nightly development snapshots are available on the web site, they can be
|
||||
configured and built without any need for Git or GNU Autotools.
|
||||
|
||||
Questions and Bugs
|
||||
|
||||
Bugs should be reported in the tracker (https://github.com/open-mpi/hwloc/
|
||||
issues). Opening a new issue automatically displays lots of hints about how to
|
||||
debug and report issues.
|
||||
|
||||
Questions may be sent to the users or developers mailing lists (http://
|
||||
www.open-mpi.org/community/lists/hwloc.php).
|
||||
|
||||
There is also a #hwloc IRC channel on Freenode (irc.freenode.net).
|
||||
|
||||
|
||||
|
||||
See https://www.open-mpi.org/projects/hwloc/doc/ for more hwloc documentation.
|
47
src/3rdparty/hwloc/VERSION
vendored
Normal file
47
src/3rdparty/hwloc/VERSION
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
# This is the VERSION file for hwloc, describing the precise version
|
||||
# of hwloc in this distribution. The various components of the version
|
||||
# number below are combined to form a single version number string.
|
||||
|
||||
# major, minor, and release are generally combined in the form
|
||||
# <major>.<minor>.<release>. If release is zero, then it is omitted.
|
||||
|
||||
# Please update HWLOC_VERSION* in contrib/windows/hwloc_config.h too.
|
||||
|
||||
major=2
|
||||
minor=0
|
||||
release=4
|
||||
|
||||
# greek is used for alpha or beta release tags. If it is non-empty,
|
||||
# it will be appended to the version number. It does not have to be
|
||||
# numeric. Common examples include a1 (alpha release 1), b1 (beta
|
||||
# release 1), sc2005 (Super Computing 2005 release). The only
|
||||
# requirement is that it must be entirely printable ASCII characters
|
||||
# and have no white space.
|
||||
|
||||
greek=
|
||||
|
||||
# The date when this release was created
|
||||
|
||||
date="Jun 03, 2019"
|
||||
|
||||
# If snapshot=1, then use the value from snapshot_version as the
|
||||
# entire hwloc version (i.e., ignore major, minor, release, and
|
||||
# greek). This is only set to 1 when making snapshot tarballs.
|
||||
snapshot=0
|
||||
snapshot_version=${major}.${minor}.${release}${greek}-git
|
||||
|
||||
# The shared library version of hwloc's public library. This version
|
||||
# is maintained in accordance with the "Library Interface Versions"
|
||||
# chapter from the GNU Libtool documentation. Notes:
|
||||
|
||||
# 1. Since version numbers are associated with *releases*, the version
|
||||
# number maintained on the hwloc git master (and developer branches)
|
||||
# is always 0:0:0.
|
||||
|
||||
# 2. Version numbers are described in the Libtool current:revision:age
|
||||
# format.
|
||||
|
||||
libhwloc_so_version=15:3:0
|
||||
libnetloc_so_version=0:0:0
|
||||
|
||||
# Please also update the <TargetName> lines in contrib/windows/libhwloc.vcxproj
|
2270
src/3rdparty/hwloc/include/hwloc.h
vendored
Normal file
2270
src/3rdparty/hwloc/include/hwloc.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
59
src/3rdparty/hwloc/include/hwloc/autogen/config.h
vendored
Normal file
59
src/3rdparty/hwloc/include/hwloc/autogen/config.h
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright © 2009 CNRS
|
||||
* Copyright © 2009-2018 Inria. All rights reserved.
|
||||
* Copyright © 2009-2012 Université Bordeaux
|
||||
* Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved.
|
||||
* See COPYING in top-level directory.
|
||||
*/
|
||||
|
||||
/* The configuration file */
|
||||
|
||||
#ifndef HWLOC_CONFIG_H
|
||||
#define HWLOC_CONFIG_H
|
||||
|
||||
#define HWLOC_VERSION "2.0.4"
|
||||
#define HWLOC_VERSION_MAJOR 2
|
||||
#define HWLOC_VERSION_MINOR 0
|
||||
#define HWLOC_VERSION_RELEASE 4
|
||||
#define HWLOC_VERSION_GREEK ""
|
||||
|
||||
#define __hwloc_restrict
|
||||
#define __hwloc_inline __inline
|
||||
|
||||
#define __hwloc_attribute_unused
|
||||
#define __hwloc_attribute_malloc
|
||||
#define __hwloc_attribute_const
|
||||
#define __hwloc_attribute_pure
|
||||
#define __hwloc_attribute_deprecated
|
||||
#define __hwloc_attribute_may_alias
|
||||
#define __hwloc_attribute_warn_unused_result
|
||||
|
||||
/* Defined to 1 if you have the `windows.h' header. */
|
||||
#define HWLOC_HAVE_WINDOWS_H 1
|
||||
#define hwloc_pid_t HANDLE
|
||||
#define hwloc_thread_t HANDLE
|
||||
|
||||
#include <windows.h>
|
||||
#include <BaseTsd.h>
|
||||
typedef DWORDLONG hwloc_uint64_t;
|
||||
|
||||
#if defined( _USRDLL ) /* dynamic linkage */
|
||||
#if defined( DECLSPEC_EXPORTS )
|
||||
#define HWLOC_DECLSPEC __declspec(dllexport)
|
||||
#else
|
||||
#define HWLOC_DECLSPEC __declspec(dllimport)
|
||||
#endif
|
||||
#else /* static linkage */
|
||||
#define HWLOC_DECLSPEC
|
||||
#endif
|
||||
|
||||
/* Whether we need to re-define all the hwloc public symbols or not */
|
||||
#define HWLOC_SYM_TRANSFORM 0
|
||||
|
||||
/* The hwloc symbol prefix */
|
||||
#define HWLOC_SYM_PREFIX hwloc_
|
||||
|
||||
/* The hwloc symbol prefix in all caps */
|
||||
#define HWLOC_SYM_PREFIX_CAPS HWLOC_
|
||||
|
||||
#endif /* HWLOC_CONFIG_H */
|
467
src/3rdparty/hwloc/include/hwloc/bitmap.h
vendored
Normal file
467
src/3rdparty/hwloc/include/hwloc/bitmap.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
220
src/3rdparty/hwloc/include/hwloc/cuda.h
vendored
Normal file
220
src/3rdparty/hwloc/include/hwloc/cuda.h
vendored
Normal file
@ -0,0 +1,220 @@
|
||||
/*
|
||||
* Copyright © 2010-2017 Inria. All rights reserved.
|
||||
* Copyright © 2010-2011 Université Bordeaux
|
||||
* Copyright © 2011 Cisco Systems, Inc. All rights reserved.
|
||||
* See COPYING in top-level directory.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
* \brief Macros to help interaction between hwloc and the CUDA Driver API.
|
||||
*
|
||||
* Applications that use both hwloc and the CUDA Driver API may want to
|
||||
* include this file so as to get topology information for CUDA devices.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HWLOC_CUDA_H
|
||||
#define HWLOC_CUDA_H
|
||||
|
||||
#include <hwloc.h>
|
||||
#include <hwloc/autogen/config.h>
|
||||
#include <hwloc/helper.h>
|
||||
#ifdef HWLOC_LINUX_SYS
|
||||
#include <hwloc/linux.h>
|
||||
#endif
|
||||
|
||||
#include <cuda.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/** \defgroup hwlocality_cuda Interoperability with the CUDA Driver API
|
||||
*
|
||||
* This interface offers ways to retrieve topology information about
|
||||
* CUDA devices when using the CUDA Driver API.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** \brief Return the domain, bus and device IDs of the CUDA device \p cudevice.
|
||||
*
|
||||
* Device \p cudevice must match the local machine.
|
||||
*/
|
||||
static __hwloc_inline int
|
||||
hwloc_cuda_get_device_pci_ids(hwloc_topology_t topology __hwloc_attribute_unused,
|
||||
CUdevice cudevice, int *domain, int *bus, int *dev)
|
||||
{
|
||||
CUresult cres;
|
||||
|
||||
#if CUDA_VERSION >= 4000
|
||||
cres = cuDeviceGetAttribute(domain, CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID, cudevice);
|
||||
if (cres != CUDA_SUCCESS) {
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
#else
|
||||
*domain = 0;
|
||||
#endif
|
||||
cres = cuDeviceGetAttribute(bus, CU_DEVICE_ATTRIBUTE_PCI_BUS_ID, cudevice);
|
||||
if (cres != CUDA_SUCCESS) {
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
cres = cuDeviceGetAttribute(dev, CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID, cudevice);
|
||||
if (cres != CUDA_SUCCESS) {
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** \brief Get the CPU set of logical processors that are physically
|
||||
* close to device \p cudevice.
|
||||
*
|
||||
* Return the CPU set describing the locality of the CUDA device \p cudevice.
|
||||
*
|
||||
* Topology \p topology and device \p cudevice must match the local machine.
|
||||
* I/O devices detection and the CUDA component are not needed in the topology.
|
||||
*
|
||||
* The function only returns the locality of the device.
|
||||
* If more information about the device is needed, OS objects should
|
||||
* be used instead, see hwloc_cuda_get_device_osdev()
|
||||
* and hwloc_cuda_get_device_osdev_by_index().
|
||||
*
|
||||
* This function is currently only implemented in a meaningful way for
|
||||
* Linux; other systems will simply get a full cpuset.
|
||||
*/
|
||||
static __hwloc_inline int
|
||||
hwloc_cuda_get_device_cpuset(hwloc_topology_t topology __hwloc_attribute_unused,
|
||||
CUdevice cudevice, hwloc_cpuset_t set)
|
||||
{
|
||||
#ifdef HWLOC_LINUX_SYS
|
||||
/* If we're on Linux, use the sysfs mechanism to get the local cpus */
|
||||
#define HWLOC_CUDA_DEVICE_SYSFS_PATH_MAX 128
|
||||
char path[HWLOC_CUDA_DEVICE_SYSFS_PATH_MAX];
|
||||
int domainid, busid, deviceid;
|
||||
|
||||
if (hwloc_cuda_get_device_pci_ids(topology, cudevice, &domainid, &busid, &deviceid))
|
||||
return -1;
|
||||
|
||||
if (!hwloc_topology_is_thissystem(topology)) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
sprintf(path, "/sys/bus/pci/devices/%04x:%02x:%02x.0/local_cpus", domainid, busid, deviceid);
|
||||
if (hwloc_linux_read_path_as_cpumask(path, set) < 0
|
||||
|| hwloc_bitmap_iszero(set))
|
||||
hwloc_bitmap_copy(set, hwloc_topology_get_complete_cpuset(topology));
|
||||
#else
|
||||
/* Non-Linux systems simply get a full cpuset */
|
||||
hwloc_bitmap_copy(set, hwloc_topology_get_complete_cpuset(topology));
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** \brief Get the hwloc PCI device object corresponding to the
|
||||
* CUDA device \p cudevice.
|
||||
*
|
||||
* Return the PCI device object describing the CUDA device \p cudevice.
|
||||
* Return NULL if there is none.
|
||||
*
|
||||
* Topology \p topology and device \p cudevice must match the local machine.
|
||||
* I/O devices detection must be enabled in topology \p topology.
|
||||
* The CUDA component is not needed in the topology.
|
||||
*/
|
||||
static __hwloc_inline hwloc_obj_t
|
||||
hwloc_cuda_get_device_pcidev(hwloc_topology_t topology, CUdevice cudevice)
|
||||
{
|
||||
int domain, bus, dev;
|
||||
|
||||
if (hwloc_cuda_get_device_pci_ids(topology, cudevice, &domain, &bus, &dev))
|
||||
return NULL;
|
||||
|
||||
return hwloc_get_pcidev_by_busid(topology, domain, bus, dev, 0);
|
||||
}
|
||||
|
||||
/** \brief Get the hwloc OS device object corresponding to CUDA device \p cudevice.
|
||||
*
|
||||
* Return the hwloc OS device object that describes the given
|
||||
* CUDA device \p cudevice. Return NULL if there is none.
|
||||
*
|
||||
* Topology \p topology and device \p cudevice must match the local machine.
|
||||
* I/O devices detection and the CUDA component must be enabled in the topology.
|
||||
* If not, the locality of the object may still be found using
|
||||
* hwloc_cuda_get_device_cpuset().
|
||||
*
|
||||
* \note This function cannot work if PCI devices are filtered out.
|
||||
*
|
||||
* \note The corresponding hwloc PCI device may be found by looking
|
||||
* at the result parent pointer (unless PCI devices are filtered out).
|
||||
*/
|
||||
static __hwloc_inline hwloc_obj_t
|
||||
hwloc_cuda_get_device_osdev(hwloc_topology_t topology, CUdevice cudevice)
|
||||
{
|
||||
hwloc_obj_t osdev = NULL;
|
||||
int domain, bus, dev;
|
||||
|
||||
if (hwloc_cuda_get_device_pci_ids(topology, cudevice, &domain, &bus, &dev))
|
||||
return NULL;
|
||||
|
||||
osdev = NULL;
|
||||
while ((osdev = hwloc_get_next_osdev(topology, osdev)) != NULL) {
|
||||
hwloc_obj_t pcidev = osdev->parent;
|
||||
if (strncmp(osdev->name, "cuda", 4))
|
||||
continue;
|
||||
if (pcidev
|
||||
&& pcidev->type == HWLOC_OBJ_PCI_DEVICE
|
||||
&& (int) pcidev->attr->pcidev.domain == domain
|
||||
&& (int) pcidev->attr->pcidev.bus == bus
|
||||
&& (int) pcidev->attr->pcidev.dev == dev
|
||||
&& pcidev->attr->pcidev.func == 0)
|
||||
return osdev;
|
||||
/* if PCI are filtered out, we need a info attr to match on */
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/** \brief Get the hwloc OS device object corresponding to the
|
||||
* CUDA device whose index is \p idx.
|
||||
*
|
||||
* Return the OS device object describing the CUDA device whose
|
||||
* index is \p idx. Return NULL if there is none.
|
||||
*
|
||||
* The topology \p topology does not necessarily have to match the current
|
||||
* machine. For instance the topology may be an XML import of a remote host.
|
||||
* I/O devices detection and the CUDA component must be enabled in the topology.
|
||||
*
|
||||
* \note The corresponding PCI device object can be obtained by looking
|
||||
* at the OS device parent object (unless PCI devices are filtered out).
|
||||
*
|
||||
* \note This function is identical to hwloc_cudart_get_device_osdev_by_index().
|
||||
*/
|
||||
static __hwloc_inline hwloc_obj_t
|
||||
hwloc_cuda_get_device_osdev_by_index(hwloc_topology_t topology, unsigned idx)
|
||||
{
|
||||
hwloc_obj_t osdev = NULL;
|
||||
while ((osdev = hwloc_get_next_osdev(topology, osdev)) != NULL) {
|
||||
if (HWLOC_OBJ_OSDEV_COPROC == osdev->attr->osdev.type
|
||||
&& osdev->name
|
||||
&& !strncmp("cuda", osdev->name, 4)
|
||||
&& atoi(osdev->name + 4) == (int) idx)
|
||||
return osdev;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* HWLOC_CUDA_H */
|
177
src/3rdparty/hwloc/include/hwloc/cudart.h
vendored
Normal file
177
src/3rdparty/hwloc/include/hwloc/cudart.h
vendored
Normal file
@ -0,0 +1,177 @@
|
||||
/*
|
||||
* Copyright © 2010-2017 Inria. All rights reserved.
|
||||
* Copyright © 2010-2011 Université Bordeaux
|
||||
* Copyright © 2011 Cisco Systems, Inc. All rights reserved.
|
||||
* See COPYING in top-level directory.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
* \brief Macros to help interaction between hwloc and the CUDA Runtime API.
|
||||
*
|
||||
* Applications that use both hwloc and the CUDA Runtime API may want to
|
||||
* include this file so as to get topology information for CUDA devices.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HWLOC_CUDART_H
|
||||
#define HWLOC_CUDART_H
|
||||
|
||||
#include <hwloc.h>
|
||||
#include <hwloc/autogen/config.h>
|
||||
#include <hwloc/helper.h>
|
||||
#ifdef HWLOC_LINUX_SYS
|
||||
#include <hwloc/linux.h>
|
||||
#endif
|
||||
|
||||
#include <cuda.h> /* for CUDA_VERSION */
|
||||
#include <cuda_runtime_api.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/** \defgroup hwlocality_cudart Interoperability with the CUDA Runtime API
|
||||
*
|
||||
* This interface offers ways to retrieve topology information about
|
||||
* CUDA devices when using the CUDA Runtime API.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** \brief Return the domain, bus and device IDs of the CUDA device whose index is \p idx.
|
||||
*
|
||||
* Device index \p idx must match the local machine.
|
||||
*/
|
||||
static __hwloc_inline int
|
||||
hwloc_cudart_get_device_pci_ids(hwloc_topology_t topology __hwloc_attribute_unused,
|
||||
int idx, int *domain, int *bus, int *dev)
|
||||
{
|
||||
cudaError_t cerr;
|
||||
struct cudaDeviceProp prop;
|
||||
|
||||
cerr = cudaGetDeviceProperties(&prop, idx);
|
||||
if (cerr) {
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
|
||||
#if CUDA_VERSION >= 4000
|
||||
*domain = prop.pciDomainID;
|
||||
#else
|
||||
*domain = 0;
|
||||
#endif
|
||||
|
||||
*bus = prop.pciBusID;
|
||||
*dev = prop.pciDeviceID;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** \brief Get the CPU set of logical processors that are physically
|
||||
* close to device \p idx.
|
||||
*
|
||||
* Return the CPU set describing the locality of the CUDA device
|
||||
* whose index is \p idx.
|
||||
*
|
||||
* Topology \p topology and device \p idx must match the local machine.
|
||||
* I/O devices detection and the CUDA component are not needed in the topology.
|
||||
*
|
||||
* The function only returns the locality of the device.
|
||||
* If more information about the device is needed, OS objects should
|
||||
* be used instead, see hwloc_cudart_get_device_osdev_by_index().
|
||||
*
|
||||
* This function is currently only implemented in a meaningful way for
|
||||
* Linux; other systems will simply get a full cpuset.
|
||||
*/
|
||||
static __hwloc_inline int
|
||||
hwloc_cudart_get_device_cpuset(hwloc_topology_t topology __hwloc_attribute_unused,
|
||||
int idx, hwloc_cpuset_t set)
|
||||
{
|
||||
#ifdef HWLOC_LINUX_SYS
|
||||
/* If we're on Linux, use the sysfs mechanism to get the local cpus */
|
||||
#define HWLOC_CUDART_DEVICE_SYSFS_PATH_MAX 128
|
||||
char path[HWLOC_CUDART_DEVICE_SYSFS_PATH_MAX];
|
||||
int domain, bus, dev;
|
||||
|
||||
if (hwloc_cudart_get_device_pci_ids(topology, idx, &domain, &bus, &dev))
|
||||
return -1;
|
||||
|
||||
if (!hwloc_topology_is_thissystem(topology)) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
sprintf(path, "/sys/bus/pci/devices/%04x:%02x:%02x.0/local_cpus", (unsigned) domain, (unsigned) bus, (unsigned) dev);
|
||||
if (hwloc_linux_read_path_as_cpumask(path, set) < 0
|
||||
|| hwloc_bitmap_iszero(set))
|
||||
hwloc_bitmap_copy(set, hwloc_topology_get_complete_cpuset(topology));
|
||||
#else
|
||||
/* Non-Linux systems simply get a full cpuset */
|
||||
hwloc_bitmap_copy(set, hwloc_topology_get_complete_cpuset(topology));
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** \brief Get the hwloc PCI device object corresponding to the
|
||||
* CUDA device whose index is \p idx.
|
||||
*
|
||||
* Return the PCI device object describing the CUDA device whose
|
||||
* index is \p idx. Return NULL if there is none.
|
||||
*
|
||||
* Topology \p topology and device \p idx must match the local machine.
|
||||
* I/O devices detection must be enabled in topology \p topology.
|
||||
* The CUDA component is not needed in the topology.
|
||||
*/
|
||||
static __hwloc_inline hwloc_obj_t
|
||||
hwloc_cudart_get_device_pcidev(hwloc_topology_t topology, int idx)
|
||||
{
|
||||
int domain, bus, dev;
|
||||
|
||||
if (hwloc_cudart_get_device_pci_ids(topology, idx, &domain, &bus, &dev))
|
||||
return NULL;
|
||||
|
||||
return hwloc_get_pcidev_by_busid(topology, domain, bus, dev, 0);
|
||||
}
|
||||
|
||||
/** \brief Get the hwloc OS device object corresponding to the
|
||||
* CUDA device whose index is \p idx.
|
||||
*
|
||||
* Return the OS device object describing the CUDA device whose
|
||||
* index is \p idx. Return NULL if there is none.
|
||||
*
|
||||
* The topology \p topology does not necessarily have to match the current
|
||||
* machine. For instance the topology may be an XML import of a remote host.
|
||||
* I/O devices detection and the CUDA component must be enabled in the topology.
|
||||
* If not, the locality of the object may still be found using
|
||||
* hwloc_cudart_get_device_cpuset().
|
||||
*
|
||||
* \note The corresponding PCI device object can be obtained by looking
|
||||
* at the OS device parent object (unless PCI devices are filtered out).
|
||||
*
|
||||
* \note This function is identical to hwloc_cuda_get_device_osdev_by_index().
|
||||
*/
|
||||
static __hwloc_inline hwloc_obj_t
|
||||
hwloc_cudart_get_device_osdev_by_index(hwloc_topology_t topology, unsigned idx)
|
||||
{
|
||||
hwloc_obj_t osdev = NULL;
|
||||
while ((osdev = hwloc_get_next_osdev(topology, osdev)) != NULL) {
|
||||
if (HWLOC_OBJ_OSDEV_COPROC == osdev->attr->osdev.type
|
||||
&& osdev->name
|
||||
&& !strncmp("cuda", osdev->name, 4)
|
||||
&& atoi(osdev->name + 4) == (int) idx)
|
||||
return osdev;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* HWLOC_CUDART_H */
|
206
src/3rdparty/hwloc/include/hwloc/deprecated.h
vendored
Normal file
206
src/3rdparty/hwloc/include/hwloc/deprecated.h
vendored
Normal file
@ -0,0 +1,206 @@
|
||||
/*
|
||||
* Copyright © 2009 CNRS
|
||||
* Copyright © 2009-2017 Inria. All rights reserved.
|
||||
* Copyright © 2009-2012 Université Bordeaux
|
||||
* Copyright © 2009-2010 Cisco Systems, Inc. All rights reserved.
|
||||
* See COPYING in top-level directory.
|
||||
*/
|
||||
|
||||
/**
|
||||
* This file contains the inline code of functions declared in hwloc.h
|
||||
*/
|
||||
|
||||
#ifndef HWLOC_DEPRECATED_H
|
||||
#define HWLOC_DEPRECATED_H
|
||||
|
||||
#ifndef HWLOC_H
|
||||
#error Please include the main hwloc.h instead
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* backward compat with v1.11 before System removal */
|
||||
#define HWLOC_OBJ_SYSTEM HWLOC_OBJ_MACHINE
|
||||
/* backward compat with v1.10 before Socket->Package renaming */
|
||||
#define HWLOC_OBJ_SOCKET HWLOC_OBJ_PACKAGE
|
||||
/* backward compat with v1.10 before Node->NUMANode clarification */
|
||||
#define HWLOC_OBJ_NODE HWLOC_OBJ_NUMANODE
|
||||
|
||||
/** \brief Insert a misc object by parent.
|
||||
*
|
||||
* Identical to hwloc_topology_insert_misc_object().
|
||||
*/
|
||||
static __hwloc_inline hwloc_obj_t
|
||||
hwloc_topology_insert_misc_object_by_parent(hwloc_topology_t topology, hwloc_obj_t parent, const char *name) __hwloc_attribute_deprecated;
|
||||
static __hwloc_inline hwloc_obj_t
|
||||
hwloc_topology_insert_misc_object_by_parent(hwloc_topology_t topology, hwloc_obj_t parent, const char *name)
|
||||
{
|
||||
return hwloc_topology_insert_misc_object(topology, parent, name);
|
||||
}
|
||||
|
||||
/** \brief Stringify the cpuset containing a set of objects.
|
||||
*
|
||||
* If \p size is 0, \p string may safely be \c NULL.
|
||||
*
|
||||
* \return the number of character that were actually written if not truncating,
|
||||
* or that would have been written (not including the ending \\0).
|
||||
*/
|
||||
static __hwloc_inline int
|
||||
hwloc_obj_cpuset_snprintf(char *str, size_t size, size_t nobj, struct hwloc_obj * const *objs) __hwloc_attribute_deprecated;
|
||||
static __hwloc_inline int
|
||||
hwloc_obj_cpuset_snprintf(char *str, size_t size, size_t nobj, struct hwloc_obj * const *objs)
|
||||
{
|
||||
hwloc_bitmap_t set = hwloc_bitmap_alloc();
|
||||
int res;
|
||||
unsigned i;
|
||||
|
||||
hwloc_bitmap_zero(set);
|
||||
for(i=0; i<nobj; i++)
|
||||
if (objs[i]->cpuset)
|
||||
hwloc_bitmap_or(set, set, objs[i]->cpuset);
|
||||
|
||||
res = hwloc_bitmap_snprintf(str, size, set);
|
||||
hwloc_bitmap_free(set);
|
||||
return res;
|
||||
}
|
||||
|
||||
/** \brief Convert a type string into a type and some attributes.
|
||||
*
|
||||
* Deprecated by hwloc_type_sscanf()
|
||||
*/
|
||||
static __hwloc_inline int
|
||||
hwloc_obj_type_sscanf(const char *string, hwloc_obj_type_t *typep, int *depthattrp, void *typeattrp, size_t typeattrsize) __hwloc_attribute_deprecated;
|
||||
static __hwloc_inline int
|
||||
hwloc_obj_type_sscanf(const char *string, hwloc_obj_type_t *typep, int *depthattrp, void *typeattrp, size_t typeattrsize)
|
||||
{
|
||||
union hwloc_obj_attr_u attr;
|
||||
int err = hwloc_type_sscanf(string, typep, &attr, sizeof(attr));
|
||||
if (err < 0)
|
||||
return err;
|
||||
if (hwloc_obj_type_is_cache(*typep)) {
|
||||
if (depthattrp)
|
||||
*depthattrp = (int) attr.cache.depth;
|
||||
if (typeattrp && typeattrsize >= sizeof(hwloc_obj_cache_type_t))
|
||||
memcpy(typeattrp, &attr.cache.type, sizeof(hwloc_obj_cache_type_t));
|
||||
} else if (*typep == HWLOC_OBJ_GROUP) {
|
||||
if (depthattrp)
|
||||
*depthattrp = (int) attr.group.depth;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** \brief Set the default memory binding policy of the current
|
||||
* process or thread to prefer the NUMA node(s) specified by physical \p nodeset
|
||||
*/
|
||||
static __hwloc_inline int
|
||||
hwloc_set_membind_nodeset(hwloc_topology_t topology, hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags) __hwloc_attribute_deprecated;
|
||||
static __hwloc_inline int
|
||||
hwloc_set_membind_nodeset(hwloc_topology_t topology, hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags)
|
||||
{
|
||||
return hwloc_set_membind(topology, nodeset, policy, flags | HWLOC_MEMBIND_BYNODESET);
|
||||
}
|
||||
|
||||
/** \brief Query the default memory binding policy and physical locality of the
|
||||
* current process or thread.
|
||||
*/
|
||||
static __hwloc_inline int
|
||||
hwloc_get_membind_nodeset(hwloc_topology_t topology, hwloc_nodeset_t nodeset, hwloc_membind_policy_t * policy, int flags) __hwloc_attribute_deprecated;
|
||||
static __hwloc_inline int
|
||||
hwloc_get_membind_nodeset(hwloc_topology_t topology, hwloc_nodeset_t nodeset, hwloc_membind_policy_t * policy, int flags)
|
||||
{
|
||||
return hwloc_get_membind(topology, nodeset, policy, flags | HWLOC_MEMBIND_BYNODESET);
|
||||
}
|
||||
|
||||
/** \brief Set the default memory binding policy of the specified
|
||||
* process to prefer the NUMA node(s) specified by physical \p nodeset
|
||||
*/
|
||||
static __hwloc_inline int
|
||||
hwloc_set_proc_membind_nodeset(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags) __hwloc_attribute_deprecated;
|
||||
static __hwloc_inline int
|
||||
hwloc_set_proc_membind_nodeset(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags)
|
||||
{
|
||||
return hwloc_set_proc_membind(topology, pid, nodeset, policy, flags | HWLOC_MEMBIND_BYNODESET);
|
||||
}
|
||||
|
||||
/** \brief Query the default memory binding policy and physical locality of the
|
||||
* specified process.
|
||||
*/
|
||||
static __hwloc_inline int
|
||||
hwloc_get_proc_membind_nodeset(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_nodeset_t nodeset, hwloc_membind_policy_t * policy, int flags) __hwloc_attribute_deprecated;
|
||||
static __hwloc_inline int
|
||||
hwloc_get_proc_membind_nodeset(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_nodeset_t nodeset, hwloc_membind_policy_t * policy, int flags)
|
||||
{
|
||||
return hwloc_get_proc_membind(topology, pid, nodeset, policy, flags | HWLOC_MEMBIND_BYNODESET);
|
||||
}
|
||||
|
||||
/** \brief Bind the already-allocated memory identified by (addr, len)
|
||||
* to the NUMA node(s) in physical \p nodeset.
|
||||
*/
|
||||
static __hwloc_inline int
|
||||
hwloc_set_area_membind_nodeset(hwloc_topology_t topology, const void *addr, size_t len, hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags) __hwloc_attribute_deprecated;
|
||||
static __hwloc_inline int
|
||||
hwloc_set_area_membind_nodeset(hwloc_topology_t topology, const void *addr, size_t len, hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags)
|
||||
{
|
||||
return hwloc_set_area_membind(topology, addr, len, nodeset, policy, flags | HWLOC_MEMBIND_BYNODESET);
|
||||
}
|
||||
|
||||
/** \brief Query the physical NUMA node(s) and binding policy of the memory
|
||||
* identified by (\p addr, \p len ).
|
||||
*/
|
||||
static __hwloc_inline int
|
||||
hwloc_get_area_membind_nodeset(hwloc_topology_t topology, const void *addr, size_t len, hwloc_nodeset_t nodeset, hwloc_membind_policy_t * policy, int flags) __hwloc_attribute_deprecated;
|
||||
static __hwloc_inline int
|
||||
hwloc_get_area_membind_nodeset(hwloc_topology_t topology, const void *addr, size_t len, hwloc_nodeset_t nodeset, hwloc_membind_policy_t * policy, int flags)
|
||||
{
|
||||
return hwloc_get_area_membind(topology, addr, len, nodeset, policy, flags | HWLOC_MEMBIND_BYNODESET);
|
||||
}
|
||||
|
||||
/** \brief Allocate some memory on the given physical nodeset \p nodeset
|
||||
*/
|
||||
static __hwloc_inline void *
|
||||
hwloc_alloc_membind_nodeset(hwloc_topology_t topology, size_t len, hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags) __hwloc_attribute_malloc __hwloc_attribute_deprecated;
|
||||
static __hwloc_inline void *
|
||||
hwloc_alloc_membind_nodeset(hwloc_topology_t topology, size_t len, hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags)
|
||||
{
|
||||
return hwloc_alloc_membind(topology, len, nodeset, policy, flags | HWLOC_MEMBIND_BYNODESET);
|
||||
}
|
||||
|
||||
/** \brief Allocate some memory on the given nodeset \p nodeset.
|
||||
*/
|
||||
static __hwloc_inline void *
|
||||
hwloc_alloc_membind_policy_nodeset(hwloc_topology_t topology, size_t len, hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags) __hwloc_attribute_malloc __hwloc_attribute_deprecated;
|
||||
static __hwloc_inline void *
|
||||
hwloc_alloc_membind_policy_nodeset(hwloc_topology_t topology, size_t len, hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags)
|
||||
{
|
||||
return hwloc_alloc_membind_policy(topology, len, nodeset, policy, flags | HWLOC_MEMBIND_BYNODESET);
|
||||
}
|
||||
|
||||
/** \brief Convert a CPU set into a NUMA node set and handle non-NUMA cases
|
||||
*/
|
||||
static __hwloc_inline void
|
||||
hwloc_cpuset_to_nodeset_strict(hwloc_topology_t topology, hwloc_const_cpuset_t _cpuset, hwloc_nodeset_t nodeset) __hwloc_attribute_deprecated;
|
||||
static __hwloc_inline void
|
||||
hwloc_cpuset_to_nodeset_strict(hwloc_topology_t topology, hwloc_const_cpuset_t _cpuset, hwloc_nodeset_t nodeset)
|
||||
{
|
||||
hwloc_cpuset_to_nodeset(topology, _cpuset, nodeset);
|
||||
}
|
||||
|
||||
/** \brief Convert a NUMA node set into a CPU set and handle non-NUMA cases
|
||||
*/
|
||||
static __hwloc_inline void
|
||||
hwloc_cpuset_from_nodeset_strict(hwloc_topology_t topology, hwloc_cpuset_t _cpuset, hwloc_const_nodeset_t nodeset) __hwloc_attribute_deprecated;
|
||||
static __hwloc_inline void
|
||||
hwloc_cpuset_from_nodeset_strict(hwloc_topology_t topology, hwloc_cpuset_t _cpuset, hwloc_const_nodeset_t nodeset)
|
||||
{
|
||||
hwloc_cpuset_from_nodeset(topology, _cpuset, nodeset);
|
||||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* HWLOC_DEPRECATED_H */
|
289
src/3rdparty/hwloc/include/hwloc/diff.h
vendored
Normal file
289
src/3rdparty/hwloc/include/hwloc/diff.h
vendored
Normal file
@ -0,0 +1,289 @@
|
||||
/*
|
||||
* Copyright © 2013-2018 Inria. All rights reserved.
|
||||
* See COPYING in top-level directory.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
* \brief Topology differences.
|
||||
*/
|
||||
|
||||
#ifndef HWLOC_DIFF_H
|
||||
#define HWLOC_DIFF_H
|
||||
|
||||
#ifndef HWLOC_H
|
||||
#error Please include the main hwloc.h instead
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#elif 0
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/** \defgroup hwlocality_diff Topology differences
|
||||
*
|
||||
* Applications that manipulate many similar topologies, for instance
|
||||
* one for each node of a homogeneous cluster, may want to compress
|
||||
* topologies to reduce the memory footprint.
|
||||
*
|
||||
* This file offers a way to manipulate the difference between topologies
|
||||
* and export/import it to/from XML.
|
||||
* Compression may therefore be achieved by storing one topology
|
||||
* entirely while the others are only described by their differences
|
||||
* with the former.
|
||||
* The actual topology can be reconstructed when actually needed by
|
||||
* applying the precomputed difference to the reference topology.
|
||||
*
|
||||
* This interface targets very similar nodes.
|
||||
* Only very simple differences between topologies are actually
|
||||
* supported, for instance a change in the memory size, the name
|
||||
* of the object, or some info attribute.
|
||||
* More complex differences such as adding or removing objects cannot
|
||||
* be represented in the difference structures and therefore return
|
||||
* errors.
|
||||
* Differences between object sets or topology-wide allowed sets,
|
||||
* cannot be represented either.
|
||||
*
|
||||
* It means that there is no need to apply the difference when
|
||||
* looking at the tree organization (how many levels, how many
|
||||
* objects per level, what kind of objects, CPU and node sets, etc)
|
||||
* and when binding to objects.
|
||||
* However the difference must be applied when looking at object
|
||||
* attributes such as the name, the memory size or info attributes.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/** \brief Type of one object attribute difference.
|
||||
*/
|
||||
typedef enum hwloc_topology_diff_obj_attr_type_e {
|
||||
/** \brief The object local memory is modified.
|
||||
* The union is a hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s
|
||||
* (and the index field is ignored).
|
||||
*/
|
||||
HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_SIZE,
|
||||
|
||||
/** \brief The object name is modified.
|
||||
* The union is a hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s
|
||||
* (and the name field is ignored).
|
||||
*/
|
||||
|
||||
HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_NAME,
|
||||
/** \brief the value of an info attribute is modified.
|
||||
* The union is a hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s.
|
||||
*/
|
||||
HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_INFO
|
||||
} hwloc_topology_diff_obj_attr_type_t;
|
||||
|
||||
/** \brief One object attribute difference.
|
||||
*/
|
||||
union hwloc_topology_diff_obj_attr_u {
|
||||
struct hwloc_topology_diff_obj_attr_generic_s {
|
||||
/* each part of the union must start with these */
|
||||
hwloc_topology_diff_obj_attr_type_t type;
|
||||
} generic;
|
||||
|
||||
/** \brief Integer attribute modification with an optional index. */
|
||||
struct hwloc_topology_diff_obj_attr_uint64_s {
|
||||
/* used for storing integer attributes */
|
||||
hwloc_topology_diff_obj_attr_type_t type;
|
||||
hwloc_uint64_t index; /* not used for SIZE */
|
||||
hwloc_uint64_t oldvalue;
|
||||
hwloc_uint64_t newvalue;
|
||||
} uint64;
|
||||
|
||||
/** \brief String attribute modification with an optional name */
|
||||
struct hwloc_topology_diff_obj_attr_string_s {
|
||||
/* used for storing name and info pairs */
|
||||
hwloc_topology_diff_obj_attr_type_t type;
|
||||
char *name; /* not used for NAME */
|
||||
char *oldvalue;
|
||||
char *newvalue;
|
||||
} string;
|
||||
};
|
||||
|
||||
|
||||
/** \brief Type of one element of a difference list.
|
||||
*/
|
||||
typedef enum hwloc_topology_diff_type_e {
|
||||
/** \brief An object attribute was changed.
|
||||
* The union is a hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_s.
|
||||
*/
|
||||
HWLOC_TOPOLOGY_DIFF_OBJ_ATTR,
|
||||
|
||||
/** \brief The difference is too complex,
|
||||
* it cannot be represented. The difference below
|
||||
* this object has not been checked.
|
||||
* hwloc_topology_diff_build() will return 1.
|
||||
*
|
||||
* The union is a hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_too_complex_s.
|
||||
*/
|
||||
HWLOC_TOPOLOGY_DIFF_TOO_COMPLEX
|
||||
} hwloc_topology_diff_type_t;
|
||||
|
||||
/** \brief One element of a difference list between two topologies.
|
||||
*/
|
||||
typedef union hwloc_topology_diff_u {
|
||||
struct hwloc_topology_diff_generic_s {
|
||||
/* each part of the union must start with these */
|
||||
hwloc_topology_diff_type_t type;
|
||||
union hwloc_topology_diff_u * next; /* pointer to the next element of the list, or NULL */
|
||||
} generic;
|
||||
|
||||
/* A difference in an object attribute. */
|
||||
struct hwloc_topology_diff_obj_attr_s {
|
||||
hwloc_topology_diff_type_t type; /* must be ::HWLOC_TOPOLOGY_DIFF_OBJ_ATTR */
|
||||
union hwloc_topology_diff_u * next;
|
||||
/* List of attribute differences for a single object */
|
||||
int obj_depth;
|
||||
unsigned obj_index;
|
||||
union hwloc_topology_diff_obj_attr_u diff;
|
||||
} obj_attr;
|
||||
|
||||
/* A difference that is too complex. */
|
||||
struct hwloc_topology_diff_too_complex_s {
|
||||
hwloc_topology_diff_type_t type; /* must be ::HWLOC_TOPOLOGY_DIFF_TOO_COMPLEX */
|
||||
union hwloc_topology_diff_u * next;
|
||||
/* Where we had to stop computing the diff in the first topology */
|
||||
int obj_depth;
|
||||
unsigned obj_index;
|
||||
} too_complex;
|
||||
} * hwloc_topology_diff_t;
|
||||
|
||||
|
||||
/** \brief Compute the difference between 2 topologies.
|
||||
*
|
||||
* The difference is stored as a list of ::hwloc_topology_diff_t entries
|
||||
* starting at \p diff.
|
||||
* It is computed by doing a depth-first traversal of both topology trees
|
||||
* simultaneously.
|
||||
*
|
||||
* If the difference between 2 objects is too complex to be represented
|
||||
* (for instance if some objects have different types, or different numbers
|
||||
* of children), a special diff entry of type ::HWLOC_TOPOLOGY_DIFF_TOO_COMPLEX
|
||||
* is queued.
|
||||
* The computation of the diff does not continue below these objects.
|
||||
* So each such diff entry means that the difference between two subtrees
|
||||
* could not be computed.
|
||||
*
|
||||
* \return 0 if the difference can be represented properly.
|
||||
*
|
||||
* \return 0 with \p diff pointing to NULL if there is no difference
|
||||
* between the topologies.
|
||||
*
|
||||
* \return 1 if the difference is too complex (see above). Some entries in
|
||||
* the list will be of type ::HWLOC_TOPOLOGY_DIFF_TOO_COMPLEX.
|
||||
*
|
||||
* \return -1 on any other error.
|
||||
*
|
||||
* \note \p flags is currently not used. It should be 0.
|
||||
*
|
||||
* \note The output diff has to be freed with hwloc_topology_diff_destroy().
|
||||
*
|
||||
* \note The output diff can only be exported to XML or passed to
|
||||
* hwloc_topology_diff_apply() if 0 was returned, i.e. if no entry of type
|
||||
* ::HWLOC_TOPOLOGY_DIFF_TOO_COMPLEX is listed.
|
||||
*
|
||||
* \note The output diff may be modified by removing some entries from
|
||||
* the list. The removed entries should be freed by passing them to
|
||||
* to hwloc_topology_diff_destroy() (possible as another list).
|
||||
*/
|
||||
HWLOC_DECLSPEC int hwloc_topology_diff_build(hwloc_topology_t topology, hwloc_topology_t newtopology, unsigned long flags, hwloc_topology_diff_t *diff);
|
||||
|
||||
/** \brief Flags to be given to hwloc_topology_diff_apply().
|
||||
*/
|
||||
enum hwloc_topology_diff_apply_flags_e {
|
||||
/** \brief Apply topology diff in reverse direction.
|
||||
* \hideinitializer
|
||||
*/
|
||||
HWLOC_TOPOLOGY_DIFF_APPLY_REVERSE = (1UL<<0)
|
||||
};
|
||||
|
||||
/** \brief Apply a topology diff to an existing topology.
|
||||
*
|
||||
* \p flags is an OR'ed set of ::hwloc_topology_diff_apply_flags_e.
|
||||
*
|
||||
* The new topology is modified in place. hwloc_topology_dup()
|
||||
* may be used to duplicate it before patching.
|
||||
*
|
||||
* If the difference cannot be applied entirely, all previous applied
|
||||
* elements are unapplied before returning.
|
||||
*
|
||||
* \return 0 on success.
|
||||
*
|
||||
* \return -N if applying the difference failed while trying
|
||||
* to apply the N-th part of the difference. For instance -1
|
||||
* is returned if the very first difference element could not
|
||||
* be applied.
|
||||
*/
|
||||
HWLOC_DECLSPEC int hwloc_topology_diff_apply(hwloc_topology_t topology, hwloc_topology_diff_t diff, unsigned long flags);
|
||||
|
||||
/** \brief Destroy a list of topology differences.
|
||||
*/
|
||||
HWLOC_DECLSPEC int hwloc_topology_diff_destroy(hwloc_topology_diff_t diff);
|
||||
|
||||
/** \brief Load a list of topology differences from a XML file.
|
||||
*
|
||||
* If not \c NULL, \p refname will be filled with the identifier
|
||||
* string of the reference topology for the difference file,
|
||||
* if any was specified in the XML file.
|
||||
* This identifier is usually the name of the other XML file
|
||||
* that contains the reference topology.
|
||||
*
|
||||
* \note the pointer returned in refname should later be freed
|
||||
* by the caller.
|
||||
*/
|
||||
HWLOC_DECLSPEC int hwloc_topology_diff_load_xml(const char *xmlpath, hwloc_topology_diff_t *diff, char **refname);
|
||||
|
||||
/** \brief Export a list of topology differences to a XML file.
|
||||
*
|
||||
* If not \c NULL, \p refname defines an identifier string
|
||||
* for the reference topology which was used as a base when
|
||||
* computing this difference.
|
||||
* This identifier is usually the name of the other XML file
|
||||
* that contains the reference topology.
|
||||
* This attribute is given back when reading the diff from XML.
|
||||
*/
|
||||
HWLOC_DECLSPEC int hwloc_topology_diff_export_xml(hwloc_topology_diff_t diff, const char *refname, const char *xmlpath);
|
||||
|
||||
/** \brief Load a list of topology differences from a XML buffer.
|
||||
*
|
||||
* If not \c NULL, \p refname will be filled with the identifier
|
||||
* string of the reference topology for the difference file,
|
||||
* if any was specified in the XML file.
|
||||
* This identifier is usually the name of the other XML file
|
||||
* that contains the reference topology.
|
||||
*
|
||||
* \note the pointer returned in refname should later be freed
|
||||
* by the caller.
|
||||
*/
|
||||
HWLOC_DECLSPEC int hwloc_topology_diff_load_xmlbuffer(const char *xmlbuffer, int buflen, hwloc_topology_diff_t *diff, char **refname);
|
||||
|
||||
/** \brief Export a list of topology differences to a XML buffer.
|
||||
*
|
||||
* If not \c NULL, \p refname defines an identifier string
|
||||
* for the reference topology which was used as a base when
|
||||
* computing this difference.
|
||||
* This identifier is usually the name of the other XML file
|
||||
* that contains the reference topology.
|
||||
* This attribute is given back when reading the diff from XML.
|
||||
*
|
||||
* The returned buffer ends with a \0 that is included in the returned
|
||||
* length.
|
||||
*
|
||||
* \note The XML buffer should later be freed with hwloc_free_xmlbuffer().
|
||||
*/
|
||||
HWLOC_DECLSPEC int hwloc_topology_diff_export_xmlbuffer(hwloc_topology_diff_t diff, const char *refname, char **xmlbuffer, int *buflen);
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* HWLOC_DIFF_H */
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user