Skip to content

Commit

Permalink
Merge branch 'STEllAR-GROUP:master' into feature/lockfree-uint128
Browse files Browse the repository at this point in the history
  • Loading branch information
Dysrhythmic authored Sep 8, 2024
2 parents 02b2c24 + f4ff6e8 commit 0833ee7
Show file tree
Hide file tree
Showing 257 changed files with 14,720 additions and 2,181 deletions.
6 changes: 2 additions & 4 deletions .circleci/tests.unit1.algorithms
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

tests.unit.modules.algorithms.algorithms.adjacentdifference
tests.unit.modules.algorithms.algorithms.adjacentdifference_sender
tests.unit.modules.algorithms.algorithms.adjacentfind
tests.unit.modules.algorithms.algorithms.adjacentfind_binary
tests.unit.modules.algorithms.algorithms.all_of
Expand All @@ -31,7 +30,6 @@ tests.unit.modules.algorithms.algorithms.exclusive_scan_validate
tests.unit.modules.algorithms.algorithms.fill
tests.unit.modules.algorithms.algorithms.filln
tests.unit.modules.algorithms.algorithms.find
tests.unit.modules.algorithms.algorithms.find_sender
tests.unit.modules.algorithms.algorithms.findend
tests.unit.modules.algorithms.algorithms.findfirstof
tests.unit.modules.algorithms.algorithms.findfirstof_binary
Expand All @@ -40,7 +38,6 @@ tests.unit.modules.algorithms.algorithms.findifnot
tests.unit.modules.algorithms.algorithms.foreach
tests.unit.modules.algorithms.algorithms.foreach_executors
tests.unit.modules.algorithms.algorithms.foreach_prefetching
tests.unit.modules.algorithms.algorithms.foreach_sender
tests.unit.modules.algorithms.algorithms.foreach_scheduler
tests.unit.modules.algorithms.algorithms.foreachn
tests.unit.modules.algorithms.algorithms.foreachn_exception
Expand All @@ -53,7 +50,6 @@ tests.unit.modules.algorithms.algorithms.for_loop_n
tests.unit.modules.algorithms.algorithms.for_loop_n_strided
tests.unit.modules.algorithms.algorithms.for_loop_reduction
tests.unit.modules.algorithms.algorithms.for_loop_reduction_async
tests.unit.modules.algorithms.algorithms.for_loop_sender
tests.unit.modules.algorithms.algorithms.for_loop_strided
tests.unit.modules.algorithms.algorithms.generate
tests.unit.modules.algorithms.algorithms.generaten
Expand All @@ -74,3 +70,5 @@ tests.unit.modules.algorithms.algorithms.min_element
tests.unit.modules.algorithms.algorithms.minmax_element
tests.unit.modules.algorithms.algorithms.mismatch
tests.unit.modules.algorithms.algorithms.mismatch_binary
tests.unit.modules.algorithms.algorithms.move
tests.unit.modules.algorithms.algorithms.nth_element
5 changes: 0 additions & 5 deletions .circleci/tests.unit2.algorithms
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
# 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)

tests.unit.modules.algorithms.algorithms.move
tests.unit.modules.algorithms.algorithms.nth_element
tests.unit.modules.algorithms.algorithms.none_of
tests.unit.modules.algorithms.algorithms.parallel_sort
tests.unit.modules.algorithms.algorithms.partial_sort
Expand All @@ -15,7 +13,6 @@ tests.unit.modules.algorithms.algorithms.partition_copy
tests.unit.modules.algorithms.algorithms.reduce_
tests.unit.modules.algorithms.algorithms.reduce_by_key
tests.unit.modules.algorithms.algorithms.remove
tests.unit.modules.algorithms.algorithms.remove
tests.unit.modules.algorithms.algorithms.remove1
tests.unit.modules.algorithms.algorithms.remove2
tests.unit.modules.algorithms.algorithms.remove_if
Expand All @@ -28,10 +25,8 @@ tests.unit.modules.algorithms.algorithms.replace_copy
tests.unit.modules.algorithms.algorithms.replace_copy_if
tests.unit.modules.algorithms.algorithms.reverse
tests.unit.modules.algorithms.algorithms.reverse_copy
tests.unit.modules.algorithms.algorithms.reverse_sender
tests.unit.modules.algorithms.algorithms.rotate
tests.unit.modules.algorithms.algorithms.rotate_copy
tests.unit.modules.algorithms.algorithms.rotate_sender
tests.unit.modules.algorithms.algorithms.search
tests.unit.modules.algorithms.algorithms.searchn
tests.unit.modules.algorithms.algorithms.set_difference
Expand Down
27 changes: 26 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright (c) 2020 Mikael Simberg
# Copyright (c) 2007-2024 Hartmut Kaiser
# Copyright (c) 2011-2014 Thomas Heller
# Copyright (c) 2024 Isidoros Tsaousis-Seiras
# Copyright (c) 2007-2008 Chirag Dekate
# Copyright (c) 2011 Bryce Lelbach
# Copyright (c) 2011 Vinay C Amatya
Expand Down Expand Up @@ -578,6 +579,27 @@ if(HPX_WITH_CUDA AND HPX_WITH_HIP)
)
endif()

