xref: /petsc/src/ksp/pc/impls/tfs/tfs.h (revision 75d4829f77e52545cf17aa14e26bb6ab7709cba6)
1 
2 #if !defined(__TFS_H)
3 #define __TFS_H
4 
5 /**********************************const.h*************************************
6 
7 Author: Henry M. Tufo III
8 
9 e-mail: hmt@cs.brown.edu
10 
11 snail-mail:
12 Division of Applied Mathematics
13 Brown University
14 Providence, RI 02912
15 
16 Last Modification:
17 6.21.97
18 ***********************************const.h************************************/
19 
20 /**********************************const.h*************************************
21 File Description:
22 -----------------
23 
24 ***********************************const.h************************************/
25 #include "petsc.h"
26 #include <limits.h>
27 #include <float.h>
28 
29 #define X          0
30 #define Y          1
31 #define Z          2
32 #define XY         3
33 #define XZ         4
34 #define YZ         5
35 
36 
37 #define THRESH          0.2
38 #define N_HALF          4096
39 #define PRIV_BUF_SZ     45
40 
41 /*4096 8192 32768 65536 1048576 */
42 #define MAX_MSG_BUF     32768
43 
44 /* fortran gs limit */
45 #define MAX_GS_IDS      100
46 
47 #define FULL          2
48 #define PARTIAL       1
49 #define NONE          0
50 
51 #define BYTE		8
52 #define BIT_0		0x1
53 #define BIT_1		0x2
54 #define BIT_2		0x4
55 #define BIT_3		0x8
56 #define BIT_4		0x10
57 #define BIT_5		0x20
58 #define BIT_6		0x40
59 #define BIT_7		0x80
60 #define TOP_BIT         INT_MIN
61 #define ALL_ONES        -1
62 
63 #define FALSE		0
64 #define TRUE		1
65 
66 #define C		0
67 #define FORTRAN 	1
68 
69 
70 #define MAX_VEC		1674
71 #define FORMAT		30
72 #define MAX_COL_LEN    	100
73 #define MAX_LINE	FORMAT*MAX_COL_LEN
74 #define   DELIM         " \n \t"
75 #define LINE		12
76 #define C_LINE		80
77 
78 #define REAL_MAX	DBL_MAX
79 #define REAL_MIN	DBL_MIN
80 
81 #define   UT            5               /* dump upper 1/2 */
82 #define   LT            6               /* dump lower 1/2 */
83 #define   SYMM          8               /* we assume symm and dump upper 1/2 */
84 #define   NON_SYMM      9
85 
86 #define   ROW          10
87 #define   COL          11
88 
89 #define EPS   1.0e-14
90 #define EPS2  1.0e-07
91 
92 
93 #define MPI   1
94 #define NX    2
95 
96 
97 #define LOG2(x)		(PetscScalar)log((double)x)/log(2)
98 #define SWAP(a,b)       temp=(a); (a)=(b); (b)=temp;
99 #define P_SWAP(a,b)     ptr=(a); (a)=(b); (b)=ptr;
100 
101 #define MAX_FABS(x,y)   ((double)fabs(x)>(double)fabs(y)) ? ((PetscScalar)x) : ((PetscScalar)y)
102 #define MIN_FABS(x,y)   ((double)fabs(x)<(double)fabs(y)) ? ((PetscScalar)x) : ((PetscScalar)y)
103 
104 /* specer's existence ... can be done w/MAX_ABS */
105 #define EXISTS(x,y)     ((x)==0.0) ? (y) : (x)
106 
107 #define MULT_NEG_ONE(a) (a) *= -1;
108 #define NEG(a)          (a) |= BIT_31;
109 #define POS(a)          (a) &= INT_MAX;
110 
111 
112 
113 
114 /**********************************types.h*************************************
115 
116 Author: Henry M. Tufo III
117 
118 e-mail: hmt@cs.brown.edu
119 
120 snail-mail:
121 Division of Applied Mathematics
122 Brown University
123 Providence, RI 02912
124 
125 Last Modification:
126 6.21.97
127 ***********************************types.h************************************/
128 
129 /**********************************types.h*************************************
130 File Description:
131 -----------------
132 
133 ***********************************types.h************************************/
134 typedef void (*vfp)(void*,void*,int,...);
135 typedef void (*rbfp)(PetscScalar *, PetscScalar *, int len);
136 #define vbfp MPI_User_function *
137 typedef int (*bfp)(void*, void *, int *len, MPI_Datatype *dt);
138 
139 /***********************************comm.h*************************************
140 
141 Author: Henry M. Tufo III
142 
143 e-mail: hmt@cs.brown.edu
144 
145 snail-mail:
146 Division of Applied Mathematics
147 Brown University
148 Providence, RI 02912
149 
150 Last Modification:
151 6.21.97
152 ***********************************comm.h*************************************/
153 
154 /***********************************comm.h*************************************
155 File Description:
156 -----------------
157 
158 ***********************************comm.h*************************************/
159 
160 /***********************************comm.h*************************************
161 Function:
162 
163 Input :
164 Output:
165 Return:
166 Description:
167 Usage:
168 ***********************************comm.h*************************************/
169 extern int my_id;
170 extern int num_nodes;
171 extern int floor_num_nodes;
172 extern int i_log2_num_nodes;
173 
174 extern void giop(int *vals, int *work, int n, int *oprs);
175 extern void grop(PetscScalar *vals, PetscScalar *work, int n, int *oprs);
176 extern void gfop(void *vals, void *wk, int n, vbfp fp, MPI_Datatype dt, int comm_type);
177 extern void comm_init(void);
178 extern void giop_hc(int *vals, int *work, int n, int *oprs, int dim);
179 extern void grop_hc(PetscScalar *vals, PetscScalar *work, int n, int *oprs, int dim);
180 extern void grop_hc_vvl(PetscScalar *vals, PetscScalar *work, int *n, int *oprs, int dim);
181 extern void ssgl_radd(PetscScalar *vals, PetscScalar *work, int level, int *segs);
182 
183 #define MSGTAG0 101
184 #define MSGTAG1 1001
185 #define MSGTAG2 76207
186 #define MSGTAG3 100001
187 #define MSGTAG4 163841
188 #define MSGTAG5 249439
189 #define MSGTAG6 10000001
190 
191 
192 /**********************************error.h*************************************
193 
194 Author: Henry M. Tufo III
195 
196 e-mail: hmt@cs.brown.edu
197 
198 snail-mail:
199 Division of Applied Mathematics
200 Brown University
201 Providence, RI 02912
202 
203 Last Modification:
204 6.21.97
205 **********************************error.h*************************************/
206 
207 /**********************************error.h*************************************
208 File Description:
209 -----------------
210 
211 **********************************error.h*************************************/
212 
213 /**********************************error.h*************************************
214 Function: error_msg_fatal()
215 
216 Input : formatted string and arguments.
217 Output: conversion printed to stdout.
218 Return: na.
219 Description: prints error message and terminates program.
220 Usage: error_msg_fatal("this is my %d'st test",test_num)
221 **********************************error.h*************************************/
222 extern void error_msg_fatal(const char msg[], ...);
223 
224 
225 
226 /**********************************error.h*************************************
227 Function: error_msg_warning()
228 
229 Input : formatted string and arguments.
230 Output: conversion printed to stdout.
231 Return: na.
232 Description: prints error message.
233 Usage: error_msg_warning("this is my %d'st test",test_num)
234 **********************************error.h*************************************/
235 extern void error_msg_warning(const char msg[], ...);
236 
237 /*$Id: vector.c,v 1.228 2001/03/23 23:21:22 balay Exp $*/
238 /**********************************ivec.h**************************************
239 
240 Author: Henry M. Tufo III
241 
242 e-mail: hmt@cs.brown.edu
243 
244 snail-mail:
245 Division of Applied Mathematics
246 Brown University
247 Providence, RI 02912
248 
249 Last Modification:
250 6.21.97
251 ***********************************ivec.h*************************************/
252 
253 /**********************************ivec.h**************************************
254 File Description:
255 -----------------
256 
257 ***********************************ivec.h*************************************/
258 
259 #define SORT_REAL		1
260 #define SORT_INTEGER	        0
261 #define SORT_INT_PTR	        2
262 
263 
264 #define NON_UNIFORM     0
265 #define GL_MAX          1
266 #define GL_MIN          2
267 #define GL_MULT         3
268 #define GL_ADD          4
269 #define GL_B_XOR        5
270 #define GL_B_OR         6
271 #define GL_B_AND        7
272 #define GL_L_XOR        8
273 #define GL_L_OR         9
274 #define GL_L_AND        10
275 #define GL_MAX_ABS      11
276 #define GL_MIN_ABS      12
277 #define GL_EXISTS       13
278 
279 
280 
281 /**********************************ivec.h**************************************
282 Function:
283 
284 Input :
285 Output:
286 Return:
287 Description:
288 Usage:
289 ***********************************ivec.h*************************************/
290 extern void ivec_dump(int *v, int n, int tag, int tag2, char * s);
291 extern void ivec_lb_ub(int *arg1, int n, int *lb, int *ub);
292 extern int *ivec_copy(int *arg1, int *arg2, int n);
293 /*void ivec_copy(int *arg1, int *arg2, int n); */
294 
295 extern void ivec_comp(int *arg1, int n);
296 
297 extern int ivec_reduce_and(int *arg1, int n);
298 extern int ivec_reduce_or(int *arg1, int n);
299 
300 extern void ivec_zero(int *arg1, int n);
301 extern void ivec_pos_one(int *arg1, int n);
302 extern void ivec_neg_one(int *arg1, int n);
303 extern void ivec_set(int *arg1, int arg2, int n);
304 extern int ivec_cmp(int *arg1, int *arg2, int n);
305 
306 extern int ivec_lb(int *work, int n);
307 extern int ivec_ub(int *work, int n);
308 extern int ivec_sum(int *arg1, int n);
309 extern int ivec_u_sum(unsigned *arg1, int n);
310 extern int ivec_prod(int *arg1, int n);
311 
312 extern vfp ivec_fct_addr(int type);
313 
314 extern void ivec_non_uniform(int *arg1, int *arg2, int n, int *arg3);
315 extern void ivec_max(int *arg1, int *arg2, int n);
316 extern void ivec_min(int *arg1, int *arg2, int n);
317 extern void ivec_mult(int *arg1, int *arg2, int n);
318 extern void ivec_add(int *arg1, int *arg2, int n);
319 extern void ivec_xor(int *arg1, int *arg2, int n);
320 extern void ivec_or(int *arg1, int *arg2, int len);
321 extern void ivec_and(int *arg1, int *arg2, int len);
322 extern void ivec_lxor(int *arg1, int *arg2, int n);
323 extern void ivec_lor(int *arg1, int *arg2, int len);
324 extern void ivec_land(int *arg1, int *arg2, int len);
325 
326 extern void ivec_or3 (int *arg1, int *arg2, int *arg3, int len);
327 extern void ivec_and3(int *arg1, int *arg2, int *arg3, int n);
328 
329 extern int ivec_split_buf(int *buf1, int **buf2, int size);
330 
331 
332 extern void ivec_sort_companion(int *ar, int *ar2, int size);
333 extern void ivec_sort(int *ar, int size);
334 extern void SMI_sort(void *ar1, void *ar2, int size, int type);
335 extern int ivec_binary_search(int item, int *list, int n);
336 extern int ivec_linear_search(int item, int *list, int n);
337 
338 extern void ivec_c_index(int *arg1, int n);
339 extern void ivec_fortran_index(int *arg1, int n);
340 extern void ivec_sort_companion_hack(int *ar, int **ar2, int size);
341 
342 
343 extern void rvec_dump(PetscScalar *v, int n, int tag, int tag2, char * s);
344 extern void rvec_zero(PetscScalar *arg1, int n);
345 extern void rvec_one(PetscScalar *arg1, int n);
346 extern void rvec_neg_one(PetscScalar *arg1, int n);
347 extern void rvec_set(PetscScalar *arg1, PetscScalar arg2, int n);
348 extern void rvec_copy(PetscScalar *arg1, PetscScalar *arg2, int n);
349 extern void rvec_lb_ub(PetscScalar *arg1, int n, PetscScalar *lb, PetscScalar *ub);
350 extern void rvec_scale(PetscScalar *arg1, PetscScalar arg2, int n);
351 
352 extern vfp rvec_fct_addr(int type);
353 extern void rvec_add(PetscScalar *arg1, PetscScalar *arg2, int n);
354 extern void rvec_mult(PetscScalar *arg1, PetscScalar *arg2, int n);
355 extern void rvec_max(PetscScalar *arg1, PetscScalar *arg2, int n);
356 extern void rvec_max_abs(PetscScalar *arg1, PetscScalar *arg2, int n);
357 extern void rvec_min(PetscScalar *arg1, PetscScalar *arg2, int n);
358 extern void rvec_min_abs(PetscScalar *arg1, PetscScalar *arg2, int n);
359 extern void vec_exists(PetscScalar *arg1, PetscScalar *arg2, int n);
360 
361 
362 extern void rvec_sort(PetscScalar *ar, int size);
363 extern void rvec_sort_companion(PetscScalar *ar, int *ar2, int size);
364 
365 extern PetscScalar rvec_dot(PetscScalar *arg1, PetscScalar *arg2, int n);
366 
367 extern void rvec_axpy(PetscScalar *arg1, PetscScalar *arg2, PetscScalar scale, int n);
368 
369 extern int  rvec_binary_search(PetscScalar item, PetscScalar *list, int rh);
370 
371 
372 /**********************************queue.h*************************************
373 
374 Author: Henry M. Tufo III
375 
376 e-mail: hmt@cs.brown.edu
377 
378 snail-mail:
379 Division of Applied Mathematics
380 Brown University
381 Providence, RI 02912
382 
383 Last Modification:
384 6.21.97
385 **********************************queue.h*************************************/
386 
387 /**********************************queue.h*************************************
388 File Description:
389 -----------------
390   This file provides an interface to a simple queue abstraction.
391 **********************************queue.h*************************************/
392 
393 /**********************************queue.h*************************************
394 Type: queue_ADT
395 ---------------
396   This line defines the abstract queue type as a pointer to
397   its concrete counterpart.  Clients have no access to the
398   underlying representation.
399 **********************************queue.h*************************************/
400 typedef struct queue_CDT *queue_ADT;
401 
402 
403 
404 /**********************************queue.h*************************************
405 Function: new_queue()
406 
407 Input : na
408 Output: na
409 Return: pointer to ADT.
410 Description: This function allocates and returns an empty queue.
411 Usage: queue = new_queue();
412 **********************************queue.h*************************************/
413 extern queue_ADT new_queue(void);
414 
415 
416 
417 /**********************************queue.h*************************************
418 Function: free_queue()
419 
420 Input : pointer to ADT.
421 Output: na
422 Return: na
423 Description: This function frees the storage associated with queue but not any
424 pointer contained w/in.
425 Usage: free_queue(queue);
426 **********************************queue.h*************************************/
427 extern void free_queue(queue_ADT queue);
428 
429 
430 
431 /**********************************queue.h*************************************
432 Function: enqueue()
433 
434 Input : pointer to ADT and pointer to object
435 Output: na
436 Return: na
437 Description: This function adds obj to the end of the queue.
438 Usage: enqueue(queue, obj);
439 **********************************queue.h*************************************/
440 extern void enqueue(queue_ADT queue, void *obj);
441 
442 
443 
444 /**********************************queue.h*************************************
445 Function: dequeue()
446 
447 Input : pointer to ADT
448 Output: na
449 Return: void * to element
450 Description: This function removes the data value at the head of the queue
451 and returns it to the client.  dequeueing an empty queue is an error
452 Usage: obj = dequeue(queue);
453 **********************************queue.h*************************************/
454 extern void *dequeue(queue_ADT queue);
455 
456 
457 
458 /**********************************queue.h*************************************
459 Function: len_queue()
460 
461 Input : pointer to ADT
462 Output: na
463 Return: integer number of elements
464 Description: This function returns the number of elements in the queue.
465 Usage: n = len_queue(queue);
466 **********************************queue.h*************************************/
467 EXTERN int len_queue(queue_ADT queue);
468 
469 
470 
471 /*$Id: vector.c,v 1.228 2001/03/23 23:21:22 balay Exp $*/
472 /***********************************gs.h***************************************
473 
474 Author: Henry M. Tufo III
475 
476 e-mail: hmt@cs.brown.edu
477 
478 snail-mail:
479 Division of Applied Mathematics
480 Brown University
481 Providence, RI 02912
482 
483 Last Modification:
484 6.21.97
485 ************************************gs.h**************************************/
486 
487 /***********************************gs.h***************************************
488 File Description:
489 -----------------
490 
491 ************************************gs.h**************************************/
492 
493 /***********************************gs.h***************************************
494 Type: gs_ADT
495 ------------
496 
497 ************************************gs.h**************************************/
498 
499 typedef struct gather_scatter_id *gs_ADT;
500 typedef void (*Rbfp)(PetscScalar *, PetscScalar *, int len);
501 
502 /***********************************gs.h***************************************
503 Function:
504 
505 Input :
506 Output:
507 Return:
508 Description:
509 Usage:
510 ************************************gs.h**************************************/
511 extern gs_ADT gs_init(int *elms, int nel, int level);
512 extern void   gs_gop(gs_ADT gs_handle, PetscScalar *vals, const char *op);
513 extern void   gs_gop_vec(gs_ADT gs_handle, PetscScalar *vals, const char *op, int step);
514 extern void   gs_gop_binary(gs_ADT gs, PetscScalar *vals, Rbfp fct);
515 extern void   gs_gop_hc(gs_ADT gs_handle, PetscScalar *vals, const char *op, int dim);
516 extern void   gs_free(gs_ADT gs_handle);
517 extern void   gs_init_msg_buf_sz(int buf_size);
518 extern void   gs_init_vec_sz(int size);
519 
520 
521 
522 /*************************************xxt.h************************************
523 Module Name: xxt
524 Module Info: need xxt.{c,h} gs.{c,h} comm.{c,h} ivec.{c,h} error.{c,h}
525 
526 author:  Henry M. Tufo III
527 e-mail:  hmt@asci.uchicago.edu
528 contact:
529 +--------------------------------+--------------------------------+
530 |MCS Division - Building 221     |Department of Computer Science  |
531 |Argonne National Laboratory     |Ryerson 152                     |
532 |9700 S. Cass Avenue             |The University of Chicago       |
533 |Argonne, IL  60439              |Chicago, IL  60637              |
534 |(630) 252-5354/5986 ph/fx       |(773) 702-6019/8487 ph/fx       |
535 +--------------------------------+--------------------------------+
536 
537 Last Modification: 3.20.01
538 **************************************xxt.h***********************************/
539 
540 /*************************************xxt.h************************************
541 File Description:
542 **************************************xxt.h***********************************/
543 
544 /*************************************xxt.h************************************
545 Notes on Usage:
546 **************************************xxt.h***********************************/
547 
548 
549 typedef struct xxt_CDT *xxt_ADT;
550 
551 
552 /*************************************xxt.h************************************
553 Function: XXT_new()
554 
555 Input :
556 Output:
557 Return: ADT ptr or NULL upon failure.
558 Description: This function allocates and returns an xxt handle
559 Usage: xxt_handle = xxt_new();
560 **************************************xxt.h***********************************/
561 extern xxt_ADT XXT_new(void);
562 
563 
564 /*************************************xxt.h************************************
565 Function: XXT_free()
566 
567 Input : pointer to ADT.
568 Output:
569 Return:
570 Description: This function frees the storage associated with an xxt handle
571 Usage: XXT_free(xxt_handle);
572 **************************************xxt.h***********************************/
573 EXTERN int XXT_free(xxt_ADT xxt_handle);
574 
575 
576 /*************************************xxt.h************************************
577 Function: XXT_factor
578 
579 Input : ADT ptr,  and pointer to object
580 Output:
581 Return: 0 on failure, 1 on success
582 Description: This function sets the xxt solver
583 
584 xxt assumptions: given n rows of global coarse matrix (E_loc) where
585    o global dofs N = sum_p(n), p=0,P-1
586    (i.e. row dist. with no dof replication)
587    (5.21.00 will handle dif replication case)
588    o m is the number of columns in E_loc (m>=n)
589    o local2global holds global number of column i (i=0,...,m-1)
590    o local2global holds global number of row    i (i=0,...,n-1)
591    o mylocmatvec performs E_loc . x_loc where x_loc is an vector of
592    length m in 1-1 correspondence with local2global
593    (note that gs package takes care of communication).
594    (note do not zero out upper m-n entries!)
595    o mylocmatvec(void *grid_data, double *in, double *out)
596 
597 ML beliefs/usage: move this to to ML_XXT_factor routine
598    o my_ml holds address of ML struct associated w/E_loc, grid_data, grid_tag
599    o grid_tag, grid_data, my_ml used in
600       ML_Set_CSolve(my_ml, grid_tag, grid_data, ML_Do_CoarseDirect);
601    o grid_data used in
602       A_matvec(grid_data,v,u);
603 
604 Usage:
605 **************************************xxt.h***********************************/
606 extern int XXT_factor(xxt_ADT xxt_handle,   /* prev. allocated xxt  handle */
607                       int *local2global,    /* global column mapping       */
608 		      int n,                /* local num rows              */
609 		      int m,                /* local num cols              */
610 		      void *mylocmatvec,    /* b_loc=A_local.x_loc         */
611 		      void *grid_data       /* grid data for matvec        */
612 		      );
613 
614 
615 /*************************************xxt.h************************************
616 Function: XXT_solve
617 
618 Input : ADT ptr, b (rhs)
619 Output: x (soln)
620 Return:
621 Description: This function performs x = E^-1.b
622 Usage:
623 XXT_solve(xxt_handle, double *x, double *b)
624 XXT_solve(xxt_handle, double *x, NULL)
625 assumes x has been initialized to be b
626 impl. issue for FORTRAN interface ... punt for now and disallow NULL opt.
627 **************************************xxt.h***********************************/
628 extern int XXT_solve(xxt_ADT xxt_handle, double *x, double *b);
629 
630 
631 /*************************************xxt.h************************************
632 Function: XXT_stats
633 
634 Input : handle
635 Output:
636 Return:
637 Description:
638 factor stats
639 **************************************xxt.h***********************************/
640 extern int XXT_stats(xxt_ADT xxt_handle);
641 
642 
643 /*************************************xxt.h************************************
644 Function: XXT_sp_1()
645 
646 Input : pointer to ADT
647 Output:
648 Return:
649 Description: sets xxt parameter 1 in xxt_handle
650 Usage: implement later
651 
652 void XXT_sp_1(xxt_handle,parameter 1 value)
653 **************************************xxt.h***********************************/
654 
655 
656 /*************************************xyt.h************************************
657 Module Name: xyt
658 Module Info: need xyt.{c,h} gs.{c,h} comm.{c,h} ivec.{c,h} error.{c,h}
659 
660 author:  Henry M. Tufo III
661 e-mail:  hmt@asci.uchicago.edu
662 contact:
663 +--------------------------------+--------------------------------+
664 |MCS Division - Building 221     |Department of Computer Science  |
665 |Argonne National Laboratory     |Ryerson 152                     |
666 |9700 S. Cass Avenue             |The University of Chicago       |
667 |Argonne, IL  60439              |Chicago, IL  60637              |
668 |(630) 252-5354/5986 ph/fx       |(773) 702-6019/8487 ph/fx       |
669 +--------------------------------+--------------------------------+
670 
671 Last Modification: 3.20.01
672 **************************************xyt.h***********************************/
673 
674 /*************************************xyt.h************************************
675 File Description:
676 **************************************xyt.h***********************************/
677 
678 /*************************************xyt.h************************************
679 Notes on Usage:
680 **************************************xyt.h***********************************/
681 
682 
683 
684 typedef struct xyt_CDT *xyt_ADT;
685 
686 
687 /*************************************xyt.h************************************
688 Function: XYT_new()
689 
690 Input :
691 Output:
692 Return: ADT ptr or NULL upon failure.
693 Description: This function allocates and returns an xyt handle
694 Usage: xyt_handle = xyt_new();
695 **************************************xyt.h***********************************/
696 extern xyt_ADT XYT_new(void);
697 
698 
699 /*************************************xyt.h************************************
700 Function: XYT_free()
701 
702 Input : pointer to ADT.
703 Output:
704 Return:
705 Description: This function frees the storage associated with an xyt handle
706 Usage: XYT_free(xyt_handle);
707 **************************************xyt.h***********************************/
708 EXTERN int XYT_free(xyt_ADT xyt_handle);
709 
710 
711 /*************************************xyt.h************************************
712 Function: XYT_factor
713 
714 Input : ADT ptr,  and pointer to object
715 Output:
716 Return: 0 on failure, 1 on success
717 Description: This function sets the xyt solver
718 
719 xyt assumptions: given n rows of global coarse matrix (E_loc) where
720    o global dofs N = sum_p(n), p=0,P-1
721    (i.e. row dist. with no dof replication)
722    (5.21.00 will handle dif replication case)
723    o m is the number of columns in E_loc (m>=n)
724    o local2global holds global number of column i (i=0,...,m-1)
725    o local2global holds global number of row    i (i=0,...,n-1)
726    o mylocmatvec performs E_loc . x_loc where x_loc is an vector of
727    length m in 1-1 correspondence with local2global
728    (note that gs package takes care of communication).
729    (note do not zero out upper m-n entries!)
730    o mylocmatvec(void *grid_data, double *in, double *out)
731 
732 ML beliefs/usage: move this to to ML_XYT_factor routine
733    o my_ml holds address of ML struct associated w/E_loc, grid_data, grid_tag
734    o grid_tag, grid_data, my_ml used in
735       ML_Set_CSolve(my_ml, grid_tag, grid_data, ML_Do_CoarseDirect);
736    o grid_data used in
737       A_matvec(grid_data,v,u);
738 
739 Usage:
740 **************************************xyt.h***********************************/
741 extern int XYT_factor(xyt_ADT xyt_handle,   /* prev. allocated xyt  handle */
742                       int *local2global,    /* global column mapping       */
743 		      int n,                /* local num rows              */
744 		      int m,                /* local num cols              */
745 		      void *mylocmatvec,    /* b_loc=A_local.x_loc         */
746 		      void *grid_data       /* grid data for matvec        */
747 		      );
748 
749 
750 /*************************************xyt.h************************************
751 Function: XYT_solve
752 
753 Input : ADT ptr, b (rhs)
754 Output: x (soln)
755 Return:
756 Description: This function performs x = E^-1.b
757 Usage: XYT_solve(xyt_handle, double *x, double *b)
758 **************************************xyt.h***********************************/
759 extern int XYT_solve(xyt_ADT xyt_handle, double *x, double *b);
760 
761 
762 /*************************************xyt.h************************************
763 Function: XYT_stats
764 
765 Input : handle
766 Output:
767 Return:
768 Description:
769 factor stats
770 **************************************xyt.h***********************************/
771 extern int XYT_stats(xyt_ADT xyt_handle);
772 
773 
774 /*************************************xyt.h************************************
775 Function: XYT_sp_1()
776 
777 Input : pointer to ADT
778 Output:
779 Return:
780 Description: sets xyt parameter 1 in xyt_handle
781 Usage: implement later
782 
783 void XYT_sp_1(xyt_handle,parameter 1 value)
784 **************************************xyt.h***********************************/
785 
786 /********************************bit_mask.h************************************
787 
788 Author: Henry M. Tufo III
789 
790 e-mail: hmt@cs.brown.edu
791 
792 snail-mail:
793 Division of Applied Mathematics
794 Brown University
795 Providence, RI 02912
796 
797 Last Modification:
798 11.21.97
799 *********************************bit_mask.h***********************************/
800 
801 /********************************bit_mask.h************************************
802 File Description:
803 -----------------
804 
805 *********************************bit_mask.h***********************************/
806 
807 
808 /********************************bit_mask.h************************************
809 Function:
810 
811 Input :
812 Output:
813 Return:
814 Description:
815 Usage:
816 *********************************bit_mask.h***********************************/
817 extern int div_ceil(int numin, int denom);
818 extern void set_bit_mask(int *bm, int len, int val);
819 extern int len_bit_mask(int num_items);
820 extern int ct_bits(char *ptr, int n);
821 extern void bm_to_proc(char *ptr, int p_mask, int *msg_list);
822 extern int len_buf(int item_size, int num_items);
823 
824 #endif
825 
826