Hi Konstantin,

On Monday, June 08, 2015 18:35:18 Konstantin Kronfeldner wrote:
> Hello all,
> 
> I've run into some issues with the registration of global ids with global
> names.
> I'm working with the latest hpx trunk.
> 
> I have to create several instances of server component objects, which then
> have to be found by client objects.
> At the time of creation of the server components there are no client
> objects yet, as they are supposed to register while the simulation is
> running.
> In order to find the gids of the server components, I wanted to register
> them under a global base name using hpx::register_id_with_basename(), and
> retrieve them with hpx::find_all_ids_from_basename(). Looking at those
> functions, I thought that multiple ids with the same name should be
> possible. The registration of these gids seems to work fine, as the return
> value is always true.

I think this is a problem in the code. IMHO the registration should fail if 
there is an already registered id with that name. Could you create an issue 
for that please? That means that line 118 and 123 should return false in your 
minimal testcase. Not knowing the total amount of elements in your sequence is 
certainly a problem. I think the best way is, as you already described, is to 
have one "manager" per locality that is able to dispatch to the appropriate 
registered name of your dynamically allocated objects later on.

> 
> But when retrieving those objects, I ran into several problems.
> - I don't know the exact number of server objects that will be created but
> hpx::find_all_ids_from_basename() expects me to know the expected number
> (Though, this might be solvable in another way, as there *should* be as
> many of them as there are localities.)
> - When trying to use f.get() on anything but the first element in the
> vector returned by hpx::find_all_ids_from_basename() the thread doesn't
> return.

>From looking at your minimal testcase, you don't supply a sequence number 
(It's the last argument for register_with_basename: 
https://github.com/STEllAR-GROUP/hpx/blob/master/hpx/hpx_fwd.hpp#L1133).
That means that you more or less overwrite the registration of A with B, and B 
with C. In the end, there is only one component registered. That's the reason 
why you only successfully get the first element.

> 
> I was hoping you could tell me what I'm doing wrong, or if there is a
> better solution to this problem.
> I've attached a minimal example of my code.
> 
> Thank you very much for your help.
> 
> Regards, Konstantin


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

Reply via email to