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

GraspFilter::filterGraspsHelper - IK-solver fails when using too many OpenMP threads #105

Open
Levaru opened this issue Apr 27, 2022 · 1 comment

Comments

@Levaru
Copy link

Levaru commented Apr 27, 2022

I have a very strange problem:
Grasp poses are filtered in GraspFilter::filterGraspsHelper with the help of a multi-threaded OpenMP for-loop (line in question). Part of this filtering function is the IK-solver (line in question).

The thread count is set with omp_set_num_threads(num_threads); and num_threads is determined by std::size_t num_threads = omp_get_max_threads(); (line in question).

I have a Threadripper with 32 cores and omp_get_max_threads(); returns 64 threads. When filtering grasp poses with that thread count, 98-100% of them will fail due to (probably) to IK-timeout even though most of them are completely valid. But when I set the thread count to 2-5 all of the previously failed grasps will be now valid this time around. The higher I set the thread count, the more grasps will fail. Changing the IK-solver timeout from 0.005 to 5 seconds does nothing.

What could be reason for this behavior? Do the threads starve each other for CPU resources when too many are present? Is there something weird going on if too many IK-solvers are working? This is a huge roadblock for me and I don't even know how to properly debug it. Does anyone have a deep understanding of OpenMP and the IK-solvers and knows what the issue here is?

@Au3f
Copy link

Au3f commented Apr 29, 2022

I have an maybe related issue:
When sampling larger areas with the moveit graps pipeline, the number of grasp-candidates varies a lot when multi-threading is enabled. Without multi-threading, results are consistent. I was not able to do further investigations since the workaround was obvious.

This might be relevant: the problem is occurring on a i7-11800H running Ubuntu 20.04.4 LTS

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

No branches or pull requests

2 participants