1#include <stdio.h>
2#include "applu_share.h"
3
4void read_input() {
5
6  int  root;
7
8//c---------------------------------------------------------------------
9//c    only root does initializtion, it uses defaults
10//c       ipr = 1 for detailed progress output
11//c       inorm = how often the norm is printed (once every inorm iterations)
12//c       itmax = number of pseudo time steps
13//c       dt = time step
14//c       omega 1 over-relaxation factor for SSOR
15//c       tolrsd = steady state residual tolerance levels
16//c       nx, ny, nz = number of grid points in x, y, z directions
17//c---------------------------------------------------------------------
18   root = 0;
19
20
21         ipr = ipr_default;
22         inorm = inorm_default;
23         itmax = itmax_default;
24         dt = dt_default;
25         omega = omega_default;
26         tolrsd[0] = tolrsd1_def;
27         tolrsd[1] = tolrsd2_def;
28         tolrsd[2] = tolrsd3_def;
29         tolrsd[3] = tolrsd4_def;
30         tolrsd[4] = tolrsd5_def;
31         nx0 = isiz01;
32         ny0 = isiz02;
33         nz0 = isiz03;
34      if (id == root) {
35//c---------------------------------------------------------------------
36//c   check problem size
37//c---------------------------------------------------------------------
38
39         if (num != nnodes_compiled) {
40            printf("Warning: program is running on %d processors ", num);
41            printf("but was compiled for %d\n", nnodes_compiled);
42         }
43
44         if ( nx0 < 4 || ny0 < 4 || nz0 < 4 ) {
45            printf("PROBLEM SIZE IS TOO SMALL\n");
46         }
47
48         if (nx0 > isiz01 || ny0 > isiz02 || nz0 > isiz03 ) {
49            printf("PROBLEM SIZE IS TOO LARGE\n");
50         }
51
52         printf("\nNAS Parallel Benchmarks 3.3 -- LU Benchmark\n");
53         printf("Size: %d %d %d\n", nx0, ny0, nz0);
54         printf("Iterations: %d\n", itmax);
55         printf("Number of processes: %d\n", num);
56
57      }
58
59      return;
60}
61
62
63
64