Skip to content

Commit

Permalink
Merge branch 'master' into throttle_cores
Browse files Browse the repository at this point in the history
Conflicts:
	tests/unit/resource/CMakeLists.txt
  • Loading branch information
Thomas Heller committed Sep 20, 2017
2 parents da663c9 + 0bc6e4e commit b198581
Show file tree
Hide file tree
Showing 391 changed files with 6,416 additions and 5,042 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Expand Up @@ -1196,7 +1196,10 @@ if(NOT WIN32)
# System libraries
##############################################################################
if(NOT MSVC)
hpx_libraries(atomic)
hpx_add_compile_flag_if_available(-pthread)
if(HPX_HAVE_LIBATOMIC)
hpx_libraries(atomic)
endif()
endif()

if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
Expand Down
6 changes: 3 additions & 3 deletions cmake/HPX_AddComponent.cmake
Expand Up @@ -8,7 +8,7 @@ macro(add_hpx_component name)
# retrieve arguments
set(options EXCLUDE_FROM_ALL AUTOGLOB STATIC PLUGIN)
set(one_value_args INI FOLDER SOURCE_ROOT HEADER_ROOT SOURCE_GLOB HEADER_GLOB OUTPUT_SUFFIX INSTALL_SUFFIX LANGUAGE)
set(multi_value_args SOURCES HEADERS DEPENDENCIES COMPONENT_DEPENDENCIES COMPILE_FLAGS LINK_FLAGS)
set(multi_value_args SOURCES HEADERS AUXILIARY DEPENDENCIES COMPONENT_DEPENDENCIES COMPILE_FLAGS LINK_FLAGS)
cmake_parse_arguments(${name} "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN})

if(NOT ${name}_LANGUAGE)
Expand Down Expand Up @@ -144,10 +144,10 @@ macro(add_hpx_component name)

if(HPX_WITH_CUDA AND NOT HPX_WITH_CUDA_CLANG)
cuda_add_library(${name}_component ${${name}_lib_linktype} ${exclude_from_all}
${${name}_SOURCES} ${${name}_HEADERS})
${${name}_SOURCES} ${${name}_HEADERS} ${${name}_AUXILIARY})
else()
add_library(${name}_component ${${name}_lib_linktype} ${exclude_from_all}
${${name}_SOURCES} ${${name}_HEADERS})
${${name}_SOURCES} ${${name}_HEADERS} ${${name}_AUXILIARY})
endif()

if(${name}_OUTPUT_SUFFIX)
Expand Down
26 changes: 25 additions & 1 deletion cmake/HPX_AddConfigTest.cmake
Expand Up @@ -391,10 +391,27 @@ endmacro()

###############################################################################
macro(hpx_check_for_cxx11_std_atomic)
# Sometimes linking against libatomic is required for atomic ops, if
# the platform doesn't support lock-free atomics.

# First check if atomics work without the library.
add_hpx_config_test(HPX_WITH_CXX11_ATOMIC
SOURCE cmake/tests/cxx11_std_atomic.cpp
LIBRARIES "-latomic"
FILE ${ARGN})

# If not, check if the library exists, and atomics work with it.
if(NOT HPX_WITH_CXX11_ATOMIC)
check_library_exists(atomic __atomic_fetch_add_4 "" HPX_HAVE_LIBATOMIC)
if(HPX_HAVE_LIBATOMIC)
add_hpx_config_test(HPX_WITH_CXX11_ATOMIC
SOURCE cmake/tests/cxx11_std_atomic.cpp
LIBRARIES "atomic"
FILE ${ARGN})
else()
message(FATAL_ERROR
"Host compiler appears to require libatomic, but cannot find it.")
endif()
endif()
endmacro()

###############################################################################
Expand Down Expand Up @@ -453,6 +470,13 @@ macro(hpx_check_for_cxx11_std_lock_guard)
FILE ${ARGN})
endmacro()

###############################################################################
macro(hpx_check_for_cxx11_std_random)
add_hpx_config_test(HPX_WITH_CXX11_RANDOM
SOURCE cmake/tests/cxx11_std_random.cpp
FILE ${ARGN})
endmacro()

