Skip to content

[WIP] Boost dash::sort with even more parallelism #611

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 99 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
0c608f6
added a specific configuration for Intel KNL
Nov 21, 2018
f3679f5
Add Intel Parallel STL for ICC > 2018
Nov 21, 2018
2d36a52
include MPI linker flags in compiler wrapper
Nov 22, 2018
21ba37a
include parallel stl in dash::sort
Nov 22, 2018
c08a21e
Merge branch 'fix-constexpr-icc19' into feat-sort-parallel-stl
Nov 22, 2018
9cb3fd4
refactor and centralize parallel sort
Nov 27, 2018
d9732a9
different value type for test
Nov 28, 2018
52cb8c3
Merge remote-tracking branch 'origin/development' into feat-sort-high…
Nov 28, 2018
46a4d5b
rename pstl config to algo_pstl
Nov 23, 2018
a0e8b71
Merge remote-tracking branch 'dash/development' into feat-sort-high-p…
Nov 30, 2018
cf5bef2
Find Parallel STL properly on SuperMUC environment
Dec 2, 2018
ba99e30
remove unknown flag
Dec 2, 2018
47cfcbc
use parallelism according to locality information
Dec 2, 2018
4f76d60
fix detection of pstl in OpenHPC stack
Dec 2, 2018
57dfd3f
minor refactoring for the sorting algorithm
Dec 5, 2018
1fe1c4d
added exclusive scan operation in DASH and DART
Dec 9, 2018
a903131
remove erroneuous logging
Dec 9, 2018
1d89255
refactor to use more efficient MPI communication
Dec 9, 2018
4e2e594
fix trace numbering
Dec 9, 2018
a63d717
do not send empty messages
Dec 10, 2018
763fc01
Use std::async for merging
pascalj Dec 4, 2018
daf928d
Remove unused file dash/internal/Config.in.h
devreal Nov 19, 2018
a124c91
Parse git commit hash and add it as compiler macro
devreal Nov 19, 2018
6fd6246
Add compiler version to benchmark output
devreal Nov 19, 2018
35e3955
Move specification of DASH version into head file
devreal Nov 19, 2018
a7d9fe4
Re-add version to CMake file and generate Version.h from it
devreal Nov 19, 2018
83c3c16
Do not define DASH_GIT_COMMIT in Version.h unless the git commit is a…
devreal Nov 20, 2018
a63ef36
Print DART environment variables in BenchmarkParams
devreal Nov 20, 2018
1a631cd
fix tracing
Dec 10, 2018
76085ad
make strided iterator constexpr
Dec 11, 2018
c9849bb
rename detail namespace to impl namespace
Dec 11, 2018
24965f8
fix missing traces
Dec 11, 2018
758138c
Move the copy_async future into lambda
pascalj Dec 11, 2018
c8e7806
Merge branch 'feat-sort-high-parallelism' of github.com:dash-project/…
pascalj Dec 11, 2018
6a303ea
change put to get variant for correct merging -> Tests not
Dec 12, 2018
26ac2b5
fix a bug in communication / merge overlap
Dec 13, 2018
239fc7c
Use std::merge instread of inplace_merge for the last step
pascalj Dec 14, 2018
ce06c8f
Use the sort_comp lambda also for merging
pascalj Dec 14, 2018
3a01410
temporary commit to simplify the sort algorithm and to reduce lots of
Dec 14, 2018
ef63a7e
remove two all-to-all communication steps
Dec 14, 2018
54c87df
Try to compile with threadsupport on CI
pascalj Dec 14, 2018
c49f892
fix deadlock if we have a local empty range at the beginning
Dec 14, 2018
1d421d7
fix missing information in trace
Dec 14, 2018
9d082a6
make GlobLocalMemoryPool thread-safe
Dec 16, 2018
f1b18ce
temporarily disable strange ThreadsafeTest.ConcurrentAlgorithm
Dec 16, 2018
a025c19
disable another thread safety test
Dec 16, 2018
376ba84
Add thread pool
pascalj Dec 15, 2018
2bb4744
Move all-to-all and merge to its own file
pascalj Dec 16, 2018
1fc1b8e
Use std::future<result_t> for the thread pool
pascalj Dec 16, 2018
ae9304f
Merge remote-tracking branch 'dash/development' into feat-sort-high-p…
Dec 16, 2018
f3cac18
add a config file to manage node level parallelism
Dec 17, 2018
8b8d842
Use operator[] for std::map access in threads
pascalj Dec 18, 2018
8be6273
Use dash_get_handle instead of async_copy
pascalj Dec 18, 2018
8749a5c
Test whether the range dependencies are waitable
pascalj Dec 18, 2018
0d568a8
fix tbb config since it is neither swappable nor movable
Dec 18, 2018
53633f8
fix identation again
Dec 18, 2018
62cd0ee
fix narrowing conversion
Dec 18, 2018
4e9c3e0
Use a threadpool of the configured size
pascalj Dec 18, 2018
7fb4bc5
Remove constexpr in NodeParallelismConfig
pascalj Dec 19, 2018
ab39386
add the possibility to pass an explicit output iterator
Dec 19, 2018
23aa200
Prepare support for non-inplace sort and enhance documentation
Dec 20, 2018
13da0d9
minor refactoring
Dec 20, 2018
c926b82
minor refactoring to support sort and merge strategies via templates
Dec 21, 2018
02f6d1d
minor changes
Dec 21, 2018
26499b3
minor changes
Dec 21, 2018
07ca18f
refactoring for preparation of non-in-place sort
Dec 25, 2018
5374432
use a unique pointer for the local buffer instead of a vector
Dec 26, 2018
448b802
remove duplicate code
Dec 26, 2018
d6df5ae
add cpp17 monotonic buffer resource
Dec 26, 2018
f5f09a7
minmax in separate function
Dec 27, 2018
ba855c0
add a very simple integer range class
Dec 27, 2018
2cd3d95
simplify and remove some ugly stuff
Dec 27, 2018
0e3067e
rely on copy ellision instead of explicit moves
Dec 28, 2018
531e8a6
fix an error after refactoring
Dec 28, 2018
b2d51a0
minor changes
Dec 28, 2018
32ccc26
added non in-place sort: tests cannot be passed
Dec 28, 2018
deb6545
minor refactoring
Dec 28, 2018
9c4eebe
Add non-inplace merge
pascalj Dec 31, 2018
a220257
Handle non-inplace edge case with n=1
pascalj Dec 31, 2018
e051f2b
remove branches in loops
Dec 28, 2018
4c45890
simplify the local data container
Jan 1, 2019
ab8fbf0
remove non-existent include
Jan 1, 2019
53afd7c
add unit test which uses sort instead of merge as a final step
Jan 2, 2019
dd0e08a
Switch to alltoallv for data exchange
pascalj Jan 15, 2019
66f391e
Add comment for send counts
pascalj Jan 15, 2019
3a22430
Check if value_type is supported by dart
pascalj Jan 16, 2019
9f44af8
minor changes
Jan 20, 2019
bc85377
log number of iterations even in release build temporarily
Jan 24, 2019
02d8fbe
minor changes
Jan 25, 2019
2537a35
enable thread support for algorithms independent of DART
Jan 25, 2019
79a9cba
some minor refactorings and const correctness
Feb 5, 2019
889e38f
remove unnecessary barrier
Feb 5, 2019
8a3436d
remove empty file
Feb 5, 2019
f2b9c08
Revert "make GlobLocalMemoryPool thread-safe"
Feb 5, 2019
264bdd3
reenable test
Feb 5, 2019
cb08349
dash::sort: remove merge implementation as not need for now
Feb 5, 2019
48f9a53
remove thread support in ci
Feb 5, 2019
cf39716
no magic numbers
Feb 5, 2019
151a6b9
replace ugly macros with lovely constexprs
Feb 5, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
303 changes: 303 additions & 0 deletions CMakeExt/FindTBB.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,303 @@
# The MIT License (MIT)
#
# Copyright (c) 2015 Justus Calvin
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

