[med-svn] [Git][med-team/xenium][master] 6 commits: Add missing Build-Depends

Andreas Tille gitlab at salsa.debian.org
Tue Jul 21 08:56:23 BST 2020



Andreas Tille pushed to branch master at Debian Med / xenium


Commits:
d8d30da0 by Andreas Tille at 2020-07-21T09:56:16+02:00
Add missing Build-Depends

- - - - -
717f73ef by Andreas Tille at 2020-07-21T09:56:16+02:00
Rename package xenium to what it really is: libxenium-doc

- - - - -
b8a3615d by Andreas Tille at 2020-07-21T09:56:16+02:00
Section is libdevel

- - - - -
96d422a2 by Andreas Tille at 2020-07-21T09:56:16+02:00
Reflect that some filese were removed

- - - - -
11908f39 by Andreas Tille at 2020-07-21T09:56:16+02:00
New upstream version 0.0+git20200720.e62d4d5+dfsg
- - - - -
9452ad60 by Andreas Tille at 2020-07-21T09:56:16+02:00
debhelper is clever enough to install docs right to the real package

- - - - -


17 changed files:

- azure-pipelines.yml
- benchmarks/config.hpp
- + benchmarks/examples/hash_map.json
- benchmarks/examples/queue.json
- − benchmarks/hash_map.json
- benchmarks/hash_map_benchmark.cpp
- benchmarks/hash_maps.hpp
- benchmarks/main.cpp
- debian/changelog
- debian/control
- debian/xenium.doc-base → debian/libxenium-doc.doc-base
- debian/xenium.docs → debian/libxenium-doc.docs
- debian/watch
- xenium/backoff.hpp
- + xenium/detail/hardware.hpp
- xenium/kirsch_bounded_kfifo_queue.hpp
- xenium/kirsch_kfifo_queue.hpp


Changes:

=====================================
azure-pipelines.yml
=====================================
@@ -3,30 +3,44 @@ stages:
     jobs:
       - job: BuildLinux
         displayName: 'Build Linux'
-        pool:
-          vmImage: 'ubuntu-18.04'
 
         strategy:
           matrix:
             gcc8-Release:
               compiler: g++-8
               buildConfiguration: Release
+              image: 'ubuntu-18.04'
             gcc8-Debug:
               compiler: g++-8
               buildConfiguration: Debug
+              image: 'ubuntu-18.04'
             clang8-Release:
               compiler: clang++-8
               buildConfiguration: Release
+              image: 'ubuntu-18.04'
             clang8-Debug:
               compiler: clang++-8
               buildConfiguration: Debug
+              image: 'ubuntu-18.04'
             clang9-Release:
               compiler: clang++-9
               buildConfiguration: Release
+              image: 'ubuntu-18.04'
             clang9-Debug:
               compiler: clang++-9
               buildConfiguration: Debug
+              image: 'ubuntu-18.04'
+            clang10-Mac-Debug:
+              compiler: clang++
+              buildConfiguration: Debug
+              image: macOS-10.15
+            clang10-Mac-Release:
+              compiler: clang++
+              buildConfiguration: Release
+              image: macOS-10.15
 
+        pool:
+          vmImage: $(image)
         steps:
         - script: |
             sudo apt-get update -y
@@ -35,10 +49,11 @@ stages:
           condition: eq(variables['compiler'], 'g++-8')
 
         - script: |
+            $(compiler) --version
             git submodule update --init --recursive
             mkdir $(Build.BinariesDirectory)/build
             cd $(Build.BinariesDirectory)/build
-            cmake $(Build.SourcesDirectory) -DCMAKE_CXX_COMPILER=$(compiler) -DCMAKE_BUILD_TYPE=$(buildConfiguration) -DCMAKE_CXX_FLAGS="-fsanitize=thread"
+            cmake $(Build.SourcesDirectory) -DCMAKE_CXX_COMPILER=$(compiler) -DCMAKE_CXX_STANDARD=17 -DCMAKE_BUILD_TYPE=$(buildConfiguration) -DCMAKE_CXX_FLAGS="-fsanitize=thread"
           displayName: 'Prepare build'
 
         - script: make -j 4
@@ -49,6 +64,10 @@ stages:
           workingDirectory: $(Build.BinariesDirectory)/build
           displayName: 'Run tests'
 
