Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.

Parallel For-Each

james_b1
Beginner
242 Views
Hiya,

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?
0 Kudos
2 Replies
RafSchietekat
Valued Contributor III
242 Views
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).
0 Kudos
james_b1
Beginner
242 Views
Aha.. Thanks for your quick reply - I misunderstood.
0 Kudos
Reply