KavrakiLab / KavrakiLab/robowflex

[FEATURE] Add per-thread queuing for benchmarking

Open
#302 1 comment 0 reactions 1 assignee Claimed by @ell0ry View on GitHub
enhancement
Dominant language
C++
Stars
137
Forks
26
PR merge metrics
No merged PRs in 30d

Description

Some planning setups require that a planner be made for each thread and maintained. For example, with my current DART + Robowflex setup, I need to interact with the underlying DART scene for different queries.

This limits my ability to parallelize benchmarking as I need to enforce that each worker thread only interacts with its respective planner. I've got a workaround for the time being, but it would be nice to have the ability to queue runs in the `Experiment` API and assign them to a particular worker thread.

## Detailed Description
Allow requests to be queued in an [Experiment](https://kavrakilab.github.io/robowflex/classrobowflex_1_1Experiment.html) and assigned to a particular thread.

## Possible Implementation
The current implementation accents a number of worker threads in the `Experiment::benchmark (std::size_t n_threads=1)` method. Instead, this param would need to be accepted in the constructor, and the various `Experiment::addQuery` methods be changed to accept a thread index to queue the job to.

Under the hood, the queued jobs will need to be indexed by their assigned thread. Currently, the `Experiment::benchmark` method has each thread grab a `mutex` lock, pop a job to run from the queue, and unlock. If the jobs are already indexed by their worker thread, each thread can pop a job off its queue without worrying about synchronization.

This would leave the burden of dividing the jobs up by thread to the user. However, I think this might be useful in fringe situations like what I'm dealing with.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.