Search found 19 matches

by johncampbell
Wed Apr 22, 2020 9:07 pm
Forum: Using OpenMP
Topic: Managing private arrays to either stack or heap
Replies: 5
Views: 19896

Re: Managing private arrays to either stack or heap

I have further investigated where do PRIVATE copies of OMP arrays go ? When using gFortran in a 64-bit windows environment they can go to two possible locations. 1) it can be the local thread stack or 2) it can be a single shared heap. I have written a program to test a number of different array typ...
by johncampbell
Thu Feb 20, 2020 6:52 pm
Forum: OpenMP 5.0 Examples Discussion
Topic: Memory Allocators
Replies: 0
Views: 32711

Memory Allocators

I am looking for a way to manage large arrays and especially PRIVATE copies of large arrays in a Fortran OpenMP program. I am not sure if the Memory Allocators provide a convenient way of achieving this result. My memory use strategy is based on: 1) "small" arrays and variables should go on the stac...
by johncampbell
Wed Jan 22, 2020 11:04 pm
Forum: Using OpenMP
Topic: Managing private arrays to either stack or heap
Replies: 5
Views: 19896

Re: Managing private arrays to either stack or heap

Mark, Thanks for your reply. The three main performance issues I am attempting to address are: 1) Use of the thread stack to improve cache performance. 2) Use of the heap to avoid stack overflow when scaling up problem size. 3) Manage memory allocation to avoid cache/memory coherence delays. Althoug...
by johncampbell
Fri Jan 17, 2020 10:15 pm
Forum: Using OpenMP
Topic: Managing private arrays to either stack or heap
Replies: 5
Views: 19896

Managing private arrays to either stack or heap

I have now been using OpenMP via gFortran for 5 years and am struggling to find suitable documentation relating to managing PRIVATE arrays and avoiding stack overflows. I am trying to understand if there are any guidelines in the OpenMP specification for where PRIVATE copies of arrays are allocated ...
by johncampbell
Fri Jan 17, 2020 9:19 pm
Forum: Using OpenMP
Topic: Help with !$OMP BARRIER
Replies: 5
Views: 18494

Re: Help with !$OMP BARRIER

Hi Mark, Thanks for your advice on reducing the number of threads to the number of cores, however the optimised solution appears to be more complex. I thought I would summarise my results, as this may assist others. The basic problem I have is that I am now running 10 calculation threads in parallel...
by johncampbell
Sat Nov 02, 2019 11:09 pm
Forum: Using OpenMP
Topic: Help with !$OMP BARRIER
Replies: 5
Views: 18494

Re: Help with !$OMP BARRIER

Thanks Mark, I have overcome the problem by setting the number of runs as a multiple of the number of threads. This requires adjusting both the loop iterations and the active threads. However, (typically in my case) if loops <= max_threads then the fix has minimal effect, although num_threads must b...
by johncampbell
Tue Oct 15, 2019 5:24 pm
Forum: Using OpenMP
Topic: OMP program runs with 1 thread but fails on 2 threads
Replies: 6
Views: 4693

Re: OMP program runs with 1 thread but fails on 2 threads

Your choice of !$OMP for simple loops may not be effective as the computation involved may not be sufficient to justify the !$OMP overhead. To overcome the race condition, you would be better off merging the two lines, giving one thread to each ap(i): ap(i) = ap(i) - ph(i-1,2)*p(i-1) - ph(i,2)*p(i+1...
by johncampbell
Tue Oct 15, 2019 2:32 am
Forum: Using OpenMP
Topic: Help with !$OMP BARRIER
Replies: 5
Views: 18494

Re: Help with !$OMP BARRIER

The following example appears to demonstrate my problem on my 4-thread i5-2300, that works for loops=8 but fails/hangs for loops=7. I was hoping that BARRIER would identify the active threads and respond when all active threads have reached the barrier. ie call set_num_threads (4) ; do loop=1,7 ! sh...
by johncampbell
Mon Oct 14, 2019 6:36 pm
Forum: Using OpenMP
Topic: Help with !$OMP BARRIER
Replies: 5
Views: 18494

Help with !$OMP BARRIER

I have tried to use BARRIER to synchronise multiple threads that are doing a long computation, utilising the same large (16GByte) matrix. The problem I am having is related to "Each barrier must be encountered by all threads in a team" (Using OpenMP by Chapman et al, page 84) To explain: I am using ...
by johncampbell
Fri Nov 14, 2014 3:27 am
Forum: Using OpenMP
Topic: Applying !$OMP to direct linear solvers
Replies: 8
Views: 13021

Re: Applying !$OMP to direct linear solvers

I thought I'd update this post. I have succeeded in applying Openmp to a skyline solver and improved the performance. The path I took was: I first tried to improve cache usage by applying a virtual blocking system to an out-of-core skyline solver approach. By choosing the blocks as 40% of the cache ...