/[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.2 - (show annotations) (download)
Sun Feb 4 14:38:41 2001 UTC (23 years, 1 month 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.1: +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/BAR2.h,v 1.1 1998/09/29 18:54:25 cnh Exp $
2 C $Name: $
3 C
4 C /==========================================================\
5 C | BAR2.h |
6 C | o Globals used by BAR2 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 BAR2_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 BAR2( myThid ) |
28 C | where myThid is myThreadId |
29 C | on CRAY, NEC FBAR will just do C$DIR BARRIER |
30 C | or CALL BARRIER or the like. |
31 C | on T3E FBAR does CALL BARRIER(...) or something |
32 C | need to check this. |
33 C \==========================================================/
34 COMMON /BAR2_BUFFER_I/
35 & BAR2_level,
36 & BAR2_barrierCount,
37 & BAR2_spinsCount, BAR2_spinsMax, BAR2_spinsMin
38 INTEGER BAR2_level(cacheLineSize/4,MAX_NO_THREADS)
39 INTEGER BAR2_barrierCount(cacheLineSize/4,MAX_NO_THREADS)
40 INTEGER BAR2_spinsCount(cacheLineSize/4,MAX_NO_THREADS)
41 INTEGER BAR2_spinsMax(cacheLineSize/4,MAX_NO_THREADS)
42 INTEGER BAR2_spinsMin(cacheLineSize/4,MAX_NO_THREADS)
43
44 COMMON /BAR2_L/ bar2CollectStatistics
45 LOGICAL bar2CollectStatistics

  ViewVC Help
Powered by ViewVC 1.1.22