/[MITgcm]/MITgcm_contrib/cg2d_bench/gsum.F
ViewVC logotype

Contents of /MITgcm_contrib/cg2d_bench/gsum.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Fri May 12 21:58:05 2006 UTC (19 years, 2 months ago) by ce107
Branch: MAIN
Initial version of CG2D benchmark code (serial and parallel) by Chris Hill

1 SUBROUTINE GSUM_R8( ans, phi )
2
3 #ifdef ALLOW_MPI
4 #include "mpif.h"
5 #endif
6
7 Real*8 ans
8 Real*8 phi
9
10 INTEGER RC
11
12 ans = phi
13
14 #ifdef USE_MPI_GSUM
15 CALL MPI_Allreduce( phi,
16 & ans,
17 & 1,
18 & MPI_REAL8,
19 & MPI_SUM,
20 & MPI_COMM_WORLD,
21 & rc
22 & )
23 #endif
24
25 #ifdef USE_JAM_GSUM
26 C JAM global sum
27 CALL JAM_barrier_start( phi )
28 CALL JAM_barrier_done( ans )
29 #endif
30
31 C WRITE(6,*) ' phi = ', phi, ' Sum = ', ans
32 C CALL MPI_Finalize( rc )
33 C STOP
34
35 RETURN
36 END

  ViewVC Help
Powered by ViewVC 1.1.22