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

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

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


Revision 1.3 - (show annotations) (download)
Sun Feb 4 14:38:41 2001 UTC (23 years ago) by cnh
Branch: MAIN
CVS Tags: checkpoint40pre3, checkpoint40pre1, checkpoint40pre7, checkpoint40pre6, checkpoint40pre9, checkpoint40pre8, checkpoint38, checkpoint40pre2, checkpoint40pre4, pre38tag1, c37_adj, pre38-close, checkpoint39, checkpoint37, checkpoint36, checkpoint35, checkpoint40pre5, checkpoint40
Branch point for: pre38
Changes since 1.2: +2 -1 lines
File MIME type: text/plain
Made sure each .F and .h file had
the CVS keywords Header and Name at its start.
Most had header but very few currently have Name, so
lots of changes!

1 C $Header: /u/gcmpack/models/MITgcmUV/eesupp/inc/BARRIER.h,v 1.2 1998/04/23 20:59:34 cnh Exp $
2 C $Name: $
3 C
4 C /==========================================================\
5 C | FBAR.h |
6 C | o Globals used by Fortran barrier routine. |
7 C |==========================================================|
8 C | These variables support a simple Fortran shared memory |
9 C | barrier routine. They do busy waiting, that is the |
10 C | thread that is waiting sits in a tight loop reading |
11 C | some memory location and waiting for all other threads. |
12 C | On some systems this is sometimes a good method to use. |
13 C | On the T3E memory is not shared so the routine should |
14 C | use the T3E "eureka" barriers. On CRAY and NEC there are |
15 C | hardware barriers that are accessed through a compiler |
16 C | directives. Finally proper multi-threading compilers |
17 C | support barrier compile directives - sometimes these |
18 C | are good, sometimes they are lousy. |
19 C | The barrier mechanism is used as follows |
20 C | 1. In the single-threaded part of the code |
21 C | CALL FBAR_INIT |
22 C | on CRAY, NEC this routine does nothing |
23 C | on T3E there is no single-threaded code |
24 C | but there may be barrier initialisation - |
25 C | need to check. |
26 C | 2. When we need to synchronize everybody just |
27 C | CALL FBAR( myThid ) |
28 C | where myThid is myThreadId |
29 C | on CRAY, NEC FBAR will just do C$DIR BARRIER |
30 C | or the like. |
31 C | on T3E FBAR does CALL BARRIER(...) or something |
32 C | need to check this. |
33 C \==========================================================/
34 COMMON / BARRIER_COMMON / key1, key2, key3,
35 & door1, door2, door3
36 INTEGER key1(lShare4,MAX_NO_THREADS)
37 INTEGER key2(lShare4,MAX_NO_THREADS)
38 INTEGER key3(lShare4,MAX_NO_THREADS)
39 INTEGER door1
40 INTEGER door2
41 INTEGER door3
42 INTEGER VALID
43 PARAMETER ( VALID = 1 )
44 INTEGER INVALID
45 PARAMETER ( INVALID = 0 )
46 INTEGER OPEN
47 PARAMETER ( OPEN = 1 )
48 INTEGER SHUT
49 PARAMETER ( SHUT = 0 )

  ViewVC Help
Powered by ViewVC 1.1.22