/[MITgcm]/MITgcm/eesupp/inc/BAR2.h
ViewVC logotype

Diff of /MITgcm/eesupp/inc/BAR2.h

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.2 by cnh, Sun Feb 4 14:38:41 2001 UTC revision 1.3 by cnh, Fri Sep 21 03:54:35 2001 UTC
# Line 1  Line 1 
1  C $Header$  C $Header$
2  C $Name$  C $Name$
3  C  C
4  C     /==========================================================\  CBOP
5  C     | BAR2.h                                                   |  C     !ROUTINE: BAR2.h
6  C     | o Globals used by BAR2 Fortran barrier routine.          |  C     !INTERFACE:
7  C     |==========================================================|  C     include "BAR2.h"
8  C     | These variables support a simple Fortran shared memory   |  C     !DESCRIPTION:
9  C     | barrier routine. They do busy waiting, that is the       |  C     *==========================================================*
10  C     | thread that is waiting sits in a tight loop reading      |  C     | BAR2.h                                                    
11  C     | some memory location and waiting for all other threads.  |  C     | o Globals used by BAR2 Fortran barrier routine.          
12  C     | On some systems this is sometimes a good method to use.  |  C     |==========================================================*
13  C     | On the T3E memory is not shared so the routine should    |  C     | These variables support a simple Fortran shared memory    
14  C     | use the T3E "eureka" barriers. On CRAY and NEC there are |  C     | barrier routine. They do busy waiting, that is the        
15  C     | hardware barriers that are accessed through a compiler   |  C     | thread that is waiting sits in a tight loop reading      
16  C     | directives. Finally proper multi-threading compilers     |  C     | some memory location and waiting for all other threads.  
17  C     | support barrier compile directives - sometimes these     |  C     | On some systems this is sometimes a good method to use.  
18  C     | are good, sometimes they are lousy.                      |  C     | On the T3E memory is not shared so the routine should    
19  C     |  The barrier mechanism is used as follows                |  C     | use the T3E "eureka" barriers. On CRAY and NEC there are  
20  C     |  1. In the single-threaded part of the code              |  C     | hardware barriers that are accessed through a compiler    
21  C     |     CALL BAR2_INIT                                       |  C     | directives. Finally proper multi-threading compilers      
22  C     |     on CRAY, NEC this routine does nothing               |  C     | support barrier compile directives - sometimes these      
23  C     |     on T3E there is no single-threaded code              |  C     | are good, sometimes they are lousy.                      
24  C     |        but there may be barrier initialisation -         |  C     |  The barrier mechanism is used as follows                
25  C     |        need to check.                                    |  C     |  1. In the single-threaded part of the code              
26  C     |  2. When we need to synchronize everybody just           |  C     |     CALL BAR2_INIT                                        
27  C     |     CALL BAR2( myThid )                                  |  C     |     on CRAY, NEC this routine does nothing                
28  C     |     where myThid is myThreadId                           |  C     |     on T3E there is no single-threaded code              
29  C     |     on CRAY, NEC FBAR will just do C$DIR BARRIER         |  C     |        but there may be barrier initialisation -          
30  C     |     or CALL BARRIER or the like.                         |  C     |        need to check.                                    
31  C     |     on T3E FBAR does CALL BARRIER(...) or something      |  C     |  2. When we need to synchronize everybody just            
32  C     |     need to check this.                                  |  C     |     CALL BAR2( myThid )                                  
33  C     \==========================================================/  C     |     where myThid is myThreadId                            
34    C     |     on CRAY, NEC FBAR will just do C$DIR BARRIER          
35    C     |     or CALL BARRIER or the like.                          
36    C     |     on T3E FBAR does CALL BARRIER(...) or something      
37    C     |     need to check this.                                  
38    C     *==========================================================*
39    CEOP
40        COMMON /BAR2_BUFFER_I/        COMMON /BAR2_BUFFER_I/
41       &  BAR2_level,       &  BAR2_level,
42       &  BAR2_barrierCount,       &  BAR2_barrierCount,

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.22