+        - publish: $(Build.BinariesDirectory)/build/benchmark
+          artifact: benchmark
+          condition: and(eq(variables.compiler, 'g++-8'), eq(variables.buildConfiguration, 'Release'))
+
         - task: PublishTestResults at 2
           inputs:
             testResultsFormat: 'JUnit'
@@ -97,6 +116,34 @@ stages:
             testResultsFormat: 'JUnit'
             testResultsFiles: $(Build.BinariesDirectory)\build\$(buildConfiguration)\gtest.log
 
+############################################################
+
+  - stage: BenchmarkSmokeTest
+    condition: succeeded()
+    jobs:
+    - job: BenchmarkSmokeTest
+      displayName: 'Benchmark smoke tests'
+      pool:
+        vmImage: 'Ubuntu-16.04'
+      steps:
+      - task: DownloadPipelineArtifact at 2
+        inputs:
+          artifact: benchmark
+          path: benchmarks/examples
+      - script: |
+          cd benchmarks/examples
+          chmod +x benchmark
+          set -e
+          for QUEUE in ramalhete michael_scott vyukov_bounded kirsch_kfifo kirsch_bounded_kfifo; do
+            ./benchmark queue.json -- "ds=(queues.$QUEUE)" warmup.rounds=0 rounds=1 runtime=500
+          done
+          for RECLAIMER in EBR NEBR DEBRA QSBR static-HP dynamic-HP; do
+            ./benchmark queue.json -- "ds.reclaimer=(reclaimers.$RECLAIMER)" warmup.rounds=0 rounds=1 runtime=500
+          done
+          for HASHMAP in vyukov harris_michael; do
+            ./benchmark hash_map.json -- "ds=(hash_maps.$HASHMAP)" warmup.rounds=0 rounds=1 runtime=500
+          done
+
 ############################################################
 
   - stage: Documentation
@@ -115,7 +162,7 @@ stages:
           doxygen
         displayName: build doxygen
       - script: |
-          cd doc/html
+         cd doc/html
           git init
           git checkout --orphan gh-pages
           git add .


=====================================
benchmarks/config.hpp
=====================================
@@ -27,7 +27,7 @@
   #define WITH_CDS_BASKET_QUEUE
   #define WITH_CDS_SEGMENTED_QUEUE
 
-  #define WITH_CDS_MICHAEL_MAP
+  #define WITH_CDS_MICHAEL_HASHMAP
   #define WITH_CDS_FELDMAN_HASHMAP
 #endif
 


=====================================
benchmarks/examples/hash_map.json
=====================================
@@ -0,0 +1,63 @@
+{
+  "reclaimers": {
+    "EBR": {
+      "type": "generic_epoch_based",
+      "scan_strategy": { "type": "all_threads" },
+      "region_extension": "none"
+    },
+    "NEBR": {
+      "type": "generic_epoch_based",
+      "scan_strategy": { "type": "all_threads" },
+      "region_extension": "eager"
+    },
+    "DEBRA": {
+      "type": "generic_epoch_based",
+      "scan_strategy": { "type": "one_threads" },
+      "region_extension": "eager"
+    },
+    "QSBR": {
+      "type": "quiescent_state_based"
+    },
+    "static-HP": {
+      "type": "hazard_pointer",
+      "allocation_strategy": { "type": "static"}
+    },
+    "dynamic-HP": {
+      "type": "hazard_pointer",
+      "allocation_strategy": { "type": "dynamic"}
+    },
+  },
+  "hash_maps": {
+    "vyukov": {
+      "type": "vyukov_hash_map",
+      "reclaimer": (reclaimers.EBR)
+    },
+    "harris_michael" : {
+      "type": "harris_michael_hash_map",
+      "reclaimer": (reclaimers.EBR)
+    },
+    "cds-MichaelHashMap" : {
+      "type": "cds::MichaelHashMap",
+      "gc": "HP",
+      "nMaxItemCount": 512,
+      "nLoadFactor": 1
+    },
+    "cds-FeldmanHashMap": {
+      "type": "cds::FeldmanHashMap",
+      "gc": "HP"
+    }
+  },
+  "type": "hash_map",
+  "ds": (hash_maps.vyukov),
+  "warmup": {
+    "rounds": 1,
+    "runtime": 200
+  },
+  "rounds": 4,
+  "runtime": 1000,
+  "threads": {
+    "mixed": {
+      "count": 4
+    }
+  }
+}
\ No newline at end of file


