| 1 |
|
C $Header$ |
| 2 |
|
C $Name$ |
| 3 |
|
C |
| 4 |
|
C /==========================================================\ |
| 5 |
|
C | GLOBAL_MAX.h | |
| 6 |
|
C | o Globals used by Fortran global max routine. | |
| 7 |
|
C |==========================================================| |
| 8 |
|
C | The global max shared memory scheme uses global heap data| |
| 9 |
|
C | structures (.i.e COMMON blocks ). Each thread writes to | |
| 10 |
|
C | an its own element of the shared memory array and then | |
| 11 |
|
C | one thread reads all the entries and maxs them. The max | |
| 12 |
|
C | result is then read by all threads. | |
| 13 |
|
C | Remember - you are working with regions of memory that | |
| 14 |
|
C | are being updated concurrently by different threads. | |
| 15 |
|
C | What happens, when it happens and who gets to see what | |
| 16 |
|
C | happens at what stage depends on the computer systems | |
| 17 |
|
C | memory model. Every computer has a different memory model| |
| 18 |
|
C | and they are never simple. In all current platforms it is| |
| 19 |
|
C | possible for one thread to see events happening in a | |
| 20 |
|
C | different order from the order they are written in the | |
| 21 |
|
C | code. | |
| 22 |
|
C | Unless you understand this it is not a good idea to | |
| 23 |
|
C | make modifications te way these header files are setup or| |
| 24 |
|
C | the way the global sum routines work. | |
| 25 |
|
C \==========================================================/ |
| 26 |
|
COMMON / GMAX_COMMON_R8 / phiGMRL |
| 27 |
|
Real*8 phiGMRL(lShare8, MAX_NO_THREADS ) |
| 28 |
|
|
| 29 |
|
COMMON / GMAX_COMMON_R4 / phiGMRS |
| 30 |
|
Real*4 phiGMRS(lShare4, MAX_NO_THREADS ) |
| 31 |
|
|
| 32 |
|
COMMON / GMAX_COMMON_I / phiGMI |
| 33 |
|
INTEGER phiGMI (lShare4, MAX_NO_THREADS ) |