Skip to content

Commit

Permalink
Merge pull request #1641 from STEllAR-GROUP/generic_client
Browse files Browse the repository at this point in the history
Generic client
  • Loading branch information
hkaiser committed Apr 4, 2016
2 parents dee2677 + 37a1349 commit bbcc734
Show file tree
Hide file tree
Showing 62 changed files with 1,750 additions and 611 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Expand Up @@ -999,6 +999,9 @@ if(HPX_WITH_COMPILER_WARNINGS)
# has no meaning; ignored'
hpx_add_compile_flag(-wd4180)

# max symbol length exceeded
hpx_add_compile_flag(-wd4503)

# OpenMPI triggers a lot of forcing value to bool 'true' or 'false'
# (performance warning)
if(MPI_FOUND OR HPX_WITH_APEX)
Expand Down
3 changes: 0 additions & 3 deletions docs/CMakeLists.txt
Expand Up @@ -177,9 +177,6 @@ set(doxygen_output_dir "${CMAKE_CURRENT_BINARY_DIR}/doxygen")

set(doxygen_definition_list
"DOXYGEN:=1"
"BOOST_SCOPED_ENUM_START(x):=enum x"
"BOOST_SCOPED_ENUM_END="
"BOOST_SCOPED_ENUM(x):=x"
"BOOST_SYSTEM_NOEXCEPT="
"HPX_EXCEPTION_EXPORT="
"HPX_EXPORT="
Expand Down
2 changes: 1 addition & 1 deletion examples/quickstart/non_atomic_rma.cpp
Expand Up @@ -121,7 +121,7 @@ int hpx_main(po::variables_map &vm)

for (int i=0;i<array_length;i++) {
components::access_memory_block<data>
result( components::stubs::memory_block::get(n[i].get()) );
result( components::stubs::memory_block::get_data(n[i].get()) );
std::cout << " Result index: " << i << " value : "
<< result->val_ << std::endl;
}
Expand Down
4 changes: 2 additions & 2 deletions examples/quickstart/quicksort.cpp
Expand Up @@ -103,7 +103,7 @@ void quicksort_parallel<T>::call(id_type prefix, id_type d, std::size_t begin,
if (begin != end)
{
memory_block mb(d);
access_memory_block<T> data(mb.get());
access_memory_block<T> data(mb.get_data());

std::size_t middle_idx = partition(data.get_ptr(), begin, end);

Expand Down Expand Up @@ -153,7 +153,7 @@ int hpx_main(variables_map& vm)
{
// create a (remote) memory block
memory_block mb = memory_block::create<int, uint8_t>(prefix, elements);
access_memory_block<int> data(mb.get());
access_memory_block<int> data(mb.get_data());

// randomly fill the vector
std::generate(data.get_ptr(), data.get_ptr() + elements, std::rand);
Expand Down
9 changes: 5 additions & 4 deletions hpx/async.hpp
@@ -1,4 +1,4 @@
// Copyright (c) 2007-2013 Hartmut Kaiser
// Copyright (c) 2007-2015 Hartmut Kaiser
//
// 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)
Expand Down Expand Up @@ -103,7 +103,7 @@ namespace hpx { namespace detail
traits::detail::is_deferred_callable<F(Ts&&...)>::value,
hpx::future<typename util::detail::deferred_result_of<F(Ts&&...)>::type>
>::type
call(launch launch_policy, F&& f, Ts&&... ts)
call(launch launch_policy, F && f, Ts&&... ts)
{
typedef typename util::detail::deferred_result_of<
F(Ts&&...)
Expand Down Expand Up @@ -221,8 +221,9 @@ namespace hpx
std::forward<F>(f), std::forward<Ts>(ts)...
))
{
return detail::async_dispatch<typename util::decay<F>::type>::call(
std::forward<F>(f), std::forward<Ts>(ts)...);
return detail::async_dispatch<
typename util::decay<F>::type
>::call(std::forward<F>(f), std::forward<Ts>(ts)...);
}
}

Expand Down
1 change: 1 addition & 0 deletions hpx/components/component_storage/component_storage.hpp
Expand Up @@ -25,6 +25,7 @@ namespace hpx { namespace components

public:
component_storage(hpx::id_type target_locality);
component_storage(hpx::future<naming::id_type> && f);

hpx::future<naming::id_type> migrate_to_here(std::vector<char> const&,
naming::id_type, naming::address const&);
Expand Down
Expand Up @@ -145,7 +145,7 @@ namespace hpx { namespace components { namespace server
.then(
[to_resurrect, target_locality](
future<std::pair<naming::id_type, naming::address> > && f)
-> future<naming::id_type>
-> future<naming::id_type>
{
// rethrow errors
std::pair<naming::id_type, naming::address> r = f.get();
Expand Down
Expand Up @@ -131,7 +131,7 @@ namespace hpx
///
template <typename T>
class partitioned_vector
: hpx::components::client_base<partitioned_vector<T>,
: public hpx::components::client_base<partitioned_vector<T>,
hpx::components::server::distributed_metadata_base<
server::partitioned_vector_config_data> >
{
Expand Down Expand Up @@ -337,6 +337,15 @@ namespace hpx
register_as(symbolic_name).get();
}

// construct from id
partitioned_vector(future<id_type> && f)
{
using util::placeholders::_1;
f.share().then(
util::bind(&partitioned_vector::connect_to_helper, this, _1)
);
}

public:
// Return the sequence number of the segment corresponding to the
// given global index
Expand Down
Expand Up @@ -481,6 +481,7 @@ namespace hpx
typedef hpx::components::client_base<
partitioned_vector_partition<T>, server::partitioned_vector<T>
> base_type;

public:
partitioned_vector_partition() {}

Expand Down
1 change: 1 addition & 0 deletions hpx/include/components.hpp
Expand Up @@ -30,6 +30,7 @@

#include <hpx/runtime/components/stubs/runtime_support.hpp>
#include <hpx/runtime/components/client_base.hpp>
#include <hpx/runtime/components/client.hpp>

#include <hpx/runtime/components/server/component.hpp>
#include <hpx/runtime/components/server/component_base.hpp>
Expand Down

0 comments on commit bbcc734

Please sign in to comment.