Utilities (PetscRandom, PetscLayout, Subcommunicators, ...) - Low-level Interface
Small helper classes used throughout PETSc:
- PetscRandom: parallel random number generators
- PetscLayout: the parallel row distribution of vectors and matrices
- PetscSubcomm / PetscShmComm: splitting a communicator, shared-memory communicators
- PetscBag: option-settable parameter structs
- PetscToken: string tokenizer
- PetscSegBuffer, PetscHeap, PetscIntStack: growable buffers, heaps and stacks
- PetscKDTree, PetscGridHash: spatial search structures used by
DMPlex/DMSwarm - PetscOmpCtrl, PetscMatlabEngine, PetscBench: OpenMP control, MATLAB engine, benchmarks
Basic Usage
using PETSc, MPI
MPI.Init()
petsclib = PETSc.getlib()
PETSc.initialize(petsclib)
# Random numbers in [0, 10)
rnd = LibPETSc.PetscRandomCreate(petsclib, MPI.COMM_SELF)
LibPETSc.PetscRandomSetType(petsclib, rnd, LibPETSc.PETSCRANDER48)
LibPETSc.PetscRandomSetInterval(petsclib, rnd, 0.0, 10.0)
x = LibPETSc.PetscRandomGetValue(petsclib, rnd) # PetscScalar
LibPETSc.PetscRandomDestroy(petsclib, rnd)
# Parallel layout of 100 rows
layout = LibPETSc.PetscLayoutCreate(petsclib, MPI.COMM_WORLD)
LibPETSc.PetscLayoutSetSize(petsclib, layout, 100)
LibPETSc.PetscLayoutSetUp(petsclib, layout)
rstart, rend = LibPETSc.PetscLayoutGetRange(petsclib, layout) # rows owned by this rank
LibPETSc.PetscLayoutDestroy(petsclib, layout)
PETSc.finalize(petsclib)Function Reference
PetscRandom
PETSc.LibPETSc.PetscRandomCreate — Method
r::PetscRandom = PetscRandomCreate(petsclib::PetscLibType, comm::MPI_Comm)Creates an object for generating random numbers, and initializes the random-number generator.
Collective
Input Parameter:
comm- MPI communicator
Output Parameter:
r- the random number generator object
Level: intermediate
See also: PetscRandomSetType(), PetscRandomGetValue(), PetscRandomGetValueReal(), PetscRandomSetInterval(), PetscRandomDestroy(), VecSetRandom(), PetscRandomType, PetscRandom
External Links
- PETSc Manual:
Sys/PetscRandomCreate
PETSc.LibPETSc.PetscRandomDestroy — Method
PetscRandomDestroy(petsclib::PetscLibType, r::Union{PetscRandom, Ref{PetscRandom}})Destroys a PetscRandom object that was created by PetscRandomCreate().
Collective
Input Parameter:
r- the random number generator object
Level: intermediate
See also: PetscRandom, PetscRandomGetValue(), PetscRandomCreate(), VecSetRandom()
External Links
- PETSc Manual:
Sys/PetscRandomDestroy
PETSc.LibPETSc.PetscRandomFinalizePackage — Method
PetscRandomFinalizePackage(petsclib::PetscLibType)This function frees everything in the PetscRandom package. It is called from PetscFinalize().
Level: developer
See also: PetscFinalize()
External Links
- PETSc Manual:
Sys/PetscRandomFinalizePackage
PETSc.LibPETSc.PetscRandomGetInterval — Method
low::PetscScalar,high::PetscScalar = PetscRandomGetInterval(petsclib::PetscLibType, r::PetscRandom)Gets the interval over which the random numbers will be distributed. By default, this interval is [0,1).
Not Collective
Input Parameter:
r- the random number generator context
Output Parameters:
low- The lower bound of the intervalhigh- The upper bound of the interval
Level: intermediate
See also: PetscRandom, PetscRandomCreate(), PetscRandomSetInterval()
External Links
- PETSc Manual:
Sys/PetscRandomGetInterval
PETSc.LibPETSc.PetscRandomGetSeed — Method
seed::PetscInt64 = PetscRandomGetSeed(petsclib::PetscLibType, r::PetscRandom)Gets the random seed.
Not collective
Input Parameter:
r- The random number generator context
Output Parameter:
seed- The random seed
Level: intermediate
See also: PetscRandom, PetscRandomCreate(), PetscRandomSetSeed(), PetscRandomSeed()
External Links
- PETSc Manual:
Sys/PetscRandomGetSeed
PETSc.LibPETSc.PetscRandomGetType — Method
type::String = PetscRandomGetType(petsclib::PetscLibType, rnd::PetscRandom)Gets the type name (as a string) from the PetscRandom.
Not Collective
Input Parameter:
rnd- The random number generator context
Output Parameter:
type- The type name
Level: intermediate
See also: PetscRandom, PetscRandomType, PetscRandomSetType(), PetscRandomCreate()
External Links
- PETSc Manual:
Sys/PetscRandomGetType
PETSc.LibPETSc.PetscRandomGetValue — Method
val::PetscScalar = PetscRandomGetValue(petsclib::PetscLibType, r::PetscRandom)Generates a random number. Call this after first calling PetscRandomCreate().
Not Collective
Input Parameter:
r- the random number generator context
Output Parameter:
val- the value
Level: intermediate
See also: PetscRandom, PetscRandomCreate(), PetscRandomDestroy(), VecSetRandom(), PetscRandomGetValueReal(), PetscRandomSetInterval()
External Links
- PETSc Manual:
Sys/PetscRandomGetValue
PETSc.LibPETSc.PetscRandomGetValueReal — Method
val::PetscReal = PetscRandomGetValueReal(petsclib::PetscLibType, r::PetscRandom)Generates a real random number. Call this after first calling PetscRandomCreate().
Not Collective
Input Parameter:
r- the random number generator context
Output Parameter:
val- the value
Level: intermediate
See also: PetscRandom, PetscRandomCreate(), PetscRandomDestroy(), VecSetRandom(), PetscRandomGetValue()
External Links
- PETSc Manual:
Sys/PetscRandomGetValueReal
PETSc.LibPETSc.PetscRandomGetValues — Method
val::PetscScalar = PetscRandomGetValues(petsclib::PetscLibType, r::PetscRandom, n::PetscInt)Generates a sequence of random numbers. Call this after first calling PetscRandomCreate().
Not Collective
Input Parameters:
r- the random number generator contextn- number of random numbers to generate
Output Parameter:
val- the array to hold the values
Level: intermediate
See also: PetscRandom, PetscRandomCreate(), PetscRandomDestroy(), VecSetRandom(), PetscRandomGetValue()
External Links
- PETSc Manual:
Sys/PetscRandomGetValues
PETSc.LibPETSc.PetscRandomGetValuesReal — Method
val::PetscReal = PetscRandomGetValuesReal(petsclib::PetscLibType, r::PetscRandom, n::PetscInt)Generates a sequence of real random numbers. Call this after first calling PetscRandomCreate().
Not Collective
Input Parameters:
r- the random number generator contextn- number of random numbers to generate
Output Parameter:
val- the array to hold the values
Level: intermediate
See also: PetscRandom, PetscRandomCreate(), PetscRandomDestroy(), VecSetRandom(), PetscRandomGetValues()
External Links
- PETSc Manual:
Sys/PetscRandomGetValuesReal
PETSc.LibPETSc.PetscRandomInitializePackage — Method
PetscRandomInitializePackage(petsclib::PetscLibType)This function initializes everything in the PetscRandom package. It is called from PetscDLLibraryRegister_petsc() when using dynamic libraries, and on the first call to PetscRandomCreate() when using shared or static libraries.
Level: developer
See also: PetscInitialize()
External Links
- PETSc Manual:
Sys/PetscRandomInitializePackage
PETSc.LibPETSc.PetscRandomRegister — Method
PetscRandomRegister(petsclib::PetscLibType, sname::String, fnc::external)Adds a new PetscRandom implementation
Not Collective, No Fortran Support
Input Parameters:
sname- The name of a new user-defined creation routinefunction- The creation routine
Level: advanced
See also: PetscRandom, PetscRandomRegisterAll(), PetscRandomRegisterDestroy()
External Links
- PETSc Manual:
Sys/PetscRandomRegister
PETSc.LibPETSc.PetscRandomSeed — Method
PetscRandomSeed(petsclib::PetscLibType, r::PetscRandom)Seed the random number generator.
Not collective
Input Parameter:
r- The random number generator context
Level: intermediate
See also: PetscRandomCreate(), PetscRandomGetSeed(), PetscRandomSetSeed()
External Links
- PETSc Manual:
Sys/PetscRandomSeed
PETSc.LibPETSc.PetscRandomSetFromOptions — Method
PetscRandomSetFromOptions(petsclib::PetscLibType, rnd::PetscRandom)Configures the random number generator from the options database.
Collective
Input Parameter:
rnd- The random number generator context
Options Database Keys:
-random_seed seed- provide a seed to the random number generator-random_no_imaginary_part- makes the imaginary part of the random number zero, this is useful when you want the
same code to produce the same result when run with real numbers or complex numbers for regression testing purposes
Level: beginner
See also: PetscRandom, PetscRandomCreate(), PetscRandomSetType()
External Links
- PETSc Manual:
Sys/PetscRandomSetFromOptions
PETSc.LibPETSc.PetscRandomSetInterval — Method
PetscRandomSetInterval(petsclib::PetscLibType, r::PetscRandom, low::PetscScalar, high::PetscScalar)Sets the interval over which the random numbers will be distributed. By default, this interval is [0,1).
Not Collective
Input Parameters:
r- the random number generator contextlow- The lower bound of the intervalhigh- The upper bound of the interval
Level: intermediate
See also: PetscRandomCreate(), PetscRandomGetInterval()
External Links
- PETSc Manual:
Sys/PetscRandomSetInterval
PETSc.LibPETSc.PetscRandomSetOptionsPrefix — Method
PetscRandomSetOptionsPrefix(petsclib::PetscLibType, r::PetscRandom, prefix::String)Sets the prefix used for searching for all PetscRandom options in the database.
Logically Collective
Input Parameters:
r- the random number generator contextprefix- the prefix to prepend to all option names
Level: advanced
See also: PetscRandom, PetscRandomSetFromOptions()
External Links
- PETSc Manual:
Sys/PetscRandomSetOptionsPrefix
PETSc.LibPETSc.PetscRandomSetSeed — Method
PetscRandomSetSeed(petsclib::PetscLibType, r::PetscRandom, seed::PetscInt64)Sets the random seed. You MUST call PetscRandomSeed() after this call to have the new seed used.
Not collective
Input Parameters:
r- The random number generator contextseed- The random seed
Level: intermediate
See also: PetscRandom, PetscRandomCreate(), PetscRandomGetSeed(), PetscRandomSeed()
External Links
- PETSc Manual:
Sys/PetscRandomSetSeed
PETSc.LibPETSc.PetscRandomSetType — Method
PetscRandomSetType(petsclib::PetscLibType, rnd::PetscRandom, type::String)Builds a context for generating a particular type of random numbers.
Collective
Input Parameters:
rnd- The random number generator contexttype- The name of the random type
Options Database Key:
-random_type (rander48|rand|rand48|sprng|random123|curand)- set the random number generator from the options database, seePetscRandomType.
Level: intermediate
See also: PetscRandom, PetscRandomType, PetscRandomGetType(), PetscRandomCreate()
External Links
- PETSc Manual:
Sys/PetscRandomSetType
PETSc.LibPETSc.PetscRandomView — Method
PetscRandomView(petsclib::PetscLibType, rnd::PetscRandom, viewer::PetscViewer)Views a random number generator object.
Collective
Input Parameters:
rnd- The random number generator contextviewer- an optional visualization context
Level: beginner
See also: PetscRandom, PetscRealView(), PetscScalarView(), PetscIntView()
External Links
- PETSc Manual:
Sys/PetscRandomView
PETSc.LibPETSc.PetscRandomViewFromOptions — Method
PetscRandomViewFromOptions(petsclib::PetscLibType, A::PetscRandom, obj, name::String)View a PetscRandom object based on the options database
Collective
Input Parameters:
A- the random number generator contextobj- Optional objectname- command line option
Options Database Key:
-name [viewertype][:...]- option name and values. SeePetscObjectViewFromOptions()for the possible arguments
Level: intermediate
See also: PetscRandom, PetscRandomView, PetscObjectViewFromOptions(), PetscRandomCreate()
External Links
- PETSc Manual:
Sys/PetscRandomViewFromOptions
PetscLayout
PETSc.LibPETSc.PetscLayoutCompare — Method
congruent::PetscBool = PetscLayoutCompare(petsclib::PetscLibType, mapa::PetscLayout, mapb::PetscLayout)Compares two layouts
Not Collective
Input Parameters:
mapa- pointer to the first mapmapb- pointer to the second map
Output Parameter:
congruent-PETSC_TRUEif the two layouts are congruent,PETSC_FALSEotherwise
Level: beginner
See also: PetscLayout, PetscLayoutCreate(), PetscLayoutSetLocalSize(), PetscLayoutGetLocalSize(), PetscLayoutGetBlockSize(), PetscLayoutGetRange(), PetscLayoutGetRanges(), PetscLayoutSetSize(), PetscLayoutGetSize(), PetscLayoutSetUp()
External Links
- PETSc Manual:
IS/PetscLayoutCompare
PETSc.LibPETSc.PetscLayoutCreate — Method
map::PetscLayout = PetscLayoutCreate(petsclib::PetscLibType, comm::MPI_Comm)Allocates PetscLayout object
Collective
Input Parameter:
comm- the MPI communicator
Output Parameter:
map- the newPetscLayout
Level: advanced
See also: PetscLayout, PetscLayoutSetLocalSize(), PetscLayoutSetSize(), PetscLayoutGetSize(), PetscLayoutGetLocalSize(), PetscLayout, PetscLayoutDestroy(), PetscLayoutGetRange(), PetscLayoutGetRanges(), PetscLayoutSetBlockSize(), PetscLayoutGetBlockSize(), PetscLayoutSetUp(), PetscLayoutCreateFromSizes()
External Links
- PETSc Manual:
IS/PetscLayoutCreate
PETSc.LibPETSc.PetscLayoutCreateFromRanges — Method
newmap::PetscLayout = PetscLayoutCreateFromRanges(petsclib::PetscLibType, comm::MPI_Comm, range::Vector{PetscInt}, mode::PetscCopyMode, bs::PetscInt)Creates a new PetscLayout with the given ownership ranges and sets it up.
Collective
Input Parameters:
comm- the MPI communicatorrange- the array of ownership ranges for each rank with length commsize+1mode- the copy mode for rangebs- the block size (orPETSC_DECIDE)
Output Parameter:
newmap- the newPetscLayout
Level: developer
See also: PetscLayout, PetscLayoutCreate(), PetscLayoutSetLocalSize(), PetscLayoutSetSize(), PetscLayoutGetSize(), PetscLayoutGetLocalSize(), PetscLayout, PetscLayoutDestroy(), PetscLayoutGetRange(), PetscLayoutGetRanges(), PetscLayoutSetBlockSize(), PetscLayoutGetBlockSize(), PetscLayoutSetUp(), PetscLayoutCreateFromSizes()
External Links
- PETSc Manual:
IS/PetscLayoutCreateFromRanges
PETSc.LibPETSc.PetscLayoutCreateFromSizes — Method
map::PetscLayout = PetscLayoutCreateFromSizes(petsclib::PetscLibType, comm::MPI_Comm, n::PetscInt, M_N::PetscInt, bs::PetscInt)Allocates PetscLayout object and sets the layout sizes, and sets the layout up.
Collective
Input Parameters:
comm- the MPI communicatorn- the local size (orPETSC_DECIDE)N- the global size (orPETSC_DECIDE)bs- the block size (orPETSC_DECIDE)
Output Parameter:
map- the newPetscLayout
Level: advanced
See also: PetscLayout, PetscLayoutCreate(), PetscLayoutSetLocalSize(), PetscLayoutSetSize(), PetscLayoutGetSize(), PetscLayoutGetLocalSize(), PetscLayout, PetscLayoutDestroy(), PetscLayoutGetRange(), PetscLayoutGetRanges(), PetscLayoutSetBlockSize(), PetscLayoutGetBlockSize(), PetscLayoutSetUp(), PetscLayoutCreateFromRanges()
External Links
- PETSc Manual:
IS/PetscLayoutCreateFromSizes
PETSc.LibPETSc.PetscLayoutDestroy — Method
PetscLayoutDestroy(petsclib::PetscLibType, map::Union{PetscLayout, Ref{PetscLayout}})Frees a PetscLayout object and frees its range if that exists.
Collective
Input Parameter:
map- thePetscLayout
Level: developer
See also: PetscLayout, PetscLayoutSetLocalSize(), PetscLayoutSetSize(), PetscLayoutGetSize(), PetscLayoutGetLocalSize(), PetscLayout, PetscLayoutCreate(), PetscLayoutGetRange(), PetscLayoutGetRanges(), PetscLayoutSetBlockSize(), PetscLayoutGetBlockSize(), PetscLayoutSetUp()
External Links
- PETSc Manual:
IS/PetscLayoutDestroy
PETSc.LibPETSc.PetscLayoutDuplicate — Method
out::PetscLayout = PetscLayoutDuplicate(petsclib::PetscLibType, in::PetscLayout)creates a new PetscLayout with the same information as a given one. If the PetscLayout already exists it is destroyed first.
Collective
Input Parameter:
in- inputPetscLayoutto be duplicated
Output Parameter:
out- the copy
Level: developer
See also: PetscLayout, PetscLayoutCreate(), PetscLayoutDestroy(), PetscLayoutSetUp(), PetscLayoutReference()
External Links
- PETSc Manual:
IS/PetscLayoutDuplicate
PETSc.LibPETSc.PetscLayoutFindOwner — Method
owner::PetscMPIInt = PetscLayoutFindOwner(petsclib::PetscLibType, map::PetscLayout, idx::PetscInt)Find the owning MPI process for a global index
Not Collective; No Fortran Support
Input Parameters:
map- the layoutidx- global index to find the owner of
Output Parameter:
owner- the owning rank
Level: developer
See also: PetscLayout, PetscLayoutFindOwnerIndex()
External Links
- PETSc Manual:
IS/PetscLayoutFindOwner
PETSc.LibPETSc.PetscLayoutFindOwnerIndex — Method
owner::PetscMPIInt,lidx::PetscInt = PetscLayoutFindOwnerIndex(petsclib::PetscLibType, map::PetscLayout, idx::PetscInt)Find the owning MPI process and the local index on that process for a global index
Not Collective; No Fortran Support
Input Parameters:
map- the layoutidx- global index to find the owner of
Output Parameters:
owner- the owning ranklidx- local index used by the owner foridx
Level: developer
See also: PetscLayout, PetscLayoutFindOwner()
External Links
- PETSc Manual:
IS/PetscLayoutFindOwnerIndex
PETSc.LibPETSc.PetscLayoutGetBlockSize — Method
bs::PetscInt = PetscLayoutGetBlockSize(petsclib::PetscLibType, map::PetscLayout)Gets the block size for a PetscLayout object.
Not Collective
Input Parameter:
map- pointer to the map
Output Parameter:
bs- the size
Level: developer
See also: PetscLayout, PetscLayoutCreate(), PetscLayoutSetLocalSize(), PetscLayoutGetLocalSize(), PetscLayoutSetSize(), PetscLayoutSetUp(), PetscLayoutGetRange(), PetscLayoutGetRanges(), PetscLayoutSetBlockSize(), PetscLayoutGetSize()
External Links
- PETSc Manual:
IS/PetscLayoutGetBlockSize
PETSc.LibPETSc.PetscLayoutGetLocalSize — Method
n::PetscInt = PetscLayoutGetLocalSize(petsclib::PetscLibType, map::PetscLayout)Gets the local size for a PetscLayout object.
Not Collective
Input Parameter:
map- pointer to the map
Output Parameter:
n- the local size
Level: developer
See also: PetscLayout, PetscLayoutCreate(), PetscLayoutSetSize(), PetscLayoutGetSize(), PetscLayoutSetUp(), PetscLayoutGetRange(), PetscLayoutGetRanges(), PetscLayoutSetBlockSize(), PetscLayoutGetBlockSize()
External Links
- PETSc Manual:
IS/PetscLayoutGetLocalSize
PETSc.LibPETSc.PetscLayoutGetRange — Method
rstart::PetscInt,rend::PetscInt = PetscLayoutGetRange(petsclib::PetscLibType, map::PetscLayout)gets the range of values owned by this process
Not Collective
Input Parameter:
map- pointer to the map
Output Parameters:
rstart- first index owned by this processrend- one more than the last index owned by this process
Level: developer
See also: PetscLayout, PetscLayoutCreate(), PetscLayoutSetLocalSize(), PetscLayoutGetLocalSize(), PetscLayoutSetSize(), PetscLayoutGetSize(), PetscLayoutGetRanges(), PetscLayoutSetBlockSize(), PetscLayoutSetUp()
External Links
- PETSc Manual:
IS/PetscLayoutGetRange
PETSc.LibPETSc.PetscLayoutGetRanges — Method
range::Ptr{PetscInt} = PetscLayoutGetRanges(petsclib::PetscLibType, map::PetscLayout)gets the ranges of values owned by all processes
Not Collective
Input Parameter:
map- pointer to the map
Output Parameter:
range- start of each processors range of indices (the final entry is one more than the
last index on the last process). The length of the array is one more than the number of processes in the MPI communicator owned by map
Level: developer
See also: PetscLayout, PetscLayoutCreate(), PetscLayoutSetLocalSize(), PetscLayoutGetLocalSize(), PetscLayoutSetSize(), PetscLayoutGetSize(), PetscLayoutGetRange(), PetscLayoutSetBlockSize(), PetscLayoutSetUp()
External Links
- PETSc Manual:
IS/PetscLayoutGetRanges
PETSc.LibPETSc.PetscLayoutGetSize — Method
n::PetscInt = PetscLayoutGetSize(petsclib::PetscLibType, map::PetscLayout)Gets the global size for a PetscLayout object.
Not Collective
Input Parameter:
map- pointer to the map
Output Parameter:
n- the global size
Level: developer
See also: PetscLayout, PetscLayoutCreate(), PetscLayoutSetLocalSize(), PetscLayoutGetLocalSize(), PetscLayoutSetSize(), PetscLayoutSetUp(), PetscLayoutGetRange(), PetscLayoutGetRanges(), PetscLayoutSetBlockSize(), PetscLayoutGetBlockSize()
External Links
- PETSc Manual:
IS/PetscLayoutGetSize
PETSc.LibPETSc.PetscLayoutMapLocal — Method
on::PetscInt,oidxs::Ptr{PetscInt},ogidxs::Ptr{PetscInt} = PetscLayoutMapLocal(petsclib::PetscLibType, map::PetscLayout, N::PetscInt, idxs::Vector{PetscInt})Maps a set of global indices to the subset owned locally by each MPI process according to a PetscLayout
Collective
Input Parameters:
map- thePetscLayoutdescribing global ownershipN- the number of input indicesidxs- the global indices; negative entries are ignored
Output Parameters:
on- number of indices in the returned local set (may beNULL)oidxs- the local (0-based) indices owned by this MPI process (may beNULL); caller mustPetscFree()ogidxs- the corresponding global indices in a compact numbering (may beNULL); caller mustPetscFree()
Level: developer
See also: PetscLayout, PetscSF, PetscLayoutFindOwner(), PetscSFCreateFromLayouts()
External Links
- PETSc Manual:
PetscSF/PetscLayoutMapLocal
PETSc.LibPETSc.PetscLayoutReference — Method
out::PetscLayout = PetscLayoutReference(petsclib::PetscLibType, in::PetscLayout)Causes a PETSc Vec or Mat to share a PetscLayout with one that already exists.
Collective
Input Parameter:
in- inputPetscLayoutto be copied
Output Parameter:
out- the reference location
Level: developer
See also: PetscLayout, PetscLayoutCreate(), PetscLayoutDestroy(), PetscLayoutSetUp(), PetscLayoutDuplicate()
External Links
- PETSc Manual:
IS/PetscLayoutReference
PETSc.LibPETSc.PetscLayoutSetBlockSize — Method
PetscLayoutSetBlockSize(petsclib::PetscLibType, map::PetscLayout, bs::PetscInt)Sets the block size for a PetscLayout object.
Logically Collective
Input Parameters:
map- pointer to the mapbs- the size
Level: developer
See also: PetscLayout, PetscLayoutCreate(), PetscLayoutSetLocalSize(), PetscLayoutGetLocalSize(), PetscLayoutGetBlockSize(), PetscLayoutGetRange(), PetscLayoutGetRanges(), PetscLayoutSetSize(), PetscLayoutGetSize(), PetscLayoutSetUp()
External Links
- PETSc Manual:
IS/PetscLayoutSetBlockSize
PETSc.LibPETSc.PetscLayoutSetISLocalToGlobalMapping — Method
PetscLayoutSetISLocalToGlobalMapping(petsclib::PetscLibType, in::PetscLayout, ltog::ISLocalToGlobalMapping)sets a ISLocalGlobalMapping into a PetscLayout
Collective
Input Parameters:
in- inputPetscLayoutltog- the local to global mapping
Level: developer
See also: PetscLayout, PetscLayoutCreate(), PetscLayoutDestroy(), PetscLayoutSetUp(), PetscLayoutDuplicate()
External Links
- PETSc Manual:
IS/PetscLayoutSetISLocalToGlobalMapping
PETSc.LibPETSc.PetscLayoutSetLocalSize — Method
PetscLayoutSetLocalSize(petsclib::PetscLibType, map::PetscLayout, n::PetscInt)Sets the local size for a PetscLayout object.
Collective
Input Parameters:
map- pointer to the mapn- the local size, passPETSC_DECIDE(the default) to have this value determined by the global size set withPetscLayoutSetSize()
Level: developer
See also: PetscLayout, PetscLayoutCreate(), PetscLayoutSetSize(), PetscLayoutGetSize(), PetscLayoutGetLocalSize(), PetscLayoutSetUp(), PetscLayoutGetRange(), PetscLayoutGetRanges(), PetscLayoutSetBlockSize(), PetscLayoutGetBlockSize()
External Links
- PETSc Manual:
IS/PetscLayoutSetLocalSize
PETSc.LibPETSc.PetscLayoutSetSize — Method
PetscLayoutSetSize(petsclib::PetscLibType, map::PetscLayout, n::PetscInt)Sets the global size for a PetscLayout object.
Logically Collective
Input Parameters:
map- pointer to the mapn- the global size, usePETSC_DETERMINE(the default) to have this value computed as the sum of the local sizes set withPetscLayoutSetLocalSize()
Level: developer
See also: PetscLayout, PetscLayoutCreate(), PetscLayoutSetLocalSize(), PetscLayoutGetLocalSize(), PetscLayoutGetSize(), PetscLayoutSetUp(), PetscLayoutGetRange(), PetscLayoutGetRanges(), PetscLayoutSetBlockSize(), PetscLayoutGetBlockSize()
External Links
- PETSc Manual:
IS/PetscLayoutSetSize
PETSc.LibPETSc.PetscLayoutSetUp — Method
PetscLayoutSetUp(petsclib::PetscLibType, map::PetscLayout)given a map where you have set either the global or local size sets up the map so that it may be used.
Collective
Input Parameter:
map- pointer to the map
Level: developer
See also: PetscLayout, PetscLayoutSetLocalSize(), PetscLayoutSetSize(), PetscLayoutGetSize(), PetscLayoutGetLocalSize(), PetscLayout, PetscLayoutDestroy(), PetscLayoutGetRange(), PetscLayoutGetRanges(), PetscLayoutSetBlockSize(), PetscLayoutGetBlockSize(), PetscLayoutCreate(), PetscSplitOwnership()
External Links
- PETSc Manual:
IS/PetscLayoutSetUp
PetscSubcomm and PetscShmComm
PETSc.LibPETSc.PetscShmCommGet — Method
pshmcomm::PetscShmComm = PetscShmCommGet(petsclib::PetscLibType, globcomm::MPI_Comm)Returns a sub-communicator of all ranks that share a common memory
Collective.
Input Parameter:
globcomm-MPI_Comm, which can be a userMPI_Commor a PETSc innerMPI_Comm
Output Parameter:
pshmcomm- the PETSc shared memory communicator object
Level: developer
See also: PetscShmCommGlobalToLocal(), PetscShmCommLocalToGlobal(), PetscShmCommGetMpiShmComm()
External Links
- PETSc Manual:
Sys/PetscShmCommGet
PETSc.LibPETSc.PetscShmCommGetMpiShmComm — Method
comm::MPI_Comm = PetscShmCommGetMpiShmComm(petsclib::PetscLibType, pshmcomm::PetscShmComm)Returns the MPI communicator that represents all processes with common shared memory
Input Parameter:
pshmcomm- PetscShmComm object obtained with PetscShmCommGet()
Output Parameter:
comm- the MPI communicator
Level: developer
See also: PetscShmCommGlobalToLocal(), PetscShmCommGet(), PetscShmCommLocalToGlobal()
External Links
- PETSc Manual:
Sys/PetscShmCommGetMpiShmComm
PETSc.LibPETSc.PetscShmCommGlobalToLocal — Method
lrank::PetscMPIInt = PetscShmCommGlobalToLocal(petsclib::PetscLibType, pshmcomm::PetscShmComm, grank::PetscMPIInt)Given a global rank returns the local rank in the shared memory communicator
Input Parameters:
pshmcomm- the shared memory communicator objectgrank- the global rank
Output Parameter:
lrank- the local rank, orMPI_PROC_NULLif it does not exist
Level: developer
See also: PetscShmCommGet(), PetscShmCommLocalToGlobal(), PetscShmCommGetMpiShmComm()
External Links
- PETSc Manual:
Sys/PetscShmCommGlobalToLocal
PETSc.LibPETSc.PetscShmCommLocalToGlobal — Method
grank::PetscMPIInt = PetscShmCommLocalToGlobal(petsclib::PetscLibType, pshmcomm::PetscShmComm, lrank::PetscMPIInt)Given a local rank in the shared memory communicator returns the global rank
Input Parameters:
pshmcomm- the shared memory communicator objectlrank- the local rank in the shared memory communicator
Output Parameter:
grank- the global rank in the global communicator where the shared memory communicator is built
Level: developer
See also: PetscShmCommGlobalToLocal(), PetscShmCommGet(), PetscShmCommGetMpiShmComm()
External Links
- PETSc Manual:
Sys/PetscShmCommLocalToGlobal
PETSc.LibPETSc.PetscSubcommCreate — Method
psubcomm::PetscSubcomm = PetscSubcommCreate(petsclib::PetscLibType, comm::MPI_Comm)Create a PetscSubcomm context. This object is used to manage the division of a MPI_Comm into subcommunicators
Collective
Input Parameter:
comm- MPI communicator
Output Parameter:
psubcomm- location to store thePetscSubcommcontext
Level: advanced
See also: PetscSubcomm, PetscSubcommDestroy(), PetscSubcommSetTypeGeneral(), PetscSubcommSetFromOptions(), PetscSubcommSetType(), PetscSubcommSetNumber()
External Links
- PETSc Manual:
Sys/PetscSubcommCreate
PETSc.LibPETSc.PetscSubcommDestroy — Method
PetscSubcommDestroy(petsclib::PetscLibType, psubcomm::Union{PetscSubcomm, Ref{PetscSubcomm}})Destroys a PetscSubcomm object
Collective
Input Parameter:
psubcomm- thePetscSubcommcontext
Level: advanced
See also: PetscSubcommCreate(), PetscSubcommSetType()
External Links
- PETSc Manual:
Sys/PetscSubcommDestroy
PETSc.LibPETSc.PetscSubcommGetChild — Method
ccomm::MPI_Comm = PetscSubcommGetChild(petsclib::PetscLibType, scomm::PetscSubcomm)Gets the communicator created by the PetscSubcomm. This is part of one of the subcommunicators created by the PetscSubcomm
Collective
Input Parameter:
scomm- thePetscSubcomm
Output Parameter:
ccomm- location to store the child communicator
Level: intermediate
See also: PetscSubcommDestroy(), PetscSubcommSetTypeGeneral(), PetscSubcommSetFromOptions(), PetscSubcommSetType(), PetscSubcommSetNumber(), PetscSubcommGetParent(), PetscSubcommContiguousParent()
External Links
- PETSc Manual:
Sys/PetscSubcommGetChild
PETSc.LibPETSc.PetscSubcommGetContiguousParent — Method
pcomm::MPI_Comm = PetscSubcommGetContiguousParent(petsclib::PetscLibType, scomm::PetscSubcomm)Gets a communicator that is a duplicate of the parent but has the ranks reordered by the order they are in the children
Collective
Input Parameter:
scomm- thePetscSubcomm
Output Parameter:
pcomm- location to store the parent communicator
Level: intermediate
See also: PetscSubcommDestroy(), PetscSubcommSetTypeGeneral(), PetscSubcommSetFromOptions(), PetscSubcommSetType(), PetscSubcommSetNumber(), PetscSubcommGetChild(), PetscSubcommContiguousParent()
External Links
- PETSc Manual:
Sys/PetscSubcommGetContiguousParent
PETSc.LibPETSc.PetscSubcommGetParent — Method
pcomm::MPI_Comm = PetscSubcommGetParent(petsclib::PetscLibType, scomm::PetscSubcomm)Gets the communicator that was used to create the PetscSubcomm
Collective
Input Parameter:
scomm- thePetscSubcomm
Output Parameter:
pcomm- location to store the parent communicator
Level: intermediate
See also: PetscSubcommDestroy(), PetscSubcommSetTypeGeneral(), PetscSubcommSetFromOptions(), PetscSubcommSetType(), PetscSubcommSetNumber(), PetscSubcommGetChild(), PetscSubcommContiguousParent()
External Links
- PETSc Manual:
Sys/PetscSubcommGetParent
PETSc.LibPETSc.PetscSubcommSetFromOptions — Method
PetscSubcommSetFromOptions(petsclib::PetscLibType, psubcomm::PetscSubcomm)Allows setting options for a PetscSubcomm
Collective
Input Parameter:
psubcomm-PetscSubcommcontext
Level: beginner
See also: PetscSubcomm, PetscSubcommCreate()
External Links
- PETSc Manual:
Sys/PetscSubcommSetFromOptions
PETSc.LibPETSc.PetscSubcommSetNumber — Method
PetscSubcommSetNumber(petsclib::PetscLibType, psubcomm::PetscSubcomm, nsubcomm::PetscInt)Set total number of subcommunicators desired in the given PetscSubcomm
Collective
Input Parameters:
psubcomm-PetscSubcommcontextnsubcomm- the total number of subcommunicators in psubcomm
Level: advanced
See also: PetscSubcomm, PetscSubcommCreate(), PetscSubcommDestroy(), PetscSubcommSetType(), PetscSubcommSetTypeGeneral()
External Links
- PETSc Manual:
Sys/PetscSubcommSetNumber
PETSc.LibPETSc.PetscSubcommSetOptionsPrefix — Method
PetscSubcommSetOptionsPrefix(petsclib::PetscLibType, psubcomm::PetscSubcomm, pre::String)Sets the prefix used for searching for options in the options database for this object
Logically Collective
Level: intermediate
Input Parameters:
psubcomm-PetscSubcommcontextpre- the prefix to prepend allPetscSubcommitem names with.
See also: PetscSubcomm, PetscSubcommCreate()
External Links
- PETSc Manual:
Sys/PetscSubcommSetOptionsPrefix
PETSc.LibPETSc.PetscSubcommSetType — Method
PetscSubcommSetType(petsclib::PetscLibType, psubcomm::PetscSubcomm, subcommtype::PetscSubcommType)Set the way the original MPI communicator is divided up in the PetscSubcomm
Collective
Input Parameters:
psubcomm-PetscSubcommcontextsubcommtype-PetscSubcommTypePETSC_SUBCOMM_CONTIGUOUSorPETSC_SUBCOMM_INTERLACED
Level: advanced
See also: PetscSubcommType, PETSC_SUBCOMM_CONTIGUOUS, PETSC_SUBCOMM_INTERLACED, PetscSubcommCreate(), PetscSubcommDestroy(), PetscSubcommSetNumber(), PetscSubcommSetTypeGeneral()
External Links
- PETSc Manual:
Sys/PetscSubcommSetType
PETSc.LibPETSc.PetscSubcommSetTypeGeneral — Method
PetscSubcommSetTypeGeneral(petsclib::PetscLibType, psubcomm::PetscSubcomm, color::PetscMPIInt, subrank::PetscMPIInt)Divides up a communicator based on a specific user's specification
Collective
Input Parameters:
psubcomm-PetscSubcommcontextcolor- control of subset assignment (nonnegative integer). Processes with the same color are in the same subcommunicator.subrank- rank in the subcommunicator
Level: advanced
See also: PetscSubcommType, PETSC_SUBCOMM_CONTIGUOUS, PETSC_SUBCOMM_INTERLACED, PetscSubcommCreate(), PetscSubcommDestroy(), PetscSubcommSetNumber(), PetscSubcommSetType()
External Links
- PETSc Manual:
Sys/PetscSubcommSetTypeGeneral
PETSc.LibPETSc.PetscSubcommView — Method
PetscSubcommView(petsclib::PetscLibType, psubcomm::PetscSubcomm, viewer::PetscViewer)Views a PetscSubcomm
Collective
Input Parameters:
psubcomm-PetscSubcommcontextviewer-PetscViewerto display the information
Level: beginner
See also: PetscSubcomm, PetscSubcommCreate(), PetscViewer
External Links
- PETSc Manual:
Sys/PetscSubcommView
PetscBag
PETSc.LibPETSc.PetscBagCreate — Method
bag::PetscBag = PetscBagCreate(petsclib::PetscLibType, comm::MPI_Comm, bagsize::Csize_t)Create a bag of values. A PetscBag is a representation of a C struct that can be saved to and read from files, can have values set from the options database
Collective
Input Parameters:
comm- communicator to share bagbagsize- size of the C structure holding the values, for examplesizeof(mystruct)
Output Parameter:
bag- the bag of values
Level: intermediate
See also: PetscBag, PetscBagGetName(), PetscBagView(), PetscBagLoad(), PetscBagGetData(), PetscBagRegisterReal(), PetscBagRegisterInt(), PetscBagRegisterBool(), PetscBagRegisterScalar(), PetscBagSetFromOptions(), PetscBagDestroy(), PetscBagRegisterEnum()
External Links
- PETSc Manual:
Bag/PetscBagCreate
PETSc.LibPETSc.PetscBagDestroy — Method
PetscBagDestroy(petsclib::PetscLibType, bag::Union{PetscBag, Ref{PetscBag}})Destroys a PetscBag
Collective
Input Parameter:
bag- the bag of values
Level: beginner
See also: PetscBag, PetscBagSetName(), PetscBagView(), PetscBagLoad(), PetscBagGetData(), PetscBagRegisterReal(), PetscBagRegisterInt(), PetscBagRegisterBool(), PetscBagRegisterScalar(), PetscBagSetFromOptions(), PetscBagCreate(), PetscBagGetName(), PetscBagRegisterEnum()
External Links
- PETSc Manual:
Bag/PetscBagDestroy
PETSc.LibPETSc.PetscBagGetData — Method
data::Ptr{Cvoid} = PetscBagGetData(petsclib::PetscLibType, bag::PetscBag)Gives back the user - access to memory that can be used for storing user-data-structure
Not Collective
Input Parameter:
bag- the bag of values
Output Parameter:
data- pointer to memory that will have user-data-structure, this can be cast to a pointer of the type the C struct used in
defining the bag
Level: intermediate
See also: PetscBag, PetscBagSetName(), PetscBagView(), PetscBagLoad(), PetscBagRegisterReal(), PetscBagRegisterInt(), PetscBagRegisterBool(), PetscBagRegisterScalar(), PetscBagSetFromOptions(), PetscBagCreate(), PetscBagDestroy(), PetscBagRegisterEnum()
External Links
- PETSc Manual:
Bag/PetscBagGetData
PETSc.LibPETSc.PetscBagGetName — Method
name::String = PetscBagGetName(petsclib::PetscLibType, bag::PetscBag)Gets the name of a bag of values
Not Collective
Level: intermediate
Input Parameter:
bag- the bag of values
Output Parameter:
name- the name assigned to the bag
See also: PetscBag, PetscBagSetName(), PetscBagView(), PetscBagLoad(), PetscBagGetData(), PetscBagRegisterReal(), PetscBagRegisterInt(), PetscBagRegisterBool(), PetscBagRegisterScalar(), PetscBagSetFromOptions(), PetscBagCreate(), PetscBagDestroy(), PetscBagRegisterEnum()
External Links
- PETSc Manual:
Bag/PetscBagGetName
PETSc.LibPETSc.PetscBagLoad — Method
PetscBagLoad(petsclib::PetscLibType, view::PetscViewer, bag::PetscBag)Loads a bag of values from a binary file
Collective
Input Parameters:
view- file to load values frombag- the bag of values
Level: beginner
See also: PetscBag, PetscBagSetName(), PetscBagDestroy(), PetscBagView(), PetscBagGetData(), PetscBagRegisterReal(), PetscBagRegisterInt(), PetscBagRegisterBool(), PetscBagRegisterScalar(), PetscBagSetFromOptions(), PetscBagCreate(), PetscBagGetName(), PetscBagRegisterEnum()
External Links
- PETSc Manual:
Bag/PetscBagLoad
PETSc.LibPETSc.PetscBagRegisterBool — Method
PetscBagRegisterBool(petsclib::PetscLibType, bag::PetscBag, addr::Ptr{Cvoid}, mdefault::PetscBool, name::String, help::String)add a PetscBool to a PetscBag
Logically Collective
Input Parameters:
bag- the bag of valuesaddr- location ofPetscBoolin struct, for example¶ms->bmdefault- the initial value, eitherPETSC_FALSEorPETSC_TRUEname- name of the variablehelp- longer string with more information about the value
Level: beginner
See also: PetscBag, PetscBagSetName(), PetscBagView(), PetscBagLoad(), PetscBagGetData(), PetscBagRegisterInt(), PetscBagRegisterScalar(), PetscBagSetFromOptions(), PetscBagCreate(), PetscBagGetName(), PetscBagRegisterEnum()
External Links
- PETSc Manual:
Bag/PetscBagRegisterBool
PETSc.LibPETSc.PetscBagRegisterBoolArray — Method
PetscBagRegisterBoolArray(petsclib::PetscLibType, bag::PetscBag, addr::Ptr{Cvoid}, msize::PetscInt, name::String, help::String)add a n PetscBool values to a PetscBag
Logically Collective
Input Parameters:
bag- the bag of valuesaddr- location of boolean array in struct, for example¶ms->bmsize- number of entries in arrayname- name of the boolean arrayhelp- longer string with more information about the value
Level: beginner
See also: PetscBag, PetscBagSetName(), PetscBagView(), PetscBagLoad(), PetscBagGetData(), PetscBagRegisterInt(), PetscBagRegisterBool(), PetscBagRegisterScalar(), PetscBagSetFromOptions(), PetscBagCreate(), PetscBagGetName(), PetscBagRegisterEnum()
External Links
- PETSc Manual:
Bag/PetscBagRegisterBoolArray
PETSc.LibPETSc.PetscBagRegisterEnum — Method
PetscBagRegisterEnum(petsclib::PetscLibType, bag::PetscBag, addr::Ptr{Cvoid}, list::Cchar, mdefault::PetscEnum, name::String, help::String)add an enum value to a PetscBag
Logically Collective
Input Parameters:
bag- the bag of valuesaddr- location of enum in struct, for example¶ms->dtlist- array of strings containing names of enum values followed by enum name followed by enum prefixmdefault- the initial value, cast with (PetscEnum)name- the name of the itemhelp- longer string with more information about the value
Level: beginner
See also: PetscBag, PetscBagSetName(), PetscBagView(), PetscBagLoad(), PetscBagGetData(), PetscBagRegisterInt(), PetscBagRegisterBool(), PetscBagRegisterScalar(), PetscBagSetFromOptions(), PetscBagCreate(), PetscBagGetName()
External Links
- PETSc Manual:
Bag/PetscBagRegisterEnum
PETSc.LibPETSc.PetscBagRegisterInt — Method
PetscBagRegisterInt(petsclib::PetscLibType, bag::PetscBag, addr::Ptr{Cvoid}, mdefault::PetscInt, name::String, help::String)add a PetscInt value to a PetscBag
Logically Collective
Input Parameters:
bag- the bag of valuesaddr- location of integer in struct, for example¶ms->imdefault- the initial valuename- name of the integerhelp- longer string with more information about the value
Level: beginner
See also: PetscBag, PetscBagSetName(), PetscBagView(), PetscBagLoad(), PetscBagGetData(), PetscBagRegisterInt64(), PetscBagRegisterBool(), PetscBagRegisterScalar(), PetscBagSetFromOptions(), PetscBagCreate(), PetscBagGetName(), PetscBagRegisterEnum()
External Links
- PETSc Manual:
Bag/PetscBagRegisterInt
PETSc.LibPETSc.PetscBagRegisterInt64 — Method
PetscBagRegisterInt64(petsclib::PetscLibType, bag::PetscBag, addr::Ptr{Cvoid}, mdefault::PetscInt64, name::String, help::String)add a PetscInt64 value to a PetscBag
Logically Collective
Input Parameters:
bag- the bag of valuesaddr- location of integer in struct, for example¶ms->imdefault- the initial valuename- name of the integerhelp- longer string with more information about the value
Level: beginner
See also: PetscBag, PetscBagSetName(), PetscBagView(), PetscBagLoad(), PetscBagGetData(), PetscBagRegisterInt(), PetscBagRegisterBool(), PetscBagRegisterScalar(), PetscBagSetFromOptions(), PetscBagCreate(), PetscBagGetName(), PetscBagRegisterEnum()
External Links
- PETSc Manual:
Bag/PetscBagRegisterInt64
PETSc.LibPETSc.PetscBagRegisterIntArray — Method
PetscBagRegisterIntArray(petsclib::PetscLibType, bag::PetscBag, addr::Ptr{Cvoid}, msize::PetscInt, name::String, help::String)add a PetscInt array to a PetscBag
Logically Collective
Input Parameters:
bag- the bag of valuesaddr- location of integer in struct, for example¶ms->imsize- number of entries in arrayname- name of the arrayhelp- longer string with more information about the value
Level: beginner
See also: PetscBag, PetscBagSetName(), PetscBagView(), PetscBagLoad(), PetscBagGetData(), PetscBagRegisterInt(), PetscBagRegisterBool(), PetscBagRegisterScalar(), PetscBagSetFromOptions(), PetscBagCreate(), PetscBagGetName(), PetscBagRegisterEnum()
External Links
- PETSc Manual:
Bag/PetscBagRegisterIntArray
PETSc.LibPETSc.PetscBagRegisterReal — Method
PetscBagRegisterReal(petsclib::PetscLibType, bag::PetscBag, addr::Ptr{Cvoid}, mdefault::PetscReal, name::String, help::String)add a PetscReal value to a PetscBag
Logically Collective
Input Parameters:
bag- the bag of valuesaddr- location ofPetscRealin struct, for example¶ms->rmdefault- the initial valuename- name of the variablehelp- longer string with more information about the value
Level: beginner
See also: PetscBag, PetscBagSetName(), PetscBagView(), PetscBagLoad(), PetscBagGetData(), PetscBagRegisterInt(), PetscBagRegisterBool(), PetscBagRegisterScalar(), PetscBagSetFromOptions(), PetscBagCreate(), PetscBagGetName(), PetscBagRegisterEnum()
External Links
- PETSc Manual:
Bag/PetscBagRegisterReal
PETSc.LibPETSc.PetscBagRegisterRealArray — Method
PetscBagRegisterRealArray(petsclib::PetscLibType, bag::PetscBag, addr::Ptr{Cvoid}, msize::PetscInt, name::String, help::String)add a PetscReal array to a PetscBag
Logically Collective
Input Parameters:
bag- the bag of valuesaddr- location of real array in struct, for example¶ms->dmsize- number of entries in the arrayname- name of the arrayhelp- longer string with more information about the value
Level: beginner
See also: PetscBag, PetscBagSetName(), PetscBagView(), PetscBagLoad(), PetscBagGetData(), PetscBagRegisterInt(), PetscBagRegisterBool(), PetscBagRegisterScalar(), PetscBagSetFromOptions(), PetscBagCreate(), PetscBagGetName(), PetscBagRegisterEnum()
External Links
- PETSc Manual:
Bag/PetscBagRegisterRealArray
PETSc.LibPETSc.PetscBagRegisterScalar — Method
PetscBagRegisterScalar(petsclib::PetscLibType, bag::PetscBag, addr::Ptr{Cvoid}, mdefault::PetscScalar, name::String, help::String)add a PetscScalar value to a PetscBag
Logically Collective
Input Parameters:
bag- the bag of valuesaddr- location ofPetscScalarin struct, for example¶ms->cmdefault- the initial valuename- name of the variablehelp- longer string with more information about the value
Level: beginner
See also: PetscBag, PetscBagSetName(), PetscBagView(), PetscBagLoad(), PetscBagGetData(), PetscBagRegisterInt(), PetscBagRegisterBool(), PetscBagSetFromOptions(), PetscBagCreate(), PetscBagGetName(), PetscBagRegisterEnum()
External Links
- PETSc Manual:
Bag/PetscBagRegisterScalar
PETSc.LibPETSc.PetscBagRegisterString — Method
PetscBagRegisterString(petsclib::PetscLibType, bag::PetscBag, addr::Ptr{Cvoid}, msize::PetscInt, mdefault::String, name::String, help::String)add a string value to a PetscBag
Logically Collective
Input Parameters:
bag- the bag of valuesaddr- location of start of string in struct, for example¶ms->mystringmsize- length of the string space in the structmdefault- the initial valuename- name of the stringhelp- longer string with more information about the value
Level: beginner
See also: PetscBag, PetscBagSetName(), PetscBagView(), PetscBagLoad(), PetscBagGetData(), PetscBagRegisterInt(), PetscBagRegisterBool(), PetscBagRegisterScalar(), PetscBagSetFromOptions(), PetscBagCreate(), PetscBagGetName(), PetscBagRegisterEnum()
External Links
- PETSc Manual:
Bag/PetscBagRegisterString
PETSc.LibPETSc.PetscBagSetFromOptions — Method
PetscBagSetFromOptions(petsclib::PetscLibType, bag::PetscBag)Allows setting entries to a PetscBag using the options database
Collective
Input Parameter:
bag- the bag of values
Level: beginner
See also: PetscBag, PetscBagSetName(), PetscBagDestroy(), PetscBagLoad(), PetscBagGetData(), PetscBagRegisterReal(), PetscBagRegisterInt(), PetscBagRegisterBool(), PetscBagRegisterScalar(), PetscBagCreate(), PetscBagGetName(), PetscBagView(), PetscBagRegisterEnum()
External Links
- PETSc Manual:
Bag/PetscBagSetFromOptions
PETSc.LibPETSc.PetscBagSetName — Method
PetscBagSetName(petsclib::PetscLibType, bag::PetscBag, name::String, help::String)Sets the name of a bag of values
Not Collective
Level: intermediate
Input Parameters:
bag- the bag of valuesname- the name assigned to the baghelp- help message for bag
See also: PetscBag, PetscBagGetName(), PetscBagView(), PetscBagLoad(), PetscBagGetData(), PetscBagRegisterReal(), PetscBagRegisterInt(), PetscBagRegisterBool(), PetscBagRegisterScalar(), PetscBagSetFromOptions(), PetscBagCreate(), PetscBagDestroy(), PetscBagRegisterEnum()
External Links
- PETSc Manual:
Bag/PetscBagSetName
PETSc.LibPETSc.PetscBagSetOptionsPrefix — Method
PetscBagSetOptionsPrefix(petsclib::PetscLibType, bag::PetscBag, pre::String)Sets the prefix used for searching for all PetscBag items in the options database.
Logically Collective
Level: intermediate
Input Parameters:
bag- the bag of valuespre- the prefix to prepend all Bag item names with.
See also: PetscBag, PetscBagRegisterReal(), PetscBagRegisterInt(), PetscBagRegisterBool(), PetscBagRegisterScalar(), PetscBagSetFromOptions(), PetscBagCreate(), PetscBagDestroy(), PetscBagRegisterEnum()
External Links
- PETSc Manual:
Bag/PetscBagSetOptionsPrefix
PETSc.LibPETSc.PetscBagView — Method
PetscBagView(petsclib::PetscLibType, bag::PetscBag, view::PetscViewer)Views a bag of values as either ASCII text or a binary file
Collective
Input Parameters:
bag- the bag of valuesview- location to view the values
Level: beginner
See also: PetscBag, PetscBagSetName(), PetscBagDestroy(), PetscBagLoad(), PetscBagGetData(), PetscBagRegisterReal(), PetscBagRegisterInt(), PetscBagRegisterBool(), PetscBagRegisterScalar(), PetscBagRegisterEnum(), PetscBagSetFromOptions(), PetscBagCreate(), PetscBagGetName()
External Links
- PETSc Manual:
Bag/PetscBagView
PETSc.LibPETSc.PetscBagViewFromOptions — Method
PetscBagViewFromOptions(petsclib::PetscLibType, bag::PetscBag, bobj, name::String)Processes command line options to determine if/how a PetscBag is to be viewed.
Collective
Input Parameters:
bag- the objectbobj- optional other object that provides prefix (ifNULLthen the prefix in obj is used)name- option to activate viewing
Options Database Key:
-name [viewertype][:...]- option name and values. SeePetscObjectViewFromOptions()for the possible arguments
Level: intermediate
See also: PetscBagCreate(), PetscBag, PetscViewer, PetscBagView(), PetscObjectViewFromOptions()
External Links
- PETSc Manual:
Bag/PetscBagViewFromOptions
PetscToken
PETSc.LibPETSc.PetscTokenCreate — Method
t::PetscToken = PetscTokenCreate(petsclib::PetscLibType, a::String, b::Cchar)Creates a PetscToken used to find tokens in a string
Not Collective; No Fortran Support
Input Parameters:
a- the string to look inb- the separator character
Output Parameter:
t- the token object
Level: intermediate
See also: PetscToken, PetscTokenFind(), PetscTokenDestroy()
External Links
- PETSc Manual:
Sys/PetscTokenCreate
PETSc.LibPETSc.PetscTokenDestroy — Method
PetscTokenDestroy(petsclib::PetscLibType, a::Union{PetscToken, Ref{PetscToken}})Destroys a PetscToken
Not Collective; No Fortran Support
Input Parameter:
a- pointer to token
Level: intermediate
See also: PetscToken, PetscTokenCreate(), PetscTokenFind()
External Links
- PETSc Manual:
Sys/PetscTokenDestroy
PETSc.LibPETSc.PetscTokenFind — Method
result::String = PetscTokenFind(petsclib::PetscLibType, a::PetscToken)Locates next "token" in a PetscToken
Not Collective; No Fortran Support
Input Parameter:
a- pointer to token
Output Parameter:
result- location of occurrence,NULLif not found
Level: intermediate
See also: PetscToken, PetscTokenCreate(), PetscTokenDestroy()
External Links
- PETSc Manual:
Sys/PetscTokenFind
PetscSegBuffer
PETSc.LibPETSc.PetscSegBufferCreate — Method
seg::PetscSegBuffer = PetscSegBufferCreate(petsclib::PetscLibType, unitbytes::Csize_t, expected::PetscCount)create a segmented buffer
Not Collective, No Fortran Support
Input Parameters:
unitbytes- number of bytes that each entry will containexpected- expected/typical number of entries
Output Parameter:
seg-PetscSegBufferobject
Level: developer
See also: PetscSegBufferGet(), PetscSegBufferExtractAlloc(), PetscSegBufferExtractTo(), PetscSegBufferExtractInPlace(), PetscSegBufferDestroy(), PetscSegBuffer
External Links
- PETSc Manual:
Sys/PetscSegBufferCreate
PETSc.LibPETSc.PetscSegBufferDestroy — Method
PetscSegBufferDestroy(petsclib::PetscLibType, seg::Union{PetscSegBuffer, Ref{PetscSegBuffer}})destroy segmented buffer
Not Collective, No Fortran Support
Input Parameter:
seg- address of segmented buffer object
Level: developer
See also: PetscSegBuffer, PetscSegBufferCreate()
External Links
- PETSc Manual:
Sys/PetscSegBufferDestroy
PETSc.LibPETSc.PetscSegBufferExtractAlloc — Method
contiguous::Ptr{Cvoid} = PetscSegBufferExtractAlloc(petsclib::PetscLibType, seg::PetscSegBuffer)extract contiguous data to new allocation and reset segmented buffer
Not Collective, No Fortran Support
Input Parameter:
seg-PetscSegBufferbuffer
Output Parameter:
contiguous- address of new array containing contiguous data, caller frees withPetscFree()
Level: developer
See also: PetscSegBufferCreate(), PetscSegBufferGet(), PetscSegBufferDestroy(), PetscSegBufferExtractTo(), PetscSegBufferExtractInPlace(), PetscSegBuffer
External Links
- PETSc Manual:
Sys/PetscSegBufferExtractAlloc
PETSc.LibPETSc.PetscSegBufferExtractInPlace — Method
contig::Ptr{Cvoid} = PetscSegBufferExtractInPlace(petsclib::PetscLibType, seg::PetscSegBuffer)extract in-place contiguous representation of data and reset segmented buffer for reuse
Not Collective, No Fortran Support
Input Parameter:
seg-PetscSegBufferobject
Output Parameter:
contig- address of pointer to contiguous memory, may beNULL
Level: developer
See also: PetscSegBuffer, PetscSegBufferExtractAlloc(), PetscSegBufferExtractTo()
External Links
- PETSc Manual:
Sys/PetscSegBufferExtractInPlace
PETSc.LibPETSc.PetscSegBufferExtractTo — Method
PetscSegBufferExtractTo(petsclib::PetscLibType, seg::PetscSegBuffer, contig::Ptr{Cvoid})extract contiguous data to provided buffer and reset segmented buffer
Not Collective, No Fortran Support
Input Parameters:
seg- segmented buffercontig- allocated buffer to hold contiguous data
Level: developer
See also: PetscSegBufferCreate(), PetscSegBufferGet(), PetscSegBufferDestroy(), PetscSegBufferExtractAlloc(), PetscSegBufferExtractInPlace(), PetscSegBuffer
External Links
- PETSc Manual:
Sys/PetscSegBufferExtractTo
PETSc.LibPETSc.PetscSegBufferGet — Method
buf::Ptr{Cvoid} = PetscSegBufferGet(petsclib::PetscLibType, seg::PetscSegBuffer, count::PetscCount)get new buffer space from a segmented buffer
Not Collective, No Fortran Support
Input Parameters:
seg-PetscSegBufferbuffercount- number of entries needed
Output Parameter:
buf- address of new buffer for contiguous data
Level: developer
See also: PetscSegBufferCreate(), PetscSegBufferExtractAlloc(), PetscSegBufferExtractTo(), PetscSegBufferExtractInPlace(), PetscSegBufferDestroy(), PetscSegBuffer, PetscSegBufferGetInts()
External Links
- PETSc Manual:
Sys/PetscSegBufferGet
PETSc.LibPETSc.PetscSegBufferGetSize — Method
usedsize::PetscCount = PetscSegBufferGetSize(petsclib::PetscLibType, seg::PetscSegBuffer)get currently used number of entries of a PetscSegBuffer
Not Collective, No Fortran Support
Input Parameter:
seg-PetscSegBufferobject
Output Parameter:
usedsize- number of used units
Level: developer
See also: PetscSegBuffer, PetscSegBufferExtractAlloc(), PetscSegBufferExtractTo(), PetscSegBufferCreate(), PetscSegBufferGet()
External Links
- PETSc Manual:
Sys/PetscSegBufferGetSize
PETSc.LibPETSc.PetscSegBufferUnuse — Method
PetscSegBufferUnuse(petsclib::PetscLibType, seg::PetscSegBuffer, unused::PetscCount)return some unused entries obtained with an overzealous PetscSegBufferGet()
Not Collective, No Fortran Support
Input Parameters:
seg-PetscSegBufferobjectunused- number of unused units to return
Level: developer
See also: PetscSegBuffer, PetscSegBufferCreate(), PetscSegBufferGet()
External Links
- PETSc Manual:
Sys/PetscSegBufferUnuse
PetscHeap
PETSc.LibPETSc.PetscHeapAdd — Method
PetscHeapAdd(petsclib::PetscLibType, h::PetscHeap, id::PetscInt, val::PetscInt)Insert an item into a PetscHeap.
Not Collective
Input Parameters:
h- thePetscHeapid- the item identifierval- the value used for heap ordering
Level: developer
See also: PetscHeap, PetscHeapCreate(), PetscHeapPop(), PetscHeapPeek(), PetscHeapStash(), PetscHeapUnstash(), PetscHeapDestroy()
External Links
- PETSc Manual:
Mat/PetscHeapAdd
PETSc.LibPETSc.PetscHeapCreate — Method
heap::PetscHeap = PetscHeapCreate(petsclib::PetscLibType, maxsize::PetscInt)Creates a PetscHeap object, a simple min-heap for (id, value) pairs.
Not Collective
Input Parameter:
maxsize- the maximum number of items the heap can hold at once
Output Parameter:
heap- the newly createdPetscHeapobject
Level: developer
See also: PetscHeap, PetscHeapAdd(), PetscHeapPop(), PetscHeapPeek(), PetscHeapStash(), PetscHeapUnstash(), PetscHeapView(), PetscHeapDestroy()
External Links
- PETSc Manual:
Mat/PetscHeapCreate
PETSc.LibPETSc.PetscHeapDestroy — Method
PetscHeapDestroy(petsclib::PetscLibType, heap::Union{PetscHeap, Ref{PetscHeap}})Destroys a PetscHeap created with PetscHeapCreate().
Not Collective
Input Parameter:
heap- thePetscHeapto destroy; set toNULLon return
Level: developer
See also: PetscHeap, PetscHeapCreate()
External Links
- PETSc Manual:
Mat/PetscHeapDestroy
PETSc.LibPETSc.PetscHeapPeek — Method
id::PetscInt,val::PetscInt = PetscHeapPeek(petsclib::PetscLibType, h::PetscHeap)Return the minimum item of a PetscHeap without removing it.
Not Collective
Input Parameter:
h- thePetscHeap
Output Parameters:
id- identifier of the minimum item, or-1if the heap is emptyval- value of the minimum item, orPETSC_INT_MINif the heap is empty
Level: developer
See also: PetscHeap, PetscHeapCreate(), PetscHeapAdd(), PetscHeapPop(), PetscHeapDestroy()
External Links
- PETSc Manual:
Mat/PetscHeapPeek
PETSc.LibPETSc.PetscHeapPop — Method
id::PetscInt,val::PetscInt = PetscHeapPop(petsclib::PetscLibType, h::PetscHeap)Remove and return the minimum item from a PetscHeap.
Not Collective
Input Parameter:
h- thePetscHeap
Output Parameters:
id- identifier of the popped item, or-1if the heap is emptyval- value of the popped item, orPETSC_INT_MINif the heap is empty
Level: developer
See also: PetscHeap, PetscHeapCreate(), PetscHeapAdd(), PetscHeapPeek(), PetscHeapStash(), PetscHeapUnstash(), PetscHeapDestroy()
External Links
- PETSc Manual:
Mat/PetscHeapPop
PETSc.LibPETSc.PetscHeapStash — Method
PetscHeapStash(petsclib::PetscLibType, h::PetscHeap, id::PetscInt, val::PetscInt)Set aside an item in a PetscHeap for later insertion via PetscHeapUnstash().
Not Collective
Input Parameters:
h- thePetscHeapid- the item identifierval- the value used for heap ordering
Level: developer
See also: PetscHeap, PetscHeapCreate(), PetscHeapAdd(), PetscHeapUnstash(), PetscHeapDestroy()
External Links
- PETSc Manual:
Mat/PetscHeapStash
PETSc.LibPETSc.PetscHeapUnstash — Method
PetscHeapUnstash(petsclib::PetscLibType, h::PetscHeap)Reinsert all items previously stashed with PetscHeapStash() into the heap.
Not Collective
Input Parameter:
h- thePetscHeap
Level: developer
See also: PetscHeap, PetscHeapCreate(), PetscHeapAdd(), PetscHeapStash(), PetscHeapDestroy()
External Links
- PETSc Manual:
Mat/PetscHeapUnstash
PETSc.LibPETSc.PetscHeapView — Method
PetscHeapView(petsclib::PetscLibType, h::PetscHeap, viewer::PetscViewer)View the contents of a PetscHeap, including any stashed items.
Not Collective
Input Parameters:
h- thePetscHeapviewer- aPetscViewer, orNULLto usePETSC_VIEWER_STDOUT_SELF
Level: developer
See also: PetscHeap, PetscHeapCreate(), PetscHeapAdd(), PetscHeapPop()
External Links
- PETSc Manual:
Mat/PetscHeapView
PetscIntStack
PETSc.LibPETSc.PetscIntStackCreate — Method
stack::PetscIntStack = PetscIntStackCreate(petsclib::PetscLibType)This function creates a stack.
Not Collective, No Fortran Support
Output Parameter:
stack- The stack
Level: developer
See also: PetscIntStackDestroy(), PetscIntStackEmpty(), PetscIntStackPush(), PetscIntStackPop(), PetscIntStackTop()
External Links
- PETSc Manual:
Log/PetscIntStackCreate
PETSc.LibPETSc.PetscIntStackDestroy — Method
PetscIntStackDestroy(petsclib::PetscLibType, stack::PetscIntStack)This function destroys a stack.
Not Collective, No Fortran Support
Input Parameter:
stack- The stack
Level: developer
See also: PetscIntStackCreate(), PetscIntStackEmpty(), PetscIntStackPush(), PetscIntStackPop(), PetscIntStackTop()
External Links
- PETSc Manual:
Log/PetscIntStackDestroy
PETSc.LibPETSc.PetscIntStackEmpty — Method
empty::PetscBool = PetscIntStackEmpty(petsclib::PetscLibType, stack::PetscIntStack)This function determines whether any items have been pushed.
Not Collective, No Fortran Support
Input Parameter:
stack- The stack
Output Parameter:
empty-PETSC_TRUEif the stack is empty
Level: developer
See also: PetscIntStackCreate(), PetscIntStackDestroy(), PetscIntStackPush(), PetscIntStackPop(), PetscIntStackTop()
External Links
- PETSc Manual:
Log/PetscIntStackEmpty
PETSc.LibPETSc.PetscIntStackPop — Method
item::Cint = PetscIntStackPop(petsclib::PetscLibType, stack::PetscIntStack)This function pops an integer from the stack.
Not Collective, No Fortran Support
Input Parameter:
stack- The stack
Output Parameter:
item- The integer popped
Level: developer
See also: PetscIntStackCreate(), PetscIntStackDestroy(), PetscIntStackEmpty(), PetscIntStackPush(), PetscIntStackTop()
External Links
- PETSc Manual:
Log/PetscIntStackPop
PETSc.LibPETSc.PetscIntStackPush — Method
PetscIntStackPush(petsclib::PetscLibType, stack::PetscIntStack, item::Cint)This function pushes an integer on the stack.
Not Collective, No Fortran Support
Input Parameters:
stack- The stackitem- The integer to push
Level: developer
See also: PetscIntStackCreate(), PetscIntStackDestroy(), PetscIntStackEmpty(), PetscIntStackPop(), PetscIntStackTop()
External Links
- PETSc Manual:
Log/PetscIntStackPush
PETSc.LibPETSc.PetscIntStackTop — Method
top::Cint = PetscIntStackTop(petsclib::PetscLibType, stack::PetscIntStack)This function returns the top of the stack.
Not Collective, No Fortran Support
Input Parameter:
stack- The stack
Output Parameter:
top- The integer on top of the stack
Level: developer
See also: PetscIntStackCreate(), PetscIntStackDestroy(), PetscIntStackEmpty(), PetscIntStackPush(), PetscIntStackPop()
External Links
- PETSc Manual:
Log/PetscIntStackTop
PetscKDTree
PETSc.LibPETSc.PetscKDTreeCreate — Method
new_tree::PetscKDTree = PetscKDTreeCreate(petsclib::PetscLibType, num_coords::PetscCount, dim::PetscInt, coords::Vector{PetscReal}, copy_mode::PetscCopyMode, max_bucket_size::PetscInt)create a PetscKDTree
Not Collective, No Fortran Support
Input Parameters:
num_coords- number of coordinate points to build thePetscKDTreedim- the dimension of the coordinatescoords- array of the coordinates, in point-major ordercopy_mode- behavior handlingcoords,PETSC_COPY_VALUESgenerally more performantmax_bucket_size- maximum number of points stored at each leaf
Output Parameter:
new_tree- the resultingPetscKDTree
Level: advanced
See also: PetscKDTree, PetscKDTreeDestroy(), PetscKDTreeQueryPointsNearestNeighbor()
External Links
- PETSc Manual:
IS/PetscKDTreeCreate
PETSc.LibPETSc.PetscKDTreeDestroy — Method
PetscKDTreeDestroy(petsclib::PetscLibType, tree::Union{PetscKDTree, Ref{PetscKDTree}})destroy a PetscKDTree
Not Collective, No Fortran Support
Input Parameters:
tree- tree to destroy
Level: advanced
See also: PetscKDTree, PetscKDTreeCreate()
External Links
- PETSc Manual:
IS/PetscKDTreeDestroy
PETSc.LibPETSc.PetscKDTreeQueryPointsNearestNeighbor — Method
PetscKDTreeQueryPointsNearestNeighbor(petsclib::PetscLibType, tree::PetscKDTree, num_points::PetscCount, points::Vector{PetscReal}, tolerance::PetscReal, indices::Vector{PetscCount}, distances::Vector{PetscReal})find the nearest neighbor in a PetscKDTree
Not Collective, No Fortran Support
Input Parameters:
tree- tree to querynum_points- number of points to querypoints- array of the coordinates, in point-major ordertolerance- tolerance for nearest neighbor
Output Parameters:
indices- indices of the nearest neighbor to the query pointdistances- distance between the queried point and the nearest neighbor
Level: advanced
See also: PetscKDTree, PetscKDTreeCreate()
External Links
- PETSc Manual:
IS/PetscKDTreeQueryPointsNearestNeighbor
PETSc.LibPETSc.PetscKDTreeView — Method
PetscKDTreeView(petsclib::PetscLibType, tree::PetscKDTree, viewer::PetscViewer)view a PetscKDTree
Not Collective, No Fortran Support
Input Parameters:
tree- tree to viewviewer- visualization context
Level: advanced
See also: PetscKDTree, PetscKDTreeCreate(), PetscViewer
External Links
- PETSc Manual:
IS/PetscKDTreeView
PetscGridHash
PETSc.LibPETSc.PetscGridHashCreate — Method
box::PetscGridHash = PetscGridHashCreate(petsclib::PetscLibType, comm::MPI_Comm, dim::PetscInt, point::Vector{PetscScalar})Create a PetscGridHash for spatially locating points in a mesh.
Collective
Input Parameters:
comm- the MPI communicatordim- the spatial dimensionpoint- an initial point used to seed the bounding box, orNULLfor a zero-initialized box
Output Parameter:
box- the newly createdPetscGridHash
Level: developer
See also: DMPLEX, PetscGridHash, PetscGridHashEnlarge(), PetscGridHashDestroy()
External Links
- PETSc Manual:
DMPlex/PetscGridHashCreate
PETSc.LibPETSc.PetscGridHashDestroy — Method
PetscGridHashDestroy(petsclib::PetscLibType, box::Union{PetscGridHash, Ref{PetscGridHash}})Destroy a PetscGridHash and free its resources.
Collective
Input Parameter:
box- thePetscGridHashto destroy; set toNULLon return
Level: developer
See also: DMPLEX, PetscGridHash, PetscGridHashCreate(), PetscGridHashEnlarge()
External Links
- PETSc Manual:
DMPlex/PetscGridHashDestroy
PETSc.LibPETSc.PetscGridHashEnlarge — Method
PetscGridHashEnlarge(petsclib::PetscLibType, box::PetscGridHash, point::Vector{PetscScalar})Enlarge the bounding box of a PetscGridHash to include a new point.
Not Collective
Input Parameters:
box- thePetscGridHashpoint- the point whose coordinates extend the box's lower and upper bounds
Level: developer
See also: DMPLEX, PetscGridHash, PetscGridHashCreate(), PetscGridHashDestroy()
External Links
- PETSc Manual:
DMPlex/PetscGridHashEnlarge
PETSc.LibPETSc.PetscGridHashGetEnclosingBox — Method
PetscGridHashGetEnclosingBox(petsclib::PetscLibType, box::PetscGridHash, numPoints::PetscInt, points::Vector{PetscScalar}, dboxes::Vector{PetscInt}, boxes::Vector{PetscInt})Find the grid boxes containing each input point
Not Collective
Input Parameters:
box- The grid hash objectnumPoints- The number of input pointspoints- The input point coordinates
Output Parameters:
dboxes- An array ofnumPointsxdimintegers expressing the enclosing box as (i0, i1, ..., i_dim)boxes- An array ofnumPointsintegers expressing the enclosing box as single number, orNULL
Level: developer
See also: DMPLEX, PetscGridHashCreate()
External Links
- PETSc Manual:
DMPlex/PetscGridHashGetEnclosingBox
PETSc.LibPETSc.PetscGridHashSetGrid — Method
PetscGridHashSetGrid(petsclib::PetscLibType, box::PetscGridHash, n::Vector{PetscInt}, h::Vector{PetscReal})Divide the grid into boxes
Not Collective
Input Parameters:
box- The grid hash objectn- The number of boxes in each dimension, may usePETSC_DETERMINEfor the entriesh- The box size in each dimension, only used if n[d] ==PETSC_DETERMINE, if not needed you can pass inNULL
Level: developer
See also: DMPLEX, PetscGridHashCreate()
External Links
- PETSc Manual:
DMPlex/PetscGridHashSetGrid
PetscOmpCtrl
PETSc.LibPETSc.PetscOmpCtrlBarrier — Method
PetscOmpCtrlBarrier(petsclib::PetscLibType, ctrl::PetscOmpCtrl)Do barrier on MPI ranks in omp_comm contained by the PETSc OMP controller (to let slave ranks free their CPU)
Input Parameter:
ctrl- a PETSc OMP controller
See also: PetscOmpCtrlOmpRegionOnMasterBegin(), PetscOmpCtrlOmpRegionOnMasterEnd(), PetscOmpCtrlCreate(), PetscOmpCtrlDestroy()
External Links
- PETSc Manual:
Sys/PetscOmpCtrlBarrier
PETSc.LibPETSc.PetscOmpCtrlCreate — Method
pctrl::PetscOmpCtrl = PetscOmpCtrlCreate(petsclib::PetscLibType, petsc_comm::MPI_Comm, nthreads::PetscInt)create a PETSc OpenMP controller, which manages PETSc's interaction with third party libraries that use OpenMP
Input Parameters:
petsc_comm- a communicator some PETSc object (for example, a matrix) lives innthreads- number of threads per MPI rank to spawn in a library using OpenMP. If nthreads = -1, let PETSc decide a suitable value
Output Parameter:
pctrl- a PETSc OpenMP controller
Level: developer
See also: PetscOmpCtrlDestroy(), PetscOmpCtrlGetOmpComms(), PetscOmpCtrlBarrier(), PetscOmpCtrlOmpRegionOnMasterBegin(), PetscOmpCtrlOmpRegionOnMasterEnd()
External Links
- PETSc Manual:
Sys/PetscOmpCtrlCreate
PETSc.LibPETSc.PetscOmpCtrlDestroy — Method
PetscOmpCtrlDestroy(petsclib::PetscLibType, pctrl::Union{PetscOmpCtrl, Ref{PetscOmpCtrl}})destroy the PETSc OpenMP controller
Input Parameter:
pctrl- a PETSc OpenMP controller
Level: developer
See also: PetscOmpCtrlCreate(), PetscOmpCtrlGetOmpComms(), PetscOmpCtrlBarrier(), PetscOmpCtrlOmpRegionOnMasterBegin(), PetscOmpCtrlOmpRegionOnMasterEnd()
External Links
- PETSc Manual:
Sys/PetscOmpCtrlDestroy
PETSc.LibPETSc.PetscOmpCtrlGetOmpComms — Method
omp_comm::MPI_Comm,omp_master_comm::MPI_Comm,is_omp_master::PetscBool = PetscOmpCtrlGetOmpComms(petsclib::PetscLibType, ctrl::PetscOmpCtrl)Get MPI communicators from a PETSc OMP controller
Input Parameter:
ctrl- a PETSc OMP controller
Output Parameters:
omp_comm- a communicator that includes a master rank and slave ranks where master spawns threadsomp_master_comm- on master ranks, return a communicator that include master ranks of each omp_comm;
on slave ranks, MPI_COMM_NULL will be return in reality.
is_omp_master- true if the calling process is an OMP master rank.
See also: PetscOmpCtrlCreate(), PetscOmpCtrlDestroy(), PetscOmpCtrlBarrier(), PetscOmpCtrlOmpRegionOnMasterBegin(), PetscOmpCtrlOmpRegionOnMasterEnd()
External Links
- PETSc Manual:
Sys/PetscOmpCtrlGetOmpComms
PETSc.LibPETSc.PetscOmpCtrlOmpRegionOnMasterBegin — Method
PetscOmpCtrlOmpRegionOnMasterBegin(petsclib::PetscLibType, ctrl::PetscOmpCtrl)Mark the beginning of an OpenMP library call on master ranks
Input Parameter:
ctrl- a PETSc OMP controller
See also: PetscOmpCtrlOmpRegionOnMasterEnd(), PetscOmpCtrlCreate(), PetscOmpCtrlDestroy(), PetscOmpCtrlBarrier()
External Links
- PETSc Manual:
Sys/PetscOmpCtrlOmpRegionOnMasterBegin
PETSc.LibPETSc.PetscOmpCtrlOmpRegionOnMasterEnd — Method
PetscOmpCtrlOmpRegionOnMasterEnd(petsclib::PetscLibType, ctrl::PetscOmpCtrl)Mark the end of an OpenMP library call on master ranks
Input Parameter:
ctrl- a PETSc OMP controller
See also: PetscOmpCtrlOmpRegionOnMasterBegin(), PetscOmpCtrlCreate(), PetscOmpCtrlDestroy(), PetscOmpCtrlBarrier()
External Links
- PETSc Manual:
Sys/PetscOmpCtrlOmpRegionOnMasterEnd
PetscMatlabEngine
PETSc.LibPETSc.PetscMatlabEngineCreate — Method
mengine::PetscMatlabEngine = PetscMatlabEngineCreate(petsclib::PetscLibType, comm::MPI_Comm, host::String)Creates a MATLAB engine object
Not Collective
Input Parameters:
comm- a separate MATLAB engine is started for each process in the communicatorhost- name of machine where MATLAB engine is to be run (usually NULL)
Output Parameter:
mengine- the resulting object
Options Database Keys:
-matlab_engine_graphics- allow the MATLAB engine to display graphics-matlab_engine_host- hostname, machine to run the MATLAB engine on-info- print out all requests to MATLAB and all if its responses (for debugging)
Level: advanced
See also: PetscMatlabEngineDestroy(), PetscMatlabEnginePut(), PetscMatlabEngineGet(), PetscMatlabEngineEvaluate(), PetscMatlabEngineGetOutput(), PetscMatlabEnginePrintOutput(), PETSC_MATLAB_ENGINE_(), PetscMatlabEnginePutArray(), PetscMatlabEngineGetArray(), PetscMatlabEngine
External Links
- PETSc Manual:
Matlab/PetscMatlabEngineCreate
PETSc.LibPETSc.PetscMatlabEngineDestroy — Method
PetscMatlabEngineDestroy(petsclib::PetscLibType, v::Union{PetscMatlabEngine, Ref{PetscMatlabEngine}})Shuts down a MATLAB engine.
Collective
Input Parameter:
v- the engine
Level: advanced
See also: PetscMatlabEngineCreate(), PetscMatlabEnginePut(), PetscMatlabEngineGet(), PetscMatlabEngineEvaluate(), PetscMatlabEngineGetOutput(), PetscMatlabEnginePrintOutput(), PETSC_MATLAB_ENGINE_(), PetscMatlabEnginePutArray(), PetscMatlabEngineGetArray(), PetscMatlabEngine
External Links
- PETSc Manual:
Matlab/PetscMatlabEngineDestroy
PETSc.LibPETSc.PetscMatlabEngineGet — Method
PetscMatlabEngineGet(petsclib::PetscLibType, mengine::PetscMatlabEngine, obj)Gets a variable from MATLAB into a PETSc object.
Collective
Input Parameters:
mengine- the MATLAB engineobj- the PETSc object, for example aVec
Level: advanced
See also: PetscMatlabEngineDestroy(), PetscMatlabEnginePut(), PetscMatlabEngineCreate(), PetscMatlabEngineEvaluate(), PetscMatlabEngineGetOutput(), PetscMatlabEnginePrintOutput(), PETSC_MATLAB_ENGINE_(), PetscMatlabEnginePutArray(), PetscMatlabEngineGetArray(), PetscMatlabEngine
External Links
- PETSc Manual:
Matlab/PetscMatlabEngineGet
PETSc.LibPETSc.PetscMatlabEngineGetArray — Method
PetscMatlabEngineGetArray(petsclib::PetscLibType, mengine::PetscMatlabEngine, m::Cint, n::Cint, array::Vector{PetscScalar}, name::String)Gets a variable from MATLAB into an array
Not Collective
Input Parameters:
mengine- the MATLAB enginem- the x dimension of the arrayn- the y dimension of the arrayarray- the array (represented in one dimension), much be large enough to hold all the dataname- the name of the array
Level: advanced
See also: PetscMatlabEngineDestroy(), PetscMatlabEnginePut(), PetscMatlabEngineCreate(), PetscMatlabEngineEvaluate(), PetscMatlabEngineGetOutput(), PetscMatlabEnginePrintOutput(), PETSC_MATLAB_ENGINE_(), PetscMatlabEnginePutArray(), PetscMatlabEngineGet(), PetscMatlabEngine
External Links
- PETSc Manual:
Matlab/PetscMatlabEngineGetArray
PETSc.LibPETSc.PetscMatlabEngineGetOutput — Method
string::String = PetscMatlabEngineGetOutput(petsclib::PetscLibType, mengine::PetscMatlabEngine)Gets a string buffer where the MATLAB output is printed
Not Collective
Input Parameter:
mengine- the MATLAB engine
Output Parameter:
string- buffer where MATLAB output is printed
Level: advanced
See also: PetscMatlabEngineDestroy(), PetscMatlabEnginePut(), PetscMatlabEngineGet(), PetscMatlabEngineEvaluate(), PetscMatlabEngineCreate(), PetscMatlabEnginePrintOutput(), PETSC_MATLAB_ENGINE_(), PetscMatlabEnginePutArray(), PetscMatlabEngineGetArray(), PetscMatlabEngine
External Links
- PETSc Manual:
Matlab/PetscMatlabEngineGetOutput
PETSc.LibPETSc.PetscMatlabEnginePrintOutput — Method
PetscMatlabEnginePrintOutput(petsclib::PetscLibType, mengine::PetscMatlabEngine, fd::Libc.FILE)prints the output from MATLAB to an ASCII file
Collective
Input Parameters:
mengine- the MATLAB enginefd- the file
Level: advanced
See also: PetscMatlabEngineDestroy(), PetscMatlabEnginePut(), PetscMatlabEngineGet(), PetscMatlabEngineEvaluate(), PetscMatlabEngineGetOutput(), PetscMatlabEngineCreate(), PETSC_MATLAB_ENGINE_(), PetscMatlabEnginePutArray(), PetscMatlabEngineGetArray(), PetscMatlabEngine
External Links
- PETSc Manual:
Matlab/PetscMatlabEnginePrintOutput
PETSc.LibPETSc.PetscMatlabEnginePut — Method
PetscMatlabEnginePut(petsclib::PetscLibType, mengine::PetscMatlabEngine, obj)Puts a PETSc object, such as a Mat or Vec into the MATLAB space. For parallel objects, each processor's part is put in a separate MATLAB process.
Collective
Input Parameters:
mengine- the MATLAB engineobj- the PETSc object, for example Vec
Level: advanced
See also: PetscMatlabEngineDestroy(), PetscMatlabEngineCreate(), PetscMatlabEngineGet(), PetscMatlabEngineEvaluate(), PetscMatlabEngineGetOutput(), PetscMatlabEnginePrintOutput(), PETSC_MATLAB_ENGINE_(), PetscMatlabEnginePutArray(), PetscMatlabEngineGetArray(), PetscMatlabEngine
External Links
- PETSc Manual:
Matlab/PetscMatlabEnginePut
PETSc.LibPETSc.PetscMatlabEnginePutArray — Method
PetscMatlabEnginePutArray(petsclib::PetscLibType, mengine::PetscMatlabEngine, m::Cint, n::Cint, array::Vector{PetscScalar}, name::String)Puts an array into the MATLAB space, treating it as a Fortran style (column major ordering) array. For parallel objects, each processors part is put in a separate MATLAB process.
Collective
Input Parameters:
mengine- the MATLAB enginem- the x dimension of the arrayn- the y dimension of the arrayarray- the array (represented in one dimension)name- the name of the array
Level: advanced
See also: PetscMatlabEngineDestroy(), PetscMatlabEngineCreate(), PetscMatlabEngineGet(), PetscMatlabEngineEvaluate(), PetscMatlabEngineGetOutput(), PetscMatlabEnginePrintOutput(), PETSC_MATLAB_ENGINE_(), PetscMatlabEnginePut(), PetscMatlabEngineGetArray(), PetscMatlabEngine
External Links
- PETSc Manual:
Matlab/PetscMatlabEnginePutArray
PetscBench
PETSc.LibPETSc.PetscBenchCreate — Method
bm::PetscBench = PetscBenchCreate(petsclib::PetscLibType, comm::MPI_Comm)Create a PETSc benchmark PetscBench object
Collective
Input Parameter:
comm- communicator to share thePetscBench
Output Parameter:
bm- thePetscBench
Level: advanced
See also: PetscBench, PetscBenchSetFromOptions(), PetscBenchRun(), PetscBenchViewFromOptions(), PetscBenchDestroy(), PetscBenchSetUp(), PetscBenchSetType(), PetscBenchSetSize(), PetscBenchGetSize()
External Links
- PETSc Manual:
BM/PetscBenchCreate
PETSc.LibPETSc.PetscBenchDestroy — Method
PetscBenchDestroy(petsclib::PetscLibType, bm::Union{PetscBench, Ref{PetscBench}})Destroys a PetscBench
Collective
Input Parameter:
bm- thePetscBench
Level: advanced
See also: PetscBench, PetscBenchView(), PetscBenchSetFromOptions(), PetscBenchCreate()
External Links
- PETSc Manual:
BM/PetscBenchDestroy
PETSc.LibPETSc.PetscBenchGetSize — Method
n::PetscInt = PetscBenchGetSize(petsclib::PetscLibType, bm::PetscBench)Gets the size of the PetscBench benchmark to run
Logically Collective
Input Parameter:
bm- thePetscBench
Output Parameter:
n- the size
Level: advanced
See also: PetscBench, PetscBenchSetFromOptions(), PetscBenchRun(), PetscBenchViewFromOptions(), PetscBenchDestroy(), PetscBenchSetUp(), PetscBenchSetType(), PetscBenchSetOptionsPrefix(), PetscBenchSetSize()
External Links
- PETSc Manual:
BM/PetscBenchGetSize
PETSc.LibPETSc.PetscBenchGetType — Method
type::String = PetscBenchGetType(petsclib::PetscLibType, bm::PetscBench)Gets the PetscBenchType (as a string) from the PetscBench context.
Not Collective
Input Parameter:
bm- thePetscBench
Output Parameter:
type- name of benchmark method
Level: intermediate
See also: PetscBench, PetscBenchType, PetscBenchSetType(), PetscBenchCreate()
External Links
- PETSc Manual:
BM/PetscBenchGetType
PETSc.LibPETSc.PetscBenchInitializePackage — Method
PetscBenchInitializePackage(petsclib::PetscLibType)This function initializes everything in the PetscBench package.
Level: developer
See also: PetscInitialize(), PetscBenchCreate(), PetscBench, PetscBenchType
External Links
- PETSc Manual:
BM/PetscBenchInitializePackage
PETSc.LibPETSc.PetscBenchRegister — Method
PetscBenchRegister(petsclib::PetscLibType, sname::String, fnc::external)Adds a benchmark test, PetscBenchType, to the PetscBench package
Not Collective, No Fortran Support
Input Parameters:
sname- name of a new benchmarkfunction- routine to create benchmark
Calling sequence of function:
bm- thePetscBenchto be created
Level: advanced
See also: PetscBenchInitializePackage(), PetscBenchCreate(), PetscBench, PetscBenchType, PetscBenchSetType(), PetscBenchGetType()
External Links
- PETSc Manual:
BM/PetscBenchRegister
PETSc.LibPETSc.PetscBenchReset — Method
PetscBenchReset(petsclib::PetscLibType, bm::PetscBench)removes all the intermediate data structures in a PetscBench
Collective
Input Parameter:
bm- thePetscBench
Level: advanced
See also: PetscBench, PetscBenchView(), PetscBenchSetFromOptions(), PetscBenchCreate(), PetscBenchDestroy(), PetscBenchSetUp(), PetscBenchSetType()
External Links
- PETSc Manual:
BM/PetscBenchReset
PETSc.LibPETSc.PetscBenchRun — Method
PetscBenchRun(petsclib::PetscLibType, bm::PetscBench)runs the PetscBench
Collective
Input Parameter:
bm- thePetscBench
Level: advanced
See also: PetscBench, PetscBenchView(), PetscBenchSetFromOptions(), PetscBenchCreate(), PetscBenchDestroy(), PetscBenchSetUp(), PetscBenchSetType(), PetscBenchSetSize(), PetscBenchGetSize()
External Links
- PETSc Manual:
BM/PetscBenchRun
PETSc.LibPETSc.PetscBenchSetFromOptions — Method
PetscBenchSetFromOptions(petsclib::PetscLibType, bm::PetscBench)Sets options to a PetscBench using the options database
Collective
Input Parameter:
bm- thePetscBench
Level: advanced
See also: PetscBench, PetscBenchView(), PetscBenchRun(), PetscBenchCreate(), PetscBenchDestroy(), PetscBenchSetUp(), PetscBenchSetType(), PetscBenchSetSize(), PetscBenchGetSize()
External Links
- PETSc Manual:
BM/PetscBenchSetFromOptions
PETSc.LibPETSc.PetscBenchSetOptionsPrefix — Method
PetscBenchSetOptionsPrefix(petsclib::PetscLibType, bm::PetscBench, pre::String)Sets the prefix used for searching for all PetscBench items in the options database.
Logically Collective
Input Parameters:
bm- thePetscBenchpre- the prefix to prepend allPetscBenchoption names
Level: advanced
See also: PetscBench, PetscBenchSetFromOptions(), PetscBenchRun(), PetscBenchViewFromOptions(), PetscBenchDestroy(), PetscBenchSetUp(), PetscBenchSetType(), PetscBenchSetSize(), PetscBenchGetSize()
External Links
- PETSc Manual:
BM/PetscBenchSetOptionsPrefix
PETSc.LibPETSc.PetscBenchSetSize — Method
PetscBenchSetSize(petsclib::PetscLibType, bm::PetscBench, n::PetscInt)Sets the size of the PetscBench benchmark to run
Logically Collective
Input Parameters:
bm- thePetscBenchn- the size
Level: advanced
See also: PetscBench, PetscBenchSetFromOptions(), PetscBenchRun(), PetscBenchViewFromOptions(), PetscBenchDestroy(), PetscBenchSetUp(), PetscBenchSetType(), PetscBenchSetOptionsPrefix(), PetscBenchGetSize()
External Links
- PETSc Manual:
BM/PetscBenchSetSize
PETSc.LibPETSc.PetscBenchSetType — Method
PetscBenchSetType(petsclib::PetscLibType, bm::PetscBench, type::String)set the type of PetscBench benchmark to run
Collective
Input Parameters:
bm- thePetscBenchtype- a known method
Options Database Key:
-bm_type type- SetsPetscBenchtype
Level: advanced
See also: PetscBench, PetscBenchSetFromOptions(), PetscBenchRun(), PetscBenchViewFromOptions(), PetscBenchDestroy(), PetscBenchSetUp(), PetscBenchGetSize(), PetscBenchSetOptionsPrefix(), PetscBenchSetSize(), PetscBenchGetType(), PetscBenchCreate()
External Links
- PETSc Manual:
BM/PetscBenchSetType
PETSc.LibPETSc.PetscBenchSetUp — Method
PetscBenchSetUp(petsclib::PetscLibType, bm::PetscBench)sets up the PetscBench
Collective
Input Parameter:
bm- thePetscBench
Level: advanced
See also: PetscBench, PetscBenchView(), PetscBenchSetFromOptions(), PetscBenchCreate(), PetscBenchDestroy(), PetscBenchSetType(), PetscBenchRun(), PetscBenchSetSize(), PetscBenchGetSize()
External Links
- PETSc Manual:
BM/PetscBenchSetUp
PETSc.LibPETSc.PetscBenchView — Method
PetscBenchView(petsclib::PetscLibType, bm::PetscBench, viewer::PetscViewer)Views a PETSc benchmark PetscBench
Collective
Input Parameters:
bm- thePetscBenchviewer- location to viewbm
Level: advanced
See also: PetscBench, PetscBenchSetFromOptions(), PetscBenchRun(), PetscBenchCreate(), PetscBenchDestroy(), PetscBenchSetUp(), PetscBenchSetType(), PetscBenchSetSize(), PetscBenchGetSize(), PetscBenchViewFromOptions()
External Links
- PETSc Manual:
BM/PetscBenchView
PETSc.LibPETSc.PetscBenchViewFromOptions — Method
PetscBenchViewFromOptions(petsclib::PetscLibType, bm::PetscBench, bobj, name::String)Processes command line options to determine if/how a PetscBench is to be viewed.
Collective
Input Parameters:
bm- the objectbobj- optional other object that provides prefix (ifNULLthen the prefix inbmis used)name- option to activate viewing
Options Database Key:
-name [viewertype][:...]- option name and values. SeePetscObjectViewFromOptions()for the possible arguments
Level: advanced
See also: PetscBench, PetscBenchSetFromOptions(), PetscBenchRun(), PetscBenchCreate(), PetscBenchDestroy(), PetscBenchSetUp(), PetscBenchSetType(), PetscBenchSetSize(), PetscBenchGetSize(), PetscObjectViewFromOptions(), PetscViewer, PetscBenchView()
External Links
- PETSc Manual:
BM/PetscBenchViewFromOptions