Skip to content

Commit

Permalink
Merge pull request #2278 from STEllAR-GROUP/remove_agas_request
Browse files Browse the repository at this point in the history
Getting rid of agas::response and agas::request
  • Loading branch information
hkaiser committed Sep 5, 2016
2 parents 2ad2497 + f5c2c89 commit b142c02
Show file tree
Hide file tree
Showing 78 changed files with 2,815 additions and 6,666 deletions.
4 changes: 2 additions & 2 deletions docs/manual/applying_actions.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -349,14 +349,14 @@ forwarded to the second action and the result of the second action is sent back
to the original invocation site:

// first action
boost::int32_t action1(boost::int32_t i)
std::int32_t action1(std::int32_t i)
{
return i+1;
}
HPX_PLAIN_ACTION(action1); // defines action1_type

// second action
boost::int32_t action2(boost::int32_t i)
std::int32_t action2(std::int32_t i)
{
return i*2;
}
Expand Down
8 changes: 4 additions & 4 deletions docs/manual/providing_performance_counters.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ will then be called whenever a consumer queries this counter. Currently, this
type of Performance Counter can only be used to expose integer values. The
expected signature of this function is:

boost::int64_t some_performance_data(bool reset);
std::int64_t some_performance_data(bool reset);

The argument `bool reset` (which is supplied by the runtime system when the
function is invoked) specifies whether the counter value should be reset after
Expand All @@ -39,11 +39,11 @@ evaluating the current value (if applicable).
For instance, here is such a function returning how often it was invoked:

// The atomic variable 'counter' ensures the thread safety of the counter.
boost::atomic<boost::int64_t> counter(0);
boost::atomic<std::int64_t> counter(0);

boost::int64_t some_performance_data(bool reset)
std::int64_t some_performance_data(bool reset)
{
boost::int64_t result = ++counter;
std::int64_t result = ++counter;
if (reset)
counter = 0;
return result;
Expand Down
6 changes: 3 additions & 3 deletions docs/tutorial/examples.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ printed out.

[fib_hpx_main]

Upon a closer look we see that we've created a `boost::uint64_t` to store the result of
Upon a closer look we see that we've created a `std::uint64_t` to store the result of
invoking our `fibonacci_action` ['fib]. This action will launch synchronously ( as the work
done inside of the action will be asynchronous itself) and return the result of the fibonacci
sequence. But wait, what is an action? And what
Expand All @@ -165,7 +165,7 @@ creating.

This picture should now start making sense. The function `fibonacci()` is
wrapped in an action `fibonacci_action`, which was run synchronously but
created asynchronous work, then returns a `boost::uint64_t`
created asynchronous work, then returns a `std::uint64_t`
representing the result of the function `fibonacci()`. Now, let's look at the
function `fibonacci()`:

Expand Down Expand Up @@ -491,7 +491,7 @@ are used to create components:
and to invoke component actions:

``
c.add_sync(4);
c.add(hpx::launch::sync, 4);
``

Clients, like servers, need to inherit from a base class, this time,
Expand Down
8 changes: 4 additions & 4 deletions examples/quickstart/zerocopy_rdma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ struct zerocopy
return hpx::async(act, this->get_id(), buff.size(), buffer_address)
.then(hpx::util::bind(&zerocopy::transfer_data, buff, _1));
}
void get_here_sync(general_buffer_type& buff) const
void get_here(hpx::launch::sync_policy, general_buffer_type& buff) const
{
get_here(buff).get();
}
Expand All @@ -205,7 +205,7 @@ struct zerocopy
zerocopy_get_action act;
return hpx::async(act, this->get_id(), size);
}
general_buffer_type get_sync(std::size_t size) const
general_buffer_type get(hpx::launch::sync_policy, std::size_t size) const
{
return get(size).get();
}
Expand All @@ -227,7 +227,7 @@ int main(int argc, char* argv[])
hpx::util::high_resolution_timer t;

for (int i = 0; i != 100; ++i)
zc.get_sync(ZEROCOPY_DATASIZE);
zc.get(hpx::launch::sync, ZEROCOPY_DATASIZE);

double d = t.elapsed();
std::cout << "Elapsed time 'get' (locality "
Expand All @@ -239,7 +239,7 @@ int main(int argc, char* argv[])
hpx::util::high_resolution_timer t;

for (int i = 0; i != 100; ++i)
zc.get_here_sync(buffer);
zc.get_here(hpx::launch::sync, buffer);

