From 361c68d2bb2ed66443d5ebeefa700467d50a38ba Mon Sep 17 00:00:00 2001 From: Carlchristian Eckert Date: Wed, 4 Jun 2014 15:44:42 +0200 Subject: [PATCH 01/17] add information for FindmallocMC.cmake in PIConGPU --- INSTALL.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/INSTALL.md b/INSTALL.md index 669adbd4..f077c908 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -45,3 +45,42 @@ This is an example how to compile `mallocMC` and test the example code snippets - `./mallocMC_Example02` - `./VerifyHeap` - additional options: see `./VerifyHeap --help` + + +Linking to your Project +----------------------- + +To use mallocMC in your project, you must include the header `mallocMC.hpp` and +add the correct include path. + +Because we are linking to Boost and CUDA, the following **external dependencies** must be linked: +- `-lboost`, `-lcudart` + +If you are using CMake you can download our `FindmallocMC.cmake` module with +```bash +wget https://raw.githubusercontent.com/ComputationalRadiationPhysics/picongpu/dev/src/cmake/FindmallocMC.cmake +# read the documentation +cmake -DCMAKE_MODULE_PATH=. --help-module FindmallocMC | less +``` + +and use the following lines in your `CMakeLists.txt`: +```cmake +# this example will require at least CMake 2.8.5 +cmake_minimum_required(VERSION 2.8.5) + +# add path to FindmallocMC.cmake, e.g. in the directory in cmake/ +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/) + +# find the packages that are required by mallocMC. This has to be done BEFORE +# loading mallocMC +find_package(Boost REQUIRED) +find_package(CUDA REQUIRED) + +# find mallocMC installation +find_package(mallocMC REQUIRED) + +# where to find headers (-I includes for compiler) +include_directories(SYSTEM ${mallocMC_INCLUDE_DIRS}) + +# add_executable(yourBinary ${SOURCES}) + ``` From cc28ecda8bce245d7ba594d7119308317c6ca2e7 Mon Sep 17 00:00:00 2001 From: Carlchristian Eckert Date: Wed, 4 Jun 2014 15:47:40 +0200 Subject: [PATCH 02/17] fix comment --- INSTALL.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index f077c908..2b8eca62 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -82,5 +82,5 @@ find_package(mallocMC REQUIRED) # where to find headers (-I includes for compiler) include_directories(SYSTEM ${mallocMC_INCLUDE_DIRS}) -# add_executable(yourBinary ${SOURCES}) - ``` +add_executable(yourBinary ${SOURCES}) +``` From 5001a6411c4dc982e57b7c619875738e4e264aa7 Mon Sep 17 00:00:00 2001 From: Carlchristian Eckert Date: Wed, 4 Jun 2014 21:32:33 +0200 Subject: [PATCH 03/17] Update INSTALL.md --- INSTALL.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 2b8eca62..0a5cd087 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -50,7 +50,7 @@ This is an example how to compile `mallocMC` and test the example code snippets Linking to your Project ----------------------- -To use mallocMC in your project, you must include the header `mallocMC.hpp` and +To use mallocMC in your project, you must include the header `mallocMC/mallocMC.hpp` and add the correct include path. Because we are linking to Boost and CUDA, the following **external dependencies** must be linked: @@ -74,13 +74,18 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/) # find the packages that are required by mallocMC. This has to be done BEFORE # loading mallocMC find_package(Boost REQUIRED) +set(LIBS ${LIBS} ${Boost_LIBRARIES}) + find_package(CUDA REQUIRED) +cuda_include_directories(${CUDA_INCLUDE_DIRS}) # find mallocMC installation -find_package(mallocMC REQUIRED) +find_package(mallocMC 2.0.0 REQUIRED) # where to find headers (-I includes for compiler) -include_directories(SYSTEM ${mallocMC_INCLUDE_DIRS}) +include_directories(SYSTEM ${mallocMC_INCLUDE_DIRS} ${CUDA_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}) add_executable(yourBinary ${SOURCES}) + +target_link_libraries(yourBinary ${LIBS}) ``` From 96fd48e2228dd809c711f0324ac18536adfa5b87 Mon Sep 17 00:00:00 2001 From: Carlchristian Eckert Date: Tue, 29 Jul 2014 14:10:41 +0200 Subject: [PATCH 04/17] Regions are now correctly initialized --- src/include/mallocMC/creationPolicies/Scatter_impl.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/include/mallocMC/creationPolicies/Scatter_impl.hpp b/src/include/mallocMC/creationPolicies/Scatter_impl.hpp index d38871bb..a9fcdb96 100644 --- a/src/include/mallocMC/creationPolicies/Scatter_impl.hpp +++ b/src/include/mallocMC/creationPolicies/Scatter_impl.hpp @@ -718,7 +718,7 @@ namespace ScatterKernelDetail{ ptes[i].init(); page[i].init(); } - for(uint32 i = linid; i < numregions; i+= numregions) + for(uint32 i = linid; i < numregions; i+= threads) regions[i] = 0; if(linid == 0) From af9305d3b72ce404b4284258f78b8d424e267089 Mon Sep 17 00:00:00 2001 From: Carlchristian Eckert Date: Tue, 29 Jul 2014 14:12:31 +0200 Subject: [PATCH 05/17] getAvailableSlots walks through all blocks - if getAvailableSlots worked in page-based mode, it didn't walk through all the blocks --- src/include/mallocMC/creationPolicies/Scatter_impl.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/include/mallocMC/creationPolicies/Scatter_impl.hpp b/src/include/mallocMC/creationPolicies/Scatter_impl.hpp index d38871bb..8f912e6e 100644 --- a/src/include/mallocMC/creationPolicies/Scatter_impl.hpp +++ b/src/include/mallocMC/creationPolicies/Scatter_impl.hpp @@ -869,7 +869,8 @@ namespace ScatterKernelDetail{ if(gid > 0) return 0; //do this serially uint32 pagestoalloc = divup((uint32)slotSize, pagesize); uint32 freecount = 0; - for(uint32 currentpage = _numpages; currentpage > 0; --currentpage){ //this already includes all superblocks + for(uint32 currentpage = _numpages; currentpage > 0;){ //this already includes all superblocks + --currentpage; if(_ptes[currentpage].chunksize == 0){ if(++freecount == pagestoalloc){ freecount = 0; From e66205cb56c362f69d09b6f4a4ccec3285c12787 Mon Sep 17 00:00:00 2001 From: Carlchristian Eckert Date: Thu, 31 Jul 2014 10:30:30 +0200 Subject: [PATCH 06/17] Bugfix: counter could get too high (racecondition) --- .../mallocMC/creationPolicies/Scatter_impl.hpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/include/mallocMC/creationPolicies/Scatter_impl.hpp b/src/include/mallocMC/creationPolicies/Scatter_impl.hpp index d38871bb..1d0b077b 100644 --- a/src/include/mallocMC/creationPolicies/Scatter_impl.hpp +++ b/src/include/mallocMC/creationPolicies/Scatter_impl.hpp @@ -319,6 +319,9 @@ namespace ScatterKernelDetail{ */ __device__ inline void* tryUsePage(uint32 page, uint32 chunksize) { + + void* chunk_ptr = NULL + //increse the fill level uint32 filllevel = atomicAdd((uint32*)&(_ptes[page].count), 1); //recheck chunck size (it could be that the page got freed in the meanwhile...) @@ -333,19 +336,21 @@ namespace ScatterKernelDetail{ fullsegments = pagesize / segmentsize; additional_chunks = max(0,(int)pagesize - (int)fullsegments*segmentsize - (int)sizeof(uint32))/chunksize; if(filllevel < fullsegments * 32 + additional_chunks) - return addChunkHierarchy(chunksize, fullsegments, additional_chunks, page); + chunk_ptr = addChunkHierarchy(chunksize, fullsegments, additional_chunks, page); } else { uint32 chunksinpage = min(pagesize / chunksize, 32); if(filllevel < chunksinpage) - return addChunkNoHierarchy(chunksize, page, chunksinpage); + chunk_ptr = addChunkNoHierarchy(chunksize, page, chunksinpage); } } //this one is full/not useable - atomicSub((uint32*)&(_ptes[page].count), 1); - return 0; + if(chunk_ptr == NULL) + atomicSub((uint32*)&(_ptes[page].count), 1); + + return chunk_ptr; } From 750d5d6a3468d95ad66ab2b00c53ed2b16158522 Mon Sep 17 00:00:00 2001 From: Carlchristian Eckert Date: Thu, 31 Jul 2014 10:51:04 +0200 Subject: [PATCH 07/17] fixed semicolon --- src/include/mallocMC/creationPolicies/Scatter_impl.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/include/mallocMC/creationPolicies/Scatter_impl.hpp b/src/include/mallocMC/creationPolicies/Scatter_impl.hpp index 1d0b077b..6cfb54a1 100644 --- a/src/include/mallocMC/creationPolicies/Scatter_impl.hpp +++ b/src/include/mallocMC/creationPolicies/Scatter_impl.hpp @@ -320,7 +320,7 @@ namespace ScatterKernelDetail{ __device__ inline void* tryUsePage(uint32 page, uint32 chunksize) { - void* chunk_ptr = NULL + void* chunk_ptr = NULL; //increse the fill level uint32 filllevel = atomicAdd((uint32*)&(_ptes[page].count), 1); From 029d035378d79a06d825589cf0696cf5e3fe7bef Mon Sep 17 00:00:00 2001 From: Carlchristian Eckert Date: Thu, 31 Jul 2014 10:27:16 +0200 Subject: [PATCH 08/17] Bugfix: bitmask in PTE wrong (racecondition) idea of how the bug worked (in hierarchical pages): - currently selected onpagemask is not full. - thread starts searching for free slot - new free slots appear where the thread already searched, while the free slots in unvisited places disappear - thread does not find a free slot, sets `_ptes[page].bitmask` a position of the onpagemask to 1, indicating that the onpagemask/segment is completely filled. - since `_ptes[page].bitmask` indicates, that the onpagemask/segment is completely filled, no other threads will ever enter this segment. - The bug hits, since the `_ptes[page].bitmask` on position onpagemask is only set to 0 by a thread that had a completely filled onpagemask and removes 1 element. Since the onpagemask was never completely filled, no thread will perform the reset - memory is lost. --- src/include/mallocMC/creationPolicies/Scatter_impl.hpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/include/mallocMC/creationPolicies/Scatter_impl.hpp b/src/include/mallocMC/creationPolicies/Scatter_impl.hpp index d38871bb..2b9c5a49 100644 --- a/src/include/mallocMC/creationPolicies/Scatter_impl.hpp +++ b/src/include/mallocMC/creationPolicies/Scatter_impl.hpp @@ -444,9 +444,8 @@ namespace ScatterKernelDetail{ uint32* onpagemasks = (uint32*)(_page[page].data + chunksize*(fullsegments*32 + additional_chunks)); uint32 old = atomicAnd(onpagemasks + segment, ~(1 << withinsegment)); - uint32 elementsinsegment = segment < fullsegments ? 32 : additional_chunks; - if(__popc(old) == elementsinsegment) - atomicAnd((uint32*)&_ptes[page].bitmask, ~(1 << segment)); + // always do this, since it might fail due to a race-condition with addChunkHierarchy + atomicAnd((uint32*)&_ptes[page].bitmask, ~(1 << segment)); } else { From 74db89a09bf12bb0a43a9f13f3092dfe78989eec Mon Sep 17 00:00:00 2001 From: Carlchristian Eckert Date: Thu, 31 Jul 2014 14:41:33 +0200 Subject: [PATCH 09/17] Added flags for more compile warnings --- CMakeLists.txt | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e0a539fb..b7845597 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,6 +39,30 @@ if(Boost_VERSION EQUAL 105500) set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} \"-DBOOST_NOINLINE=__attribute__((noinline))\" ") endif(Boost_VERSION EQUAL 105500) + +################################################################################ +# Warnings +################################################################################ +# GNU +if(CMAKE_COMPILER_IS_GNUCXX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-pragmas") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter") + # new warning in gcc 4.8 (flag ignored in previous version) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs") + # ICC +elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBOOST_NO_VARIADIC_TEMPLATES") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBOOST_NO_CXX11_VARIADIC_TEMPLATES") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBOOST_NO_FENV_H") + # PGI +elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "PGI") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Minform=inform") +endif() + + ############################################################################### # Installation ############################################################################### From b6f00a0e8d4a5cfdbf78b0a485d6c1e504972fc2 Mon Sep 17 00:00:00 2001 From: Carlchristian Eckert Date: Thu, 31 Jul 2014 14:52:47 +0200 Subject: [PATCH 10/17] fixed 2 warnings with -Wsign-compare --- src/include/mallocMC/alignmentPolicies/Shrink_impl.hpp | 2 +- src/include/mallocMC/distributionPolicies/XMallocSIMD_impl.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/include/mallocMC/alignmentPolicies/Shrink_impl.hpp b/src/include/mallocMC/alignmentPolicies/Shrink_impl.hpp index dd80ddd4..f858b60e 100644 --- a/src/include/mallocMC/alignmentPolicies/Shrink_impl.hpp +++ b/src/include/mallocMC/alignmentPolicies/Shrink_impl.hpp @@ -74,7 +74,7 @@ namespace Shrink2NS{ #endif static const uint32 dataAlignment = MALLOCMC_AP_SHRINK_DATAALIGNMENT; - BOOST_STATIC_ASSERT(dataAlignment > 0); + BOOST_STATIC_ASSERT(static_cast(dataAlignment) > 0); //dataAlignment must also be a power of 2! BOOST_STATIC_ASSERT(dataAlignment && !(dataAlignment & (dataAlignment-1)) ); diff --git a/src/include/mallocMC/distributionPolicies/XMallocSIMD_impl.hpp b/src/include/mallocMC/distributionPolicies/XMallocSIMD_impl.hpp index 2c96cd93..ccd510da 100644 --- a/src/include/mallocMC/distributionPolicies/XMallocSIMD_impl.hpp +++ b/src/include/mallocMC/distributionPolicies/XMallocSIMD_impl.hpp @@ -77,7 +77,7 @@ namespace DistributionPolicies{ //all the properties must be unsigned integers > 0 BOOST_STATIC_ASSERT(!std::numeric_limits::is_signed); - BOOST_STATIC_ASSERT(pagesize > 0); + BOOST_STATIC_ASSERT(static_cast(pagesize) > 0); public: static const uint32 _pagesize = pagesize; From 500423de5d602b7fed60fdbad77aaf5576bbe947 Mon Sep 17 00:00:00 2001 From: Carlchristian Eckert Date: Thu, 31 Jul 2014 20:34:47 +0200 Subject: [PATCH 11/17] Bugfix: free did not work when using coalescing - local variable "threadcount" did shadow a class member - better syntax highlighting in my VIM would have made this more obvious :( - `-Wshadow` would have warned about it :( --- src/include/mallocMC/distributionPolicies/XMallocSIMD_impl.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/include/mallocMC/distributionPolicies/XMallocSIMD_impl.hpp b/src/include/mallocMC/distributionPolicies/XMallocSIMD_impl.hpp index 2c96cd93..fe5092cd 100644 --- a/src/include/mallocMC/distributionPolicies/XMallocSIMD_impl.hpp +++ b/src/include/mallocMC/distributionPolicies/XMallocSIMD_impl.hpp @@ -97,7 +97,7 @@ namespace DistributionPolicies{ //second half: make sure that all coalesced allocations can fit within one page //necessary for offset calculation bool coalescible = bytes > 0 && bytes < (pagesize / 32); - uint32 threadcount = __popc(__ballot(coalescible)); + threadcount = __popc(__ballot(coalescible)); if (coalescible && threadcount > 1) { From c9d5b9af60ed7ab17d9847217880a82720665b00 Mon Sep 17 00:00:00 2001 From: Carlchristian Eckert Date: Tue, 10 Jun 2014 10:18:02 +0200 Subject: [PATCH 12/17] Interface changed for OOMPolicy - Scatter can now check better --- src/include/mallocMC/creationPolicies/OldMalloc_impl.hpp | 4 ++-- src/include/mallocMC/creationPolicies/Scatter_impl.hpp | 6 +++--- src/include/mallocMC/mallocMC_hostclass.hpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/include/mallocMC/creationPolicies/OldMalloc_impl.hpp b/src/include/mallocMC/creationPolicies/OldMalloc_impl.hpp index ab4b66c5..5b9eff34 100644 --- a/src/include/mallocMC/creationPolicies/OldMalloc_impl.hpp +++ b/src/include/mallocMC/creationPolicies/OldMalloc_impl.hpp @@ -52,8 +52,8 @@ namespace CreationPolicies{ free(mem); } - __device__ bool isOOM(void* p){ - return 32 == __popc(__ballot(p == NULL)); + __device__ bool isOOM(void* p, size_t s){ + return s && (p == NULL); } template < typename T> diff --git a/src/include/mallocMC/creationPolicies/Scatter_impl.hpp b/src/include/mallocMC/creationPolicies/Scatter_impl.hpp index 1fc535ec..295e64d6 100644 --- a/src/include/mallocMC/creationPolicies/Scatter_impl.hpp +++ b/src/include/mallocMC/creationPolicies/Scatter_impl.hpp @@ -781,9 +781,9 @@ namespace ScatterKernelDetail{ } } - __device__ bool isOOM(void* p){ - // all threads in a warp return get NULL - return 32 == __popc(__ballot(p == NULL)); + __device__ bool isOOM(void* p, size_t s){ + // one thread that requested memory returned null + return s && (p == NULL); } diff --git a/src/include/mallocMC/mallocMC_hostclass.hpp b/src/include/mallocMC/mallocMC_hostclass.hpp index fb7528e4..5ceb2f66 100644 --- a/src/include/mallocMC/mallocMC_hostclass.hpp +++ b/src/include/mallocMC/mallocMC_hostclass.hpp @@ -112,7 +112,7 @@ namespace mallocMC{ bytes = AlignmentPolicy::applyPadding(bytes); uint32 req_size = distributionPolicy.collect(bytes); void* memBlock = CreationPolicy::create(req_size); - const bool oom = CreationPolicy::isOOM(memBlock); + const bool oom = CreationPolicy::isOOM(memBlock, req_size); if(oom) memBlock = OOMPolicy::handleOOM(memBlock); void* myPart = distributionPolicy.distribute(memBlock); From 8641b7d2134c5714c152ceb831476c72a5767438 Mon Sep 17 00:00:00 2001 From: Carlchristian Eckert Date: Tue, 14 Oct 2014 15:30:15 +0200 Subject: [PATCH 13/17] Fix for the onPageTables formula - relies on HierarchyThreshold to find a good place to start the cleanup - validity of the formula was tested for ALL pagesizes ranging from 16 byte to 32 Mbyte with ALL possible chunkSizes that result in a hierarchical page layout for the given pagesize. - the previous comment mentioned, that it might be possible to free only those areas that were used as metadata based on the previous chunkSize. This does NOT work: if the new metadata includes some parts that were previously used as payload-data, this parts will still be non-zero and the bug will occur again. - closes #70 --- .../mallocMC/creationPolicies/Scatter_impl.hpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/include/mallocMC/creationPolicies/Scatter_impl.hpp b/src/include/mallocMC/creationPolicies/Scatter_impl.hpp index 295e64d6..61debeef 100644 --- a/src/include/mallocMC/creationPolicies/Scatter_impl.hpp +++ b/src/include/mallocMC/creationPolicies/Scatter_impl.hpp @@ -187,15 +187,11 @@ namespace ScatterKernelDetail{ * bit fields when the page is used for a small chunk size * @param previous_chunksize the chunksize which was uses for the page before */ - __device__ void init(uint32 previous_chunksize = 0) + __device__ void init() { - //TODO: we can speed this up for pages being freed, because we know the - //chunksize used before (these bits must be zero again) - - //init the entire data which can hold bitfields - uint32 max_bits = min(32*32,pagesize/minChunkSize1); - uint32 max_entries = divup(max_bits/8,sizeof(uint32))*sizeof(uint32); - uint32* write = (uint32*)(data+(pagesize-max_entries)); + //clear the entire data which can hold bitfields + uint32 first_possible_metadata = 32*HierarchyThreshold; + uint32* write = (uint32*)(data+(pagesize-first_possible_metadata)); while(write < (uint32*)(data + pagesize)) *write++ = 0; } From c710a6c7920205324bc59dd6be5fb7cfebf9277b Mon Sep 17 00:00:00 2001 From: Carlchristian Eckert Date: Fri, 8 Aug 2014 15:56:00 +0200 Subject: [PATCH 14/17] The constraints check is no longer instantiated --- src/include/mallocMC/mallocMC_constraints.hpp | 4 ++-- src/include/mallocMC/mallocMC_hostclass.hpp | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/include/mallocMC/mallocMC_constraints.hpp b/src/include/mallocMC/mallocMC_constraints.hpp index 7aedf4bf..413024a3 100644 --- a/src/include/mallocMC/mallocMC_constraints.hpp +++ b/src/include/mallocMC/mallocMC_constraints.hpp @@ -63,8 +63,8 @@ namespace mallocMC{ typename T_GetHeapPolicy, typename T_AlignmentPolicy > - class PolicyConstraints{ - PolicyCheck2 c; + struct PolicyConstraints:PolicyCheck2{ + }; diff --git a/src/include/mallocMC/mallocMC_hostclass.hpp b/src/include/mallocMC/mallocMC_hostclass.hpp index 5ceb2f66..b5282a36 100644 --- a/src/include/mallocMC/mallocMC_hostclass.hpp +++ b/src/include/mallocMC/mallocMC_hostclass.hpp @@ -83,7 +83,8 @@ namespace mallocMC{ public T_CreationPolicy, public T_OOMPolicy, public T_ReservePoolPolicy, - public T_AlignmentPolicy + public T_AlignmentPolicy, + public PolicyConstraints { public: typedef T_CreationPolicy CreationPolicy; @@ -96,10 +97,6 @@ namespace mallocMC{ typedef boost::uint32_t uint32; void* pool; - //Instantiating the constraints checker will execute the check - PolicyConstraints c; - public: typedef Allocator Date: Tue, 6 Jan 2015 12:25:59 +0100 Subject: [PATCH 15/17] inheritance is no longer public --- src/include/mallocMC/mallocMC_constraints.hpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/include/mallocMC/mallocMC_constraints.hpp b/src/include/mallocMC/mallocMC_constraints.hpp index 413024a3..867e97f7 100644 --- a/src/include/mallocMC/mallocMC_constraints.hpp +++ b/src/include/mallocMC/mallocMC_constraints.hpp @@ -37,19 +37,19 @@ namespace mallocMC{ /** The default PolicyCheckers (do always succeed) */ template - struct PolicyCheck1{}; + class PolicyCheck1{}; template - struct PolicyCheck2{}; + class PolicyCheck2{}; template - struct PolicyCheck3{}; + class PolicyCheck3{}; template - struct PolicyCheck4{}; + class PolicyCheck4{}; template - struct PolicyCheck5{}; + class PolicyCheck5{}; /** Enforces constraints on policies or combinations of polices @@ -63,7 +63,8 @@ namespace mallocMC{ typename T_GetHeapPolicy, typename T_AlignmentPolicy > - struct PolicyConstraints:PolicyCheck2{ + + class PolicyConstraints:PolicyCheck2{ }; @@ -75,7 +76,7 @@ namespace mallocMC{ * the same value for their "pagesize"-parameter. */ template - struct PolicyCheck2< + class PolicyCheck2< typename CreationPolicies::Scatter, typename DistributionPolicies::XMallocSIMD >{ From 60a8070ab97b72efcceea546070c0995b27b4b97 Mon Sep 17 00:00:00 2001 From: Carlchristian Eckert Date: Tue, 13 Jan 2015 13:35:02 +0100 Subject: [PATCH 16/17] bump version information to 2.0.1 2.0.1 --- CHANGELOG.md | 26 ++++++++++++++++++++++++++ INSTALL.md | 2 +- src/include/mallocMC/version.hpp | 2 +- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35296241..6bfd4cbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,32 @@ Change Log / Release Log for mallocMC ================================================================ +2.0.1crp +------------- +**Date:** 2015-01-13 + +This release fixes several bugs that occured after the release of 2.0.0crp. +We closed all issues documented in +[Milestone *Bugfixes*](https://github.com/ComputationalRadiationPhysics/mallocMC/issues?milestone=4&state=closed) + +### Changes to mallocMC 2.0.0crp + +**Features** + - Overwriting of the default CUDA allocator is no longer possible. This allows to build more complex allocator policies in the future #72 + +**Bug fixes** + - page table metadata was not correctly initialized with 0 #70 + - freeing pages would not work under certain circumstances #66 + - the bitmask in a page table entry could be wrong due to a racecondition #62 + - not all regions were initialized correctly #60 + - getAvailableSlots could sometimes miss blocks #59 + - the counter for elements in a page could get too high due to a racecondition #61 + - Out of Memory (OOM) Policy sometimes did not recognize allocation failures correctly #67 + +**Misc:** + - See the full changes at https://github.com/ComputationalRadiationPhysics/mallocMC/compare/2.0.0crp...2.0.1crp + + 2.0.0crp ------------- **Date:** 2014-06-02 diff --git a/INSTALL.md b/INSTALL.md index 0a5cd087..bbe88223 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -80,7 +80,7 @@ find_package(CUDA REQUIRED) cuda_include_directories(${CUDA_INCLUDE_DIRS}) # find mallocMC installation -find_package(mallocMC 2.0.0 REQUIRED) +find_package(mallocMC 2.0.1 REQUIRED) # where to find headers (-I includes for compiler) include_directories(SYSTEM ${mallocMC_INCLUDE_DIRS} ${CUDA_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}) diff --git a/src/include/mallocMC/version.hpp b/src/include/mallocMC/version.hpp index cb29fb19..1a7ad800 100644 --- a/src/include/mallocMC/version.hpp +++ b/src/include/mallocMC/version.hpp @@ -39,7 +39,7 @@ /** the mallocMC version: major API changes should be reflected here */ #define MALLOCMC_VERSION_MAJOR 2 #define MALLOCMC_VERSION_MINOR 0 -#define MALLOCMC_VERSION_PATCH 0 +#define MALLOCMC_VERSION_PATCH 1 /** the mallocMC flavor is used to differenciate the releases of the * Computational Radiation Physics group (crp) from other releases From 4c89d7d9111344795c988180846ee3e98704c32f Mon Sep 17 00:00:00 2001 From: Carlchristian Eckert Date: Thu, 15 Jan 2015 14:20:53 +0100 Subject: [PATCH 17/17] Edited changelog: removed #72 from release 2.0.1 - #72 will not make it into the release and is pushed back to the release of 2.1.0crp. --- CHANGELOG.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bfd4cbd..3dbfbde6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,9 +11,6 @@ We closed all issues documented in ### Changes to mallocMC 2.0.0crp -**Features** - - Overwriting of the default CUDA allocator is no longer possible. This allows to build more complex allocator policies in the future #72 - **Bug fixes** - page table metadata was not correctly initialized with 0 #70 - freeing pages would not work under certain circumstances #66