# ## HPX STDEXEC configuration ##

hpx_option(
HPX_WITH_STDEXEC BOOL
"Use STDEXEC executors instead of native HPX.(default: OFF)" OFF
CATEGORY "Executor"
ADVANCED
)

hpx_option(
HPX_WITH_FETCH_STDEXEC BOOL "Use FetchContent to fetch STDEXEC.(default: ON)"
ON
CATEGORY "Executor"
ADVANCED
)

hpx_option(
HPX_WITH_STDEXEC_TAG STRING "STDEXEC repository tag or branch" "main"
CATEGORY "Executor"
)

# ##############################################################################
# HPX SYCL configuration
# ##############################################################################
Expand Down Expand Up @@ -1346,7 +1368,7 @@ if(HPX_WITH_NETWORKING AND HPX_WITH_PARCELPORT_LCI)
endif()
endif()

# External libraries/frameworks used by sme of the examples and benchmarks
# External libraries/frameworks used by some of the examples and benchmarks
hpx_option(
HPX_WITH_EXAMPLES_OPENMP BOOL
"Enable examples requiring OpenMP support (default: OFF)." OFF
Expand Down Expand Up @@ -2265,6 +2287,9 @@ if(HPX_WITH_CUDA OR HPX_WITH_HIP)
hpx_add_config_define(HPX_HAVE_GPU_SUPPORT)
endif()

# Setup NVIDIA's stdexec if requested
include(HPX_SetupStdexec)

if(HPX_WITH_SANITIZERS)
hpx_add_config_define(HPX_HAVE_SANITIZERS)
endif()
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Documentation
=============

If you plan to use HPX we suggest to start with the latest released version
which can be downloaded `here <https://stellar.cct.lsu.edu/downloads/>`_.
which can be downloaded `here <https://github.com/STEllAR-GROUP/hpx/releases/>`_.

To quickly get started with HPX on most Linux distributions you can read the
quick start guide `here
Expand Down
39 changes: 39 additions & 0 deletions cmake/FindStdexec.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright (c) 2024 Isidoros Tsaousis-Seiras
#
# 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)

if(NOT TARGET STDEXEC::stdexec)
if(STDEXEC_ROOT AND NOT Stdexec_ROOT)
set(Stdexec_ROOT
${STDEXEC_ROOT}
CACHE PATH "stdexec base directory"
)
unset(STDEXEC_ROOT CACHE)
endif()

find_path(Stdexec_INCLUDE_DIR stdexec HINTS ${Stdexec_ROOT})
message(STATUS "stdexec include dir: ${Stdexec_INCLUDE_DIR}")
if(Stdexec_INCLUDE_DIR)
file(TO_CMAKE_PATH ${Stdexec_INCLUDE_DIR} Stdexec_INCLUDE_DIR)
else()
message(FATAL_ERROR "stdexec not found")
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
Stdexec
REQUIRED_VARS Stdexec_INCLUDE_DIR
FOUND_VAR Stdexec_FOUND
VERSION_VAR Stdexec_VERSION
FAIL_MESSAGE "stdexec not found"
)

add_library(STDEXEC::stdexec INTERFACE IMPORTED)
target_include_directories(
STDEXEC::stdexec SYSTEM INTERFACE ${Stdexec_INCLUDE_DIR}
)

mark_as_advanced(Stdexec_INCLUDE_DIR Stdexec_ROOT)
endif()
9 changes: 9 additions & 0 deletions cmake/HPX_AddConfigTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,15 @@ function(hpx_check_for_cxx20_std_bit_cast)
)
endfunction()

# ##############################################################################
function(hpx_check_for_cxx20_std_identity)
add_hpx_config_test(
HPX_WITH_CXX20_STD_IDENTITY
SOURCE cmake/tests/cxx20_std_identity.cpp
FILE ${ARGN}
)
endfunction()

# ##############################################################################
function(hpx_check_for_cxx20_constexpr_destructor)
add_hpx_config_test(
Expand Down
2 changes: 2 additions & 0 deletions cmake/HPX_PerformCxxFeatureTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ function(hpx_perform_cxx_feature_tests)

hpx_check_for_cxx20_std_bit_cast(DEFINITIONS HPX_HAVE_CXX20_STD_BIT_CAST)

hpx_check_for_cxx20_std_identity(DEFINITIONS HPX_HAVE_CXX20_STD_IDENTITY)

hpx_check_for_cxx20_constexpr_destructor(
DEFINITIONS HPX_HAVE_CXX20_CONSTEXPR_DESTRUCTOR
)
Expand Down
2 changes: 1 addition & 1 deletion cmake/HPX_SetupBoost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ if(NOT TARGET hpx_dependencies_boost)
hpx_set_cmake_policy(CMP0167 OLD) # use CMake's FindBoost for now

# Find the headers and get the version
find_package(Boost ${Boost_MINIMUM_VERSION} REQUIRED)
find_package(Boost ${Boost_MINIMUM_VERSION} NO_POLICY_SCOPE MODULE REQUIRED)
if(NOT Boost_VERSION_STRING)
set(Boost_VERSION_STRING
"${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}"
Expand Down
104 changes: 104 additions & 0 deletions cmake/HPX_SetupStdexec.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Copyright (c) 2024 Isidoros Tsaousis-Seiras
#
# 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)

if(HPX_WITH_STDEXEC)
if(HPX_WITH_CXX_STANDARD LESS 20)
hpx_error("HPX_WITH_STDEXEC Requires C++20 or later.")
endif()
if(NOT HPX_WITH_CXX20_STD_IDENTITY)
hpx_error("HPX_WITH_STDEXEC Requires std::identity.")
endif()
if(MSVC)
hpx_error("HPX_WITH_STDEXEC is not available on MSVC.")
endif()
endif()

if(STDEXEC_ROOT AND NOT Stdexec_ROOT)
set(Stdexec_ROOT ${STDEXEC_ROOT})
# remove STDEXEC_ROOT from the cache
unset(STDEXEC_ROOT CACHE)
endif()

if(HPX_WITH_STDEXEC)
# prefer HPX_WITH_FETCH_STDEXEC by default
if(Stdexec_ROOT AND HPX_WITH_FETCH_STDEXEC)
hpx_warn(
"Both Stdexec_ROOT and HPX_WITH_FETCH_STDEXEC are provided. HPX_WITH_FETCH_STDEXEC will take precedence."
)
endif()

hpx_add_config_define(HPX_HAVE_STDEXEC)

if(HPX_WITH_FETCH_STDEXEC)
hpx_info(
"HPX_WITH_FETCH_STDEXEC=${HPX_WITH_FETCH_STDEXEC}, Stdexec will be fetched using CMake's FetchContent and installed alongside HPX (HPX_WITH_STDEXEC_TAG=${HPX_WITH_STDEXEC_TAG})"
)
if(UNIX)
include(FetchContent)
fetchcontent_declare(
Stdexec
GIT_REPOSITORY https://github.com/NVIDIA/stdexec.git
GIT_TAG ${HPX_WITH_STDEXEC_TAG}
)

fetchcontent_getproperties(Stdexec)
if(NOT Stdexec_POPULATED)
fetchcontent_populate(Stdexec)
endif()
set(Stdexec_ROOT ${stdexec_SOURCE_DIR})

add_library(Stdexec INTERFACE)
target_include_directories(
Stdexec INTERFACE $<BUILD_INTERFACE:${stdexec_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)

install(
TARGETS Stdexec
EXPORT HPXStdexecTarget
COMPONENT core
)

install(
DIRECTORY ${Stdexec_ROOT}/include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
COMPONENT core
FILES_MATCHING
PATTERN "*.hpp"
)

export(
TARGETS Stdexec
NAMESPACE Stdexec::
FILE "${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/${HPX_PACKAGE_NAME}/HPXStdexecTarget.cmake"
)

install(
EXPORT HPXStdexecTarget
NAMESPACE Stdexec::
FILE HPXStdexecTarget.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${HPX_PACKAGE_NAME}
COMPONENT cmake
)

# TODO: Enforce a single spelling
add_library(Stdexec::Stdexec ALIAS Stdexec)
add_library(STDEXEC::stdexec ALIAS Stdexec)

endif()

else()
find_package(Stdexec REQUIRED)

if(Stdexec_FOUND)
hpx_add_config_define(HPX_HAVE_STDEXEC)
else()
hpx_error(
"Stdexec could not be found, please specify Stdexec_ROOT to point to the correct location or enable HPX_WITH_FETCH_STDEXEC"
)
endif()
endif()
endif()
14 changes: 14 additions & 0 deletions cmake/templates/HPXConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,20 @@ else()
include(HPX_SetupAsio)
endif()


# Stdexec can be installed by HPX or externally installed. In the first case we use
# exported targets, in the second we find Stdexec again using find_package.
if(HPX_WITH_STDEXEC)
if(HPX_WITH_FETCH_STDEXEC)
include("${CMAKE_CURRENT_LIST_DIR}/HPXStdexecTarget.cmake")
else()
set(Stdexec_ROOT "@Stdexec_ROOT@")
include(HPX_SetupStdexec)
endif()
endif()



# NLohnmann JSON can be installed by HPX or externally installed. In the first
# case we use exported targets, in the second we find JSON again using
# find_package.
Expand Down
14 changes: 14 additions & 0 deletions cmake/tests/cxx20_std_identity.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright (c) 2024 Isidoros Tsaousis-Seiras
//
// 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)

// test for availability of std::identity

#include <functional>

int main()
{
auto f = std::identity{}(3);
}
9 changes: 7 additions & 2 deletions docs/sphinx/manual/using_the_lci_parcelport.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,19 @@ Run |hpx| with the LCI parcelport
=================================

We use the same mechanisms as MPI to launch LCI, so you can use the same way you run MPI parcelport to run LCI
parcelport. Typically, it would be ``hpxrun``, ``mpirun``, or ``srun``.
parcelport. Typically, it would be ``hpxrun.py``, ``mpirun``, or ``srun``.

If you are using ``hpxrun.py``, just pass ``--parcelport lci`` to the scripts.
``hpxrun.py`` serves as a wrapper for ``mpirun`` and ``srun``.
If you are using ``hpxrun.py``, pass ``-p lci`` to the scripts. You also need to pass either ``-r mpi`` or
``-r srun`` to select the correct run wrapper according to the platform.

If you are using ``mpirun`` or ``srun``, you can just pass
``--hpx:ini=hpx.parcel.lci.priority=1000``, ``--hpx:ini=hpx.parcel.lci.enable=1``, and
``--hpx:ini=hpx.parcel.bootstrap=lci`` to the |hpx| applications.

The ``hpxrun.py`` argument ``-r none`` (the default option for the run wrapper) and its corresponding |hpx| arguments
``--hpx:hpx`` and ``--hpx:agas`` do not work for the MPI or the LCI parcelport.

.. _tune_lci_pp:

Performance tuning of the LCI parcelport
Expand Down
4 changes: 4 additions & 0 deletions libs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,10 @@ if(HPX_WITH_ITTNOTIFY)
target_link_libraries(hpx_core PUBLIC Amplifier::amplifier)
endif()

if(TARGET STDEXEC::stdexec)
target_link_libraries(hpx_core INTERFACE STDEXEC::stdexec)
endif()

if(HPX_WITH_PARCELPORT_GASNET AND GASNET_LIBRARY_DIRS)
target_link_directories(hpx_core PUBLIC ${GASNET_LIBRARY_DIRS})
endif()
Expand Down
Loading

0 comments on commit 0833ee7

Please sign in to comment.