 Parent Directory
|
 Parent Directory
|  Revision Log
|
 Revision Log
|  Revision Graph
 Revision Graph
Fixed for single/double precision and also mixed precision (double for global sums only)
| 1 | C $Id$ | 
| 2 | SUBROUTINE GSUM_R8( ans, phi ) | 
| 3 | |
| 4 | #include "EEPARAMS.h" | 
| 5 | #ifdef ALLOW_MPI | 
| 6 | #include "mpif.h" | 
| 7 | #include "MPI_INFO.h" | 
| 8 | #endif | 
| 9 | |
| 10 | #ifdef USE_MIXED_PRECISION | 
| 11 | REAL*8 ans | 
| 12 | REAL*8 phi | 
| 13 | #else | 
| 14 | Real ans | 
| 15 | Real phi | 
| 16 | #endif | 
| 17 | |
| 18 | INTEGER RC | 
| 19 | |
| 20 | ans = phi | 
| 21 | |
| 22 | #ifdef USE_MPI_GSUM | 
| 23 | #ifdef USE_MIXED_PRECISION | 
| 24 | CALL MPI_Allreduce( phi, | 
| 25 | & ans, | 
| 26 | & 1, | 
| 27 | & MPI_REAL8, | 
| 28 | & MPI_SUM, | 
| 29 | & comm_use, | 
| 30 | & rc | 
| 31 | & ) | 
| 32 | #else | 
| 33 | CALL MPI_Allreduce( phi, | 
| 34 | & ans, | 
| 35 | & 1, | 
| 36 | & _MPI_TYPE_REAL, | 
| 37 | & MPI_SUM, | 
| 38 | & comm_use, | 
| 39 | & rc | 
| 40 | & ) | 
| 41 | #endif | 
| 42 | #endif | 
| 43 | |
| 44 | #ifdef USE_JAM_GSUM | 
| 45 | C JAM global sum | 
| 46 | CALL JAM_barrier_start( phi ) | 
| 47 | CALL JAM_barrier_done( ans ) | 
| 48 | #endif | 
| 49 | |
| 50 | C WRITE(6,*) ' phi = ', phi, ' Sum = ', ans | 
| 51 | C CALL MPI_Finalize( rc ) | 
| 52 | C STOP | 
| 53 | |
| 54 | RETURN | 
| 55 | END | 
| ViewVC Help | |
| Powered by ViewVC 1.1.22 |