On Mon, 11 May 2009 19:00:54 +0300 Mikolaj Golub wrote: > Hello, > > If I run the following program > > --------------- > > #include <omp.h> > > int n = 4, m = 2; > > int main () { > for (;;) { > int i; > > #pragma omp parallel num_threads(m) > { > int just_to_make_some_code_generated; > just_to_make_some_code_generated = 0; > } > #pragma omp parallel for num_threads(n) > for(i = 0; i < 1; i++) {} > > } > > return 0; > } > > --------------- > > on FreeBSD6/7 (i386 and amd64) built with gcc42 or gcc43 -fopenmp (I have not > tried other gcc versions), the memory usage is constantly growing during the > run. The memory growth is observed in case n != m. If n == m, everything works > ok.
The problem is observed also for constructions like this one: #pragma omp parallel for num_threads(m) ... #pragma omp parallel for num_threads(n) ... Adding some sleep() code I see in top that during the program run m or n threads are run in turn. So it looks like memory leaks when thread is removed. It might be FreeBSD problem, not gcc. -- Mikolaj Golub