###############################################################################
macro(hpx_check_for_cxx11_std_range_access)
add_hpx_config_test(HPX_WITH_CXX11_RANGE_ACCESS
Expand Down
10 changes: 8 additions & 2 deletions cmake/HPX_AddDefinitions.cmake
Expand Up @@ -15,7 +15,10 @@ set_property(GLOBAL PROPERTY HPX_CONFIG_COND_DEFINITIONS "")

function(hpx_add_config_define definition)

if(ARGN)
# if(ARGN) ignores an argument "0"
set(Args ${ARGN})
list(LENGTH Args ArgsLen)
if(ArgsLen GREATER 0)
set_property(GLOBAL APPEND PROPERTY HPX_CONFIG_DEFINITIONS "${definition} ${ARGN}")
else()
set_property(GLOBAL APPEND PROPERTY HPX_CONFIG_DEFINITIONS "${definition}")
Expand All @@ -25,7 +28,10 @@ endfunction()

function(hpx_add_config_cond_define definition)

if(ARGN)
# if(ARGN) ignores an argument "0"
set(Args ${ARGN})
list(LENGTH Args ArgsLen)
if(ArgsLen GREATER 0)
set_property(GLOBAL APPEND PROPERTY HPX_CONFIG_COND_DEFINITIONS "${definition} ${ARGN}")
else()
set_property(GLOBAL APPEND PROPERTY HPX_CONFIG_COND_DEFINITIONS "${definition}")
Expand Down
6 changes: 3 additions & 3 deletions cmake/HPX_AddExecutable.cmake
Expand Up @@ -8,7 +8,7 @@ macro(add_hpx_executable name)
# retrieve arguments
set(options EXCLUDE_FROM_ALL EXCLUDE_FROM_DEFAULT_BUILD AUTOGLOB NOLIBS NOHPX_INIT)
set(one_value_args INI FOLDER SOURCE_ROOT HEADER_ROOT SOURCE_GLOB HEADER_GLOB OUTPUT_SUFFIX INSTALL_SUFFIX LANGUAGE HPX_PREFIX)
set(multi_value_args SOURCES HEADERS DEPENDENCIES COMPONENT_DEPENDENCIES COMPILE_FLAGS LINK_FLAGS)
set(multi_value_args SOURCES HEADERS AUXILIARY DEPENDENCIES COMPONENT_DEPENDENCIES COMPILE_FLAGS LINK_FLAGS)
cmake_parse_arguments(${name} "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN})

if(NOT ${name}_LANGUAGE)
Expand Down Expand Up @@ -130,10 +130,10 @@ macro(add_hpx_executable name)

if(HPX_WITH_CUDA AND NOT HPX_WITH_CUDA_CLANG)
cuda_add_executable(${name}_exe
${${name}_SOURCES} ${${name}_HEADERS})
${${name}_SOURCES} ${${name}_HEADERS} ${${name}_AUXILIARY})
else()
add_executable(${name}_exe
${${name}_SOURCES} ${${name}_HEADERS})
${${name}_SOURCES} ${${name}_HEADERS} ${${name}_AUXILIARY})
endif()

if(${name}_OUTPUT_SUFFIX)
Expand Down
6 changes: 3 additions & 3 deletions cmake/HPX_AddLibrary.cmake
Expand Up @@ -8,7 +8,7 @@ macro(add_hpx_library name)
# retrieve arguments
set(options EXCLUDE_FROM_ALL NOLIBS AUTOGLOB STATIC PLUGIN)
set(one_value_args FOLDER SOURCE_ROOT HEADER_ROOT SOURCE_GLOB HEADER_GLOB OUTPUT_SUFFIX INSTALL_SUFFIX)
set(multi_value_args SOURCES HEADERS DEPENDENCIES COMPONENT_DEPENDENCIES COMPILER_FLAGS LINK_FLAGS)
set(multi_value_args SOURCES HEADERS AUXILIARY DEPENDENCIES COMPONENT_DEPENDENCIES COMPILER_FLAGS LINK_FLAGS)
cmake_parse_arguments(${name} "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN})

if(NOT ${name}_SOURCE_ROOT)
Expand Down Expand Up @@ -138,10 +138,10 @@ macro(add_hpx_library name)

if(HPX_WITH_CUDA AND NOT HPX_WITH_CUDA_CLANG)
cuda_add_library(${name}_lib ${${name}_lib_linktype} ${exclude_from_all}
${${name}_SOURCES} ${${name}_HEADERS})
${${name}_SOURCES} ${${name}_HEADERS} ${${name}_AUXILIARY})
else()
add_library(${name}_lib ${${name}_lib_linktype} ${exclude_from_all}
${${name}_SOURCES} ${${name}_HEADERS})
${${name}_SOURCES} ${${name}_HEADERS} ${${name}_AUXILIARY})
endif()

