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

source
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

source
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 interval
  • high - The upper bound of the interval

Level: intermediate

See also: PetscRandom, PetscRandomCreate(), PetscRandomSetInterval()

External Links

source
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

source
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

source
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

source
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

source
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 context
  • n - 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

source
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 context
  • n - 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

source
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

source
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 routine
  • function - The creation routine

Level: advanced

See also: PetscRandom, PetscRandomRegisterAll(), PetscRandomRegisterDestroy()

External Links

source
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

source
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

source
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 context
  • low - The lower bound of the interval
  • high - The upper bound of the interval

Level: intermediate

See also: PetscRandomCreate(), PetscRandomGetInterval()

External Links

source
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 context
  • prefix - the prefix to prepend to all option names

Level: advanced

See also: PetscRandom, PetscRandomSetFromOptions()

External Links

source
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 context
  • seed - The random seed

Level: intermediate

See also: PetscRandom, PetscRandomCreate(), PetscRandomGetSeed(), PetscRandomSeed()

External Links

source
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 context
  • type - 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, see PetscRandomType.

Level: intermediate

See also: PetscRandom, PetscRandomType, PetscRandomGetType(), PetscRandomCreate()

External Links

source
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 context
  • viewer - an optional visualization context

Level: beginner

See also: PetscRandom, PetscRealView(), PetscScalarView(), PetscIntView()

External Links

source
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 context
  • obj - Optional object
  • name - command line option

Options Database Key:

  • -name [viewertype][:...] - option name and values. See PetscObjectViewFromOptions() for the possible arguments

Level: intermediate

See also: PetscRandom, PetscRandomView, PetscObjectViewFromOptions(), PetscRandomCreate()

External Links

source

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 map
  • mapb - pointer to the second map

Output Parameter:

  • congruent - PETSC_TRUE if the two layouts are congruent, PETSC_FALSE otherwise

Level: beginner

See also: PetscLayout, PetscLayoutCreate(), PetscLayoutSetLocalSize(), PetscLayoutGetLocalSize(), PetscLayoutGetBlockSize(), PetscLayoutGetRange(), PetscLayoutGetRanges(), PetscLayoutSetSize(), PetscLayoutGetSize(), PetscLayoutSetUp()

External Links

source
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 new PetscLayout

Level: advanced

See also: PetscLayout, PetscLayoutSetLocalSize(), PetscLayoutSetSize(), PetscLayoutGetSize(), PetscLayoutGetLocalSize(), PetscLayout, PetscLayoutDestroy(), PetscLayoutGetRange(), PetscLayoutGetRanges(), PetscLayoutSetBlockSize(), PetscLayoutGetBlockSize(), PetscLayoutSetUp(), PetscLayoutCreateFromSizes()

External Links

source
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 communicator
  • range - the array of ownership ranges for each rank with length commsize+1
  • mode - the copy mode for range
  • bs - the block size (or PETSC_DECIDE)

Output Parameter:

  • newmap - the new PetscLayout

Level: developer

See also: PetscLayout, PetscLayoutCreate(), PetscLayoutSetLocalSize(), PetscLayoutSetSize(), PetscLayoutGetSize(), PetscLayoutGetLocalSize(), PetscLayout, PetscLayoutDestroy(), PetscLayoutGetRange(), PetscLayoutGetRanges(), PetscLayoutSetBlockSize(), PetscLayoutGetBlockSize(), PetscLayoutSetUp(), PetscLayoutCreateFromSizes()

External Links

source
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 communicator
  • n - the local size (or PETSC_DECIDE)
  • N - the global size (or PETSC_DECIDE)
  • bs - the block size (or PETSC_DECIDE)

Output Parameter:

  • map - the new PetscLayout

Level: advanced

See also: PetscLayout, PetscLayoutCreate(), PetscLayoutSetLocalSize(), PetscLayoutSetSize(), PetscLayoutGetSize(), PetscLayoutGetLocalSize(), PetscLayout, PetscLayoutDestroy(), PetscLayoutGetRange(), PetscLayoutGetRanges(), PetscLayoutSetBlockSize(), PetscLayoutGetBlockSize(), PetscLayoutSetUp(), PetscLayoutCreateFromRanges()