double d = t.elapsed();
std::cout << "Elapsed time 'get_here' (locality "
Expand Down
5 changes: 1 addition & 4 deletions examples/throttle/spin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#include <hpx/hpx_init.hpp>
#include <hpx/runtime/naming/resolver_client.hpp>
#include <hpx/hpx.hpp>

#include <boost/format.hpp>

Expand All @@ -18,11 +18,8 @@ using boost::program_options::options_description;
using hpx::init;
using hpx::finalize;

using hpx::naming::get_agas_client;

using hpx::naming::address;
using hpx::naming::id_type;
using hpx::naming::resolver_client;
using hpx::naming::get_locality_id_from_gid;

///////////////////////////////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ namespace examples
/// put \p tuple into tuplespace.
///
/// \note This function is fully synchronous.
int write_sync(const tuple_type& tuple)
int write(hpx::launch::sync_policy, const tuple_type& tuple)
{
HPX_ASSERT(this->get_id());
return this->base_type::write_sync(this->get_id(), tuple);
return this->base_type::write(hpx::launch::sync, this->get_id(), tuple);
}

///////////////////////////////////////////////////////////////////////
Expand All @@ -136,10 +136,12 @@ namespace examples
///
/// \note This function is fully synchronous.
//[simple_central_tuplespace_client_read_sync
tuple_type read_sync(const tuple_type& tp, long const timeout)
tuple_type read(hpx::launch::sync_policy, const tuple_type& tp,
long const timeout)
{
HPX_ASSERT(this->get_id());
return this->base_type::read_sync(this->get_id(), tp, timeout);
return this->base_type::read(hpx::launch::sync, this->get_id(),
tp, timeout);
}
//]

Expand All @@ -156,17 +158,20 @@ namespace examples
take_async(const tuple_type& tp, long const timeout)
{
HPX_ASSERT(this->get_id());
return this->base_type::take_async(this->get_id(), tp, timeout);
return this->base_type::take(hpx::launch::async, this->get_id(),
tp, timeout);
}
//]

/// take matching tuple from tuplespace within \p timeout.
///
/// \note This function is fully synchronous.
tuple_type take_sync(const tuple_type& tp, long const timeout)
tuple_type take(hpx::launch::sync_policy, const tuple_type& tp,
long const timeout)
{
HPX_ASSERT(this->get_id());
return this->base_type::take_sync(this->get_id(), tp, timeout);
return this->base_type::take(hpx::launch::sync, this->get_id(),
tp, timeout);
}

private:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ namespace examples { namespace stubs
/// put \p tuple into tuplespace.
///
/// \note This function is fully synchronous.
static int write_sync(hpx::naming::id_type const& gid, tuple_type const& tuple)
static int write(hpx::launch::sync_policy,
hpx::naming::id_type const& gid, tuple_type const& tuple)
{
typedef server::simple_central_tuplespace::write_action action_type;
return hpx::async<action_type>(gid, tuple).get();
Expand All @@ -65,8 +66,8 @@ namespace examples { namespace stubs
/// \note This function is fully synchronous.
//[simple_central_tuplespace_stubs_read_sync
static tuple_type
read_sync(hpx::naming::id_type const& gid, const tuple_type& tp,
long const timeout)
read(hpx::launch::sync_policy, hpx::naming::id_type const& gid,
const tuple_type& tp, long const timeout)
{
typedef server::simple_central_tuplespace::read_action action_type;
return hpx::async<action_type>(gid, tp, timeout).get();
Expand All @@ -83,8 +84,8 @@ namespace examples { namespace stubs
/// until the value is ready.
//[simple_central_tuplespace_stubs_take_async
static hpx::lcos::future<tuple_type>
take_async(hpx::naming::id_type const& gid, const tuple_type& tp,
long const timeout)
take(hpx::launch::async_policy, hpx::naming::id_type const& gid,
const tuple_type& tp, long const timeout)
{
typedef server::simple_central_tuplespace::take_action action_type;
return hpx::async<action_type>(gid, tp, timeout);
Expand All @@ -94,11 +95,12 @@ namespace examples { namespace stubs
/// take tuple matching \p key from tuplespace within \p timeout.
///
/// \note This function is fully synchronous.
static tuple_type take_sync(hpx::naming::id_type const& gid
, const tuple_type& tp, const long timeout)
static tuple_type take(hpx::launch::sync_policy,
hpx::naming::id_type const& gid, const tuple_type& tp,
const long timeout)
{
// The following get yields control while the action is executed.
return take_async(gid, tp, timeout).get();
return take(hpx::launch::async, gid, tp, timeout).get();
}
};
}}
Expand Down
Loading

0 comments on commit b142c02

Please sign in to comment.