#
# FindTBB
# -------
#
# Find TBB include directories and libraries.
#
# Usage:
#
# find_package(TBB [major[.minor]] [EXACT]
# [QUIET] [REQUIRED]
# [[COMPONENTS] [components...]]
# [OPTIONAL_COMPONENTS components...])
#
# where the allowed components are tbbmalloc and tbb_preview. Users may modify
# the behavior of this module with the following variables:
#
# * TBB_ROOT_DIR - The base directory the of TBB installation.
# * TBB_INCLUDE_DIR - The directory that contains the TBB headers files.
# * TBB_LIBRARY - The directory that contains the TBB library files.
# * TBB_<library>_LIBRARY - The path of the TBB the corresponding TBB library.
# These libraries, if specified, override the
# corresponding library search results, where <library>
# may be tbb, tbb_debug, tbbmalloc, tbbmalloc_debug,
# tbb_preview, or tbb_preview_debug.
# * TBB_USE_DEBUG_BUILD - The debug version of tbb libraries, if present, will
# be used instead of the release version.
#
# Users may modify the behavior of this module with the following environment
# variables:
#
# * TBB_INSTALL_DIR
# * TBBROOT
# * LIBRARY_PATH
#
# This module will set the following variables:
#
# * TBB_FOUND - Set to false, or undefined, if we haven’t found, or
# don’t want to use TBB.
# * TBB_<component>_FOUND - If False, optional <component> part of TBB sytem is
# not available.
# * TBB_VERSION - The full version string
# * TBB_VERSION_MAJOR - The major version
# * TBB_VERSION_MINOR - The minor version
# * TBB_INTERFACE_VERSION - The interface version number defined in
# tbb/tbb_stddef.h.
# * TBB_<library>_LIBRARY_RELEASE - The path of the TBB release version of
# <library>, where <library> may be tbb, tbb_debug,
# tbbmalloc, tbbmalloc_debug, tbb_preview, or
# tbb_preview_debug.
# * TBB_<library>_LIBRARY_DEGUG - The path of the TBB release version of
# <library>, where <library> may be tbb, tbb_debug,
# tbbmalloc, tbbmalloc_debug, tbb_preview, or
# tbb_preview_debug.
#
# The following varibles should be used to build and link with TBB:
#
# * TBB_INCLUDE_DIRS - The include directory for TBB.
# * TBB_LIBRARIES - The libraries to link against to use TBB.
# * TBB_LIBRARIES_RELEASE - The release libraries to link against to use TBB.
# * TBB_LIBRARIES_DEBUG - The debug libraries to link against to use TBB.
# * TBB_DEFINITIONS - Definitions to use when compiling code that uses
# TBB.
# * TBB_DEFINITIONS_RELEASE - Definitions to use when compiling release code that
# uses TBB.
# * TBB_DEFINITIONS_DEBUG - Definitions to use when compiling debug code that
# uses TBB.
#
# This module will also create the "tbb" target that may be used when building
# executables and libraries.

