Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:36:06 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
4c563c2ee9 Chri*0001 CBOP
                0002 C     !ROUTINE: MAIN_PDIRECTIVES2.h
                0003 C     !INTERFACE:
                0004 C     include "MAIN_PDIRECTIVES2.h"
                0005 C     !DESCRIPTION:
                0006 C     *==========================================================*
2b4c849245 Ed H*0007 C     | MAIN\_PDIRECTIVES2.h                                       
4c563c2ee9 Chri*0008 C     *==========================================================*
                0009 C     | Parallel directives to generate multithreaded code for    
                0010 C     | various different compilers. The master preprocessor      
2b4c849245 Ed H*0011 C     | file CPP\_OPTIONS is used to select which of these 
                0012 C     | options is included in the code.           
4c563c2ee9 Chri*0013 C     | Note: Only some of the directives require end blocks.     
                0014 C     |      For directives which do not require end blocks there 
                0015 C     |      is no entry here.                                    
                0016 C     *==========================================================*
                0017 CEOP
924557e60a Chri*0018 
                0019 #if defined USE_KAP_THREADING
                0020 C--
                0021 C--  Parallel directives for Kuck and Associates compiler.
                0022 C--  This is used to generate multi-threaded code on Digital
                0023 C--  systems. It can also be used under NT. 
                0024 C--  Note: The KAP parallel proceesing tool has several bugs
                0025 C--        which means that if there are more threads (set via
                0026 C--        setenv PARALLEL) than iterations in the parallel
                0027 C--        loop the extra threads start on the section 
                0028 C--        after the loop!
                0029 C--        To work around this we could place an extra dummy
                0030 C--        parallel section here. KAP places a barrier at the
                0031 C--        start of each parallel region which ensures that 
                0032 C--        the extra threads wait (note this wait is in a busy loop).
                0033 C--        Without this feature the extra thread(s) will run on and may
                0034 C--        halt the program by calling STOP! Unfortunately that seems
                0035 C--        to cause a deadlock in a KAP library routine! Instead the
                0036 C--        current solution is to check for a thread reaching the
                0037 C--        shutdown part of main.F before other threads have
                0038 C--        completed computation ( see eedie.F ).
                0039 C
                0040 C*KAP*  END PARALLEL REGION
                0041 C   C*KAP*  PARALLEL REGION
                0042 C           CALL FOOL_THE_COMPILER
                0043 C   C*KAP*  END PARALLEL REGION
                0044 C
                0045 #endif
                0046 C
                0047 
a6a74ff42f Chri*0048 #ifdef USE_OMP_THREADING
                0049 C$OMP  END PARALLEL
                0050 #endif