Skip to content

Commit

Permalink
Merge branch 'ibverbs_parcelport'. This Fixes #735 (among others)
Browse files Browse the repository at this point in the history
  • Loading branch information
sithhell committed Apr 12, 2013
2 parents c5cee4d + 27bedb9 commit 30c37ae
Show file tree
Hide file tree
Showing 66 changed files with 5,513 additions and 1,078 deletions.
66 changes: 65 additions & 1 deletion CMakeLists.txt
Expand Up @@ -257,6 +257,14 @@ if(CMAKE_Fortran_COMPILER)
endif()
endif()

# If we are compiling with an intel compiler, we need to override the default
# boost compiler config in order to have proper C++11 detection for more
# recent intel compiler versions (>12.0)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
hpx_add_definitions(-DBOOST_COMPILER_CONFIG="${CMAKE_SOURCE_DIR}/hpx/config/boost/compiler/intel.hpp")
endif()


hpx_include(CompilerFlags)

################################################################################
Expand Down Expand Up @@ -305,6 +313,19 @@ if(${BOOST_MINOR_VERSION} GREATER 51)
endif()
endif()

################################################################################
# Decide whether to use rdma based ibverbs parcelport
################################################################################
find_package(HPX_Ibverbs)
find_package(HPX_Rdmacm)
if(IBVERBS_FOUND AND RDMACM_FOUND)
hpx_option(HPX_USE_PARCELPORT_IBVERBS BOOL "Enable parcelport based on rdma ibverbs operations (default: OFF)." OFF ADVANCED)
if(HPX_USE_PARCELPORT_IBVERBS)
hpx_add_definitions(-DHPX_HAVE_PARCELPORT_IBVERBS)
endif()
endif()


################################################################################
# Logging configuration
################################################################################
Expand Down Expand Up @@ -877,6 +898,8 @@ else()
hpx_use_flag_if_available(-Wsign-promo LANGUAGES CXX)
endif()



# VLAs are a GNU extensions that we forbid as they are not supported on MSVC
hpx_use_flag_if_available(-Werror=vla LANGUAGES CXX C)

Expand Down Expand Up @@ -948,6 +971,40 @@ else()
hpx_use_flag_if_available(-Wno-cast-align)
endif()