include(FindPackageHandleStandardArgs)

if(NOT TBB_FOUND)

##################################
# Check the build type
##################################

if(NOT DEFINED TBB_USE_DEBUG_BUILD)
if(CMAKE_BUILD_TYPE MATCHES "(Debug|DEBUG|debug|RelWithDebInfo|RELWITHDEBINFO|relwithdebinfo)")
set(TBB_BUILD_TYPE DEBUG)
else()
set(TBB_BUILD_TYPE RELEASE)
endif()
elseif(TBB_USE_DEBUG_BUILD)
set(TBB_BUILD_TYPE DEBUG)
else()
set(TBB_BUILD_TYPE RELEASE)
endif()

##################################
# Set the TBB search directories
##################################

# Define search paths based on user input and environment variables
set(TBB_SEARCH_DIR ${TBB_ROOT_DIR} $ENV{TBB_BASE} $ENV{TBB_INSTALL_DIR} $ENV{TBBROOT})

# Define the search directories based on the current platform
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
set(TBB_DEFAULT_SEARCH_DIR "C:/Program Files/Intel/TBB"
"C:/Program Files (x86)/Intel/TBB")

# Set the target architecture
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(TBB_ARCHITECTURE "intel64")
else()
set(TBB_ARCHITECTURE "ia32")
endif()

