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

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

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

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

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

  ViewVC Help
Powered by ViewVC 1.1.22