##############################################################################
# ICPC-only configuration
##############################################################################
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
# Disable the following warnings:
# #1170: invalid redeclaration of nested class
# #858: type qualifier on return type is meaningless
# #1098: the qualifier on this friend declaration is ignored
# #488: template parameter not used in declaring the parameter type
hpx_use_flag_if_available(-wd1170)
hpx_use_flag_if_available(-wd858)
hpx_use_flag_if_available(-wd1098)
hpx_use_flag_if_available(-wd488)
if("${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel" OR
"${CMAKE_BUILD_TYPE}" STREQUAL "Release" OR
"${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
## FIXME: figure out which flags can be used with HPX
#hpx_use_flag_if_available(-opt-calloc)
#hpx_use_flag_if_available(-inline-calloc)
#hpx_use_flag_if_available(-ip)
#hpx_use_flag_if_available(-ipo)
#hpx_use_flag_if_available(-opt-class-analysis)
#hpx_use_flag_if_available(-opt-multi-version-aggressive)
#hpx_use_flag_if_available(-xHost)
#hpx_use_flag_if_available(-fno-alias)
#hpx_use_flag_if_available(-fbuiltin)
#hpx_use_flag_if_available(-finline)
#hpx_use_flag_if_available(-fma)
#hpx_use_flag_if_available(-fno-implicit-inline-templates)
#hpx_use_flag_if_available(-fno-implicit-templates)
#hpx_use_flag_if_available(-ftls-model=initial-exec)
endif()
endif()

##############################################################################
# x86-64 specific configuration
hpx_option(HPX_MICROACRH_OPTIMIZATIONS BOOL
Expand Down Expand Up @@ -1432,7 +1489,14 @@ foreach(library ${BOOST_LIBRARIES})
"${boost_library_info} CACHE FILEPATH \"Boost ${library} shared library.\")\n")
endforeach()

get_directory_property(external_definitions DEFINITIONS)
get_directory_property(definitions DEFINITIONS)

set(external_definitions "")

foreach(definition ${definitions})
string(REGEX REPLACE "\"" "\\\\\\\\\\\\\\\\\"" definition ${definition})
set(external_definitions "${external_definitions} ${definition}")
endforeach()

set(cmake_dir cmake-${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})

Expand Down
23 changes: 23 additions & 0 deletions cmake/FindHPX_Ibverbs.cmake
@@ -0,0 +1,23 @@
# Copyright (c) 2007-2011 Hartmut Kaiser
# Copyright (c) 2011 Bryce Lelbach
# Copyright (c) 2011 Maciej Brodowicz
#
# 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 HPX_FINDPACKAGE_LOADED)
include(HPX_FindPackage)
endif()

hpx_find_package(IBVERBS
LIBRARIES ibverbs
LIBRARY_PATHS lib
HEADERS infiniband/verbs.h
HEADER_PATHS include)

if(IBVERBS_FOUND)
set(hpx_RUNTIME_LIBRARIES ${hpx_RUNTIME_LIBRARIES} ${IBVERBS_LIBRARY})
hpx_include_sys_directories(${IBVERBS_INCLUDE_DIR})
hpx_link_sys_directories(${IBVERBS_LIBRARY_DIR})
add_definitions(-DHPX_HAVE_IBVERBS)
endif()
23 changes: 23 additions & 0 deletions cmake/FindHPX_Rdmacm.cmake
@@ -0,0 +1,23 @@
# Copyright (c) 2007-2011 Hartmut Kaiser
# Copyright (c) 2011 Bryce Lelbach
# Copyright (c) 2011 Maciej Brodowicz
#
# 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 HPX_FINDPACKAGE_LOADED)
include(HPX_FindPackage)
endif()

hpx_find_package(RDMACM
LIBRARIES rdmacm
LIBRARY_PATHS lib
HEADERS rdma/rdma_cma.h
HEADER_PATHS include)

if(RDMACM_FOUND)
set(hpx_RUNTIME_LIBRARIES ${hpx_RUNTIME_LIBRARIES} ${RDMACM_LIBRARY})
hpx_include_sys_directories(${RDMACM_INCLUDE_DIR})
hpx_link_sys_directories(${RDMACM_LIBRARY_DIR})
add_definitions(-DHPX_HAVE_RDMACM)
endif()
17 changes: 13 additions & 4 deletions cmake/HPX_AddExecutable.cmake
Expand Up @@ -125,10 +125,19 @@ macro(add_hpx_executable name)
endif()

hpx_handle_component_dependencies(${name}_COMPONENT_DEPENDENCIES)
target_link_libraries(${name}_exe
${${name}_DEPENDENCIES}
${${name}_COMPONENT_DEPENDENCIES}
${hpx_libs})

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
target_link_libraries(${name}_exe
${${name}_DEPENDENCIES}
${${name}_COMPONENT_DEPENDENCIES}
${hpx_libs}
imf svml irng intlc)
else()
target_link_libraries(${name}_exe
${${name}_DEPENDENCIES}
${${name}_COMPONENT_DEPENDENCIES}
${hpx_libs})
endif()
set_property(TARGET ${name}_exe APPEND
PROPERTY COMPILE_DEFINITIONS
"HPX_PREFIX=\"${HPX_PREFIX}\""
Expand Down
1 change: 0 additions & 1 deletion examples/CMakeLists.txt
Expand Up @@ -15,7 +15,6 @@ set(subdirs
balancing
bcast
bfs
bright_future
cancelable_action
dataflow
distributed_test
Expand Down
8 changes: 8 additions & 0 deletions examples/adaptive1d/dataflow/server/functional_component.hpp
Expand Up @@ -105,7 +105,15 @@ namespace hpx { namespace components { namespace adaptive1d { namespace server
// serialization, etc.
HPX_DEFINE_COMPONENT_ACTION(functional_component, alloc_data_nonvirt, alloc_data_action);
HPX_DEFINE_COMPONENT_ACTION(functional_component, eval_nonvirt, eval_action);
<<<<<<< HEAD
<<<<<<< HEAD
HPX_DEFINE_COMPONENT_ACTION(functional_component, init_nonvirt, init_action);
=======
HPX_DEFINE_COMPONENT_ACTION(functional_component, init_non_virt, init_action);
>>>>>>> Starting to fix examples
=======
HPX_DEFINE_COMPONENT_ACTION(functional_component, init_nonvirt, init_action);
>>>>>>> Fixing more example compilation problems

/// This is the default hook implementation for decorate_action which
/// does no hooking at all.
Expand Down
5 changes: 0 additions & 5 deletions examples/jacobi/jacobi_component/CMakeLists.txt
Expand Up @@ -16,9 +16,4 @@ if(HPX_HAVE_CXX11_LAMBDAS)
HEADER_GLOB "*.h*"
${jacobi_component_FLAGS}
FOLDER "Examples/Jacobi")

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set_target_properties(jacobi_component PROPERTIES COMPILE_FLAGS "-fPIC")
endif()

endif()
4 changes: 4 additions & 0 deletions examples/quickstart/hello_world.cpp
Expand Up @@ -107,10 +107,14 @@ void hello_world_foreman()
// is the index of the future in the vector, and the second is the
// return value of the future. hpx::lcos::wait doesn't return until
// all the futures in the vector have returned.
hpx::lcos::local::spinlock mtx;
hpx::wait(futures,
[&](std::size_t, std::size_t t) {
if (std::size_t(-1) != t)
{
hpx::lcos::local::spinlock::scoped_lock lk(mtx);
attendance.erase(t);
}
});
}
}
Expand Down
30 changes: 24 additions & 6 deletions examples/quickstart/pingpong.cpp
Expand Up @@ -29,6 +29,7 @@ void on_recv(hpx::naming::id_type to, std::vector<double> const & in,
// received vector in
if (--counter == 0) return;


// send it to remote locality (to), and wait until it is received
std::vector<double> data(in);

Expand Down Expand Up @@ -61,8 +62,17 @@ int hpx_main(boost::program_options::variables_map &b_arg)
std::size_t const vsize = b_arg["vsize"].as<std::size_t>();
std::size_t const numiter = b_arg["numiter"].as<std::size_t>() * 2;

std::vector<hpx::naming::id_type> localities = hpx::find_all_localities();
hpx::naming::id_type to = localities.back(); // send to last element
std::vector<hpx::naming::id_type> localities = hpx::find_remote_localities();

hpx::naming::id_type to;
if(localities.size() == 0)
{
to = hpx::find_here();
}
else
{
to = localities[0]; // send to first remote locality
}

// test sending messages back and forth using a larger vector as one of
// the arguments
Expand All @@ -78,12 +88,16 @@ int hpx_main(boost::program_options::variables_map &b_arg)

double time = timer1.elapsed();

std::cout << "[hpx_pingpong]:total_time(secs)=" << time << ":vsize="
<< vsize << ":localities=" << localities.size()
std::cout << "[hpx_pingpong]"
<< ":total_time(secs)=" << time
<< ":vsize=" << vsize
<< ":bandwidth(GB/s)=" << (((vsize * sizeof(double) * numiter) / time) / 1024) / 1024
<< ":localities=" << localities.size()
<< ":numiter=" << numiter << std::endl;
}

// do the same but with a wrapped vector
/*
{
boost::shared_ptr<std::vector<double> > data(
boost::make_shared<std::vector<double> >(vsize, double(3.11)));
Expand All @@ -97,10 +111,14 @@ int hpx_main(boost::program_options::variables_map &b_arg)
double time = timer1.elapsed();
std::cout << "[hpx_pingpong]:total_time_ind(secs)=" << time << ":vsize="
<< vsize << ":localities=" << localities.size()
std::cout << "[hpx_pingpong]"
<< ":total_time(secs)=" << time
<< ":vsize=" << vsize
<< ":bandwidth(GB/s)=" << (vsize * sizeof(double) * numiter) / (time * 1024 * 1024)
<< ":localities=" << localities.size()
<< ":numiter=" << numiter << std::endl;
}
*/

hpx::finalize();
return 0;
Expand Down

0 comments on commit 30c37ae

Please sign in to comment.