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

HPX distributed barrier runs into assertion error #6430

Open
JiakunYan opened this issue Feb 1, 2024 · 1 comment
Open

HPX distributed barrier runs into assertion error #6430

JiakunYan opened this issue Feb 1, 2024 · 1 comment

Comments

@JiakunYan
Copy link
Contributor

JiakunYan commented Feb 1, 2024

Expected Behavior

The hpx::distributed::barrier::synchronize() runs successfully.

Actual Behavior

It gets into an assertion error

{file}: /home/jiakuny/workspace/hpx-master/libs/full/collectives/src/barrier.cpp
{line}: 210
{function}: static void hpx::distributed::barrier::synchronize()
{what}: Assertion 'b[0].node_ && b[1].node_' failed: HPX(assertion_failure)

Steps to Reproduce the Problem

A simple example code to reproduce this error. (Ran it with 2 localities)

void run_test();
HPX_PLAIN_ACTION(run_test, run_test_action)

void run_test() {
    fprintf(stderr, "%d: run_test\n", hpx::get_locality_id());
    hpx::distributed::barrier::synchronize();
}

///////////////////////////////////////////////////////////////////////////////
int hpx_main(hpx::program_options::variables_map& b_arg)
{
    std::vector<hpx::future<void>> futs;
    for (auto l : hpx::find_all_localities()) {
        futs.emplace_back(hpx::async<run_test_action>(l));
    }
    hpx::wait_all(futs);

    hpx::finalize();
    return 0;
}

int main(int argc, char* argv[])
{
    namespace po = hpx::program_options;
    po::options_description description("HPX test barrier");

    hpx::init_params init_args;
    init_args.desc_cmdline = description;

    return hpx::init(argc, argv, init_args);
}

Specifications

  • HPX Version: The current master branch
  • Platform (compiler, OS): ubuntu 20.04, GCC 9.4
@JiakunYan
Copy link
Contributor Author

GDB told me post_main was triggered earilier than the call to hpx::distributed::barrier::synchronize() on locality 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants