Hi,
note: all I know about OpenMP is what I just found with a quick search ... so take anything I say with caution 😉
In general, please supply as much information as possible when writing things like "better performance", eg:
- what are the actual numbers? (or even more generally, what is considered "better performance"?)
- how was this measured?
- is this reproducable?
- what else did you try do understand what's going on, and what were the results?
looking at your example, and comparing to what I found, I believe you may have missed segmenting 'c' into per-thread sections, and you may have heavy contention when writing to this array.
HTH