Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bulk_then_execute has unexpected return type/does not compile #3182

Closed
msimberg opened this issue Feb 20, 2018 · 0 comments · Fixed by #3205
Closed

bulk_then_execute has unexpected return type/does not compile #3182

msimberg opened this issue Feb 20, 2018 · 0 comments · Fixed by #3205

Comments

@msimberg
Copy link
Contributor

msimberg commented Feb 20, 2018

The following snippet of code does not do what I would expect it to do:

void fun1(int, shared_future<void>) {...}
int fun2(int, shared_future<void>) {...}
...
{
    shared_future<void> f = ...;
    std::vector<int> v(100);
    // tested with exec as pool_executor, thread_pool_executor or this_thread_executor
    bulk_then_execute(exec, &fun1, v, f); // Returns future<void>
    // bulk_then_execute(exec, &fun2, v, f); // Does not compile
}

Expected Behavior

  • with fun1 I expect either that .get()ing the future<void> would block until all 100 invocations of fun1 have finished or that it returns a vector<future<void>> like bulk_async_execute
  • with fun2 I expect it to compile and return a vector<future<int>>

Actual Behavior

  • with fun1 get() does not wait for all invocations to finish
  • with fun2 it fails to compile with the following error:
/home/simbergm/src/hpx-worktrees/fix-examples/hpx/parallel/executors/thread_execution.hpp:213:25: error: could not convert ‘hpx::traits::future_access<hpx::lcos::future<R>>::create(boost::intrusive_ptr<U>&&) [with SharedState = hpx::lcos::detail::future_data_base<std::vector<hpx::lcos::future<int>, std::allocator<hpx::lcos::future<int> > > >; R = std::vector<hpx::lcos::future<int>, std::allocator<hpx::lcos::future<int> > >]()’ from ‘hpx::lcos::future<std::vector<hpx::lcos::future<int>, std::allocator<hpx::lcos::future<int> > > >’ to ‘std::enable_if<true, hpx::lcos::future<std::vector<int> > >::type {aka hpx::lcos::future<std::vector<int> >}’
             std::move(p));
                         ^

Specifications

  • HPX Version: 8b0f81c
  • Platform (compiler, OS): gcc 6.3.0, Ubuntu 16.04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants