| 1 |
cnh |
1.3 |
C $Header: /u/gcmpack/models/MITgcmUV/eesupp/inc/MAIN_PDIRECTIVES2.h,v 1.2 1998/04/23 20:59:35 cnh Exp $ |
| 2 |
cnh |
1.1 |
C |
| 3 |
|
|
C /==========================================================\ |
| 4 |
|
|
C | MAIN_PDIRECTIVES2.h | |
| 5 |
|
|
C |==========================================================| |
| 6 |
|
|
C | Parallel directives to generate multithreaded code for | |
| 7 |
|
|
C | various different compilers. The master preprocessor | |
| 8 |
|
|
C | file CPP_OPTIONS is used to select which of these options| |
| 9 |
|
|
C | is included in the code. | |
| 10 |
|
|
C | Note: Only some of the directives require end blocks. | |
| 11 |
cnh |
1.3 |
C | For directives which do not require end blocks there| |
| 12 |
|
|
C | is no entry here. | |
| 13 |
cnh |
1.1 |
C \==========================================================/ |
| 14 |
|
|
|
| 15 |
|
|
#if defined USE_KAP_THREADING |
| 16 |
|
|
C-- |
| 17 |
|
|
C-- Parallel directives for Kuck and Associates compiler. |
| 18 |
|
|
C-- This is used to generate multi-threaded code on Digital |
| 19 |
|
|
C-- systems. It can also be used under NT. |
| 20 |
|
|
C-- Note: The KAP parallel proceesing tool has several bugs |
| 21 |
|
|
C-- which means that if there are more threads (set via |
| 22 |
|
|
C-- setenv PARALLEL) than iterations in the parallel |
| 23 |
|
|
C-- loop the extra threads start on the section |
| 24 |
|
|
C-- after the loop! |
| 25 |
|
|
C-- To work around this we could place an extra dummy |
| 26 |
|
|
C-- parallel section here. KAP places a barrier at the |
| 27 |
|
|
C-- start of each parallel region which ensures that |
| 28 |
|
|
C-- the extra threads wait (note this wait is in a busy loop). |
| 29 |
|
|
C-- Without this feature the extra thread(s) will run on and may |
| 30 |
|
|
C-- halt the program by calling STOP! Unfortunately that seems |
| 31 |
|
|
C-- to cause a deadlock in a KAP library routine! Instead the |
| 32 |
|
|
C-- current solution is to check for a thread reaching the |
| 33 |
|
|
C-- shutdown part of main.F before other threads have |
| 34 |
|
|
C-- completed computation ( see eedie.F ). |
| 35 |
|
|
C |
| 36 |
|
|
C*KAP* END PARALLEL REGION |
| 37 |
|
|
C C*KAP* PARALLEL REGION |
| 38 |
|
|
C CALL FOOL_THE_COMPILER |
| 39 |
|
|
C C*KAP* END PARALLEL REGION |
| 40 |
|
|
C |
| 41 |
|
|
#endif |
| 42 |
|
|
C |
| 43 |
|
|
|