Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
azure-cloud-mining-script
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Recolic
azure-cloud-mining-script
Commits
8bbdd45b
There was an error fetching the commit references. Please try again later.
Commit
8bbdd45b
authored
7 years ago
by
fireice-uk
Browse files
Options
Downloads
Patches
Plain Diff
Affinity - fix C
parent
73482f30
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
xmrstak/backend/cpu/minethd.cpp
+6
-3
6 additions, 3 deletions
xmrstak/backend/cpu/minethd.cpp
xmrstak/backend/cpu/minethd.hpp
+2
-2
2 additions, 2 deletions
xmrstak/backend/cpu/minethd.hpp
with
8 additions
and
5 deletions
xmrstak/backend/cpu/minethd.cpp
+
6
−
3
View file @
8bbdd45b
...
@@ -101,12 +101,15 @@ minethd::minethd(miner_work& pWork, size_t iNo, bool double_work, bool no_prefet
...
@@ -101,12 +101,15 @@ minethd::minethd(miner_work& pWork, size_t iNo, bool double_work, bool no_prefet
bNoPrefetch
=
no_prefetch
;
bNoPrefetch
=
no_prefetch
;
this
->
affinity
=
affinity
;
this
->
affinity
=
affinity
;
std
::
lock_guard
<
std
::
mutex
>
lock
(
work_thd_mtx
);
std
::
future
<
void
>
order_guard
=
order_fix
.
get_future
();
if
(
double_work
)
if
(
double_work
)
oWorkThd
=
std
::
thread
(
&
minethd
::
double_work_main
,
this
);
oWorkThd
=
std
::
thread
(
&
minethd
::
double_work_main
,
this
);
else
else
oWorkThd
=
std
::
thread
(
&
minethd
::
work_main
,
this
);
oWorkThd
=
std
::
thread
(
&
minethd
::
work_main
,
this
);
order_guard
.
wait
();
if
(
!
thd_setaffinity
(
oWorkThd
.
native_handle
(),
affinity
))
if
(
!
thd_setaffinity
(
oWorkThd
.
native_handle
(),
affinity
))
printer
::
inst
()
->
print_msg
(
L1
,
"WARNING setting affinity failed."
);
printer
::
inst
()
->
print_msg
(
L1
,
"WARNING setting affinity failed."
);
}
}
...
@@ -305,8 +308,6 @@ minethd::cn_hash_fun minethd::func_selector(bool bHaveAes, bool bNoPrefetch)
...
@@ -305,8 +308,6 @@ minethd::cn_hash_fun minethd::func_selector(bool bHaveAes, bool bNoPrefetch)
void
minethd
::
pin_thd_affinity
()
void
minethd
::
pin_thd_affinity
()
{
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
work_thd_mtx
);
// pin memory to NUMA node
// pin memory to NUMA node
bindMemoryToNUMANode
(
affinity
);
bindMemoryToNUMANode
(
affinity
);
}
}
...
@@ -316,6 +317,8 @@ void minethd::work_main()
...
@@ -316,6 +317,8 @@ void minethd::work_main()
if
(
affinity
>=
0
)
//-1 means no affinity
if
(
affinity
>=
0
)
//-1 means no affinity
pin_thd_affinity
();
pin_thd_affinity
();
order_fix
.
set_value
();
cn_hash_fun
hash_fun
;
cn_hash_fun
hash_fun
;
cryptonight_ctx
*
ctx
;
cryptonight_ctx
*
ctx
;
uint64_t
iCount
=
0
;
uint64_t
iCount
=
0
;
...
...
This diff is collapsed.
Click to expand it.
xmrstak/backend/cpu/minethd.hpp
+
2
−
2
View file @
8bbdd45b
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
#include
<thread>
#include
<thread>
#include
<vector>
#include
<vector>
#include
<atomic>
#include
<atomic>
#include
<
m
ute
x
>
#include
<
f
ut
ur
e>
namespace
xmrstak
namespace
xmrstak
{
{
...
@@ -46,7 +46,7 @@ private:
...
@@ -46,7 +46,7 @@ private:
miner_work
oWork
;
miner_work
oWork
;
void
pin_thd_affinity
();
void
pin_thd_affinity
();
std
::
mutex
work_thd_mt
x
;
std
::
promise
<
void
>
order_fi
x
;
std
::
thread
oWorkThd
;
std
::
thread
oWorkThd
;
int64_t
affinity
;
int64_t
affinity
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment