Skip to content

Commit

Permalink
Use unwrap and unwrapping in the examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Naios committed Jul 27, 2017
1 parent b6545ba commit e4465fc
Show file tree
Hide file tree
Showing 18 changed files with 34 additions and 34 deletions.
4 changes: 2 additions & 2 deletions examples/1d_stencil/1d_stencil_2.cpp
Expand Up @@ -66,7 +66,7 @@ struct stepper
hpx::future<space> do_work(std::size_t nx, std::size_t nt)
{
using hpx::dataflow;
using hpx::util::unwrapped;
using hpx::util::unwrapping;

// U[t][i] is the state of position i at time t.
std::vector<space> U(2);
Expand All @@ -77,7 +77,7 @@ struct stepper
for (std::size_t i = 0; i != nx; ++i)
U[0][i] = hpx::make_ready_future(double(i));

auto Op = unwrapped(&stepper::heat);
auto Op = unwrapping(&stepper::heat);

// Actual time step loop
for (std::size_t t = 0; t != nt; ++t)
Expand Down
4 changes: 2 additions & 2 deletions examples/1d_stencil/1d_stencil_4.cpp
Expand Up @@ -133,7 +133,7 @@ struct stepper
std::uint64_t nd)
{
using hpx::dataflow;
using hpx::util::unwrapped;
using hpx::util::unwrapping;

// U[t][i] is the state of position i at time t.
std::vector<space> U(2);
Expand All @@ -154,7 +154,7 @@ struct stepper
// limit depth of dependency tree
hpx::lcos::local::sliding_semaphore sem(nd);

auto Op = unwrapped(&stepper::heat_part);
auto Op = unwrapping(&stepper::heat_part);

// Actual time step loop
for (std::size_t t = 0; t != nt; ++t)
Expand Down
4 changes: 2 additions & 2 deletions examples/1d_stencil/1d_stencil_4_parallel.cpp
Expand Up @@ -117,7 +117,7 @@ struct stepper
// time steps
hpx::future<space> do_work(std::size_t np, std::size_t nx, std::size_t nt)
{
using hpx::util::unwrapped;
using hpx::util::unwrapping;
using hpx::dataflow;
using hpx::parallel::for_each;
using hpx::parallel::execution::par;
Expand All @@ -131,7 +131,7 @@ struct stepper
for (std::size_t i = 0; i != np; ++i)
U[0][i] = hpx::make_ready_future(partition_data(nx, double(i)));

auto Op = unwrapped(&stepper::heat_part);
auto Op = unwrapping(&stepper::heat_part);

// Actual time step loop
for (std::size_t t = 0; t != nt; ++t)
Expand Down
4 changes: 2 additions & 2 deletions examples/1d_stencil/1d_stencil_4_repart.cpp
Expand Up @@ -219,7 +219,7 @@ struct stepper
boost::shared_array<double> data)
{
using hpx::dataflow;
using hpx::util::unwrapped;
using hpx::util::unwrapping;

// U[t][i] is the state of position i at time t.
std::vector<space> U(2);
Expand Down Expand Up @@ -255,7 +255,7 @@ struct stepper
);
}

auto Op = unwrapped(&stepper::heat_part);
auto Op = unwrapping(&stepper::heat_part);

// Actual time step loop
for (std::size_t t = 0; t != nt; ++t)
Expand Down
4 changes: 2 additions & 2 deletions examples/1d_stencil/1d_stencil_4_throttle.cpp
Expand Up @@ -202,7 +202,7 @@ struct stepper
hpx::future<space> do_work(std::size_t np, std::size_t nx, std::size_t nt)
{
using hpx::dataflow;
using hpx::util::unwrapped;
using hpx::util::unwrapping;

// U[t][i] is the state of position i at time t.
std::vector<space> U(2);
Expand All @@ -220,7 +220,7 @@ struct stepper
}
);

auto Op = unwrapped(&stepper::heat_part);
auto Op = unwrapping(&stepper::heat_part);

