Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[examples,smpi] remove warnings and resolve a bug (I hope I amn't sure)
[simgrid.git] / examples / smpi / NAS / LU / lu.f
1 !-------------------------------------------------------------------------!
2 !                                                                         !
3 !        N  A  S     P A R A L L E L     B E N C H M A R K S  3.3         !
4 !                                                                         !
5 !                                   L U                                   !
6 !                                                                         !
7 !-------------------------------------------------------------------------!
8 !                                                                         !
9 !    This benchmark is part of the NAS Parallel Benchmark 3.3 suite.      !
10 !    It is described in NAS Technical Reports 95-020 and 02-007           !
11 !                                                                         !
12 !    Permission to use, copy, distribute and modify this software         !
13 !    for any purpose with or without fee is hereby granted.  We           !
14 !    request, however, that all derived work reference the NAS            !
15 !    Parallel Benchmarks 3.3. This software is provided "as is"           !
16 !    without express or implied warranty.                                 !
17 !                                                                         !
18 !    Information on NPB 3.3, including the technical report, the          !
19 !    original specifications, source code, results and information        !
20 !    on how to submit new results, is available at:                       !
21 !                                                                         !
22 !           http://www.nas.nasa.gov/Software/NPB/                         !
23 !                                                                         !
24 !    Send comments or suggestions to  npb@nas.nasa.gov                    !
25 !                                                                         !
26 !          NAS Parallel Benchmarks Group                                  !
27 !          NASA Ames Research Center                                      !
28 !          Mail Stop: T27A-1                                              !
29 !          Moffett Field, CA   94035-1000                                 !
30 !                                                                         !
31 !          E-mail:  npb@nas.nasa.gov                                      !
32 !          Fax:     (650) 604-3957                                        !
33 !                                                                         !
34 !-------------------------------------------------------------------------!
35
36 c---------------------------------------------------------------------
37 c
38 c Authors: S. Weeratunga
39 c          V. Venkatakrishnan
40 c          E. Barszcz
41 c          M. Yarrow
42 c
43 c---------------------------------------------------------------------
44
45 c---------------------------------------------------------------------
46       program applu
47 c---------------------------------------------------------------------
48
49 c---------------------------------------------------------------------
50 c
51 c   driver for the performance evaluation of the solver for
52 c   five coupled parabolic/elliptic partial differential equations.
53 c
54 c---------------------------------------------------------------------
55
56       implicit none
57
58       include 'applu.incl'
59       character class
60       logical verified
61       double precision mflops
62       integer ierr
63
64 c---------------------------------------------------------------------
65 c   initialize communications
66 c---------------------------------------------------------------------
67       call init_comm()
68
69 c---------------------------------------------------------------------
70 c   read input data
71 c---------------------------------------------------------------------
72       call read_input()
73
74 c---------------------------------------------------------------------
75 c   set up processor grid
76 c---------------------------------------------------------------------
77       call proc_grid()
78
79 c---------------------------------------------------------------------
80 c   determine the neighbors
81 c---------------------------------------------------------------------
82       call neighbors()
83
84 c---------------------------------------------------------------------
85 c   set up sub-domain sizes
86 c---------------------------------------------------------------------
87       call subdomain()
88
89 c---------------------------------------------------------------------
90 c   set up coefficients
91 c---------------------------------------------------------------------
92       call setcoeff()
93
94 c---------------------------------------------------------------------
95 c   set the masks required for comm
96 c---------------------------------------------------------------------
97       call sethyper()
98
99 c---------------------------------------------------------------------
100 c   set the boundary values for dependent variables
101 c---------------------------------------------------------------------
102       call setbv()
103
104 c---------------------------------------------------------------------
105 c   set the initial values for dependent variables
106 c---------------------------------------------------------------------
107       call setiv()
108
109 c---------------------------------------------------------------------
110 c   compute the forcing term based on prescribed exact solution
111 c---------------------------------------------------------------------
112       call erhs()
113
114 c---------------------------------------------------------------------
115 c   perform one SSOR iteration to touch all data and program pages 
116 c---------------------------------------------------------------------
117       call ssor(1)
118
119 c---------------------------------------------------------------------
120 c   reset the boundary and initial values
121 c---------------------------------------------------------------------
122       call setbv()
123       call setiv()
124
125 c---------------------------------------------------------------------
126 c   perform the SSOR iterations
127 c---------------------------------------------------------------------
128       call ssor(itmax)
129
130 c---------------------------------------------------------------------
131 c   compute the solution error
132 c---------------------------------------------------------------------
133       call error()
134
135 c---------------------------------------------------------------------
136 c   compute the surface integral
137 c---------------------------------------------------------------------
138       call pintgr()
139
140 c---------------------------------------------------------------------
141 c   verification test
142 c---------------------------------------------------------------------
143       IF (id.eq.0) THEN
144          call verify ( rsdnm, errnm, frc, class, verified )
145          mflops = float(itmax)*(1984.77*float( nx0 )
146      >        *float( ny0 )
147      >        *float( nz0 )
148      >        -10923.3*(float( nx0+ny0+nz0 )/3.)**2 
149      >        +27770.9* float( nx0+ny0+nz0 )/3.
150      >        -144010.)
151      >        / (maxtime*1000000.)
152
153          call print_results('LU', class, nx0,
154      >     ny0, nz0, itmax, nnodes_compiled,
155      >     num, maxtime, mflops, '          floating point', verified, 
156      >     npbversion, compiletime, cs1, cs2, cs3, cs4, cs5, cs6, 
157      >     '(none)')
158
159       END IF
160
161       call mpi_finalize(ierr)
162       end
163
164