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

wait_for does always in "deferred" state for calls on remote localities #2796

Closed
KADichev opened this issue Aug 2, 2017 · 1 comment · Fixed by #2797
Closed

wait_for does always in "deferred" state for calls on remote localities #2796

KADichev opened this issue Aug 2, 2017 · 1 comment · Fixed by #2797

Comments

@KADichev
Copy link
Contributor

KADichev commented Aug 2, 2017

wait_for does not work as expected for calls on remote localities. Even after the remote call successfully completes, wait_for returns "deferred". The bug can be reproduced with many examples, e.g. this one:

#include <hpx/hpx_init.hpp>
#include <hpx/include/lcos.hpp>
#include <hpx/include/actions.hpp>


#include <chrono>

#include <iostream>

void f();
HPX_PLAIN_ACTION(f, f_action);

void f() 
{
    std::cout << "Calling empty f\n";
}

int hpx_main(boost::program_options::variables_map &vm)
{
    auto remotes = hpx::find_remote_localities();
    if (remotes.size() == 0) {
        std::cout << "Need at least 2 localities!\n";
        return -1; 
    }   
    auto fut = hpx::async<f_action>(remotes[0]);
    auto status = fut.wait_for(std::chrono::seconds(3));
    if (status == hpx::lcos::future_status::deferred)
        std::cout << "Status deferred after waiting for 3 seconds in a trivial function!\n";

    hpx::finalize();
    return 0;
}

int main(int argc, char* argv[])
{
    boost::program_options::options_description description("Bug");
    return hpx::init(description, argc, argv);
}
@hkaiser
Copy link
Member

hkaiser commented Aug 2, 2017

@KADichev thanks for reporting this, we'll have a look asap.

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