K
K
kodwi2014-09-01 19:15:25
C++ / C#
kodwi, 2014-09-01 19:15:25

How to correctly parallelize C++ code using OpenMP?

Implemented one numerical method. The directives seem to be correctly placed, everything should work. But the parallel is very strange. For example - with 1 thread, the operating time is ~ 4.5 sec, with 2 threads ~ 2.3 sec, with 4 threads it can give out 1.6 sec, or maybe 2.7 sec, with 8 threads in general 2.2+ sec and does not work faster.
Who has time and who has experience with OpenMP, please help, preferably in Skype tmp_skype_929292 .

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2014-09-01
Protko @Fesor

indicate how many cores the processor has, in general, what kind of it is.
In general, there are a lot of options. One of the most possible options, a lot of cache misses with 4 threads.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question