Sys (Runtime, Memory, Strings, Errors) - Low-level Interface
Sys_wrappers.jl collects the PETSc functions that do not belong to a class: initialization and version queries, memory and timing utilities, error handling, string and sorting helpers, MPI helpers (PetscSplitOwnership, PetscGlobalMinMax*, ...), binary I/O and the PetscInfo diagnostics.
PETSc.jl calls PetscInitialize/PetscFinalize for you through PETSc.initialize(petsclib) and PETSc.finalize(petsclib); do not call them directly.
Basic Usage
using PETSc, MPI
MPI.Init()
petsclib = PETSc.getlib()
PETSc.initialize(petsclib)
major, minor, subminor, release = LibPETSc.PetscGetVersionNumber(petsclib)
mem = LibPETSc.PetscMemoryGetCurrentUsage(petsclib) # bytes used by this process
t0 = LibPETSc.PetscGetCPUTime(petsclib) # PetscTime is a C inline; not wrapped
LibPETSc.PetscSleep(petsclib, 0.01)
elapsed = LibPETSc.PetscGetCPUTime(petsclib) - t0
# Split N unknowns over the processes of a communicator (n = PETSC_DECIDE)
n, N = LibPETSc.PetscSplitOwnership(petsclib, MPI.COMM_WORLD, LibPETSc.PETSC_DECIDE, 100)
PETSc.finalize(petsclib)Function Reference
Sys
PETSc.LibPETSc.PetscAbortErrorHandler — Method
PetscAbortErrorHandler(petsclib::PetscLibType, comm::MPI_Comm, line::Cint, fun::String, file::String, n::PetscErrorCode, p::PetscErrorType, mess::String, ctx::Ptr{Cvoid})Error handler that calls abort on error. This routine is very useful when running in the debugger, because the user can look directly at the stack frames and the variables where the error occurred
Not Collective, No Fortran Support
Input Parameters:
comm- communicator over which error occurredline- the line number of the error (usually indicated by__LINE__in the calling routine)fun- the function name of the calling routinefile- the file in which the error was detected (usually indicated by__FILE__in the calling routine)mess- an error text string, usually this is just printed to the screenn- the generic error numberp-PETSC_ERROR_INITIALindicates this is the first time the error handler is being called whilePETSC_ERROR_REPEATindicates it was previously calledctx- error handler context
Options Database Keys:
-on_error_abort- Activates aborting when an error is encountered-start_in_debugger [(noxterm)],[(lldb|gdb|...)]- Starts all processes in the debugger and usesPetscAbortErrorHandler(). By default on Linux the
debugger is gdb and on macOS it is lldb. On Linux it opens a new xterm and on macOS it opens a new Terminal for the debugger unless noxterm is given
-display name- Uses the X-Windows display name to open the xterms
Level: developer
See also: PetscError(), PetscPushErrorHandler(), PetscPopErrorHander(), PetscTraceBackErrorHandler(), PetscAttachDebuggerErrorHandler(), PetscMPIAbortErrorHandler(), PetscReturnErrorHandler(), PetscEmacsClientErrorHandler(), PetscErrorType, PETSC_ERROR_INITIAL, PETSC_ERROR_REPEAT, PetscErrorCode
External Links
- PETSc Manual:
Sys/PetscAbortErrorHandler
PETSc.LibPETSc.PetscAttachDebugger — Method
PetscAttachDebugger(petsclib::PetscLibType)Attaches the debugger to the running process.
Not Collective
Options Database Keys:
-start_in_debugger [(noxterm)],[(lldb|gdb|...)]- Set debugger debug_terminal xterm or Terminal (for Apple)-display name- XDisplay to open xterm in-debugger_ranks m,n- Which MPI ranks on which to start the debugger, defaults to all-stop_for_debugger- Print a message on how to attach the process with a debugger and then wait for the user to attach-debugger_pause secs- Wait secs before attaching the debugger. This is useful for slow connections
that take a long time for the Terminal window or xterm to start up.
Level: advanced
See also: PetscSetDebugger(), PetscSetDefaultDebugger(), PetscSetDebugTerminal(), PetscAttachDebuggerErrorHandler(), PetscStopForDebugger()
External Links
- PETSc Manual:
Sys/PetscAttachDebugger
PETSc.LibPETSc.PetscAttachDebuggerErrorHandler — Method
PetscAttachDebuggerErrorHandler(petsclib::PetscLibType, comm::MPI_Comm, line::Cint, fun::String, file::String, num::PetscErrorCode, p::PetscErrorType, mess::String, ctx::Ptr{Cvoid})Error handler that attaches a debugger to a running process when an error is detected. This routine is useful for examining variables, etc.
Not Collective, No Fortran Support
Input Parameters:
comm- communicator over which error occurredline- the line number of the error (usually indicated by__LINE__in the calling routine)fun- the function name of the calling routinefile- the file in which the error was detected (usually indicated by__FILE__in the calling routine)mess- an error text string, usually just printed to the screennum- the generic error numberp-PETSC_ERROR_INITIALif error just detected, otherwisePETSC_ERROR_REPEATctx- error handler context
Level: developer
See also: PetscSetDebuggerFromString(), PetscSetDebugger(), PetscSetDefaultDebugger(), PetscError(), PetscPushErrorHandler(), PetscPopErrorHandler(), PetscTraceBackErrorHandler(), PetscAbortErrorHandler(), PetscMPIAbortErrorHandler(), PetscEmacsClientErrorHandler(), PetscReturnErrorHandler(), PetscSetDebugTerminal()
External Links
- PETSc Manual:
Sys/PetscAttachDebuggerErrorHandler
PETSc.LibPETSc.PetscBLASGetNumThreads — Method
nt::PetscInt = PetscBLASGetNumThreads(petsclib::PetscLibType)get the number of threads for calls to BLAS to use
Output Parameter:
nt- the number of threads
Level: intermediate
See also: PetscInitialize(), PetscBLASSetNumThreads()
External Links
- PETSc Manual:
Sys/PetscBLASGetNumThreads
PETSc.LibPETSc.PetscBLASSetNumThreads — Method
PetscBLASSetNumThreads(petsclib::PetscLibType, nt::PetscInt)set the number of threads for calls to BLAS to use
Input Parameter:
nt- the number of threads
Options Database Key:
-blas_num_threads nt- set the number of threads when PETSc is initialized
Level: intermediate
See also: PetscInitialize(), PetscBLASGetNumThreads()
External Links
- PETSc Manual:
Sys/PetscBLASSetNumThreads
PETSc.LibPETSc.PetscBTView — Method
PetscBTView(petsclib::PetscLibType, m::PetscCount, bt::PetscBT, viewer::PetscViewer)View the contents of a PetscBT (bit array) on a PetscViewer, one line per bit
Collective on viewer; No Fortran Support
Input Parameters:
m- the number of bits in the array to printbt- thePetscBTviewer- thePetscViewerto print to, orNULLto usePETSC_VIEWER_STDOUT_SELF
Level: developer
See also: PetscBT, PetscBTCreate(), PetscBTLookup(), PetscViewer
External Links
- PETSc Manual:
Viewer/PetscBTView
PETSc.LibPETSc.PetscBarrier — Method
PetscBarrier(petsclib::PetscLibType, obj)Blocks until this routine is executed by all processors owning the object obj.
Input Parameter:
obj- PETSc object (Mat,Vec,IS,SNESetc...)
Level: intermediate
See also: PetscObject, MPI_Comm, MPI_Barrier
External Links
- PETSc Manual:
Sys/PetscBarrier
PETSc.LibPETSc.PetscBinaryClose — Method
PetscBinaryClose(petsclib::PetscLibType, fd::Cint)Closes a PETSc binary file.
Not Collective
Output Parameter:
fd- the file
Level: advanced
See also: PetscBinaryRead(), PetscBinaryWrite(), PetscBinaryOpen(), PetscBinarySynchronizedWrite(), PetscBinarySynchronizedRead(), PetscBinarySynchronizedSeek()
External Links
- PETSc Manual:
Sys/PetscBinaryClose
PETSc.LibPETSc.PetscBinaryOpen — Method
fd::Cint = PetscBinaryOpen(petsclib::PetscLibType, name::String, mode::PetscFileMode)Opens a PETSc binary file.
Not Collective
Input Parameters:
name- filenamemode- open mode of binary file, one ofFILE_MODE_READ,FILE_MODE_WRITE,FILE_MODE_APPEND
Output Parameter:
fd- the file
Level: advanced
See also: PetscBinaryRead(), PetscBinaryWrite(), PetscFileMode, PetscViewerFileSetMode(), PetscViewerBinaryGetDescriptor(), PetscBinarySynchronizedWrite(), PetscBinarySynchronizedRead(), PetscBinarySynchronizedSeek()
External Links
- PETSc Manual:
Sys/PetscBinaryOpen
PETSc.LibPETSc.PetscBinaryRead — Method
data::Ptr{Cvoid},count::PetscInt = PetscBinaryRead(petsclib::PetscLibType, fd::Cint, num::PetscCount, type::PetscDataType)Reads from a binary file.
Not Collective
Input Parameters:
fd- the file descriptornum- the maximum number of items to readtype- the type of items to read (PETSC_INT,PETSC_REAL,PETSC_SCALAR, etc.)
Output Parameters:
data- the buffer, this is an array of the type that matches the value intypecount- the number of items read, optional
Level: developer
See also: PetscBinaryWrite(), PetscBinaryOpen(), PetscBinaryClose(), PetscViewerBinaryGetDescriptor(), PetscBinarySynchronizedWrite(), PetscBinarySynchronizedRead(), PetscBinarySynchronizedSeek()
External Links
- PETSc Manual:
Viewer/PetscBinaryRead
PETSc.LibPETSc.PetscBinarySynchronizedRead — Method
data::Ptr{Cvoid},count::PetscInt = PetscBinarySynchronizedRead(petsclib::PetscLibType, comm::MPI_Comm, fd::Cint, num::PetscInt, type::PetscDataType)Reads from a binary file, all MPI processes get the same values
Collective, No Fortran Support
Input Parameters:
comm- the MPI communicatorfd- the file descriptornum- the maximum number of items to readtype- the type of items to read (PETSC_INT,PETSC_REAL,PETSC_SCALAR, etc.)
Output Parameters:
data- the buffer, an array of the type that matches the value intypecount- the number of items read, optional
Level: developer
See also: PetscBinaryWrite(), PetscBinaryOpen(), PetscBinaryClose(), PetscBinaryRead(), PetscBinarySynchronizedWrite(), PetscBinarySynchronizedSeek()
External Links
- PETSc Manual:
Sys/PetscBinarySynchronizedRead
PETSc.LibPETSc.PetscBinarySynchronizedWrite — Method
PetscBinarySynchronizedWrite(petsclib::PetscLibType, comm::MPI_Comm, fd::Cint, p::Ptr{Cvoid}, n::PetscInt, type::PetscDataType)writes to a binary file.
Collective, No Fortran Support
Input Parameters:
comm- the MPI communicatorfd- the filen- the number of items to writep- the buffer, an array of the type that matches the value intypetype- the type of items to write (PETSC_INT,PETSC_REALorPETSC_SCALAR)
Level: developer
See also: PetscBinaryWrite(), PetscBinaryOpen(), PetscBinaryClose(), PetscBinaryRead(), PetscBinarySynchronizedRead(), PetscBinarySynchronizedSeek()
External Links
- PETSc Manual:
Sys/PetscBinarySynchronizedWrite
PETSc.LibPETSc.PetscBinaryWrite — Method
PetscBinaryWrite(petsclib::PetscLibType, fd::Cint, p::Ptr{Cvoid}, n::PetscCount, type::PetscDataType)Writes to a binary file.
Not Collective
Input Parameters:
fd- the filep- the buffer, an array of the type that matches the value intypen- the number of items to writetype- the type of items to read (PETSC_INT,PETSC_REALorPETSC_SCALAR)
Level: advanced
See also: PetscBinaryRead(), PetscBinaryOpen(), PetscBinaryClose(), PetscViewerBinaryGetDescriptor(), PetscBinarySynchronizedWrite(), PetscBinarySynchronizedRead(), PetscBinarySynchronizedSeek()
External Links
- PETSc Manual:
Viewer/PetscBinaryWrite
PETSc.LibPETSc.PetscBoxAuthorize — Method
PetscBoxAuthorize(petsclib::PetscLibType, comm::MPI_Comm, access_token::String, refresh_token::String, tokensize::Csize_t)Get authorization and refresh token for accessing Box drive from PETSc
Not Collective, only the first rank in MPI_Comm does anything
Input Parameters:
comm- the MPI communicatortokensize- size of the token arrays
Output Parameters:
access_token- can be used withPetscBoxUpload()for this one sessionrefresh_token- can be used for ever to obtain new access_tokens withPetscBoxRefresh(),
guard this like a password it gives access to your Box Drive
Level: intermediate
See also: PetscBoxRefresh(), PetscBoxUpload()
External Links
- PETSc Manual:
Sys/PetscBoxAuthorize
PETSc.LibPETSc.PetscBoxRefresh — Method
PetscBoxRefresh(petsclib::PetscLibType, comm::MPI_Comm, refresh_token::String, access_token::String, new_refresh_token::String, tokensize::Csize_t)Get a new authorization token for accessing Box drive from PETSc from a refresh token
Not Collective, only the first process in the MPI_Comm does anything
Input Parameters:
comm- MPI communicatorrefresh_token- obtained withPetscBoxAuthorize(), ifNULLPETSc will first look for one in the options data
if not found it will call PetscBoxAuthorize()
tokensize- size of the output string access_token
Output Parameters:
access_token- token that can be passed toPetscBoxUpload()new_refresh_token- the old refresh token is no longer valid, not this is different than Google where the same refresh_token is used forever
Level: intermediate
See also: PetscBoxAuthorize(), PetscBoxUpload()
External Links
- PETSc Manual:
Sys/PetscBoxRefresh
PETSc.LibPETSc.PetscBoxUpload — Method
PetscBoxUpload(petsclib::PetscLibType, comm::MPI_Comm, access_token::String, filename::String)Loads a file to the Box Drive
This routine has not yet been written; it is just copied from Google Drive
Not collective, only the first process in the MPI_Comm uploads the file
Input Parameters:
comm- MPI communicatoraccess_token- obtained withPetscBoxRefresh(), passNULLto have PETSc generate onefilename- file to upload; if you upload multiple times it will have different names each time on Box Drive
Options Database Key:
-box_refresh_token XXX- the token value
See also: PetscBoxAuthorize(), PetscBoxRefresh()
External Links
- PETSc Manual:
Sys/PetscBoxUpload
PETSc.LibPETSc.PetscByteSwap — Method
PetscByteSwap(petsclib::PetscLibType, data::Ptr{Cvoid}, pdtype::PetscDataType, count::PetscCount)Reverse the byte order of an array of values of a given PetscDataType, in place
Not Collective; No Fortran Support
Input Parameters:
data- the array of values to byte-swap in placepdtype- thePetscDataTypeof the values (e.g.PETSC_INT,PETSC_REAL,PETSC_SCALAR)count- number of values indata
Level: developer
See also: PetscDataType, PetscViewerBinaryRead(), PetscViewerBinaryWrite()
External Links
- PETSc Manual:
Sys/PetscByteSwap
PETSc.LibPETSc.PetscCUBLASGetHandle — Method
PetscCUBLASGetHandle(petsclib::PetscLibType, handle::cublasHandle_t)External Links
- PETSc Manual:
Sys/PetscCUBLASGetHandle
PETSc.LibPETSc.PetscCUSOLVERDnGetHandle — Method
PetscCUSOLVERDnGetHandle(petsclib::PetscLibType, handle::cusolverDnHandle_t)External Links
- PETSc Manual:
Sys/PetscCUSOLVERDnGetHandle
PETSc.LibPETSc.PetscCheckDupsInt — Method
dups::PetscBool = PetscCheckDupsInt(petsclib::PetscLibType, n::PetscInt, X::Vector{PetscInt})Checks if an PetscInt array has duplicates
Not Collective
Input Parameters:
n- number of values in the arrayX- array ofPetscInt
Output Parameter:
dups- True if the array has dups, otherwise false
Level: intermediate
See also: PetscSortRemoveDupsInt(), PetscSortedCheckDupsInt()
External Links
- PETSc Manual:
Sys/PetscCheckDupsInt
PETSc.LibPETSc.PetscCheckPointerSetIntensity — Method
PetscCheckPointerSetIntensity(petsclib::PetscLibType, intensity::PetscInt)Set the intensity of debug pointer checks
Not Collective
Input Parameter:
intensity- how much to check pointers for validity
Options Database Key:
-check_pointer_intensity- intensity (0, 1, or 2)
Level: advanced
See also: PetscCheckPointer(), PetscFunctionBeginHot()
External Links
- PETSc Manual:
Sys/PetscCheckPointerSetIntensity
PETSc.LibPETSc.PetscClassIdRegister — Method
oclass::PetscClassId = PetscClassIdRegister(petsclib::PetscLibType, name::String)Registers a new class name for objects and logging operations in an application code.
Not Collective
Input Parameter:
name- The class name
Output Parameter:
oclass- The class id or classid
Level: developer
See also: PetscLogEventRegister()
External Links
- PETSc Manual:
Log/PetscClassIdRegister
PETSc.LibPETSc.PetscCommBuildTwoSidedGetType — Method
twosided::PetscBuildTwoSidedType = PetscCommBuildTwoSidedGetType(petsclib::PetscLibType, comm::MPI_Comm)get algorithm used when building two-sided communication
Logically Collective
Output Parameters:
comm- communicator on which to query algorithmtwosided- algorithm to use forPetscCommBuildTwoSided()
Level: developer
See also: PetscCommBuildTwoSided(), PetscCommBuildTwoSidedSetType(), PetscBuildTwoSidedType
External Links
- PETSc Manual:
Sys/PetscCommBuildTwoSidedGetType
PETSc.LibPETSc.PetscCommBuildTwoSidedSetType — Method
PetscCommBuildTwoSidedSetType(petsclib::PetscLibType, comm::MPI_Comm, twosided::PetscBuildTwoSidedType)set algorithm to use when building two-sided communication
Logically Collective
Input Parameters:
comm-PETSC_COMM_WORLDtwosided- algorithm to use in subsequent calls toPetscCommBuildTwoSided()
Level: developer
See also: PetscCommBuildTwoSided(), PetscCommBuildTwoSidedGetType(), PetscBuildTwoSidedType
External Links
- PETSc Manual:
Sys/PetscCommBuildTwoSidedSetType
PETSc.LibPETSc.PetscCommDestroy — Method
comm::MPI_Comm = PetscCommDestroy(petsclib::PetscLibType)Frees communicator obtained with PetscCommDuplicate().
Collective
Input Parameter:
comm- the communicator to free
Level: developer
See also: PetscCommDuplicate()
External Links
- PETSc Manual:
Sys/PetscCommDestroy
PETSc.LibPETSc.PetscCommDuplicate — Method
comm_out::MPI_Comm,first_tag::PetscMPIInt = PetscCommDuplicate(petsclib::PetscLibType, comm_in::MPI_Comm)Duplicates the communicator only if it is not already a PETSc communicator.
Collective
Input Parameter:
comm_in- Input communicator
Output Parameters:
comm_out- Output communicator. May becomm_in.first_tag- Tag available that has not already been used with this communicator (you may pass inNULLif you do not need a tag)
Level: developer
See also: PetscObjectGetNewTag(), PetscCommGetNewTag(), PetscCommDestroy()
External Links
- PETSc Manual:
Sys/PetscCommDuplicate
PETSc.LibPETSc.PetscCommGetComm — Method
comm_out::MPI_Comm = PetscCommGetComm(petsclib::PetscLibType, comm_in::MPI_Comm)get a new MPI communicator from a PETSc communicator that can be passed off to another package
Collective
Input Parameter:
comm_in- Input communicator
Output Parameter:
comm_out- Output communicator
Level: developer
See also: PetscObjectGetNewTag(), PetscCommGetNewTag(), PetscCommDestroy(), PetscCommRestoreComm()
External Links
- PETSc Manual:
Sys/PetscCommGetComm
PETSc.LibPETSc.PetscCommGetNewTag — Method
tag::PetscMPIInt = PetscCommGetNewTag(petsclib::PetscLibType, comm::MPI_Comm)Gets a unique new tag from a PETSc communicator
Collective
Input Parameter:
comm- the MPI communicator
Output Parameter:
tag- the new tag
Level: developer
See also: PetscObjectGetNewTag(), PetscCommDuplicate()
External Links
- PETSc Manual:
Sys/PetscCommGetNewTag
PETSc.LibPETSc.PetscCommRestoreComm — Method
PetscCommRestoreComm(petsclib::PetscLibType, comm_in::MPI_Comm, comm_out::MPI_Comm)restores an MPI communicator that was obtained with PetscCommGetComm()
Collective
Input Parameters:
comm_in- Input communicatorcomm_out- returned communicator
Level: developer
See also: PetscObjectGetNewTag(), PetscCommGetNewTag(), PetscCommDestroy()
External Links
- PETSc Manual:
Sys/PetscCommRestoreComm
PETSc.LibPETSc.PetscCommSplitReductionBegin — Method
PetscCommSplitReductionBegin(petsclib::PetscLibType, comm::MPI_Comm)Begin an asynchronous split-mode reduction
Collective but not synchronizing
Input Parameter:
comm- communicator on which split reduction has been queued
Level: advanced
See also: VecNormBegin(), VecNormEnd(), VecDotBegin(), VecDotEnd(), VecTDotBegin(), VecTDotEnd(), VecMDotBegin(), VecMDotEnd(), VecMTDotBegin(), VecMTDotEnd()
External Links
- PETSc Manual:
Vec/PetscCommSplitReductionBegin
PETSc.LibPETSc.PetscDLAddr — Method
name::Ptr{Cchar} = PetscDLAddr(petsclib::PetscLibType, func::Ptr{Cvoid})find the name of a symbol in a dynamic library
Not Collective, No Fortran Support
Input Parameters:
func- pointer to the function,NULLif not found
Output Parameter:
name- name of symbol, orNULLif name lookup is not supported.
Level: developer
See also: PetscDLClose(), PetscDLSym(), PetscDLOpen(), PetscDLLibrary, PetscLoadDynamicLibrary(), PetscDLLibraryAppend(), PetscDLLibraryRetrieve(), PetscDLLibraryOpen(), PetscDLLibraryClose(), PetscDLLibrarySym()
External Links
- PETSc Manual:
Sys/PetscDLAddr
PETSc.LibPETSc.PetscDLClose — Method
PetscDLClose(petsclib::PetscLibType, handle::PetscDLHandle)closes a dynamic library
Not Collective, No Fortran Support
Input Parameter:
handle- the handle for the library obtained withPetscDLOpen()
Level: developer
See also: PetscDLOpen(), PetscDLSym(), PetscDLAddr()
External Links
- PETSc Manual:
Sys/PetscDLClose
PETSc.LibPETSc.PetscDLOpen — Method
handle::PetscDLHandle = PetscDLOpen(petsclib::PetscLibType, name::String, mode::PetscDLMode)opens a dynamic library
Not Collective, No Fortran Support
Input Parameters:
name- name of librarymode- options on how to open library, seePetscDLMode
Output Parameter:
handle- opaque pointer to be used withPetscDLSym()
Level: developer
See also: PetscDLClose(), PetscDLSym(), PetscDLAddr(), PetscDLLibrary, PetscLoadDynamicLibrary(), PetscDLLibraryAppend(), PetscDLLibraryRetrieve(), PetscDLLibraryOpen(), PetscDLLibraryClose(), PetscDLLibrarySym(), PetscDLMode, PetscDLHandle
External Links
- PETSc Manual:
Sys/PetscDLOpen
PETSc.LibPETSc.PetscDLSym — Method
value::Ptr{Cvoid} = PetscDLSym(petsclib::PetscLibType, handle::PetscDLHandle, symbol::String)finds a symbol in a dynamic library
Not Collective, No Fortran Support
Input Parameters:
handle- obtained withPetscDLOpen()orNULLsymbol- name of symbol
Output Parameter:
value- returns pointer to the function,NULLif not found
Level: developer
See also: PetscDLClose(), PetscDLOpen(), PetscDLAddr(), PetscDLLibrary, PetscLoadDynamicLibrary(), PetscDLLibraryAppend(), PetscDLLibraryRetrieve(), PetscDLLibraryOpen(), PetscDLLibraryClose(), PetscDLLibrarySym(), PetscDLHandle
External Links
- PETSc Manual:
Sys/PetscDLSym
PETSc.LibPETSc.PetscDTAltVApply — Method
wv::PetscReal = PetscDTAltVApply(petsclib::PetscLibType, N::PetscInt, k::PetscInt, w::Vector{PetscReal}, v::Vector{PetscReal})Apply an a k-form (an alternating k-linear map) to a set of k N-dimensional vectors
Input Parameters:
N- the dimension of the vector space, N >= 0k- the degree k of the k-form w, 0 <= k <= Nw- a k-form, size [N choose k] (each degree of freedom of a k-form is associated with a subset of k coordinates of the N-dimensional vectors.
The degrees of freedom are ordered lexicographically by their associated subsets)
v- a set of k vectors of size N, size [k x N], each vector stored contiguously
Output Parameter:
wv- w(v1,...,vk) = \sumi wi * det(Vi): the degree of freedom wi is associated with coordinates [s{i,1},...,s{i,k}], and the square matrix V_i has
entry (j,k) given by the s{i,k}'th coordinate of vj
Level: intermediate
See also: PetscDTAltV, PetscDTAltVPullback(), PetscDTAltVPullbackMatrix()
External Links
- PETSc Manual:
DT/PetscDTAltVApply
PETSc.LibPETSc.PetscDTAltVInterior — Method
wIntv::PetscReal = PetscDTAltVInterior(petsclib::PetscLibType, N::PetscInt, k::PetscInt, w::Vector{PetscReal}, v::Vector{PetscReal})Compute the interior product of a k-form with a vector
Input Parameters:
N- the dimension of the vector space, N >= 0k- the degree k of the k-form w, 0 <= k <= Nw- a k-form, size [N choose k]v- an N dimensional vector
Output Parameter:
wIntv- the (k-1)-form (w int v), size [N choose (k-1)]: (w int v) is defined by its action on (k-1) vectors {v1, ..., v{k-1}} as (w inv v)(v1, ..., v{k-1}) = w(v, v1, ..., v{k-1}).
Level: intermediate
See also: PetscDTAltV, PetscDTAltVInteriorMatrix(), PetscDTAltVInteriorPattern(), PetscDTAltVPullback(), PetscDTAltVPullbackMatrix()
External Links
- PETSc Manual:
DT/PetscDTAltVInterior
PETSc.LibPETSc.PetscDTAltVInteriorMatrix — Method
intvMat::PetscReal = PetscDTAltVInteriorMatrix(petsclib::PetscLibType, N::PetscInt, k::PetscInt, v::Vector{PetscReal})Compute the matrix of the linear transformation induced on a k-form by the interior product with a vector
Input Parameters:
N- the dimension of the vector space, N >= 0k- the degree k of the k-forms on which intvMat acts, 0 <= k <= Nv- an N dimensional vector
Output Parameter:
intvMat- an [(N choose (k-1)) x (N choose k)] matrix, row-major: (intvMat) * w = (w int v)
Level: intermediate
See also: PetscDTAltV, PetscDTAltVInterior(), PetscDTAltVInteriorPattern(), PetscDTAltVPullback(), PetscDTAltVPullbackMatrix()
External Links
- PETSc Manual:
DT/PetscDTAltVInteriorMatrix
PETSc.LibPETSc.PetscDTAltVInteriorPattern — Method
PetscDTAltVInteriorPattern(petsclib::PetscLibType, N::PetscInt, k::PetscInt, noname::Ptr{Cvoid})compute the sparsity and sign pattern of the interior product matrix computed in PetscDTAltVInteriorMatrix()
Input Parameters:
N- the dimension of the vector space, N \ge 0k- the degree of the k-forms on whichintvMatfromPetscDTAltVInteriorMatrix()acts, 0 le k le N .
Output Parameter:
indices- The interior product matrixintvMathas dimensions [(N choose (k-1)) x (N choose k)] and has (N choose k) * k
non-zeros. indices[i][0] and indices[i][1] are the row and column of a non-zero, and its value is equal to the vector coordinate v[j] if indices[i][2] = j, or -v[j] if indices[i][2] = -(j+1)
Level: intermediate
See also: PetscDTAltV, PetscDTAltVInterior(), PetscDTAltVInteriorMatrix(), PetscDTAltVPullback(), PetscDTAltVPullbackMatrix()
External Links
- PETSc Manual:
DT/PetscDTAltVInteriorPattern
PETSc.LibPETSc.PetscDTAltVPullback — Method
Lstarw::PetscReal = PetscDTAltVPullback(petsclib::PetscLibType, N::PetscInt, M::PetscInt, L::Vector{PetscReal}, k::PetscInt, w::Vector{PetscReal})Compute the pullback of a k-form under a linear transformation of the coordinate space
Input Parameters:
N- the dimension of the origin vector space of the linear transformation, M >= 0M- the dimension of the image vector space of the linear transformation, N >= 0L- a linear transformation, an [M x N] matrix in row-major formatk- the signed degree k of the |k|-form w, -(min(M,N)) <= k <= min(M,N). A negative form degree indicates that the pullback should be conjugated by
the Hodge star operator (see note).
w- a |k|-form in the image space, size [M choose |k|]
Output Parameter:
Lstarw- the pullback of w to a |k|-form in the origin space, size [N choose |k|]: (Lstarw)(v1,...vk) = w(Lv_1,...,Lv_k).
Level: intermediate
See also: PetscDTAltV, PetscDTAltVPullbackMatrix(), PetscDTAltVStar()
External Links
- PETSc Manual:
DT/PetscDTAltVPullback
PETSc.LibPETSc.PetscDTAltVPullbackMatrix — Method
Lstar::PetscReal = PetscDTAltVPullbackMatrix(petsclib::PetscLibType, N::PetscInt, M::PetscInt, L::Vector{PetscReal}, k::PetscInt)Compute the pullback matrix for k-forms under a linear transformation
Input Parameters:
N- the dimension of the origin vector space of the linear transformation, N >= 0M- the dimension of the image vector space of the linear transformation, M >= 0L- a linear transformation, an [M x N] matrix in row-major formatk- the signed degree k of the |k|-forms on which Lstar acts, -(min(M,N)) <= k <= min(M,N).
A negative form degree indicates that the pullback should be conjugated by the Hodge star operator (see note in PetscDTAltvPullback())
Output Parameter:
Lstar- the pullback matrix, an [(N choose |k|) x (M choose |k|)] matrix in row-major format such that Lstar * w = L^* w
Level: intermediate
See also: PetscDTAltV, PetscDTAltVPullback(), PetscDTAltVStar()
External Links
- PETSc Manual:
DT/PetscDTAltVPullbackMatrix
PETSc.LibPETSc.PetscDTAltVStar — Method
starw::PetscReal = PetscDTAltVStar(petsclib::PetscLibType, N::PetscInt, k::PetscInt, pow::PetscInt, w::Vector{PetscReal})Apply a power of the Hodge star operator, which maps k-forms to (N-k) forms, to a k-form
Input Parameters:
N- the dimension of the vector space, N >= 0k- the degree k of the k-form w, 0 <= k <= Npow- the number of times to apply the Hodge star operator: pow < 0 indicates that the inverse of the Hodge star operator should be applied |pow| times.w- a k-form, size [N choose k]
Output Parameter:
starw- (star)^pow w
Level: intermediate
See also: PetscDTAltV, PetscDTAltVPullback(), PetscDTAltVPullbackMatrix()
External Links
- PETSc Manual:
DT/PetscDTAltVStar
PETSc.LibPETSc.PetscDTAltVWedge — Method
awedgeb::PetscReal = PetscDTAltVWedge(petsclib::PetscLibType, N::PetscInt, j::PetscInt, k::PetscInt, a::Vector{PetscReal}, b::Vector{PetscReal})Compute the wedge product of a j-form and a k-form, giving a (j+k) form
Input Parameters:
N- the dimension of the vector space, N >= 0j- the degree j of the j-form a, 0 <= j <= Nk- the degree k of the k-form b, 0 <= k <= N and 0 <= j+k <= Na- a j-form, size [N choose j]b- a k-form, size [N choose k]
Output Parameter:
awedgeb- the (j+k)-form a wedge b, size [N choose (j+k)]: (a wedge b)(v1,...,v{j+k}) = \sum{s} sign(s) a(v{s1},...,v{sj}) b(v{s{j+1}},...,v{s_{j+k}}),
where the sum is over permutations s such that s1 < s2 < ... < sj and s{j+1} < s{j+2} < ... < s{j+k}.
Level: intermediate
See also: PetscDTAltV, PetscDTAltVWedgeMatrix(), PetscDTAltVPullback(), PetscDTAltVPullbackMatrix()
External Links
- PETSc Manual:
DT/PetscDTAltVWedge
PETSc.LibPETSc.PetscDTAltVWedgeMatrix — Method
awedgeMat::PetscReal = PetscDTAltVWedgeMatrix(petsclib::PetscLibType, N::PetscInt, j::PetscInt, k::PetscInt, a::Vector{PetscReal})Compute the matrix defined by the wedge product with a given j-form that maps k-forms to (j+k)-forms
Input Parameters:
N- the dimension of the vector space, N >= 0j- the degree j of the j-form a, 0 <= j <= Nk- the degree k of the k-forms that (a wedge) will be applied to, 0 <= k <= N and 0 <= j+k <= Na- a j-form, size [N choose j]
Output Parameter:
awedgeMat- (a wedge), an [(N choose j+k) x (N choose k)] matrix in row-major order, such that (a wedge) * b = a wedge b
Level: intermediate
See also: PetscDTAltV, PetscDTAltVPullback(), PetscDTAltVPullbackMatrix()
External Links
- PETSc Manual:
DT/PetscDTAltVWedgeMatrix
PETSc.LibPETSc.PetscDTBaryToIndex — Method
index::PetscInt = PetscDTBaryToIndex(petsclib::PetscLibType, len::PetscInt, sum::PetscInt, coord::Vector{PetscInt})convert a barycentric coordinate to an index
Input Parameters:
len- the desired length of the barycentric tuple (usually 1 more than the dimension it represents, so a barycentric coordinate in a triangle has length 3)sum- the value that the sum of the barycentric coordinates (which will be non-negative integers) should sum tocoord- a barycentric coordinate with the given lengthlenandsum
Output Parameter:
index- the unique index for the coordinate, >= 0 and < Binomial(len - 1 + sum, sum)
Level: beginner
See also: PetscDTIndexToBary
External Links
- PETSc Manual:
DT/PetscDTBaryToIndex
PETSc.LibPETSc.PetscDTCreateDefaultQuadrature — Method
q::PetscQuadrature,fq::PetscQuadrature = PetscDTCreateDefaultQuadrature(petsclib::PetscLibType, ct::DMPolytopeType, qorder::PetscInt)Create default quadrature for a given cell
Not collective
Input Parameters:
ct- The integration domainqorder- The desired quadrature order
Output Parameters:
q- The cell quadraturefq- The face quadrature
Level: developer
See also: PetscDTCreateQuadratureByCell(), PetscFECreateDefault(), PetscDTGaussTensorQuadrature(), PetscDTSimplexQuadrature(), PetscDTTensorQuadratureCreate()
External Links
- PETSc Manual:
DT/PetscDTCreateDefaultQuadrature
PETSc.LibPETSc.PetscDTCreateQuadratureByCell — Method
q::PetscQuadrature,fq::PetscQuadrature = PetscDTCreateQuadratureByCell(petsclib::PetscLibType, ct::DMPolytopeType, qorder::PetscInt, qtype::PetscDTSimplexQuadratureType)Create default quadrature for a given cell
Not collective
Input Parameters:
ct- The integration domainqorder- The desired quadrature orderqtype- The type of simplex quadrature, or PETSCDTSIMPLEXQUAD_DEFAULT
Output Parameters:
q- The cell quadraturefq- The face quadrature
Level: developer
See also: PetscDTCreateDefaultQuadrature(), PetscFECreateDefault(), PetscDTGaussTensorQuadrature(), PetscDTSimplexQuadrature(), PetscDTTensorQuadratureCreate()
External Links
- PETSc Manual:
DT/PetscDTCreateQuadratureByCell
PETSc.LibPETSc.PetscDTGaussJacobiQuadrature — Method
PetscDTGaussJacobiQuadrature(petsclib::PetscLibType, npoints::PetscInt, a::PetscReal, b::PetscReal, alpha::PetscReal, beta::PetscReal, x::Vector{PetscReal}, w::Vector{PetscReal})quadrature for the interval [a, b] with the weight function (x-a)^\alpha (x-b)^\beta.
Not Collective
Input Parameters:
npoints- the number of points in the quadrature rulea- the left endpoint of the intervalb- the right endpoint of the intervalalpha- the left exponentbeta- the right exponent
Output Parameters:
x- array of lengthnpoints, the locations of the quadrature pointsw- array of lengthnpoints, the weights of the quadrature points
Level: intermediate
See also: PetscDTGaussQuadrature()
External Links
- PETSc Manual:
DT/PetscDTGaussJacobiQuadrature
PETSc.LibPETSc.PetscDTGaussLobattoJacobiQuadrature — Method
PetscDTGaussLobattoJacobiQuadrature(petsclib::PetscLibType, npoints::PetscInt, a::PetscReal, b::PetscReal, alpha::PetscReal, beta::PetscReal, x::Vector{PetscReal}, w::Vector{PetscReal})quadrature for the interval [a, b] with the weight function (x-a)^\alpha (x-b)^\beta, with endpoints a and b included as quadrature points.
Not Collective
Input Parameters:
npoints- the number of points in the quadrature rulea- the left endpoint of the intervalb- the right endpoint of the intervalalpha- the left exponentbeta- the right exponent
Output Parameters:
x- array of lengthnpoints, the locations of the quadrature pointsw- array of lengthnpoints, the weights of the quadrature points
Level: intermediate
See also: PetscDTGaussJacobiQuadrature()
External Links
- PETSc Manual:
DT/PetscDTGaussLobattoJacobiQuadrature
PETSc.LibPETSc.PetscDTGaussLobattoLegendreQuadrature — Method
PetscDTGaussLobattoLegendreQuadrature(petsclib::PetscLibType, npoints::PetscInt, type::PetscGaussLobattoLegendreCreateType, x::Vector{PetscReal}, w::Vector{PetscReal})creates a set of the locations and weights of the Gauss-Lobatto-Legendre nodes of a given size on the domain [-1,1]
Not Collective
Input Parameters:
npoints- number of grid nodestype-PETSCGAUSSLOBATTOLEGENDRE_VIA_LINEAR_ALGEBRAorPETSCGAUSSLOBATTOLEGENDRE_VIA_NEWTON
Output Parameters:
x- quadrature points, pass in an array of lengthnpointsw- quadrature weights, pass in an array of lengthnpoints
Level: intermediate
See also: PetscDTGaussQuadrature(), PetscGaussLobattoLegendreCreateType
External Links
- PETSc Manual:
DT/PetscDTGaussLobattoLegendreQuadrature
PETSc.LibPETSc.PetscDTGaussQuadrature — Method
PetscDTGaussQuadrature(petsclib::PetscLibType, npoints::PetscInt, a::PetscReal, b::PetscReal, x::Vector{PetscReal}, w::Vector{PetscReal})create Gauss-Legendre quadrature
Not Collective
Input Parameters:
npoints- number of pointsa- left end of interval (often-1)b- right end of interval (often +1)
Output Parameters:
x- quadrature pointsw- quadrature weights
Level: intermediate
See also: PetscDTLegendreEval(), PetscDTGaussJacobiQuadrature()
External Links
- PETSc Manual:
DT/PetscDTGaussQuadrature
PETSc.LibPETSc.PetscDTGaussTensorQuadrature — Method
q::PetscQuadrature = PetscDTGaussTensorQuadrature(petsclib::PetscLibType, dim::PetscInt, Nc::PetscInt, npoints::PetscInt, a::PetscReal, b::PetscReal)creates a tensor-product Gauss quadrature
Not Collective
Input Parameters:
dim- The spatial dimensionNc- The number of componentsnpoints- number of points in one dimensiona- left end of interval (often-1)b- right end of interval (often +1)
Output Parameter:
q- APetscQuadratureobject
Level: intermediate
See also: PetscDTGaussQuadrature(), PetscDTLegendreEval()
External Links
- PETSc Manual:
DT/PetscDTGaussTensorQuadrature
PETSc.LibPETSc.PetscDTGradedOrderToIndex — Method
index::PetscInt = PetscDTGradedOrderToIndex(petsclib::PetscLibType, len::PetscInt, degtup::Vector{PetscInt})convert a tuple into an index in a graded order, the inverse of PetscDTIndexToGradedOrder().
Input Parameters:
len- the length of the degree tupledegtup- tuple with this length
Output Parameter:
index- index in graded order: >= 0
Level: beginner
See also: PetscDTIndexToGradedOrder()
External Links
- PETSc Manual:
DT/PetscDTGradedOrderToIndex
PETSc.LibPETSc.PetscDTIndexToBary — Method
PetscDTIndexToBary(petsclib::PetscLibType, len::PetscInt, sum::PetscInt, index::PetscInt, coord::Vector{PetscInt})convert an index into a barycentric coordinate.
Input Parameters:
len- the desired length of the barycentric tuple (usually 1 more than the dimension it represents, so a barycentric coordinate in a triangle has length 3)sum- the value that the sum of the barycentric coordinates (which will be non-negative integers) should sum toindex- the index to convert: should be >= 0 and < Binomial(len - 1 + sum, sum)
Output Parameter:
coord- will be filled with the barycentric coordinate, of lengthn
Level: beginner
See also: PetscDTBaryToIndex()
External Links
- PETSc Manual:
DT/PetscDTIndexToBary
PETSc.LibPETSc.PetscDTIndexToGradedOrder — Method
PetscDTIndexToGradedOrder(petsclib::PetscLibType, len::PetscInt, index::PetscInt, degtup::Vector{PetscInt})convert an index into a tuple of monomial degrees in a graded order (that is, if the degree sum of tuple x is less than the degree sum of tuple y, then the index of x is smaller than the index of y)
Input Parameters:
len- the desired length of the degree tupleindex- the index to convert: should be >= 0
Output Parameter:
degtup- filled with a tuple of degrees
Level: beginner
See also: PetscDTGradedOrderToIndex()
External Links
- PETSc Manual:
DT/PetscDTIndexToGradedOrder
PETSc.LibPETSc.PetscDTJacobiEval — Method
PetscDTJacobiEval(petsclib::PetscLibType, npoints::PetscInt, alpha::PetscReal, beta::PetscReal, points::Vector{PetscReal}, ndegree::PetscInt, degrees::Vector{PetscInt}, B::Vector{PetscReal}, D::Vector{PetscReal}, D2::Vector{PetscReal})evaluate Jacobi polynomials for the weight function (1.+x)^{\alpha} (1.-x)^{\beta} at a set of points at points
Not Collective
Input Parameters:
npoints- number of spatial points to evaluate atalpha- the left exponent > -1beta- the right exponent > -1points- array of locations to evaluate atndegree- number of basis degrees to evaluatedegrees- sorted array of degrees to evaluate
Output Parameters:
B- row-oriented basis evaluation matrix B[pointndegree + degree] (dimension npointsndegrees, allocated by caller) (orNULL)D- row-oriented derivative evaluation matrix (orNULL)D2- row-oriented second derivative evaluation matrix (orNULL)
Level: intermediate
See also: PetscDTGaussQuadrature(), PetscDTLegendreEval()
External Links
- PETSc Manual:
DT/PetscDTJacobiEval
PETSc.LibPETSc.PetscDTJacobiEvalJet — Method
PetscDTJacobiEvalJet(petsclib::PetscLibType, alpha::PetscReal, beta::PetscReal, npoints::PetscInt, points::Vector{PetscReal}, degree::PetscInt, k::PetscInt, p::Vector{PetscReal})Evaluate the jet (function and derivatives) of the Jacobi polynomials basis up to a given degree.
Input Parameters:
alpha- the left exponent of the weightbeta- the right exponetn of the weightnpoints- the number of points to evaluate the polynomials atpoints- [npoints] array of point coordinatesdegree- the maximm degree polynomial space to evaluate, (degree + 1) will be evaluated total.k- the maximum derivative to evaluate in the jet, (k + 1) will be evaluated total.
Output Parameter:
p- an array containing the evaluations of the Jacobi polynomials's jets on the points. the size is (degree + 1) x
(k + 1) x npoints, which also describes the order of the dimensions of this three-dimensional array: the first (slowest varying) dimension is polynomial degree; the second dimension is derivative order; the third (fastest varying) dimension is the index of the evaluation point.
Level: advanced
See also: PetscDTJacobiEval(), PetscDTPKDEvalJet()
External Links
- PETSc Manual:
DT/PetscDTJacobiEvalJet
PETSc.LibPETSc.PetscDTJacobiNorm — Method
norm::PetscReal = PetscDTJacobiNorm(petsclib::PetscLibType, alpha::PetscReal, beta::PetscReal, n::PetscInt)Compute the weighted L2 norm of a Jacobi polynomial.
\| P^{\alpha,\beta}n \|{\alpha,\beta}^2 = \int{-1}^1 (1 + x)^{\alpha} (1 - x)^{\beta} P^{\alpha,\beta}n (x)^2 dx.
Input Parameters:
alpha- the left exponent > -1beta- the right exponent > -1n- the polynomial degree
Output Parameter:
norm- the weighted L2 norm
Level: beginner
See also: PetscQuadrature, PetscDTJacobiEval()
External Links
- PETSc Manual:
DT/PetscDTJacobiNorm
PETSc.LibPETSc.PetscDTLegendreEval — Method
PetscDTLegendreEval(petsclib::PetscLibType, npoints::PetscInt, points::Vector{PetscReal}, ndegree::PetscInt, degrees::Vector{PetscInt}, B::Vector{PetscReal}, D::Vector{PetscReal}, D2::Vector{PetscReal})evaluate Legendre polynomials at points
Not Collective
Input Parameters:
npoints- number of spatial points to evaluate atpoints- array of locations to evaluate atndegree- number of basis degrees to evaluatedegrees- sorted array of degrees to evaluate
Output Parameters:
B- row-oriented basis evaluation matrix B[pointndegree + degree] (dimensionnpointsndegrees, allocated by caller) (orNULL)D- row-oriented derivative evaluation matrix (orNULL)D2- row-oriented second derivative evaluation matrix (orNULL)
Level: intermediate
See also: PetscDTGaussQuadrature()
External Links
- PETSc Manual:
DT/PetscDTLegendreEval
PETSc.LibPETSc.PetscDTPKDEvalJet — Method
PetscDTPKDEvalJet(petsclib::PetscLibType, dim::PetscInt, npoints::PetscInt, points::Vector{PetscReal}, degree::PetscInt, k::PetscInt, p::Vector{PetscReal})Evaluate the jet (function and derivatives) of the Proriol-Koornwinder-Dubiner (PKD) basis for the space of polynomials up to a given degree.
Input Parameters:
dim- the number of variables in the multivariate polynomialsnpoints- the number of points to evaluate the polynomials atpoints- [npoints x dim] array of point coordinatesdegree- the degree (sum of degrees on the variables in a monomial) of the polynomial space to evaluate. There are ((dim + degree) choose dim) polynomials in this space.k- the maximum order partial derivative to evaluate in the jet. There are (dim + k choose dim) partial derivatives
in the jet. Choosing k = 0 means to evaluate just the function and no derivatives
Output Parameter:
p- an array containing the evaluations of the PKD polynomials' jets on the points. The size is ((dim + degree)
choose dim) x ((dim + k) choose dim) x npoints, which also describes the order of the dimensions of this three-dimensional array: the first (slowest varying) dimension is basis function index; the second dimension is jet index; the third (fastest varying) dimension is the index of the evaluation point.
Level: advanced
See also: PetscDTGradedOrderToIndex(), PetscDTIndexToGradedOrder(), PetscDTJacobiEvalJet()
External Links
- PETSc Manual:
DT/PetscDTPKDEvalJet
PETSc.LibPETSc.PetscDTPTrimmedEvalJet — Method
PetscDTPTrimmedEvalJet(petsclib::PetscLibType, dim::PetscInt, npoints::PetscInt, points::Vector{PetscReal}, degree::PetscInt, formDegree::PetscInt, jetDegree::PetscInt, p::Vector{PetscReal})Evaluate the jet (function and derivatives) of a basis of the trimmed polynomial k-forms up to a given degree.
Input Parameters:
dim- the number of variables in the multivariate polynomialsnpoints- the number of points to evaluate the polynomials atpoints- [npoints x dim] array of point coordinatesdegree- the degree (sum of degrees on the variables in a monomial) of the trimmed polynomial space to evaluate.
There are ((dim + degree) choose (dim + formDegree)) x ((degree + formDegree - 1) choose (formDegree)) polynomials in this space. (You can use PetscDTPTrimmedSize() to compute this size.)
formDegree- the degree of the formjetDegree- the maximum order partial derivative to evaluate in the jet. There are ((dim + jetDegree) choose dim) partial derivatives
in the jet. Choosing jetDegree = 0 means to evaluate just the function and no derivatives
Output Parameter:
p- an array containing the evaluations of the PKD polynomials' jets on the points.
Level: advanced
See also: PetscDTPKDEvalJet(), PetscDTPTrimmedSize()
External Links
- PETSc Manual:
DT/PetscDTPTrimmedEvalJet
PETSc.LibPETSc.PetscDTPTrimmedSize — Method
size::PetscInt = PetscDTPTrimmedSize(petsclib::PetscLibType, dim::PetscInt, degree::PetscInt, formDegree::PetscInt)The size of the trimmed polynomial space of k-forms with a given degree and form degree, which can be evaluated in PetscDTPTrimmedEvalJet().
Input Parameters:
dim- the number of variables in the multivariate polynomialsdegree- the degree (sum of degrees on the variables in a monomial) of the trimmed polynomial space.formDegree- the degree of the form
Output Parameter:
size- The number ((dim+degree) choose (dim+formDegree)) x ((degree+formDegree- 1) choose (formDegree))
Level: advanced
See also: PetscDTPTrimmedEvalJet()
External Links
- PETSc Manual:
DT/PetscDTPTrimmedSize
PETSc.LibPETSc.PetscDTReconstructPoly — Method
PetscDTReconstructPoly(petsclib::PetscLibType, degree::PetscInt, nsource::PetscInt, sourcex::Vector{PetscReal}, ntarget::PetscInt, targetx::Vector{PetscReal}, R::Vector{PetscReal})create matrix representing polynomial reconstruction using cell intervals and evaluation at target intervals
Not Collective
Input Parameters:
degree- degree of reconstruction polynomialnsource- number of source intervalssourcex- sorted coordinates of source cell boundaries (lengthnsource+1)ntarget- number of target intervalstargetx- sorted coordinates of target cell boundaries (lengthntarget+1)
Output Parameter:
R- reconstruction matrix, utarget = sum_s R[t*nsource+s] * usource[s]
Level: advanced
See also: PetscDTLegendreEval()
External Links
- PETSc Manual:
DT/PetscDTReconstructPoly
PETSc.LibPETSc.PetscDTSimplexQuadrature — Method
quad::PetscQuadrature = PetscDTSimplexQuadrature(petsclib::PetscLibType, dim::PetscInt, degree::PetscInt, type::PetscDTSimplexQuadratureType)Create a quadrature rule for a simplex that exactly integrates polynomials up to a given degree.
Not Collective
Input Parameters:
dim- The spatial dimension of the simplex (1 = segment, 2 = triangle, 3 = tetrahedron)degree- The largest polynomial degree that is required to be integrated exactlytype-PetscDTSimplexQuadratureTypeindicating the type of quadrature rule
Output Parameter:
quad- APetscQuadratureobject for integration over the biunit simplex
(defined by the bounds xi >= -1 and \sumi x_i <= 2 - d) that is exact for polynomials up to the given degree
Level: intermediate
See also: PetscDTSimplexQuadratureType, PetscDTGaussQuadrature(), PetscDTStroudCononicalQuadrature(), PetscQuadrature
External Links
- PETSc Manual:
DT/PetscDTSimplexQuadrature
PETSc.LibPETSc.PetscDTStroudConicalQuadrature — Method
q::PetscQuadrature = PetscDTStroudConicalQuadrature(petsclib::PetscLibType, dim::PetscInt, Nc::PetscInt, npoints::PetscInt, a::PetscReal, b::PetscReal)create Stroud conical quadrature for a simplex {cite}karniadakis2005spectral
Not Collective
Input Parameters:
dim- The simplex dimensionNc- The number of componentsnpoints- The number of points in one dimensiona- left end of interval (often-1)b- right end of interval (often +1)
Output Parameter:
q- APetscQuadratureobject
Level: intermediate
See also: PetscDTGaussTensorQuadrature(), PetscDTGaussQuadrature()
External Links
- PETSc Manual:
DT/PetscDTStroudConicalQuadrature
PETSc.LibPETSc.PetscDTTanhSinhIntegrate — Method
sol::PetscReal = PetscDTTanhSinhIntegrate(petsclib::PetscLibType, func::external, a::PetscReal, b::PetscReal, digits::PetscInt, ctx::Ptr{Cvoid})Approximate \int_a^b f(x)\,dx to a requested precision using adaptive tanh-sinh (double-exponential) quadrature
Not Collective; No Fortran Support
Input Parameters:
func- the integrand callback (func(x, ctx, &value)evaluates the integrand at pointx)a- lower limit of integrationb- upper limit of integrationdigits- target number of correct decimal digitsctx- optional application context passed tofunc
Output Parameter:
sol- the approximate value of the integral
Level: developer
See also: PetscDTTanhSinhIntegrateMPFR(), PetscDTGaussQuadrature()
External Links
- PETSc Manual:
DT/PetscDTTanhSinhIntegrate
PETSc.LibPETSc.PetscDTTanhSinhIntegrateMPFR — Method
sol::PetscReal = PetscDTTanhSinhIntegrateMPFR(petsclib::PetscLibType, func::external, a::PetscReal, b::PetscReal, digits::PetscInt, ctx::Ptr{Cvoid})High-precision version of PetscDTTanhSinhIntegrate() that uses the MPFR arbitrary-precision library to evaluate the quadrature
Not Collective; No Fortran Support
Input Parameters:
func- the integrand callback (func(x, ctx, &value)evaluates the integrand at pointx)a- lower limit of integrationb- upper limit of integrationdigits- target number of correct decimal digits (also drives the working MPFR precision)ctx- optional application context passed tofunc
Output Parameter:
sol- the approximate value of the integral
Level: developer
See also: PetscDTTanhSinhIntegrate(), PetscDTGaussQuadrature()
External Links
- PETSc Manual:
DT/PetscDTTanhSinhIntegrateMPFR
PETSc.LibPETSc.PetscDTTanhSinhTensorQuadrature — Method
q::PetscQuadrature = PetscDTTanhSinhTensorQuadrature(petsclib::PetscLibType, dim::PetscInt, level::PetscInt, a::PetscReal, b::PetscReal)create tanh-sinh quadrature for a tensor product cell
Not Collective
Input Parameters:
dim- The cell dimensionlevel- The number of points in one dimension, 2^la- left end of interval (often-1)b- right end of interval (often +1)
Output Parameter:
q- APetscQuadratureobject
Level: intermediate
See also: PetscDTGaussTensorQuadrature(), PetscQuadrature
External Links
- PETSc Manual:
DT/PetscDTTanhSinhTensorQuadrature
PETSc.LibPETSc.PetscDTTensorQuadratureCreate — Method
q::PetscQuadrature = PetscDTTensorQuadratureCreate(petsclib::PetscLibType, q1::PetscQuadrature, q2::PetscQuadrature)create the tensor product quadrature from two lower-dimensional quadratures
Not Collective
Input Parameters:
q1- The first quadratureq2- The second quadrature
Output Parameter:
q- APetscQuadratureobject
Level: intermediate
See also: PetscQuadrature, PetscDTGaussTensorQuadrature()
External Links
- PETSc Manual:
DT/PetscDTTensorQuadratureCreate
PETSc.LibPETSc.PetscDemangleSymbol — Method
name::String = PetscDemangleSymbol(petsclib::PetscLibType, mangledName::String)Convert a C++-mangled symbol name to its human-readable form using abi::__cxa_demangle() when available
Not Collective
Input Parameter:
mangledName- the mangled symbol name (typically obtained fromdladdr())
Output Parameter:
name- newly-allocated, null-terminated demangled name; caller mustPetscFree()it
Level: developer
See also: PetscStackView(), PetscStackPrint()
External Links
- PETSc Manual:
Sys/PetscDemangleSymbol
PETSc.LibPETSc.PetscDetermineInitialFPTrap — Method
PetscDetermineInitialFPTrap(petsclib::PetscLibType)Attempts to determine the floating point trapping that exists when PetscInitialize() is called
Not Collective
See also: PetscFPTrapPush(), PetscFPTrapPop(), PetscDetermineInitialFPTrap()
External Links
- PETSc Manual:
Sys/PetscDetermineInitialFPTrap
PETSc.LibPETSc.PetscEListFind — Method
value::PetscInt,found::PetscBool = PetscEListFind(petsclib::PetscLibType, n::PetscInt, list::Cchar, str::String)searches list of strings for given string, using case insensitive matching
Not Collective; No Fortran Support
Input Parameters:
n- number of strings inlist- list of strings to searchstr- string to look for, empty string "" accepts default (first entry in list)
Output Parameters:
value- index of matching string (if found)found- boolean indicating whether string was found (can beNULL)
Level: developer
See also: PetscEnumFind()
External Links
- PETSc Manual:
Sys/PetscEListFind
PETSc.LibPETSc.PetscElementalFinalizePackage — Method
PetscElementalFinalizePackage(petsclib::PetscLibType)External Links
- PETSc Manual:
Sys/PetscElementalFinalizePackage
PETSc.LibPETSc.PetscElementalInitializePackage — Method
PetscElementalInitializePackage(petsclib::PetscLibType)External Links
- PETSc Manual:
Sys/PetscElementalInitializePackage
PETSc.LibPETSc.PetscElementalInitialized — Method
isInitialized::PetscBool = PetscElementalInitialized(petsclib::PetscLibType)External Links
- PETSc Manual:
Sys/PetscElementalInitialized
PETSc.LibPETSc.PetscEmacsClientErrorHandler — Method
PetscEmacsClientErrorHandler(petsclib::PetscLibType, comm::MPI_Comm, line::Cint, fun::String, file::String, n::PetscErrorCode, p::PetscErrorType, mess::String, ctx::Ptr{Cvoid})Error handler that uses the emacsclient program to load the file where the error occurred. Then calls the "previous" error handler.
Not Collective, No Fortran Support
Input Parameters:
comm- communicator over which error occurredline- the line number of the error (usually indicated by__LINE__in the calling routine)file- the file in which the error was detected (usually indicated by__FILE__in the calling routine)fun- the function name of the calling routinemess- an error text string, usually just printed to the screenn- the generic error numberp-PETSC_ERROR_INITIALindicates this is the first time the error handler is being called whilePETSC_ERROR_REPEATindicates it was previously calledctx- error handler context
Options Database Key:
-on_error_emacs machinename- will contact machinename to open the Emacs client there
Level: developer
See also: PetscError(), PetscPushErrorHandler(), PetscPopErrorHandler(), PetscAttachDebuggerErrorHandler(), PetscAbortErrorHandler(), PetscMPIAbortErrorHandler(), PetscTraceBackErrorHandler(), PetscReturnErrorHandler(), PetscErrorType, PETSC_ERROR_INITIAL, PETSC_ERROR_REPEAT, PetscErrorCode
External Links
- PETSc Manual:
Sys/PetscEmacsClientErrorHandler
PETSc.LibPETSc.PetscEnd — Method
PetscEnd(petsclib::PetscLibType)Calls PetscFinalize() and then ends the program. This is useful if one wishes a clean exit somewhere deep in the program.
Collective on PETSC_COMM_WORLD
Level: advanced
See also: PetscInitialize(), PetscOptionsView(), PetscMallocDump(), PetscMPIDump(), PetscFinalize()
External Links
- PETSc Manual:
Sys/PetscEnd
PETSc.LibPETSc.PetscEnumFind — Method
value::PetscEnum,found::PetscBool = PetscEnumFind(petsclib::PetscLibType, enumlist::Cchar, str::String)searches enum list of strings for given string, using case insensitive matching
Not Collective; No Fortran Support
Input Parameters:
enumlist- list of strings to search, followed by enum name, then enum prefix, thenNULLstr- string to look for
Output Parameters:
value- index of matching string (if found)found- boolean indicating whether string was found (can beNULL)
Level: advanced
See also: PetscEListFind()
External Links
- PETSc Manual:
Sys/PetscEnumFind
PETSc.LibPETSc.PetscErrorMessage — Method
text::String,specific::String = PetscErrorMessage(petsclib::PetscLibType, errnum::PetscErrorCode)Returns the text string associated with a PETSc error code.
Not Collective, No Fortran Support
Input Parameter:
errnum- the error code
Output Parameters:
text- the error message (NULLif not desired)specific- the specific error message that was set withSETERRQ()or
PetscError(). (NULL if not desired)
Level: developer
See also: PetscErrorCode, PetscPushErrorHandler(), PetscAttachDebuggerErrorHandler(), PetscError(), SETERRQ(), PetscCall(), PetscAbortErrorHandler(), PetscTraceBackErrorHandler()
External Links
- PETSc Manual:
Sys/PetscErrorMessage
PETSc.LibPETSc.PetscErrorPrintfInitialize — Method
PetscErrorPrintfInitialize(petsclib::PetscLibType)Cache the architecture, host name, user name, program name and date so that PETSc's error-traceback printer does not need to make system calls from inside a signal handler
Collective
Level: developer
See also: PetscErrorPrintf, PetscTraceBackErrorHandler(), PetscPushErrorHandler()
External Links
- PETSc Manual:
Sys/PetscErrorPrintfInitialize
PETSc.LibPETSc.PetscFClose — Method
PetscFClose(petsclib::PetscLibType, comm::MPI_Comm, fd::Libc.FILE)Has MPI rank 0 in the communicator close a file (usually obtained with PetscFOpen(); all others do nothing.
Logically Collective
Input Parameters:
comm- the MPI communicatorfd- the file, opened withPetscFOpen()
Level: developer
See also: PetscFOpen()
External Links
- PETSc Manual:
Sys/PetscFClose
PETSc.LibPETSc.PetscFFlush — Method
PetscFFlush(petsclib::PetscLibType, fd::Libc.FILE)Flush a file stream
Input Parameter:
fd- The file stream handle
Level: intermediate
See also: PetscPrintf(), PetscFPrintf(), PetscVFPrintf(), PetscVSNPrintf()
External Links
- PETSc Manual:
Sys/PetscFFlush
PETSc.LibPETSc.PetscFOpen — Method
fp::Ptr{Libc.FILE} = PetscFOpen(petsclib::PetscLibType, comm::MPI_Comm, name::String, mode::String)Has the first process in the MPI communicator open a file; all others do nothing.
Logically Collective
Input Parameters:
comm- the MPI communicatorname- the filenamemode- the mode forfopen(), usually "w"
Output Parameter:
fp- the file pointer
Level: developer
See also: PetscFClose(), PetscSynchronizedFGets(), PetscSynchronizedPrintf(), PetscSynchronizedFlush(), PetscFPrintf()
External Links
- PETSc Manual:
Sys/PetscFOpen
PETSc.LibPETSc.PetscFPTrapPop — Method
PetscFPTrapPop(petsclib::PetscLibType)push a floating point trapping mode, to be restored using PetscFPTrapPop()
Not Collective
Level: advanced
See also: PetscFPTrapPush(), PetscSetFPTrap(), PetscDetermineInitialFPTrap()
External Links
- PETSc Manual:
Sys/PetscFPTrapPop
PETSc.LibPETSc.PetscFPTrapPush — Method
PetscFPTrapPush(petsclib::PetscLibType, trap::PetscFPTrap)push a floating point trapping mode, restored using PetscFPTrapPop()
Not Collective
Input Parameter:
trap-PETSC_FP_TRAP_ONorPETSC_FP_TRAP_OFFor any of the values passable toPetscSetFPTrap()
Level: advanced
See also: PetscFPTrapPop(), PetscSetFPTrap(), PetscDetermineInitialFPTrap()
External Links
- PETSc Manual:
Sys/PetscFPTrapPush
PETSc.LibPETSc.PetscFileRetrieve — Method
found::PetscBool = PetscFileRetrieve(petsclib::PetscLibType, comm::MPI_Comm, url::String, localname::String, llen::Csize_t)Obtains a file from a URL or a compressed file and copies into local disk space as uncompressed.
Collective
Input Parameters:
comm- processors accessing the fileurl- name of file, including entire URL (with or without .gz)llen- length oflocalname
Output Parameters:
localname- name of local copy of file - valid on only process zerofound- if found or retrieved the file - valid on all processes
Level: developer
See also: PetscDLLibraryRetrieve()
External Links
- PETSc Manual:
Sys/PetscFileRetrieve
PETSc.LibPETSc.PetscFinalize — Method
PetscFinalize(petsclib::PetscLibType)Checks for options to be called at the conclusion of a PETSc program and frees any remaining PETSc objects and data structures. of the program. Automatically calls MPI_Finalize() if the user had not called MPI_Init() before calling PetscInitialize().
Collective on PETSC_COMM_WORLD
Options Database Keys:
-options_view- CallsPetscOptionsView()to display all options in the database-options_left- Prints unused options that remain in the database (default value istrue)-objects_dump [all]- Prints list of objects allocated by the user that have not been freed, the option all cause all outstanding objects to be listed-mpidump- Calls PetscMPIDump()-malloc_dump [filename]- CallsPetscMallocDump(), displays all memory allocated that has not been freed-memory_view- Prints total memory usage-malloc_view [filename]- Prints list of all memory allocated and in what functions
Level: beginner
See also: PetscInitialize(), PetscOptionsView(), PetscMallocDump(), PetscMPIDump(), PetscEnd()
External Links
- PETSc Manual:
Sys/PetscFinalize
PETSc.LibPETSc.PetscFinalized — Method
isFinalized::PetscBool = PetscFinalized(petsclib::PetscLibType)Determine whether PetscFinalize() has been called yet
Output Parameter:
isFinalized-PETSC_TRUEif PETSc is finalized,PETSC_FALSEotherwise
Level: developer
See also: PetscInitialize(), PetscInitializeNoArguments(), PetscInitializeFortran()
External Links
- PETSc Manual:
Sys/PetscFinalized
PETSc.LibPETSc.PetscFindCount — Method
loc::PetscCount = PetscFindCount(petsclib::PetscLibType, key::PetscCount, n::PetscCount, X::Vector{PetscCount})Finds the location of a PetscCount key in a sorted array of PetscCount
Not Collective
Input Parameters:
key- thePetscCountkey to locaten- number of values in the arrayX- array ofPetscCount
Output Parameter:
loc- the location if found, otherwise -(slot+1) where slot is the place the value would go
Level: intermediate
See also: PetscCount, PetscSortCount()
External Links
- PETSc Manual:
Sys/PetscFindCount
PETSc.LibPETSc.PetscFindInt — Method
loc::PetscInt = PetscFindInt(petsclib::PetscLibType, key::PetscInt, n::PetscCount, X::Vector{PetscInt})Finds the location of a PetscInt key in a sorted array of PetscInt
Not Collective
Input Parameters:
key- thePetscIntkey to locaten- number of values in the arrayX- array ofPetscInt
Output Parameter:
loc- the location if found, otherwise -(slot+1) where slot is the place the value would go
Level: intermediate
See also: PetscIntSortSemiOrdered(), PetscSortInt(), PetscSortIntWithArray(), PetscSortRemoveDupsInt()
External Links
- PETSc Manual:
Sys/PetscFindInt
PETSc.LibPETSc.PetscFindMPIInt — Method
loc::PetscInt = PetscFindMPIInt(petsclib::PetscLibType, key::PetscMPIInt, n::PetscCount, X::Vector{PetscMPIInt})Finds PetscMPIInt in a sorted array of PetscMPIInt
Not Collective
Input Parameters:
key- the integer to locaten- number of values in the arrayX- array ofPetscMPIInt
Output Parameter:
loc- the location if found, otherwise -(slot+1) where slot is the place the value would go
Level: intermediate
See also: PetscMPIIntSortSemiOrdered(), PetscSortInt(), PetscSortIntWithArray(), PetscSortRemoveDupsInt()
External Links
- PETSc Manual:
Sys/PetscFindMPIInt
PETSc.LibPETSc.PetscFindReal — Method
loc::PetscInt = PetscFindReal(petsclib::PetscLibType, key::PetscReal, n::PetscCount, t::Vector{PetscReal}, eps::PetscReal)Finds a PetscReal in a sorted array of PetscReals
Not Collective
Input Parameters:
key- the value to locaten- number of values in the arrayt- array of valueseps- tolerance used to compare
Output Parameter:
loc- the location if found, otherwise -(slot+1) where slot is the place the value would go
Level: intermediate
See also: PetscSortReal(), PetscSortRealWithArrayInt()
External Links
- PETSc Manual:
Sys/PetscFindReal
PETSc.LibPETSc.PetscFixFilename — Method
PetscFixFilename(petsclib::PetscLibType, filein::String, fileout::String)Fixes a file name so that it is correct for both Unix and Microsoft Windows by using the correct / or \ to separate directories.
Not Collective
Input Parameter:
filein- name of file to be fixed
Output Parameter:
fileout- the fixed name. Should long enough to hold the filename.
Level: developer
See also: PetscFOpen()
External Links
- PETSc Manual:
Sys/PetscFixFilename
PETSc.LibPETSc.PetscFormKeySort — Method
PetscFormKeySort(petsclib::PetscLibType, n::PetscInt, arr::Vector{PetscFormKey})Sorts an array of PetscFormKey in place in increasing order.
Not Collective
Input Parameters:
n- number of valuesarr- array ofPetscFormKey
Level: intermediate
See also: PetscFormKey, PetscIntSortSemiOrdered(), PetscSortInt()
External Links
- PETSc Manual:
DT/PetscFormKeySort
PETSc.LibPETSc.PetscFormatConvert — Method
PetscFormatConvert(petsclib::PetscLibType, format::String, newformat::String)converts %g to [|%g|] so that PetscVSNPrintf() can ensure all %g formatted numbers have a decimal point when printed.
No Fortran Support
Input Parameter:
format- the PETSc format string
Output Parameter:
newformat- the formatted string, must be long enough to hold result
Level: developer
See also: PetscFormatConvertGetSize(), PetscVSNPrintf(), PetscVFPrintf()
External Links
- PETSc Manual:
Sys/PetscFormatConvert
PETSc.LibPETSc.PetscFormatConvertGetSize — Method
size::Csize_t = PetscFormatConvertGetSize(petsclib::PetscLibType, format::String)Gets the length of a string needed to hold data converted with PetscFormatConvert() based on the format
No Fortran Support
Input Parameter:
format- the PETSc format string
Output Parameter:
size- the needed length of the new format
Level: developer
See also: PetscFormatConvert(), PetscVSNPrintf(), PetscVFPrintf()
External Links
- PETSc Manual:
Sys/PetscFormatConvertGetSize
PETSc.LibPETSc.PetscFormatRealArray — Method
PetscFormatRealArray(petsclib::PetscLibType, buf::String, len::Csize_t, fmt::String, n::PetscInt, x::Vector{PetscReal})Format an array of PetscReal values as a comma-separated string using a printf-style format
Not Collective; No Fortran Support
Input Parameters:
len- the length of the output buffer in bytesfmt- theprintf-style format string applied to each element (e.g."%g")n- number of values inxx- array ofPetscRealvalues to format
Output Parameter:
buf- the formatted, null-terminated string
Level: developer
See also: PetscSNPrintf(), PetscViewerASCIIPrintf()
External Links
- PETSc Manual:
Sys/PetscFormatRealArray
PETSc.LibPETSc.PetscFreeArguments — Method
args::String = PetscFreeArguments(petsclib::PetscLibType)Frees the memory obtained with PetscGetArguments()
Not Collective, No Fortran Support
Output Parameter:
args- the command line arguments
Level: intermediate
See also: PetscFinalize(), PetscInitializeFortran(), PetscGetArgs(), PetscGetArguments()
External Links
- PETSc Manual:
Sys/PetscFreeArguments
PETSc.LibPETSc.PetscGatherMessageLengths — Method
onodes::Ptr{PetscMPIInt},olengths::Ptr{PetscMPIInt} = PetscGatherMessageLengths(petsclib::PetscLibType, comm::MPI_Comm, nsends::PetscMPIInt, nrecvs::PetscMPIInt, ilengths::Vector{PetscMPIInt})Computes information about messages that an MPI rank will receive, including (from-id,length) pairs for each message.
Collective, No Fortran Support
Input Parameters:
comm- Communicatornsends- number of messages that are to be sent.nrecvs- number of messages being receivedilengths- an array of integers of length sizeof(comm)
a non zero ilengths[i] represent a message to i of length ilengths[i]
Output Parameters:
onodes- list of ranks from which messages are expectedolengths- corresponding message lengths
Level: developer
See also: PetscGatherNumberOfMessages(), PetscGatherMessageLengths2(), PetscCommBuildTwoSided()
External Links
- PETSc Manual:
Sys/PetscGatherMessageLengths
PETSc.LibPETSc.PetscGatherMessageLengths2 — Method
onodes::Ptr{PetscMPIInt},olengths1::Ptr{PetscMPIInt},olengths2::Ptr{PetscMPIInt} = PetscGatherMessageLengths2(petsclib::PetscLibType, comm::MPI_Comm, nsends::PetscMPIInt, nrecvs::PetscMPIInt, ilengths1::Vector{PetscMPIInt}, ilengths2::Vector{PetscMPIInt})Computes info about messages that a MPI rank will receive, including (from-id,length) pairs for each message. Same functionality as PetscGatherMessageLengths() except it takes TWO ilenths and output TWO olengths.
Collective, No Fortran Support
Input Parameters:
comm- Communicatornsends- number of messages that are to be sent.nrecvs- number of messages being receivedilengths1- first array of integers of length sizeof(comm)ilengths2- second array of integers of length sizeof(comm)
Output Parameters:
onodes- list of ranks from which messages are expectedolengths1- first corresponding message lengthsolengths2- second message lengths
Level: developer
See also: PetscGatherMessageLengths(), PetscGatherNumberOfMessages(), PetscCommBuildTwoSided()
External Links
- PETSc Manual:
Sys/PetscGatherMessageLengths2
PETSc.LibPETSc.PetscGatherNumberOfMessages — Method
nrecvs::PetscMPIInt = PetscGatherNumberOfMessages(petsclib::PetscLibType, comm::MPI_Comm, iflags::Vector{PetscMPIInt}, ilengths::Vector{PetscMPIInt})Computes the number of messages an MPI rank expects to receive during a neighbor communication
Collective, No Fortran Support
Input Parameters:
comm- Communicatoriflags- an array of integers of length sizeof(comm). A '1' inilengths[i] represent a
message from current node to ith node. Optionally NULL
ilengths- Non zero ilengths[i] represent a message to i of lengthilengths[i].
Optionally NULL.
Output Parameter:
nrecvs- number of messages received
Level: developer
See also: PetscGatherMessageLengths(), PetscGatherMessageLengths2(), PetscCommBuildTwoSided()
External Links
- PETSc Manual:
Sys/PetscGatherNumberOfMessages
PETSc.LibPETSc.PetscGaussLobattoLegendreElementAdvectionCreate — Method
AA::Ptr{PetscReal} = PetscGaussLobattoLegendreElementAdvectionCreate(petsclib::PetscLibType, n::PetscInt, nodes::Vector{PetscReal}, weights::Vector{PetscReal})computes the advection operator for a single 1d GLL element
Not Collective
Input Parameters:
n- the number of GLL nodesnodes- the GLL nodes, of lengthnweights- the GLL weights, of lengthn
Output Parameter:
AA- the stiffness element, of dimensionnbyn
Level: beginner
See also: PetscDTGaussLobattoLegendreQuadrature(), PetscGaussLobattoLegendreElementLaplacianCreate(), PetscGaussLobattoLegendreElementAdvectionDestroy()
External Links
- PETSc Manual:
DT/PetscGaussLobattoLegendreElementAdvectionCreate
PETSc.LibPETSc.PetscGaussLobattoLegendreElementAdvectionDestroy — Method
PetscGaussLobattoLegendreElementAdvectionDestroy(petsclib::PetscLibType, n::PetscInt, nodes::Vector{PetscReal}, weights::Vector{PetscReal}, AA::PetscReal)frees the advection stiffness for a single 1d GLL element created with PetscGaussLobattoLegendreElementAdvectionCreate()
Not Collective
Input Parameters:
n- the number of GLL nodesnodes- the GLL nodes, ignoredweights- the GLL weights, ignoredAA- advection obtained withPetscGaussLobattoLegendreElementAdvectionCreate()
Level: beginner
See also: PetscDTGaussLobattoLegendreQuadrature(), PetscGaussLobattoLegendreElementAdvectionCreate()
External Links
- PETSc Manual:
DT/PetscGaussLobattoLegendreElementAdvectionDestroy
PETSc.LibPETSc.PetscGaussLobattoLegendreElementGradientCreate — Method
AA::Ptr{PetscReal},AAT::Ptr{PetscReal} = PetscGaussLobattoLegendreElementGradientCreate(petsclib::PetscLibType, n::PetscInt, nodes::Vector{PetscReal}, weights::Vector{PetscReal})computes the gradient for a single 1d GLL element
Not Collective
Input Parameters:
n- the number of GLL nodesnodes- the GLL nodes, of lengthnweights- the GLL weights, of lengthn
Output Parameters:
AA- the stiffness element, of dimensionnbynAAT- the transpose of AA (pass inNULLif you do not need this array), of dimensionnbyn
Level: beginner
See also: PetscDTGaussLobattoLegendreQuadrature(), PetscGaussLobattoLegendreElementLaplacianDestroy(), PetscGaussLobattoLegendreElementGradientDestroy()
External Links
- PETSc Manual:
DT/PetscGaussLobattoLegendreElementGradientCreate
PETSc.LibPETSc.PetscGaussLobattoLegendreElementGradientDestroy — Method
PetscGaussLobattoLegendreElementGradientDestroy(petsclib::PetscLibType, n::PetscInt, nodes::Vector{PetscReal}, weights::Vector{PetscReal}, AA::PetscReal, AAT::PetscReal)frees the gradient for a single 1d GLL element obtained with PetscGaussLobattoLegendreElementGradientCreate()
Not Collective
Input Parameters:
n- the number of GLL nodesnodes- the GLL nodes, ignoredweights- the GLL weights, ignoredAA- the stiffness element obtained withPetscGaussLobattoLegendreElementGradientCreate()AAT- the transpose of the element obtained withPetscGaussLobattoLegendreElementGradientCreate()
Level: beginner
See also: PetscDTGaussLobattoLegendreQuadrature(), PetscGaussLobattoLegendreElementLaplacianCreate(), PetscGaussLobattoLegendreElementAdvectionCreate()
External Links
- PETSc Manual:
DT/PetscGaussLobattoLegendreElementGradientDestroy
PETSc.LibPETSc.PetscGaussLobattoLegendreElementLaplacianCreate — Method
AA::Ptr{PetscReal} = PetscGaussLobattoLegendreElementLaplacianCreate(petsclib::PetscLibType, n::PetscInt, nodes::Vector{PetscReal}, weights::Vector{PetscReal})computes the Laplacian for a single 1d GLL element
Not Collective
Input Parameters:
n- the number of GLL nodesnodes- the GLL nodes, of lengthnweights- the GLL weights, of lengthn
Output Parameter:
AA- the stiffness element, of sizenbyn
Level: beginner
See also: PetscDTGaussLobattoLegendreQuadrature(), PetscGaussLobattoLegendreElementLaplacianDestroy()
External Links
- PETSc Manual:
DT/PetscGaussLobattoLegendreElementLaplacianCreate
PETSc.LibPETSc.PetscGaussLobattoLegendreElementLaplacianDestroy — Method
PetscGaussLobattoLegendreElementLaplacianDestroy(petsclib::PetscLibType, n::PetscInt, nodes::Vector{PetscReal}, weights::Vector{PetscReal}, AA::PetscReal)frees the Laplacian for a single 1d GLL element created with PetscGaussLobattoLegendreElementLaplacianCreate()
Not Collective
Input Parameters:
n- the number of GLL nodesnodes- the GLL nodes, ignoredweights- the GLL weightss, ignoredAA- the stiffness element fromPetscGaussLobattoLegendreElementLaplacianCreate()
Level: beginner
See also: PetscDTGaussLobattoLegendreQuadrature(), PetscGaussLobattoLegendreElementLaplacianCreate()
External Links
- PETSc Manual:
DT/PetscGaussLobattoLegendreElementLaplacianDestroy
PETSc.LibPETSc.PetscGaussLobattoLegendreElementMassCreate — Method
nodes::PetscReal,weights::PetscReal,AA::Ptr{PetscReal} = PetscGaussLobattoLegendreElementMassCreate(petsclib::PetscLibType, n::PetscInt)Build the elemental mass matrix for a single 1D Gauss-Lobatto-Legendre (GLL) spectral element
Not Collective; No Fortran Support
Input Parameters:
n- number of GLL nodesnodes- the GLL quadrature nodesweights- the GLL quadrature weights
Output Parameter:
AA- newly allocatednxnmass matrix asPetscReal **
Level: beginner
See also: PetscDTGaussLobattoLegendreQuadrature(), PetscGaussLobattoLegendreElementMassDestroy(), PetscGaussLobattoLegendreElementLaplacianCreate(), PetscGaussLobattoLegendreElementAdvectionCreate()
External Links
- PETSc Manual:
DT/PetscGaussLobattoLegendreElementMassCreate
PETSc.LibPETSc.PetscGaussLobattoLegendreElementMassDestroy — Method
nodes::PetscReal,weights::PetscReal = PetscGaussLobattoLegendreElementMassDestroy(petsclib::PetscLibType, n::PetscInt, AA::PetscReal)Free a 1D GLL elemental mass matrix created with PetscGaussLobattoLegendreElementMassCreate()
Not Collective; No Fortran Support
Input Parameters:
n- number of GLL nodes (ignored)nodes- the GLL quadrature nodes (ignored)weights- the GLL quadrature weights (ignored)AA- the mass matrix to free;*AAis set toNULLon return
Level: beginner
See also: PetscGaussLobattoLegendreElementMassCreate(), PetscDTGaussLobattoLegendreQuadrature()
External Links
- PETSc Manual:
DT/PetscGaussLobattoLegendreElementMassDestroy
PETSc.LibPETSc.PetscGaussLobattoLegendreIntegrate — Method
in::PetscReal = PetscGaussLobattoLegendreIntegrate(petsclib::PetscLibType, n::PetscInt, nodes::Vector{PetscReal}, weights::Vector{PetscReal}, f::Vector{PetscReal})Compute the L2 integral of a function on the GLL points
Not Collective
Input Parameters:
n- the number of GLL nodesnodes- the GLL nodesweights- the GLL weightsf- the function values at the nodes
Output Parameter:
in- the value of the integral
Level: beginner
See also: PetscDTGaussLobattoLegendreQuadrature()
External Links
- PETSc Manual:
DT/PetscGaussLobattoLegendreIntegrate
PETSc.LibPETSc.PetscGetArchType — Method
PetscGetArchType(petsclib::PetscLibType, str::String, slen::Csize_t)Returns the PETSC_ARCH that was used for this configuration of PETSc
Not Collective
Input Parameter:
slen- length of string buffer
Output Parameter:
str- string area to contain architecture name, should be at least 10 characters long. Name is truncated if string is not long enough.
Level: developer
See also: PetscGetUserName(), PetscGetHostName()
External Links
- PETSc Manual:
Sys/PetscGetArchType
PETSc.LibPETSc.PetscGetArgs — Method
argc::Cint,args::String = PetscGetArgs(petsclib::PetscLibType)Allows you to access the raw command line arguments anywhere after PetscInitialize() is called but before PetscFinalize().
Not Collective, No Fortran Support
Output Parameters:
argc- count of the number of command line argumentsargs- the command line arguments
Level: intermediate
See also: PetscFinalize(), PetscInitializeFortran(), PetscGetArguments(), PetscInitialize()
External Links
- PETSc Manual:
Sys/PetscGetArgs
PETSc.LibPETSc.PetscGetArguments — Method
args::String = PetscGetArguments(petsclib::PetscLibType)Allows you to access the command line arguments anywhere after PetscInitialize() is called but before PetscFinalize().
Not Collective, No Fortran Support
Output Parameter:
args- the command line arguments
Level: intermediate
See also: PetscFinalize(), PetscInitializeFortran(), PetscGetArgs(), PetscFreeArguments(), PetscInitialize()
External Links
- PETSc Manual:
Sys/PetscGetArguments
PETSc.LibPETSc.PetscGetCPUTime — Method
t::PetscLogDouble = PetscGetCPUTime(petsclib::PetscLibType)Returns the CPU time in seconds used by the process.
Not Collective
Output Parameter:
t- Time in seconds charged to the process.
Example: `` #include <petscsys.h> -.. PetscLogDouble t1, t2;
PetscCall(PetscGetCPUTime(&t1)); -.. code to time ... PetscCall(PetscGetCPUTime(&t2)); printf("Code took %f CPU seconds\n", t2-t1); ``
Level: intermediate
See also: PetscTime(), PetscLogView()
External Links
- PETSc Manual:
Sys/PetscGetCPUTime
PETSc.LibPETSc.PetscGetCurrentCUDAStream — Method
PetscGetCurrentCUDAStream(petsclib::PetscLibType, stream::cudaStream_t)External Links
- PETSc Manual:
Sys/PetscGetCurrentCUDAStream
PETSc.LibPETSc.PetscGetCurrentHIPStream — Method
PetscGetCurrentHIPStream(petsclib::PetscLibType, stream::hipStream_t)External Links
- PETSc Manual:
Sys/PetscGetCurrentHIPStream
PETSc.LibPETSc.PetscGetDate — Method
PetscGetDate(petsclib::PetscLibType, date::String, len::Csize_t)Gets the current date.
Not Collective
Input Parameter:
len- length of string to hold date
Output Parameter:
date- the date
Level: beginner
See also: PetscGetHostName()
External Links
- PETSc Manual:
Sys/PetscGetDate
PETSc.LibPETSc.PetscGetDisplay — Method
PetscGetDisplay(petsclib::PetscLibType, display::String, n::Csize_t)Gets the X windows display variable for all processors.
Input Parameter:
n- length of string display
Output Parameter:
display- the display string
Options Database Keys:
-display display- sets the display to use-x_virtual- forces use of a X virtual display Xvfb that will not display anything but -draw_save will still work. Xvfb is automatically
started up in PetscSetDisplay() with this option
Level: advanced
See also: PETSC_DRAW_X, PetscDrawOpenX()
External Links
- PETSc Manual:
Sys/PetscGetDisplay
PETSc.LibPETSc.PetscGetFlops — Method
flops::PetscLogDouble = PetscGetFlops(petsclib::PetscLibType)Returns the number of flops used on this processor since the program began.
Not Collective
Output Parameter:
flops- number of floating point operations
Level: intermediate
See also: PetscLogGpuFlops(), PetscTime(), PetscLogFlops()
External Links
- PETSc Manual:
Log/PetscGetFlops
PETSc.LibPETSc.PetscGetFullPath — Method
PetscGetFullPath(petsclib::PetscLibType, path::String, fullpath::String, flen::Csize_t)Given a filename, returns the fully qualified file name.
Not Collective
Input Parameters:
path- pathname to qualifyflen- size offullpath
Output Parameter:
fullpath- buffer to hold the full pathname
Level: developer
See also: PetscGetRelativePath()
External Links
- PETSc Manual:
Sys/PetscGetFullPath
PETSc.LibPETSc.PetscGetHomeDirectory — Method
PetscGetHomeDirectory(petsclib::PetscLibType, dir::String, maxlen::Csize_t)Returns the name of the user's home directory
Not Collective
Input Parameter:
maxlen- maximum length allowed
Output Parameter:
dir- contains the home directory. Must be long enough to hold the name.
Level: developer
See also: PetscGetTmp(), PetscSharedTmp(), PetscGetWorkingDirectory()
External Links
- PETSc Manual:
Sys/PetscGetHomeDirectory
PETSc.LibPETSc.PetscGetHostName — Method
PetscGetHostName(petsclib::PetscLibType, name::String, nlen::Csize_t)Returns the name of the host. This attempts to return the entire Internet name. It may not return the same name as MPI_Get_processor_name().
Not Collective
Input Parameter:
nlen- length of name
Output Parameter:
name- contains host name. Must be long enough to hold the name
This is the fully qualified name, including the domain.
Level: developer
See also: PetscGetUserName(), PetscGetArchType()
External Links
- PETSc Manual:
Sys/PetscGetHostName
PETSc.LibPETSc.PetscGetMemType — Method
type::PetscMemType = PetscGetMemType(petsclib::PetscLibType, ptr::Ptr{Cvoid})Query the PetscMemType of a pointer
Not Collective, No Fortran Support
Input Parameter:
ptr- The pointer to query (may beNULL)
Output Parameter:
type- ThePetscMemTypeof the pointer
Level: intermediate
See also: PetscMemType, PetscDeviceMalloc(), PetscDeviceCalloc(), PetscDeviceFree(), PetscDeviceArrayCopy(), PetscDeviceArrayZero()
External Links
- PETSc Manual:
Sys/PetscGetMemType
PETSc.LibPETSc.PetscGetPetscDir — Method
dir::String = PetscGetPetscDir(petsclib::PetscLibType)Gets the directory PETSc is installed in
Not Collective; No Fortran Support
Output Parameter:
dir- the directory
Level: developer
See also: PetscGetArchType()
External Links
- PETSc Manual:
Sys/PetscGetPetscDir
PETSc.LibPETSc.PetscGetProgramName — Method
PetscGetProgramName(petsclib::PetscLibType, name::String, len::Csize_t)Gets the name of the running program.
Not Collective
Input Parameter:
len- length of the string name
Output Parameter:
name- the name of the running program, provide a string of lengthPETSC_MAX_PATH_LEN
Level: advanced
See also: PetscFinalize(), PetscInitializeFortran(), PetscGetArguments(), PetscInitialize()
External Links
- PETSc Manual:
Sys/PetscGetProgramName
PETSc.LibPETSc.PetscGetRealPath — Method
PetscGetRealPath(petsclib::PetscLibType, path::String, rpath::String)Get the path without symbolic links etc. in absolute form.
Not Collective
Input Parameter:
path- path to resolve
Output Parameter:
rpath- resolved path
Level: developer
See also: PetscGetFullPath()
External Links
- PETSc Manual:
Sys/PetscGetRealPath
PETSc.LibPETSc.PetscGetRelativePath — Method
PetscGetRelativePath(petsclib::PetscLibType, fullpath::String, path::String, flen::Csize_t)Given a filename, returns the relative path (removes all directory specifiers).
Not Collective; No Fortran Support
Input Parameters:
fullpath- full pathnameflen- size ofpath
Output Parameter:
path- buffer that holds relative pathname
Level: developer
See also: PetscGetFullPath()
External Links
- PETSc Manual:
Sys/PetscGetRelativePath
PETSc.LibPETSc.PetscGetTmp — Method
PetscGetTmp(petsclib::PetscLibType, comm::MPI_Comm, dir::String, len::Csize_t)Gets the name of the "tmp" directory, often this is /tmp
Collective
Input Parameters:
comm- MPI_Communicator that may share tmplen- length of string to hold name
Output Parameter:
dir- directory name
Environmental Variables:
PETSC_SHARED_TMP- indicates the directory is known to be shared among the MPI processesPETSC_NOT_SHARED_TMP- indicates the directory is known to be not shared among the MPI processesPETSC_TMP- name of the directory you wish to use as tmp
Level: developer
See also: PetscSharedTmp(), PetscSharedWorkingDirectory(), PetscGetWorkingDirectory(), PetscGetHomeDirectory()
External Links
- PETSc Manual:
Sys/PetscGetTmp
PETSc.LibPETSc.PetscGetUserName — Method
PetscGetUserName(petsclib::PetscLibType, name::String, nlen::Csize_t)Get the login name of the user running the program on the current MPI process
Not Collective
Input Parameter:
nlen- length of thenamebuffer
Output Parameter:
name- on output, holds the user name (null-terminated)
Level: developer
See also: PetscGetHostName(), PetscGetProgramName()
External Links
- PETSc Manual:
Sys/PetscGetUserName
PETSc.LibPETSc.PetscGetVersion — Method
PetscGetVersion(petsclib::PetscLibType, version::String, len::Csize_t)Gets the PETSc version information in a string.
Not Collective; No Fortran Support
Input Parameter:
len- length of the string
Output Parameter:
version- version string
Level: developer
See also: PetscGetProgramName(), PetscGetVersionNumber()
External Links
- PETSc Manual:
Sys/PetscGetVersion
PETSc.LibPETSc.PetscGetVersionNumber — Method
major::PetscInt,minor::PetscInt,subminor::PetscInt,release::PetscInt = PetscGetVersionNumber(petsclib::PetscLibType)Gets the PETSc version information from the library
Not Collective
Output Parameters:
major- the major version (optional, passNULLif not requested)minor- the minor version (optional, passNULLif not requested)subminor- the subminor version (patch number) (optional, passNULLif not requested)release- indicates the library is from a release, not random git repository (optional, passNULLif not requested)
Level: developer
See also: PetscGetProgramName(), PetscGetVersion(), PetscInitialize()
External Links
- PETSc Manual:
Sys/PetscGetVersionNumber
PETSc.LibPETSc.PetscGetWorkingDirectory — Method
PetscGetWorkingDirectory(petsclib::PetscLibType, path::String, len::Csize_t)Gets the current working directory.
Not Collective
Input Parameter:
len- maximum length ofpath
Output Parameter:
path- holds the result value. The string should be long enough to hold the path, for example,PETSC_MAX_PATH_LEN
Level: developer
See also: PetscGetTmp(), PetscSharedTmp(), PetscSharedWorkingDirectory(), PetscGetHomeDirectory()
External Links
- PETSc Manual:
Sys/PetscGetWorkingDirectory
PETSc.LibPETSc.PetscGlobalMinMaxInt — Method
PetscGlobalMinMaxInt(petsclib::PetscLibType, comm::MPI_Comm, minMaxVal::Vector{PetscInt}, minMaxValGlobal::Vector{PetscInt})Get the global min/max from local min/max input
Collective
Input Parameters:
comm- The MPI communicator to reduce withminMaxVal- An array with the local min and max
Output Parameter:
minMaxValGlobal- An array with the global min and max
Level: beginner
See also: PetscSplitOwnership(), PetscGlobalMinMaxReal()
External Links
- PETSc Manual:
Sys/PetscGlobalMinMaxInt
PETSc.LibPETSc.PetscGlobalMinMaxReal — Method
PetscGlobalMinMaxReal(petsclib::PetscLibType, comm::MPI_Comm, minMaxVal::Vector{PetscReal}, minMaxValGlobal::Vector{PetscReal})Get the global min/max from local min/max input
Collective
Input Parameters:
comm- The MPI communicator to reduce withminMaxVal- An array with the local min and max
Output Parameter:
minMaxValGlobal- An array with the global min and max
Level: beginner
See also: PetscSplitOwnership(), PetscGlobalMinMaxInt()
External Links
- PETSc Manual:
Sys/PetscGlobalMinMaxReal
PETSc.LibPETSc.PetscGlobusAuthorize — Method
PetscGlobusAuthorize(petsclib::PetscLibType, comm::MPI_Comm, access_token::String, tokensize::Csize_t)Get an access token allowing PETSc applications to make Globus file transfer requests
Not Collective, only the first process in MPI_Comm does anything
Input Parameters:
comm- the MPI communicatortokensize- size of the token array
Output Parameter:
access_token- can be used withPetscGlobusUpLoad()for 30 days
Level: intermediate
See also: PetscGoogleDriveRefresh(), PetscGoogleDriveUpload(), PetscGlobusUpload()
External Links
- PETSc Manual:
Sys/PetscGlobusAuthorize
PETSc.LibPETSc.PetscGlobusGetTransfers — Method
PetscGlobusGetTransfers(petsclib::PetscLibType, comm::MPI_Comm, access_token::String, buff::String, buffsize::Csize_t)Get a record of current transfers requested from Globus
Not Collective, only the first process in MPI_Comm does anything
Input Parameters:
comm- the MPI communicatoraccess_token- Globus access token, ifNULLwill check in options database for -globusaccesstoken XXX otherwise
will call PetscGlobusAuthorize().
buffsize- size of the buffer
Output Parameter:
buff- location to put Globus information
Level: intermediate
See also: PetscGoogleDriveRefresh(), PetscGoogleDriveUpload(), PetscGlobusUpload(), PetscGlobusAuthorize()
External Links
- PETSc Manual:
Sys/PetscGlobusGetTransfers
PETSc.LibPETSc.PetscGlobusUpload — Method
PetscGlobusUpload(petsclib::PetscLibType, comm::MPI_Comm, access_token::String, filename::String)Loads a file to Globus
Not Collective, only the first process in the MPI_Comm uploads the file
Input Parameters:
comm- MPI communicatoraccess_token- obtained withPetscGlobusAuthorize(), passNULLto use-globus_access_token XXXfrom the PETSc databasefilename- file to upload
Options Database Key:
-globus_access_token XXX- the Globus token
Level: intermediate
See also: PetscGoogleDriveAuthorize(), PetscGoogleDriveRefresh(), PetscGlobusAuthorize()
External Links
- PETSc Manual:
Sys/PetscGlobusUpload
PETSc.LibPETSc.PetscGoogleDriveAuthorize — Method
PetscGoogleDriveAuthorize(petsclib::PetscLibType, comm::MPI_Comm, access_token::String, refresh_token::String, tokensize::Csize_t)Get authorization and refresh token for accessing Google drive from PETSc
Not Collective, only the first process in MPI_Comm does anything
Input Parameters:
comm- the MPI communicatortokensize- size of the token arrays
Output Parameters:
access_token- can be used withPetscGoogleDriveUpload()for this one sessionrefresh_token- can be used for ever to obtain new access_tokens withPetscGoogleDriveRefresh(), guard this like a password
it gives access to your Google Drive
Level: intermediate
See also: PetscGoogleDriveRefresh(), PetscGoogleDriveUpload()
External Links
- PETSc Manual:
Sys/PetscGoogleDriveAuthorize
PETSc.LibPETSc.PetscGoogleDriveRefresh — Method
PetscGoogleDriveRefresh(petsclib::PetscLibType, comm::MPI_Comm, refresh_token::String, access_token::String, tokensize::Csize_t)Get a new authorization token for accessing Google drive from PETSc from a refresh token
Not Collective, only the first process in the MPI_Comm does anything
Input Parameters:
comm- MPI communicatorrefresh_token- obtained withPetscGoogleDriveAuthorize(), if NULL PETSc will first look for one in the options data
if not found it will call PetscGoogleDriveAuthorize()
tokensize- size of the output string access_token
Output Parameter:
access_token- token that can be passed toPetscGoogleDriveUpload()
Options Database Key:
-google_refresh_token XXX- where XXX was obtained fromPetscGoogleDriveAuthorize()
Level: intermediate
See also: PetscGoogleDriveAuthorize(), PetscGoogleDriveUpload()
External Links
- PETSc Manual:
Sys/PetscGoogleDriveRefresh
PETSc.LibPETSc.PetscGoogleDriveUpload — Method
PetscGoogleDriveUpload(petsclib::PetscLibType, comm::MPI_Comm, access_token::String, filename::String)Loads a file to the Google Drive
Not Collective, only the first process in the MPI_Comm uploads the file
Input Parameters:
comm- MPI communicatoraccess_token- obtained with PetscGoogleDriveRefresh(), passNULLto have PETSc generate onefilename- file to upload; if you upload multiple times it will have different names each time on Google Drive
Options Database Key:
-google_refresh_token XXX- pass the access token for the operation
See also: PetscGoogleDriveAuthorize(), PetscGoogleDriveRefresh()
External Links
- PETSc Manual:
Sys/PetscGoogleDriveUpload
PETSc.LibPETSc.PetscHDF5DataTypeToPetscDataType — Method
ptype::PetscDataType = PetscHDF5DataTypeToPetscDataType(petsclib::PetscLibType, htype::hid_t)Finds the PETSc name of a datatype from its HDF5 name
Not Collective
Input Parameter:
htype- the HDF5 datatype (for exampleH5T_NATIVE_DOUBLE, ...)
Output Parameter:
ptype- the PETSc datatype name (for examplePETSC_DOUBLE)
Level: advanced
See also: PetscDataType
External Links
- PETSc Manual:
Viewer/PetscHDF5DataTypeToPetscDataType
PETSc.LibPETSc.PetscHIPBLASGetHandle — Method
PetscHIPBLASGetHandle(petsclib::PetscLibType, handle::hipblasHandle_t)External Links
- PETSc Manual:
Sys/PetscHIPBLASGetHandle
PETSc.LibPETSc.PetscHIPSOLVERGetHandle — Method
PetscHIPSOLVERGetHandle(petsclib::PetscLibType, handle::hipsolverHandle_t)External Links
- PETSc Manual:
Sys/PetscHIPSOLVERGetHandle
PETSc.LibPETSc.PetscHTTPRequest — Method
PetscHTTPRequest(petsclib::PetscLibType, type::String, url::String, header::String, ctype::String, body::String, sock::Cint, buff::String, buffsize::Csize_t)Send a request to an HTTP server
Input Parameters:
type- either "POST" or "GET"url- URL of request host/pathheader- additional header information, may beNULLctype- data type of body, for example application/jsonbody- data to send to serversock- obtained withPetscOpenSocket()buffsize- size of buffer
Output Parameter:
buff- everything returned from server
Level: advanced
See also: PetscHTTPSRequest(), PetscOpenSocket(), PetscHTTPSConnect(), PetscPullJSONValue()
External Links
- PETSc Manual:
Sys/PetscHTTPRequest
PETSc.LibPETSc.PetscHTTPSConnect — Method
sock::Cint,ssl::Ptr{SSL} = PetscHTTPSConnect(petsclib::PetscLibType, host::String, port::Cint, ctx::SSL_CTX)connect to a HTTPS server
Input Parameters:
host- the name of the machine hosting the HTTPS serverport- the port number where the server is hosting, usually 443ctx- value obtained withPetscSSLInitializeContext()
Output Parameters:
sock- socket to connectssl- the argument passed toPetscHTTPSRequest()
Level: advanced
See also: PetscOpenSocket(), PetscHTTPSRequest(), PetscSSLInitializeContext()
External Links
- PETSc Manual:
Sys/PetscHTTPSConnect
PETSc.LibPETSc.PetscHTTPSRequest — Method
PetscHTTPSRequest(petsclib::PetscLibType, type::String, url::String, header::String, ctype::String, body::String, ssl::SSL, buff::String, buffsize::Csize_t)Send a request to an HTTPS server
Input Parameters:
type- either "POST" or "GET"url- URL of request host/pathheader- additional header information, may beNULLctype- data type of body, for example application/jsonbody- data to send to serverssl- obtained withPetscHTTPSConnect()buffsize- size of buffer
Output Parameter:
buff- everything returned from server
Level: advanced
See also: PetscHTTPRequest(), PetscHTTPSConnect(), PetscSSLInitializeContext(), PetscSSLDestroyContext(), PetscPullJSONValue()
External Links
- PETSc Manual:
Sys/PetscHTTPSRequest
PETSc.LibPETSc.PetscHasExternalPackage — Method
has::PetscBool = PetscHasExternalPackage(petsclib::PetscLibType, pkg::String)Determine whether PETSc has been configured with the given package
Not Collective
Input Parameter:
pkg- external package name
Output Parameter:
has-PETSC_TRUEif PETSc is configured with the given package, elsePETSC_FALSE.
Level: intermediate
See also: PetscViewerType, MatPartitioningType, MatSolverType
External Links
- PETSc Manual:
Sys/PetscHasExternalPackage
PETSc.LibPETSc.PetscInfoActivateClass — Method
PetscInfoActivateClass(petsclib::PetscLibType, classid::PetscClassId)Activates PetscInfo() messages for a PETSc object class.
Not Collective
Input Parameter:
classid- The object class, e.g.,MAT_CLASSID,SNES_CLASSID, etc.
Options Database Key:
-info [filename][:[~]list,of,classnames[:[~]self]]- specify which informative messages are printed, SeePetscInfo().
Level: developer
See also: PetscInfoDeactivateClass(), PetscInfo(), PetscInfoAllow(), PetscInfoSetFromOptions()
External Links
- PETSc Manual:
Log/PetscInfoActivateClass
PETSc.LibPETSc.PetscInfoAllow — Method
PetscInfoAllow(petsclib::PetscLibType, flag::PetscBool)Enables/disables PetscInfo() messages
Not Collective
Input Parameter:
flag-PETSC_TRUEorPETSC_FALSE
Level: advanced
See also: PetscInfo(), PetscInfoEnabled(), PetscInfoGetInfo(), PetscInfoSetFromOptions()
External Links
- PETSc Manual:
Log/PetscInfoAllow
PETSc.LibPETSc.PetscInfoDeactivateClass — Method
PetscInfoDeactivateClass(petsclib::PetscLibType, classid::PetscClassId)Deactivates PetscInfo() messages for a PETSc object class.
Not Collective
Input Parameter:
classid- The object class, e.g.,MAT_CLASSID,SNES_CLASSID, etc.
Options Database Key:
-info [filename][:[~]list,of,classnames[:[~]self]]- specify which informative messages are printed, SeePetscInfo().
Level: developer
See also: PetscInfoActivateClass(), PetscInfo(), PetscInfoAllow(), PetscInfoSetFromOptions()
External Links
- PETSc Manual:
Log/PetscInfoDeactivateClass
PETSc.LibPETSc.PetscInfoDestroy — Method
PetscInfoDestroy(petsclib::PetscLibType)Destroys and resets internal PetscInfo() data structures.
Not Collective
Level: developer
See also: PetscInfo(), PetscInfoSetFromOptions()
External Links
- PETSc Manual:
Log/PetscInfoDestroy
PETSc.LibPETSc.PetscInfoEnabled — Method
enabled::PetscBool = PetscInfoEnabled(petsclib::PetscLibType, classid::PetscClassId)Checks whether a given PetscClassid is allowed to print using PetscInfo()
Not Collective
Input Parameter:
classid-PetscClassidretrieved from aPetscObjecte.g.VEC_CLASSID
Output Parameter:
enabled-PetscBoolindicating whether this classid is allowed to print
Level: advanced
See also: PetscInfo(), PetscInfoAllow(), PetscInfoGetInfo(), PetscObjectGetClassid()
External Links
- PETSc Manual:
Log/PetscInfoEnabled
PETSc.LibPETSc.PetscInfoGetClass — Method
found::PetscBool = PetscInfoGetClass(petsclib::PetscLibType, classname::String)Indicates whether the provided classname is marked as a filter in PetscInfo() as set by PetscInfoSetClasses()
Not Collective
Input Parameter:
classname- Name of the class to search for
Output Parameter:
found-PetscBoolindicating whether the classname was found
Level: developer
See also: PetscInfo(), PetscInfoSetClasses(), PetscInfoSetFromOptions(), PetscObjectGetName()
External Links
- PETSc Manual:
Log/PetscInfoGetClass
PETSc.LibPETSc.PetscInfoGetFile — Method
filename::Ptr{Cchar},InfoFile::Ptr{Libc.FILE} = PetscInfoGetFile(petsclib::PetscLibType)Gets the filename and FILE pointer of the file where PetscInfo() prints to
Not Collective; No Fortran Support
Output Parameters:
filename- The name of the output fileInfoFile- TheFILEpointer for the output file
Level: advanced
See also: PetscInfo(), PetscInfoSetFile(), PetscInfoSetFromOptions(), PetscInfoDestroy()
External Links
- PETSc Manual:
Log/PetscInfoGetFile
PETSc.LibPETSc.PetscInfoGetInfo — Method
infoEnabled::PetscBool,classesSet::PetscBool,exclude::PetscBool,locked::PetscBool,commSelfFlag::PetscInfoCommFlag = PetscInfoGetInfo(petsclib::PetscLibType)Returns the current state of several flags for PetscInfo()
Not Collective
Output Parameters:
infoEnabled-PETSC_TRUEifPetscInfoAllow(PETSC_TRUE) has been calledclassesSet-PETSC_TRUEif the list of classes to filter for has been setexclude-PETSC_TRUEif the class filtering forPetscInfo()is invertedlocked-PETSC_TRUEif the list of classes to filter for has been lockedcommSelfFlag- Enum indicating whetherPetscInfo()will print for communicators of size 1, any size != 1, or all
communicators
Level: developer
See also: PetscInfo(), PetscInfoAllow(), PetscInfoSetFilterCommSelf, PetscInfoSetFromOptions()
External Links
- PETSc Manual:
Log/PetscInfoGetInfo
PETSc.LibPETSc.PetscInfoProcessClass — Method
PetscInfoProcessClass(petsclib::PetscLibType, classname::String, numClassID::PetscInt, classIDs::Vector{PetscClassId})Activates or deactivates a class based on the filtering status of PetscInfo()
Not Collective
Input Parameters:
classname- Name of the class to activate/deactivatePetscInfo()fornumClassID- Number of entries inclassIDsclassIDs- Array containing all of thePetscClassIds associated withclassname
Options Database Key:
-info [filename][:[~]list,of,classnames[:[~]self]]- specify which informative messages are printed, seePetscInfo().
Level: developer
See also: PetscInfo(), PetscInfoActivateClass(), PetscInfoDeactivateClass(), PetscInfoSetFromOptions()
External Links
- PETSc Manual:
Log/PetscInfoProcessClass
PETSc.LibPETSc.PetscInfoSetClasses — Method
PetscInfoSetClasses(petsclib::PetscLibType, exclude::PetscBool, n::PetscInt, classnames::Cchar)Sets the classes which PetscInfo() is filtered for/against
Not Collective; No Fortran Support
Input Parameters:
exclude- Whether or not to invert the filter, i.e. if exclude is true,PetscInfo()will print from every class that
is NOT one of the classes specified
n- Number of classes to filter for (size ofclassnames)classnames- String array containing the names of classes to filter for, e.g. "vec"
Level: developer
See also: PetscInfo(), PetscInfoGetClass(), PetscInfoProcessClass(), PetscInfoSetFromOptions(), PetscStrToArray(), PetscObjectGetName()
External Links
- PETSc Manual:
Log/PetscInfoSetClasses
PETSc.LibPETSc.PetscInfoSetFile — Method
PetscInfoSetFile(petsclib::PetscLibType, filename::String, mode::String)Sets the printing destination for all PetscInfo() calls
Not Collective
Input Parameters:
filename- Name of the file wherePetscInfo()will print to, useNULLto write toPETSC_STDOUT.mode- Write mode passed toPetscFOpen()
Level: advanced
See also: PetscInfo(), PetscInfoGetFile(), PetscInfoSetFromOptions(), PetscFOpen()
External Links
- PETSc Manual:
Log/PetscInfoSetFile
PETSc.LibPETSc.PetscInfoSetFilterCommSelf — Method
PetscInfoSetFilterCommSelf(petsclib::PetscLibType, commSelfFlag::PetscInfoCommFlag)Sets PetscInfoCommFlag enum to determine communicator filtering for PetscInfo()
Not Collective
Input Parameter:
commSelfFlag- Enum value indicating method with which to filterPetscInfo()based on the size of the communicator of the object callingPetscInfo()
Options Database Key:
-info [filename][:[~]list,of,classnames[:[~]self]]- specify which informative messages are printed, SeePetscInfo().
Level: advanced
See also: PetscInfo(), PetscInfoGetInfo()
External Links
- PETSc Manual:
Log/PetscInfoSetFilterCommSelf
PETSc.LibPETSc.PetscInfoSetFromOptions — Method
PetscInfoSetFromOptions(petsclib::PetscLibType, options::AbstractPetscOptions)Configure PetscInfo() using command line options, enabling or disabling various calls to PetscInfo()
Not Collective
Input Parameter:
options- Options database, useNULLfor default global database
Options Database Key:
-info [filename][:[~]list,of,classnames[:[~]self]]- specify which informative messages are printed, SeePetscInfo().
Level: advanced
See also: PetscInfo(), PetscInfoAllow(), PetscInfoSetFile(), PetscInfoSetClasses(), PetscInfoSetFilterCommSelf(), PetscInfoDestroy()
External Links
- PETSc Manual:
Log/PetscInfoSetFromOptions
PETSc.LibPETSc.PetscInitialize — Function
PetscInitialize(petsclib::PetscLibType, args::Vector{String}, file::Union{Nothing, String} = nothing, help::Union{Nothing, String} = nothing)Initializes the PETSc database and MPI, with args as the command line: args[1] is the program name and the rest are options, one token per entry, such as ["prog", "-ksp_type", "cg"]. Options given here override those in the PETSC_OPTIONS environment variable.
PETSc keeps pointers to args until PetscFinalize(), so the strings are held here until the next call.
Collective on MPI_COMM_WORLD or PETSC_COMM_WORLD if it has been set
Input Parameters:
args- the command line, program name firstfile- an optional options file, ornothinghelp- an optional help message printed by-help, ornothing
Level: beginner
See also: PetscFinalize(), PetscInitializeNoArguments(), PetscGetArgs()
External Links
- PETSc Manual:
Sys/PetscInitialize
PETSc.LibPETSc.PetscInitializeFortran — Method
PetscInitializeFortran(petsclib::PetscLibType)Routine that should be called soon AFTER the call to PetscInitialize() if one is using a C main program that calls Fortran routines that in turn call PETSc routines.
Collective on PETSC_COMM_WORLD
Level: beginner
See also: PetscInitialize()
External Links
- PETSc Manual:
Sys/PetscInitializeFortran
PETSc.LibPETSc.PetscInitializeNoArguments — Method
PetscInitializeNoArguments(petsclib::PetscLibType)Calls PetscInitialize() from C/C++ without the command line arguments.
Collective
Level: advanced
See also: PetscInitialize(), PetscInitializeFortran()
External Links
- PETSc Manual:
Sys/PetscInitializeNoArguments
PETSc.LibPETSc.PetscInitializeNoPointers — Method
PetscInitializeNoPointers(petsclib::PetscLibType, argc::Cint, args::Cchar, filename::String, help::String)Calls PetscInitialize() from C/C++ without the pointers to argc and args
Collective, No Fortran Support
Input Parameters:
argc- number of argsargs- array of command line argumentsfilename- optional name of the program file, passNULLto ignorehelp- optional help, passNULLto ignore
Level: advanced
See also: PetscInitialize(), PetscInitializeFortran(), PetscInitializeNoArguments()
External Links
- PETSc Manual:
Sys/PetscInitializeNoPointers
PETSc.LibPETSc.PetscInitialized — Method
isInitialized::PetscBool = PetscInitialized(petsclib::PetscLibType)Determine whether PETSc is initialized.
Output Parameter:
isInitialized-PETSC_TRUEif PETSc is initialized,PETSC_FALSEotherwise
Level: beginner
See also: PetscInitialize(), PetscInitializeNoArguments(), PetscInitializeFortran()
External Links
- PETSc Manual:
Sys/PetscInitialized
PETSc.LibPETSc.PetscIntSortSemiOrdered — Method
PetscIntSortSemiOrdered(petsclib::PetscLibType, n::PetscInt, arr::Vector{PetscInt})Sorts an array of PetscInt in place in increasing order.
Not Collective
Input Parameters:
n- number of valuesarr- array of integers
Output Parameter:
arr- sorted array of integers
Level: intermediate
See also: PetscTimSort(), PetscSortInt(), PetscSortIntWithPermutation()
External Links
- PETSc Manual:
Sys/PetscIntSortSemiOrdered
PETSc.LibPETSc.PetscIntSortSemiOrderedWithArray — Method
PetscIntSortSemiOrderedWithArray(petsclib::PetscLibType, n::PetscInt, arr1::Vector{PetscInt}, arr2::Vector{PetscInt})Sorts an array of PetscInt in place in increasing order and reorders a second PetscInt array to match the first.
Not Collective
Input Parameter:
n- number of values
Input/Output Parameters:
arr1- array of integers to be sorted, modified on outputarr2- array of integers to be reordered, modified on output
Level: intermediate
See also: PetscTimSortWithArray(), PetscSortIntWithArray(), PetscSortIntWithPermutation()
External Links
- PETSc Manual:
Sys/PetscIntSortSemiOrderedWithArray
PETSc.LibPETSc.PetscIntView — Method
PetscIntView(petsclib::PetscLibType, N::PetscInt, idx::Vector{PetscInt}, viewer::PetscViewer)Prints an array of integers; useful for debugging.
Collective
Input Parameters:
N- number of integers in arrayidx- array of integersviewer- location to print array,PETSC_VIEWER_STDOUT_WORLD,PETSC_VIEWER_STDOUT_SELFor 0
Level: intermediate
See also: PetscViewer, PetscIntViewNumColumns(), PetscRealView()
External Links
- PETSc Manual:
Sys/PetscIntView
PETSc.LibPETSc.PetscIntViewNumColumns — Method
PetscIntViewNumColumns(petsclib::PetscLibType, N::PetscInt, Ncol::PetscInt, idx::Vector{PetscInt}, viewer::PetscViewer)Prints an array of integers; useful for debugging.
Collective
Input Parameters:
N- number of integers in arrayNcol- number of integers to print per rowidx- array of integersviewer- location to print array,PETSC_VIEWER_STDOUT_WORLD,PETSC_VIEWER_STDOUT_SELFor 0
Level: intermediate
See also: PetscViewer, PetscIntView(), PetscRealView()
External Links
- PETSc Manual:
Sys/PetscIntViewNumColumns
PETSc.LibPETSc.PetscKokkosInitializeCheck — Method
PetscKokkosInitializeCheck(petsclib::PetscLibType)External Links
- PETSc Manual:
Sys/PetscKokkosInitializeCheck
PETSc.LibPETSc.PetscLinearRegression — Method
slope::PetscReal,intercept::PetscReal = PetscLinearRegression(petsclib::PetscLibType, n::PetscInt, x::Vector{PetscReal}, y::Vector{PetscReal})Gives the best least-squares linear fit to some x-y data points
Input Parameters:
n- The number of pointsx- The x-valuesy- The y-values
Output Parameters:
slope- The slope of the best-fit lineintercept- The y-intercept of the best-fit line
Level: intermediate
See also: PetscConvEstGetConvRate()
External Links
- PETSc Manual:
Sys/PetscLinearRegression
PETSc.LibPETSc.PetscLogActions — Method
PetscLogActions(petsclib::PetscLibType, flag::PetscBool)Determines whether actions are logged for the default log handler.
Not Collective
Input Parameter:
flag-PETSC_TRUEif actions are to be logged
Options Database Key:
-log_exclude_actions- (deprecated) Does nothing-log_include_actions- Turn on action logging
Level: intermediate
See also: PetscLogStagePush(), PetscLogStagePop(), PetscLogGetDefaultHandler()
External Links
- PETSc Manual:
Log/PetscLogActions
PETSc.LibPETSc.PetscLogClassGetClassId — Method
classid::PetscClassId = PetscLogClassGetClassId(petsclib::PetscLibType, name::String)Returns the PetscClassId when given the class name.
Not Collective
Input Parameter:
name- The class name
Output Parameter:
classid- ThePetscClassIdid, or -1 if no class with that name exists
Level: intermediate
See also: PetscLogEventBegin(), PetscLogEventEnd(), PetscLogStageGetId()
External Links
- PETSc Manual:
Log/PetscLogClassGetClassId
PETSc.LibPETSc.PetscLogClassIdGetName — Method
name::String = PetscLogClassIdGetName(petsclib::PetscLibType, classid::PetscClassId)Returns a PetscClassId's name.
Not Collective
Input Parameter:
classid- APetscClassId
Output Parameter:
name- The class name
Level: intermediate
See also: PetscLogClassRegister(), PetscLogClassBegin(), PetscLogClassEnd(), PetscPreLoadBegin(), PetscPreLoadEnd(), PetscPreLoadClass()
External Links
- PETSc Manual:
Log/PetscLogClassIdGetName
PETSc.LibPETSc.PetscLogDefaultBegin — Method
PetscLogDefaultBegin(petsclib::PetscLibType)Turns on logging (profiling) of PETSc code using the default log handler (profiler). This logs time, flop rates, and object creation and should not slow programs down too much.
Logically Collective on PETSC_COMM_WORLD
Options Database Key:
-log_view [viewertype[:filename[:viewerformat]]]- Prints summary of flop and timing (profiling) information to the
screen (for PETSc configured with --with-log=1 (which is the default)). This option must be provided before PetscInitialize().
See also: PetscLogDump(), PetscLogView(), PetscLogTraceBegin()
External Links
- PETSc Manual:
Log/PetscLogDefaultBegin
PETSc.LibPETSc.PetscLogDump — Method
PetscLogDump(petsclib::PetscLibType, sname::String)Dumps logs of objects to a file. There is currently no utility to read the dump file.
Collective on PETSC_COMM_WORLD
Input Parameter:
sname- an optional file name
See also: PetscLogDefaultBegin(), PetscLogView(), PetscLogGetDefaultHandler()
External Links
- PETSc Manual:
Log/PetscLogDump
PETSc.LibPETSc.PetscLogEventActivate — Method
PetscLogEventActivate(petsclib::PetscLibType, event::PetscLogEvent)Indicates that a particular event should be logged.
Not Collective
Input Parameter:
event- The event id
See also: PetscLogEventDeactivate(), PetscLogEventDeactivatePush(), PetscLogEventDeactivatePop()
External Links
- PETSc Manual:
Log/PetscLogEventActivate
PETSc.LibPETSc.PetscLogEventActivateClass — Method
PetscLogEventActivateClass(petsclib::PetscLibType, classid::PetscClassId)Activates event logging for a PETSc object class for the current stage
Not Collective
Input Parameter:
classid- The event class, for exampleMAT_CLASSID,SNES_CLASSID, etc.
Level: developer
See also: PetscLogEventIncludeClass(), PetscLogEventExcludeClass(), PetscLogEventDeactivateClass(), PetscLogEventActivate(), PetscLogEventDeactivate()
External Links
- PETSc Manual:
Log/PetscLogEventActivateClass
PETSc.LibPETSc.PetscLogEventDeactivate — Method
PetscLogEventDeactivate(petsclib::PetscLibType, event::PetscLogEvent)Indicates that a particular event should not be logged.
Not Collective
Input Parameter:
event- The event id
See also: PetscLogEventActivate(), PetscLogEventDeactivatePush(), PetscLogEventDeactivatePop()
External Links
- PETSc Manual:
Log/PetscLogEventDeactivate
PETSc.LibPETSc.PetscLogEventDeactivateClass — Method
PetscLogEventDeactivateClass(petsclib::PetscLibType, classid::PetscClassId)Deactivates event logging for a PETSc object class for the current stage
Not Collective
Input Parameter:
classid- The event class, for exampleMAT_CLASSID,SNES_CLASSID, etc.
Level: developer
See also: PetscLogEventIncludeClass(), PetscLogEventExcludeClass(), PetscLogEventActivateClass(), PetscLogEventActivate(), PetscLogEventDeactivate()
External Links
- PETSc Manual:
Log/PetscLogEventDeactivateClass
PETSc.LibPETSc.PetscLogEventDeactivatePop — Method
PetscLogEventDeactivatePop(petsclib::PetscLibType, event::PetscLogEvent)Indicates that a particular event should again be logged after the logging was turned off with PetscLogEventDeactivatePush()
Not Collective
Input Parameter:
event- The event id
See also: PetscLogEventActivate(), PetscLogEventDeactivatePush()
External Links
- PETSc Manual:
Log/PetscLogEventDeactivatePop
PETSc.LibPETSc.PetscLogEventDeactivatePush — Method
PetscLogEventDeactivatePush(petsclib::PetscLibType, event::PetscLogEvent)Indicates that a particular event should not be logged until PetscLogEventDeactivatePop() is called
Not Collective
Input Parameter:
event- The event id
See also: PetscLogEventActivate(), PetscLogEventDeactivate(), PetscLogEventDeactivatePop()
External Links
- PETSc Manual:
Log/PetscLogEventDeactivatePush
PETSc.LibPETSc.PetscLogEventExcludeClass — Method
PetscLogEventExcludeClass(petsclib::PetscLibType, classid::PetscClassId)Deactivates event logging for a PETSc object class in every stage.
Not Collective
Input Parameter:
classid- The object class, for exampleMAT_CLASSID,SNES_CLASSID, etc.
Level: developer
See also: PetscLogEventDeactivateClass(), PetscLogEventActivateClass(), PetscLogEventDeactivate(), PetscLogEventActivate()
External Links
- PETSc Manual:
Log/PetscLogEventExcludeClass
PETSc.LibPETSc.PetscLogEventGetId — Method
event::PetscLogEvent = PetscLogEventGetId(petsclib::PetscLibType, name::String)Returns the event id when given the event name.
Not Collective
Input Parameter:
name- The event name
Output Parameter:
event- The event, or -1 if no event with that name exists
Level: intermediate
See also: PetscLogEventBegin(), PetscLogEventEnd(), PetscLogStageGetId()
External Links
- PETSc Manual:
Log/PetscLogEventGetId
PETSc.LibPETSc.PetscLogEventGetName — Method
name::String = PetscLogEventGetName(petsclib::PetscLibType, event::PetscLogEvent)Returns the event name when given the event id.
Not Collective
Input Parameter:
event- The event
Output Parameter:
name- The event name
Level: intermediate
See also: PetscLogEventRegister(), PetscLogEventBegin(), PetscLogEventEnd(), PetscPreLoadBegin(), PetscPreLoadEnd(), PetscPreLoadStage()
External Links
- PETSc Manual:
Log/PetscLogEventGetName
PETSc.LibPETSc.PetscLogEventGetPerfInfo — Method
info::PetscEventPerfInfo = PetscLogEventGetPerfInfo(petsclib::PetscLibType, stage::PetscLogStage, event::PetscLogEvent)Return the performance information about the given event in the given stage
No Fortran Support
Input Parameters:
stage- The stage number orPETSC_DETERMINEfor the current stageevent- The event number
Output Parameter:
info- This structure is filled with the performance information
Level: intermediate
See also: PetscLogEventRegister(), PetscLogEventBegin(), PetscLogEventEnd(), PetscLogGetDefaultHandler()
External Links
- PETSc Manual:
Log/PetscLogEventGetPerfInfo
PETSc.LibPETSc.PetscLogEventIncludeClass — Method
PetscLogEventIncludeClass(petsclib::PetscLibType, classid::PetscClassId)Activates event logging for a PETSc object class in every stage.
Not Collective
Input Parameter:
classid- The object class, for exampleMAT_CLASSID,SNES_CLASSID, etc.
Level: developer
See also: PetscLogEventActivateClass(), PetscLogEventDeactivateClass(), PetscLogEventActivate(), PetscLogEventDeactivate()
External Links
- PETSc Manual:
Log/PetscLogEventIncludeClass
PETSc.LibPETSc.PetscLogEventRegister — Method
event::PetscLogEvent = PetscLogEventRegister(petsclib::PetscLibType, name::String, classid::PetscClassId)Registers an event name for logging operations
Not Collective
Input Parameters:
name- The name associated with the eventclassid- The classid associated to the class for this event, obtain either with
PetscClassIdRegister() or use a predefined one such as KSP_CLASSID, SNES_CLASSID, the predefined ones are only available in C code
Output Parameter:
event- The event id for use withPetscLogEventBegin()andPetscLogEventEnd().
See also: PetscLogStageRegister(), PetscLogEventBegin(), PetscLogEventEnd(), PetscLogFlops(), PetscLogEventActivate(), PetscLogEventDeactivate(), PetscClassIdRegister()
External Links
- PETSc Manual:
Log/PetscLogEventRegister
PETSc.LibPETSc.PetscLogEventSetActiveAll — Method
PetscLogEventSetActiveAll(petsclib::PetscLibType, event::PetscLogEvent, isActive::PetscBool)Turns on logging of all events
Not Collective
Input Parameters:
event- The event idisActive- The activity flag determining whether the event is logged
Level: advanced
See also: PetscLogEventActivate(), PetscLogEventDeactivate()
External Links
- PETSc Manual:
Log/PetscLogEventSetActiveAll
PETSc.LibPETSc.PetscLogEventSetCollective — Method
PetscLogEventSetCollective(petsclib::PetscLibType, event::PetscLogEvent, collective::PetscBool)Indicates that a particular event is collective.
Logically Collective
Input Parameters:
event- The event idcollective-PetscBoolindicating whether a particular event is collective
Level: developer
See also: PetscLogEventBegin(), PetscLogEventEnd(), PetscLogEventRegister()
External Links
- PETSc Manual:
Log/PetscLogEventSetCollective
PETSc.LibPETSc.PetscLogEventSetDof — Method
PetscLogEventSetDof(petsclib::PetscLibType, event::PetscLogEvent, n::PetscInt, dof::PetscLogDouble)Set the nth number of degrees of freedom of a numerical problem associated with this event
Not Collective
Input Parameters:
event- The event id to logn- The dof index, in [0, 8)dof- The number of dofs
Options Database Key:
-log_view- Activates log summary
Level: developer
See also: PetscLogEventSetError(), PetscLogEventRegister(), PetscLogGetDefaultHandler()
External Links
- PETSc Manual:
Log/PetscLogEventSetDof
PETSc.LibPETSc.PetscLogEventSetError — Method
PetscLogEventSetError(petsclib::PetscLibType, event::PetscLogEvent, n::PetscInt, error::PetscLogDouble)Set the nth error associated with a numerical problem associated with this event
Not Collective
Input Parameters:
event- The event id to logn- The error index, in [0, 8)error- The error
Options Database Key:
-log_view- Activates log summary
Level: developer
See also: PetscLogEventSetDof(), PetscLogEventRegister(), PetscLogGetDefaultHandler()
External Links
- PETSc Manual:
Log/PetscLogEventSetError
PETSc.LibPETSc.PetscLogEventsPause — Method
PetscLogEventsPause(petsclib::PetscLibType)Put event logging into "paused" mode: timers and counters for in-progress events are paused, and any events that happen before logging is resumed with PetscLogEventsResume() are logged in the "Main Stage" of execution.
Not collective
Level: advanced
See also: PetscLogEventDeactivatePush(), PetscLogEventDeactivatePop(), PetscLogEventsResume(), PetscLogGetDefaultHandler()
External Links
- PETSc Manual:
Log/PetscLogEventsPause
PETSc.LibPETSc.PetscLogEventsResume — Method
PetscLogEventsResume(petsclib::PetscLibType)Return logging to normal behavior after it was paused with PetscLogEventsPause().
Not collective
Level: advanced
See also: PetscLogEventDeactivatePush(), PetscLogEventDeactivatePop(), PetscLogEventsPause(), PetscLogGetDefaultHandler()
External Links
- PETSc Manual:
Log/PetscLogEventsResume
PETSc.LibPETSc.PetscLogGetDefaultHandler — Method
handler::PetscLogHandler = PetscLogGetDefaultHandler(petsclib::PetscLibType)Get the default log handler if it is running.
Not collective
Output Parameter:
handler- the defaultPetscLogHandler, orNULLif it is not running.
Level: developer
Notes: The default handler is started with PetscLogDefaultBegin(), if the options flags -log_all or -log_view is given without arguments, or for -log_view :output:format if format is not ascii_xml or ascii_flamegraph.
External Links
- PETSc Manual:
Log/PetscLogGetDefaultHandler
PETSc.LibPETSc.PetscLogGetState — Method
state::PetscLogState = PetscLogGetState(petsclib::PetscLibType)Get the PetscLogState for PETSc's global logging, used by all default log handlers (PetscLogDefaultBegin(), PetscLogNestedBegin(), PetscLogTraceBegin(), PetscLogMPEBegin(), PetscLogPerfstubsBegin()).
Collective on PETSC_COMM_WORLD
Output Parameter:
state- ThePetscLogStatechanged by registrations (such as
PetscLogEventRegister()) and actions (such as PetscLogEventBegin() or PetscLogStagePush()), or NULL if logging is not active
Level: developer
See also: PetscLogState
External Links
- PETSc Manual:
Log/PetscLogGetState
PETSc.LibPETSc.PetscLogIsActive — Method
isActive::PetscBool = PetscLogIsActive(petsclib::PetscLibType)Check if logging (profiling) is currently in progress.
Not Collective
Output Parameter:
isActive-PETSC_TRUEif logging is in progress,PETSC_FALSEotherwise
Level: beginner
See also: PetscLogDefaultBegin()
External Links
- PETSc Manual:
Log/PetscLogIsActive
PETSc.LibPETSc.PetscLogLegacyCallbacksBegin — Method
PetscLogLegacyCallbacksBegin(petsclib::PetscLibType, PetscLogPLB::external, PetscLogPLE::external, PetscLogPHC::external, PetscLogPHD::external)Create and start a log handler from callbacks matching the now deprecated function pointers PetscLogPLB, PetscLogPLE, PetscLogPHC, PetscLogPHD.
Logically Collective on PETSC_COMM_WORLD
Input Parameters:
PetscLogPLB- A callback that will be executed byPetscLogEventBegin()(orNULL)PetscLogPLE- A callback that will be executed byPetscLogEventEnd()(orNULL)PetscLogPHC- A callback that will be executed byPetscLogObjectCreate()(orNULL)PetscLogPHD- A callback that will be executed byPetscLogObjectCreate()(orNULL)
Calling sequence of PetscLogPLB:
e- aPetscLogEventthat is beginning_i- deprecated, unusedo1- aPetscObjectassociated withe(orNULL)o2- aPetscObjectassociated withe(orNULL)o3- aPetscObjectassociated withe(orNULL)o4- aPetscObjectassociated withe(orNULL)
Calling sequence of PetscLogPLE:
e- aPetscLogEventthat is beginning_i- deprecated, unusedo1- aPetscObjectassociated withe(orNULL)o2- aPetscObjectassociated withe(orNULL)o3- aPetscObjectassociated withe(orNULL)o4- aPetscObjectassociated withe(orNULL)
Calling sequence of PetscLogPHC:
o- aPetscObjectthat has just been created
Calling sequence of PetscLogPHD:
o- aPetscObjectthat is about to be destroyed
Level: advanced
See also: PetscLogHandler, PetscLogHandlerStart(), PetscLogState
External Links
- PETSc Manual:
Log/PetscLogLegacyCallbacksBegin
PETSc.LibPETSc.PetscLogMPEBegin — Method
PetscLogMPEBegin(petsclib::PetscLibType)Turns on MPE logging of events. This creates large log files and slows the program down.
Collective on PETSC_COMM_WORLD, No Fortran Support
Options Database Key:
-log_mpe- Prints extensive log information
Level: advanced
See also: PetscLogDump(), PetscLogDefaultBegin(), PetscLogEventActivate(), PetscLogEventDeactivate()
External Links
- PETSc Manual:
Log/PetscLogMPEBegin
PETSc.LibPETSc.PetscLogMPEDump — Method
PetscLogMPEDump(petsclib::PetscLibType, sname::String)Dumps the MPE logging info to file for later use with Jumpshot.
Collective on PETSC_COMM_WORLD
Input Parameter:
sname- filename for the MPE logfile
Level: advanced
See also: PetscLogDump(), PetscLogMPEBegin()
External Links
- PETSc Manual:
Log/PetscLogMPEDump
PETSc.LibPETSc.PetscLogNestedBegin — Method
PetscLogNestedBegin(petsclib::PetscLibType)Turns on nested logging of objects and events. This logs flop rates and object creation and should not slow programs down too much.
Logically Collective on PETSC_COMM_WORLD, No Fortran Support
Options Database Keys:
-log_view :filename.xml:ascii_xml- Prints an XML summary of flop and timing information to the file
See also: PetscLogDump(), PetscLogView(), PetscLogTraceBegin(), PetscLogDefaultBegin()
External Links
- PETSc Manual:
Log/PetscLogNestedBegin
PETSc.LibPETSc.PetscLogObjects — Method
PetscLogObjects(petsclib::PetscLibType, flag::PetscBool)Determines whether objects are logged for the graphical viewer.
Not Collective
Input Parameter:
flag-PETSC_TRUEif objects are to be logged
Options Database Key:
-log_exclude_objects- (deprecated) Does nothing-log_include_objects- Turns on object logging
Level: intermediate
See also: PetscLogStagePush(), PetscLogStagePop(), PetscLogGetDefaultHandler()
External Links
- PETSc Manual:
Log/PetscLogObjects
PETSc.LibPETSc.PetscLogPerfstubsBegin — Method
PetscLogPerfstubsBegin(petsclib::PetscLibType)Turns on logging of events using the perfstubs interface.
Collective on PETSC_COMM_WORLD, No Fortran Support
Options Database Key:
-log_perfstubs- use an external log handler through the perfstubs interface
Level: advanced
See also: PetscLogDefaultBegin(), PetscLogEventActivate()
External Links
- PETSc Manual:
Log/PetscLogPerfstubsBegin
PETSc.LibPETSc.PetscLogSetThreshold — Method
oldThresh::PetscLogDouble = PetscLogSetThreshold(petsclib::PetscLibType, newThresh::PetscLogDouble)Set the threshold time for logging the events; this is a percentage out of 100, so 1. means any event that takes 1 or more percent of the time.
Logically Collective on PETSC_COMM_WORLD
Input Parameter:
newThresh- the threshold to use
Output Parameter:
oldThresh- the previously set threshold value
Options Database Keys:
-log_view :filename.xml:ascii_xml- Prints an XML summary of flop and timing information to the file
See also: PetscLogDump(), PetscLogView(), PetscLogTraceBegin(), PetscLogDefaultBegin(), PetscLogNestedBegin()
External Links
- PETSc Manual:
Log/PetscLogSetThreshold
PETSc.LibPETSc.PetscLogStageGetActive — Method
isActive::PetscBool = PetscLogStageGetActive(petsclib::PetscLibType, stage::PetscLogStage)Checks if a stage is used for PetscLogEventBegin() and PetscLogEventEnd().
Not Collective
Input Parameter:
stage- The stage
Output Parameter:
isActive- The activity flag,PETSC_TRUEfor logging, elsePETSC_FALSE(defaults toPETSC_TRUE)
Level: intermediate
See also: PetscLogStageRegister(), PetscLogStagePush(), PetscLogStagePop(), PetscLogEventBegin(), PetscLogEventEnd(), PetscPreLoadBegin(), PetscPreLoadEnd(), PetscPreLoadStage()
External Links
- PETSc Manual:
Log/PetscLogStageGetActive
PETSc.LibPETSc.PetscLogStageGetId — Method
stage::PetscLogStage = PetscLogStageGetId(petsclib::PetscLibType, name::String)Returns the stage id when given the stage name.
Not Collective
Input Parameter:
name- The stage name
Output Parameter:
stage- The stage, , or -1 if no stage with that name exists
Level: intermediate
See also: PetscLogStageRegister(), PetscLogStagePush(), PetscLogStagePop(), PetscPreLoadBegin(), PetscPreLoadEnd(), PetscPreLoadStage()
External Links
- PETSc Manual:
Log/PetscLogStageGetId
PETSc.LibPETSc.PetscLogStageGetName — Method
name::String = PetscLogStageGetName(petsclib::PetscLibType, stage::PetscLogStage)Returns the stage name when given the stage id.
Not Collective
Input Parameter:
stage- The stage
Output Parameter:
name- The stage name
Level: intermediate
See also: PetscLogStageRegister(), PetscLogStagePush(), PetscLogStagePop(), PetscPreLoadBegin(), PetscPreLoadEnd(), PetscPreLoadStage()
External Links
- PETSc Manual:
Log/PetscLogStageGetName
PETSc.LibPETSc.PetscLogStageGetPerfInfo — Method
info::PetscEventPerfInfo = PetscLogStageGetPerfInfo(petsclib::PetscLibType, stage::PetscLogStage)Return the performance information about the given stage
No Fortran Support
Input Parameters:
stage- The stage number orPETSC_DETERMINEfor the current stage
Output Parameter:
info- This structure is filled with the performance information
Level: intermediate
See also: PetscLogEventRegister(), PetscLogEventBegin(), PetscLogEventEnd(), PetscLogGetDefaultHandler()
External Links
- PETSc Manual:
Log/PetscLogStageGetPerfInfo
PETSc.LibPETSc.PetscLogStageGetVisible — Method
isVisible::PetscBool = PetscLogStageGetVisible(petsclib::PetscLibType, stage::PetscLogStage)Returns stage visibility in PetscLogView()
Not Collective
Input Parameter:
stage- The stage
Output Parameter:
isVisible- The visibility flag,PETSC_TRUEto print, elsePETSC_FALSE(defaults toPETSC_TRUE)
Level: intermediate
See also: PetscLogStageSetVisible(), PetscLogStageRegister(), PetscLogStagePush(), PetscLogStagePop(), PetscLogView(), PetscLogGetDefaultHandler()
External Links
- PETSc Manual:
Log/PetscLogStageGetVisible
PETSc.LibPETSc.PetscLogStagePop — Method
PetscLogStagePop(petsclib::PetscLibType)This function pops a stage from the logging stack that was pushed with PetscLogStagePush()
Not Collective
See also: PetscLogStagePush(), PetscLogStageRegister(), PetscBarrier()
External Links
- PETSc Manual:
Log/PetscLogStagePop
PETSc.LibPETSc.PetscLogStagePush — Method
PetscLogStagePush(petsclib::PetscLibType, stage::PetscLogStage)This function pushes a stage on the logging stack. Events started and stopped until PetscLogStagePop() will be associated with the stage
Not Collective
Input Parameter:
stage- The stage on which to log
See also: PetscLogStagePop(), PetscLogStageRegister(), PetscBarrier()
External Links
- PETSc Manual:
Log/PetscLogStagePush
PETSc.LibPETSc.PetscLogStageRegister — Method
stage::PetscLogStage = PetscLogStageRegister(petsclib::PetscLibType, sname::String)Attaches a character string name to a logging stage.
Not Collective
Input Parameter:
sname- The name to associate with that stage
Output Parameter:
stage- The stage number or -1 if logging is not active (PetscLogIsActive()).
Level: intermediate
See also: PetscLogStagePush(), PetscLogStagePop()
External Links
- PETSc Manual:
Log/PetscLogStageRegister
PETSc.LibPETSc.PetscLogStageSetActive — Method
PetscLogStageSetActive(petsclib::PetscLibType, stage::PetscLogStage, isActive::PetscBool)Sets if a stage is used for PetscLogEventBegin() and PetscLogEventEnd().
Not Collective
Input Parameters:
stage- The stageisActive- The activity flag,PETSC_TRUEfor logging, elsePETSC_FALSE(defaults toPETSC_TRUE)
Level: intermediate
See also: PetscLogStageRegister(), PetscLogStagePush(), PetscLogStagePop(), PetscLogEventBegin(), PetscLogEventEnd(), PetscPreLoadBegin(), PetscPreLoadEnd(), PetscPreLoadStage()
External Links
- PETSc Manual:
Log/PetscLogStageSetActive
PETSc.LibPETSc.PetscLogStageSetVisible — Method
PetscLogStageSetVisible(petsclib::PetscLibType, stage::PetscLogStage, isVisible::PetscBool)Determines stage visibility in PetscLogView()
Not Collective
Input Parameters:
stage- The stageisVisible- The visibility flag,PETSC_TRUEto print, elsePETSC_FALSE(defaults toPETSC_TRUE)
Level: intermediate
See also: PetscLogStageGetVisible(), PetscLogStageRegister(), PetscLogStagePush(), PetscLogStagePop(), PetscLogView(), PetscLogGetDefaultHandler()
External Links
- PETSc Manual:
Log/PetscLogStageSetVisible
PETSc.LibPETSc.PetscLogTraceBegin — Method
PetscLogTraceBegin(petsclib::PetscLibType, file::Libc.FILE)Begins trace logging. Every time a PETSc event begins or ends, the event name is printed.
Logically Collective on PETSC_COMM_WORLD, No Fortran Support
Input Parameter:
file- The file to print trace in (e.g. stdout)
Options Database Key:
-log_trace [filename]- BeginsPetscLogTraceBegin()
Level: intermediate
See also: PetscLogDump(), PetscLogView(), PetscLogDefaultBegin()
External Links
- PETSc Manual:
Log/PetscLogTraceBegin
PETSc.LibPETSc.PetscLogView — Method
PetscLogView(petsclib::PetscLibType, viewer::PetscViewer)Prints a summary of the logging.
Collective
Input Parameter:
viewer- an ASCII viewer
Options Database Keys:
-log_view [:filename]- Prints summary of log information-log_view :filename.py:ascii_info_detail- Saves logging information from each process as a Python file-log_view :filename.xml:ascii_xml- Saves a summary of the logging information in a nested format (see below for how to view it)-log_view :filename.txt:ascii_flamegraph- Saves logging information in a format suitable for visualising as a Flame Graph (see below for how to view it)-log_view :filename.csv:ascii_csv- Saves logging information as a comma-separated values file-log_view_memory- Also display memory usage in each event-log_view_gpu_time- Also display time in each event for GPU kernels (Note this may slow the computation)-log_view_gpu_energy- Also display energy (estimated with power*gtime) in Joules for GPU kernels-log_view_gpu_energy_meter- [Experimental] Also display energy (readings from energy meters) in Joules for GPU kernels.
This option is ignored if -log_view_gpu_energy is provided.
-log_all- Saves a fileLog.rankfor each MPI process with details of each step of the computation, where
rank is the MPI rank of each process
-log_trace [filename]- Displays a trace of what each process is doing
Level: beginner
See also: PetscLogDefaultBegin(), PetscLogDump()
External Links
- PETSc Manual:
Log/PetscLogView
PETSc.LibPETSc.PetscLogViewFromOptions — Method
PetscLogViewFromOptions(petsclib::PetscLibType)Processes command line options to determine if/how a PetscLog is to be viewed.
Collective on PETSC_COMM_WORLD
Level: developer
See also: PetscLogView()
External Links
- PETSc Manual:
Log/PetscLogViewFromOptions
PETSc.LibPETSc.PetscLs — Method
flg::PetscBool = PetscLs(petsclib::PetscLibType, comm::MPI_Comm, dirname::String, found::String, tlen::Csize_t)produce a listing of the files in a directory
Collective
Input Parameters:
comm- the MPI communicatordirname- the directory nametlen- the length of the bufferfound
Output Parameters:
found- listing of filesflg- the directory exists
Level: intermediate
See also: PetscTestFile(), PetscRMTree(), PetscTestDirectory()
External Links
- PETSc Manual:
Sys/PetscLs
PETSc.LibPETSc.PetscMPIAbortErrorHandler — Method
PetscMPIAbortErrorHandler(petsclib::PetscLibType, comm::MPI_Comm, line::Cint, fun::String, file::String, n::PetscErrorCode, p::PetscErrorType, mess::String, ctx::Ptr{Cvoid})Calls PETSCABORT() and exits.
Not Collective, No Fortran Support
Input Parameters:
comm- communicator over which error occurredline- the line number of the error (indicated by__LINE__)fun- the function namefile- the file in which the error was detected (indicated by__FILE__)mess- an error text string, usually just printed to the screenn- the generic error numberp-PETSC_ERROR_INITIALif error just detected, otherwisePETSC_ERROR_REPEATctx- error handler context
Level: developer
See also: PetscError(), PetscPushErrorHandler(), PetscPopErrorHandler(), PetscAttachDebuggerErrorHandler(), PetscAbortErrorHandler(), PetscTraceBackErrorHandler(), PetscEmacsClientErrorHandler(), PetscReturnErrorHandler()
External Links
- PETSc Manual:
Sys/PetscMPIAbortErrorHandler
PETSc.LibPETSc.PetscMPIDump — Method
PetscMPIDump(petsclib::PetscLibType, fd::Libc.FILE)Dumps a listing of incomplete MPI operations, such as sends that have never been received, etc.
Collective on PETSC_COMM_WORLD
Input Parameter:
fd- file pointer. If fp isNULL,stdoutis assumed.
Options Database Key:
-mpidump- Dumps MPI incompleteness during call to PetscFinalize()
Level: developer
See also: PetscMallocDump()
External Links
- PETSc Manual:
Sys/PetscMPIDump
PETSc.LibPETSc.PetscMPIIntSortSemiOrdered — Method
PetscMPIIntSortSemiOrdered(petsclib::PetscLibType, n::PetscInt, arr::Vector{PetscMPIInt})Sorts an array of PetscMPIInt in place in increasing order.
Not Collective
Input Parameters:
n- number of valuesarr- array ofPetscMPIInt
Output Parameter:
arr- sorted array of integers
Level: intermediate
See also: PetscTimSort(), PetscSortMPIInt()
External Links
- PETSc Manual:
Sys/PetscMPIIntSortSemiOrdered
PETSc.LibPETSc.PetscMPIIntSortSemiOrderedWithArray — Method
PetscMPIIntSortSemiOrderedWithArray(petsclib::PetscLibType, n::PetscInt, arr1::Vector{PetscMPIInt}, arr2::Vector{PetscMPIInt})Sorts an array of PetscMPIInt in place in increasing order and reorders a second PetscMPIInt array to match the first.
Not Collective
Input Parameter:
n- number of values
Input/Output Parameters:
arr1- array of integers to be sorted, modified on outputarr2- array of integers to be reordered, modified on output
Level: intermediate
See also: PetscTimSortWithArray(), PetscSortMPIIntWithArray(), PetscSortIntWithPermutation()
External Links
- PETSc Manual:
Sys/PetscMPIIntSortSemiOrderedWithArray
PETSc.LibPETSc.PetscMallocClear — Method
PetscMallocClear(petsclib::PetscLibType)Resets the routines used by PetscMalloc() and PetscFree()
Not Collective
Level: developer
See also: PetscMallocSet(), PetscMalloc(), PetscFree()
External Links
- PETSc Manual:
Sys/PetscMallocClear
PETSc.LibPETSc.PetscMallocDump — Method
PetscMallocDump(petsclib::PetscLibType, fp::Libc.FILE)Dumps the currently allocated memory blocks to a file. The information printed is: size of space (in bytes), address of space, id of space, file in which space was allocated, and line number at which it was allocated.
Not Collective
Input Parameter:
fp- file pointer. IffpisNULL,stdoutis assumed.
Options Database Key:
-malloc_dump optional filename- Print summary of unfreed memory during call toPetscFinalize(), writing to filename if given
Level: intermediate
See also: PetscMallocGetCurrentUsage(), PetscMallocView(), PetscMallocViewSet(), PetscMallocValidate(), PetscMalloc(), PetscFree()
External Links
- PETSc Manual:
Sys/PetscMallocDump
PETSc.LibPETSc.PetscMallocGetCurrentUsage — Method
space::PetscLogDouble = PetscMallocGetCurrentUsage(petsclib::PetscLibType)gets the current amount of memory used that was allocated with PetscMalloc()
Not Collective
Output Parameter:
space- number of bytes currently allocated
Level: intermediate
See also: PetscMallocDump(), PetscMallocGetMaximumUsage(), PetscMemoryGetCurrentUsage(), PetscMalloc(), PetscFree(), PetscMemoryGetMaximumUsage()
External Links
- PETSc Manual:
Sys/PetscMallocGetCurrentUsage
PETSc.LibPETSc.PetscMallocGetDebug — Method
basic::PetscBool,eachcall::PetscBool,initializenan::PetscBool = PetscMallocGetDebug(petsclib::PetscLibType)Indicates what PETSc memory debugging it is doing.
Not Collective
Output Parameters:
basic- doing basic debuggingeachcall- checks the entire memory heap at eachPetscMalloc()/PetscFree()initializenan- initializes memory withNaN
Level: intermediate
See also: CHKMEMQ, PetscMallocValidate(), PetscMallocSetDebug(), PetscMalloc(), PetscFree()
External Links
- PETSc Manual:
Sys/PetscMallocGetDebug
PETSc.LibPETSc.PetscMallocGetMaximumUsage — Method
space::PetscLogDouble = PetscMallocGetMaximumUsage(petsclib::PetscLibType)gets the maximum amount of memory used that was obtained with PetscMalloc() at any time during this run, the high water mark.
Not Collective
Output Parameter:
space- maximum number of bytes ever allocated at one time
Level: intermediate
See also: PetscMallocDump(), PetscMallocView(), PetscMemoryGetCurrentUsage(), PetscMalloc(), PetscFree(), PetscMallocPushMaximumUsage()
External Links
- PETSc Manual:
Sys/PetscMallocGetMaximumUsage
PETSc.LibPETSc.PetscMallocLogRequestedSizeGet — Method
flg::PetscBool = PetscMallocLogRequestedSizeGet(petsclib::PetscLibType)Whether to log the requested or aligned memory size
Not Collective
Output Parameter:
flg-PETSC_TRUEif we log the requested memory size
Level: developer
See also: PetscMallocLogRequestedSizeSet(), PetscMallocViewSet(), PetscMalloc(), PetscFree()
External Links
- PETSc Manual:
Sys/PetscMallocLogRequestedSizeGet
PETSc.LibPETSc.PetscMallocLogRequestedSizeSet — Method
PetscMallocLogRequestedSizeSet(petsclib::PetscLibType, flg::PetscBool)Whether to log the requested or aligned memory size
Not Collective
Input Parameter:
flg-PETSC_TRUEto log the requested memory size
Options Database Key:
-malloc_requested_size (true|false)- Sets this flag
Level: developer
See also: PetscMallocLogRequestedSizeGet(), PetscMallocViewSet(), PetscMalloc(), PetscFree()
External Links
- PETSc Manual:
Sys/PetscMallocLogRequestedSizeSet
PETSc.LibPETSc.PetscMallocPopMaximumUsage — Method
mu::PetscLogDouble = PetscMallocPopMaximumUsage(petsclib::PetscLibType, event::Cint)collect the maximum memory usage over an event
Not Collective
Input Parameter:
event- an event id; this is just for error checking
Output Parameter:
mu- maximum amount of memory malloced during this event; high water mark relative to the beginning of the event
Level: developer
See also: PetscMallocDump(), PetscMallocView(), PetscMallocGetMaximumUsage(), PetscMemoryGetCurrentUsage(), PetscMalloc(), PetscFree(), PetscMallocPushMaximumUsage()
External Links
- PETSc Manual:
Sys/PetscMallocPopMaximumUsage
PETSc.LibPETSc.PetscMallocPushMaximumUsage — Method
PetscMallocPushMaximumUsage(petsclib::PetscLibType, event::Cint)Adds another event to collect the maximum memory usage over an event
Not Collective
Input Parameter:
event- an event id; this is just for error checking
Level: developer
See also: PetscMallocDump(), PetscMallocView(), PetscMallocGetMaximumUsage(), PetscMemoryGetCurrentUsage(), PetscMalloc(), PetscFree(), PetscMallocPopMaximumUsage()
External Links
- PETSc Manual:
Sys/PetscMallocPushMaximumUsage
PETSc.LibPETSc.PetscMallocResetCUDAHost — Method
PetscMallocResetCUDAHost(petsclib::PetscLibType)External Links
- PETSc Manual:
Sys/PetscMallocResetCUDAHost
PETSc.LibPETSc.PetscMallocResetDRAM — Method
PetscMallocResetDRAM(petsclib::PetscLibType)Reset the changes made by PetscMallocSetDRAM()
Not Collective
Level: developer
See also: PetscMallocSetDRAM()
External Links
- PETSc Manual:
Sys/PetscMallocResetDRAM
PETSc.LibPETSc.PetscMallocSet — Method
PetscMallocSet(petsclib::PetscLibType, imalloc::external, ifree::external, iralloc::external)Sets the underlying allocation routines used by PetscMalloc() and PetscFree()
Not Collective, No Fortran Support
Input Parameters:
imalloc- the routine that provides themalloc()implementation (also providescalloc(), which is used depending on the second argument)ifree- the routine that provides thefree()implementationiralloc- the routine that provides therealloc()implementation
Level: developer
See also: PetscMallocClear(), PetscInitialize(), PetscMalloc(), PetscFree()
External Links
- PETSc Manual:
Sys/PetscMallocSet
PETSc.LibPETSc.PetscMallocSetCUDAHost — Method
PetscMallocSetCUDAHost(petsclib::PetscLibType)External Links
- PETSc Manual:
Sys/PetscMallocSetCUDAHost
PETSc.LibPETSc.PetscMallocSetCoalesce — Method
PetscMallocSetCoalesce(petsclib::PetscLibType, coalesce::PetscBool)Use coalesced PetscMalloc() when allocating groups of objects, that is when using PetscMallocN()
Not Collective
Input Parameter:
coalesce-PETSC_TRUEto use coalesced malloc for multi-memory allocation.
Options Database Key:
-malloc_coalesce- turn coalescedPetscMallocN()on or off
Level: developer
See also: PetscMallocA(), PetscMalloc(), PetscFree()
External Links
- PETSc Manual:
Sys/PetscMallocSetCoalesce
PETSc.LibPETSc.PetscMallocSetDRAM — Method
PetscMallocSetDRAM(petsclib::PetscLibType)Set PetscMalloc() to use DRAM. If memkind is available, change the memkind type. Otherwise, switch the current malloc and free routines to the PetscMallocAlign() and PetscFreeAlign() (PETSc default).
Not Collective
Level: developer
See also: PetscMallocReset(), PetscMalloc(), PetscFree()
External Links
- PETSc Manual:
Sys/PetscMallocSetDRAM
PETSc.LibPETSc.PetscMallocSetDebug — Method
PetscMallocSetDebug(petsclib::PetscLibType, eachcall::PetscBool, initializenan::PetscBool)Set's PETSc memory debugging
Not Collective
Input Parameters:
eachcall- checks the entire heap of allocated memory for issues on each call toPetscMalloc()andPetscFree(), slowinitializenan- initializes all memory withNaNto catch use of uninitialized floating point arrays
Options Database Keys:
-malloc_debug (true|false)- turns on or off debugging-malloc_test- turns on all debugging if PETSc was configured with debugging including-malloc_dump, otherwise ignored-malloc_view_threshold t- log only allocations larger than t-malloc_dump filename- print a list of all memory that has not been freed, inPetscFinalize()
Level: developer
See also: CHKMEMQ, PetscMallocValidate(), PetscMallocGetDebug(), PetscMalloc(), PetscFree()
External Links
- PETSc Manual:
Sys/PetscMallocSetDebug
PETSc.LibPETSc.PetscMallocTraceGet — Method
logging::PetscBool = PetscMallocTraceGet(petsclib::PetscLibType)Determine whether all calls to PetscMalloc() are being traced
Not Collective
Output Parameter:
logging-PETSC_TRUEif logging is active
Options Database Key:
-malloc_view optional filename- ActivatesPetscMallocView()
Level: advanced
This only does anything if -malloc_debug (or -malloc_test if PETSc was configured with debugging) has been used
See also: PetscMallocTraceSet(), PetscMallocViewGet(), PetscMallocDump(), PetscMallocView(), PetscMalloc(), PetscFree()
External Links
- PETSc Manual:
Sys/PetscMallocTraceGet
PETSc.LibPETSc.PetscMallocTraceSet — Method
PetscMallocTraceSet(petsclib::PetscLibType, viewer::PetscViewer, active::PetscBool, logmin::PetscLogDouble)Trace all calls to PetscMalloc(). That is print each PetscMalloc() and PetscFree() call to a viewer.
Not Collective
Input Parameters:
viewer- The viewer to use for tracing, orNULLto usePETSC_VIEWER_STDOUT_SELFactive- Flag to activate or deactivate tracinglogmin- The smallest memory size that will be logged
Level: advanced
See also: PetscMallocTraceGet(), PetscMallocViewGet(), PetscMallocDump(), PetscMallocView(), PetscMalloc(), PetscFree()
External Links
- PETSc Manual:
Sys/PetscMallocTraceSet
PETSc.LibPETSc.PetscMallocValidate — Method
PetscMallocValidate(petsclib::PetscLibType, line::Cint, fnc::String, file::String)Test the memory for corruption. This can be called at any time between PetscInitialize() and PetscFinalize()
Input Parameters:
line- line number where call originated.function- name of function callingfile- file where function is
Options Database Keys:
-malloc_test- turns this feature on when PETSc was not configured with--with-debugging=0-malloc_debug- turns this feature on anytime
Level: advanced
See also: CHKMEMQ, PetscMalloc(), PetscFree(), PetscMallocSetDebug()
External Links
- PETSc Manual:
Sys/PetscMallocValidate
PETSc.LibPETSc.PetscMallocView — Method
PetscMallocView(petsclib::PetscLibType, fp::Libc.FILE)Saves the log of all calls to PetscMalloc(); also calls PetscMemoryGetMaximumUsage()
Not Collective
Input Parameter:
fp- file pointer; orNULL
Options Database Key:
-malloc_view optional filename- ActivatesPetscMallocView()inPetscFinalize()
Level: advanced
See also: PetscMallocGetCurrentUsage(), PetscMallocDump(), PetscMallocViewSet(), PetscMemoryView(), PetscMalloc(), PetscFree()
External Links
- PETSc Manual:
Sys/PetscMallocView
PETSc.LibPETSc.PetscMallocViewGet — Method
logging::PetscBool = PetscMallocViewGet(petsclib::PetscLibType)Determine whether calls to PetscMalloc() are being logged
Not Collective
Output Parameter:
logging-PETSC_TRUEif logging is active
Options Database Key:
-malloc_view optional filename- ActivatesPetscMallocView()
Level: advanced
See also: PetscMallocViewSet(), PetscMallocDump(), PetscMallocView(), PetscMallocTraceGet(), PetscMalloc(), PetscFree()
External Links
- PETSc Manual:
Sys/PetscMallocViewGet
PETSc.LibPETSc.PetscMallocViewSet — Method
PetscMallocViewSet(petsclib::PetscLibType, logmin::PetscLogDouble)Activates logging of all calls to PetscMalloc() with a minimum size to view
Not Collective
Input Parameter:
logmin- minimum allocation size to log, orPETSC_DEFAULTto log all memory allocations
Options Database Keys:
-malloc_view optional filename- ActivatesPetscMallocView()inPetscFinalize()-malloc_view_threshold min- Sets a minimum size if-malloc_viewis used-log_view_memory- view the memory usage also with the -log_view option
Level: advanced
See also: PetscMallocViewGet(), PetscMallocDump(), PetscMallocView(), PetscMallocTraceSet(), PetscMallocValidate(), PetscMalloc(), PetscFree()
External Links
- PETSc Manual:
Sys/PetscMallocViewSet
PETSc.LibPETSc.PetscMaxSum — Method
max::PetscInt,sum::PetscInt = PetscMaxSum(petsclib::PetscLibType, comm::MPI_Comm, array::Vector{PetscInt})Returns the max of the first entry over all MPI processes and the sum of the second entry.
Collective
Input Parameters:
comm- the communicatorarray- an arry of length 2 timessize, the number of MPI processes
Output Parameters:
max- the maximum ofarray[2*rank]over all MPI processessum- the sum of thearray[2*rank + 1]over all MPI processes
Level: developer
See also: PetscInitialize()
External Links
- PETSc Manual:
Sys/PetscMaxSum
PETSc.LibPETSc.PetscMemcmp — Method
e::PetscBool = PetscMemcmp(petsclib::PetscLibType, str1::Ptr{Cvoid}, str2::Ptr{Cvoid}, len::Csize_t)Compares two byte streams in memory.
Not Collective
Input Parameters:
str1- Pointer to the first byte streamstr2- Pointer to the second byte streamlen- The length of the byte stream
(both str1 and str2 are assumed to be of length len)
Output Parameter:
e-PETSC_TRUEif equal elsePETSC_FALSE.
Level: intermediate
See also: PetscMemcpy(), PetscArrayzero(), PetscMemzero(), PetscArraycmp(), PetscArraycpy(), PetscStrallocpy(), PetscArraymove()
External Links
- PETSc Manual:
Sys/PetscMemcmp
PETSc.LibPETSc.PetscMemoryGetCurrentUsage — Method
mem::PetscLogDouble = PetscMemoryGetCurrentUsage(petsclib::PetscLibType)Returns the current resident set size (memory used) for the program.
Not Collective
Output Parameter:
mem- memory usage in bytes
Options Database Key:
-memory_view- Print memory usage at end of run-log_view_memory- Display memory information for each logged event-malloc_view- Print usage ofPetscMalloc()inPetscFinalize()
Level: intermediate
See also: PetscMallocGetMaximumUsage(), PetscMemoryGetMaximumUsage(), PetscMallocGetCurrentUsage(), PetscMemorySetGetMaximumUsage(), PetscMemoryView()
External Links
- PETSc Manual:
Sys/PetscMemoryGetCurrentUsage
PETSc.LibPETSc.PetscMemoryGetMaximumUsage — Method
mem::PetscLogDouble = PetscMemoryGetMaximumUsage(petsclib::PetscLibType)Returns the maximum resident set size (memory used) for the program since it started (the high water mark).
Not Collective
Output Parameter:
mem- memory usage in bytes
Options Database Key:
-memory_view- Print memory usage at end of run-log_view_memory- Print memory information per event-malloc_view- Print usage ofPetscMalloc()inPetscFinalize()
Level: intermediate
See also: PetscMallocGetMaximumUsage(), PetscMemoryGetCurrentUsage(), PetscMallocGetCurrentUsage(), PetscMemorySetGetMaximumUsage()
External Links
- PETSc Manual:
Sys/PetscMemoryGetMaximumUsage
PETSc.LibPETSc.PetscMemorySetGetMaximumUsage — Method
PetscMemorySetGetMaximumUsage(petsclib::PetscLibType)Tells PETSc to monitor the maximum memory usage so that PetscMemoryGetMaximumUsage() will work.
Not Collective
Options Database Key:
-memory_view- Print memory usage at end of run-log_view_memory- Print memory information per event-malloc_view- Print usage ofPetscMalloc()inPetscFinalize()
Level: intermediate
See also: PetscMallocGetMaximumUsage(), PetscMemoryGetCurrentUsage(), PetscMallocGetCurrentUsage(), PetscMemoryGetMaximumUsage()
External Links
- PETSc Manual:
Sys/PetscMemorySetGetMaximumUsage
PETSc.LibPETSc.PetscMemoryTrace — Method
PetscMemoryTrace(petsclib::PetscLibType, label::String)Print the current and high-water memory usage and the delta since the last call, tagged with a user-supplied label
Collective on PETSC_COMM_WORLD; No Fortran Support
Input Parameter:
label- short string used to tag the printed line so successive calls can be distinguished
Level: developer
See also: PetscMemoryGetCurrentUsage(), PetscMallocGetCurrentUsage(), PetscMallocDump()
External Links
- PETSc Manual:
Sys/PetscMemoryTrace
PETSc.LibPETSc.PetscMemoryView — Method
PetscMemoryView(petsclib::PetscLibType, viewer::PetscViewer, message::String)Shows the amount of memory currently being used in a communicator.
Collective
Input Parameters:
viewer- the viewer to output the information onmessage- string printed before values
Options Database Keys:
-malloc_debug- have PETSc track how much memory it has allocated-log_view_memory- print memory usage per event when-log_viewis used-memory_view- duringPetscFinalize()have this routine called
Level: intermediate
See also: PetscMallocDump(), PetscMemoryGetCurrentUsage(), PetscMemorySetGetMaximumUsage(), PetscMallocView(), PetscMalloc(), PetscFree()
External Links
- PETSc Manual:
Sys/PetscMemoryView
PETSc.LibPETSc.PetscMergeIntArray — Method
n::PetscInt,L::Ptr{PetscInt} = PetscMergeIntArray(petsclib::PetscLibType, an::PetscInt, aI::Vector{PetscInt}, bn::PetscInt, bI::Vector{PetscInt})Merges two SORTED PetscInt arrays, removes duplicate elements.
Not Collective
Input Parameters:
an- number of values in the first arrayaI- first sorted array ofPetscIntbn- number of values in the second arraybI- second array ofPetscInt
Output Parameters:
n- number of values in the merged arrayL- merged sorted array, this is allocated if an array is not provided
Level: intermediate
See also: PetscSortReal(), PetscSortIntWithPermutation(), PetscSortInt(), PetscSortIntWithArray()
External Links
- PETSc Manual:
Sys/PetscMergeIntArray
PETSc.LibPETSc.PetscMergeIntArrayPair — Method
n::PetscInt,L::Vector{PetscInt},J::Vector{PetscInt} = PetscMergeIntArrayPair(petsclib::PetscLibType, an::PetscInt, aI::Vector{PetscInt}, aJ::Vector{PetscInt}, bn::PetscInt, bI::Vector{PetscInt}, bJ::Vector{PetscInt})Merges two SORTED PetscInt arrays that share NO common values along with an additional array of PetscInt. The additional arrays are the same length as sorted arrays and are merged in the order determined by the merging of the sorted pair.
Not Collective
Input Parameters:
an- number of values in the first arrayaI- first sorted array ofPetscIntaJ- first additional array ofPetscIntbn- number of values in the second arraybI- second array ofPetscIntbJ- second additional ofPetscInt
Output Parameters:
n- number of values in the merged array (== an + bn)L- merged sorted arrayJ- merged additional array
See also: PetscIntSortSemiOrdered(), PetscSortReal(), PetscSortIntWithPermutation(), PetscSortInt(), PetscSortIntWithArray()
External Links
- PETSc Manual:
Sys/PetscMergeIntArrayPair
PETSc.LibPETSc.PetscMergeMPIIntArray — Method
n::PetscInt,L::Ptr{PetscMPIInt} = PetscMergeMPIIntArray(petsclib::PetscLibType, an::PetscInt, aI::Vector{PetscMPIInt}, bn::PetscInt, bI::Vector{PetscMPIInt})Merges two SORTED PetscMPIInt arrays.
Not Collective
Input Parameters:
an- number of values in the first arrayaI- first sorted array ofPetscMPIIntbn- number of values in the second arraybI- second array ofPetscMPIInt
Output Parameters:
n- number of values in the merged array (<= an + bn)L- merged sorted array, allocated if address of NULL pointer is passed
Level: intermediate
See also: PetscIntSortSemiOrdered(), PetscSortReal(), PetscSortIntWithPermutation(), PetscSortInt(), PetscSortIntWithArray()
External Links
- PETSc Manual:
Sys/PetscMergeMPIIntArray
PETSc.LibPETSc.PetscMkdir — Method
PetscMkdir(petsclib::PetscLibType, dir::String)Create a directory
Not Collective
Input Parameter:
dir- the directory name
Level: advanced
See also: PetscMkdtemp(), PetscRMTree()
External Links
- PETSc Manual:
Sys/PetscMkdir
PETSc.LibPETSc.PetscMkdtemp — Method
PetscMkdtemp(petsclib::PetscLibType, dir::String)Create a directory with a unique name given a name template.
Input Parameter:
dir- file name template, the last six characters must be 'XXXXXX', and they will be modified upon return
Level: advanced
See also: PetscMkdir(), PetscRMTree()
External Links
- PETSc Manual:
Sys/PetscMkdtemp
PETSc.LibPETSc.PetscMonitorCompare — Method
identical::PetscBool = PetscMonitorCompare(petsclib::PetscLibType, nmon::external, nmctx::Ptr{Cvoid}, nmdestroy::Ptr{Cvoid}, mon::external, mctx::Ptr{Cvoid}, mdestroy::Ptr{Cvoid})Checks if two monitors are identical; if they are then it destroys the new one
Not Collective
Input Parameters:
nmon- The new monitornmctx- The new monitor context, orNULLnmdestroy- The new monitor context destroy function, orNULL, seePetscCtxDestroyFnfor its calling sequencemon- The old monitormctx- The old monitor context, orNULLmdestroy- The old monitor context destroy function, orNULL, seePetscCtxDestroyFnfor its calling sequence
Output Parameter:
identical-PETSC_TRUEif the monitors are the same
Level: developer
See also: DMMonitorSetFromOptions(), KSPMonitorSetFromOptions(), SNESMonitorSetFromOptions(), PetscCtxDestroyFn
External Links
- PETSc Manual:
Viewer/PetscMonitorCompare
PETSc.LibPETSc.PetscOpenSocket — Method
t::Cint = PetscOpenSocket(petsclib::PetscLibType, hostname::String, portnum::Cint)handles connected to an open port where someone is waiting.
Input Parameters:
hostname- for example www.mcs.anl.govportnum- for example 80
Output Parameter:
t- the socket number
See also: PetscSocketListen(), PetscSocketEstablish(), PetscHTTPRequest(), PetscHTTPSConnect()
External Links
- PETSc Manual:
Viewer/PetscOpenSocket
PETSc.LibPETSc.PetscPClose — Method
PetscPClose(petsclib::PetscLibType, comm::MPI_Comm, fd::Libc.FILE)Closes (ends) a program on MPI rank 0 run with PetscPOpen()
Collective, but only MPI rank 0 does anything
Input Parameters:
comm- MPI communicator, only rank 0 performs the closefd- the file pointer where program input or output may be read orNULLif don't care
Level: intermediate
See also: PetscFOpen(), PetscFClose(), PetscPOpen()
External Links
- PETSc Manual:
Sys/PetscPClose
PETSc.LibPETSc.PetscPOpen — Method
fp::Ptr{Libc.FILE} = PetscPOpen(petsclib::PetscLibType, comm::MPI_Comm, machine::String, program::String, mode::String)Runs a program on MPI rank 0 and sends either its input or output to a file.
Logically Collective, but only MPI rank 0 runs the command
Input Parameters:
comm- MPI communicator, only processor zero runs the programmachine- machine to run command on orNULL, or a string with 0 in first locationprogram- name of program to runmode- either "r" or "w"
Output Parameter:
fp- the file pointer where program input or output may be read orNULLif results are not needed
Level: intermediate
See also: PetscFOpen(), PetscFClose(), PetscPClose(), PetscPOpenSetMachine()
External Links
- PETSc Manual:
Sys/PetscPOpen
PETSc.LibPETSc.PetscPOpenSetMachine — Method
PetscPOpenSetMachine(petsclib::PetscLibType, machine::String)Sets the name of the default machine to run PetscPOpen() calls on
Logically Collective, but only the MPI process with rank 0 runs the command
Input Parameter:
machine- machine to run command on orNULLfor the current machine
Options Database Key:
-popen_machine machine- run the process on this machine
Level: intermediate
See also: PetscFOpen(), PetscFClose(), PetscPClose(), PetscPOpen()
External Links
- PETSc Manual:
Sys/PetscPOpenSetMachine
PETSc.LibPETSc.PetscParallelSortInt — Method
PetscParallelSortInt(petsclib::PetscLibType, mapin::PetscLayout, mapout::PetscLayout, keysin::Vector{PetscInt}, keysout::Vector{PetscInt})Globally sort a distributed array of integers
Collective
Input Parameters:
mapin-PetscLayoutdescribing the distribution of the input keysmapout-PetscLayoutdescribing the desired distribution of the output keyskeysin- the pre-sorted array of integers
Output Parameter:
keysout- the array in which the sorted integers will be stored. Ifmapin==mapout, thenkeysinmay be equal tokeysout.
Level: developer
See also: PetscSortInt(), PetscParallelSortedInt()
External Links
- PETSc Manual:
IS/PetscParallelSortInt
PETSc.LibPETSc.PetscParallelSortedInt — Method
is_sorted::PetscBool = PetscParallelSortedInt(petsclib::PetscLibType, comm::MPI_Comm, n::PetscInt, keys::Vector{PetscInt})Check whether a PetscInt array, distributed over a communicator, is globally sorted.
Collective
Input Parameters:
comm- the MPI communicatorn- the local number ofPetscIntkeys- the local array ofPetscInt
Output Parameters:
is_sorted- whether the array is globally sorted
Level: developer
See also: PetscParallelSortInt()
External Links
- PETSc Manual:
Sys/PetscParallelSortedInt
PETSc.LibPETSc.PetscPopErrorHandler — Method
PetscPopErrorHandler(petsclib::PetscLibType)Removes the latest error handler that was pushed with PetscPushErrorHandler().
Not Collective
Level: intermediate
See also: PetscPushErrorHandler()
External Links
- PETSc Manual:
Sys/PetscPopErrorHandler
PETSc.LibPETSc.PetscPopSignalHandler — Method
PetscPopSignalHandler(petsclib::PetscLibType)Removes the last signal handler that was pushed. If no signal handlers are left on the stack it will remove the PETSc signal handler. (That is PETSc will no longer catch signals).
Not Collective
Level: developer
See also: PetscPushSignalHandler()
External Links
- PETSc Manual:
Sys/PetscPopSignalHandler
PETSc.LibPETSc.PetscPostIrecvInt — Method
rbuf::Ptr{PetscInt},r_waits::Ptr{MPI_Request} = PetscPostIrecvInt(petsclib::PetscLibType, comm::MPI_Comm, tag::PetscMPIInt, nrecvs::PetscMPIInt, onodes::Vector{PetscMPIInt}, olengths::Vector{PetscMPIInt})Allocate the receive buffers for an irregular all-to-all of PetscInt messages and post non-blocking MPI_Irecv()s on them
Collective; No Fortran Support
Input Parameters:
comm- theMPI_Commto communicate overtag- MPI tag for the irecvsnrecvs- number of receives to postonodes- array of lengthnrecvsof source ranksolengths- array of lengthnrecvsof message lengths (inPetscInts)
Output Parameters:
rbuf- allocated array of lengthnrecvsof pointers to the receive buffers (in contiguous storage)r_waits- allocated array of lengthnrecvsofMPI_Requests for the posted irecvs
Level: developer
See also: PetscPostIrecvScalar(), PetscGatherNumberOfMessages(), PetscGatherMessageLengths()
External Links
- PETSc Manual:
Sys/PetscPostIrecvInt
PETSc.LibPETSc.PetscPostIrecvScalar — Method
rbuf::Ptr{PetscScalar},r_waits::Ptr{MPI_Request} = PetscPostIrecvScalar(petsclib::PetscLibType, comm::MPI_Comm, tag::PetscMPIInt, nrecvs::PetscMPIInt, onodes::Vector{PetscMPIInt}, olengths::Vector{PetscMPIInt})Allocate the receive buffers for an irregular all-to-all of PetscScalar messages and post non-blocking MPI_Irecv()s on them
Collective; No Fortran Support
Input Parameters:
comm- theMPI_Commto communicate overtag- MPI tag for the irecvsnrecvs- number of receives to postonodes- array of lengthnrecvsof source ranksolengths- array of lengthnrecvsof message lengths (inPetscScalars)
Output Parameters:
rbuf- allocated array of lengthnrecvsof pointers to the receive buffers (in contiguous storage)r_waits- allocated array of lengthnrecvsofMPI_Requests for the posted irecvs
Level: developer
See also: PetscPostIrecvInt(), PetscGatherNumberOfMessages(), PetscGatherMessageLengths()
External Links
- PETSc Manual:
Sys/PetscPostIrecvScalar
PETSc.LibPETSc.PetscProbComputeKSStatistic — Method
alpha::PetscReal = PetscProbComputeKSStatistic(petsclib::PetscLibType, v::AbstractPetscVec, cdf::Ptr{Cvoid})Compute the Kolmogorov-Smirnov statistic for the empirical distribution for an input vector, compared to an analytic CDF.
Collective
Input Parameters:
v- The data vector, blocksize is the sample dimensioncdf- The analytic CDF
Output Parameter:
alpha- The KS statistic
Level: advanced
See also: PetscProbComputeKSStatisticWeighted(), PetscProbComputeKSStatisticMagnitude(), PetscProbFn
External Links
- PETSc Manual:
DT/PetscProbComputeKSStatistic
PETSc.LibPETSc.PetscProbComputeKSStatisticMagnitude — Method
alpha::PetscReal = PetscProbComputeKSStatisticMagnitude(petsclib::PetscLibType, v::AbstractPetscVec, cdf::Ptr{Cvoid})Compute the Kolmogorov-Smirnov statistic for the empirical distribution for the magnitude over each block of an input vector, compared to an analytic CDF.
Collective
Input Parameters:
v- The data vector, blocksize is the sample dimensioncdf- The analytic CDF
Output Parameter:
alpha- The KS statistic
Level: advanced
See also: PetscProbComputeKSStatistic(), PetscProbComputeKSStatisticWeighted(), PetscProbFn
External Links
- PETSc Manual:
DT/PetscProbComputeKSStatisticMagnitude
PETSc.LibPETSc.PetscProbComputeKSStatisticWeighted — Method
alpha::PetscReal = PetscProbComputeKSStatisticWeighted(petsclib::PetscLibType, v::AbstractPetscVec, w::AbstractPetscVec, cdf::Ptr{Cvoid})Compute the Kolmogorov-Smirnov statistic for the weighted empirical distribution for an input vector, compared to an analytic CDF.
Collective
Input Parameters:
v- The data vector, blocksize is the sample dimensionw- The vector of weights for each sample, instead of the default 1/ncdf- The analytic CDF
Output Parameter:
alpha- The KS statistic
Level: advanced
See also: PetscProbComputeKSStatistic(), PetscProbComputeKSStatisticMagnitude(), PetscProbFn
External Links
- PETSc Manual:
DT/PetscProbComputeKSStatisticWeighted
PETSc.LibPETSc.PetscProbCreateFromOptions — Method
pdf::Ptr{Cvoid},cdf::Ptr{Cvoid},sampler::Ptr{Cvoid} = PetscProbCreateFromOptions(petsclib::PetscLibType, dim::PetscInt, prefix::String, name::String)Return the probability distribution specified by the arguments and options
Not Collective
Input Parameters:
dim- The dimension of sample pointsprefix- The options prefix, orNULLname- The options database name for the probability distribution type
Output Parameters:
pdf- The PDF of this type, orNULLcdf- The CDF of this type, orNULLsampler- The PDF sampler of this type, orNULL
Level: intermediate
See also: PetscProbFn, PetscPDFMaxwellBoltzmann1D(), PetscPDFGaussian1D(), PetscPDFConstant1D()
External Links
- PETSc Manual:
DT/PetscProbCreateFromOptions
PETSc.LibPETSc.PetscProcessPlacementView — Method
PetscProcessPlacementView(petsclib::PetscLibType, viewer::PetscViewer)display the MPI rank placement by core
Input Parameter:
viewer-PETSCVIEWERASCIIto display the results on
Level: intermediate
See also: PetscInitialize()
External Links
- PETSc Manual:
Sys/PetscProcessPlacementView
PETSc.LibPETSc.PetscProcessTree — Method
Nlevels::PetscInt,Level::Ptr{PetscInt},Levelcnt::Ptr{PetscInt},Idbylevel::Ptr{PetscInt},Column::Ptr{PetscInt} = PetscProcessTree(petsclib::PetscLibType, n::PetscInt, mask::Vector{PetscBool}, parentid::Vector{PetscInt})Prepares tree data to be displayed graphically
Not Collective, No Fortran Support
Input Parameters:
n- number of valuesmask- indicates those entries in the tree, location 0 is always maskedparentid- indicates the parent of each entry
Output Parameters:
Nlevels- the number of levelsLevel- for each node tells its levelLevelcnt- the number of nodes on each levelIdbylevel- a list of ids on each of the levels, first level followed by second etcColumn- for each id tells its column index
Level: developer
See also: PetscSortReal(), PetscSortIntWithPermutation()
External Links
- PETSc Manual:
Sys/PetscProcessTree
PETSc.LibPETSc.PetscPullJSONValue — Method
found::PetscBool = PetscPullJSONValue(petsclib::PetscLibType, buff::String, key::String, value::String, valuelen::Csize_t)Given a JSON response containing the substring with "key" : "value" where there may or not be spaces around the : returns the value.
Input Parameters:
buff- the char array containing the possible valueskey- the key of the requested valuevaluelen- the length of the array to contain the value associated with the key
Output Parameters:
value- the value obtainedfound- flag indicating if the value was found in the buff
Level: advanced
See also: PetscOpenSocket(), PetscHTTPSRequest(), PetscSSLInitializeContext(), PetscPushJSONValue()
External Links
- PETSc Manual:
Sys/PetscPullJSONValue
PETSc.LibPETSc.PetscPushErrorHandler — Method
PetscPushErrorHandler(petsclib::PetscLibType, handler::external, ctx::Ptr{Cvoid})Sets a routine to be called on detection of errors.
Not Collective, No Fortran Support
Input Parameters:
handler- error handler routinectx- optional handler context that contains information needed by the handler (for
example file pointers for error messages etc.)
Calling sequence of handler:
comm- communicator over which error occurredline- the line number of the error (usually indicated by__LINE__in the calling routine)file- the file in which the error was detected (usually indicated by__FILE__in the calling routine)fun- the function name of the calling routinen- the generic error number (see list defined in include/petscerror.h)p-PETSC_ERROR_INITIALif error just detected, otherwisePETSC_ERROR_REPEATmess- an error text string, usually just printed to the screenctx- the error handler context
Options Database Keys:
-on_error_attach_debugger [noxterm,][(gdb|lldb)]- starts up the debugger if an error occurs-on_error_abort- aborts the program if an error occurs
Level: intermediate
See also: PetscPopErrorHandler(), PetscAttachDebuggerErrorHandler(), PetscAbortErrorHandler(), PetscTraceBackErrorHandler(), PetscPushSignalHandler(), PetscErrorType, PETSC_ERROR_INITIAL, PETSC_ERROR_REPEAT, PetscErrorCode
External Links
- PETSc Manual:
Sys/PetscPushErrorHandler
PETSc.LibPETSc.PetscPushJSONValue — Method
PetscPushJSONValue(petsclib::PetscLibType, buff::String, key::String, value::String, bufflen::Csize_t)Puts a "key" : "value" pair onto a string
Input Parameters:
buff- the char array where the value will be putkey- the key value to be setvalue- the value associated with the keybufflen- the size of the buffer (currently ignored)
Level: advanced
See also: PetscOpenSocket(), PetscHTTPSRequest(), PetscSSLInitializeContext(), PetscPullJSONValue()
External Links
- PETSc Manual:
Sys/PetscPushJSONValue
PETSc.LibPETSc.PetscPushSignalHandler — Method
PetscPushSignalHandler(petsclib::PetscLibType, routine::external, ctx::Ptr{Cvoid})Catches the usual fatal errors and calls a user-provided routine.
Not Collective, No Fortran Support
Input Parameters:
routine- routine to call when a signal is receivedctx- optional context needed by the routine
Level: developer
See also: PetscPopSignalHandler(), PetscSignalHandlerDefault(), PetscPushErrorHandler()
External Links
- PETSc Manual:
Sys/PetscPushSignalHandler
PETSc.LibPETSc.PetscPythonFinalize — Method
PetscPythonFinalize(petsclib::PetscLibType)Finalize PETSc for use with Python.
Level: intermediate
See also: PetscPythonInitialize(), PetscPythonPrintError()
External Links
- PETSc Manual:
Sys/PetscPythonFinalize
PETSc.LibPETSc.PetscPythonInitialize — Method
PetscPythonInitialize(petsclib::PetscLibType, pyexe::String, pylib::String)Initialize Python for use with PETSc and import petsc4py.
Input Parameters:
pyexe- path to the Python interpreter executable, orNULL.pylib- full path to the Python dynamic library, orNULL.
Options Database Key:
-python exe- Initializes Python, and optionally takes a Python executable name
Level: intermediate
See also: PetscPythonFinalize(), PetscPythonPrintError()
External Links
- PETSc Manual:
Sys/PetscPythonInitialize
PETSc.LibPETSc.PetscPythonMonitorSet — Method
PetscPythonMonitorSet(petsclib::PetscLibType, obj, url::String)Set a Python monitor for a PetscObject
Level: developer
See also: PetscPythonInitialize(), PetscPythonFinalize(), PetscPythonPrintError()
External Links
- PETSc Manual:
Sys/PetscPythonMonitorSet
PETSc.LibPETSc.PetscPythonPrintError — Method
PetscPythonPrintError(petsclib::PetscLibType)Print any current Python errors.
Level: developer
See also: PetscPythonInitialize(), PetscPythonFinalize()
External Links
- PETSc Manual:
Sys/PetscPythonPrintError
PETSc.LibPETSc.PetscRMTree — Method
PetscRMTree(petsclib::PetscLibType, dir::String)Recursively delete a directory tree on the current MPI process
Not Collective
Input Parameter:
dir- path of the directory to delete
Level: developer
See also: PetscMkdir(), PetscTestDirectory()
External Links
- PETSc Manual:
Sys/PetscRMTree
PETSc.LibPETSc.PetscRealSortSemiOrdered — Method
PetscRealSortSemiOrdered(petsclib::PetscLibType, n::PetscInt, arr::Vector{PetscReal})Sorts an array of PetscReal in place in increasing order.
Not Collective
Input Parameters:
n- number of valuesarr- array ofPetscReal
Output Parameter:
arr- sorted array of integers
Level: intermediate
See also: PetscTimSort(), PetscSortReal(), PetscSortRealWithPermutation()
External Links
- PETSc Manual:
Sys/PetscRealSortSemiOrdered
PETSc.LibPETSc.PetscRealSortSemiOrderedWithArrayInt — Method
PetscRealSortSemiOrderedWithArrayInt(petsclib::PetscLibType, n::PetscInt, arr1::Vector{PetscReal}, arr2::Vector{PetscInt})Sorts an array of PetscReal in place in increasing order and reorders a second array of PetscInt to match the first.
Not Collective
Input Parameter:
n- number of values
Input/Output Parameters:
arr1- array ofPetscRealto be sorted, modified on outputarr2- array ofPetscIntto be reordered, modified on output
Level: intermediate
See also: PetscTimSortWithArray(), PetscSortRealWithArrayInt(), PetscSortRealWithPermutation()
External Links
- PETSc Manual:
Sys/PetscRealSortSemiOrderedWithArrayInt
PETSc.LibPETSc.PetscRealView — Method
PetscRealView(petsclib::PetscLibType, N::PetscInt, idx::Vector{PetscReal}, viewer::PetscViewer)Prints an array of doubles; useful for debugging.
Collective
Input Parameters:
N- number ofPetscRealin arrayidx- array ofPetscRealviewer- location to print array,PETSC_VIEWER_STDOUT_WORLD,PETSC_VIEWER_STDOUT_SELFor 0
Level: intermediate
See also: PetscViewer, PetscIntView()
External Links
- PETSc Manual:
Sys/PetscRealView
PETSc.LibPETSc.PetscRealViewNumColumns — Method
PetscRealViewNumColumns(petsclib::PetscLibType, N::PetscInt, Ncol::PetscInt, idx::Vector{PetscReal}, viewer::PetscViewer)Prints an array of doubles; useful for debugging.
Collective
Input Parameters:
N- number ofPetscRealin arrayNcol- number ofPetscRealto print per rowidx- array ofPetscRealviewer- location to print array,PETSC_VIEWER_STDOUT_WORLD,PETSC_VIEWER_STDOUT_SELFor 0
Level: intermediate
See also: PetscViewer, PetscRealView(), PetscIntView()
External Links
- PETSc Manual:
Sys/PetscRealViewNumColumns
PETSc.LibPETSc.PetscRegisterFinalize — Method
PetscRegisterFinalize(petsclib::PetscLibType, f::external)Registers a function that is to be called in PetscFinalize()
Not Collective
Input Parameter:
f- function to be called
Level: developer
See also: PetscRegisterFinalizeAll(), PetscObjectRegisterDestroy()
External Links
- PETSc Manual:
Sys/PetscRegisterFinalize
PETSc.LibPETSc.PetscRegisterFinalizeAll — Method
PetscRegisterFinalizeAll(petsclib::PetscLibType)Runs all the finalize functions set with PetscRegisterFinalize()
Not Collective except for registered functions that are collective
Level: developer
See also: PetscRegisterFinalize(), PetscObjectRegisterDestroyAll()
External Links
- PETSc Manual:
Sys/PetscRegisterFinalizeAll
PETSc.LibPETSc.PetscReturnErrorHandler — Method
PetscReturnErrorHandler(petsclib::PetscLibType, comm::MPI_Comm, line::Cint, fun::String, file::String, n::PetscErrorCode, p::PetscErrorType, mess::String, ctx::Ptr{Cvoid})Error handler that causes a return without printing an error message.
Not Collective, No Fortran Support
Input Parameters:
comm- communicator over which error occurredline- the line number of the error (usually indicated by__LINE__in the calling routine)fun- the function namefile- the file in which the error was detected (usually indicated by__FILE__in the calling routine)mess- an error text string, usually just printed to the screenn- the generic error numberp-PETSC_ERROR_INITIALindicates this is the first time the error handler is being called whilePETSC_ERROR_REPEATindicates it was previously calledctx- error handler context
Level: developer
See also: PetscPushErrorHandler(), PetscPopErrorHandler(), PetscError(), PetscAbortErrorHandler(), PetscMPIAbortErrorHandler(), PetscTraceBackErrorHandler(), PetscAttachDebuggerErrorHandler(), PetscEmacsClientErrorHandler(), PetscErrorType, PETSC_ERROR_INITIAL, PETSC_ERROR_REPEAT, PetscErrorCode
External Links
- PETSc Manual:
Sys/PetscReturnErrorHandler
PETSc.LibPETSc.PetscSSLDestroyContext — Method
PetscSSLDestroyContext(petsclib::PetscLibType, ctx::SSL_CTX)frees a SSL_CTX obtained with PetscSSLInitializeContext()
Input Parameter:
ctx- theSSL_CTX
Level: advanced
See also: PetscSSLInitializeContext(), PetscHTTPSConnect()
External Links
- PETSc Manual:
Sys/PetscSSLDestroyContext
PETSc.LibPETSc.PetscSSLInitializeContext — Method
octx::Ptr{SSL_CTX} = PetscSSLInitializeContext(petsclib::PetscLibType)Set up an SSL context suitable for initiating HTTPS requests.
Output Parameter:
octx- the SSL_CTX to be passed toPetscHTTPSConnect90
Level: advanced
If PETSc was ./configure -with-ssl-certificate requires the user have created a self-signed certificate with $saws/CA.pl -newcert (using the passphrase of password) cat newkey.pem newcert.pem > sslclient.pem$
and put the resulting file in either the current directory (with the application) or in the home directory. This seems kind of silly but it was all I could figure out.
See also: PetscSSLDestroyContext(), PetscHTTPSConnect(), PetscHTTPSRequest()
External Links
- PETSc Manual:
Sys/PetscSSLInitializeContext
PETSc.LibPETSc.PetscScalarView — Method
PetscScalarView(petsclib::PetscLibType, N::PetscInt, idx::Vector{PetscScalar}, viewer::PetscViewer)Prints an array of PetscScalar; useful for debugging.
Collective
Input Parameters:
N- number of scalars in arrayidx- array of scalarsviewer- location to print array,PETSC_VIEWER_STDOUT_WORLD,PETSC_VIEWER_STDOUT_SELFor 0
Level: intermediate
See also: PetscViewer, PetscIntView(), PetscRealView()
External Links
- PETSc Manual:
Sys/PetscScalarView
PETSc.LibPETSc.PetscScalarViewNumColumns — Method
PetscScalarViewNumColumns(petsclib::PetscLibType, N::PetscInt, Ncol::PetscInt, idx::Vector{PetscScalar}, viewer::PetscViewer)Prints an array of doubles; useful for debugging.
Collective
Input Parameters:
N- number ofPetscScalarin arrayNcol- number ofPetscScalarto print per rowidx- array ofPetscScalarviewer- location to print array,PETSC_VIEWER_STDOUT_WORLD,PETSC_VIEWER_STDOUT_SELFor 0
Level: intermediate
See also: PetscViewer, PetscRealView(), PetscScalarView(), PetscIntView()
External Links
- PETSc Manual:
Sys/PetscScalarViewNumColumns
PETSc.LibPETSc.PetscSequentialPhaseBegin — Method
PetscSequentialPhaseBegin(petsclib::PetscLibType, comm::MPI_Comm, ng::Cint)Begins a sequential section of code.
Collective
Input Parameters:
comm- Communicator to sequentialize overng- Number in processor group. This many processes are allowed to execute
at the same time (usually 1)
Level: intermediate
See also: PetscSequentialPhaseEnd(), PetscSynchronizedPrintf()
External Links
- PETSc Manual:
Sys/PetscSequentialPhaseBegin
PETSc.LibPETSc.PetscSequentialPhaseEnd — Method
PetscSequentialPhaseEnd(petsclib::PetscLibType, comm::MPI_Comm, ng::Cint)Ends a sequential section of code.
Collective
Input Parameters:
comm- Communicator to sequentialize.ng- Number in processor group. This many processes are allowed to execute
at the same time (usually 1)
Level: intermediate
See also: PetscSequentialPhaseBegin()
External Links
- PETSc Manual:
Sys/PetscSequentialPhaseEnd
PETSc.LibPETSc.PetscSetDebugTerminal — Method
PetscSetDebugTerminal(petsclib::PetscLibType, terminal::String)Sets the terminal to use for debugging.
Not Collective; No Fortran Support
Input Parameter:
terminal- name of terminal and any flags required to execute a program.
For example "xterm", "urxvt -e", "gnome-terminal -x". On Apple macOS you can use "Terminal" (note the capital T)
Options Database Key:
-debug_terminal terminal- use this terminal instead of the default
Level: developer
See also: PetscSetDebugger(), PetscAttachDebugger()
External Links
- PETSc Manual:
Sys/PetscSetDebugTerminal
PETSc.LibPETSc.PetscSetDebugger — Method
PetscSetDebugger(petsclib::PetscLibType, debugger::String, usedebugterminal::PetscBool)Sets options associated with the debugger.
Not Collective; No Fortran Support
Input Parameters:
debugger- name of debugger, which should be in your path,
usually "lldb", "dbx", "gdb", "cuda-gdb", "idb", "xxgdb", "kdgb" or "ddd". Also, HP-UX supports "xdb", and IBM rs6000 supports "xldb".
usedebugterminal- flag to indicate debugger window, set to eitherPETSC_TRUE(to indicate
debugger should be started in a new terminal window) or PETSC_FALSE (to start debugger in initial window (the option PETSC_FALSE makes no sense when using more than one MPI process.)
Level: developer
See also: PetscAttachDebugger(), PetscAttachDebuggerErrorHandler(), PetscSetDebugTerminal()
External Links
- PETSc Manual:
Sys/PetscSetDebugger
PETSc.LibPETSc.PetscSetDebuggerFromString — Method
PetscSetDebuggerFromString(petsclib::PetscLibType, string::String)Set the complete path for the debugger for PETSc to use.
Not Collective
Input Parameter:
string- the name of the debugger, for example "gdb"
Level: developer
See also: PetscSetDebugger(), PetscSetDefaultDebugger(), PetscAttachDebugger()
External Links
- PETSc Manual:
Sys/PetscSetDebuggerFromString
PETSc.LibPETSc.PetscSetDefaultDebugger — Method
PetscSetDefaultDebugger(petsclib::PetscLibType)Causes PETSc to use its default debugger and output terminal
Not Collective, No Fortran Support
Level: developer
See also: PetscSetDebugger(), PetscSetDebuggerFromString(), PetscAttachDebugger()
External Links
- PETSc Manual:
Sys/PetscSetDefaultDebugger
PETSc.LibPETSc.PetscSetDisplay — Method
PetscSetDisplay(petsclib::PetscLibType)Determine and set PETSc's X11 display string from the -display option, the DISPLAY environment variable, or the hostname of MPI rank 0 when running across multiple nodes
Collective; No Fortran Support
Level: developer
See also: PetscGetDisplay(), PetscDraw, PETSC_DRAW_X
External Links
- PETSc Manual:
Sys/PetscSetDisplay
PETSc.LibPETSc.PetscSetFPTrap — Method
PetscSetFPTrap(petsclib::PetscLibType, flag::PetscFPTrap)Enables traps/exceptions on common floating point errors. This option may not work on certain systems or only a subset of exceptions may be trapable.
Not Collective
Input Parameter:
flag- values are
$PETSC_FP_TRAP_OFF - do not trap any exceptions PETSC_FP_TRAP_ON - all exceptions that are possible on the system except underflow PETSC_FP_TRAP_INDIV - integer divide by zero PETSC_FP_TRAP_FLTOPERR - improper argument to function, for example with real numbers, the square root of a negative number PETSC_FP_TRAP_FLTOVF - overflow PETSC_FP_TRAP_FLTUND - underflow - not trapped by default on most systems PETSC_FP_TRAP_FLTDIV - floating point divide by zero PETSC_FP_TRAP_FLTINEX - inexact floating point result$
Options Database Key:
-fp_trap (off|on)- turn on or off trapping of floating point exceptions
Level: advanced
See also: PetscFPTrapPush(), PetscFPTrapPop(), PetscDetermineInitialFPTrap()
External Links
- PETSc Manual:
Sys/PetscSetFPTrap
PETSc.LibPETSc.PetscSetHelpVersionFunctions — Method
PetscSetHelpVersionFunctions(petsclib::PetscLibType, help::external, version::external)Sets functions that print help and version information before the PETSc help and version information is printed.
No Fortran Support
Input Parameters:
help- the help function (may beNULL)version- the version function (may beNULL)
Level: developer
See also: PetscInitialize()
External Links
- PETSc Manual:
Sys/PetscSetHelpVersionFunctions
PETSc.LibPETSc.PetscSetProgramName — Method
PetscSetProgramName(petsclib::PetscLibType, name::String)Set the program name reported by PetscGetProgramName()
Not Collective
Input Parameter:
name- the program name to record
Level: developer
See also: PetscGetProgramName(), PetscInitialize()
External Links
- PETSc Manual:
Sys/PetscSetProgramName
PETSc.LibPETSc.PetscSharedTmp — Method
shared::PetscBool = PetscSharedTmp(petsclib::PetscLibType, comm::MPI_Comm)Determines if all processors in a communicator share a tmp directory or have different ones.
Collective
Input Parameter:
comm- MPI_Communicator that may share tmp
Output Parameter:
shared-PETSC_TRUEorPETSC_FALSE
Options Database Keys:
-shared_tmp- indicates the directory is known to be shared among the MPI processes-not_shared_tmp- indicates the directory is known to be not shared among the MPI processes-tmp tmpdir- name of the directory you wish to use as tmp
Environmental Variables:
PETSC_SHARED_TMP- indicates the directory is known to be shared among the MPI processesPETSC_NOT_SHARED_TMP- indicates the directory is known to be not shared among the MPI processesPETSC_TMP- name of the directory you wish to use as tmp
Level: developer
See also: PetscGetTmp(), PetscSharedWorkingDirectory(), PetscGetWorkingDirectory(), PetscGetHomeDirectory()
External Links
- PETSc Manual:
Sys/PetscSharedTmp
PETSc.LibPETSc.PetscSharedWorkingDirectory — Method
shared::PetscBool = PetscSharedWorkingDirectory(petsclib::PetscLibType, comm::MPI_Comm)Determines if all processors in a communicator share a working directory or have different ones.
Collective
Input Parameter:
comm- MPI_Communicator that may share working directory
Output Parameter:
shared-PETSC_TRUEorPETSC_FALSE
Options Database Keys:
-shared_working_directory- indicates the directory is known to be shared among the MPI processes-not_shared_working_directory- indicates the directory is known to be not shared among the MPI processes
Environmental Variables:
PETSC_SHARED_WORKING_DIRECTORY- indicates the directory is known to be shared among the MPI processesPETSC_NOT_SHARED_WORKING_DIRECTORY- indicates the directory is known to be not shared among the MPI processes
Level: developer
See also: PetscGetTmp(), PetscSharedTmp(), PetscGetWorkingDirectory(), PetscGetHomeDirectory()
External Links
- PETSc Manual:
Sys/PetscSharedWorkingDirectory
PETSc.LibPETSc.PetscShmgetAddressesFinalize — Method
PetscShmgetAddressesFinalize(petsclib::PetscLibType)frees any shared memory that was allocated by PetscShmgetAllocateArray() but not deallocated with PetscShmgetDeallocateArray()
Not Collective
Level: developer
See also: PetscShmgetAllocateArray(), PetscShmgetDeallocateArray(), PetscShmgetUnmapAddresses()
External Links
- PETSc Manual:
Sys/PetscShmgetAddressesFinalize
PETSc.LibPETSc.PetscShmgetAllocateArray — Method
addr::Ptr{Cvoid} = PetscShmgetAllocateArray(petsclib::PetscLibType, sz::Csize_t, asz::Csize_t)allocates shared memory that will later be made accessible by all MPI processes in the server
Not Collective, only called on the first MPI process
Input Parameters:
sz- the number of elements in the arrayasz- the size of an entry in the array, for examplesizeof(PetscScalar)
Output Parameters:
addr- the address of the array
Level: developer
See also: PCMPIServerBegin(), PCMPI, KSPCheckPCMPI(), PetscShmgetDeallocateArray()
External Links
- PETSc Manual:
Sys/PetscShmgetAllocateArray
PETSc.LibPETSc.PetscShmgetDeallocateArray — Method
PetscShmgetDeallocateArray(petsclib::PetscLibType, addr::Union{Ptr, AbstractArray{Cvoid}})deallocates shared memory accessible by all MPI processes in the server obtained with PetscShmgetAllocateArray()
Not Collective, only called on the first MPI process
Input Parameter:
addr- the address of array
Level: developer
See also: PCMPIServerBegin(), PCMPI, KSPCheckPCMPI(), PetscShmgetAllocateArray()
External Links
- PETSc Manual:
Sys/PetscShmgetDeallocateArray
PETSc.LibPETSc.PetscShmgetMapAddresses — Method
addres::Ptr{Cvoid} = PetscShmgetMapAddresses(petsclib::PetscLibType, comm::MPI_Comm, n::PetscInt, baseaddres::Ptr{Ptr{Cvoid}})given shared address on the first MPI process determines the addresses on the other MPI processes that map to the same physical memory
Collective
Input Parameters:
comm- theMPI_Commto scatter the addressn- the number of addresses, each obtained on MPI process zero byPetscShmgetAllocateArray()baseaddres- the addresses on the first MPI process, ignored on all but first process
Output Parameter:
addres- the addresses on each MPI process, the array of void * must already be allocated
Level: developer
See also: PetscShmgetDeallocateArray(), PetscShmgetAllocateArray(), PetscShmgetUnmapAddresses()
External Links
- PETSc Manual:
Sys/PetscShmgetMapAddresses
PETSc.LibPETSc.PetscShmgetUnmapAddresses — Method
PetscShmgetUnmapAddresses(petsclib::PetscLibType, n::PetscInt, addres::Ptr{Ptr{Cvoid}})unlinks given shared addresses on a MPI process that is not of PetscGlobalRank 0
Not Collective
Input Parameters:
n- the number of addresses, each obtained originally on MPIPetscGlobalRankzero byPetscShmgetAllocateArray()addres- the addresses
Level: developer
See also: PetscShmgetDeallocateArray(), PetscShmgetAllocateArray(), PetscShmgetMapAddresses()
External Links
- PETSc Manual:
Sys/PetscShmgetUnmapAddresses
PETSc.LibPETSc.PetscSignalHandlerDefault — Method
PetscSignalHandlerDefault(petsclib::PetscLibType, sig::Cint, ptr::Ptr{Cvoid})Default signal handler.
Not Collective
Input Parameters:
sig- signal valueptr- unused pointer
Level: advanced
See also: PetscPushSignalHandler()
External Links
- PETSc Manual:
Sys/PetscSignalHandlerDefault
PETSc.LibPETSc.PetscSleep — Method
PetscSleep(petsclib::PetscLibType, s::PetscReal)Sleeps some number of seconds.
Not Collective
Input Parameter:
s- number of seconds to sleep
Level: intermediate
See also: PetscTime()
External Links
- PETSc Manual:
Sys/PetscSleep
PETSc.LibPETSc.PetscSortCount — Method
PetscSortCount(petsclib::PetscLibType, n::PetscCount, X::Vector{PetscCount})Sorts an array of PetscCount in place in increasing order.
Not Collective
Input Parameters:
n- number of valuesX- array ofPetscCount
See also: PetscSortInt()
External Links
- PETSc Manual:
Sys/PetscSortCount
PETSc.LibPETSc.PetscSortInt — Method
PetscSortInt(petsclib::PetscLibType, n::PetscCount, X::Vector{PetscInt})Sorts an array of PetscInt in place in increasing order.
Not Collective
Input Parameters:
n- number of valuesX- array ofPetscInt
See also: PetscIntSortSemiOrdered(), PetscSortReal(), PetscSortIntWithPermutation()
External Links
- PETSc Manual:
Sys/PetscSortInt
PETSc.LibPETSc.PetscSortInt64 — Method
PetscSortInt64(petsclib::PetscLibType, n::PetscCount, X::Vector{PetscInt64})Sorts an array of PetscInt64 in place in increasing order.
Not Collective
Input Parameters:
n- number of valuesX- array ofPetscInt64
See also: PetscSortInt()
External Links
- PETSc Manual:
Sys/PetscSortInt64
PETSc.LibPETSc.PetscSortIntWithArray — Method
PetscSortIntWithArray(petsclib::PetscLibType, n::PetscCount, X::Vector{PetscInt}, Y::Vector{PetscInt})Sorts an array of PetscInt in place in increasing order; changes a second array of PetscInt to match the sorted first array.
Not Collective
Input Parameters:
n- number of valuesX- array ofPetscIntY- second array ofPetscInt
Level: intermediate
See also: PetscIntSortSemiOrderedWithArray(), PetscSortReal(), PetscSortIntWithPermutation(), PetscSortInt(), PetscSortIntWithCountArray()
External Links
- PETSc Manual:
Sys/PetscSortIntWithArray
PETSc.LibPETSc.PetscSortIntWithArrayPair — Method
PetscSortIntWithArrayPair(petsclib::PetscLibType, n::PetscCount, X::Vector{PetscInt}, Y::Vector{PetscInt}, Z::Vector{PetscInt})Sorts an array of PetscInt in place in increasing order; changes a pair of PetscInt arrays to match the sorted first array.
Not Collective
Input Parameters:
n- number of valuesX- array ofPestcIntY- second array ofPestcInt(first array of the pair)Z- third array ofPestcInt(second array of the pair)
Level: intermediate
See also: PetscSortReal(), PetscSortIntWithPermutation(), PetscSortIntWithArray(), PetscIntSortSemiOrdered(), PetscSortIntWithIntCountArrayPair()
External Links
- PETSc Manual:
Sys/PetscSortIntWithArrayPair
PETSc.LibPETSc.PetscSortIntWithCountArray — Method
PetscSortIntWithCountArray(petsclib::PetscLibType, n::PetscCount, X::Vector{PetscInt}, Y::Vector{PetscCount})Sorts an array of PetscInt in place in increasing order; changes a second array of PetscCount to match the sorted first array.
Not Collective
Input Parameters:
n- number of valuesX- array ofPetscIntY- second array ofPetscCount
Level: intermediate
See also: PetscIntSortSemiOrderedWithArray(), PetscSortReal(), PetscSortIntWithPermutation(), PetscSortInt(), PetscSortIntWithArray()
External Links
- PETSc Manual:
Sys/PetscSortIntWithCountArray
PETSc.LibPETSc.PetscSortIntWithDataArray — Method
PetscSortIntWithDataArray(petsclib::PetscLibType, n::PetscCount, X::Vector{PetscInt}, Y::Ptr{Cvoid}, size::Csize_t, t2::Ptr{Cvoid})Sorts an array of PetscInt in place in increasing order; changes a second array to match the sorted first INTEGER array. Unlike other sort routines, the user must provide workspace (the size of an element in the data array) to use when sorting.
Not Collective, No Fortran Support
Input Parameters:
n- number of valuesX- array ofPetscIntY- second array of datasize- sizeof elements in the data array in bytest2- workspace of "size" bytes used when sorting
Level: intermediate
See also: PetscTimSortWithArray(), PetscSortReal(), PetscSortIntWithPermutation(), PetscSortInt(), PetscSortIntWithArray()
External Links
- PETSc Manual:
Sys/PetscSortIntWithDataArray
PETSc.LibPETSc.PetscSortIntWithIntCountArrayPair — Method
PetscSortIntWithIntCountArrayPair(petsclib::PetscLibType, n::PetscCount, X::Vector{PetscInt}, Y::Vector{PetscInt}, Z::Vector{PetscCount})Sorts an array of PetscInt in place in increasing order; changes a PetscInt array and a PetscCount array to match the sorted first array.
Not Collective
Input Parameters:
n- number of valuesX- array ofPetscIntY- second array ofPetscInt(first array of the pair)Z- third array ofPetscCount(second array of the pair)
Level: intermediate
See also: PetscSortReal(), PetscSortIntWithPermutation(), PetscSortIntWithArray(), PetscIntSortSemiOrdered(), PetscSortIntWithArrayPair()
External Links
- PETSc Manual:
Sys/PetscSortIntWithIntCountArrayPair
PETSc.LibPETSc.PetscSortIntWithMPIIntArray — Method
PetscSortIntWithMPIIntArray(petsclib::PetscLibType, n::PetscCount, X::Vector{PetscInt}, Y::Vector{PetscMPIInt})Sorts an array of PetscInt in place in increasing order; changes a second array of PetscMPI to match the sorted first array.
Not Collective
Input Parameters:
n- number of valuesX- array ofPetscIntY- second array ofPetscMPIInt
Level: intermediate
See also: PetscIntSortSemiOrderedWithArray(), PetscSortReal(), PetscSortIntWithPermutation(), PetscSortInt(), PetscSortIntWithArray()
External Links
- PETSc Manual:
Sys/PetscSortIntWithMPIIntArray
PETSc.LibPETSc.PetscSortIntWithPermutation — Method
PetscSortIntWithPermutation(petsclib::PetscLibType, n::PetscInt, i::Vector{PetscInt}, idx::Vector{PetscInt})Computes the permutation of PetscInt that gives a sorted sequence.
Not Collective
Input Parameters:
n- number of values to sorti- values to sortidx- permutation array. Must be initialized to 0:n-1 on input.
Level: intermediate
See also: PetscSortInt(), PetscSortRealWithPermutation(), PetscSortIntWithArray()
External Links
- PETSc Manual:
Sys/PetscSortIntWithPermutation
PETSc.LibPETSc.PetscSortIntWithScalarArray — Method
PetscSortIntWithScalarArray(petsclib::PetscLibType, n::PetscCount, X::Vector{PetscInt}, Y::Vector{PetscScalar})Sorts an array of PetscInt in place in increasing order; changes a second PetscScalar array to match the sorted first array.
Not Collective
Input Parameters:
n- number of valuesX- array ofPetscIntY- second array ofPetscScalar
Level: intermediate
See also: PetscTimSortWithArray(), PetscSortReal(), PetscSortIntWithPermutation(), PetscSortInt(), PetscSortIntWithArray()
External Links
- PETSc Manual:
Sys/PetscSortIntWithScalarArray
PETSc.LibPETSc.PetscSortMPIInt — Method
PetscSortMPIInt(petsclib::PetscLibType, n::PetscCount, X::Vector{PetscMPIInt})Sorts an array of PetscMPIInt in place in increasing order.
Not Collective
Input Parameters:
n- number of valuesX- array ofPetscMPIInt
Level: intermediate
See also: PetscMPIIntSortSemiOrdered(), PetscSortReal(), PetscSortIntWithPermutation()
External Links
- PETSc Manual:
Sys/PetscSortMPIInt
PETSc.LibPETSc.PetscSortMPIIntWithArray — Method
PetscSortMPIIntWithArray(petsclib::PetscLibType, n::PetscCount, X::Vector{PetscMPIInt}, Y::Vector{PetscMPIInt})Sorts an array of PetscMPIInt in place in increasing order; changes a second PetscMPIInt array to match the sorted first array.
Not Collective
Input Parameters:
n- number of valuesX- array ofPetscMPIIntY- second array ofPetscMPIInt
Level: intermediate
See also: PetscMPIIntSortSemiOrderedWithArray(), PetscSortReal(), PetscSortIntWithPermutation(), PetscSortInt()
External Links
- PETSc Manual:
Sys/PetscSortMPIIntWithArray
PETSc.LibPETSc.PetscSortMPIIntWithIntArray — Method
PetscSortMPIIntWithIntArray(petsclib::PetscLibType, n::PetscCount, X::Vector{PetscMPIInt}, Y::Vector{PetscInt})Sorts an array of PetscMPIInt in place in increasing order; changes a second array of PetscInt to match the sorted first array.
Not Collective
Input Parameters:
n- number of valuesX- array ofPetscMPIIntY- second array ofPetscInt
Level: intermediate
See also: PetscSortMPIIntWithArray(), PetscIntSortSemiOrderedWithArray(), PetscTimSortWithArray()
External Links
- PETSc Manual:
Sys/PetscSortMPIIntWithIntArray
PETSc.LibPETSc.PetscSortReal — Method
PetscSortReal(petsclib::PetscLibType, n::PetscCount, v::Vector{PetscReal})Sorts an array of PetscReal in place in increasing order.
Not Collective
Input Parameters:
n- number of valuesv- array of doubles
Level: intermediate
See also: PetscRealSortSemiOrdered(), PetscSortInt(), PetscSortRealWithPermutation(), PetscSortRealWithArrayInt()
External Links
- PETSc Manual:
Sys/PetscSortReal
PETSc.LibPETSc.PetscSortRealWithArrayInt — Method
PetscSortRealWithArrayInt(petsclib::PetscLibType, n::PetscCount, r::Vector{PetscReal}, Ii::Vector{PetscInt})Sorts an array of PetscReal in place in increasing order; changes a second PetscInt array to match the sorted first array.
Not Collective
Input Parameters:
n- number of valuesIi- array of integersr- second array of integers
Level: intermediate
See also: PetscSortReal()
External Links
- PETSc Manual:
Sys/PetscSortRealWithArrayInt
PETSc.LibPETSc.PetscSortRealWithPermutation — Method
PetscSortRealWithPermutation(petsclib::PetscLibType, n::PetscInt, i::Vector{PetscReal}, idx::Vector{PetscInt})Computes the permutation of PetscReal that gives a sorted sequence.
Not Collective
Input Parameters:
n- number of values to sorti- values to sortidx- permutation array. Must be initialized to 0:n-1 on input.
Level: intermediate
See also: PetscSortReal(), PetscSortIntWithPermutation()
External Links
- PETSc Manual:
Sys/PetscSortRealWithPermutation
PETSc.LibPETSc.PetscSortRemoveDupsInt — Method
n::PetscInt = PetscSortRemoveDupsInt(petsclib::PetscLibType, n::PetscInt, X::Vector{PetscInt})Sorts an array of PetscInt in place in increasing order removes all duplicate entries
Not Collective
Input Parameters:
n- number of valuesX- array ofPetscInt
Output Parameter:
n- number of non-redundant values
Level: intermediate
See also: PetscIntSortSemiOrdered(), PetscSortReal(), PetscSortIntWithPermutation(), PetscSortInt(), PetscSortedRemoveDupsInt()
External Links
- PETSc Manual:
Sys/PetscSortRemoveDupsInt
PETSc.LibPETSc.PetscSortRemoveDupsMPIInt — Method
n::PetscInt = PetscSortRemoveDupsMPIInt(petsclib::PetscLibType, n::PetscInt, X::Vector{PetscMPIInt})Sorts an array of PetscMPIInt in place in increasing order removes all duplicate entries
Not Collective
Input Parameters:
n- number of valuesX- array ofPetscMPIInt
Output Parameter:
n- number of non-redundant values
Level: intermediate
See also: PetscSortReal(), PetscSortIntWithPermutation(), PetscSortInt()
External Links
- PETSc Manual:
Sys/PetscSortRemoveDupsMPIInt
PETSc.LibPETSc.PetscSortRemoveDupsReal — Method
n::PetscInt = PetscSortRemoveDupsReal(petsclib::PetscLibType, n::PetscInt, v::Vector{PetscReal})Sorts an array of PetscReal in place in increasing order and removes all duplicate entries
Not Collective
Input Parameters:
n- initial number of valuesv- array of values
See also: PetscSortReal(), PetscSortRemoveDupsInt()
External Links
- PETSc Manual:
Sys/PetscSortRemoveDupsReal
PETSc.LibPETSc.PetscSortReverseInt — Method
PetscSortReverseInt(petsclib::PetscLibType, n::PetscCount, X::Vector{PetscInt})Sorts an array of PetscInt in place in decreasing order.
Not Collective
Input Parameters:
n- number of valuesX- array ofPetscInt
Level: intermediate
See also: PetscIntSortSemiOrdered(), PetscSortInt(), PetscSortIntWithPermutation()
External Links
- PETSc Manual:
Sys/PetscSortReverseInt
PETSc.LibPETSc.PetscSortSplit — Method
PetscSortSplit(petsclib::PetscLibType, ncut::PetscInt, n::PetscInt, a::Vector{PetscScalar}, idx::Vector{PetscInt})Quick-sort split of an array of PetscScalars in place.
Not Collective
Input Parameters:
ncut- splitting indexn- number of values to sort
Input/Output Parameters:
a- array of values, on output the values are permuted such that its elements satisfy:
abs(a[i]) >= abs(a[ncut-1]) for i < ncut and abs(a[i]) <= abs(a[ncut-1]) for i >= ncut
idx- index for array a, on output permuted accordingly
Level: intermediate
See also: PetscSortInt(), PetscSortRealWithPermutation()
External Links
- PETSc Manual:
Sys/PetscSortSplit
PETSc.LibPETSc.PetscSortSplitReal — Method
PetscSortSplitReal(petsclib::PetscLibType, ncut::PetscInt, n::PetscInt, a::Vector{PetscReal}, idx::Vector{PetscInt})Quick-sort split of an array of PetscReals in place.
Not Collective
Input Parameters:
ncut- splitting indexn- number of values to sort
Input/Output Parameters:
a- array of values, on output the values are permuted such that its elements satisfy:
abs(a[i]) >= abs(a[ncut-1]) for i < ncut and abs(a[i]) <= abs(a[ncut-1]) for i >= ncut
idx- index for array a, on output permuted accordingly
Level: intermediate
See also: PetscSortInt(), PetscSortRealWithPermutation()
External Links
- PETSc Manual:
Sys/PetscSortSplitReal
PETSc.LibPETSc.PetscSortStrWithPermutation — Method
PetscSortStrWithPermutation(petsclib::PetscLibType, n::PetscInt, i::String, idx::Vector{PetscInt})Computes the permutation of strings that gives a sorted sequence.
Not Collective, No Fortran Support
Input Parameters:
n- number of values to sorti- values to sortidx- permutation array. Must be initialized to 0:n-1 on input.
Level: intermediate
See also: PetscSortInt(), PetscSortRealWithPermutation()
External Links
- PETSc Manual:
Sys/PetscSortStrWithPermutation
PETSc.LibPETSc.PetscSortedCheckDupsCount — Method
flg::PetscBool = PetscSortedCheckDupsCount(petsclib::PetscLibType, n::PetscCount, X::Vector{PetscCount})Checks if a sorted PetscCount array has duplicates
Not Collective
Input Parameters:
n- number of valuesX- sorted array ofPetscCount
Output Parameter:
flg- True if the array has duplications, otherwise false
Level: intermediate
See also: PetscCount, PetscSortCount(), PetscSortedCheckDupsInt()
External Links
- PETSc Manual:
Sys/PetscSortedCheckDupsCount
PETSc.LibPETSc.PetscSortedCheckDupsInt — Method
flg::PetscBool = PetscSortedCheckDupsInt(petsclib::PetscLibType, n::PetscCount, X::Vector{PetscInt})Checks if a sorted PetscInt array has duplicates
Not Collective
Input Parameters:
n- number of valuesX- sorted array ofPetscInt
Output Parameter:
flg- True if the array has duplications, otherwise false
Level: intermediate
See also: PetscSortInt(), PetscCheckDupsInt(), PetscSortRemoveDupsInt(), PetscSortedRemoveDupsInt()
External Links
- PETSc Manual:
Sys/PetscSortedCheckDupsInt
PETSc.LibPETSc.PetscSortedInt — Method
sorted::PetscBool = PetscSortedInt(petsclib::PetscLibType, n::PetscCount, X::Vector{PetscInt})Determines whether the PetscInt array is sorted.
Not Collective
Input Parameters:
n- number of valuesX- array ofPetscInt
Output Parameter:
sorted- flag whether the array is sorted
Level: intermediate
See also: PetscSortInt(), PetscSortedMPIInt(), PetscSortedReal()
External Links
- PETSc Manual:
Sys/PetscSortedInt
PETSc.LibPETSc.PetscSortedInt64 — Method
sorted::PetscBool = PetscSortedInt64(petsclib::PetscLibType, n::PetscCount, X::Vector{PetscInt64})Determines whether the PetscInt64 array is sorted.
Not Collective
Input Parameters:
n- number of valuesX- array ofPetscInt64
Output Parameter:
sorted- flag whether the array is sorted
Level: intermediate
See also: PetscSortInt64(), PetscSortInt(), PetscSortedMPIInt(), PetscSortedReal()
External Links
- PETSc Manual:
Sys/PetscSortedInt64
PETSc.LibPETSc.PetscSortedMPIInt — Method
sorted::PetscBool = PetscSortedMPIInt(petsclib::PetscLibType, n::PetscCount, X::Vector{PetscMPIInt})Determines whether the PetscMPIInt array is sorted.
Not Collective
Input Parameters:
n- number of valuesX- array ofPetscMPIInt
Output Parameter:
sorted- flag whether the array is sorted
Level: intermediate
See also: PetscMPIIntSortSemiOrdered(), PetscSortMPIInt(), PetscSortedInt(), PetscSortedReal()
External Links
- PETSc Manual:
Sys/PetscSortedMPIInt
PETSc.LibPETSc.PetscSortedReal — Method
sorted::PetscBool = PetscSortedReal(petsclib::PetscLibType, n::PetscCount, X::Vector{PetscReal})Determines whether the array of PetscReal is sorted.
Not Collective
Input Parameters:
n- number of valuesX- array of integers
Output Parameter:
sorted- flag whether the array is sorted
Level: intermediate
See also: PetscSortReal(), PetscSortedInt(), PetscSortedMPIInt()
External Links
- PETSc Manual:
Sys/PetscSortedReal
PETSc.LibPETSc.PetscSortedRemoveDupsInt — Method
n::PetscInt = PetscSortedRemoveDupsInt(petsclib::PetscLibType, n::PetscInt, X::Vector{PetscInt})Removes all duplicate entries of a sorted PetscInt array
Not Collective
Input Parameters:
n- number of valuesX- sorted array ofPetscInt
Output Parameter:
n- number of non-redundant values
Level: intermediate
See also: PetscSortInt()
External Links
- PETSc Manual:
Sys/PetscSortedRemoveDupsInt
PETSc.LibPETSc.PetscSplitOwnership — Method
n::PetscInt,M_N::PetscInt = PetscSplitOwnership(petsclib::PetscLibType, comm::MPI_Comm, n::PetscInt, M_N::PetscInt)Given a global (or local) length determines a local (or global) length via a simple formula
Collective (if n or N is PETSC_DECIDE or PETSC_DETERMINE)
Input Parameters:
comm- MPI communicator that shares the object being dividedn- local length (orPETSC_DECIDEto have it set)N- global length (orPETSC_DETERMINEto have it set)
Level: developer
See also: PetscSplitOwnershipBlock(), PetscSplitOwnershipEqual(), PETSC_DECIDE, PETSC_DETERMINE
External Links
- PETSc Manual:
Sys/PetscSplitOwnership
PETSc.LibPETSc.PetscSplitOwnershipBlock — Method
n::PetscInt,M_N::PetscInt = PetscSplitOwnershipBlock(petsclib::PetscLibType, comm::MPI_Comm, bs::PetscInt, n::PetscInt, M_N::PetscInt)Given a global (or local) length determines a local (or global) length via a simple formula. Splits so each processors local size is divisible by the block size.
Collective (if N is PETSC_DECIDE)
Input Parameters:
comm- MPI communicator that shares the object being dividedbs- block sizen- local length (orPETSC_DECIDEto have it set)N- global length (orPETSC_DECIDE)
Level: developer
See also: PetscSplitOwnership(), PetscSplitOwnershipEqual()
External Links
- PETSc Manual:
Sys/PetscSplitOwnershipBlock
PETSc.LibPETSc.PetscSplitOwnershipEqual — Method
n::PetscInt,M_N::PetscInt = PetscSplitOwnershipEqual(petsclib::PetscLibType, comm::MPI_Comm, n::PetscInt, M_N::PetscInt)Given a global (or local) length determines a local (or global) length via a simple formula, trying to have all local lengths equal
Collective (if n or N is PETSC_DECIDE)
Input Parameters:
comm- MPI communicator that shares the object being dividedn- local length (orPETSC_DECIDEto have it set)N- global length (orPETSC_DECIDE)
Level: developer
See also: PetscSplitOwnership(), PetscSplitOwnershipBlock()
External Links
- PETSc Manual:
Sys/PetscSplitOwnershipEqual
PETSc.LibPETSc.PetscStartMatlab — Method
fp::Ptr{Libc.FILE} = PetscStartMatlab(petsclib::PetscLibType, comm::MPI_Comm, machine::String, script::String)starts up MATLAB with a MATLAB script
Logically Collective, but only MPI rank 0 in the communicator does anything
Input Parameters:
comm- MPI communicatormachine- optional machine to run MATLAB onscript- name of script (without the .m)
Output Parameter:
fp- a file pointer returned fromPetscPOpen()
Level: intermediate
See also: PetscPOpen(), PetscPClose(), PetscMatlabEngine
External Links
- PETSc Manual:
Sys/PetscStartMatlab
PETSc.LibPETSc.PetscStopForDebugger — Method
PetscStopForDebugger(petsclib::PetscLibType)Prints a message to the screen indicating how to attach to the process with the debugger and then waits for the debugger to attach.
Not Collective, No Fortran Support
Options Database Key:
-stop_for_debugger- will stop for you to attach the debugger whenPetscInitialize()is called
Level: developer
See also: PetscSetDebugger(), PetscAttachDebugger()
External Links
- PETSc Manual:
Sys/PetscStopForDebugger
PETSc.LibPETSc.PetscStrArrayDestroy — Method
list::String = PetscStrArrayDestroy(petsclib::PetscLibType)Frees array of strings created with PetscStrArrayallocpy().
Not Collective; No Fortran Support
Output Parameter:
list- array of strings
Level: intermediate
See also: PetscStrArrayallocpy()
External Links
- PETSc Manual:
Sys/PetscStrArrayDestroy
PETSc.LibPETSc.PetscStrArrayallocpy — Method
t::String = PetscStrArrayallocpy(petsclib::PetscLibType, list::Cchar)Allocates space to hold a copy of an array of strings then copies the strings
Not Collective; No Fortran Support
Input Parameter:
list- pointer to array of strings (final string is aNULL)
Output Parameter:
t- the copied array string
Level: intermediate
See also: PetscStrallocpy(), PetscStrArrayDestroy(), PetscStrNArrayallocpy()
External Links
- PETSc Manual:
Sys/PetscStrArrayallocpy
PETSc.LibPETSc.PetscStrInList — Method
found::PetscBool = PetscStrInList(petsclib::PetscLibType, str::String, list::String, sep::Cchar)search for a string in character-delimited list
Not Collective; No Fortran Support
Input Parameters:
str- the string to look forlist- the list to search insep- the separator character
Output Parameter:
found- whetherstris inlist
Level: intermediate
See also: PetscTokenCreate(), PetscTokenFind(), PetscStrcmp()
External Links
- PETSc Manual:
Sys/PetscStrInList
PETSc.LibPETSc.PetscStrNArrayDestroy — Method
list::String = PetscStrNArrayDestroy(petsclib::PetscLibType, n::PetscInt)Frees array of strings created with PetscStrNArrayallocpy().
Not Collective; No Fortran Support
Output Parameters:
n- number of string entrieslist- array of strings
Level: intermediate
See also: PetscStrNArrayallocpy(), PetscStrArrayallocpy()
External Links
- PETSc Manual:
Sys/PetscStrNArrayDestroy
PETSc.LibPETSc.PetscStrNArrayallocpy — Method
t::String = PetscStrNArrayallocpy(petsclib::PetscLibType, n::PetscInt, list::Cchar)Allocates space to hold a copy of an array of strings then copies the strings
Not Collective; No Fortran Support
Input Parameters:
n- the number of string entrieslist- pointer to array of strings
Output Parameter:
t- the copied array string
Level: intermediate
See also: PetscStrallocpy(), PetscStrArrayallocpy(), PetscStrNArrayDestroy()
External Links
- PETSc Manual:
Sys/PetscStrNArrayallocpy
PETSc.LibPETSc.PetscStrToArray — Method
argc::Cint,args::String = PetscStrToArray(petsclib::PetscLibType, s::String, sp::Cchar)Separates a string by a character (for example ' ' or '\n') and creates an array of strings
Not Collective; No Fortran Support
Input Parameters:
s- pointer to stringsp- separator character
Output Parameters:
argc- the number of entries inargsargs- an array of the entries with aNULLat the end
Level: intermediate
See also: PetscStrToArrayDestroy(), PetscToken, PetscTokenCreate()
External Links
- PETSc Manual:
Sys/PetscStrToArray
PETSc.LibPETSc.PetscStrToArrayDestroy — Method
args::String = PetscStrToArrayDestroy(petsclib::PetscLibType, argc::Cint)Frees array created with PetscStrToArray().
Not Collective; No Fortran Support
Output Parameters:
argc- the number of argumentsargs- the array of arguments
Level: intermediate
See also: PetscStrToArray()
External Links
- PETSc Manual:
Sys/PetscStrToArrayDestroy
PETSc.LibPETSc.PetscStrcasecmp — Method
t::PetscBool = PetscStrcasecmp(petsclib::PetscLibType, a::String, b::String)Returns true if the two strings are the same except possibly for case.
Not Collective; No Fortran Support
Input Parameters:
a- pointer to first stringb- pointer to second string
Output Parameter:
t- if the two strings are the same
Level: intermediate
See also: PetscStrcmp(), PetscStrncmp(), PetscStrgrt()
External Links
- PETSc Manual:
Sys/PetscStrcasecmp
PETSc.LibPETSc.PetscStrcat — Method
PetscStrcat(petsclib::PetscLibType, s::String, t::String)Concatenates a string onto a given string
Not Collective, No Fortran Support
Input Parameters:
s- string to be added tot- pointer to string to be added to end
Level: deprecated (since 3.18.5)
See also: PetscStrlcat()
External Links
- PETSc Manual:
Sys/PetscStrcat
PETSc.LibPETSc.PetscStrcpy — Method
PetscStrcpy(petsclib::PetscLibType, s::String, t::String)Copies a string
Not Collective, No Fortran Support
Input Parameter:
t- pointer to string
Output Parameter:
s- the copied string
Level: deprecated (since 3.18.5)
See also: PetscStrncpy()
External Links
- PETSc Manual:
Sys/PetscStrcpy
PETSc.LibPETSc.PetscStrendswithwhich — Method
cnt::PetscInt = PetscStrendswithwhich(petsclib::PetscLibType, a::String, bs::Cchar)Determines if a string ends with one of several possible strings
Not Collective; No Fortran Support
Input Parameters:
a- pointer to stringbs- strings to end with (last entry must beNULL)
Output Parameter:
cnt- the index of the string it ends with or the index ofNULL
Level: intermediate
See also: PetscStrbeginswithwhich(), PetscStrendswith(), PetscStrtoupper, PetscStrtolower(), PetscStrrchr(), PetscStrchr(), PetscStrncmp(), PetscStrlen(), PetscStrcmp()
External Links
- PETSc Manual:
Sys/PetscStrendswithwhich
PETSc.LibPETSc.PetscStrreplace — Method
PetscStrreplace(petsclib::PetscLibType, comm::MPI_Comm, aa::String, b::String, len::Csize_t)Replaces substrings in string with other substrings
Not Collective; No Fortran Support
Input Parameters:
comm-MPI_Commof processors that are processing the stringaa- the string to look inb- the resulting copy of a with replaced strings (bcan be the same asa)len- the length ofb
Level: developer
See also: PetscStrcmp()
External Links
- PETSc Manual:
Sys/PetscStrreplace
PETSc.LibPETSc.PetscSynchronizedFGets — Method
PetscSynchronizedFGets(petsclib::PetscLibType, comm::MPI_Comm, fp::Libc.FILE, len::Csize_t, string::String)Multiple MPI processes all get the same line from a file.
Collective
Input Parameters:
comm- the MPI communicatorfp- the file pointerlen- the length ofstring
Output Parameter:
string- the line read from the file, at end of filestring[0] == 0
Level: intermediate
See also: PetscSynchronizedPrintf(), PetscSynchronizedFlush(), PetscFOpen(), PetscViewerASCIISynchronizedPrintf(), PetscViewerASCIIPrintf()
External Links
- PETSc Manual:
Sys/PetscSynchronizedFGets
PETSc.LibPETSc.PetscSynchronizedFlush — Method
PetscSynchronizedFlush(petsclib::PetscLibType, comm::MPI_Comm, fd::Libc.FILE)Flushes to the screen output from all processors involved in previous PetscSynchronizedPrintf()/PetscSynchronizedFPrintf() calls.
Collective
Input Parameters:
comm- the MPI communicatorfd- the file pointer (valid on MPI rank 0 of the communicator),PETSC_STDOUTor value obtained fromPetscFOpen()
Level: intermediate
See also: PetscSynchronizedPrintf(), PetscFPrintf(), PetscPrintf(), PetscViewerASCIIPrintf(), PetscViewerASCIISynchronizedPrintf()
External Links
- PETSc Manual:
Sys/PetscSynchronizedFlush
PETSc.LibPETSc.PetscSysFinalizePackage — Method
PetscSysFinalizePackage(petsclib::PetscLibType)This function destroys everything in the system library portion of PETSc. It is called from PetscFinalize().
Level: developer
See also: PetscSysInitializePackage(), PetscFinalize()
External Links
- PETSc Manual:
Viewer/PetscSysFinalizePackage
PETSc.LibPETSc.PetscSysInitializePackage — Method
PetscSysInitializePackage(petsclib::PetscLibType)This function initializes everything in the system library portion of PETSc. It is called from PetscDLLibraryRegister_petsc() when using dynamic libraries, and in the call to PetscInitialize() when using shared or static libraries.
Level: developer
See also: PetscSysFinalizePackage(), PetscInitialize()
External Links
- PETSc Manual:
Viewer/PetscSysInitializePackage
PETSc.LibPETSc.PetscTestDirectory — Method
flg::PetscBool = PetscTestDirectory(petsclib::PetscLibType, dirname::String, mode::Cchar)checks for the existence of a directory
Not Collective
Input Parameters:
dirname- the directory namemode- either 'r', 'w', or 'x'
Output Parameter:
flg- the directory exists and satisfies the mode
Level: intermediate
See also: PetscTestFile(), PetscLs(), PetscRMTree()
External Links
- PETSc Manual:
Sys/PetscTestDirectory
PETSc.LibPETSc.PetscTestFile — Method
flg::PetscBool = PetscTestFile(petsclib::PetscLibType, fname::String, mode::Cchar)checks for the existence of a file
Not Collective
Input Parameters:
fname- the filenamemode- either 'r', 'w', 'x' or '\0'
Output Parameter:
flg- the file exists and satisfies the mode
Level: intermediate
See also: PetscTestDirectory(), PetscLs()
External Links
- PETSc Manual:
Sys/PetscTestFile
PETSc.LibPETSc.PetscTimSort — Method
arr::Ptr{Cvoid} = PetscTimSort(petsclib::PetscLibType, n::PetscInt, size::Csize_t, cmp::external, ctx::Ptr{Cvoid})Sorts an array in place in increasing order using Tim Peters https://bugs.python.org/file4451/timsort.txt adaptive sorting algorithm.
Not Collective, No Fortran Support
Input Parameters:
n- number of valuesarr- array to be sortedsize- size in bytes of the datatype held in arrcmp- function pointer to comparison functionctx- optional context to be passed to comparison function, NULL if not needed
Output Parameter:
arr- sorted array
Level: developer
See also: PetscTimSortWithArray(), PetscIntSortSemiOrdered(), PetscRealSortSemiOrdered(), PetscMPIIntSortSemiOrdered()
External Links
- PETSc Manual:
Sys/PetscTimSort
PETSc.LibPETSc.PetscTimSortWithArray — Method
PetscTimSortWithArray(petsclib::PetscLibType, n::PetscInt, arr::Ptr{Cvoid}, asize::Csize_t, barr::Ptr{Cvoid}, bsize::Csize_t, cmp::external, ctx::Ptr{Cvoid})Sorts an array in place in increasing order using Tim Peters https://bugs.python.org/file4451/timsort.txt adaptive sorting algorithm and reorders a second array to match the first. The arrays need not be the same type.
Not Collective, No Fortran Support
Input Parameters:
n- number of valuesasize- size in bytes of the datatype held in arrbsize- size in bytes of the datatype held in barrcmp- function pointer to comparison functionctx- optional context to be passed to comparison function, NULL if not needed
Input/Output Parameters:
arr- array to be sorted, on output it is sortedbarr- array to be reordered, on output it is reordered
Level: developer
See also: PetscTimSort(), PetscIntSortSemiOrderedWithArray(), PetscRealSortSemiOrderedWithArrayInt(), PetscMPIIntSortSemiOrderedWithArray()
External Links
- PETSc Manual:
Sys/PetscTimSortWithArray
PETSc.LibPETSc.PetscTraceBackErrorHandler — Method
PetscTraceBackErrorHandler(petsclib::PetscLibType, comm::MPI_Comm, line::Cint, fun::String, file::String, n::PetscErrorCode, p::PetscErrorType, mess::String, ctx::Ptr{Cvoid})Default error handler routine that generates a traceback on error detection.
Not Collective, No Fortran Support
Input Parameters:
comm- communicator over which error occurredline- the line number of the error (usually indicated by__LINE__in the calling routine)fun- the function namefile- the file in which the error was detected (usually indicated by__FILE__in the calling routine)mess- an error text string, usually just printed to the screenn- the generic error numberp-PETSC_ERROR_INITIALif this is the first call the error handler, otherwisePETSC_ERROR_REPEATctx- error handler context
Options Database Keys:
-error_output_stdout- output the error messages tostdoutinstead of the defaultstderr-error_output_none- do not output the error messages
See also: PetscError(), PetscPushErrorHandler(), PetscPopErrorHandler(), PetscAttachDebuggerErrorHandler(), PetscAbortErrorHandler(), PetscMPIAbortErrorHandler(), PetscReturnErrorHandler(), PetscEmacsClientErrorHandler(), PETSC_ERROR_INITIAL, PETSC_ERROR_REPEAT, PetscErrorCode, PetscErrorType
External Links
- PETSc Manual:
Sys/PetscTraceBackErrorHandler
PETSc.LibPETSc.PetscWaitOnError — Method
PetscWaitOnError(petsclib::PetscLibType)If an error is detected and the process would normally exit the main program with MPI_Abort() sleep instead of exiting.
Not Collective
Level: advanced
See also: PetscSetDebugger(), PetscAttachDebugger()
External Links
- PETSc Manual:
Sys/PetscWaitOnError