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
73482f30
There was an error fetching the commit references. Please try again later.
Commit
73482f30
authored
7 years ago
by
fireice-uk
Browse files
Options
Downloads
Patches
Plain Diff
Affinity - fix B
parent
329a6d9a
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
+9
-7
9 additions, 7 deletions
xmrstak/backend/cpu/minethd.cpp
xmrstak/backend/cpu/minethd.hpp
+0
-1
0 additions, 1 deletion
xmrstak/backend/cpu/minethd.hpp
with
9 additions
and
8 deletions
xmrstak/backend/cpu/minethd.cpp
+
9
−
7
View file @
73482f30
...
@@ -106,6 +106,9 @@ minethd::minethd(miner_work& pWork, size_t iNo, bool double_work, bool no_prefet
...
@@ -106,6 +106,9 @@ minethd::minethd(miner_work& pWork, size_t iNo, bool double_work, bool no_prefet
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
);
if
(
!
thd_setaffinity
(
oWorkThd
.
native_handle
(),
affinity
))
printer
::
inst
()
->
print_msg
(
L1
,
"WARNING setting affinity failed."
);
}
}
cryptonight_ctx
*
minethd
::
minethd_alloc_ctx
()
cryptonight_ctx
*
minethd
::
minethd_alloc_ctx
()
...
@@ -258,7 +261,13 @@ std::vector<iBackend*> minethd::thread_starter(uint32_t threadOffset, miner_work
...
@@ -258,7 +261,13 @@ std::vector<iBackend*> minethd::thread_starter(uint32_t threadOffset, miner_work
pvThreads
.
push_back
(
thd
);
pvThreads
.
push_back
(
thd
);
if
(
cfg
.
iCpuAff
>=
0
)
if
(
cfg
.
iCpuAff
>=
0
)
{
#if defined(__APPLE__)
printer
::
inst
()
->
print_msg
(
L1
,
"WARNING on MacOS thread affinity is only advisory."
);
#endif
printer
::
inst
()
->
print_msg
(
L1
,
"Starting %s thread, affinity: %d."
,
cfg
.
bDoubleMode
?
"double"
:
"single"
,
(
int
)
cfg
.
iCpuAff
);
printer
::
inst
()
->
print_msg
(
L1
,
"Starting %s thread, affinity: %d."
,
cfg
.
bDoubleMode
?
"double"
:
"single"
,
(
int
)
cfg
.
iCpuAff
);
}
else
else
printer
::
inst
()
->
print_msg
(
L1
,
"Starting %s thread, no affinity."
,
cfg
.
bDoubleMode
?
"double"
:
"single"
);
printer
::
inst
()
->
print_msg
(
L1
,
"Starting %s thread, no affinity."
,
cfg
.
bDoubleMode
?
"double"
:
"single"
);
}
}
...
@@ -296,15 +305,8 @@ minethd::cn_hash_fun minethd::func_selector(bool bHaveAes, bool bNoPrefetch)
...
@@ -296,15 +305,8 @@ minethd::cn_hash_fun minethd::func_selector(bool bHaveAes, bool bNoPrefetch)
void
minethd
::
pin_thd_affinity
()
void
minethd
::
pin_thd_affinity
()
{
{
//Lock is needed because we need to use oWorkThd
std
::
lock_guard
<
std
::
mutex
>
lock
(
work_thd_mtx
);
std
::
lock_guard
<
std
::
mutex
>
lock
(
work_thd_mtx
);
#if defined(__APPLE__)
printer
::
inst
()
->
print_msg
(
L1
,
"WARNING on MacOS thread affinity is only advisory."
);
#endif
if
(
!
thd_setaffinity
(
oWorkThd
.
native_handle
(),
affinity
))
printer
::
inst
()
->
print_msg
(
L1
,
"WARNING setting affinity failed."
);
// pin memory to NUMA node
// pin memory to NUMA node
bindMemoryToNUMANode
(
affinity
);
bindMemoryToNUMANode
(
affinity
);
}
}
...
...
This diff is collapsed.
Click to expand it.
xmrstak/backend/cpu/minethd.hpp
+
0
−
1
View file @
73482f30
...
@@ -46,7 +46,6 @@ private:
...
@@ -46,7 +46,6 @@ private:
miner_work
oWork
;
miner_work
oWork
;
void
pin_thd_affinity
();
void
pin_thd_affinity
();
// Held by the creating context to prevent a race cond with oWorkThd = std::thread(...)
std
::
mutex
work_thd_mtx
;
std
::
mutex
work_thd_mtx
;
std
::
thread
oWorkThd
;
std
::
thread
oWorkThd
;
...
...
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