Dear all,

I've been debugging a deadlock in LibGeoDecomp's HPX backend. Attached
is a minimal program which reproduces the deadlock (8/10 runs won't
terminate), but comes without any LibGeoDecomp-specific ballast.Does
the code deadlock for anyone else besides me? Is it expected to lock
up?

I've been using HPX master (a1778309a559d866bc48e4b8a8edfb47982a7225)
together with OpenMPI 1.8.8. Please find an execution log below:

> gentryx@neuromancer ~ $ g++-4.9.3 -O3 -march=native test.cpp -std=c++14 -o 
> test -Ilocal_install/include/ -Ilocal_install/include/hpx/external 
> -Llocal_install/lib -lhpx -lhpx_init -lboost_program_options -lboost_system 
> -lboost_thread
> gentryx@neuromancer ~ $ LD_LIBRARY_PATH=local_install/lib mpirun -np 4 ./test
> registration: HPXSimulatorUpdateGroupSdfafafasdasd/PatchLink/1-0
> registration: HPXSimulatorUpdateGroupSdfafafasdasd/PatchLink/2-0
> registration: HPXSimulatorUpdateGroupSdfafafasdasd/PatchLink/0-1
> registration: HPXSimulatorUpdateGroupSdfafafasdasd/PatchLink/0-2
> registration: HPXSimulatorUpdateGroupSdfafafasdasd/PatchLink/0-3
> registration: HPXSimulatorUpdateGroupSdfafafasdasd/PatchLink/3-0
> registration: HPXSimulatorUpdateGroupSdfafafasdasd/PatchLink/1-3
> registration: HPXSimulatorUpdateGroupSdfafafasdasd/PatchLink/2-1
> registration: HPXSimulatorUpdateGroupSdfafafasdasd/PatchLink/3-1
> lookup: HPXSimulatorUpdateGroupSdfafafasdasd/PatchLink/0-1
> registration: HPXSimulatorUpdateGroupSdfafafasdasd/PatchLink/1-2
> lookup: HPXSimulatorUpdateGroupSdfafafasdasd/PatchLink/0-2
> registration: HPXSimulatorUpdateGroupSdfafafasdasd/PatchLink/2-3
> registration: HPXSimulatorUpdateGroupSdfafafasdasd/PatchLink/3-2
> lookup: HPXSimulatorUpdateGroupSdfafafasdasd/PatchLink/0-3
> lookup: HPXSimulatorUpdateGroupSdfafafasdasd/PatchLink/1-0
> lookup: HPXSimulatorUpdateGroupSdfafafasdasd/PatchLink/3-0
> all done 0
> lookup: HPXSimulatorUpdateGroupSdfafafasdasd/PatchLink/3-1
> lookup: HPXSimulatorUpdateGroupSdfafafasdasd/PatchLink/3-2
> all done 3
> lookup: HPXSimulatorUpdateGroupSdfafafasdasd/PatchLink/2-0
> lookup: HPXSimulatorUpdateGroupSdfafafasdasd/PatchLink/1-2
> lookup: HPXSimulatorUpdateGroupSdfafafasdasd/PatchLink/1-3
> all done 1
> lookup: HPXSimulatorUpdateGroupSdfafafasdasd/PatchLink/2-1
> lookup: HPXSimulatorUpdateGroupSdfafafasdasd/PatchLink/2-3
> all done 2
> ^C

Thanks!
-Andreas


-- 
==========================================================
Andreas Schäfer
HPC and Grid Computing
Department of Computer Science 3
Friedrich-Alexander-Universität Erlangen-Nürnberg, Germany
+49 9131 85-27910
PGP/GPG key via keyserver
http://www.libgeodecomp.org
==========================================================

(\___/)
(+'.'+)
(")_(")
This is Bunny. Copy and paste Bunny into your
signature to help him gain world domination!
#include <hpx/lcos/broadcast.hpp>
#include <hpx/lcos/local/receive_buffer.hpp>
#include <hpx/runtime/get_ptr.hpp>
#include <hpx/hpx_init.hpp>
#include <hpx/hpx.hpp>
#include <iostream>
#include <boost/shared_ptr.hpp>
#include <vector>

static std::string itoa(int i)
{
    std::stringstream buf;
    buf << i;
    return buf.str();
}

struct test_server
  : hpx::components::simple_component_base<test_server>
{
    test_server()
    {}

    hpx::id_type call() const
    {
        return hpx::find_here();
    }
    HPX_DEFINE_COMPONENT_ACTION(test_server, call, call_action);
};

typedef hpx::components::simple_component<test_server> server_type;
HPX_REGISTER_COMPONENT(server_type, test_server);

typedef test_server::call_action call_action;
HPX_REGISTER_ACTION(call_action);

std::string genName(int source, int target)
{
    std::string basename = "HPXSimulatorUpdateGroupSdfafafasdasd";

    return basename + "/PatchLink/" +
        itoa(source) + "-" +
        itoa(target);
}

void testBar()
{
    int rank = hpx::get_locality_id();

    std::vector<hpx::id_type> boundingBoxReceivers;
    std::vector<hpx::id_type> boundingBoxAccepters;
    for (int i = 0; i < 4; ++i) {
        if (i == rank)
            continue;

        std::string name = genName(i, rank);
        std::cout << "registration: " << name << "\n";

        hpx::id_type id = hpx::new_<test_server>(hpx::find_here()).get();
        hpx::register_with_basename(name, id, 0).get();
        boundingBoxReceivers.push_back(id);
    }

    for (int i = 0; i < 4; ++i) {
        if (i == rank)
            continue;

        std::string name = genName(rank, i);
        std::cout << "lookup: " << name << "\n";
        std::vector<hpx::future<hpx::id_type> > ids = hpx::find_all_from_basename(name, 1);
        boundingBoxAccepters.push_back(std::move(ids[0].get()));
    }

    std::cout << "all done " << rank << "\n";
}

int hpx_main(int argc, char **argv)
{
    testBar();
    return hpx::finalize();
}

int main(int argc, char **argv)
{
    // We want HPX to run hpx_main() on all localities to avoid the
    // initial overhead caused by broadcasting the work from one to
    // all other localities:
    std::vector<std::string> config(1, "hpx.run_hpx_main!=1");

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

Attachment: signature.asc
Description: Digital signature

_______________________________________________
hpx-users mailing list
[email protected]
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users

Reply via email to