if(${name}_OUTPUT_SUFFIX)
Expand Down
3 changes: 3 additions & 0 deletions cmake/HPX_PerformCxxFeatureTests.cmake
Expand Up @@ -110,6 +110,9 @@ macro(hpx_perform_cxx_feature_tests)
hpx_check_for_cxx11_std_lock_guard(
REQUIRED "HPX needs support for C++11 std::lock_guard")

hpx_check_for_cxx11_std_random(
DEFINITIONS HPX_HAVE_CXX11_STD_RANDOM)

hpx_check_for_cxx11_std_range_access(
REQUIRED "HPX needs support for C++11 std::begin/end")

Expand Down
7 changes: 0 additions & 7 deletions cmake/HPX_SetupBoost.cmake
Expand Up @@ -96,13 +96,6 @@ if(HPX_WITH_COMPRESSION_BZIP2 OR HPX_WITH_COMPRESSION_ZLIB)
set(Boost_TMP_LIBRARIES ${Boost_TMP_LIBRARIES} ${Boost_LIBRARIES})
endif()

# attempt to load Boost.Random (if available), it's needed for one example only
find_package(Boost 1.55 QUIET COMPONENTS random)
if(Boost_RANDOM_FOUND)
hpx_info(" random")
set(Boost_TMP_LIBRARIES ${Boost_TMP_LIBRARIES} ${Boost_LIBRARIES})
endif()

set(Boost_LIBRARIES ${Boost_TMP_LIBRARIES})

# If we compile natively for the MIC, we need some workarounds for certain
Expand Down
24 changes: 24 additions & 0 deletions cmake/tests/cxx11_std_random.cpp
@@ -0,0 +1,24 @@
////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2017 Agustin Berge
//
// 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)
////////////////////////////////////////////////////////////////////////////////

#include <random>