External Links

source
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 - the PetscLayout

Level: developer

See also: PetscLayout, PetscLayoutSetLocalSize(), PetscLayoutSetSize(), PetscLayoutGetSize(), PetscLayoutGetLocalSize(), PetscLayout, PetscLayoutCreate(), PetscLayoutGetRange(), PetscLayoutGetRanges(), PetscLayoutSetBlockSize(), PetscLayoutGetBlockSize(), PetscLayoutSetUp()

External Links

source
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 - input PetscLayout to be duplicated

Output Parameter:

  • out - the copy

Level: developer

See also: PetscLayout, PetscLayoutCreate(), PetscLayoutDestroy(), PetscLayoutSetUp(), PetscLayoutReference()

External Links

source
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 layout
  • idx - global index to find the owner of

Output Parameter:

  • owner - the owning rank

Level: developer

See also: PetscLayout, PetscLayoutFindOwnerIndex()

External Links

source
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 layout
  • idx - global index to find the owner of

Output Parameters:

  • owner - the owning rank
  • lidx - local index used by the owner for idx

Level: developer

See also: PetscLayout, PetscLayoutFindOwner()

External Links

source
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

source
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

source
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 process
  • rend - 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

source
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

source
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

source
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 - the PetscLayout describing global ownership
  • N - the number of input indices
  • idxs - the global indices; negative entries are ignored

Output Parameters:

  • on - number of indices in the returned local set (may be NULL)
  • oidxs - the local (0-based) indices owned by this MPI process (may be NULL); caller must PetscFree()
  • ogidxs - the corresponding global indices in a compact numbering (may be NULL); caller must PetscFree()

Level: developer

See also: PetscLayout, PetscSF, PetscLayoutFindOwner(), PetscSFCreateFromLayouts()

External Links

source
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 - input PetscLayout to be copied

Output Parameter:

  • out - the reference location

Level: developer

See also: PetscLayout, PetscLayoutCreate(), PetscLayoutDestroy(), PetscLayoutSetUp(), PetscLayoutDuplicate()

External Links

source
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 map
  • bs - the size

Level: developer

See also: PetscLayout, PetscLayoutCreate(), PetscLayoutSetLocalSize(), PetscLayoutGetLocalSize(), PetscLayoutGetBlockSize(), PetscLayoutGetRange(), PetscLayoutGetRanges(), PetscLayoutSetSize(), PetscLayoutGetSize(), PetscLayoutSetUp()

External Links

source
PETSc.LibPETSc.PetscLayoutSetISLocalToGlobalMapping — Method
PetscLayoutSetISLocalToGlobalMapping(petsclib::PetscLibType, in::PetscLayout, ltog::ISLocalToGlobalMapping)

sets a ISLocalGlobalMapping into a PetscLayout

Collective

Input Parameters:

  • in - input PetscLayout
  • ltog - the local to global mapping

Level: developer

See also: PetscLayout, PetscLayoutCreate(), PetscLayoutDestroy(), PetscLayoutSetUp(), PetscLayoutDuplicate()

External Links

source
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 map
  • n - the local size, pass PETSC_DECIDE (the default) to have this value determined by the global size set with PetscLayoutSetSize()

Level: developer

See also: PetscLayout, PetscLayoutCreate(), PetscLayoutSetSize(), PetscLayoutGetSize(), PetscLayoutGetLocalSize(), PetscLayoutSetUp(), PetscLayoutGetRange(), PetscLayoutGetRanges(), PetscLayoutSetBlockSize(), PetscLayoutGetBlockSize()

External Links

source
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 map
  • n - the global size, use PETSC_DETERMINE (the default) to have this value computed as the sum of the local sizes set with PetscLayoutSetLocalSize()

Level: developer

See also: PetscLayout, PetscLayoutCreate(), PetscLayoutSetLocalSize(), PetscLayoutGetLocalSize(), PetscLayoutGetSize(), PetscLayoutSetUp(), PetscLayoutGetRange(), PetscLayoutGetRanges(), PetscLayoutSetBlockSize(), PetscLayoutGetBlockSize()

External Links

source
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

source

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 user MPI_Comm or a PETSc inner MPI_Comm

