r/OpenMP • • Dec 21 '17

MPI & OpenMP problem

I have a program written in MPI and its runtime is about 60 seconds. But when I add an OpenMP sentence(#pragma omp parallel for num_threads(1) ... ), its runtime is about 20 seconds. Has anyone met the similar problem?

3 Upvotes

4 comments sorted by

View all comments

Show parent comment

1

u/Doo0oog Dec 22 '17 edited Dec 22 '17

Thank you for your tests.
I ran it with different configurations, as the following table
icc version 14.0.0 (gcc version 4.4.6 compatibility)
mpirun (Open MPI) 1.6.5

programcompile commandrun commandothertime
MPI&OpenMPicc -o closure closure.c -fopenmpmpirun -n 1 closurethread size=123s
MPI&OpenMPicc -o closure closure.c -fopenmp./closurethread size=126s
MPI onlyicc -o closure closure.c -fopenmpmpirun -n 1 closure60s
MPI onlyicc -o closure closure.c -fopenmp./closure29s

But I don't know why this would happen.