Skip to content

Commit

Permalink
Move channels to new synchronization module
Browse files Browse the repository at this point in the history
  • Loading branch information
hkaiser committed Nov 29, 2019
1 parent d56f59b commit d91737d
Show file tree
Hide file tree
Showing 17 changed files with 66 additions and 39 deletions.
3 changes: 3 additions & 0 deletions libs/synchronization/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ set(synchronization_headers
hpx/synchronization/detail/counting_semaphore.hpp
hpx/synchronization/detail/sliding_semaphore.hpp
hpx/synchronization/event.hpp
hpx/synchronization/channel_mpmc.hpp
hpx/synchronization/channel_mpsc.hpp
hpx/synchronization/channel_spsc.hpp
hpx/synchronization/latch.hpp
hpx/synchronization/mutex.hpp
hpx/synchronization/no_mutex.hpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <hpx/assertion.hpp>
#include <hpx/concurrency.hpp>
#include <hpx/errors.hpp>
#include <hpx/lcos/local/spinlock.hpp>
#include <hpx/synchronization/spinlock.hpp>
#include <hpx/thread_support.hpp>

#include <cstddef>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <hpx/assertion.hpp>
#include <hpx/concurrency.hpp>
#include <hpx/errors.hpp>
#include <hpx/lcos/local/spinlock.hpp>
#include <hpx/synchronization/spinlock.hpp>
#include <hpx/thread_support.hpp>

#include <atomic>
Expand Down
File renamed without changes.
39 changes: 38 additions & 1 deletion libs/synchronization/tests/performance/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
# Copyright (c) 2019 The STE||AR-Group
# Copyright (c) 2019 Hartmut Kaiser
#
# SPDX-License-Identifier: BSL-1.0
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

set(benchmarks
channel_mpmc_throughput
channel_mpsc_throughput
channel_spsc_throughput
)

set(channel_mpmc_throughput_FLAGS DEPENDENCIES
hpx_assertion hpx_concurrency hpx_errors hpx_synchronization hpx_timing hpx_thread_support)
set(channel_mpmc_throughput_PARAMETERS THREADS_PER_LOCALITY 2)
set(channel_mpsc_throughput_FLAGS DEPENDENCIES
hpx_assertion hpx_concurrency hpx_errors hpx_synchronization hpx_timing hpx_thread_support)
set(channel_mpsc_throughput_PARAMETERS THREADS_PER_LOCALITY 2)
set(channel_spsc_throughput_FLAGS DEPENDENCIES
hpx_assertion hpx_concurrency hpx_errors hpx_synchronization hpx_timing hpx_thread_support)
set(channel_spsc_throughputs_PARAMETERS THREADS_PER_LOCALITY 2)

foreach(benchmark ${benchmarks})

set(sources ${benchmark}.cpp)

source_group("Source Files" FILES ${sources})

# add benchmark executable
add_hpx_executable(${benchmark}_test
INTERNAL_FLAGS
SOURCES ${sources}
EXCLUDE_FROM_ALL
${${benchmark}_FLAGS}
FOLDER "Benchmarks/Modules/Synchronization"
)

# add a custom target for this benchmark
add_hpx_performance_test("modules.synchronization"
${benchmark} ${${benchmark}_PARAMETERS})

endforeach()
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <hpx/hpx.hpp>
#include <hpx/hpx_main.hpp>

#include <hpx/lcos/local/channel_mpmc.hpp>
#include <hpx/synchronization/channel_mpmc.hpp>
#include <hpx/timing.hpp>

#include <cstddef>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <hpx/hpx.hpp>
#include <hpx/hpx_main.hpp>

#include <hpx/lcos/local/channel_mpsc.hpp>
#include <hpx/synchronization/channel_mpsc.hpp>
#include <hpx/timing.hpp>

#include <cstddef>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <hpx/hpx.hpp>
#include <hpx/hpx_main.hpp>

#include <hpx/lcos/local/channel_spsc.hpp>
#include <hpx/synchronization/channel_spsc.hpp>
#include <hpx/timing.hpp>

#include <cstddef>
Expand Down
15 changes: 14 additions & 1 deletion libs/synchronization/tests/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

set(tests
channel_mpmc_fib
channel_mpmc_shift
channel_mpsc_fib
channel_mpsc_shift
channel_spsc_fib
channel_spsc_shift
condition_variable
counting_semaphore
local_latch
Expand All @@ -16,6 +22,13 @@ set(tests
sliding_semaphore
)

set(channel_mpmc_fib_PARAMETERS THREADS_PER_LOCALITY 4)
set(channel_mpmc_shift_PARAMETERS THREADS_PER_LOCALITY 4)
set(channel_mpsc_fib_PARAMETERS THREADS_PER_LOCALITY 4)
set(channel_mpsc_shift_PARAMETERS THREADS_PER_LOCALITY 4)
set(channel_spsc_fib_PARAMETERS THREADS_PER_LOCALITY 4)
set(channel_spsc_shift_PARAMETERS THREADS_PER_LOCALITY 4)

set(counting_semaphore_PARAMETERS THREADS_PER_LOCALITY 4)

set(local_barrier_PARAMETERS THREADS_PER_LOCALITY 4)
Expand Down Expand Up @@ -78,7 +91,7 @@ if(HPX_WITH_COMPILE_ONLY_TESTS)

endif()

#########################################################################################
################################################################################
set(subdirs
shared_mutex
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include <hpx/hpx.hpp>
#include <hpx/hpx_main.hpp>
#include <hpx/lcos/local/channel_mpmc.hpp>
#include <hpx/synchronization/channel_mpmc.hpp>

#include <hpx/testing.hpp>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include <hpx/hpx.hpp>
#include <hpx/hpx_main.hpp>
#include <hpx/lcos/local/channel_mpmc.hpp>
#include <hpx/synchronization/channel_mpmc.hpp>

#include <hpx/testing.hpp>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include <hpx/hpx.hpp>
#include <hpx/hpx_main.hpp>
#include <hpx/lcos/local/channel_mpsc.hpp>
#include <hpx/synchronization/channel_mpsc.hpp>

#include <hpx/testing.hpp>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include <hpx/hpx.hpp>
#include <hpx/hpx_main.hpp>
#include <hpx/lcos/local/channel_mpsc.hpp>
#include <hpx/synchronization/channel_mpsc.hpp>

#include <hpx/testing.hpp>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include <hpx/hpx.hpp>
#include <hpx/hpx_main.hpp>
#include <hpx/lcos/local/channel_spsc.hpp>
#include <hpx/synchronization/channel_spsc.hpp>

#include <hpx/testing.hpp>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include <hpx/hpx.hpp>
#include <hpx/hpx_main.hpp>
#include <hpx/lcos/local/channel_spsc.hpp>
#include <hpx/synchronization/channel_spsc.hpp>

#include <hpx/testing.hpp>

Expand Down
13 changes: 0 additions & 13 deletions tests/performance/local/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ set(boost_library_dependencies ${Boost_LIBRARIES})
set(benchmarks
agas_cache_timings
async_overheads
channel_mpmc_throughput
channel_mpsc_throughput
channel_spsc_throughput
delay_baseline
delay_baseline_threaded
hpx_homogeneous_timed_task_spawn_executors
Expand Down Expand Up @@ -147,16 +144,6 @@ set(benchmarks ${benchmarks}
partitioned_vector_foreach
)

set(channel_mpmc_throughput_FLAGS DEPENDENCIES
hpx_assertion hpx_concurrency hpx_errors hpx_timing hpx_thread_support)
set(channel_mpmc_throughput_PARAMETERS THREADS_PER_LOCALITY 2)
set(channel_mpsc_throughput_FLAGS DEPENDENCIES
hpx_assertion hpx_concurrency hpx_errors hpx_timing hpx_thread_support)
set(channel_mpsc_throughput_PARAMETERS THREADS_PER_LOCALITY 2)
set(channel_spsc_throughput_FLAGS DEPENDENCIES
hpx_assertion hpx_concurrency hpx_errors hpx_timing hpx_thread_support)
set(channel_spsc_throughputs_PARAMETERS THREADS_PER_LOCALITY 2)

set(foreach_scaling_FLAGS DEPENDENCIES iostreams_component hpx_timing)
set(function_object_wrapper_overhead_FLAGS DEPENDENCIES hpx_timing)
set(hpx_tls_overhead_FLAGS DEPENDENCIES hpx_timing)
Expand Down
13 changes: 0 additions & 13 deletions tests/unit/lcos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ set(tests
async_remote_client
async_unwrap_result
channel
channel_mpmc_fib
channel_mpmc_shift
channel_mpsc_fib
channel_mpsc_shift
channel_spsc_fib
channel_spsc_shift
client_then
future
future_ref
Expand Down Expand Up @@ -80,13 +74,6 @@ set(async_remote_client_PARAMETERS LOCALITIES 2)
set(async_cb_remote_PARAMETERS LOCALITIES 2)
set(async_cb_remote_client_PARAMETERS LOCALITIES 2)

set(channel_mpmc_fib_PARAMETERS THREADS_PER_LOCALITY 4)
set(channel_mpmc_shift_PARAMETERS THREADS_PER_LOCALITY 4)
set(channel_mpsc_fib_PARAMETERS THREADS_PER_LOCALITY 4)
set(channel_mpsc_shift_PARAMETERS THREADS_PER_LOCALITY 4)
set(channel_spsc_fib_PARAMETERS THREADS_PER_LOCALITY 4)
set(channel_spsc_shift_PARAMETERS THREADS_PER_LOCALITY 4)

set(future_PARAMETERS THREADS_PER_LOCALITY 4)
set(future_then_PARAMETERS THREADS_PER_LOCALITY 4)
set(future_then_executor_PARAMETERS THREADS_PER_LOCALITY 4)
Expand Down

0 comments on commit d91737d

Please sign in to comment.