Output Parameter:

  • pshmcomm - the PETSc shared memory communicator object

Level: developer

See also: PetscShmCommGlobalToLocal(), PetscShmCommLocalToGlobal(), PetscShmCommGetMpiShmComm()

External Links

source
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

source
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 object
  • grank - the global rank

Output Parameter:

  • lrank - the local rank, or MPI_PROC_NULL if it does not exist

Level: developer

See also: PetscShmCommGet(), PetscShmCommLocalToGlobal(), PetscShmCommGetMpiShmComm()

External Links

source
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 object
  • lrank - 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

source
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 the PetscSubcomm context

Level: advanced

See also: PetscSubcomm, PetscSubcommDestroy(), PetscSubcommSetTypeGeneral(), PetscSubcommSetFromOptions(), PetscSubcommSetType(), PetscSubcommSetNumber()

External Links

source
PETSc.LibPETSc.PetscSubcommDestroy — Method
PetscSubcommDestroy(petsclib::PetscLibType, psubcomm::Union{PetscSubcomm, Ref{PetscSubcomm}})

Destroys a PetscSubcomm object

Collective

Input Parameter:

  • psubcomm - the PetscSubcomm context

Level: advanced

See also: PetscSubcommCreate(), PetscSubcommSetType()

External Links

source
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 - the PetscSubcomm

Output Parameter:

  • ccomm - location to store the child communicator

Level: intermediate

See also: PetscSubcommDestroy(), PetscSubcommSetTypeGeneral(), PetscSubcommSetFromOptions(), PetscSubcommSetType(), PetscSubcommSetNumber(), PetscSubcommGetParent(), PetscSubcommContiguousParent()

External Links

source
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 - the PetscSubcomm

Output Parameter:

  • pcomm - location to store the parent communicator

Level: intermediate

See also: PetscSubcommDestroy(), PetscSubcommSetTypeGeneral(), PetscSubcommSetFromOptions(), PetscSubcommSetType(), PetscSubcommSetNumber(), PetscSubcommGetChild(), PetscSubcommContiguousParent()

External Links

source
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 - the PetscSubcomm

Output Parameter:

  • pcomm - location to store the parent communicator

Level: intermediate

See also: PetscSubcommDestroy(), PetscSubcommSetTypeGeneral(), PetscSubcommSetFromOptions(), PetscSubcommSetType(), PetscSubcommSetNumber(), PetscSubcommGetChild(), PetscSubcommContiguousParent()

External Links

source
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 - PetscSubcomm context
  • nsubcomm - the total number of subcommunicators in psubcomm

Level: advanced

See also: PetscSubcomm, PetscSubcommCreate(), PetscSubcommDestroy(), PetscSubcommSetType(), PetscSubcommSetTypeGeneral()

External Links

source
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 - PetscSubcomm context
  • pre - the prefix to prepend all PetscSubcomm item names with.

See also: PetscSubcomm, PetscSubcommCreate()

External Links

source
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 - PetscSubcomm context
  • subcommtype - PetscSubcommType PETSC_SUBCOMM_CONTIGUOUS or PETSC_SUBCOMM_INTERLACED

Level: advanced

See also: PetscSubcommType, PETSC_SUBCOMM_CONTIGUOUS, PETSC_SUBCOMM_INTERLACED, PetscSubcommCreate(), PetscSubcommDestroy(), PetscSubcommSetNumber(), PetscSubcommSetTypeGeneral()

External Links

source
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 - PetscSubcomm context
  • color - 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

source
PETSc.LibPETSc.PetscSubcommView — Method
PetscSubcommView(petsclib::PetscLibType, psubcomm::PetscSubcomm, viewer::PetscViewer)

Views a PetscSubcomm

Collective

Input Parameters:

  • psubcomm - PetscSubcomm context
  • viewer - PetscViewer to display the information

Level: beginner

See also: PetscSubcomm, PetscSubcommCreate(), PetscViewer

External Links

