Ask Your Question
1

parallel_for_ : nstripes parameter

asked 2017-11-10 08:23:25 -0600

aniskraini@yahoo.fr gravatar image

updated 2017-11-10 10:14:44 -0600

Hi what means nstripes in parallel_for_

edit retag flag offensive close merge delete

Comments

documentation needs a contributor for more explanation.

sturkmen gravatar imagesturkmen ( 2017-11-10 10:12:55 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
3

answered 2017-11-10 09:49:53 -0600

matman gravatar image

updated 2017-11-10 09:51:18 -0600

It's the number of stripes you parallel loop is splitted. It is not the number of threads. Here is the implementation for OpenMP for example (Stripe range is calculated here). There are different cases nstripes can be set:

  1. nstripes == cv::getNumThreads() every thread is assigned to one stripe. This can be useful if there is some overhead in thread preparation
  2. nstripes < cv::getNumThreads() just nstripes threads can be used because the loop isn't splitted in enough stripes to use all threads. This should be the same as reducing number of threads
  3. nstripes > cv::getNumThreads() Some or all threads are getting more than one stripe to calculate. This can be useful if there is no or not much overhead in thread preparation and calculation times of different stripes are inhomogeneous.
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-11-10 08:23:25 -0600

Seen: 1,391 times

Last updated: Nov 10 '17