Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concurrent data structures support #2235

Open
2 of 6 tasks
biddisco opened this issue Jul 5, 2016 · 18 comments
Open
2 of 6 tasks

Concurrent data structures support #2235

biddisco opened this issue Jul 5, 2016 · 18 comments

Comments

@biddisco
Copy link
Contributor

biddisco commented Jul 5, 2016

Attempting to port some CMS (from CERN c.f. @felicepantaleo, @rovere) software to HPX from TBB has hit a problem - the CMS code makes fairly liberal use of tbb concurrent data structures that we do not have drop-in replacements for in hpx. These need to be created/included in HPX.

  • concurrent_queue (boost::lockfree::queue)
  • concurrent_unordered_map (see hpx::parcelset::policies::verbs where readers/writer mutex is implemented for concurrent unordered map).
  • concurrent_unordered_set
  • concurrent_vector

also possibly required are replacements for

  • tbb_hash
  • tbb_hasher

For reference - some TBB related functions/classes that are used in the CMS software stack are as follows (this list may be incomplete).

$ git gr "tbb::" | grep -o -E "tbb::.*" | tr '<'  ' '  | awk '{print $1}' | sort | uniq -c
      2 tbb::",
      3 tbb::blocked_range
      6 tbb::concurrent_queue
     27 tbb::concurrent_unordered_map
      7 tbb::concurrent_unordered_set
      8 tbb::concurrent_vector
      3 tbb::empty_task*
      1 tbb::parallel_for(
      1 tbb::parallel_for(tbb::blocked_range
      1 tbb::parallel_for(0UL,collseed_size,1UL,theLoop);
      1 tbb::parallel_for_each(tasks.begin(),tasks.end(),invoker
      1 tbb::parallel_for_each(tasksD.begin(),tasksD.end(),invoker
      4 tbb::task
     35 tbb::task*
      1 tbb::task*).
      1 tbb::task*>
      1 tbb::task::allocate_additional_child_of(*pWaitTask))
      9 tbb::task::allocate_root())
      1 tbb::task::destroy(*eventLoopWaitTask);
      6 tbb::task::destroy(*iTask);}
      1 tbb::task::destroy(*iWait);
      1 tbb::task::enqueue(
      1 tbb::task::spawn(*iTask);
      1 tbb::task::spawn(*nextTask);
      3 tbb::task::spawn(*t);
      1 tbb::task::spawn(calc);
      4 tbb::task>
      5 tbb::task_scheduler_init
      2 tbb::task_scheduler_init::default_num_threads();
      1 tbb::task_scheduler_init>
      1 tbb::task_scheduler_init>&
      1 tbb::task_scheduler_init>(1);
      1 tbb::task_scheduler_init>(static_cast
      3 tbb::tbb_hash
      1 tbb::tbb_hasher(iKey.get());
      1 tbb::thread::id()
      5 tbb::tick_count
      1 tbb::tick_count"));
      4 tbb::tick_count::interval_t
      1 tbb::tick_count::interval_t();
      1 tbb::tick_count::interval_t(-1.e9);
      1 tbb::tick_count::interval_t(1.e9);
      1 tbb::tick_count::interval_t>
@hkaiser
Copy link
Member

hkaiser commented Jul 5, 2016

As a first step, we could create interface-compatible classes which simply use a spinlock to ensure data consistency. That shouldn't take too much time.

@biddisco
Copy link
Contributor Author

Just FYI : In the verbs parcelport branch, I have modified the concurrent::unordered_map to make use of a new readers_writers_lock mutex and unique_lock/scoped_lock - this gives us single writer and multiple reader support for map. Once the verbs PP branch is merged, this code can be moved into the hpx/concurrent directory where some work was started (in the concurrent_data_structures branch).

@diehlpk
Copy link
Member

diehlpk commented Jan 24, 2017

@hkaiser hkaiser modified the milestones: 1.0.0, 1.1.0 Apr 23, 2017
@rishabhkumar296
Copy link

Hi,

Is this project currently working in progress under GSoC 2017 ? If anyone is not working on it, I am willing to take this up.

@hkaiser
Copy link
Member

hkaiser commented May 14, 2017

@rishabhkumar296: None of the selected GSoC projects are related to this (see: http://stellar-group.org/2017/05/gsoc-2017-participants-announced/). Please feel free to work on this. It might be a good idea if you joined our IRC channel (#ste||ar at freenode) to be able to discuss things in a more direct way.

@felicepantaleo
Copy link

Hi @rishabhkumar296 @hkaiser ,
in July at CERN we will have a summer student working for about 3 months on the implementation of a toy framework for HEP event reconstruction using HPX.
We will be definitely interested in testing your data structures and helping in further developments.

@hkaiser
Copy link
Member

hkaiser commented May 14, 2017

@felicepantaleo Ohh, that's great! Please let us know if there is anything we can do to support that.

@biddisco
Copy link
Contributor Author

biddisco commented May 15, 2017

BTW. I did not see the discussion here, but last night I created a branch and made a PR #2629 because I need to use this concurrent map in code outside of the parcelport.

@felicepantaleo
Copy link

hi @biddisco @hkaiser,
@Element-126 just started working on HPX for us.
We will let you know if we need any support!

@msimberg
Copy link
Contributor

@felicepantaleo @Element-126 @rishabhkumar296 Just checking to see if there has been any progress on this? We're planning a release in the next few months and wondering if anything could make it into that release?

@msimberg msimberg removed this from the 1.1.0 milestone Dec 5, 2017
@SHANTAM29
Copy link

@msimberg Is someone still working on this project? I want to work on this project. If someone is not working on it, I would like to do it.

@hkaiser
Copy link
Member

hkaiser commented Dec 5, 2017

@SHANTAM29 feel free. I don't think anybody is actively working on this.

@biddisco
Copy link
Contributor Author

biddisco commented Dec 6, 2017

@SHANTAM29 if you do begin work on it, please get in touch with me via email or other means for a chat. I have been poking around with this recently.

@mikaelmello
Copy link

What is the status of hpx::concurrent::vector on the concurrent_data_structures branch?

@hkaiser
Copy link
Member

hkaiser commented Mar 7, 2018

@mikaelmello both seem to be abandoned. Feel free to pick things up where others have left things.

@shantanudwvd
Copy link

Hi,
i would like to work on this project.

@Guyanqi
Copy link

Guyanqi commented Mar 25, 2018

Hey, this project looks great, I'd like to commit to it!

@hkaiser
Copy link
Member

hkaiser commented Mar 25, 2018

@shantanudwvd, @Guyanqi: Please get in contact on IRC or the hpx-users mailing list (see https://github.com/STEllAR-GROUP/hpx/blob/master/.github/SUPPORT.md).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants