Skip to content

Commit

Permalink
Replaced some uses of wait() by wait_all()
Browse files Browse the repository at this point in the history
  • Loading branch information
K-ballo committed Jan 25, 2014
1 parent 8e8e3ac commit 50be59f
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 31 deletions.
10 changes: 5 additions & 5 deletions examples/jacobi/jacobi_component/server/solver.hpp
Expand Up @@ -93,8 +93,8 @@ namespace jacobi
HPX_ASSERT(stencil_iterators[y-1].id);
HPX_ASSERT(stencil_iterators[y].id);
HPX_ASSERT(stencil_iterators[y+1].id);
hpx::lcos::wait(init_futures[y-1]);
hpx::lcos::wait(init_futures[y+1]);
hpx::wait_all(init_futures[y-1]);
hpx::wait_all(init_futures[y+1]);
boundary_futures.push_back(
stencil_iterators[y].setup_boundary(
stencil_iterators[y-1]
Expand All @@ -105,7 +105,7 @@ namespace jacobi
}
);
HPX_ASSERT(stencil_iterators[0].id);
hpx::lcos::wait(boundary_futures);
hpx::wait_all(boundary_futures);
HPX_ASSERT(stencil_iterators[0].id);
}

Expand All @@ -122,7 +122,7 @@ namespace jacobi
run_futures.push_back(stencil_iterators[y].run(max_iterations));
}
HPX_ASSERT(stencil_iterators[0].id);
hpx::lcos::wait(run_futures);
hpx::wait_all(run_futures);
HPX_ASSERT(stencil_iterators[0].id);
*/

Expand All @@ -136,7 +136,7 @@ namespace jacobi
stencil_iterators[y].step()
);
}
hpx::lcos::wait(run_futures);
hpx::wait_all(run_futures);
}

double time_elapsed = t.elapsed();
Expand Down
4 changes: 2 additions & 2 deletions examples/quickstart/hello_world.cpp
Expand Up @@ -150,9 +150,9 @@ int main()
}

// The non-callback version of hpx::lcos::wait takes a single parameter,
// a future of vectors to wait on. hpx::lcos::wait only returns when
// a future of vectors to wait on. hpx::wait_all only returns when
// all of the futures have finished.
hpx::lcos::wait(futures);
hpx::wait_all(futures);
return 0;
}
//]
2 changes: 1 addition & 1 deletion examples/quickstart/non_atomic_rma.cpp
Expand Up @@ -125,7 +125,7 @@ int hpx_main(po::variables_map &vm)
//for (int i=0;i<N;i++) {
// future_update[i].get();
//}
hpx::lcos::wait(future_update);
hpx::wait_all(future_update);

for (int i=0;i<array_length;i++) {
components::access_memory_block<data>
Expand Down
6 changes: 3 additions & 3 deletions examples/quickstart/quicksort.cpp
Expand Up @@ -118,7 +118,7 @@ void quicksort_parallel<T>::call(id_type prefix, id_type d, std::size_t begin,
(std::max)(begin + 1, middle_idx), end);

call(prefix, d, begin, middle_idx);
::hpx::lcos::wait(n);
::hpx::wait_all(n);
}

else
Expand All @@ -127,7 +127,7 @@ void quicksort_parallel<T>::call(id_type prefix, id_type d, std::size_t begin,
begin, middle_idx);

call(prefix, d, (std::max)(begin + 1, middle_idx), end);
::hpx::lcos::wait(n);
::hpx::wait_all(n);
}
}
}
Expand Down Expand Up @@ -183,7 +183,7 @@ int hpx_main(variables_map& vm)
t.restart();
unique_future<void> n = async<quicksort_int_action>(
prefix, prefix, mb.get_gid(), 0, elements);
::hpx::lcos::wait(n);
::hpx::wait_all(n);
elapsed = t.elapsed();

std::cout << " elapsed=" << elapsed << "\n"
Expand Down
6 changes: 3 additions & 3 deletions examples/sheneos/sheneos/interpolator.cpp
Expand Up @@ -260,7 +260,7 @@ namespace sheneos
}

// Wait for initialization to finish.
hpx::lcos::wait(lazy_sync);
hpx::wait_all(lazy_sync);
}

///////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -397,7 +397,7 @@ namespace sheneos
}

// wait for all asynchronous operations to complete
lcos::wait(lazy_results);
wait_all(lazy_results);

return overall_result;
}
Expand Down Expand Up @@ -515,7 +515,7 @@ namespace sheneos
}

// wait for all asynchronous operations to complete
lcos::wait(lazy_results);
wait_all(lazy_results);

return overall_results;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/sheneos/sheneos_test.cpp
Expand Up @@ -99,7 +99,7 @@ void test_sheneos(std::size_t num_ye_points, std::size_t num_temp_points,
}
}

hpx::lcos::wait(tests);
hpx::wait_all(tests);
}

HPX_PLAIN_ACTION(test_sheneos, test_action);
Expand Down
2 changes: 1 addition & 1 deletion examples/tuplespace/simple_central_tuplespace_client.cpp
Expand Up @@ -146,7 +146,7 @@ int hpx_main()
futures.push_back(hpx::async<action_type>
(node, tuplespace_symbol_name, tuple2));
}
hpx::lcos::wait(futures);
hpx::wait_all(futures);
}

