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
06402d73
There was an error fetching the commit references. Please try again later.
Commit
06402d73
authored
8 years ago
by
fireice-uk
Browse files
Options
Downloads
Patches
Plain Diff
Fix atttempt at NUMA aff reset on Windows
parent
232c0c35
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
minethd.cpp
+15
-13
15 additions, 13 deletions
minethd.cpp
minethd.h
+4
-3
4 additions, 3 deletions
minethd.h
with
19 additions
and
16 deletions
minethd.cpp
+
15
−
13
View file @
06402d73
...
@@ -150,7 +150,7 @@ void telemetry::push_perf_value(size_t iThd, uint64_t iHashCount, uint64_t iTime
...
@@ -150,7 +150,7 @@ void telemetry::push_perf_value(size_t iThd, uint64_t iHashCount, uint64_t iTime
iBucketTop
[
iThd
]
=
(
iTop
+
1
)
&
iBucketMask
;
iBucketTop
[
iThd
]
=
(
iTop
+
1
)
&
iBucketMask
;
}
}
minethd
::
minethd
(
miner_work
&
pWork
,
size_t
iNo
,
bool
double_work
,
bool
no_prefetch
,
int
affinity
)
minethd
::
minethd
(
miner_work
&
pWork
,
size_t
iNo
,
bool
double_work
,
bool
no_prefetch
,
int
64_t
affinity
)
{
{
oWork
=
pWork
;
oWork
=
pWork
;
bQuit
=
0
;
bQuit
=
0
;
...
@@ -307,15 +307,6 @@ std::vector<minethd*>* minethd::thread_starter(miner_work& pWork)
...
@@ -307,15 +307,6 @@ std::vector<minethd*>* minethd::thread_starter(miner_work& pWork)
jconf
::
inst
()
->
GetThreadConfig
(
i
,
cfg
);
jconf
::
inst
()
->
GetThreadConfig
(
i
,
cfg
);
minethd
*
thd
=
new
minethd
(
pWork
,
i
,
cfg
.
bDoubleMode
,
cfg
.
bNoPrefetch
,
cfg
.
iCpuAff
);
minethd
*
thd
=
new
minethd
(
pWork
,
i
,
cfg
.
bDoubleMode
,
cfg
.
bNoPrefetch
,
cfg
.
iCpuAff
);
if
(
cfg
.
iCpuAff
>=
0
)
{
#if defined(__APPLE__)
printer
::
inst
()
->
print_msg
(
L1
,
"WARNING on MacOS thread affinity is only advisory."
);
#endif
thd_setaffinity
(
thd
->
oWorkThd
.
native_handle
(),
cfg
.
iCpuAff
);
}
pvThreads
->
push_back
(
thd
);
pvThreads
->
push_back
(
thd
);
if
(
cfg
.
iCpuAff
>=
0
)
if
(
cfg
.
iCpuAff
>=
0
)
...
@@ -370,11 +361,22 @@ minethd::cn_hash_fun minethd::func_selector(bool bHaveAes, bool bNoPrefetch)
...
@@ -370,11 +361,22 @@ minethd::cn_hash_fun minethd::func_selector(bool bHaveAes, bool bNoPrefetch)
return
func_table
[
digit
.
to_ulong
()];
return
func_table
[
digit
.
to_ulong
()];
}
}
void
minethd
::
work_main
()
void
minethd
::
pin_thd_affinity
()
{
{
// pin memory to NUMA node
// pin memory to NUMA node
bindMemoryToNUMANode
(
affinity
);
bindMemoryToNUMANode
(
affinity
);
#if defined(__APPLE__)
printer
::
inst
()
->
print_msg
(
L1
,
"WARNING on MacOS thread affinity is only advisory."
);
#endif
thd_setaffinity
(
oWorkThd
.
native_handle
(),
affinity
);
}
void
minethd
::
work_main
()
{
if
(
affinity
>=
0
)
//-1 means no affinity
pin_thd_affinity
();
cn_hash_fun
hash_fun
;
cn_hash_fun
hash_fun
;
cryptonight_ctx
*
ctx
;
cryptonight_ctx
*
ctx
;
uint64_t
iCount
=
0
;
uint64_t
iCount
=
0
;
...
@@ -462,8 +464,8 @@ minethd::cn_hash_fun_dbl minethd::func_dbl_selector(bool bHaveAes, bool bNoPrefe
...
@@ -462,8 +464,8 @@ minethd::cn_hash_fun_dbl minethd::func_dbl_selector(bool bHaveAes, bool bNoPrefe
void
minethd
::
double_work_main
()
void
minethd
::
double_work_main
()
{
{
// pin memory to NUMA node
if
(
affinity
>=
0
)
//-1 means no affinity
bindMemoryToNUMANode
(
affinity
);
pin_thd_
affinity
(
);
cn_hash_fun_dbl
hash_fun
;
cn_hash_fun_dbl
hash_fun
;
cryptonight_ctx
*
ctx0
;
cryptonight_ctx
*
ctx0
;
...
...
This diff is collapsed.
Click to expand it.
minethd.h
+
4
−
3
View file @
06402d73
...
@@ -97,13 +97,11 @@ public:
...
@@ -97,13 +97,11 @@ public:
std
::
atomic
<
uint64_t
>
iHashCount
;
std
::
atomic
<
uint64_t
>
iHashCount
;
std
::
atomic
<
uint64_t
>
iTimestamp
;
std
::
atomic
<
uint64_t
>
iTimestamp
;
int
affinity
;
private
:
private
:
typedef
void
(
*
cn_hash_fun
)(
const
void
*
,
size_t
,
void
*
,
cryptonight_ctx
*
);
typedef
void
(
*
cn_hash_fun
)(
const
void
*
,
size_t
,
void
*
,
cryptonight_ctx
*
);
typedef
void
(
*
cn_hash_fun_dbl
)(
const
void
*
,
size_t
,
void
*
,
cryptonight_ctx
*
__restrict
,
cryptonight_ctx
*
__restrict
);
typedef
void
(
*
cn_hash_fun_dbl
)(
const
void
*
,
size_t
,
void
*
,
cryptonight_ctx
*
__restrict
,
cryptonight_ctx
*
__restrict
);
minethd
(
miner_work
&
pWork
,
size_t
iNo
,
bool
double_work
,
bool
no_prefetch
,
int
affinity
);
minethd
(
miner_work
&
pWork
,
size_t
iNo
,
bool
double_work
,
bool
no_prefetch
,
int
64_t
affinity
);
// We use the top 10 bits of the nonce for thread and resume
// We use the top 10 bits of the nonce for thread and resume
// This allows us to resume up to 128 threads 4 times before
// This allows us to resume up to 128 threads 4 times before
...
@@ -131,8 +129,11 @@ private:
...
@@ -131,8 +129,11 @@ private:
static
miner_work
oGlobalWork
;
static
miner_work
oGlobalWork
;
miner_work
oWork
;
miner_work
oWork
;
void
pin_thd_affinity
();
std
::
thread
oWorkThd
;
std
::
thread
oWorkThd
;
uint8_t
iThreadNo
;
uint8_t
iThreadNo
;
int64_t
affinity
;
bool
bQuit
;
bool
bQuit
;
bool
bNoPrefetch
;
bool
bNoPrefetch
;
...
...
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