source: soft/giet_vm/applications/ocean/decs.H @ 581

Last change on this file since 581 was 581, checked in by laurent, 9 years ago

Adding ocean application, some mathematics functions and distributed locks

File size: 5.6 KB
Line 
1/*************************************************************************/
2/*                                                                       */
3/*  Copyright (c) 1994 Stanford University                               */
4/*                                                                       */
5/*  All rights reserved.                                                 */
6/*                                                                       */
7/*  Permission is given to use, copy, and modify this software for any   */
8/*  non-commercial purpose as long as this copyright notice is not       */
9/*  removed.  All other uses, including redistribution in whole or in    */
10/*  part, are forbidden without prior written permission.                */
11/*                                                                       */
12/*  This software is provided with absolutely no warranty and no         */
13/*  support.                                                             */
14/*                                                                       */
15/*************************************************************************/
16
17#define MASTER            0
18#define RED_ITER          0
19#define BLACK_ITER        1
20#define UP                0
21#define DOWN              1
22#define LEFT              2
23#define RIGHT             3
24#define UPLEFT            4
25#define UPRIGHT           5
26#define DOWNLEFT          6
27#define DOWNRIGHT         7
28#define PAGE_SIZE      4096
29
30struct multi_struct {
31    double err_multi;
32};
33
34extern struct multi_struct *multi;
35
36struct global_struct {
37    //long id;
38    unsigned long long starttime;
39    unsigned long long trackstart;
40    double psiai;
41    double psibi;
42};
43
44extern struct global_struct *global;
45
46extern double eig2;
47extern double ysca;
48extern long jmm1;
49extern const double pi;
50extern const double t0;
51
52extern double ****psi;
53extern double ****psim;
54extern double ***psium;
55extern double ***psilm;
56extern double ***psib;
57extern double ***ga;
58extern double ***gb;
59extern double ****work1;
60extern double ***work2;
61extern double ***work3;
62extern double ****work4;
63extern double ****work5;
64extern double ***work6;
65extern double ****work7;
66extern double ****temparray;
67extern double ***tauz;
68extern double ***oldga;
69extern double ***oldgb;
70extern double *f;
71extern double ****q_multi;
72extern double ****rhs_multi;
73
74struct locks_struct {
75    LOCKDEC(idlock)
76    LOCKDEC(psiailock)
77    LOCKDEC(psibilock)
78    LOCKDEC(donelock)
79    LOCKDEC(error_lock)
80    LOCKDEC(bar_lock)
81};
82
83extern struct locks_struct *locks;
84
85struct bars_struct {
86#if defined(MULTIPLE_BARRIERS)
87    BARDEC(iteration)
88    BARDEC(gsudn)
89    BARDEC(p_setup)
90    BARDEC(p_redph)
91    BARDEC(p_soln)
92    BARDEC(p_subph)
93    BARDEC(sl_prini)
94    BARDEC(sl_psini)
95    BARDEC(sl_onetime)
96    BARDEC(sl_phase_1)
97    BARDEC(sl_phase_2)
98    BARDEC(sl_phase_3)
99    BARDEC(sl_phase_4)
100    BARDEC(sl_phase_5)
101    BARDEC(sl_phase_6)
102    BARDEC(sl_phase_7)
103    BARDEC(sl_phase_8)
104    BARDEC(sl_phase_9)
105    BARDEC(sl_phase_10)
106    BARDEC(error_barrier)
107#else
108    BARDEC(barrier)
109#endif
110};
111
112extern struct bars_struct *bars;
113
114extern double factjacob;
115extern double factlap;
116
117struct Global_Private {
118    char *pad;                  //[PAGE_SIZE];
119    long *rel_num_x;
120    long *rel_num_y;
121    long *eist;
122    long *ejst;
123    long *oist;
124    long *ojst;
125    long *rlist;
126    long *rljst;
127    long *rlien;
128    long *rljen;
129    long *rownum;
130    long *colnum;
131    long *neighbors;            //[8];
132    long *lpid;
133    double *multi_time;
134    double *total_time;
135    double *sync_time;
136    double *process_time;
137    double *steps_time;         //[10]
138    double *step_start;
139};
140
141extern struct Global_Private *gp;
142
143extern double *i_int_coeff;
144extern double *j_int_coeff;
145extern long xprocs;
146extern long yprocs;
147
148extern long numlev;
149extern long *imx;
150extern long *jmx;
151extern double tolerance;
152extern double *lev_res;
153extern double *lev_tol;
154extern const double maxwork;
155extern long *xpts_per_proc;
156extern long *ypts_per_proc;
157extern long minlevel;
158extern const double outday0;
159extern const double outday1;
160extern const double outday2;
161extern const double outday3;
162
163extern long nprocs;
164extern const double h1;
165extern const double h3;
166extern const double h;
167extern const double lf;
168extern double res;
169extern double dtau;
170extern const double f0;
171extern const double beta;
172extern const double gpr;
173extern long oim;
174extern long im;
175extern long jm;
176extern long do_stats;
177extern long do_output;
178extern long *multi_times;
179extern long *total_times;
180
181/*
182 * jacobcalc.C
183 */
184void jacobcalc (double ***x, double ***y, double ***z, long pid, long firstrow, long lastrow, long firstcol, long lastcol);
185
186/*
187 * jacobcalc2.C
188 */
189void jacobcalc2 (double ****x, double ****y, double ****z, long psiindex, long pid, long firstrow, long lastrow, long firstcol, long lastcol);
190
191/*
192 * laplacalc.C
193 */
194void laplacalc (long procid, double ****x, double ****z, long psiindex, long firstrow, long lastrow, long firstcol, long lastcol);
195
196/*
197 * linkup.C
198 */
199void link_all (void);
200void linkup (double **row_ptr);
201void link_multi (void);
202
203/*
204 * main.C
205 */
206long log_2 (long number);
207void printerr (char *s);
208
209/*
210 * multi.C
211 */
212void multig (long my_id);
213void relax (long k, double *err, long color, long my_num);
214void rescal (long kf, long my_num);
215void intadd (long kc, long my_num);
216void putz (long k, long my_num);
217void copy_borders (long k, long pid);
218void copy_rhs_borders (long k, long procid);
219void copy_red (long k, long procid);
220void copy_black (long k, long procid);
221
222/*
223 * slave1.C
224 */
225void slave (long *ptr_procid);
226
227/*
228 * slave2.C
229 */
230void slave2 (long procid, long firstrow, long lastrow, long numrows, long firstcol, long lastcol, long numcols);
231
232/*
233 * subblock.C
234 */
235void subblock (void);
Note: See TracBrowser for help on using the repository browser.