https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78289
Bug ID: 78289
Summary: OpenMP produces high CPU load if used in more than one
process
Product: gcc
Version: 6.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libgomp
Assignee: unassigned at gcc dot gnu.org
Reporter: [email protected]
CC: jakub at gcc dot gnu.org
Target Milestone: ---
Created attachment 40014
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40014&action=edit
gcc -O2 omp.c -lpthread -fopenmp -o omp
We discovered that our application performs very bad on Linux when two or more
processes are started which use OpenMP.
I've removed line by line from the source to find the bottleneck until there
were no more lines to remove.
I attached a simple program that exposes the problem.
In the first step eight Threads are created which run a empty openmp for loop
10000 times. After that eigth Processes are created using fork() each running
the same loop 10000.
The Thread based version takes about 1 second and the fork() version 3 minutes
30 seconds on a i7 4790
Problem could be reproduced on ubuntu 12.04, 16.04
compile attachment:
gcc -O2 omp.c -lpthread -fopenmp -o omp