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