mirror of
https://github.com/jwinterm/xmr-stak.git
synced 2026-10-19 05:58:41 +02:00
Commit hwlocMemory.hpp fixes on top of this branch (cosmetic, no logic changes)
This commit is contained in:
+8
-6
@@ -13,40 +13,42 @@
|
||||
*
|
||||
* @param puId core id
|
||||
*/
|
||||
void bindMemoryToNUMANode( int puId )
|
||||
void bindMemoryToNUMANode( size_t puId )
|
||||
{
|
||||
int depth;
|
||||
hwloc_topology_t topology;
|
||||
hwloc_obj_t obj;
|
||||
|
||||
hwloc_topology_init(&topology);
|
||||
hwloc_topology_load(topology);
|
||||
|
||||
depth = hwloc_get_type_depth(topology, HWLOC_OBJ_PU);
|
||||
|
||||
for( int i = 0;
|
||||
for( size_t i = 0;
|
||||
i < hwloc_get_nbobjs_by_depth(topology, depth);
|
||||
i++ )
|
||||
{
|
||||
hwloc_obj_t pu = hwloc_get_obj_by_depth(topology, depth, i);
|
||||
if( pu->os_index == puId )
|
||||
{
|
||||
if( 0 > hwloc_set_membind_nodeset(
|
||||
topology,
|
||||
pu->nodeset,
|
||||
HWLOC_MEMBIND_BIND,
|
||||
HWLOC_MEMBIND_THREAD)
|
||||
)
|
||||
HWLOC_MEMBIND_THREAD))
|
||||
{
|
||||
printer::inst()->print_msg(L0, "hwloc: can't bind memory");
|
||||
}
|
||||
else
|
||||
{
|
||||
printer::inst()->print_msg(L0, "hwloc: memory pinned");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
||||
void bindMemoryToNUMANode( int )
|
||||
void bindMemoryToNUMANode( size_t )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -373,7 +373,7 @@ minethd::cn_hash_fun minethd::func_selector(bool bHaveAes, bool bNoPrefetch)
|
||||
void minethd::work_main()
|
||||
{
|
||||
// pin memory to NUMA node
|
||||
bindMemoryToNUMANode(this->affinity);
|
||||
bindMemoryToNUMANode(affinity);
|
||||
|
||||
cn_hash_fun hash_fun;
|
||||
cryptonight_ctx* ctx;
|
||||
@@ -463,7 +463,7 @@ minethd::cn_hash_fun_dbl minethd::func_dbl_selector(bool bHaveAes, bool bNoPrefe
|
||||
void minethd::double_work_main()
|
||||
{
|
||||
// pin memory to NUMA node
|
||||
bindMemoryToNUMANode(this->affinity);
|
||||
bindMemoryToNUMANode(affinity);
|
||||
|
||||
cn_hash_fun_dbl hash_fun;
|
||||
cryptonight_ctx* ctx0;
|
||||
|
||||
Reference in New Issue
Block a user