int main()
{
// engines
{
std::random_device random_device;
std::mt19937 mt19937;
std::mt19937_64 mt19937_64;
}

// distributions
{
std::uniform_int_distribution<> uniform_int_distribution;
std::uniform_real_distribution<> uniform_real_distribution;
}
}
2 changes: 1 addition & 1 deletion docs/authors.txt
Expand Up @@ -7,7 +7,7 @@ akemp = Andrew Kemp <akemp@cct.lsu.edu>
aserio = Adrian Serio <aserio@cct.lsu.edu>
atabbal = Alex Tabbal <atabbal@cct.lsu.edu>
atandon = Anshul Tandon <atandon@cct.lsu.edu>
blelbach = Bryce Adelstein-Lelbach <blelbach@cct.lsu.edu>
blelbach = Bryce Adelstein Lelbach <brycelelbach@gmail.com>
cdekate = Chirag Dekate <cdekate@cct.lsu.edu>
dkogler = Daniel Kogler <dkogler@cct.lsu.edu>
dstark = Dylan Stark <dstark@cct.lsu.edu>
Expand Down
3 changes: 2 additions & 1 deletion docs/hpx.qbk
Expand Up @@ -70,7 +70,8 @@
[def __unlv__ [@http://www.unlv.edu University of Nevada, Las Vegas]]
[def __cscs__ [@http://www.cscs.ch Swiss National Supercomputing Centre]]
[def __ou__ [@http://uoregon.edu/ University of Oregon]]
[def __lbnl__ [@http://www.lbl.gov/ Lawrence Berkley National Laboratory (LBNL)]]
[def __lbnl__ [@http://www.lbl.gov/ Lawrence Berkeley National Laboratory (LBNL)]]
[def __nvidia__ [@http://nvidia.com/ NVIDIA]]

[def __gsoc__ [@https://developers.google.com/open-source/soc/ Google Summer of Code]]

Expand Down
31 changes: 24 additions & 7 deletions docs/manual/vector.qbk
Expand Up @@ -252,7 +252,9 @@ variable as a first parameter.
}
HPX_PLAIN_ACTION(bulk_function, bulk_action);

[note In the following paragraphs, we will use the term "image" several times. An image is defined as a lightweight process whose the entry point is a function provided by the user. It's an "image of the function".]
[note In the following paragraphs, we will use the term "image" several times.
An image is defined as a lightweight process whose the entry point is a
function provided by the user. It's an "image of the function".]

The `spmd_block` class contains the following methods:

Expand Down Expand Up @@ -336,8 +338,11 @@ indicating the number of images per locality to create.

return 0;
}
[note In principle, the user should never call the `spmd_block` constructor. The `define_spmd_block` function is responsible of instantiating `spmd_block` objects and broadcasting them to each created image.
]

[note In principle, the user should never call the `spmd_block` constructor.
The `define_spmd_block` function is responsible of instantiating
`spmd_block` objects and broadcasting them to each created image.]

[endsect]

[section:spmd_views SPMD Multidimensionnal Views]
Expand Down Expand Up @@ -377,7 +382,10 @@ because without convention, each of the images invoked will race to execute
the statement. For this reason, our views are not only multi-dimensional
but also "spmd-aware".

[note Spmd-awareness: The convention is simple. If an assignment statement contains a view subscript as an l-value, it is only and only the image holding the r-value who is evaluating the statement. (In MPI sense, it is called a Put operation)]
[note SPMD-awareness: The convention is simple. If an assignment statement
contains a view subscript as an l-value, it is only and only the image
holding the r-value who is evaluating the statement. (In MPI sense, it is
called a Put operation)]

[section:Subscripts Subscript-based operations]
Here are some examples of using subscripts in the 2-D view case:
Expand Down Expand Up @@ -413,6 +421,7 @@ Here are some examples of using subscripts in the 2-D view case:
// assignment : oops! race between all participating images.
vv(2,3) = std::vector<double>(4,1.0);
}

[endsect]

[section:ViewIterators Iterator-based operations]
Expand Down Expand Up @@ -506,6 +515,7 @@ owned by the current image :
}

}

[endsect]

[section:SubViews Instanciating Sub-views]
Expand Down Expand Up @@ -551,16 +561,21 @@ sub-view.
}

}
[note The last parameter of the subview constructor is the size of the original view. If one would like to create a subview of the subview and so on, this parameter should stay unchanged. (`{N,N}` for the above example)]

[note The last parameter of the subview constructor is the size of the original
view. If one would like to create a subview of the subview and so on, this
parameter should stay unchanged. (`{N,N}` for the above example)]

[endsect]
[endsect]
[endsect]

[section C++ Co-Arrays]
Fortran has extended its scalar element indexing approach to reference each
segment of a distributed array. In this extension, a segment is attributed a
co-index and lives in a specific locality. A co-index provides the application
?co-index? and lives in a specific locality. A co-index provides the application
with enough information to retrieve the corresponding data reference. In C++,
containers present themselves as a smarter alternative of Fortran arrays but
containers present themselves as a ?smarter? alternative of Fortran arrays but
there are still no corresponding standardized features similar to the Fortran
co-indexing approach. We present here an implementation of such features in __hpx__.

Expand Down Expand Up @@ -661,5 +676,7 @@ Here is an example of using local subscripts :
`hpx::container::placeholders::_`, local subscript (and not global subscript)
is used. It is equivalent to a global subscript used with a
"last dimension index" equal to the value returned by `block.this_image()`.]

[endsect]
[endsect]
[endsect]

0 comments on commit b198581

Please sign in to comment.