--- MITgcm/eesupp/inc/BAR2.h 1998/09/29 18:54:25 1.1 +++ MITgcm/eesupp/inc/BAR2.h 2001/09/21 03:54:35 1.3 @@ -1,35 +1,42 @@ -C $Header: /home/ubuntu/mnt/e9_copy/MITgcm/eesupp/inc/BAR2.h,v 1.1 1998/09/29 18:54:25 cnh Exp $ +C $Header: /home/ubuntu/mnt/e9_copy/MITgcm/eesupp/inc/BAR2.h,v 1.3 2001/09/21 03:54:35 cnh Exp $ +C $Name: $ C -C /==========================================================\ -C | BAR2.h | -C | o Globals used by BAR2 Fortran barrier routine. | -C |==========================================================| -C | These variables support a simple Fortran shared memory | -C | barrier routine. They do busy waiting, that is the | -C | thread that is waiting sits in a tight loop reading | -C | some memory location and waiting for all other threads. | -C | On some systems this is sometimes a good method to use. | -C | On the T3E memory is not shared so the routine should | -C | use the T3E "eureka" barriers. On CRAY and NEC there are | -C | hardware barriers that are accessed through a compiler | -C | directives. Finally proper multi-threading compilers | -C | support barrier compile directives - sometimes these | -C | are good, sometimes they are lousy. | -C | The barrier mechanism is used as follows | -C | 1. In the single-threaded part of the code | -C | CALL BAR2_INIT | -C | on CRAY, NEC this routine does nothing | -C | on T3E there is no single-threaded code | -C | but there may be barrier initialisation - | -C | need to check. | -C | 2. When we need to synchronize everybody just | -C | CALL BAR2( myThid ) | -C | where myThid is myThreadId | -C | on CRAY, NEC FBAR will just do C$DIR BARRIER | -C | or CALL BARRIER or the like. | -C | on T3E FBAR does CALL BARRIER(...) or something | -C | need to check this. | -C \==========================================================/ +CBOP +C !ROUTINE: BAR2.h +C !INTERFACE: +C include "BAR2.h" +C !DESCRIPTION: +C *==========================================================* +C | BAR2.h +C | o Globals used by BAR2 Fortran barrier routine. +C |==========================================================* +C | These variables support a simple Fortran shared memory +C | barrier routine. They do busy waiting, that is the +C | thread that is waiting sits in a tight loop reading +C | some memory location and waiting for all other threads. +C | On some systems this is sometimes a good method to use. +C | On the T3E memory is not shared so the routine should +C | use the T3E "eureka" barriers. On CRAY and NEC there are +C | hardware barriers that are accessed through a compiler +C | directives. Finally proper multi-threading compilers +C | support barrier compile directives - sometimes these +C | are good, sometimes they are lousy. +C | The barrier mechanism is used as follows +C | 1. In the single-threaded part of the code +C | CALL BAR2_INIT +C | on CRAY, NEC this routine does nothing +C | on T3E there is no single-threaded code +C | but there may be barrier initialisation - +C | need to check. +C | 2. When we need to synchronize everybody just +C | CALL BAR2( myThid ) +C | where myThid is myThreadId +C | on CRAY, NEC FBAR will just do C$DIR BARRIER +C | or CALL BARRIER or the like. +C | on T3E FBAR does CALL BARRIER(...) or something +C | need to check this. +C *==========================================================* +CEOP COMMON /BAR2_BUFFER_I/ & BAR2_level, & BAR2_barrierCount,