/[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.2 - (show annotations) (download)
Thu Apr 23 20:59:34 1998 UTC (26 years ago) by cnh
Branch: MAIN
CVS Tags: checkpoint11, checkpoint10, checkpoint13, checkpoint15, checkpoint14, checkpoint17, checkpoint19, checkpoint18, redigm, checkpoint28, checkpoint29, checkpoint20, checkpoint21, checkpoint22, checkpoint23, checkpoint24, checkpoint25, checkpoint27, branch-atmos-merge-freeze, branch-atmos-merge-start, checkpoint5, checkpoint4, checkpoint7, checkpoint6, checkpoint1, checkpoint3, checkpoint2, checkpoint9, checkpoint8, kloop1, kloop2, checkpoint26, checkpoint12, checkpoint16, branch-atmos-merge-shapiro, checkpoint33, checkpoint32, checkpoint31, checkpoint30, checkpoint34, branch-atmos-merge-zonalfilt, branch-point-rdot, branch-atmos-merge-phase5, branch-atmos-merge-phase4, branch-atmos-merge-phase7, branch-atmos-merge-phase6, branch-atmos-merge-phase1, branch-atmos-merge-phase3, branch-atmos-merge-phase2
Branch point for: checkpoint7-4degree-ref, branch-rdot, branch-atmos-merge
Changes since 1.1: +1 -1 lines
File MIME type: text/plain
Further  changes for converting $Id to $Header

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

  ViewVC Help
Powered by ViewVC 1.1.22