Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
aurianer committed Aug 26, 2020
2 parents d6521ad + 63729e8 commit 3148105
Show file tree
Hide file tree
Showing 22 changed files with 74 additions and 65 deletions.
2 changes: 1 addition & 1 deletion components/iostreams/include/hpx/include/iostreams.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <hpx/config.hpp>
#include <hpx/iostream.hpp>

#if (HPX_HAVE_DEPRECATION_WARNINGS != 0)
#if HPX_HAVE_DEPRECATION_WARNINGS
#if defined(HPX_MSVC)
#pragma message("The header hpx/include/iostreams.hpp is deprecated, \
please include hpx/iostream.hpp instead")
Expand Down
2 changes: 1 addition & 1 deletion libs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ set(HPX_CANDIDATE_LIBS
coroutines
datastructures
debugging
distributed_executors
errors
execution
execution_base
executors
executors_distributed
filesystem
format
functional
Expand Down
2 changes: 1 addition & 1 deletion libs/all_modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ All modules
/libs/coroutines/docs/index.rst
/libs/datastructures/docs/index.rst
/libs/debugging/docs/index.rst
/libs/distributed_executors/docs/index.rst
/libs/errors/docs/index.rst
/libs/execution/docs/index.rst
/libs/execution_base/docs/index.rst
/libs/executors/docs/index.rst
/libs/executors_distributed/docs/index.rst
/libs/filesystem/docs/index.rst
/libs/format/docs/index.rst
/libs/functional/docs/index.rst
Expand Down
48 changes: 29 additions & 19 deletions libs/async_cuda/include/hpx/async_cuda/cuda_event.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ namespace hpx { namespace cuda { namespace experimental {
// Since allocation of a cuda event passes into the cuda runtime
// it might be an expensive operation, so we pre-allocate a pool
// of them at startup.
// For now - Assume a maximum of 64 outstanding events is enough
struct cuda_event_pool
{
static constexpr int max_events_in_pool = 64;
static constexpr int initial_events_in_pool = 128;

static cuda_event_pool& get_event_pool()
{
Expand All @@ -32,34 +31,35 @@ namespace hpx { namespace cuda { namespace experimental {

// create a bunch of events on initialization
cuda_event_pool()
: free_list_(initial_events_in_pool)
{
for (int i = 0; i < max_events_in_pool; ++i)
for (int i = 0; i < initial_events_in_pool; ++i)
{
cudaEvent_t event;
// Create an cuda_event to query a CUDA/CUBLAS kernel for completion.
// Timing is disabled for performance. [1]
//
// [1]: CUDA Runtime API, section 5.5 cuda_event Management
check_cuda_error(
cudaEventCreateWithFlags(&event, cudaEventDisableTiming));
free_list_.push(event);
add_event_to_pool();
}
}

// on destruction, all objects in stack will be freed
~cuda_event_pool()
{
cudaEvent_t event;
for (int i = 0; i < max_events_in_pool; ++i)
bool ok = true;
while (ok)
{
free_list_.pop(event);
check_cuda_error(cudaEventDestroy(event));
ok = free_list_.pop(event);
if (ok)
check_cuda_error(cudaEventDestroy(event));
}
}

inline bool pop(cudaEvent_t& event)
{
return free_list_.pop(event);
// pop an event off the pool, if that fails, create a new one
while (!free_list_.pop(event))
{
add_event_to_pool();
}
return true;
}

inline bool push(cudaEvent_t event)
Expand All @@ -68,10 +68,20 @@ namespace hpx { namespace cuda { namespace experimental {
}

private:
// using a fixed capacity stack means no allocations are
// needed , throws an exception if the capacity is exceeded
boost::lockfree::stack<cudaEvent_t,
boost::lockfree::capacity<max_events_in_pool>>
void add_event_to_pool()
{
cudaEvent_t event;
// Create an cuda_event to query a CUDA/CUBLAS kernel for completion.
// Timing is disabled for performance. [1]
//
// [1]: CUDA Runtime API, section 5.5 cuda_event Management
check_cuda_error(
cudaEventCreateWithFlags(&event, cudaEventDisableTiming));
free_list_.push(event);
}

// pool is dynamically sized and can grow if needed
boost::lockfree::stack<cudaEvent_t, boost::lockfree::fixed_sized<false>>
free_list_;
};
}}} // namespace hpx::cuda::experimental
2 changes: 1 addition & 1 deletion libs/config/include/hpx/config/attributes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

///////////////////////////////////////////////////////////////////////////////
// handle [[deprecated]]
#if (HPX_HAVE_DEPRECATION_WARNINGS != 0)
#if HPX_HAVE_DEPRECATION_WARNINGS
# define HPX_DEPRECATED_MSG \
"This functionality is deprecated and will be removed in the future."
# define HPX_DEPRECATED(x) [[deprecated(x)]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ endif()

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

set(distributed_executors_headers
hpx/distributed_executors/distribution_policy_executor.hpp
set(executors_distributed_headers
hpx/executors_distributed/distribution_policy_executor.hpp
)

set(distributed_executors_compat_headers
set(executors_distributed_compat_headers
hpx/parallel/executors/distribution_policy_executor.hpp
)

include(HPX_AddModule)
add_hpx_module(
distributed_executors
executors_distributed
COMPATIBILITY_HEADERS ON
DEPRECATION_WARNINGS
GLOBAL_HEADER_GEN ON
HEADERS ${distributed_executors_headers}
COMPAT_HEADERS ${distributed_executors_compat_headers}
HEADERS ${executors_distributed_headers}
COMPAT_HEADERS ${executors_distributed_compat_headers}
DEPENDENCIES hpx_async_distributed hpx_config hpx_execution hpx_functional
hpx_type_support
CMAKE_SUBDIRS examples tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

=====================
distributed_executors
executors_distributed
=====================

This library is part of HPX.

Documentation can be found `here
<https://hpx-docs.stellar-group.org/latest/html/libs/distributed_executors/docs/index.html>`__.
<https://hpx-docs.stellar-group.org/latest/html/libs/executors_distributed/docs/index.html>`__.
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
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)

.. _libs_distributed_executors:
.. _libs_executors_distributed:

=====================
distributed_executors
executors_distributed
=====================

This module provides the executor
:cpp:class:`hpx::parallel::execution::disribution_policy_executor`. It allows
one to create work that is implicitly distributed over multiple localities.

See the :ref:`API reference <libs_distributed_executors_api>` of this module for more
See the :ref:`API reference <libs_executors_distributed_api>` of this module for more
details.

Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

if(HPX_WITH_EXAMPLES)
add_hpx_pseudo_target(examples.modules.distributed_executors)
add_hpx_pseudo_target(examples.modules.executors_distributed)
add_hpx_pseudo_dependencies(
examples.modules examples.modules.distributed_executors
examples.modules examples.modules.executors_distributed
)
if(HPX_WITH_TESTS
AND HPX_WITH_TESTS_EXAMPLES
AND HPX_DISTRIBUTED_EXECUTORS_WITH_TESTS
AND HPX_EXECUTORS_DISTRIBUTED_WITH_TESTS
)
add_hpx_pseudo_target(tests.examples.modules.distributed_executors)
add_hpx_pseudo_target(tests.examples.modules.executors_distributed)
add_hpx_pseudo_dependencies(
tests.examples.modules tests.examples.modules.distributed_executors
tests.examples.modules tests.examples.modules.executors_distributed
)
endif()
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
#pragma once

#include <hpx/config.hpp>
#include <hpx/distributed_executors/config/defines.hpp>
#include <hpx/modules/distributed_executors.hpp>
#include <hpx/executors_distributed/config/defines.hpp>
#include <hpx/modules/executors_distributed.hpp>

#if HPX_EXECUTION_HAVE_DEPRECATION_WARNINGS
#if HPX_EXECUTORS_DISTRIBUTED_HAVE_DEPRECATION_WARNINGS
#if defined(HPX_MSVC)
#pragma message( \
"The header hpx/parallel/executors/distribution_policy_executor.hpp is \
deprecated, please include \
hpx/modules/distributed_executors.hpp instead")
hpx/modules/executors_distributed.hpp instead")
#else
#warning \
"The header hpx/parallel/executors/distribution_policy_executor.hpp is \
deprecated, please include \
hpx/modules/distributed_executors.hpp instead"
hpx/modules/executors_distributed.hpp instead"
#endif
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -9,44 +9,44 @@ include(HPX_Option)

if(NOT HPX_WITH_TESTS AND HPX_TOP_LEVEL)
hpx_set_option(
HPX_DISTRIBUTED_EXECUTORS_WITH_TESTS
HPX_EXECUTORS_DISTRIBUTED_WITH_TESTS
VALUE OFF
FORCE
)
return()
endif()

if(HPX_DISTRIBUTED_EXECUTORS_WITH_TESTS)
if(HPX_EXECUTORS_DISTRIBUTED_WITH_TESTS)
if(HPX_WITH_TESTS_UNIT)
add_hpx_pseudo_target(tests.unit.modules.distributed_executors)
add_hpx_pseudo_target(tests.unit.modules.executors_distributed)
add_hpx_pseudo_dependencies(
tests.unit.modules tests.unit.modules.distributed_executors
tests.unit.modules tests.unit.modules.executors_distributed
)
add_subdirectory(unit)
endif()

if(HPX_WITH_TESTS_REGRESSIONS)
add_hpx_pseudo_target(tests.regressions.modules.distributed_executors)
add_hpx_pseudo_target(tests.regressions.modules.executors_distributed)
add_hpx_pseudo_dependencies(
tests.regressions.modules tests.regressions.modules.distributed_executors
tests.regressions.modules tests.regressions.modules.executors_distributed
)
add_subdirectory(regressions)
endif()

if(HPX_WITH_TESTS_BENCHMARKS)
add_hpx_pseudo_target(tests.performance.modules.distributed_executors)
add_hpx_pseudo_target(tests.performance.modules.executors_distributed)
add_hpx_pseudo_dependencies(
tests.performance.modules tests.performance.modules.distributed_executors
tests.performance.modules tests.performance.modules.executors_distributed
)
add_subdirectory(performance)
endif()

if(HPX_WITH_TESTS_HEADERS)
add_hpx_header_tests(
modules.distributed_executors
HEADERS ${distributed_executors_headers}
modules.executors_distributed
HEADERS ${executors_distributed_headers}
HEADER_ROOT ${PROJECT_SOURCE_DIR}/include
DEPENDENCIES hpx_distributed_executors
DEPENDENCIES hpx_executors_distributed
)
endif()
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ foreach(test ${tests})

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

set(folder_name "Tests/Unit/Modules/DistributedExecutors")
set(folder_name "Tests/Unit/Modules/ExecutorsDistributed")

add_hpx_executable(
${test}_test INTERNAL_FLAGS
Expand All @@ -22,6 +22,6 @@ foreach(test ${tests})
)

add_hpx_unit_test(
"modules.distributed_executors" ${test} ${${test}_PARAMETERS}
"modules.executors_distributed" ${test} ${${test}_PARAMETERS}
)
endforeach()
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <hpx/include/async.hpp>
#include <hpx/include/components.hpp>
#include <hpx/include/util.hpp>
#include <hpx/modules/distributed_executors.hpp>
#include <hpx/modules/executors_distributed.hpp>
#include <hpx/modules/testing.hpp>

///////////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion libs/include/include/hpx/include/compression.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <hpx/plugins/binary_filter/zlib_serialization_filter.hpp>
#endif

#if (HPX_HAVE_DEPRECATION_WARNINGS != 0)
#if HPX_HAVE_DEPRECATION_WARNINGS
#if defined(HPX_MSVC)
#pragma message("The header hpx/include/compression.hpp is deprecated, \
please include directly the corresponding header \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <hpx/plugins/binary_filter/zlib_serialization_filter_registration.hpp>
#endif

#if (HPX_HAVE_DEPRECATION_WARNINGS != 0)
#if HPX_HAVE_DEPRECATION_WARNINGS
#if defined(HPX_MSVC)
#pragma message( \
"The header hpx/include/compression_registration.hpp is deprecated, \
Expand Down
3 changes: 1 addition & 2 deletions libs/synchronization/include/hpx/synchronization/latch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,12 @@ namespace hpx { namespace lcos { namespace local {
{
HPX_ASSERT(update >= 0);

std::unique_lock<mutex_type> l(mtx_.data_);

std::ptrdiff_t new_count = (counter_ -= update);
HPX_ASSERT(new_count >= 0);

if (new_count == 0)
{
std::unique_lock<mutex_type> l(mtx_.data_);
notified_ = true;
cond_.data_.notify_all(std::move(l)); // release the threads
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <hpx/config.hpp>
#include <hpx/plugins/binary_filter/bzip2_serialization_filter.hpp>

#if (HPX_HAVE_DEPRECATION_WARNINGS != 0)
#if HPX_HAVE_DEPRECATION_WARNINGS
#if defined(HPX_MSVC)
#pragma message("The header hpx/include/compression_bzip2.hpp is deprecated, \
please include \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <hpx/config.hpp>
#include <hpx/plugins/binary_filter/snappy_serialization_filter.hpp>

#if (HPX_HAVE_DEPRECATION_WARNINGS != 0)
#if HPX_HAVE_DEPRECATION_WARNINGS
#if defined(HPX_MSVC)
#pragma message("The header hpx/include/compression_snappy.hpp is deprecated, \
please include \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <hpx/config.hpp>
#include <hpx/plugins/binary_filter/zlib_serialization_filter.hpp>

#if (HPX_HAVE_DEPRECATION_WARNINGS != 0)
#if HPX_HAVE_DEPRECATION_WARNINGS
#if defined(HPX_MSVC)
#pragma message("The header hpx/include/compression_zlib.hpp is deprecated, \
please include \
Expand Down

0 comments on commit 3148105

Please sign in to comment.