I have a code that I set up as follows
SUBROUTINE OPI
!$OMP PARALLEL SECTIONS NUM_THREADS(2)
CALL OPER
!$OMP SECTION
CALL SUB
!$OMP END PARALLEL SECTIONS
RETURN
This is the basic structure. I use a module with volatile variables to communicate between the two threads. SUB has a DO WHILE loop that goes until OPER tells it to quit. To test it I don't have SUB doing anything other than looping. So none of the flags change except the one to tell it to quit. All of the real computations are done in OPER. This takes about 100 seconds to run. If I run this without the parallel sections, it takes 81 seconds. Where do I look for all this overhead. Once I actually have SUB doing some real work I expect it to happen in parallel to OPER, but the overhead is wiping out any improvements I can expect.
Thanks!
Dave




