Andreas,
> 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
The function find_all_from_basename is meant to return all registered ids
for the same base name. Could you please try to use the find_from_basename
instead:
std::string genName(int source)
{
std::string basename = "HPXSimulatorUpdateGroupSdfafafasdasd";
return basename + "/PatchLink/" + itoa(source);
}
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::cout << "registration: " << i << "\n";
hpx::id_type id = hpx::new_<test_server>(hpx::find_here()).get();
hpx::register_with_basename(genName(rank), id, i).get();
boundingBoxReceivers.push_back(id);
}
std::cout << "lookup: " << name << "\n";
for (int i = 0; i < 4; ++i) {
if (i == rank)
continue;
hpx::future<hpx::id_type> id = hpx::find_from_basename(genName(i),
rank);
boundingBoxAccepters.push_back(id.get());
}
std::cout << "all done " << rank << "\n";
}
I'll look into it as soon as I'm back from the travel. The above should do
the trick for now, though (if I got the rank <--> i business right from the
top of my head).
Alternatively, this should work as well:
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) {
std::cout << "registration: " << i << "\n";
hpx::id_type id = hpx::new_<test_server>(hpx::find_here()).get();
hpx::register_with_basename(genName(rank), id, i).get();
boundingBoxReceivers.push_back(id);
}
std::cout << "lookup: " << name << "\n";
boundingBoxAccepters =
hpx::util::unwrapped(hpx::find_all_from_basename(genName(i), 4));
std::cout << "all done " << rank << "\n";
}
However, this creates a superfluous test_server. OTOH, if we consider
oversubscription (by creating more partitions than we have ranks), you will
create one receiver/acceptor pair for each partition, at which point you
don't know any more what is local and what is remote. In this case the
scheme might actually be what you need.
Also, I'd suggest to use client classes instead of plain id_type, but that's
more of a matter of taste... Both new_<> and the base name API functions
support clients directly.
Regards Hartmut
---------------
http://boost-spirit.com
http://stellar.cct.lsu.edu
>
> 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!
_______________________________________________
hpx-users mailing list
[email protected]
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users