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