N
N
NeoZeed2014-11-10 12:43:02
Parallel Computing
NeoZeed, 2014-11-10 12:43:02

Why doesn't the exe with openMP exit after executing the code?

I am writing code in VS2010 using openMP, the code uses only the directives #pragma omp parallel for and #pragma omp parallel sections
The code produces the correct results, on two cores it gives a speedup of 2 times (sometimes more, why?). But at the end of the program, the window itself does not close, before return 0; costs cout<<"all"; it is printed. Maybe the threads are not shutting down, how can I fix this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
CPPJunior, 2014-11-14
@CPPJunior

All threads print "all" and hang before return?
Look at the CPU usage. Are the threads running (loading the CPU) or just waiting?
Show code =)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question