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 #define FULL 2 53 #define PARTIAL 1 54 #define NONE 0 55 56 #define BYTE 8 57 #define BIT_0 0x1 58 #define BIT_1 0x2 59 #define BIT_2 0x4 60 #define BIT_3 0x8 61 #define BIT_4 0x10 62 #define BIT_5 0x20 63 #define BIT_6 0x40 64 #define BIT_7 0x80 65 #define TOP_BIT INT_MIN 66 #define ALL_ONES -1 67 68 #define FALSE 0 69 #define TRUE 1 70 71 #define C 0 72 73 74 #define MAX_VEC 1674 75 #define FORMAT 30 76 #define MAX_COL_LEN 100 77 #define MAX_LINE FORMAT*MAX_COL_LEN 78 #define DELIM " \n \t" 79 #define LINE 12 80 #define C_LINE 80 81 82 #define REAL_MAX DBL_MAX 83 #define REAL_MIN DBL_MIN 84 85 #define UT 5 /* dump upper 1/2 */ 86 #define LT 6 /* dump lower 1/2 */ 87 #define SYMM 8 /* we assume symm and dump upper 1/2 */ 88 #define NON_SYMM 9 89 90 #define ROW 10 91 #define COL 11 92 93 #define EPS 1.0e-14 94 #define EPS2 1.0e-07 95 96 97 #define MPI 1 98 #define NX 2 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 PetscErrorCode (*vfp)(void*,void*,int,...); 138 typedef PetscErrorCode (*rbfp)(PetscScalar *, PetscScalar *, PetscInt len); 139 #define vbfp MPI_User_function * 140 typedef PetscInt (*bfp)(void*, void *, PetscInt *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 PetscMPIInt my_id; 173 extern PetscMPIInt num_nodes; 174 extern PetscMPIInt floor_num_nodes; 175 extern PetscMPIInt i_log2_num_nodes; 176 177 extern PetscErrorCode giop(PetscInt *vals, PetscInt *work, PetscInt n, PetscInt *oprs); 178 extern PetscErrorCode grop(PetscScalar *vals, PetscScalar *work, PetscInt n, PetscInt *oprs); 179 extern PetscErrorCode gfop(void *vals, void *wk, PetscInt n, vbfp fp, MPI_Datatype dt, PetscInt comm_type); 180 extern PetscErrorCode comm_init(void); 181 extern PetscErrorCode giop_hc(PetscInt *vals, PetscInt *work, PetscInt n, PetscInt *oprs, PetscInt dim); 182 extern PetscErrorCode grop_hc(PetscScalar *vals, PetscScalar *work, PetscInt n, PetscInt *oprs, PetscInt dim); 183 extern PetscErrorCode ssgl_radd(PetscScalar *vals, PetscScalar *work, PetscInt level, PetscInt *segs); 184 185 #define MSGTAG0 101 186 #define MSGTAG1 1001 187 #define MSGTAG2 76207 188 #define MSGTAG3 100001 189 #define MSGTAG4 163841 190 #define MSGTAG5 249439 191 #define MSGTAG6 10000001 192 193 194 /**********************************error.h************************************* 195 196 Author: Henry M. Tufo III 197 198 e-mail: hmt@cs.brown.edu 199 200 snail-mail: 201 Division of Applied Mathematics 202 Brown University 203 Providence, RI 02912 204 205 Last Modification: 206 6.21.97 207 **********************************error.h*************************************/ 208 209 /**********************************error.h************************************* 210 File Description: 211 ----------------- 212 213 **********************************error.h*************************************/ 214 215 216 217 /**********************************error.h************************************* 218 Function: error_msg_warning() 219 220 Input : formatted string and arguments. 221 Output: conversion printed to stdout. 222 Return: na. 223 Description: prints error message. 224 Usage: error_msg_warning("this is my %d'st test",test_num) 225 **********************************error.h*************************************/ 226 extern PetscErrorCode error_msg_warning(const char msg[], ...); 227 228 /*$Id: vector.c,v 1.228 2001/03/23 23:21:22 balay Exp $*/ 229 /**********************************ivec.h************************************** 230 231 Author: Henry M. Tufo III 232 233 e-mail: hmt@cs.brown.edu 234 235 snail-mail: 236 Division of Applied Mathematics 237 Brown University 238 Providence, RI 02912 239 240 Last Modification: 241 6.21.97 242 ***********************************ivec.h*************************************/ 243 244 /**********************************ivec.h************************************** 245 File Description: 246 ----------------- 247 248 ***********************************ivec.h*************************************/ 249 250 #define SORT_REAL 1 251 #define SORT_INTEGER 0 252 #define SORT_INT_PTR 2 253 254 255 #define NON_UNIFORM 0 256 #define GL_MAX 1 257 #define GL_MIN 2 258 #define GL_MULT 3 259 #define GL_ADD 4 260 #define GL_B_XOR 5 261 #define GL_B_OR 6 262 #define GL_B_AND 7 263 #define GL_L_XOR 8 264 #define GL_L_OR 9 265 #define GL_L_AND 10 266 #define GL_MAX_ABS 11 267 #define GL_MIN_ABS 12 268 #define GL_EXISTS 13 269 270 271 272 /**********************************ivec.h************************************** 273 Function: 274 275 Input : 276 Output: 277 Return: 278 Description: 279 Usage: 280 ***********************************ivec.h*************************************/ 281 extern PetscInt *ivec_copy(PetscInt *arg1, PetscInt *arg2, PetscInt n); 282 283 extern PetscErrorCode ivec_zero(PetscInt *arg1, PetscInt n); 284 extern PetscErrorCode ivec_set(PetscInt *arg1, PetscInt arg2, PetscInt n); 285 286 extern PetscInt ivec_lb(PetscInt *work, PetscInt n); 287 extern PetscInt ivec_ub(PetscInt *work, PetscInt n); 288 extern PetscInt ivec_sum(PetscInt *arg1, PetscInt n); 289 290 extern vfp ivec_fct_addr(PetscInt type); 291 292 extern PetscErrorCode ivec_non_uniform(PetscInt *arg1, PetscInt *arg2, PetscInt n, PetscInt *arg3); 293 extern PetscErrorCode ivec_max(PetscInt *arg1, PetscInt *arg2, PetscInt n); 294 extern PetscErrorCode ivec_min(PetscInt *arg1, PetscInt *arg2, PetscInt n); 295 extern PetscErrorCode ivec_mult(PetscInt *arg1, PetscInt *arg2, PetscInt n); 296 extern PetscErrorCode ivec_add(PetscInt *arg1, PetscInt *arg2, PetscInt n); 297 extern PetscErrorCode ivec_xor(PetscInt *arg1, PetscInt *arg2, PetscInt n); 298 extern PetscErrorCode ivec_or(PetscInt *arg1, PetscInt *arg2, PetscInt len); 299 extern PetscErrorCode ivec_and(PetscInt *arg1, PetscInt *arg2, PetscInt len); 300 extern PetscErrorCode ivec_lxor(PetscInt *arg1, PetscInt *arg2, PetscInt n); 301 extern PetscErrorCode ivec_lor(PetscInt *arg1, PetscInt *arg2, PetscInt len); 302 extern PetscErrorCode ivec_land(PetscInt *arg1, PetscInt *arg2, PetscInt len); 303 extern PetscErrorCode ivec_and3( PetscInt *arg1, PetscInt *arg2, PetscInt *arg3, PetscInt n); 304 305 extern PetscErrorCode ivec_sort_companion(PetscInt *ar, PetscInt *ar2, PetscInt size); 306 extern PetscErrorCode ivec_sort(PetscInt *ar, PetscInt size); 307 extern PetscErrorCode SMI_sort(void *ar1, void *ar2, PetscInt size, PetscInt type); 308 extern PetscInt ivec_binary_search(PetscInt item, PetscInt *list, PetscInt n); 309 extern PetscInt ivec_linear_search(PetscInt item, PetscInt *list, PetscInt n); 310 311 extern PetscErrorCode ivec_sort_companion_hack(PetscInt *ar, PetscInt **ar2, PetscInt size); 312 313 314 extern PetscErrorCode rvec_zero(PetscScalar *arg1, PetscInt n); 315 extern PetscErrorCode rvec_one(PetscScalar *arg1, PetscInt n); 316 extern PetscErrorCode rvec_set(PetscScalar *arg1, PetscScalar arg2, PetscInt n); 317 extern PetscErrorCode rvec_copy(PetscScalar *arg1, PetscScalar *arg2, PetscInt n); 318 extern PetscErrorCode rvec_scale(PetscScalar *arg1, PetscScalar arg2, PetscInt n); 319 320 extern vfp rvec_fct_addr(PetscInt type); 321 extern PetscErrorCode rvec_add(PetscScalar *arg1, PetscScalar *arg2, PetscInt n); 322 extern PetscErrorCode rvec_mult(PetscScalar *arg1, PetscScalar *arg2, PetscInt n); 323 extern PetscErrorCode rvec_max(PetscScalar *arg1, PetscScalar *arg2, PetscInt n); 324 extern PetscErrorCode rvec_max_abs(PetscScalar *arg1, PetscScalar *arg2, PetscInt n); 325 extern PetscErrorCode rvec_min(PetscScalar *arg1, PetscScalar *arg2, PetscInt n); 326 extern PetscErrorCode rvec_min_abs(PetscScalar *arg1, PetscScalar *arg2, PetscInt n); 327 extern PetscErrorCode vec_exists(PetscScalar *arg1, PetscScalar *arg2, PetscInt n); 328 329 330 /*$Id: vector.c,v 1.228 2001/03/23 23:21:22 balay Exp $*/ 331 /***********************************gs.h*************************************** 332 333 Author: Henry M. Tufo III 334 335 e-mail: hmt@cs.brown.edu 336 337 snail-mail: 338 Division of Applied Mathematics 339 Brown University 340 Providence, RI 02912 341 342 Last Modification: 343 6.21.97 344 ************************************gs.h**************************************/ 345 346 /***********************************gs.h*************************************** 347 File Description: 348 ----------------- 349 350 ************************************gs.h**************************************/ 351 352 /***********************************gs.h*************************************** 353 Type: gs_ADT 354 ------------ 355 356 ************************************gs.h**************************************/ 357 358 typedef struct gather_scatter_id *gs_ADT; 359 typedef PetscErrorCode (*Rbfp)(PetscScalar *, PetscScalar *, PetscInt len); 360 361 /***********************************gs.h*************************************** 362 Function: 363 364 Input : 365 Output: 366 Return: 367 Description: 368 Usage: 369 ************************************gs.h**************************************/ 370 extern gs_ADT gs_init(PetscInt *elms, PetscInt nel, PetscInt level); 371 extern PetscErrorCode gs_gop(gs_ADT gs_handle, PetscScalar *vals, const char *op); 372 extern PetscErrorCode gs_gop_vec(gs_ADT gs_handle, PetscScalar *vals, const char *op, PetscInt step); 373 extern PetscErrorCode gs_gop_binary(gs_ADT gs, PetscScalar *vals, Rbfp fct); 374 extern PetscErrorCode gs_gop_hc(gs_ADT gs_handle, PetscScalar *vals, const char *op, PetscInt dim); 375 extern PetscErrorCode gs_free(gs_ADT gs_handle); 376 extern PetscErrorCode gs_init_msg_buf_sz(PetscInt buf_size); 377 extern PetscErrorCode gs_init_vec_sz(PetscInt size); 378 379 380 381 /*************************************xxt.h************************************ 382 Module Name: xxt 383 Module Info: need xxt.{c,h} gs.{c,h} comm.{c,h} ivec.{c,h} error.{c,h} 384 385 author: Henry M. Tufo III 386 e-mail: hmt@asci.uchicago.edu 387 contact: 388 +--------------------------------+--------------------------------+ 389 |MCS Division - Building 221 |Department of Computer Science | 390 |Argonne National Laboratory |Ryerson 152 | 391 |9700 S. Cass Avenue |The University of Chicago | 392 |Argonne, IL 60439 |Chicago, IL 60637 | 393 |(630) 252-5354/5986 ph/fx |(773) 702-6019/8487 ph/fx | 394 +--------------------------------+--------------------------------+ 395 396 Last Modification: 3.20.01 397 **************************************xxt.h***********************************/ 398 399 /*************************************xxt.h************************************ 400 File Description: 401 **************************************xxt.h***********************************/ 402 403 /*************************************xxt.h************************************ 404 Notes on Usage: 405 **************************************xxt.h***********************************/ 406 407 408 typedef struct xxt_CDT *xxt_ADT; 409 410 411 /*************************************xxt.h************************************ 412 Function: XXT_new() 413 414 Input : 415 Output: 416 Return: ADT ptr or NULL upon failure. 417 Description: This function allocates and returns an xxt handle 418 Usage: xxt_handle = xxt_new(); 419 **************************************xxt.h***********************************/ 420 extern xxt_ADT XXT_new(void); 421 422 423 /*************************************xxt.h************************************ 424 Function: XXT_free() 425 426 Input : pointer to ADT. 427 Output: 428 Return: 429 Description: This function frees the storage associated with an xxt handle 430 Usage: XXT_free(xxt_handle); 431 **************************************xxt.h***********************************/ 432 EXTERN PetscInt XXT_free(xxt_ADT xxt_handle); 433 434 435 /*************************************xxt.h************************************ 436 Function: XXT_factor 437 438 Input : ADT ptr, and pointer to object 439 Output: 440 Return: 0 on failure, 1 on success 441 Description: This function sets the xxt solver 442 443 xxt assumptions: given n rows of global coarse matrix (E_loc) where 444 o global dofs N = sum_p(n), p=0,P-1 445 (i.e. row dist. with no dof replication) 446 (5.21.00 will handle dif replication case) 447 o m is the number of columns in E_loc (m>=n) 448 o local2global holds global number of column i (i=0,...,m-1) 449 o local2global holds global number of row i (i=0,...,n-1) 450 o mylocmatvec performs E_loc . x_loc where x_loc is an vector of 451 length m in 1-1 correspondence with local2global 452 (note that gs package takes care of communication). 453 (note do not zero out upper m-n entries!) 454 o mylocmatvec(void *grid_data, double *in, double *out) 455 456 ML beliefs/usage: move this to to ML_XXT_factor routine 457 o my_ml holds address of ML struct associated w/E_loc, grid_data, grid_tag 458 o grid_tag, grid_data, my_ml used in 459 ML_Set_CSolve(my_ml, grid_tag, grid_data, ML_Do_CoarseDirect); 460 o grid_data used in 461 A_matvec(grid_data,v,u); 462 463 Usage: 464 **************************************xxt.h***********************************/ 465 extern PetscInt XXT_factor(xxt_ADT xxt_handle, /* prev. allocated xxt handle */ 466 PetscInt *local2global, /* global column mapping */ 467 PetscInt n, /* local num rows */ 468 PetscInt m, /* local num cols */ 469 void *mylocmatvec, /* b_loc=A_local.x_loc */ 470 void *grid_data /* grid data for matvec */ 471 ); 472 473 474 /*************************************xxt.h************************************ 475 Function: XXT_solve 476 477 Input : ADT ptr, b (rhs) 478 Output: x (soln) 479 Return: 480 Description: This function performs x = E^-1.b 481 Usage: 482 XXT_solve(xxt_handle, double *x, double *b) 483 XXT_solve(xxt_handle, double *x, NULL) 484 assumes x has been initialized to be b 485 **************************************xxt.h***********************************/ 486 extern PetscInt XXT_solve(xxt_ADT xxt_handle, double *x, double *b); 487 488 489 /*************************************xxt.h************************************ 490 Function: XXT_stats 491 492 Input : handle 493 Output: 494 Return: 495 Description: 496 factor stats 497 **************************************xxt.h***********************************/ 498 extern PetscInt XXT_stats(xxt_ADT xxt_handle); 499 500 501 /*************************************xxt.h************************************ 502 Function: XXT_sp_1() 503 504 Input : pointer to ADT 505 Output: 506 Return: 507 Description: sets xxt parameter 1 in xxt_handle 508 Usage: implement later 509 510 void XXT_sp_1(xxt_handle,parameter 1 value) 511 **************************************xxt.h***********************************/ 512 513 514 /*************************************xyt.h************************************ 515 Module Name: xyt 516 Module Info: need xyt.{c,h} gs.{c,h} comm.{c,h} ivec.{c,h} error.{c,h} 517 518 author: Henry M. Tufo III 519 e-mail: hmt@asci.uchicago.edu 520 contact: 521 +--------------------------------+--------------------------------+ 522 |MCS Division - Building 221 |Department of Computer Science | 523 |Argonne National Laboratory |Ryerson 152 | 524 |9700 S. Cass Avenue |The University of Chicago | 525 |Argonne, IL 60439 |Chicago, IL 60637 | 526 |(630) 252-5354/5986 ph/fx |(773) 702-6019/8487 ph/fx | 527 +--------------------------------+--------------------------------+ 528 529 Last Modification: 3.20.01 530 **************************************xyt.h***********************************/ 531 532 /*************************************xyt.h************************************ 533 File Description: 534 **************************************xyt.h***********************************/ 535 536 /*************************************xyt.h************************************ 537 Notes on Usage: 538 **************************************xyt.h***********************************/ 539 540 541 542 typedef struct xyt_CDT *xyt_ADT; 543 544 545 /*************************************xyt.h************************************ 546 Function: XYT_new() 547 548 Input : 549 Output: 550 Return: ADT ptr or NULL upon failure. 551 Description: This function allocates and returns an xyt handle 552 Usage: xyt_handle = xyt_new(); 553 **************************************xyt.h***********************************/ 554 extern xyt_ADT XYT_new(void); 555 556 557 /*************************************xyt.h************************************ 558 Function: XYT_free() 559 560 Input : pointer to ADT. 561 Output: 562 Return: 563 Description: This function frees the storage associated with an xyt handle 564 Usage: XYT_free(xyt_handle); 565 **************************************xyt.h***********************************/ 566 EXTERN PetscInt XYT_free(xyt_ADT xyt_handle); 567 568 569 /*************************************xyt.h************************************ 570 Function: XYT_factor 571 572 Input : ADT ptr, and pointer to object 573 Output: 574 Return: 0 on failure, 1 on success 575 Description: This function sets the xyt solver 576 577 xyt assumptions: given n rows of global coarse matrix (E_loc) where 578 o global dofs N = sum_p(n), p=0,P-1 579 (i.e. row dist. with no dof replication) 580 (5.21.00 will handle dif replication case) 581 o m is the number of columns in E_loc (m>=n) 582 o local2global holds global number of column i (i=0,...,m-1) 583 o local2global holds global number of row i (i=0,...,n-1) 584 o mylocmatvec performs E_loc . x_loc where x_loc is an vector of 585 length m in 1-1 correspondence with local2global 586 (note that gs package takes care of communication). 587 (note do not zero out upper m-n entries!) 588 o mylocmatvec(void *grid_data, double *in, double *out) 589 590 ML beliefs/usage: move this to to ML_XYT_factor routine 591 o my_ml holds address of ML struct associated w/E_loc, grid_data, grid_tag 592 o grid_tag, grid_data, my_ml used in 593 ML_Set_CSolve(my_ml, grid_tag, grid_data, ML_Do_CoarseDirect); 594 o grid_data used in 595 A_matvec(grid_data,v,u); 596 597 Usage: 598 **************************************xyt.h***********************************/ 599 extern PetscInt XYT_factor(xyt_ADT xyt_handle, /* prev. allocated xyt handle */ 600 PetscInt *local2global, /* global column mapping */ 601 PetscInt n, /* local num rows */ 602 PetscInt m, /* local num cols */ 603 void *mylocmatvec, /* b_loc=A_local.x_loc */ 604 void *grid_data /* grid data for matvec */ 605 ); 606 607 608 /*************************************xyt.h************************************ 609 Function: XYT_solve 610 611 Input : ADT ptr, b (rhs) 612 Output: x (soln) 613 Return: 614 Description: This function performs x = E^-1.b 615 Usage: XYT_solve(xyt_handle, double *x, double *b) 616 **************************************xyt.h***********************************/ 617 extern PetscInt XYT_solve(xyt_ADT xyt_handle, double *x, double *b); 618 619 620 /*************************************xyt.h************************************ 621 Function: XYT_stats 622 623 Input : handle 624 Output: 625 Return: 626 Description: 627 factor stats 628 **************************************xyt.h***********************************/ 629 extern PetscInt XYT_stats(xyt_ADT xyt_handle); 630 631 632 /*************************************xyt.h************************************ 633 Function: XYT_sp_1() 634 635 Input : pointer to ADT 636 Output: 637 Return: 638 Description: sets xyt parameter 1 in xyt_handle 639 Usage: implement later 640 641 PetscErrorCode XYT_sp_1(xyt_handle,parameter 1 value) 642 **************************************xyt.h***********************************/ 643 644 /********************************bit_mask.h************************************ 645 646 Author: Henry M. Tufo III 647 648 e-mail: hmt@cs.brown.edu 649 650 snail-mail: 651 Division of Applied Mathematics 652 Brown University 653 Providence, RI 02912 654 655 Last Modification: 656 11.21.97 657 *********************************bit_mask.h***********************************/ 658 659 /********************************bit_mask.h************************************ 660 File Description: 661 ----------------- 662 663 *********************************bit_mask.h***********************************/ 664 665 666 /********************************bit_mask.h************************************ 667 Function: 668 669 Input : 670 Output: 671 Return: 672 Description: 673 Usage: 674 *********************************bit_mask.h***********************************/ 675 extern PetscInt div_ceil(PetscInt numin, PetscInt denom); 676 extern PetscErrorCode set_bit_mask(PetscInt *bm, PetscInt len, PetscInt val); 677 extern PetscInt len_bit_mask(PetscInt num_items); 678 extern PetscInt ct_bits(char *ptr, PetscInt n); 679 extern PetscErrorCode bm_to_proc(char *ptr, PetscInt p_mask, PetscInt *msg_list); 680 extern PetscInt len_buf(PetscInt item_size, PetscInt num_items); 681 682 #endif 683 684