// Initiate shutdown of the runtime systems on all localities.
Expand Down
8 changes: 4 additions & 4 deletions src/runtime/components/server/runtime_support_server.cpp
Expand Up @@ -27,7 +27,7 @@
#include <hpx/runtime/components/component_commandline_base.hpp>
#include <hpx/runtime/actions/continuation.hpp>
#include <hpx/runtime/applier/apply.hpp>
#include <hpx/lcos/future_wait.hpp>
#include <hpx/lcos/wait_all.hpp>

#include <hpx/util/assert.hpp>
#include <hpx/util/portable_binary_iarchive.hpp>
Expand Down Expand Up @@ -392,7 +392,7 @@ namespace hpx { namespace components { namespace server

// wait for all localities to finish executing their registered
// shutdown functions
lcos::wait(lazy_actions);
wait_all(lazy_actions);
}

void runtime_support::shutdown_all(double timeout)
Expand Down Expand Up @@ -426,7 +426,7 @@ namespace hpx { namespace components { namespace server
}

// wait for all localities to be stopped
lcos::wait(lazy_actions);
wait_all(lazy_actions);
}

// now make sure this local locality gets shut down as well.
Expand Down Expand Up @@ -458,7 +458,7 @@ namespace hpx { namespace components { namespace server
}

// wait for all localities to be stopped
lcos::wait(lazy_actions);
wait_all(lazy_actions);
}

// now make sure this local locality gets terminated as well.
Expand Down
6 changes: 3 additions & 3 deletions tests/regressions/lcos/dataflow_791.cpp
Expand Up @@ -21,7 +21,7 @@

using std::vector;
using hpx::lcos::shared_future;
using hpx::lcos::wait;
using hpx::wait_all;
using hpx::async;
using hpx::lcos::local::dataflow;
using hpx::util::unwrapped;
Expand Down Expand Up @@ -152,7 +152,7 @@ void LU( int numBlocks)
}
}
}
wait(dfArray[numBlocks-1][numBlocks-1][numBlocks-1]);
wait_all(dfArray[numBlocks-1][numBlocks-1][numBlocks-1]);
}

void getBlockList(vector<vector<block>> &blockList, int numBlocks)
Expand Down Expand Up @@ -286,7 +286,7 @@ void InitMatrix3()
for(int i = 0; i < size; i++) {
futures.push_back( async( initLoop, i));
}
wait(futures);
wait_all(futures);
}

void initLoop(int i) {
Expand Down
2 changes: 1 addition & 1 deletion tests/regressions/lcos/future_hang_on_then_629.cpp
Expand Up @@ -138,7 +138,7 @@ double null_tree(

null_function(seed, delay_iterations);

hpx::wait(futures);
hpx::wait_all(futures);

double d = 0.;

Expand Down
Expand Up @@ -114,7 +114,7 @@ double null_tree(

null_function(seed, delay_iterations);

hpx::wait(futures, [&] (std::size_t, double r) { d += r; });
hpx::wait_all(futures, [&] (std::size_t, double r) { d += r; });

return d;
}
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/lcos/local_dataflow.cpp
Expand Up @@ -106,7 +106,7 @@ void function_pointers()
, make_ready_future())
);

hpx::wait(f1);
f1.wait();
HPX_TEST_EQ(f2.get(), 126);
HPX_TEST_EQ(f3.get(), 163);
HPX_TEST_EQ(f4.get(), 10 * 84);
Expand Down Expand Up @@ -161,7 +161,7 @@ void future_function_pointers()
&future_void_f1, async(&future_void_sf1, shared_future<void>(make_ready_future()))
);

hpx::wait(f1);
f1.wait();

HPX_TEST_EQ(future_void_f1_count, 2u);
future_void_f1_count.store(0);
Expand All @@ -172,7 +172,7 @@ void future_function_pointers()
, async(&future_void_sf1, shared_future<void>(make_ready_future()))
);

hpx::wait(f2);
f2.wait();
HPX_TEST_EQ(future_void_f1_count, 2u);
HPX_TEST_EQ(future_void_f2_count, 1u);
future_void_f1_count.store(0);
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/lcos/packaged_action.cpp
Expand Up @@ -59,7 +59,7 @@ int hpx_main(variables_map&)
// create an implicit future
null_thread_executed = false;
{
HPX_TEST(hpx::lcos::wait(async<null_action>(hpx::find_here())));
HPX_TEST(async<null_action>(hpx::find_here()).get());
}
HPX_TEST(null_thread_executed);

Expand All @@ -82,7 +82,7 @@ int hpx_main(variables_map&)
// create an implicit future
null_thread_executed = false;
{
HPX_TEST(hpx::lcos::wait(async(do_null, hpx::find_here())));
HPX_TEST(async(do_null, hpx::find_here()).get());
}
HPX_TEST(null_thread_executed);

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/threads/thread_affinity.cpp
Expand Up @@ -159,7 +159,7 @@ int hpx_main(boost::program_options::variables_map& /*vm*/)
// The non-callback version of hpx::lcos::wait takes a single parameter,
// a future of vectors to wait on. hpx::lcos::wait only returns when
// all of the futures have finished.
hpx::lcos::wait(futures);
hpx::wait_all(futures);
}

// Initiate shutdown of the runtime system.
Expand Down

0 comments on commit 50be59f

Please sign in to comment.