Skip to content

HPX distributed barrier runs into assertion error #6430

@JiakunYan

Description

@JiakunYan

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions