Parallel For-Each

Parallel For-Each


I'm looking to use parallel_for_each to process a concurrent_ordered_map of AI actors.

From the documentation, it looks like a grain-size of 10,000 is a good starting place. The simulation is unlikely to have more than 4000 actors though - so if I understand correctly, only one thread will be used with this value.

Is this right?

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

10000 is often mentioned as the minimal number of processor instructions for a task, not the minimal number of iterations. If that is not clear somewhere, you should probably report it for correction.

But normally you should be able to use auto_partitioner (the default) and not have to specify a grainsize at all (using default 1).

Aha.. Thanks for your quick reply - I misunderstood.

Leave a Comment

Please sign in to add a comment. Not a member? Join today