source

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 bag
  • bagsize - size of the C structure holding the values, for example sizeof(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

source
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

source
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

source
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

source
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 from
  • bag - the bag of values

Level: beginner

See also: PetscBag, PetscBagSetName(), PetscBagDestroy(), PetscBagView(), PetscBagGetData(), PetscBagRegisterReal(), PetscBagRegisterInt(), PetscBagRegisterBool(), PetscBagRegisterScalar(), PetscBagSetFromOptions(), PetscBagCreate(), PetscBagGetName(), PetscBagRegisterEnum()

External Links

source
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 values
  • addr - location of PetscBool in struct, for example &params->b
  • mdefault - the initial value, either PETSC_FALSE or PETSC_TRUE
  • name - name of the variable
  • help - 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

source
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 values
  • addr - location of boolean array in struct, for example &params->b
  • msize - number of entries in array
  • name - name of the boolean array
  • help - 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

source
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 values
  • addr - location of enum in struct, for example &params->dt
  • list - array of strings containing names of enum values followed by enum name followed by enum prefix
  • mdefault - the initial value, cast with (PetscEnum)
  • name - the name of the item
  • help - 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

source
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 values
  • addr - location of integer in struct, for example &params->i
  • mdefault - the initial value
  • name - name of the integer
  • help - 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

source
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 values
  • addr - location of integer in struct, for example &params->i
  • mdefault - the initial value
  • name - name of the integer
  • help - 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

source
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 values
  • addr - location of integer in struct, for example &params->i
  • msize - number of entries in array
  • name - name of the array
  • help - 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

source
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 values
  • addr - location of PetscReal in struct, for example &params->r
  • mdefault - the initial value
  • name - name of the variable
  • help - 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

source
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 values
  • addr - location of real array in struct, for example &params->d
  • msize - number of entries in the array
  • name - name of the array
  • help - 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

source
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 values
  • addr - location of PetscScalar in struct, for example &params->c
  • mdefault - the initial value
  • name - name of the variable
  • help - 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

source
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 values
  • addr - location of start of string in struct, for example &params->mystring
  • msize - length of the string space in the struct
  • mdefault - the initial value
  • name - name of the string
  • help - 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

source
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

source
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 values
  • name - the name assigned to the bag
  • help - help message for bag

See also: PetscBag, PetscBagGetName(), PetscBagView(), PetscBagLoad(), PetscBagGetData(), PetscBagRegisterReal(), PetscBagRegisterInt(), PetscBagRegisterBool(), PetscBagRegisterScalar(), PetscBagSetFromOptions(), PetscBagCreate(), PetscBagDestroy(), PetscBagRegisterEnum()

External Links

source
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 values
  • pre - the prefix to prepend all Bag item names with.

See also: PetscBag, PetscBagRegisterReal(), PetscBagRegisterInt(), PetscBagRegisterBool(), PetscBagRegisterScalar(), PetscBagSetFromOptions(), PetscBagCreate(), PetscBagDestroy(), PetscBagRegisterEnum()

External Links

source
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 values
  • view - location to view the values

Level: beginner

See also: PetscBag, PetscBagSetName(), PetscBagDestroy(), PetscBagLoad(), PetscBagGetData(), PetscBagRegisterReal(), PetscBagRegisterInt(), PetscBagRegisterBool(), PetscBagRegisterScalar(), PetscBagRegisterEnum(), PetscBagSetFromOptions(), PetscBagCreate(), PetscBagGetName()

External Links

source
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 object
  • bobj - optional other object that provides prefix (if NULL then the prefix in obj is used)
  • name - option to activate viewing

Options Database Key:

  • -name [viewertype][:...] - option name and values. See PetscObjectViewFromOptions() for the possible arguments

Level: intermediate

See also: PetscBagCreate(), PetscBag, PetscViewer, PetscBagView(), PetscObjectViewFromOptions()

External Links

source

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 in
  • b - the separator character

Output Parameter:

  • t - the token object

Level: intermediate

See also: PetscToken, PetscTokenFind(), PetscTokenDestroy()

External Links

source
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

source
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, NULL if not found

Level: intermediate

See also: PetscToken, PetscTokenCreate(), PetscTokenDestroy()

External Links

source

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 contain
  • expected - expected/typical number of entries

Output Parameter:

  • seg - PetscSegBuffer object

Level: developer

See also: PetscSegBufferGet(), PetscSegBufferExtractAlloc(), PetscSegBufferExtractTo(), PetscSegBufferExtractInPlace(), PetscSegBufferDestroy(), PetscSegBuffer

External Links

source
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

source
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 - PetscSegBuffer buffer

Output Parameter:

  • contiguous - address of new array containing contiguous data, caller frees with PetscFree()

Level: developer

See also: PetscSegBufferCreate(), PetscSegBufferGet(), PetscSegBufferDestroy(), PetscSegBufferExtractTo(), PetscSegBufferExtractInPlace(), PetscSegBuffer

External Links

source
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 - PetscSegBuffer object

Output Parameter:

  • contig - address of pointer to contiguous memory, may be NULL

Level: developer

See also: PetscSegBuffer, PetscSegBufferExtractAlloc(), PetscSegBufferExtractTo()

External Links

source
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 buffer
  • contig - allocated buffer to hold contiguous data

Level: developer

See also: PetscSegBufferCreate(), PetscSegBufferGet(), PetscSegBufferDestroy(), PetscSegBufferExtractAlloc(), PetscSegBufferExtractInPlace(), PetscSegBuffer

External Links

source
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 - PetscSegBuffer buffer
  • count - 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

source
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 - PetscSegBuffer object

Output Parameter:

  • usedsize - number of used units

Level: developer

See also: PetscSegBuffer, PetscSegBufferExtractAlloc(), PetscSegBufferExtractTo(), PetscSegBufferCreate(), PetscSegBufferGet()

External Links

source
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 - PetscSegBuffer object
  • unused - number of unused units to return

Level: developer

See also: PetscSegBuffer, PetscSegBufferCreate(), PetscSegBufferGet()

External Links

source

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 - the PetscHeap
  • id - the item identifier
  • val - the value used for heap ordering

Level: developer

See also: PetscHeap, PetscHeapCreate(), PetscHeapPop(), PetscHeapPeek(), PetscHeapStash(), PetscHeapUnstash(), PetscHeapDestroy()

External Links

source
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 created PetscHeap object

Level: developer

See also: PetscHeap, PetscHeapAdd(), PetscHeapPop(), PetscHeapPeek(), PetscHeapStash(), PetscHeapUnstash(), PetscHeapView(), PetscHeapDestroy()

External Links

source
PETSc.LibPETSc.PetscHeapDestroy — Method
PetscHeapDestroy(petsclib::PetscLibType, heap::Union{PetscHeap, Ref{PetscHeap}})

Destroys a PetscHeap created with PetscHeapCreate().

Not Collective

Input Parameter:

  • heap - the PetscHeap to destroy; set to NULL on return

Level: developer

See also: PetscHeap, PetscHeapCreate()

External Links

source
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 - the PetscHeap

Output Parameters:

  • id - identifier of the minimum item, or -1 if the heap is empty
  • val - value of the minimum item, or PETSC_INT_MIN if the heap is empty

Level: developer

See also: PetscHeap, PetscHeapCreate(), PetscHeapAdd(), PetscHeapPop(), PetscHeapDestroy()

External Links

source
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 - the PetscHeap

Output Parameters:

  • id - identifier of the popped item, or -1 if the heap is empty
  • val - value of the popped item, or PETSC_INT_MIN if the heap is empty

Level: developer

See also: PetscHeap, PetscHeapCreate(), PetscHeapAdd(), PetscHeapPeek(), PetscHeapStash(), PetscHeapUnstash(), PetscHeapDestroy()

External Links

source
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 - the PetscHeap
  • id - the item identifier
  • val - the value used for heap ordering

Level: developer

See also: PetscHeap, PetscHeapCreate(), PetscHeapAdd(), PetscHeapUnstash(), PetscHeapDestroy()

External Links

source
PETSc.LibPETSc.PetscHeapUnstash — Method
PetscHeapUnstash(petsclib::PetscLibType, h::PetscHeap)

Reinsert all items previously stashed with PetscHeapStash() into the heap.

Not Collective

Input Parameter:

  • h - the PetscHeap

Level: developer

See also: PetscHeap, PetscHeapCreate(), PetscHeapAdd(), PetscHeapStash(), PetscHeapDestroy()

External Links

source
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 - the PetscHeap
  • viewer - a PetscViewer, or NULL to use PETSC_VIEWER_STDOUT_SELF

Level: developer

See also: PetscHeap, PetscHeapCreate(), PetscHeapAdd(), PetscHeapPop()

External Links

source

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

source
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

source
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_TRUE if the stack is empty

Level: developer

See also: PetscIntStackCreate(), PetscIntStackDestroy(), PetscIntStackPush(), PetscIntStackPop(), PetscIntStackTop()

External Links

source
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

source
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 stack
  • item - The integer to push

Level: developer

See also: PetscIntStackCreate(), PetscIntStackDestroy(), PetscIntStackEmpty(), PetscIntStackPop(), PetscIntStackTop()

External Links

source
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

source

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 the PetscKDTree
  • dim - the dimension of the coordinates
  • coords - array of the coordinates, in point-major order
  • copy_mode - behavior handling coords, PETSC_COPY_VALUES generally more performant
  • max_bucket_size - maximum number of points stored at each leaf

Output Parameter:

  • new_tree - the resulting PetscKDTree

Level: advanced

See also: PetscKDTree, PetscKDTreeDestroy(), PetscKDTreeQueryPointsNearestNeighbor()

External Links

source
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

source
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 query
  • num_points - number of points to query
  • points - array of the coordinates, in point-major order
  • tolerance - tolerance for nearest neighbor

Output Parameters:

  • indices - indices of the nearest neighbor to the query point
  • distances - distance between the queried point and the nearest neighbor

Level: advanced

See also: PetscKDTree, PetscKDTreeCreate()

External Links

source
PETSc.LibPETSc.PetscKDTreeView — Method
PetscKDTreeView(petsclib::PetscLibType, tree::PetscKDTree, viewer::PetscViewer)

view a PetscKDTree

Not Collective, No Fortran Support

Input Parameters:

  • tree - tree to view
  • viewer - visualization context

Level: advanced

See also: PetscKDTree, PetscKDTreeCreate(), PetscViewer

External Links

source

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 communicator
  • dim - the spatial dimension
  • point - an initial point used to seed the bounding box, or NULL for a zero-initialized box

Output Parameter:

  • box - the newly created PetscGridHash

Level: developer

See also: DMPLEX, PetscGridHash, PetscGridHashEnlarge(), PetscGridHashDestroy()

External Links

source
PETSc.LibPETSc.PetscGridHashDestroy — Method
PetscGridHashDestroy(petsclib::PetscLibType, box::Union{PetscGridHash, Ref{PetscGridHash}})

Destroy a PetscGridHash and free its resources.

Collective

Input Parameter:

  • box - the PetscGridHash to destroy; set to NULL on return

Level: developer

See also: DMPLEX, PetscGridHash, PetscGridHashCreate(), PetscGridHashEnlarge()

External Links

source
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 - the PetscGridHash
  • point - the point whose coordinates extend the box's lower and upper bounds

Level: developer

See also: DMPLEX, PetscGridHash, PetscGridHashCreate(), PetscGridHashDestroy()

External Links

source
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 object
  • numPoints - The number of input points
  • points - The input point coordinates

Output Parameters:

  • dboxes - An array of numPoints x dim integers expressing the enclosing box as (i0, i1, ..., i_dim)
  • boxes - An array of numPoints integers expressing the enclosing box as single number, or NULL

Level: developer

See also: DMPLEX, PetscGridHashCreate()

External Links

source
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 object
  • n - The number of boxes in each dimension, may use PETSC_DETERMINE for the entries
  • h - The box size in each dimension, only used if n[d] == PETSC_DETERMINE, if not needed you can pass in NULL

Level: developer

See also: DMPLEX, PetscGridHashCreate()

External Links

source

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

source
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 in
  • nthreads - 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

source
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

source
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 threads
  • omp_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

source

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 communicator
  • host - 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

source
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

source
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 engine
  • obj - the PETSc object, for example a Vec

Level: advanced

See also: PetscMatlabEngineDestroy(), PetscMatlabEnginePut(), PetscMatlabEngineCreate(), PetscMatlabEngineEvaluate(), PetscMatlabEngineGetOutput(), PetscMatlabEnginePrintOutput(), PETSC_MATLAB_ENGINE_(), PetscMatlabEnginePutArray(), PetscMatlabEngineGetArray(), PetscMatlabEngine

External Links

source
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 engine
  • m - the x dimension of the array
  • n - the y dimension of the array
  • array - the array (represented in one dimension), much be large enough to hold all the data
  • name - the name of the array

Level: advanced

See also: PetscMatlabEngineDestroy(), PetscMatlabEnginePut(), PetscMatlabEngineCreate(), PetscMatlabEngineEvaluate(), PetscMatlabEngineGetOutput(), PetscMatlabEnginePrintOutput(), PETSC_MATLAB_ENGINE_(), PetscMatlabEnginePutArray(), PetscMatlabEngineGet(), PetscMatlabEngine

External Links

source
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

source
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 engine
  • fd - the file

Level: advanced

See also: PetscMatlabEngineDestroy(), PetscMatlabEnginePut(), PetscMatlabEngineGet(), PetscMatlabEngineEvaluate(), PetscMatlabEngineGetOutput(), PetscMatlabEngineCreate(), PETSC_MATLAB_ENGINE_(), PetscMatlabEnginePutArray(), PetscMatlabEngineGetArray(), PetscMatlabEngine

External Links

source
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 engine
  • obj - the PETSc object, for example Vec

Level: advanced

See also: PetscMatlabEngineDestroy(), PetscMatlabEngineCreate(), PetscMatlabEngineGet(), PetscMatlabEngineEvaluate(), PetscMatlabEngineGetOutput(), PetscMatlabEnginePrintOutput(), PETSC_MATLAB_ENGINE_(), PetscMatlabEnginePutArray(), PetscMatlabEngineGetArray(), PetscMatlabEngine

External Links

source
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 engine
  • m - the x dimension of the array
  • n - the y dimension of the array
  • array - 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

source

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 the PetscBench

Output Parameter:

  • bm - the PetscBench

Level: advanced

See also: PetscBench, PetscBenchSetFromOptions(), PetscBenchRun(), PetscBenchViewFromOptions(), PetscBenchDestroy(), PetscBenchSetUp(), PetscBenchSetType(), PetscBenchSetSize(), PetscBenchGetSize()

External Links

source
PETSc.LibPETSc.PetscBenchDestroy — Method
PetscBenchDestroy(petsclib::PetscLibType, bm::Union{PetscBench, Ref{PetscBench}})

Destroys a PetscBench

Collective

Input Parameter:

  • bm - the PetscBench

Level: advanced

See also: PetscBench, PetscBenchView(), PetscBenchSetFromOptions(), PetscBenchCreate()

External Links

source
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 - the PetscBench

Output Parameter:

  • n - the size

Level: advanced

See also: PetscBench, PetscBenchSetFromOptions(), PetscBenchRun(), PetscBenchViewFromOptions(), PetscBenchDestroy(), PetscBenchSetUp(), PetscBenchSetType(), PetscBenchSetOptionsPrefix(), PetscBenchSetSize()

External Links

source
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 - the PetscBench

Output Parameter:

  • type - name of benchmark method

Level: intermediate

See also: PetscBench, PetscBenchType, PetscBenchSetType(), PetscBenchCreate()

External Links

source
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 benchmark
  • function - routine to create benchmark

Calling sequence of function:

  • bm - the PetscBench to be created

Level: advanced

See also: PetscBenchInitializePackage(), PetscBenchCreate(), PetscBench, PetscBenchType, PetscBenchSetType(), PetscBenchGetType()

External Links

source
PETSc.LibPETSc.PetscBenchReset — Method
PetscBenchReset(petsclib::PetscLibType, bm::PetscBench)

removes all the intermediate data structures in a PetscBench

Collective

Input Parameter:

  • bm - the PetscBench

Level: advanced

See also: PetscBench, PetscBenchView(), PetscBenchSetFromOptions(), PetscBenchCreate(), PetscBenchDestroy(), PetscBenchSetUp(), PetscBenchSetType()

External Links

source
PETSc.LibPETSc.PetscBenchRun — Method
PetscBenchRun(petsclib::PetscLibType, bm::PetscBench)

runs the PetscBench

Collective

Input Parameter:

  • bm - the PetscBench

Level: advanced

See also: PetscBench, PetscBenchView(), PetscBenchSetFromOptions(), PetscBenchCreate(), PetscBenchDestroy(), PetscBenchSetUp(), PetscBenchSetType(), PetscBenchSetSize(), PetscBenchGetSize()

External Links

source
PETSc.LibPETSc.PetscBenchSetFromOptions — Method
PetscBenchSetFromOptions(petsclib::PetscLibType, bm::PetscBench)

Sets options to a PetscBench using the options database

Collective

Input Parameter:

  • bm - the PetscBench

Level: advanced

See also: PetscBench, PetscBenchView(), PetscBenchRun(), PetscBenchCreate(), PetscBenchDestroy(), PetscBenchSetUp(), PetscBenchSetType(), PetscBenchSetSize(), PetscBenchGetSize()

External Links

source
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 - the PetscBench
  • pre - the prefix to prepend all PetscBench option names

Level: advanced

See also: PetscBench, PetscBenchSetFromOptions(), PetscBenchRun(), PetscBenchViewFromOptions(), PetscBenchDestroy(), PetscBenchSetUp(), PetscBenchSetType(), PetscBenchSetSize(), PetscBenchGetSize()

External Links

source
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 - the PetscBench
  • n - the size

Level: advanced

See also: PetscBench, PetscBenchSetFromOptions(), PetscBenchRun(), PetscBenchViewFromOptions(), PetscBenchDestroy(), PetscBenchSetUp(), PetscBenchSetType(), PetscBenchSetOptionsPrefix(), PetscBenchGetSize()

External Links

source
PETSc.LibPETSc.PetscBenchSetType — Method
PetscBenchSetType(petsclib::PetscLibType, bm::PetscBench, type::String)

set the type of PetscBench benchmark to run

Collective

Input Parameters:

  • bm - the PetscBench
  • type - a known method

Options Database Key:

  • -bm_type type - Sets PetscBench type

Level: advanced

See also: PetscBench, PetscBenchSetFromOptions(), PetscBenchRun(), PetscBenchViewFromOptions(), PetscBenchDestroy(), PetscBenchSetUp(), PetscBenchGetSize(), PetscBenchSetOptionsPrefix(), PetscBenchSetSize(), PetscBenchGetType(), PetscBenchCreate()

External Links

source
PETSc.LibPETSc.PetscBenchSetUp — Method
PetscBenchSetUp(petsclib::PetscLibType, bm::PetscBench)

sets up the PetscBench

Collective

Input Parameter:

  • bm - the PetscBench

Level: advanced

See also: PetscBench, PetscBenchView(), PetscBenchSetFromOptions(), PetscBenchCreate(), PetscBenchDestroy(), PetscBenchSetType(), PetscBenchRun(), PetscBenchSetSize(), PetscBenchGetSize()

External Links

source
PETSc.LibPETSc.PetscBenchView — Method
PetscBenchView(petsclib::PetscLibType, bm::PetscBench, viewer::PetscViewer)

Views a PETSc benchmark PetscBench

Collective

Input Parameters:

  • bm - the PetscBench
  • viewer - location to view bm

Level: advanced

See also: PetscBench, PetscBenchSetFromOptions(), PetscBenchRun(), PetscBenchCreate(), PetscBenchDestroy(), PetscBenchSetUp(), PetscBenchSetType(), PetscBenchSetSize(), PetscBenchGetSize(), PetscBenchViewFromOptions()

External Links

source
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 object
  • bobj - optional other object that provides prefix (if NULL then the prefix in bm is used)
  • name - option to activate viewing

Options Database Key:

  • -name [viewertype][:...] - option name and values. See PetscObjectViewFromOptions() for the possible arguments

Level: advanced

See also: PetscBench, PetscBenchSetFromOptions(), PetscBenchRun(), PetscBenchCreate(), PetscBenchDestroy(), PetscBenchSetUp(), PetscBenchSetType(), PetscBenchSetSize(), PetscBenchGetSize(), PetscObjectViewFromOptions(), PetscViewer, PetscBenchView()

External Links

source