=====================================
benchmarks/examples/queue.json
=====================================
@@ -12,8 +12,8 @@
     },
     "DEBRA": {
       "type": "generic_epoch_based",
-      "scan_strategy": { "type": "one_threads" },
-      "region_extension": "eager"
+      "scan_strategy": { "type": "one_thread" },
+      "region_extension": "none"
     },
     "QSBR": {
       "type": "quiescent_state_based"
@@ -38,7 +38,8 @@
     },
     "vyukov_bounded" : {
       "type": "vyukov_bounded_queue",
-      "size": 256
+      "size": 256,
+      "weak": false
     },
     "kirsch_kfifo" : {
       "type": "kirsch_kfifo_queue",


=====================================
benchmarks/hash_map.json deleted
=====================================
@@ -1,20 +0,0 @@
-{
-  "type": "hash_map",
-  "ds": {
-    "type": "vyukov_hash_map",
-    "reclaimer": {
-      "type": "epoch_based"
-    }
-  },
-  "warmup": {
-    "rounds": 1,
-    "runtime": 200
-  },
-  "rounds": 4,
-  "runtime": 1000,
-  "threads": {
-    "mixed": {
-      "count": 4
-    }
-  }
-}
\ No newline at end of file


=====================================
benchmarks/hash_map_benchmark.cpp
=====================================
@@ -199,10 +199,10 @@ namespace {
   #endif
 #endif
 
-#ifdef WITH_CDS_MICHAEL_MAP
+#ifdef WITH_CDS_MICHAEL_HASHMAP
     make_benchmark_builder<
       cds::container::MichaelHashMap<cds::gc::HP,
-        cds::container::MichaelKVList< cds::gc::HP, int, int>>>(),
+        cds::container::MichaelKVList< cds::gc::HP, QUEUE_ITEM, QUEUE_ITEM>>>(),
 #endif
 
 #ifdef WITH_CDS_FELDMAN_HASHMAP


=====================================
benchmarks/hash_maps.hpp
=====================================
@@ -88,17 +88,18 @@ namespace {
 #include <cds/gc/dhp.h>
 #endif
 
-#ifdef WITH_CDS_MICHAEL_MAP
+#ifdef WITH_CDS_MICHAEL_HASHMAP
 #include <cds/container/michael_kvlist_hp.h>
 #include <cds/container/michael_map.h>
 
-template <class GC, class List, class Traits>
-struct descriptor<cds::container::MichaelHashMap<GC, List, Traits>> {
+template <class List, class Traits>
+struct descriptor<cds::container::MichaelHashMap<cds::gc::HP, List, Traits>> {
   static tao::json::value generate() {
     return {
-      {"type", "cds::MichaelMap"},
+      {"type", "cds::MichaelHashMap"},
       {"nMaxItemCount", DYNAMIC_PARAM},
-      {"nLoadFactor", DYNAMIC_PARAM}
+      {"nLoadFactor", DYNAMIC_PARAM},
+      {"gc", "HP"}
     };
   }
 };
@@ -140,10 +141,13 @@ namespace {
 #include <cds/container/feldman_hashmap_dhp.h>
 #include <cds/container/feldman_hashmap_rcu.h>
 
-template <class GC, class Key, class T, class Traits>
-struct descriptor<cds::container::FeldmanHashMap<GC, Key, T, Traits>> {
+template <class Key, class T, class Traits>
+struct descriptor<cds::container::FeldmanHashMap<cds::gc::HP, Key, T, Traits>> {
   static tao::json::value generate() {
-    return {{"type", "cds::FeldmanHashMap"}};
+    return {
+      {"type", "cds::FeldmanHashMap"},
+      {"gc", "HP"}
+    };
   }
 };
 


=====================================
benchmarks/main.cpp
=====================================
@@ -85,7 +85,8 @@ bool objects_match(const tao::config::value::object_t& config, const tao::json::
 
 bool scalars_match(const tao::config::value& config, const tao::json::value& descriptor) {
   if (config.is_string() != descriptor.is_string() ||
-      config.is_integer() != descriptor.is_integer()) {
+      config.is_integer() != descriptor.is_integer() ||
+      config.is_boolean() != descriptor.is_boolean()) {
     return false;
   }
 
@@ -95,6 +96,9 @@ bool scalars_match(const tao::config::value& config, const tao::json::value& des
   if (config.is_string())
     return config.get_string() == descriptor.get_string();
 
+  if (config.is_boolean())
+    return config.get_boolean() == descriptor.get_boolean();
+
   throw std::runtime_error("Found unexpected type in config.");
 }
 


=====================================
debian/changelog
=====================================
@@ -1,7 +1,5 @@
-xenium (0.0+git20200603.5336adf-1) UNRELEASED; urgency=medium
+xenium (0.0+git20200720.e62d4d5+dfsg-1) UNRELEASED; urgency=medium
 
   * Initial release (Closes: #965347)
 
-    BLOCKER: Needs tao* dependencies in the distribution
-
  -- Steffen Moeller <moeller at debian.org>  Mon, 20 Jul 2020 00:37:21 +0200


=====================================
debian/control
=====================================
@@ -7,7 +7,9 @@ Build-Depends: debhelper-compat (= 13),
                libcds-dev,
                tao-json-dev,
                tao-config-dev,
-               doxygen
+               cmake,
+               doxygen,
+               googletest <!nocheck>
 Standards-Version: 4.5.0
 Vcs-Browser: https://salsa.debian.org/med-team/xenium
 Vcs-Git: https://salsa.debian.org/med-team/xenium.git
@@ -16,6 +18,7 @@ Rules-Requires-Root: no
 
 Package: libxenium-dev
 Architecture: all
+Section: libdevel
 Depends: ${misc:Depends}
 Description: concurrent data structures and memory reclamation algorithms
  xenium is a header-only library that provides a collection of concurrent
@@ -29,9 +32,11 @@ Description: concurrent data structures and memory reclamation algorithms
   * supports dynamic number of threads (no fixed compile time
     specification)
 
-Package: xenium
+Package: libxenium-doc
 Architecture: all
-Depends: ${misc:Depends}, libxenium-dev
+Section: doc
+Depends: ${misc:Depends}
+Enhances: libxenium-dev
 Description: HTML documentation for the xenium library
  xenium is a header-only library that provides a collection of concurrent
  data structures and memory reclamation algorithms. The data structures
@@ -43,3 +48,6 @@ Description: HTML documentation for the xenium library
   * no initialization code needed
   * supports dynamic number of threads (no fixed compile time
     specification)
+ .
+ This package contains the documentation for libxenium as well as some
+ benchmarking and testing code.


=====================================
debian/xenium.doc-base → debian/libxenium-doc.doc-base
=====================================
@@ -15,5 +15,5 @@ Abstract: concurrent data structures and memory reclamation algorithms
 Section: Programming/C++
 
 Format: html
-Index: /usr/share/doc/xenium/html/index.html
-Files: /usr/share/doc/xenium/html/*
+Index: /usr/share/doc/libxenium-dev/html/index.html
+Files: /usr/share/doc/libxenium-dev/html/*


=====================================
debian/xenium.docs → debian/libxenium-doc.docs
=====================================
@@ -1 +1,3 @@
 doc/html/
+benchmarks
+test


=====================================
debian/watch
=====================================
@@ -1,2 +1,2 @@
 version=4
-opts="mode=git,pretty=0.0+git%cd.%h" https://github.com/mpoeter/xenium.git HEAD
+opts="mode=git,pretty=0.0+git%cd.%h,repacksuffix=+dfsg,dversionmangle=auto" https://github.com/mpoeter/xenium.git HEAD


=====================================
xenium/backoff.hpp
=====================================
@@ -6,15 +6,9 @@
 #ifndef XENIUM_BACKOFF_HPP
 #define XENIUM_BACKOFF_HPP
 
-#include <xenium/detail/port.hpp>
+#include <xenium/detail/hardware.hpp>
 #include <algorithm>
 
-#ifdef XENIUM_ARCH_X86
-#include <emmintrin.h>
-#else
-#include <thread>
-#endif
-
 namespace xenium {
 /**
  * @brief Dummy backoff strategy that does nothing.
@@ -24,26 +18,24 @@ struct no_backoff
   void operator()() {}
 };
 
+/**
+ * @brief Simple backoff strategy that always perfoms a single `hardware_pause` operation.
+ */
+struct single_backoff
+{
+  void operator()() { detail::hardware_pause(); }
+};
+
 template <unsigned Max>
 struct exponential_backoff {
   static_assert(Max > 0, "Max must be greater than zero. If you don't want to backoff use the `no_backoff` class.");
 
   void operator()() {
     for (unsigned i = 0; i < count; ++i)
-      do_backoff();
+      detail::hardware_pause();
     count = std::min(Max, count * 2);
   }
 
-private:
-  void do_backoff() {
-#ifdef XENIUM_ARCH_X86
-    _mm_pause();
-#else
-    #warning "No backoff implementation available."
-    std::this_thread::yield();
-#endif
-  }
-
   unsigned count = 1;
 };
 


=====================================
xenium/detail/hardware.hpp
=====================================
@@ -0,0 +1,32 @@
+//
+// Copyright (c) 2018-2020 Manuel Pöter.
+// Licensed under the MIT License. See LICENSE file in the project root for full license information.
+//
+
+#ifndef XENIUM_DETAILS_HARDWARE_HPP
+#define XENIUM_DETAILS_HARDWARE_HPP
+
+#include <xenium/detail/port.hpp>
+
+#if defined(XENIUM_ARCH_X86)
+#include <emmintrin.h>
+#elif defined(XENIUM_ARCH_SPARC)
+#include <synch.h>
+#endif
+
+namespace xenium { namespace detail {
+  inline void hardware_pause() {
+    // TODO - add pause implementations for ARM + Power
+#if defined(XENIUM_ARCH_X86)
+    _mm_pause();
+#elif defined(XENIUM_ARCH_SPARC)
+    smt_pause();
+#else
+    #warning "No hardware_pause implementation available - falling back to local volatile noop."
+    // this effectively prevents the compiler from optimizing away the whole backoff operation
+    volatile int x = 0;
+    (void)x;
+#endif
+  }
+}}
+#endif


=====================================
xenium/kirsch_bounded_kfifo_queue.hpp
=====================================
@@ -13,6 +13,7 @@
 
 #include <xenium/detail/pointer_queue_traits.hpp>
 
+#include <algorithm>
 #include <atomic>
 #include <cstdint>
 
@@ -99,16 +100,16 @@ namespace xenium {
   private:
     struct marked_idx {
       marked_idx() = default;
-      marked_idx(uint64_t val, uint64_t mark) { val_ = val | (mark << bits); }
+      marked_idx(uint64_t val, uint64_t mark) noexcept { val_ = val | (mark << bits); }
 
-      uint64_t get() const { return val_ & val_mask; }
-      uint64_t mark() const { return val_ >> bits; }
-      bool operator==(const marked_idx& other) const { return this->val_ == other.val_; }
-      bool operator!=(const marked_idx& other) const { return this->val_ != other.val_; }
+      uint64_t get() const noexcept { return val_ & val_mask; }
+      uint64_t mark() const noexcept { return val_ >> bits; }
+      bool operator==(const marked_idx& other) const noexcept { return this->val_ == other.val_; }
+      bool operator!=(const marked_idx& other) const noexcept { return this->val_ != other.val_; }
     private:
       static constexpr unsigned bits = 16;
       static constexpr uint64_t val_mask = (static_cast<uint64_t>(1) << bits) - 1;
-      uint64_t val_;
+      uint64_t val_ = 0;
     };
     
     template <bool Empty>
@@ -134,7 +135,7 @@ namespace xenium {
     k_(k),
     head_(),
     tail_(),
-    queue_(new entry[k * num_segments])
+    queue_(new entry[k * num_segments]())
   {}
 
   template <class T, class... Policies>


=====================================
xenium/kirsch_kfifo_queue.hpp
=====================================
@@ -13,6 +13,7 @@
 
 #include <xenium/detail/pointer_queue_traits.hpp>
 
+#include <algorithm>
 #include <atomic>
 #include <cstdint>
 



View it on GitLab: https://salsa.debian.org/med-team/xenium/-/compare/597e8eac9eb204a49053bcbc810581f44f045761...9452ad60ca3d05bb251bac28a12ee916c7bf975d

-- 
View it on GitLab: https://salsa.debian.org/med-team/xenium/-/compare/597e8eac9eb204a49053bcbc810581f44f045761...9452ad60ca3d05bb251bac28a12ee916c7bf975d
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20200721/78eeacbe/attachment-0001.html>


More information about the debian-med-commit mailing list