// Actual time step loop
for (std::size_t t = 0; t != nt; ++t)
Expand Down
4 changes: 2 additions & 2 deletions examples/1d_stencil/1d_stencil_5.cpp
Expand Up @@ -224,10 +224,10 @@ struct stepper
partition const& right)
{
using hpx::dataflow;
using hpx::util::unwrapped;
using hpx::util::unwrapping;

return dataflow(
unwrapped(
unwrapping(
[middle](partition_data const& l, partition_data const& m,
partition_data const& r)
{
Expand Down
4 changes: 2 additions & 2 deletions examples/1d_stencil/1d_stencil_6.cpp
Expand Up @@ -275,11 +275,11 @@ struct stepper
partition const& right)
{
using hpx::dataflow;
using hpx::util::unwrapped;
using hpx::util::unwrapping;

return dataflow(
hpx::launch::async,
unwrapped(
unwrapping(
[left, middle, right](partition_data const& l, partition_data const& m,
partition_data const& r)
{
Expand Down
6 changes: 3 additions & 3 deletions examples/1d_stencil/1d_stencil_7.cpp
Expand Up @@ -260,13 +260,13 @@ struct stepper
partition const& middle, partition const& right)
{
using hpx::dataflow;
using hpx::util::unwrapped;
using hpx::util::unwrapping;

hpx::shared_future<partition_data> middle_data =
middle.get_data(partition_server::middle_partition);

hpx::future<partition_data> next_middle = middle_data.then(
unwrapped(
unwrapping(
[middle](partition_data const& m) -> partition_data
{
HPX_UNUSED(middle);
Expand All @@ -284,7 +284,7 @@ struct stepper

return dataflow(
hpx::launch::async,
unwrapped(
unwrapping(
[left, middle, right](partition_data next, partition_data const& l,
partition_data const& m, partition_data const& r) -> partition
{
Expand Down
4 changes: 2 additions & 2 deletions examples/1d_stencil/1d_stencil_8.cpp
Expand Up @@ -485,7 +485,7 @@ partition stepper_server::heat_part(partition const& left,
middle.get_data(partition_server::middle_partition);

hpx::future<partition_data> next_middle = middle_data.then(
hpx::util::unwrapped(
hpx::util::unwrapping(
[middle](partition_data const& m) -> partition_data
{
HPX_UNUSED(middle);
Expand All @@ -503,7 +503,7 @@ partition stepper_server::heat_part(partition const& left,

return hpx::dataflow(
hpx::launch::async,
hpx::util::unwrapped(
hpx::util::unwrapping(
[left, middle, right](partition_data next, partition_data const& l,
partition_data const& m, partition_data const& r) -> partition
{
Expand Down
4 changes: 2 additions & 2 deletions examples/allgather/ag/server/allgather.cpp
Expand Up @@ -6,7 +6,7 @@
#include <hpx/hpx.hpp>
#include <hpx/include/iostreams.hpp>
#include <hpx/include/async.hpp>
#include <hpx/util/unwrapped.hpp>
#include <hpx/util/unwrap.hpp>

#include "allgather.hpp"

Expand Down Expand Up @@ -40,7 +40,7 @@ namespace ag { namespace server
lazy_results.push_back( hpx::async(get_item_, point_components[i]) );
}

n_ = hpx::util::unwrapped(lazy_results);
n_ = hpx::util::unwrap(lazy_results);
}

double allgather::get_item() const
Expand Down
4 changes: 2 additions & 2 deletions examples/quickstart/fibonacci_dataflow.cpp
Expand Up @@ -14,7 +14,7 @@
#include <hpx/include/util.hpp>
#include <hpx/include/lcos.hpp>

#include <hpx/util/unwrapped.hpp>
#include <hpx/util/unwrap.hpp>

#include <cstdint>
#include <iostream>
Expand Down Expand Up @@ -45,7 +45,7 @@ hpx::future<std::uint64_t> fibonacci(std::uint64_t n)

return
hpx::dataflow(
hpx::util::unwrapped(
hpx::util::unwrapping(
[](std::uint64_t lhs, std::uint64_t rhs)
{
return lhs + rhs;
Expand Down
2 changes: 1 addition & 1 deletion examples/quickstart/fibonacci_futures_distributed.cpp
Expand Up @@ -7,7 +7,7 @@
#include <hpx/include/actions.hpp>
#include <hpx/include/util.hpp>
#include <hpx/include/lcos.hpp>
#include <hpx/util/unwrapped.hpp>
#include <hpx/util/unwrap.hpp>

#include <cstddef>
#include <cstdint>
Expand Down
2 changes: 1 addition & 1 deletion examples/quickstart/hello_world.cpp
Expand Up @@ -108,7 +108,7 @@ void hello_world_foreman()
// all the futures in the vector have returned.
hpx::lcos::local::spinlock mtx;
hpx::lcos::wait_each(
hpx::util::unwrapped([&](std::size_t t) {
hpx::util::unwrapping([&](std::size_t t) {
if (std::size_t(-1) != t)
{
std::lock_guard<hpx::lcos::local::spinlock> lk(mtx);
Expand Down
6 changes: 3 additions & 3 deletions examples/quickstart/interest_calculator.cpp
Expand Up @@ -50,7 +50,7 @@ int hpx_main(variables_map & vm)
using hpx::shared_future;
using hpx::make_ready_future;
using hpx::dataflow;
using hpx::util::unwrapped;
using hpx::util::unwrapping;
hpx::naming::id_type here = hpx::find_here();

double init_principal=vm["principal"].as<double>(); //Initial principal
Expand Down Expand Up @@ -81,8 +81,8 @@ int hpx_main(variables_map & vm)

for (int i = 0; i < t; ++i)
{
shared_future<double> interest = dataflow(unwrapped(calc), principal, rate);
principal = dataflow(unwrapped(add), principal, interest);
shared_future<double> interest = dataflow(unwrapping(calc), principal, rate);
principal = dataflow(unwrapping(add), principal, interest);
}

// wait for the dataflow execution graph to be finished calculating our
Expand Down
2 changes: 1 addition & 1 deletion examples/quickstart/pipeline1.cpp
Expand Up @@ -31,7 +31,7 @@ struct pipeline
};

hpx::async(trim, std::move(item))
.then(hpx::util::unwrapped(
.then(hpx::util::unwrapping(
[](std::string const& tc)
{
std::cout << "->" << tc << std::endl;
Expand Down
4 changes: 2 additions & 2 deletions examples/sheneos/sheneos_compare.cpp
Expand Up @@ -243,7 +243,7 @@ void test_sheneos_one_bulk(std::size_t num_ye_points,
// shen.interpolate_one_bulk_async(values_ye, values_temp, values_rho,
// sheneos::server::partition3d::logpress);

//std::vector<double> results = hpx::util::unwrapped(bulk_one_tests);
//std::vector<double> results = hpx::util::unwrap(bulk_one_tests);
}

///////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -342,7 +342,7 @@ void test_sheneos_bulk(std::size_t num_ye_points,
}
}
}
//std::vector<std::vector<double> > results = hpx::util::unwrapped(bulk_tests);
//std::vector<std::vector<double> > results = hpx::util::unwrap(bulk_tests);
}

///////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 2 additions & 2 deletions examples/sheneos/sheneos_test.cpp
Expand Up @@ -192,7 +192,7 @@ void test_sheneos_one_bulk(std::size_t num_ye_points,
shen.interpolate_one_bulk_async(values,
sheneos::server::partition3d::logpress);

std::vector<double> results = hpx::util::unwrapped(bulk_one_tests);
std::vector<double> results = hpx::util::unwrap(bulk_one_tests);
}

HPX_DECLARE_ACTION(test_sheneos_one_bulk, test_one_bulk_action);
Expand Down Expand Up @@ -284,7 +284,7 @@ void test_sheneos_bulk(std::size_t num_ye_points,
hpx::lcos::future<std::vector<std::vector<double> > > bulk_tests =
shen.interpolate_bulk_async(values);

std::vector<std::vector<double> > results = hpx::util::unwrapped(bulk_tests);
std::vector<std::vector<double> > results = hpx::util::unwrap(bulk_tests);
}

HPX_DECLARE_ACTION(test_sheneos_bulk, test_bulk_action);
Expand Down
2 changes: 1 addition & 1 deletion examples/transpose/transpose_block_numa.cpp
Expand Up @@ -492,7 +492,7 @@ int hpx_main(boost::program_options::variables_map& vm)
)
);
}
std::vector<double> errsqs = hpx::util::unwrapped(numa_workers);
std::vector<double> errsqs = hpx::util::unwrap(numa_workers);

///////////////////////////////////////////////////////////////////////
// Analyze and output results
Expand Down

0 comments on commit e4465fc

Please sign in to comment.