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

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

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


Revision 1.1 - (show annotations) (download)
Tue Sep 29 18:54:25 1998 UTC (25 years, 7 months ago) by cnh
Branch: MAIN
CVS Tags: checkpoint15, checkpoint17, checkpoint19, checkpoint18, checkpoint28, checkpoint29, checkpoint20, checkpoint21, checkpoint22, checkpoint23, checkpoint24, checkpoint25, checkpoint27, branch-atmos-merge-freeze, branch-atmos-merge-start, checkpoint26, checkpoint16, branch-atmos-merge-shapiro, checkpoint33, checkpoint32, checkpoint31, checkpoint30, checkpoint34, branch-atmos-merge-zonalfilt, 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: branch-atmos-merge
File MIME type: text/plain
CHanges to exchange routines for general tile <-> tile connectivity, DMA and shared
memory communication hooks, variable width overlaps and TAMC reverse mode flag.

1 C $Header: /u/gcmpack/models/MITgcmUV/eesupp/inc/BARRIER.h,v 1.2 1998/04/23 20:59:34 cnh Exp $
2 C
3 C /==========================================================\
4 C | BAR2.h |
5 C | o Globals used by BAR2 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 BAR2_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 BAR2( myThid ) |
27 C | where myThid is myThreadId |
28 C | on CRAY, NEC FBAR will just do C$DIR BARRIER |
29 C | or CALL BARRIER or the like. |
30 C | on T3E FBAR does CALL BARRIER(...) or something |
31 C | need to check this. |
32 C \==========================================================/
33 COMMON /BAR2_BUFFER_I/
34 & BAR2_level,
35 & BAR2_barrierCount,
36 & BAR2_spinsCount, BAR2_spinsMax, BAR2_spinsMin
37 INTEGER BAR2_level(cacheLineSize/4,MAX_NO_THREADS)
38 INTEGER BAR2_barrierCount(cacheLineSize/4,MAX_NO_THREADS)
39 INTEGER BAR2_spinsCount(cacheLineSize/4,MAX_NO_THREADS)
40 INTEGER BAR2_spinsMax(cacheLineSize/4,MAX_NO_THREADS)
41 INTEGER BAR2_spinsMin(cacheLineSize/4,MAX_NO_THREADS)
42
43 COMMON /BAR2_L/ bar2CollectStatistics
44 LOGICAL bar2CollectStatistics

  ViewVC Help
Powered by ViewVC 1.1.22