Skip to content

Commit

Permalink
More review comments addressed
Browse files Browse the repository at this point in the history
  • Loading branch information
hkaiser committed Jan 10, 2016
1 parent cddcc31 commit 58ad54e
Showing 1 changed file with 13 additions and 30 deletions.
43 changes: 13 additions & 30 deletions hpx/runtime/parcelset/parcelport_impl.hpp
Expand Up @@ -193,7 +193,7 @@ namespace hpx { namespace parcelset

protected:
void put_parcel_await(
locality const & dest, parcel p, write_handler_type f, bool trigger
locality const & dest, parcel p, write_handler_type f,
, boost::shared_ptr<archive_type> const & archive
, boost::shared_ptr<future_await_container_type> const & future_await)
{
Expand Down Expand Up @@ -229,18 +229,11 @@ namespace hpx { namespace parcelset
enqueue_parcel(dest, std::move(p), std::move(f),
std::move(future_await->new_gids_));

if (trigger)
get_connection_and_send_parcels(dest);
get_connection_and_send_parcels(dest);
}

public:
void put_parcel(locality const & dest, parcel p, write_handler_type f)
{
put_parcel(dest, std::move(p), std::move(f), true);
}

void put_parcel(locality const & dest, parcel p, write_handler_type f,
bool trigger)
{
HPX_ASSERT(dest.type() == type());

Expand All @@ -249,21 +242,20 @@ namespace hpx { namespace parcelset
boost::shared_ptr<archive_type> archive =
boost::make_shared<archive_type>(*future_await);

put_parcel_await(dest, std::move(p), std::move(f), trigger,
archive, future_await);
put_parcel_await(dest, std::move(p), std::move(f), archive,
future_await);
}


protected:
void put_parcels_await(
locality const& dest, std::vector<parcel> parcels,
std::vector<write_handler_type> handlers, bool trigger
, boost::shared_ptr<archive_type> const & archive
, boost::shared_ptr<future_await_container_type> const & future_await)
std::vector<write_handler_type> handlers
, boost::shared_ptr<archive_type> const& archive
, boost::shared_ptr<future_await_container_type> const& future_await)
{
future_await->reset();

for (parcel const& p :parcels)
for (parcel const& p : parcels)
(*archive) << p;

// We are doing a fixed point iteration until we are sure that the
Expand All @@ -278,8 +270,8 @@ namespace hpx { namespace parcelset
void (parcelport_impl::*awaiter)(
locality const &, std::vector<parcel>,
std::vector<write_handler_type>, bool
, boost::shared_ptr<archive_type> const &
, boost::shared_ptr<future_await_container_type> const &
, boost::shared_ptr<archive_type> const&
, boost::shared_ptr<future_await_container_type> const&
)
= &parcelport_impl::put_parcels_await;
(*future_await)(
Expand All @@ -295,19 +287,12 @@ namespace hpx { namespace parcelset
enqueue_parcels(dest, std::move(parcels), std::move(handlers),
std::move(future_await->new_gids_));

if (trigger)
get_connection_and_send_parcels(dest);
get_connection_and_send_parcels(dest);
}

public:
void put_parcels(locality const& dest, std::vector<parcel> parcels,
std::vector<write_handler_type> handlers)
{
put_parcels(dest, std::move(parcels), std::move(handlers), true);
}

void put_parcels(locality const& dest, std::vector<parcel> parcels,
std::vector<write_handler_type> handlers, bool trigger)
{
if (parcels.size() != handlers.size())
{
Expand All @@ -316,8 +301,6 @@ namespace hpx { namespace parcelset
return;
}

locality const& locality_id = dest;

#if defined(HPX_DEBUG)
// make sure all parcels go to the same locality
HPX_ASSERT(dest.type() == type());
Expand All @@ -335,8 +318,8 @@ namespace hpx { namespace parcelset

// enqueue the outgoing parcels ...
put_parcels_await(
locality_id, std::move(parcels), std::move(handlers), trigger,
archive, future_await);
dest, std::move(parcels), std::move(handlers), archive,
future_await);
}

void send_early_parcel(locality const & dest, parcel p)
Expand Down

0 comments on commit 58ad54e

Please sign in to comment.