From 7a212bb24fc37482bff9f397fc97bb551ae5686a Mon Sep 17 00:00:00 2001 From: psychocrypt Date: Sun, 14 May 2017 19:13:39 +0200 Subject: [PATCH] overloead cache - use one thread more if 1 MiB cache is available after removeing the multiple of 2MiB - fix install documentation --- README.md | 2 +- autoAdjustHwloc.hpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index accd20a..977e779 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ xXl2Nm/u3cPP/eQVrZz5H8eACwIv+LL1EV+9uLanWUa+IO5hHr3KElvKNKD6vN0= ### GNU Compiler ``` - sudo apt-get install libmicrohttpd-dev libssl-dev cmake build-essential hwloc-dev + sudo apt-get install libmicrohttpd-dev libssl-dev cmake build-essential libhwloc-dev cmake . make install ``` diff --git a/autoAdjustHwloc.hpp b/autoAdjustHwloc.hpp index 4df476b..9022330 100644 --- a/autoAdjustHwloc.hpp +++ b/autoAdjustHwloc.hpp @@ -138,7 +138,7 @@ private: if (obj->type == HWLOC_OBJ_CACHE) { size_t cacheSize = obj->attr->cache.size; - size_t numHashL3 = cacheSize / m_scratchPadMemSize; + size_t numHashL3 = ( cacheSize + m_scratchPadMemSize/ 2llu ) / m_scratchPadMemSize; /* check cache is exclusive or inclusive */ const char* value = hwloc_obj_get_info_by_name(obj, "Inclusive"); @@ -176,7 +176,7 @@ private: numHashL3 = 0; numHashes += extraHash; //add L2 hashes - numHashes += l2Cache / m_scratchPadMemSize; + numHashes += ( l2Cache + m_scratchPadMemSize / 2llu ) / m_scratchPadMemSize; int numCachesLeft = numL2; getConfig(topology, l3Cache, numHashes, numCachesLeft); doL3 = false;