1 |
|
C $Header$ |
2 |
|
C $Name$ |
3 |
|
C |
4 |
|
C /==========================================================\ |
5 |
|
C | GLOBA:_SUM.h | |
6 |
|
C | o Globals used by Fortran global sum routine. | |
7 |
|
C |==========================================================| |
8 |
|
C | The global sum 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 sums them. The sum | |
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 / GSUM_COMMON_R8 / phiGSRL |
27 |
|
Real*8 phiGSRL(lShare8, MAX_NO_THREADS ) |
28 |
|
|
29 |
|
COMMON / GSUM_COMMON_R4 / phiGSRS |
30 |
|
Real*4 phiGSRS(lShare4, MAX_NO_THREADS ) |
31 |
|
|
32 |
|
COMMON / GSUM_COMMON_I / phiGSI |
33 |
|
INTEGER phiGSI (lShare4, MAX_NO_THREADS ) |