Thanks Chris! This is a bug on our end as the specialization is done for 
hpx::threads::thread_id instead of hpx::thread::id (which is a different type 
for arcane reasons). I will add the correct specialization asap (see 
https://github.com/STEllAR-GROUP/hpx/issues/5129).

 

Regards Hartmut

---------------

 <http://stellar.cct.lsu.edu> http://stellar.cct.lsu.edu

 <https://github.com/STEllAR-GROUP/hpx> https://github.com/STEllAR-GROUP/hpx

 

From: hpx-users-boun...@stellar-group.org <hpx-users-boun...@stellar-group.org> 
On Behalf Of ct clmsn
Sent: Tuesday, January 26, 2021 3:34 PM
To: Hartmut Kaiser <hkai...@cct.lsu.edu>
Cc: hpx-users@stellar-group.org
Subject: Re: [hpx-users] advice hashing hpx::thread::id

 

Hartmut,

 

This looks like a slightly more subtle error. I'm deploying threads in this 
fashion (line 65): 
https://github.com/STEllAR-GROUP/hpx/blob/master/libs/parallelism/threading/tests/unit/thread_launching.cpp

 

I've a situation where the code I'm working on attempts to store 
hpx::thread:id's into a std::unordered_set<hpx::thread::id, std::int32_t>. The 
compiler is throwing the following error:

 

".../c++/x.y.z/bits/hashtable_policy.h:87:34: error: no match for call to 
`(const std::hash<hpx::thread::id>) (const hpx::thread::id&)`

 

The compiler (gnu) is complaining std::hash<> hasn't been specialized on 
hpx::thread::id. From my compilation errors, it looks like hpx::threads::id != 
hpx::thread::id.

 

Lines 241 and 242 (thread_launching.cpp) have some commented out lines that 
look like the start of a template specialization on hpx::thread::id.

 

For reference, line 75 specializes std::hash<> on hpx::threads::id not 
hpx::thread:id; this file: 
https://github.com/STEllAR-GROUP/hpx/blob/master/libs/core/threading_base/include/hpx/threading_base/threading_base_fwd.hpp

 

Wasn't sure if ya'll have seen this issue before or not. Thanks for looking 
into this one!

 

v/r,

Chris

 

 

 

On Tue, Jan 26, 2021 at 1:31 PM Hartmut Kaiser <hkai...@cct.lsu.edu 
<mailto:hkai...@cct.lsu.edu> > wrote:

Chris,

> i'm attempting to use std::hash<hpx::thread::id> and found a template
> specialized version of std::hash<hpx::threads::id> in this file:
> hpx/threading_base/threading_base_fwd.hpp
>
> The implementation makes use of a template specialized version of
> std::hash<hpx::threads::thread_data const*>.
>
> Would recycling that code for hpx::thread::id and
> hpx::threads::thread_data be sufficient or should I take another approach?

std::hash<hpx::threads::id> should just work for you (because of the code you 
mentioned). What issues do you have?

Thanks!
Regards Hartmut
---------------
http://stellar.cct.lsu.edu
https://github.com/STEllAR-GROUP/hpx





_______________________________________________
hpx-users mailing list
hpx-users@stellar-group.org
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users

Reply via email to