1 #if !defined(__PETSCSYSTYPES_H) 2 #define __PETSCSYSTYPES_H 3 4 #include <petscconf.h> 5 #include <petscfix.h> 6 7 /*MC 8 PetscErrorCode - datatype used for return error code from almost all PETSc functions 9 10 Level: beginner 11 12 .seealso: CHKERRQ, SETERRQ 13 M*/ 14 typedef int PetscErrorCode; 15 16 /*MC 17 18 PetscClassId - A unique id used to identify each PETSc class. 19 20 Notes: 21 Use PetscClassIdRegister() to obtain a new value for a new class being created. Usually 22 XXXInitializePackage() calls it for each class it defines. 23 24 Developer Notes: 25 Internal integer stored in the _p_PetscObject data structure. 26 These are all computed by an offset from the lowest one, PETSC_SMALLEST_CLASSID. 27 28 Level: developer 29 30 .seealso: PetscClassIdRegister(), PetscLogEventRegister(), PetscHeaderCreate() 31 M*/ 32 typedef int PetscClassId; 33 34 /*MC 35 PetscMPIInt - datatype used to represent 'int' parameters to MPI functions. 36 37 Level: intermediate 38 39 Notes: 40 usually this is the same as PetscInt, but if PETSc was built with --with-64-bit-indices but 41 standard C/Fortran integers are 32 bit then this is NOT the same as PetscInt; it remains 32 bit. 42 43 PetscMPIIntCast(a,&b) checks if the given PetscInt a will fit in a PetscMPIInt, if not it 44 generates a PETSC_ERR_ARG_OUTOFRANGE error. 45 46 .seealso: PetscBLASInt, PetscInt, PetscMPIIntCast() 47 48 M*/ 49 typedef int PetscMPIInt; 50 51 /*MC 52 PetscEnum - datatype used to pass enum types within PETSc functions. 53 54 Level: intermediate 55 56 .seealso: PetscOptionsGetEnum(), PetscOptionsEnum(), PetscBagRegisterEnum() 57 M*/ 58 typedef enum { ENUM_DUMMY } PetscEnum; 59 60 typedef short PetscShort; 61 typedef char PetscChar; 62 typedef float PetscFloat; 63 64 /*MC 65 PetscInt - PETSc type that represents an integer, used primarily to 66 represent size of arrays and indexing into arrays. Its size can be configured with the option --with-64-bit-indices to be either 32-bit (default) or 64-bit. 67 68 Notes: 69 For MPI calls that require datatypes, use MPIU_INT as the datatype for PetscInt. It will automatically work correctly regardless of the size of PetscInt. 70 71 Level: beginner 72 73 .seealso: PetscBLASInt, PetscMPIInt, PetscReal, PetscScalar, PetscComplex, PetscInt, MPIU_REAL, MPIU_SCALAR, MPIU_COMPLEX, MPIU_INT 74 M*/ 75 76 #if defined(PETSC_HAVE_STDINT_H) 77 # include <stdint.h> 78 #endif 79 #if defined (PETSC_HAVE_INTTYPES_H) 80 # if !defined(__STDC_FORMAT_MACROS) 81 # define __STDC_FORMAT_MACROS /* required for using PRId64 from c++ */ 82 # endif 83 # include <inttypes.h> 84 # if !defined(PRId64) 85 # define PRId64 "ld" 86 # endif 87 #endif 88 89 #if defined(PETSC_HAVE_STDINT_H) && defined(PETSC_HAVE_INTTYPES_H) && defined(PETSC_HAVE_MPI_INT64_T) /* MPI_INT64_T is not guaranteed to be a macro */ 90 typedef int64_t PetscInt64; 91 #elif (PETSC_SIZEOF_LONG_LONG == 8) 92 typedef long long PetscInt64; 93 #elif defined(PETSC_HAVE___INT64) 94 typedef __int64 PetscInt64; 95 #else 96 # error "cannot determine PetscInt64 type" 97 #endif 98 99 #if defined(PETSC_USE_64BIT_INDICES) 100 typedef PetscInt64 PetscInt; 101 #else 102 typedef int PetscInt; 103 #endif 104 105 /*MC 106 PetscBLASInt - datatype used to represent 'int' parameters to BLAS/LAPACK functions. 107 108 Notes: 109 Usually this is the same as PetscInt, but if PETSc was built with --with-64-bit-indices but 110 standard C/Fortran integers are 32 bit then this is NOT the same as PetscInt it remains 32 bit 111 (except on very rare BLAS/LAPACK implementations that support 64 bit integers see the notes below). 112 113 PetscErrorCode PetscBLASIntCast(a,&b) checks if the given PetscInt a will fit in a PetscBLASInt, if not it 114 generates a PETSC_ERR_ARG_OUTOFRANGE error 115 116 Installation Notes: 117 ./configure automatically determines the size of the integers used by BLAS/LAPACK except when --with-batch is used 118 in that situation one must know (by some other means) if the integers used by BLAS/LAPACK are 64 bit and if so pass the flag --known-64-bit-blas-indice 119 120 MATLAB ships with BLAS and LAPACK that use 64 bit integers, for example if you run ./configure with, the option 121 --with-blaslapack-lib=[/Applications/MATLAB_R2010b.app/bin/maci64/libmwblas.dylib,/Applications/MATLAB_R2010b.app/bin/maci64/libmwlapack.dylib] 122 123 MKL ships with both 32 and 64 bit integer versions of the BLAS and LAPACK. If you pass the flag -with-64-bit-blas-indices PETSc will link 124 against the 64 bit version, otherwise it use the 32 bit version 125 126 OpenBLAS can be built to use 64 bit integers. The ./configure options --download-openblas -with-64-bit-blas-indices will build a 64 bit integer version 127 128 External packages such as hypre, ML, SuperLU etc do not provide any support for passing 64 bit integers to BLAS/LAPACK so cannot 129 be used with PETSc when PETSc links against 64 bit integer BLAS/LAPACK. ./configure will generate an error if you attempt to link PETSc against any of 130 these external libraries while using 64 bit integer BLAS/LAPACK. 131 132 Level: intermediate 133 134 .seealso: PetscMPIInt, PetscInt, PetscBLASIntCast() 135 136 M*/ 137 #if defined(PETSC_HAVE_64BIT_BLAS_INDICES) 138 typedef PetscInt64 PetscBLASInt; 139 #else 140 typedef int PetscBLASInt; 141 #endif 142 143 /*E 144 PetscBool - Logical variable. Actually an int in C and a logical in Fortran. 145 146 Level: beginner 147 148 Developer Note: 149 Why have PetscBool , why not use bool in C? The problem is that K and R C, C99 and C++ all have different mechanisms for 150 boolean values. It is not easy to have a simple macro that that will work properly in all circumstances with all three mechanisms. 151 152 .seealso: PETSC_TRUE, PETSC_FALSE, PetscNot() 153 E*/ 154 typedef enum { PETSC_FALSE,PETSC_TRUE } PetscBool; 155 156 /*MC 157 PetscReal - PETSc type that represents a real number version of PetscScalar 158 159 160 Notes: 161 For MPI calls that require datatypes, use MPIU_REAL as the datatype for PetscScalar and MPIU_SUM, MPIU_MAX, etc. for operations. 162 They will automatically work correctly regardless of the size of PetscReal. 163 164 See PetscScalar for details on how to ./configure the size of PetscReal. 165 166 Level: beginner 167 168 .seealso: PetscScalar, PetscComplex, PetscInt, MPIU_REAL, MPIU_SCALAR, MPIU_COMPLEX, MPIU_INT 169 M*/ 170 171 #if defined(PETSC_USE_REAL_SINGLE) 172 typedef float PetscReal; 173 #elif defined(PETSC_USE_REAL_DOUBLE) 174 typedef double PetscReal; 175 #elif defined(PETSC_USE_REAL___FLOAT128) 176 # if defined(__cplusplus) 177 extern "C" { 178 # endif 179 # include <quadmath.h> 180 # if defined(__cplusplus) 181 } 182 # endif 183 typedef __float128 PetscReal; 184 #elif defined(PETSC_USE_REAL___FP16) 185 typedef __fp16 PetscReal; 186 #endif /* PETSC_USE_REAL_* */ 187 188 /*MC 189 PetscComplex - PETSc type that represents a complex number with precision matching that of PetscReal. 190 191 Synopsis: 192 #include <petscsys.h> 193 PetscComplex number = 1. + 2.*PETSC_i; 194 195 Notes: 196 For MPI calls that require datatypes, use MPIU_COMPLEX as the datatype for PetscComplex and MPIU_SUM etc for operations. 197 They will automatically work correctly regardless of the size of PetscComplex. 198 199 See PetscScalar for details on how to ./configure the size of PetscReal 200 201 Complex numbers are automatically available if PETSc was able to find a working complex implementation 202 203 Level: beginner 204 205 .seealso: PetscReal, PetscScalar, PetscComplex, PetscInt, MPIU_REAL, MPIU_SCALAR, MPIU_COMPLEX, MPIU_INT, PETSC_i 206 M*/ 207 208 #if defined(__cplusplus) && defined(PETSC_HAVE_CXX_COMPLEX) && !defined(PETSC_USE_REAL___FLOAT128) 209 # if !defined(PETSC_SKIP_COMPLEX) 210 /* C++ support of complex number */ 211 # define PETSC_HAVE_COMPLEX 1 212 # if defined(PETSC_HAVE_CUDA) && __CUDACC_VER_MAJOR__ > 6 213 /* complex headers in thrust only available in CUDA 7.0 and above */ 214 # define petsccomplexlib thrust 215 # include <thrust/complex.h> 216 # else 217 # define petsccomplexlib std 218 # include <complex> 219 # endif 220 # if defined(PETSC_USE_REAL_SINGLE) 221 typedef petsccomplexlib::complex<float> PetscComplex; 222 # elif defined(PETSC_USE_REAL_DOUBLE) 223 typedef petsccomplexlib::complex<double> PetscComplex; 224 # elif defined(PETSC_USE_REAL___FLOAT128) 225 typedef petsccomplexlib::complex<__float128> PetscComplex; /* Notstandard and not expected to work, use __complex128 */ 226 # endif /* PETSC_USE_REAL_ */ 227 # endif /* ! PETSC_SKIP_COMPLEX */ 228 #elif defined(PETSC_HAVE_C99_COMPLEX) && !defined(PETSC_USE_REAL___FP16) 229 # if !defined(PETSC_SKIP_COMPLEX) 230 # define PETSC_HAVE_COMPLEX 1 231 # include <complex.h> 232 # if defined(PETSC_USE_REAL_SINGLE) || defined(PETSC_USE_REAL___FP16) 233 typedef float _Complex PetscComplex; 234 # elif defined(PETSC_USE_REAL_DOUBLE) 235 typedef double _Complex PetscComplex; 236 # elif defined(PETSC_USE_REAL___FLOAT128) 237 typedef __complex128 PetscComplex; 238 # endif /* PETSC_USE_REAL_* */ 239 # endif /* !PETSC_SKIP_COMPLEX */ 240 #elif (defined(PETSC_USE_COMPLEX) && !defined(PETSC_SKIP_COMPLEX)) 241 # error "PETSc was configured --with-scalar-type=complex, but a language-appropriate complex library is not available" 242 #endif /* !PETSC_SKIP_COMPLEX */ 243 244 /*MC 245 PetscScalar - PETSc type that represents either a double precision real number, a double precision 246 complex number, a single precision real number, a __float128 real or complex or a __fp16 real - if the code is configured 247 with --with-scalar-type=real,complex --with-precision=single,double,__float128,__fp16 248 249 Notes: 250 For MPI calls that require datatypes, use MPIU_SCALAR as the datatype for PetscScalar and MPIU_SUM, MPIU_MAX etc for operations. They will automatically work correctly regardless of the size of PetscScalar. 251 252 Level: beginner 253 254 .seealso: PetscReal, PetscComplex, PetscInt, MPIU_REAL, MPIU_SCALAR, MPIU_COMPLEX, MPIU_INT, PetscRealPart(), PetscImaginaryPart() 255 M*/ 256 257 #if (defined(PETSC_USE_COMPLEX) && !defined(PETSC_SKIP_COMPLEX)) 258 typedef PetscComplex PetscScalar; 259 #else /* PETSC_USE_COMPLEX */ 260 typedef PetscReal PetscScalar; 261 #endif /* PETSC_USE_COMPLEX */ 262 263 /*E 264 PetscCopyMode - Determines how an array passed to certain functions is copied or retained 265 266 Level: beginner 267 268 $ PETSC_COPY_VALUES - the array values are copied into new space, the user is free to reuse or delete the passed in array 269 $ PETSC_OWN_POINTER - the array values are NOT copied, the object takes ownership of the array and will free it later, the user cannot change or 270 $ delete the array. The array MUST have been obtained with PetscMalloc(). Hence this mode cannot be used in Fortran. 271 $ PETSC_USE_POINTER - the array values are NOT copied, the object uses the array but does NOT take ownership of the array. The user cannot use 272 the array but the user must delete the array after the object is destroyed. 273 274 E*/ 275 typedef enum {PETSC_COPY_VALUES, PETSC_OWN_POINTER, PETSC_USE_POINTER} PetscCopyMode; 276 277 /*MC 278 PETSC_FALSE - False value of PetscBool 279 280 Level: beginner 281 282 Note: 283 Zero integer 284 285 .seealso: PetscBool, PETSC_TRUE 286 M*/ 287 288 /*MC 289 PETSC_TRUE - True value of PetscBool 290 291 Level: beginner 292 293 Note: 294 Nonzero integer 295 296 .seealso: PetscBool, PETSC_FALSE 297 M*/ 298 299 /*MC 300 PetscLogDouble - Used for logging times 301 302 Notes: 303 Contains double precision numbers that are not used in the numerical computations, but rather in logging, timing etc. 304 305 Level: developer 306 307 M*/ 308 typedef double PetscLogDouble; 309 310 /*E 311 PetscDataType - Used for handling different basic data types. 312 313 Level: beginner 314 315 Notes: 316 Use of this should be avoided if one can directly use MPI_Datatype instead. 317 318 Developer comment: 319 It would be nice if we could always just use MPI Datatypes, why can we not? 320 321 If you change any values in PetscDatatype make sure you update their usage in 322 share/petsc/matlab/PetscBagRead.m 323 324 .seealso: PetscBinaryRead(), PetscBinaryWrite(), PetscDataTypeToMPIDataType(), 325 PetscDataTypeGetSize() 326 327 E*/ 328 typedef enum {PETSC_DATATYPE_UNKNOWN = 0, 329 PETSC_DOUBLE = 1, PETSC_COMPLEX = 2, PETSC_LONG = 3, PETSC_SHORT = 4, PETSC_FLOAT = 5, 330 PETSC_CHAR = 6, PETSC_BIT_LOGICAL = 7, PETSC_ENUM = 8, PETSC_BOOL = 9, PETSC___FLOAT128 = 10, 331 PETSC_OBJECT = 11, PETSC_FUNCTION = 12, PETSC_STRING = 13, PETSC___FP16 = 14, PETSC_STRUCT = 15, 332 PETSC_INT = 16, PETSC_INT64 = 17} PetscDataType; 333 334 #if defined(PETSC_USE_COMPLEX) 335 # define PETSC_SCALAR PETSC_COMPLEX 336 #else 337 # if defined(PETSC_USE_REAL_SINGLE) 338 # define PETSC_SCALAR PETSC_FLOAT 339 # elif defined(PETSC_USE_REAL___FLOAT128) 340 # define PETSC_SCALAR PETSC___FLOAT128 341 # elif defined(PETSC_USE_REAL___FP16) 342 # define PETSC_SCALAR PETSC___FP16 343 # else 344 # define PETSC_SCALAR PETSC_DOUBLE 345 # endif 346 #endif 347 #if defined(PETSC_USE_REAL_SINGLE) 348 # define PETSC_REAL PETSC_FLOAT 349 #elif defined(PETSC_USE_REAL___FLOAT128) 350 # define PETSC_REAL PETSC___FLOAT128 351 #elif defined(PETSC_USE_REAL___FP16) 352 # define PETSC_REAL PETSC___FP16 353 #else 354 # define PETSC_REAL PETSC_DOUBLE 355 #endif 356 #define PETSC_FORTRANADDR PETSC_LONG 357 358 /*S 359 PetscToken - 'Token' used for managing tokenizing strings 360 361 Level: intermediate 362 363 .seealso: PetscTokenCreate(), PetscTokenFind(), PetscTokenDestroy() 364 S*/ 365 typedef struct _p_PetscToken* PetscToken; 366 367 /*S 368 PetscObject - any PETSc object, PetscViewer, Mat, Vec, KSP etc 369 370 Level: beginner 371 372 Note: 373 This is the base class from which all PETSc objects are derived from. 374 375 .seealso: PetscObjectDestroy(), PetscObjectView(), PetscObjectGetName(), PetscObjectSetName(), PetscObjectReference(), PetscObjectDereference() 376 S*/ 377 typedef struct _p_PetscObject* PetscObject; 378 379 /*MC 380 PetscObjectId - unique integer Id for a PetscObject 381 382 Level: developer 383 384 Notes: 385 Unlike pointer values, object ids are never reused. 386 387 .seealso: PetscObjectState, PetscObjectGetId() 388 M*/ 389 #if defined(PETSC_USING_F90) && !defined(PETSC_USE_FORTRANKIND) /* compaq F90 */ 390 typedef int PetscObjectId; 391 #else 392 typedef PetscInt64 PetscObjectId; 393 #endif 394 395 /*MC 396 PetscObjectState - integer state for a PetscObject 397 398 Level: developer 399 400 Notes: 401 Object state is always-increasing and (for objects that track state) can be used to determine if an object has 402 changed since the last time you interacted with it. It is 64-bit so that it will not overflow for a very long time. 403 404 .seealso: PetscObjectId, PetscObjectStateGet(), PetscObjectStateIncrease(), PetscObjectStateSet() 405 M*/ 406 #if defined(PETSC_USING_F90) && !defined(PETSC_USE_FORTRANKIND) /* compaq F90 */ 407 typedef int PetscObjectState; 408 #else 409 typedef PetscInt64 PetscObjectState; 410 #endif 411 412 /*S 413 PetscFunctionList - Linked list of functions, possibly stored in dynamic libraries, accessed 414 by string name 415 416 Level: advanced 417 418 .seealso: PetscFunctionListAdd(), PetscFunctionListDestroy(), PetscOpFlist 419 S*/ 420 typedef struct _n_PetscFunctionList *PetscFunctionList; 421 422 /*E 423 PetscFileMode - Access mode for a file. 424 425 Level: beginner 426 427 $ FILE_MODE_READ - open a file at its beginning for reading 428 $ FILE_MODE_WRITE - open a file at its beginning for writing (will create if the file does not exist) 429 $ FILE_MODE_APPEND - open a file at end for writing 430 $ FILE_MODE_UPDATE - open a file for updating, meaning for reading and writing 431 $ FILE_MODE_APPEND_UPDATE - open a file for updating, meaning for reading and writing, at the end 432 433 .seealso: PetscViewerFileSetMode() 434 E*/ 435 typedef enum {FILE_MODE_READ, FILE_MODE_WRITE, FILE_MODE_APPEND, FILE_MODE_UPDATE, FILE_MODE_APPEND_UPDATE} PetscFileMode; 436 437 typedef void* PetscDLHandle; 438 typedef enum {PETSC_DL_DECIDE=0,PETSC_DL_NOW=1,PETSC_DL_LOCAL=2} PetscDLMode; 439 440 /*S 441 PetscObjectList - Linked list of PETSc objects, each accessable by string name 442 443 Level: developer 444 445 Notes: 446 Used by PetscObjectCompose() and PetscObjectQuery() 447 448 .seealso: PetscObjectListAdd(), PetscObjectListDestroy(), PetscObjectListFind(), PetscObjectCompose(), PetscObjectQuery(), PetscFunctionList 449 S*/ 450 typedef struct _n_PetscObjectList *PetscObjectList; 451 452 /*S 453 PetscDLLibrary - Linked list of dynamics libraries to search for functions 454 455 Level: advanced 456 457 .seealso: PetscDLLibraryOpen() 458 S*/ 459 typedef struct _n_PetscDLLibrary *PetscDLLibrary; 460 461 /*S 462 PetscContainer - Simple PETSc object that contains a pointer to any required data 463 464 Level: advanced 465 466 .seealso: PetscObject, PetscContainerCreate() 467 S*/ 468 typedef struct _p_PetscContainer* PetscContainer; 469 470 /*S 471 PetscRandom - Abstract PETSc object that manages generating random numbers 472 473 Level: intermediate 474 475 Concepts: random numbers 476 477 .seealso: PetscRandomCreate(), PetscRandomGetValue(), PetscRandomType 478 S*/ 479 typedef struct _p_PetscRandom* PetscRandom; 480 481 /* 482 In binary files variables are stored using the following lengths, 483 regardless of how they are stored in memory on any one particular 484 machine. Use these rather then sizeof() in computing sizes for 485 PetscBinarySeek(). 486 */ 487 #define PETSC_BINARY_INT_SIZE (32/8) 488 #define PETSC_BINARY_FLOAT_SIZE (32/8) 489 #define PETSC_BINARY_CHAR_SIZE (8/8) 490 #define PETSC_BINARY_SHORT_SIZE (16/8) 491 #define PETSC_BINARY_DOUBLE_SIZE (64/8) 492 #define PETSC_BINARY_SCALAR_SIZE sizeof(PetscScalar) 493 494 /*E 495 PetscBinarySeekType - argument to PetscBinarySeek() 496 497 Level: advanced 498 499 .seealso: PetscBinarySeek(), PetscBinarySynchronizedSeek() 500 E*/ 501 typedef enum {PETSC_BINARY_SEEK_SET = 0,PETSC_BINARY_SEEK_CUR = 1,PETSC_BINARY_SEEK_END = 2} PetscBinarySeekType; 502 503 /*E 504 PetscBuildTwoSidedType - algorithm for setting up two-sided communication 505 506 $ PETSC_BUILDTWOSIDED_ALLREDUCE - classical algorithm using an MPI_Allreduce with 507 $ a buffer of length equal to the communicator size. Not memory-scalable due to 508 $ the large reduction size. Requires only MPI-1. 509 $ PETSC_BUILDTWOSIDED_IBARRIER - nonblocking algorithm based on MPI_Issend and MPI_Ibarrier. 510 $ Proved communication-optimal in Hoefler, Siebert, and Lumsdaine (2010). Requires MPI-3. 511 $ PETSC_BUILDTWOSIDED_REDSCATTER - similar to above, but use more optimized function 512 $ that only communicates the part of the reduction that is necessary. Requires MPI-2. 513 514 Level: developer 515 516 .seealso: PetscCommBuildTwoSided(), PetscCommBuildTwoSidedSetType(), PetscCommBuildTwoSidedGetType() 517 E*/ 518 typedef enum { 519 PETSC_BUILDTWOSIDED_NOTSET = -1, 520 PETSC_BUILDTWOSIDED_ALLREDUCE = 0, 521 PETSC_BUILDTWOSIDED_IBARRIER = 1, 522 PETSC_BUILDTWOSIDED_REDSCATTER = 2 523 /* Updates here must be accompanied by updates in finclude/petscsys.h and the string array in mpits.c */ 524 } PetscBuildTwoSidedType; 525 526 /*E 527 InsertMode - Whether entries are inserted or added into vectors or matrices 528 529 Level: beginner 530 531 .seealso: VecSetValues(), MatSetValues(), VecSetValue(), VecSetValuesBlocked(), 532 VecSetValuesLocal(), VecSetValuesBlockedLocal(), MatSetValuesBlocked(), 533 MatSetValuesBlockedLocal(), MatSetValuesLocal(), VecScatterBegin(), VecScatterEnd() 534 E*/ 535 typedef enum {NOT_SET_VALUES, INSERT_VALUES, ADD_VALUES, MAX_VALUES, INSERT_ALL_VALUES, ADD_ALL_VALUES, INSERT_BC_VALUES, ADD_BC_VALUES} InsertMode; 536 537 /*MC 538 INSERT_VALUES - Put a value into a vector or matrix, overwrites any previous value 539 540 Level: beginner 541 542 .seealso: InsertMode, VecSetValues(), MatSetValues(), VecSetValue(), VecSetValuesBlocked(), 543 VecSetValuesLocal(), VecSetValuesBlockedLocal(), MatSetValuesBlocked(), ADD_VALUES, 544 MatSetValuesBlockedLocal(), MatSetValuesLocal(), VecScatterBegin(), VecScatterEnd(), MAX_VALUES 545 546 M*/ 547 548 /*MC 549 ADD_VALUES - Adds a value into a vector or matrix, if there previously was no value, just puts the 550 value into that location 551 552 Level: beginner 553 554 .seealso: InsertMode, VecSetValues(), MatSetValues(), VecSetValue(), VecSetValuesBlocked(), 555 VecSetValuesLocal(), VecSetValuesBlockedLocal(), MatSetValuesBlocked(), INSERT_VALUES, 556 MatSetValuesBlockedLocal(), MatSetValuesLocal(), VecScatterBegin(), VecScatterEnd(), MAX_VALUES 557 558 M*/ 559 560 /*MC 561 MAX_VALUES - Puts the maximum of the scattered/gathered value and the current value into each location 562 563 Level: beginner 564 565 .seealso: InsertMode, VecScatterBegin(), VecScatterEnd(), ADD_VALUES, INSERT_VALUES 566 567 M*/ 568 569 /*S 570 PetscSubcomm - A decomposition of an MPI communicator into subcommunicators 571 572 Notes: 573 After a call to PetscSubcommSetType(), PetscSubcommSetTypeGeneral(), or PetscSubcommSetFromOptions() one may call 574 $ PetscSubcommChild() returns the associated subcommunicator on this process 575 $ PetscSubcommContiguousParent() returns a parent communitor but with all child of the same subcommunicator having contiguous rank 576 577 Sample Usage: 578 PetscSubcommCreate() 579 PetscSubcommSetNumber() 580 PetscSubcommSetType(PETSC_SUBCOMM_INTERLACED); 581 ccomm = PetscSubcommChild() 582 PetscSubcommDestroy() 583 584 Level: advanced 585 586 Concepts: communicator, create 587 588 Notes: 589 $ PETSC_SUBCOMM_GENERAL - similar to MPI_Comm_split() each process sets the new communicator (color) they will belong to and the order within that communicator 590 $ PETSC_SUBCOMM_CONTIGUOUS - each new communicator contains a set of process with contiguous ranks in the original MPI communicator 591 $ PETSC_SUBCOMM_INTERLACED - each new communictor contains a set of processes equally far apart in rank from the others in that new communicator 592 593 Example: Consider a communicator with six processes split into 3 subcommunicators. 594 $ PETSC_SUBCOMM_CONTIGUOUS - the first communicator contains rank 0,1 the second rank 2,3 and the third rank 4,5 in the original ordering of the original communicator 595 $ PETSC_SUBCOMM_INTERLACED - the first communicator contains rank 0,3, the second 1,4 and the third 2,5 596 597 Developer Notes: 598 This is used in objects such as PCREDUNDANT to manage the subcommunicators on which the redundant computations 599 are performed. 600 601 602 .seealso: PetscSubcommCreate(), PetscSubcommSetNumber(), PetscSubcommSetType(), PetscSubcommView(), PetscSubcommSetFromOptions() 603 604 S*/ 605 typedef struct _n_PetscSubcomm* PetscSubcomm; 606 typedef enum {PETSC_SUBCOMM_GENERAL=0,PETSC_SUBCOMM_CONTIGUOUS=1,PETSC_SUBCOMM_INTERLACED=2} PetscSubcommType; 607 608 /*S 609 PetscHeap - A simple class for managing heaps 610 611 Level: intermediate 612 613 Concepts: random numbers 614 615 .seealso: PetscHeapCreate(), PetscHeapAdd(), PetscHeapPop(), PetscHeapPeek(), PetscHeapStash(), PetscHeapUnstash(), PetscHeapView(), PetscHeapDestroy() 616 S*/ 617 typedef struct _PetscHeap *PetscHeap; 618 619 typedef struct _n_PetscShmComm* PetscShmComm; 620 typedef struct _n_PetscOmpCtrl* PetscOmpCtrl; 621 622 /*S 623 PetscSegBuffer - a segmented extendable buffer 624 625 Level: developer 626 627 .seealso: PetscSegBufferCreate(), PetscSegBufferGet(), PetscSegBufferExtract(), PetscSegBufferDestroy() 628 S*/ 629 typedef struct _n_PetscSegBuffer *PetscSegBuffer; 630 631 typedef struct _n_PetscOptionsHelpPrinted *PetscOptionsHelpPrinted; 632 633 #endif 634