Commit Graph

30 Commits

Author SHA1 Message Date
Mateusz Loskot
da4fb13aa3 Tidy up #include-s for Intel TBB headers
Remove unused and add missing headers.
2018-01-05 11:00:31 +01:00
Moritz Kobitzsch
2ddd98ee6d simplify passing annotation data through OSRM pipeline using the node-based datastore
- separates node-based graph creation and compression from edge-based graph creation
 - moves usage of edge-based node data-container to pre-processing as well, unifying access to node-based data
 - single struct instead of separate vectors for annotation data in engine (single place of modification)
2017-10-09 18:44:43 +02:00
Michael Krasnyk
c914afdbf1 Fix missing-field-initializers warnings in PackedVector 2017-06-30 14:27:43 +02:00
Michael Krasnyk
c8b75c9046 Use thread-safe lock-free assignment in PackedVector::set_value
PR uses TBB internal atomic's for atomic CAS on non-atomic data

Corresponding PR https://github.com/Project-OSRM/osrm-backend/pull/4199

Other options:

* use sequential update

* use an internal packed vector lock -> makes packed vector non-movable

* use boost.interprocess atomics implementation -> outdated and only 32 bit version

* use glib atomic's -> requires new dependency

*  wait for https://isocpp.org/blog/2014/05/n4013 as_atomic

*  use c11 _Atomic and atomic_compare_exchange_weak -> not possible to mix c++11 and c11

* use builtin functions gcc __sync_bool_compare_and_swap and msvc _InterlockedCompareExchange64 -> possible, but requires proper testing

boolean CompareAndSwapPointer(volatile * void * ptr,
                              void * new_value,
                              void * old_value) {
if defined(_MSC_VER)
   if (InterlockedCompareExchange(ptr, new_value, old_value) == old_value) return false;
   else return true;
elif (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40100
   return __sync_bool_compare_and_swap(ptr, old_value, new_value);
else
  error No implementation
endif
}

* use Boost.Atomic -> requires new dependency

        WordT local_lower_word = lower_word, new_lower_word;
        do
        {
            new_lower_word = set_lower_value<WordT, T>(local_lower_word,
                                                       lower_mask[internal_index.element],
                                                       lower_offset[internal_index.element],
                                                       value);
        } while (!boost::atomics::detail::operations<sizeof(WordT), false>::compare_exchange_weak(
            lower_word,
            local_lower_word,
            new_lower_word,
            boost::memory_order_release,
            boost::memory_order_relaxed));
2017-06-27 13:02:53 +02:00
Patrick Niklaus
3599d1db8e Switch code to use packed vector for segment weights/durations 2017-05-19 08:25:03 +00:00
Patrick Niklaus
6bd724fe24 Rewrite packed vector to also allow random access
This fixes issues #3952. The new approach pre-computes masks for fast
access. Since elements can potentially span multiple words we need masks
and offsets for each upper and lower word.

Due to a bug in the C++14 standart the mask computation is not
recognized as constexpr, but would work on C++17.
2017-05-16 10:25:29 +00:00
Patrick Niklaus
e96545be2e Disable is_integral check because it fails for strong-type-def 2017-04-18 17:24:46 +00:00
Patrick Niklaus
609801ae99 Fix PR comments 2017-04-18 17:24:46 +00:00
Patrick Niklaus
a66918a303 Make PackedVector generic 2017-04-18 17:24:46 +00:00
Patrick Niklaus
446c865415 Dont leak ownership in extractor::files 2017-04-06 15:42:38 +00:00
Patrick Niklaus
0072bf0c59 Move to forward declare header 2017-04-06 15:42:38 +00:00
Patrick Niklaus
4ec7ca29f1 Fix formating 2017-04-06 15:42:38 +00:00
Patrick Niklaus
d94017dfae No shared_memory_wrapper, (De)SerializeVector 2017-04-06 15:42:38 +00:00
Patrick Niklaus
7f6e0c478b Split QueryNode into coordinates and osm id 2017-04-06 15:42:38 +00:00
Pepijn Schoen
789311abd6 Remove osrm namespace indication where possible, wrap out shared_memory_ownership 2017-04-04 17:00:36 +00:00
Pepijn Schoen
091a495632 clang-format 2017-04-04 17:00:36 +00:00
Pepijn Schoen
16665aeb00 Renaming of MemorySetting > Ownership 2017-04-04 17:00:36 +00:00
Pepijn Schoen
157ca9161f clang-format 2017-04-04 17:00:36 +00:00
Pepijn Schoen
266e65e6d2 Replace bool for using shared memory with MemorySetting enum 2017-04-04 17:00:36 +00:00
Daniel Patterson
ec02cdc4cc Use mmap instead of read - it's a lot faster here.
Also clean up construction of STRONG_TYPEDEF so that it can be
packed properly in structs (this explains all the () -> {}) changes
here.
2016-06-27 17:24:30 -07:00
Patrick Niklaus
fddc19e98d
Fix regressed formating 2016-06-21 22:25:48 +02:00
Patrick Niklaus
e9a0beb4e8
Fix shared memory encoding for node-ids 2016-06-12 20:50:57 +02:00
Daniel J. Hofmann
801cc72691 Sync with Clang38 Format 2016-06-02 14:43:27 +02:00
Lauren Budorick
058b8c3b31 Template vector 2016-06-02 14:27:25 +02:00
Lauren Budorick
ae3ccb009e Formatting [ci skip] 2016-06-02 14:27:25 +02:00
Lauren Budorick
0c60a2aef8 Minor cleanups + comments 2016-06-02 14:27:25 +02:00
Lauren Budorick
44fdf86702 IT WORKS 2016-06-02 14:27:25 +02:00
Lauren Budorick
1659bbf7b1 Refining packed_vector.hpp
* Rename to std::vector-like APIs (push_back, at)
* Add size, reserve, capacity methods
2016-06-02 14:27:25 +02:00
Lauren Budorick
46b58fba83 Packed vector cleanups and unit test 2016-06-02 14:27:25 +02:00
Lauren Budorick
84da86ba4a Add packed vector sketch 2016-06-02 14:27:25 +02:00