# Set the TBB search library path search suffix based on the version of VC
if(WINDOWS_STORE)
set(TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc11_ui")
elseif(MSVC14)
set(TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc14")
elseif(MSVC12)
set(TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc12")
elseif(MSVC11)
set(TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc11")
elseif(MSVC10)
set(TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc10")
endif()

# Add the library path search suffix for the VC independent version of TBB
list(APPEND TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc_mt")

elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
# OS X
set(TBB_DEFAULT_SEARCH_DIR "/opt/intel/tbb")

# TODO: Check to see which C++ library is being used by the compiler.
if(NOT ${CMAKE_SYSTEM_VERSION} VERSION_LESS 13.0)
# The default C++ library on OS X 10.9 and later is libc++
set(TBB_LIB_PATH_SUFFIX "lib/libc++" "lib")
else()
set(TBB_LIB_PATH_SUFFIX "lib")
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# Linux
set(TBB_DEFAULT_SEARCH_DIR "/opt/intel/tbb")

# TODO: Check compiler version to see the suffix should be <arch>/gcc4.1 or
# <arch>/gcc4.1. For now, assume that the compiler is more recent than
# gcc 4.4.x or later.
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
set(TBB_LIB_PATH_SUFFIX "lib/intel64/gcc4.4")
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")
set(TBB_LIB_PATH_SUFFIX "lib/ia32/gcc4.4")
endif()
endif()

##################################
# Find the TBB include dir
##################################

find_path(TBB_INCLUDE_DIRS tbb/tbb.h
HINTS ${TBB_INCLUDE_DIR} ${TBB_SEARCH_DIR}
PATHS ${TBB_DEFAULT_SEARCH_DIR}
PATH_SUFFIXES include)

##################################
# Set version strings
##################################

if(TBB_INCLUDE_DIRS)
file(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _tbb_version_file)
string(REGEX REPLACE ".*#define TBB_VERSION_MAJOR ([0-9]+).*" "\\1"
TBB_VERSION_MAJOR "${_tbb_version_file}")
string(REGEX REPLACE ".*#define TBB_VERSION_MINOR ([0-9]+).*" "\\1"
TBB_VERSION_MINOR "${_tbb_version_file}")
string(REGEX REPLACE ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1"
TBB_INTERFACE_VERSION "${_tbb_version_file}")
set(TBB_VERSION "${TBB_VERSION_MAJOR}.${TBB_VERSION_MINOR}")
endif()

##################################
# Find TBB components
##################################

if(TBB_VERSION VERSION_LESS 4.3)
set(TBB_SEARCH_COMPOMPONENTS tbb_preview tbbmalloc tbb)
else()
set(TBB_SEARCH_COMPOMPONENTS tbb_preview tbbmalloc_proxy tbbmalloc tbb)
endif()

# Find each component
foreach(_comp ${TBB_SEARCH_COMPOMPONENTS})
if(";${TBB_FIND_COMPONENTS};tbb;" MATCHES ";${_comp};")

# Search for the libraries
find_library(TBB_${_comp}_LIBRARY_RELEASE ${_comp}
HINTS ${TBB_LIBRARY} ${TBB_SEARCH_DIR}
PATHS ${TBB_DEFAULT_SEARCH_DIR} ENV LIBRARY_PATH
PATH_SUFFIXES ${TBB_LIB_PATH_SUFFIX})

find_library(TBB_${_comp}_LIBRARY_DEBUG ${_comp}_debug
HINTS ${TBB_LIBRARY} ${TBB_SEARCH_DIR}
PATHS ${TBB_DEFAULT_SEARCH_DIR} ENV LIBRARY_PATH
PATH_SUFFIXES ${TBB_LIB_PATH_SUFFIX})

if(TBB_${_comp}_LIBRARY_DEBUG)
list(APPEND TBB_LIBRARIES_DEBUG "${TBB_${_comp}_LIBRARY_DEBUG}")
endif()
if(TBB_${_comp}_LIBRARY_RELEASE)
list(APPEND TBB_LIBRARIES_RELEASE "${TBB_${_comp}_LIBRARY_RELEASE}")
endif()
if(TBB_${_comp}_LIBRARY_${TBB_BUILD_TYPE} AND NOT TBB_${_comp}_LIBRARY)
set(TBB_${_comp}_LIBRARY "${TBB_${_comp}_LIBRARY_${TBB_BUILD_TYPE}}")
endif()

if(TBB_${_comp}_LIBRARY AND EXISTS "${TBB_${_comp}_LIBRARY}")
set(TBB_${_comp}_FOUND TRUE)
else()
set(TBB_${_comp}_FOUND FALSE)
endif()

# Mark internal variables as advanced
mark_as_advanced(TBB_${_comp}_LIBRARY_RELEASE)
mark_as_advanced(TBB_${_comp}_LIBRARY_DEBUG)
mark_as_advanced(TBB_${_comp}_LIBRARY)

endif()
endforeach()

##################################
# Set compile flags and libraries
##################################

set(TBB_DEFINITIONS_RELEASE "")
set(TBB_DEFINITIONS_DEBUG "-DTBB_USE_DEBUG=1")

if(TBB_LIBRARIES_${TBB_BUILD_TYPE})
set(TBB_DEFINITIONS "${TBB_DEFINITIONS_${TBB_BUILD_TYPE}}")
set(TBB_LIBRARIES "${TBB_LIBRARIES_${TBB_BUILD_TYPE}}")
elseif(TBB_LIBRARIES_RELEASE)
set(TBB_DEFINITIONS "${TBB_DEFINITIONS_RELEASE}")
set(TBB_LIBRARIES "${TBB_LIBRARIES_RELEASE}")
elseif(TBB_LIBRARIES_DEBUG)
set(TBB_DEFINITIONS "${TBB_DEFINITIONS_DEBUG}")
set(TBB_LIBRARIES "${TBB_LIBRARIES_DEBUG}")
endif()

find_package_handle_standard_args(TBB
REQUIRED_VARS TBB_INCLUDE_DIRS TBB_LIBRARIES
HANDLE_COMPONENTS
VERSION_VAR TBB_VERSION)

##################################
# Create targets
##################################

if(NOT CMAKE_VERSION VERSION_LESS 3.0 AND TBB_FOUND)
add_library(tbb SHARED IMPORTED)
set_target_properties(tbb PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${TBB_INCLUDE_DIRS}
IMPORTED_LOCATION ${TBB_LIBRARIES})
if(TBB_LIBRARIES_RELEASE AND TBB_LIBRARIES_DEBUG)
set_target_properties(tbb PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "$<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:TBB_USE_DEBUG=1>"
IMPORTED_LOCATION_DEBUG ${TBB_LIBRARIES_DEBUG}
IMPORTED_LOCATION_RELWITHDEBINFO ${TBB_LIBRARIES_DEBUG}
IMPORTED_LOCATION_RELEASE ${TBB_LIBRARIES_RELEASE}
IMPORTED_LOCATION_MINSIZEREL ${TBB_LIBRARIES_RELEASE}
)
elseif(TBB_LIBRARIES_RELEASE)
set_target_properties(tbb PROPERTIES IMPORTED_LOCATION ${TBB_LIBRARIES_RELEASE})
else()
set_target_properties(tbb PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "${TBB_DEFINITIONS_DEBUG}"
IMPORTED_LOCATION ${TBB_LIBRARIES_DEBUG}
)
endif()
endif()

mark_as_advanced(TBB_INCLUDE_DIRS TBB_LIBRARIES)

unset(TBB_ARCHITECTURE)
unset(TBB_BUILD_TYPE)
unset(TBB_LIB_PATH_SUFFIX)
unset(TBB_DEFAULT_SEARCH_DIR)

endif()
3 changes: 3 additions & 0 deletions CMakeExt/GenerateDASHCXX.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ if (";${DART_IMPLEMENTATIONS_LIST};" MATCHES ";mpi;")
set(ADDITIONAL_LIBRARIES_WRAP
"${ADDITIONAL_LIBRARIES_WRAP} ${MPI_C_LIB}")
endforeach()
if(MPI_LINK_FLAGS)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAG} ${MPI_LINK_FLAGS}")
endif()
set(ADDITIONAL_INCLUDES_WRAP "${ADDITIONAL_INCLUDES_WRAP} -I${MPI_INCLUDE_PATH}")
set(DASHCC ${CMAKE_CXX_COMPILER})
set(DART_IMPLEMENTATION "mpi")
Expand Down
61 changes: 61 additions & 0 deletions CMakeExt/ParallelStl.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# - Find Required PSTL libraries (libvmem, libpmem, libpmemobj)
# This module defines
# PSTL_FOUND
# PSTL_INCLUDE_DIRS, directory containing headers
# PSTL_LIBRARIES, directory containing libraries

if (NOT ENABLE_PSTL)
return()
else()
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel")
string(REGEX MATCH "([0-9]+)" ICC_VERSION_MAJOR "${CMAKE_CXX_COMPILER_VERSION}")
if (CMAKE_MATCH_1 LESS 18)
message(FATAL_ERROR "Parallel STL requires at least ICC 2018")
endif()
else()
message(WARNING "Parallel STL currently only supported for Intel Compiler")
return()
endif()
endif()

if(NOT TBB_FOUND)
include(${CMAKE_SOURCE_DIR}/CMakeExt/FindTBB.cmake)
endif()

if(NOT TBB_FOUND)
message(FATAL_ERROR "TBB is required for PSTL")
endif()

if (PSTL_PREFIX)
message(STATUS "Searching for PSTL in path " ${PSTL_PREFIX})
endif()

# Define search paths based on user input and environment variables
set(PSTL_DEFAULT_SEARCH_DIR "/opt/intel/pstl")
set(PSTL_SEARCH_DIR $ENV{PSTLROOT} $ENV{PSTL_ROOT})

if (DEFINED ENV{INTEL_BASE})
set(PSTL_SEARCH_DIR ${PSTL_SEARCH_DIR} "$ENV{INTEL_BASE}/linux/pstl")
endif()

find_path(
PSTL_INCLUDE_DIRS pstl/algorithm
HINTS ${PSTL_PREFIX} ${PSTL_SEARCH_DIR}
PATHS ${PSTL_DEFAULT_SEARCH_DIR}
PATH_SUFFIXES include)

include(FindPackageHandleStandardArgs)

find_package_handle_standard_args(
PSTL DEFAULT_MSG
PSTL_INCLUDE_DIRS
)

if (NOT PSTL_FOUND AND NOT PSTL_FIND_QUIETLY)
set(PSTL_ERR_MSG "Could not find the pmem libraries. Looked for headers")
set(PSTL_ERR_MSG "${PSTL_ERR_MSG} in ${PSTL_SEARCH_HEADER_PATH}")
endif()

mark_as_advanced(
PSTL_INCLUDE_DIRS
)
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ include(${CMAKE_SOURCE_DIR}/CMakeExt/Doxygen.cmake)
include(${CMAKE_SOURCE_DIR}/CMakeExt/Platform.cmake)
include(${CMAKE_SOURCE_DIR}/CMakeExt/Environment.cmake)
include(${CMAKE_SOURCE_DIR}/CMakeExt/StdLib.cmake)
include(${CMAKE_SOURCE_DIR}/CMakeExt/ParallelStl.cmake)

if (ENABLE_THREADSUPPORT)
include(${CMAKE_SOURCE_DIR}/CMakeExt/Threading.cmake)
Expand Down
14 changes: 14 additions & 0 deletions config/knl.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
set(DASH_ENV_HOST_SYSTEM_ID "default" CACHE STRING
"Host system type identifier")

if (NOT BUILD_GENERIC)
if ("${CMAKE_C_COMPILER_ID}" MATCHES "GNU"
OR "${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
#set specific flags for clang or gcc to use avx-512
endif()

if ("${CMAKE_C_COMPILER_ID}" MATCHES "Intel")
set(CC_ENV_SETUP_FLAGS "${CC_ENV_SETUP_FLAGS} -xhost")
set(CXX_ENV_SETUP_FLAGS "${CXX_ENV_SETUP_FLAGS} -xhost")
endif()
endif()
Loading