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