PetscObject, Logging and Devices - Low-level Interface

  • PetscObject: operations shared by every PETSc object (names, options prefixes, reference counting, composed objects, PetscObjectGetComm). Any Julia handle (PetscVec, PetscMat, KSP, ...) is accepted where a PetscObject is expected.
  • PetscLog: performance logging with stages and events (-log_view).
  • PetscDevice: GPU device and stream management (PetscDeviceContext).
  • PetscContainer, PetscFunctionList, PetscDLLibrary: attaching user data to objects, registering implementations and loading shared libraries.

Basic Usage

using PETSc, MPI
MPI.Init()
petsclib = PETSc.getlib()
PETSc.initialize(petsclib)

v = LibPETSc.VecCreate(petsclib, MPI.COMM_SELF)
LibPETSc.PetscObjectSetName(petsclib, v, "rhs")
name = LibPETSc.PetscObjectGetName(petsclib, v)           # "rhs"
cls  = LibPETSc.PetscObjectGetClassName(petsclib, v)      # "Vec"
comm = LibPETSc.PetscObjectGetComm(petsclib, v)           # an MPI.Comm

# Logging: register a stage and an event, then view the summary at the end
LibPETSc.PetscLogDefaultBegin(petsclib)
stage = LibPETSc.PetscLogStageRegister(petsclib, "Assembly")
classid = LibPETSc.PetscClassIdRegister(petsclib, "MyApp")
event = LibPETSc.PetscLogEventRegister(petsclib, "MyAssembly", classid)
LibPETSc.PetscLogStagePush(petsclib, stage)
# ... work ...
LibPETSc.PetscLogStagePop(petsclib)
LibPETSc.PetscLogView(petsclib, LibPETSc.PETSC_VIEWER_STDOUT_WORLD(petsclib))

LibPETSc.VecDestroy(petsclib, v)
PETSc.finalize(petsclib)

PetscLogEventBegin/PetscLogEventEnd are C macros and have no wrapper; time your own code with stages, or pass -log_view on the command line to get PETSc's own event timings.

Function Reference

PetscObject

PETSc.LibPETSc.PetscObjectAddOptionsHandler — Method
PetscObjectAddOptionsHandler(petsclib::PetscLibType, obj, handle::external, destroy::external, ctx::Ptr{Cvoid})

Adds an additional function to check for options when XXXSetFromOptions() is called.

Not Collective

Input Parameters:

  • obj - the PETSc object
  • handle - function that checks for options
  • destroy - function to destroy ctx if provided
  • ctx - optional context for check function

Calling sequence of handle:

  • obj - the PETSc object
  • PetscOptionsObject - the PetscOptionItems object
  • ctx - optional context for handle

Calling sequence of destroy:

  • obj - the PETSc object
  • ctx - optional context for handle

Level: developer

See also: KSPSetFromOptions(), PCSetFromOptions(), SNESSetFromOptions(), PetscObjectProcessOptionsHandlers(), PetscObjectDestroyOptionsHandlers(), PetscObject

External Links

source
PETSc.LibPETSc.PetscObjectAppendOptionsPrefix — Method
PetscObjectAppendOptionsPrefix(petsclib::PetscLibType, obj, prefix::String)

Appends to the prefix used for searching for options for the given object in the database.

Input Parameters:

  • obj - any PETSc object, for example a Vec, Mat or KSP.
  • prefix - the prefix string to prepend to option requests of the object.

Level: advanced

See also: PetscOptionsCreate(), PetscOptionsDestroy(), PetscObjectSetOptionsPrefix(), PetscObjectPrependOptionsPrefix(), PetscObjectGetOptionsPrefix(), TSAppendOptionsPrefix(), SNESAppendOptionsPrefix(), KSPAppendOptionsPrefix()

External Links

source
PETSc.LibPETSc.PetscObjectBaseTypeCompare — Method
same::PetscBool = PetscObjectBaseTypeCompare(petsclib::PetscLibType, obj, type_name::String)

Determines whether a PetscObject is of a given base type. For example the base type of MATSEQAIJPERM is MATSEQAIJ

Not Collective

Input Parameters:

  • obj - the object
  • type_name - string containing a type name

Output Parameter:

  • same - PETSC_TRUE if the object is of the same base type identified by type_name or both NULL, PETSC_FALSE otherwise

Level: intermediate

See also: PetscObject, PetscObjectTypeCompare(), PetscObjectTypeCompareAny(), PetscObjectBaseTypeCompareAny()

External Links

source
PETSc.LibPETSc.PetscObjectChangeTypeName — Method
PetscObjectChangeTypeName(petsclib::PetscLibType, obj, type_name::String)

Changes the type name stored on a PetscObject

Logically collective

Input Parameters:

  • obj - the PetscObject
  • type_name - the new type name

Level: developer

See also: PetscObject, PetscObjectGetType(), PetscObjectSetName()

External Links

source
PETSc.LibPETSc.PetscObjectCompareId — Method
eq::PetscBool = PetscObjectCompareId(petsclib::PetscLibType, obj, id::PetscObjectId)

compares the objects ID with a given id

Not Collective

Input Parameters:

  • obj - object
  • id - integer ID

Output Parameter:

  • eq - the ids are equal

Level: developer

See also: PetscObjectStateGet(), PetscObjectGetId()

External Links

source
PETSc.LibPETSc.PetscObjectCompose — Method
PetscObjectCompose(petsclib::PetscLibType, obj, name::String, ptr)

Associates another PETSc object with a given PETSc object.

Not Collective

Input Parameters:

  • obj - the PETSc object; this must be cast with (PetscObject), for example,

PetscObjectCompose((PetscObject)mat,...);

  • name - name associated with the child object
  • ptr - the other PETSc object to associate with the PETSc object; this must also be

cast with (PetscObject)

Level: advanced

See also: PetscObjectQuery(), PetscContainerCreate(), PetscObjectComposeFunction(), PetscObjectQueryFunction(), PetscContainer, PetscContainerSetPointer(), PetscObject, PetscObjectContainerCompose()

External Links

source
PETSc.LibPETSc.PetscObjectContainerCompose — Method
PetscObjectContainerCompose(petsclib::PetscLibType, obj, name::String, pointer::Ptr{Cvoid}, destroy::Ptr{Cvoid})

Creates a PetscContainer, provides all of its values and composes it with a PetscObject

Collective

Input Parameters:

  • obj - the PetscObject
  • name - the name for the composed container
  • pointer - the pointer to the data
  • destroy - the routine to destroy the container's data, see PetscCtxDestroyFn for its calling sequence; use PetscCtxDestroyDefault() if a PetscFree() frees the data

Level: advanced

See also: PetscContainerCreate(), PetscContainerDestroy(), PetscContainerSetPointer(), PetscContainerGetPointer(), PetscObjectCompose(), PetscObjectQuery(), PetscContainerSetCtxDestroy(), PetscObject, PetscObjectContainerQuery()

External Links

source
PETSc.LibPETSc.PetscObjectContainerQuery — Method
ptr::Ptr{Cvoid} = PetscObjectContainerQuery(petsclib::PetscLibType, obj, name::String)

Accesses the pointer in a container composed to a PetscObject with PetscObjectContainerCompose()

Collective

Input Parameters:

  • obj - the PetscObject
  • name - the name for the composed container

Output Parameter:

  • ptr - the pointer to the data

Level: advanced

See also: PetscContainerCreate(), PetscContainerDestroy(), PetscContainerSetPointer(), PetscContainerGetPointer(), PetscObjectCompose(), PetscObjectQuery(), PetscContainerSetCtxDestroy(), PetscObject, PetscObjectContainerCompose()

External Links

source
PETSc.LibPETSc.PetscObjectDereference — Method
PetscObjectDereference(petsclib::PetscLibType, obj)

Indicates to any PetscObject that it is being referenced by one less PetscObject. This decreases the reference count for that object by one.

Collective on obj if reference reaches 0 otherwise Logically Collective

Input Parameter:

  • obj - the PETSc object; this must be cast with (PetscObject), for example,

PetscObjectDereference((PetscObject)mat);

Level: advanced

See also: PetscObjectCompose(), PetscObjectReference(), PetscObjectDestroy(), PetscObject

External Links

source
PETSc.LibPETSc.PetscObjectDestroy — Method
PetscObjectDestroy(petsclib::PetscLibType, obj::Union{PetscObject, Ref{PetscObject}})

Destroys a PetscObject, regardless of the class.

Collective

Input Parameter:

  • obj - any PETSc object, for example a Vec, Mat or KSP. It must be cast with a (PetscObject*), for example,

PetscObjectDestroy((PetscObject*)&mat);

Level: beginner

See also: PetscObject

External Links

source
PETSc.LibPETSc.PetscObjectDestroyOptionsHandlers — Method
PetscObjectDestroyOptionsHandlers(petsclib::PetscLibType, obj)

Destroys all the option handlers attached to an object

Not Collective

Input Parameter:

  • obj - the PETSc object

Level: developer

See also: KSPSetFromOptions(), PCSetFromOptions(), SNESSetFromOptions(), PetscObjectAddOptionsHandler(), PetscObjectProcessOptionsHandlers(), PetscObject

External Links

source
PETSc.LibPETSc.PetscObjectGetClassId — Method
classid::PetscClassId = PetscObjectGetClassId(petsclib::PetscLibType, obj)

Gets the classid for any PetscObject

Not Collective

Input Parameter:

  • obj - any PETSc object, for example a Vec, Mat or KSP. It must be cast with a (PetscObject), for example,

PetscObjectGetClassId((PetscObject)mat,&classid);

Output Parameter:

  • classid - the classid

Level: developer

See also: PetscObject, PetscClassId, PetscObjectGetClassName(), PetscObjectGetType()

External Links

source
PETSc.LibPETSc.PetscObjectGetClassName — Method
classname::String = PetscObjectGetClassName(petsclib::PetscLibType, obj)

Gets the class name for any PetscObject

Not Collective

Input Parameter:

  • obj - any PETSc object, for example a Vec, Mat or KSP. It must be cast with a (PetscObject), for example,

PetscObjectGetClassName((PetscObject)mat,&classname);

Output Parameter:

  • classname - the class name, for example "Vec"

Level: developer

See also: PetscObject, PetscClassId, PetscObjectGetType(), PetscObjectGetClassId()

External Links

source
PETSc.LibPETSc.PetscObjectGetComm — Method
comm::MPI_Comm = PetscObjectGetComm(petsclib::PetscLibType, obj)

Gets the MPI communicator for any PetscObject regardless of the type.

Not Collective

Input Parameter:

  • obj - any PETSc object, for example a Vec, Mat or KSP. It must be cast with a (PetscObject), for example,

PetscObjectGetComm((PetscObject)mat,&comm);

Output Parameter:

  • comm - the MPI communicator

Level: advanced

See also: PetscObject, PetscObjectComm()

External Links

source
PETSc.LibPETSc.PetscObjectGetId — Method
id::PetscObjectId = PetscObjectGetId(petsclib::PetscLibType, obj)

get a unique object ID for the PetscObject

Not Collective

Input Parameter:

  • obj - object

Output Parameter:

  • id - integer ID

Level: developer

See also: PetscObjectStateGet(), PetscObjectCompareId()

External Links

source
PETSc.LibPETSc.PetscObjectGetName — Method
name::String = PetscObjectGetName(petsclib::PetscLibType, obj)

Gets a string name associated with a PETSc object.

Not Collective unless obj has not yet been named

Input Parameters:

  • obj - the PETSc variable. It must be cast with a (PetscObject), for example,

PetscObjectGetName((PetscObject)mat,&name);

  • name - the name associated with obj, do not free

Level: intermediate

See also: PetscObjectSetName(), PetscObjectName(), PetscObject, PetscObjectGetId()

External Links

source
PETSc.LibPETSc.PetscObjectGetNewTag — Method
tag::PetscMPIInt = PetscObjectGetNewTag(petsclib::PetscLibType, obj)

Gets a unique new tag from a PETSc object. All processors that share the object MUST call this routine EXACTLY the same number of times. This tag should only be used with the current objects communicator; do NOT use it with any other MPI communicator.

Collective

Input Parameter:

  • obj - the PETSc object; this must be cast with a (PetscObject), for example,

PetscObjectGetNewTag((PetscObject)mat,&tag);

Output Parameter:

  • tag - the new tag

Level: developer

See also: PetscCommGetNewTag()

External Links

source
PETSc.LibPETSc.PetscObjectGetOptions — Method
options::PetscOptions = PetscObjectGetOptions(petsclib::PetscLibType, obj)

Gets the options database used by the object that has been set with PetscObjectSetOptions()

Collective

Input Parameter:

  • obj - any PETSc object, for example a Vec, Mat or KSP.

Output Parameter:

  • options - the options database

Level: advanced

See also: PetscOptionsCreate(), PetscOptionsDestroy(), PetscObjectSetOptionsPrefix(), PetscObjectAppendOptionsPrefix(), PetscObjectPrependOptionsPrefix(), PetscObjectGetOptionsPrefix(), PetscObjectSetOptions()

External Links

source
PETSc.LibPETSc.PetscObjectGetOptionsPrefix — Method
prefix::String = PetscObjectGetOptionsPrefix(petsclib::PetscLibType, obj)

Gets the prefix of the PetscObject used for searching in the options database

Input Parameter:

  • obj - any PETSc object, for example a Vec, Mat or KSP.

Output Parameter:

  • prefix - pointer to the prefix string used is returned

Level: advanced

See also: PetscOptionsCreate(), PetscOptionsDestroy(), PetscObjectSetOptionsPrefix(), PetscObjectAppendOptionsPrefix(), PetscObjectPrependOptionsPrefix(), TSGetOptionsPrefix(), SNESGetOptionsPrefix(), KSPGetOptionsPrefix()

External Links

source
PETSc.LibPETSc.PetscObjectGetReference — Method
cnt::PetscInt = PetscObjectGetReference(petsclib::PetscLibType, obj)

Gets the current reference count for a PETSc object.

Not Collective

Input Parameter:

  • obj - the PETSc object; this must be cast with (PetscObject), for example,

PetscObjectGetReference((PetscObject)mat,&cnt); obj cannot be NULL

Output Parameter:

  • cnt - the reference count

Level: advanced

See also: PetscObjectCompose(), PetscObjectDereference(), PetscObjectReference(), PetscObject

External Links

source
PETSc.LibPETSc.PetscObjectGetTabLevel — Method
tab::PetscInt = PetscObjectGetTabLevel(petsclib::PetscLibType, obj)

Gets the number of tabs that PETSCVIEWERASCII output for that object uses

Not Collective

Input Parameter:

  • obj - any PETSc object, for example a Vec, Mat or KSP. It must be cast with a (PetscObject), for example,

PetscObjectGetTabLevel((PetscObject)mat,&tab);

Output Parameter:

  • tab - the number of tabs

Level: developer

See also: PetscObjectIncrementTabLevel(), PetscObjectSetTabLevel(), PETSCVIEWERASCII, PetscObject

External Links

source
PETSc.LibPETSc.PetscObjectGetType — Method
type::String = PetscObjectGetType(petsclib::PetscLibType, obj)

Gets the object type of any PetscObject.

Not Collective

Input Parameter:

  • obj - any PETSc object, for example a Vec, Mat or KSP. It must be cast with a (PetscObject), for example,

PetscObjectGetType((PetscObject)mat,&type);

Output Parameter:

  • type - the object type, for example, MATSEQAIJ

Level: advanced

See also: PetscObject, PetscClassId, PetscObjectGetClassName(), PetscObjectGetClassId()

External Links

source
PETSc.LibPETSc.PetscObjectHasFunction — Method
has::PetscBool = PetscObjectHasFunction(petsclib::PetscLibType, obj, name::String)

Query if a function is associated with a given object.

Logically Collective

Input Parameters:

  • obj - the PETSc object
  • name - name associated with the child function

Output Parameter:

  • has - the boolean value

Level: advanced

See also: PetscObject, PetscObjectComposeFunction(), PetscObjectQueryFunction()

External Links

source
PETSc.LibPETSc.PetscObjectIncrementTabLevel — Method
PetscObjectIncrementTabLevel(petsclib::PetscLibType, obj, oldobj, tab::PetscInt)

Increments the number of tabs that PETSCVIEWERASCII output for that object use based on the tablevel of another object. This should be called immediately after the object is created.

Not Collective

Input Parameters:

  • obj - any PETSc object where we are changing the tab
  • oldobj - the object providing the tab, optional pass NULL to use 0 as the previous tablevel for obj
  • tab - the increment that is added to the old objects tab

Level: developer

See also: PETSCVIEWERASCII, PetscObjectSetTabLevel(), PetscObjectGetTabLevel()

External Links

source
PETSc.LibPETSc.PetscObjectInheritPrintedOptions — Method
PetscObjectInheritPrintedOptions(petsclib::PetscLibType, pobj, obj)

If the child object is not on the MPI rank 0 process of the parent object and the child is sequential then the child gets it set.

Input Parameters:

  • pobj - the parent object
  • obj - the PetscObject

Level: developer

See also: PetscOptionsInsert(), PetscObjectSetPrintedOptions(), PetscObject

External Links

source
PETSc.LibPETSc.PetscObjectName — Method
PetscObjectName(petsclib::PetscLibType, obj)

Gives obj a name if it does not have one

Collective

Input Parameter:

  • obj - the PETSc object. It must be cast with a (PetscObject), for example, PetscObjectName((PetscObject)mat,name);

Level: developer

See also: PetscObjectGetName(), PetscObjectSetName()

External Links

source
PETSc.LibPETSc.PetscObjectObjectTypeCompare — Method
same::PetscBool = PetscObjectObjectTypeCompare(petsclib::PetscLibType, obj1, obj2)

Determines whether two PETSc objects are of the same type

Logically Collective

Input Parameters:

  • obj1 - any PETSc object, for example a Vec, Mat or KSP.
  • obj2 - another PETSc object

Output Parameter:

  • same - PETSC_TRUE if they are the same or both unset, else PETSC_FALSE

Level: intermediate

See also: PetscObjectTypeCompare(), VecGetType(), KSPGetType(), PCGetType(), SNESGetType(), PetscObjectBaseTypeCompare(), PetscObjectTypeCompareAny(), PetscObjectBaseTypeCompareAny()

External Links

source
PETSc.LibPETSc.PetscObjectPrependOptionsPrefix — Method
PetscObjectPrependOptionsPrefix(petsclib::PetscLibType, obj, prefix::String)

Sets the prefix used for searching for options of for this object in the database.

Input Parameters:

  • obj - any PETSc object, for example a Vec, Mat or KSP.
  • prefix - the prefix string to prepend to option requests of the object.

Level: advanced

See also: PetscOptionsCreate(), PetscOptionsDestroy(), PetscObjectSetOptionsPrefix(), PetscObjectAppendOptionsPrefix(), PetscObjectGetOptionsPrefix()

External Links

source
PETSc.LibPETSc.PetscObjectPrintClassNamePrefixType — Method
PetscObjectPrintClassNamePrefixType(petsclib::PetscLibType, obj, viewer::PetscViewer)

used in the XXXView() methods to display information about the class, name, prefix and type of an object

Input Parameters:

  • obj - the PETSc object
  • viewer - PETSCVIEWERASCII viewer where the information is printed, function does nothing if the viewer is not PETSCVIEWERASCII type

Level: developer

See also: PetscObjectSetName(), PetscObjectName()

External Links

source
PETSc.LibPETSc.PetscObjectProcessOptionsHandlers — Method
PetscObjectProcessOptionsHandlers(petsclib::PetscLibType, obj, PetscOptionsObject::PetscOptionItems)

Calls all the options handlers attached to an object

Not Collective

Input Parameters:

  • obj - the PETSc object
  • PetscOptionsObject - the options context

Level: developer

See also: KSPSetFromOptions(), PCSetFromOptions(), SNESSetFromOptions(), PetscObjectAddOptionsHandler(), PetscObjectDestroyOptionsHandlers(), PetscObject

External Links

source
PETSc.LibPETSc.PetscObjectQuery — Method
PetscObjectQuery(petsclib::PetscLibType, obj, name::String, ptr::PetscObject)

Gets a PETSc object associated with a given object that was composed with PetscObjectCompose()

Not Collective

Input Parameters:

  • obj - the PETSc object. It must be cast with a (PetscObject), for example,

PetscObjectCompose((PetscObject)mat,...);

  • name - name associated with child object
  • ptr - the other PETSc object associated with the PETSc object, this must be

cast with (PetscObject*)

Level: advanced

See also: PetscObjectCompose(), PetscObjectComposeFunction(), PetscObjectQueryFunction(), PetscContainer, PetscContainerGetPointer(), PetscObject

External Links

source
PETSc.LibPETSc.PetscObjectReference — Method
PetscObjectReference(petsclib::PetscLibType, obj)

Indicates to a PetscObject that it is being referenced by another PetscObject. This increases the reference count for that object by one.

Logically Collective

Input Parameter:

  • obj - the PETSc object. This must be cast with (PetscObject), for example, PetscObjectReference((PetscObject)mat);

Level: advanced

See also: PetscObjectCompose(), PetscObjectDereference(), PetscObject

External Links

source
PETSc.LibPETSc.PetscObjectRegisterDestroy — Method
PetscObjectRegisterDestroy(petsclib::PetscLibType, obj)

Registers a PETSc object to be destroyed when PetscFinalize() is called.

Logically Collective

Input Parameter:

  • obj - a PETSc object, for example a Vec, Mat or KSP. It must be cast with a (PetscObject), for example,

PetscObjectRegisterDestroy((PetscObject)mat);

Level: developer

See also: PetscObjectRegisterDestroyAll()

External Links

source
PETSc.LibPETSc.PetscObjectRegisterDestroyAll — Method
PetscObjectRegisterDestroyAll(petsclib::PetscLibType)

Frees all the PETSc objects that have been registered with PetscObjectRegisterDestroy(). Called by PetscFinalize()

Logically Collective on the individual PetscObjects that are being processed

Level: developer

See also: PetscObjectRegisterDestroy()

External Links

source
PETSc.LibPETSc.PetscObjectRemoveReference — Method
PetscObjectRemoveReference(petsclib::PetscLibType, obj, name::String)

Removes a reference link from a PetscObject's object list without dereferencing the referenced object

Logically collective

Input Parameters:

  • obj - the PetscObject whose list will be modified
  • name - the name under which the reference was composed

Level: developer

See also: PetscObject, PetscObjectCompose(), PetscObjectQuery(), PetscObjectReference(), PetscObjectDereference()

External Links

source
PETSc.LibPETSc.PetscObjectSetName — Method
PetscObjectSetName(petsclib::PetscLibType, obj, name::String)

Sets a string name for a PETSc object.

Not Collective

Input Parameters:

  • obj - the PETSc object. It must be cast with a (PetscObject), for example,

PetscObjectSetName((PetscObject)mat,name);

  • name - the name to give obj

Level: advanced

See also: PetscObjectGetName(), PetscObjectName()

External Links

source
PETSc.LibPETSc.PetscObjectSetOptions — Method
PetscObjectSetOptions(petsclib::PetscLibType, obj, options::AbstractPetscOptions)

Sets the options database used by the object. Call immediately after creating the object.

Collective

Input Parameters:

  • obj - any PETSc object, for example a Vec, Mat or KSP.
  • options - the options database, use NULL for default

Level: advanced

See also: PetscOptionsCreate(), PetscOptionsDestroy(), PetscObjectSetOptionsPrefix(), PetscObjectAppendOptionsPrefix(), PetscObjectPrependOptionsPrefix(), PetscObjectGetOptionsPrefix(), PetscObjectGetOptions()

External Links

source
PETSc.LibPETSc.PetscObjectSetOptionsPrefix — Method
PetscObjectSetOptionsPrefix(petsclib::PetscLibType, obj, prefix::String)

Sets the prefix used for searching for all options for the given object in the database.

Collective

Input Parameters:

  • obj - any PETSc object, for example a Vec, Mat or KSP.
  • prefix - the prefix string to prepend to option requests of the object.

Level: advanced

See also: PetscOptionsCreate(), PetscOptionsDestroy(), PetscObjectAppendOptionsPrefix(), PetscObjectPrependOptionsPrefix(), PetscObjectGetOptionsPrefix(), TSSetOptionsPrefix(), SNESSetOptionsPrefix(), KSPSetOptionsPrefix()

External Links

source
PETSc.LibPETSc.PetscObjectSetPrintedOptions — Method
PetscObjectSetPrintedOptions(petsclib::PetscLibType, obj)

indicate to an object that it should behave as if it has already printed the help for its options so it will not display the help message

Input Parameter:

  • obj - the PetscObject

Level: developer

See also: PetscOptionsInsert(), PetscObject

External Links

source
PETSc.LibPETSc.PetscObjectSetTabLevel — Method
PetscObjectSetTabLevel(petsclib::PetscLibType, obj, tab::PetscInt)

Sets the number of tabs that PETSCVIEWERASCII output for that object uses

Not Collective

Input Parameters:

  • obj - any PETSc object, for example a Vec, Mat or KSP. It must be cast with a (PetscObject), for example,

PetscObjectSetTabLevel((PetscObject)mat,tab;

  • tab - the number of tabs

Level: developer

See also: PetscObjectIncrementTabLevel(), PetscObjectGetTabLevel()

External Links

source
PETSc.LibPETSc.PetscObjectSetUp — Method
PetscObjectSetUp(petsclib::PetscLibType, obj)

Sets up the internal data structures for later use of the object

Collective

Input Parameter:

  • obj - the PetscObject

Level: advanced

See also: PetscObjectDestroy(), PetscObject

External Links

source
PETSc.LibPETSc.PetscObjectTypeCompare — Method
same::PetscBool = PetscObjectTypeCompare(petsclib::PetscLibType, obj, type_name::String)

Determines whether a PETSc object is of a particular type.

Not Collective

Input Parameters:

  • obj - a PETSc object, for example a Vec, Mat or KSP. It must be cast with a (PetscObject), for example,

PetscObjectTypeCompare((PetscObject)mat);

  • type_name - string containing a type name

Output Parameter:

  • same - PETSC_TRUE if the type of obj and type_name are the same or both NULL, else PETSC_FALSE

Level: intermediate

See also: PetscObject, VecGetType(), KSPGetType(), PCGetType(), SNESGetType(), PetscObjectBaseTypeCompare(), PetscObjectTypeCompareAny(), PetscObjectBaseTypeCompareAny(), PetscObjectObjectTypeCompare()

External Links

source
PETSc.LibPETSc.PetscObjectView — Method
PetscObjectView(petsclib::PetscLibType, obj, viewer::PetscViewer)

Views, that is displays or stores information about a PetscObject.

Collective

Input Parameters:

  • obj - any PETSc object, for example a Vec, Mat or KSP. It must be cast with a (PetscObject), for example,

PetscObjectView((PetscObject)mat,viewer);

  • viewer - any PETSc viewer

Level: intermediate

See also: PetscObject, PetscObjectViewFromOptions(), PetscViewer

External Links

source
PETSc.LibPETSc.PetscObjectViewFromOptions — Method
PetscObjectViewFromOptions(petsclib::PetscLibType, obj, bobj, name::String)

Processes command line options to determine if/how a PetscObject is to be viewed.

Collective

Input Parameters:

  • obj - the object
  • bobj - optional other object that provides prefix (if NULL then the prefix in obj is used)
  • name - option string that is used to activate viewing. It typically ends with _view.

Options Database Key:

  • -name [viewertype][:...] - option name and values. In actual usage the key might be something like -vec_view

Level: developer

See also: PetscObject, PetscObjectView(), PetscOptionsCreateViewer()

External Links

source
PETSc.LibPETSc.PetscObjectViewSAWs — Method
PetscObjectViewSAWs(petsclib::PetscLibType, obj, viewer::PetscViewer)

View the base portion of any object with an SAWs viewer

Collective

Input Parameters:

  • obj - the PetscObject variable. It must be cast with a (PetscObject), for example, PetscObjectSetName((PetscObject)mat,name);
  • viewer - the SAWs viewer

Level: advanced

See also: PetscViewer, PetscObject, PetscObjectSetName()

External Links

source
PETSc.LibPETSc.PetscObjectsDump — Method
PetscObjectsDump(petsclib::PetscLibType, fd::Libc.FILE, all::PetscBool)

Prints all the currently existing objects.

Input Parameters:

  • fd - file pointer
  • all - by default only tries to display objects created explicitly by the user, if all is PETSC_TRUE then lists all outstanding objects

Options Database Key:

  • -objects_dump all - print information about all the objects that exist at the end of the programs run

Level: advanced

See also: PetscObject

External Links

source
PETSc.LibPETSc.PetscObjectsGetObject — Method
obj::PetscObject,classname::String = PetscObjectsGetObject(petsclib::PetscLibType, name::String)

Get a pointer to a named object

Not Collective

Input Parameter:

  • name - the name of an object

Output Parameters:

  • obj - the object or NULL if there is no object, optional, pass in NULL if not needed
  • classname - the name of the class of the object, optional, pass in NULL if not needed

Level: advanced

See also: PetscObject

External Links

source
PETSc.LibPETSc.PetscObjectsListGetGlobalNumbering — Method
count::PetscInt,numbering::PetscInt = PetscObjectsListGetGlobalNumbering(petsclib::PetscLibType, comm::MPI_Comm, len::PetscInt, objlist::Vector{PetscObject})

computes a global numbering of PetscObjects living on subcommunicators of a given communicator.

Collective.

Input Parameters:

  • comm - the MPI_Comm
  • len - local length of objlist
  • objlist - a list of PETSc objects living on subcomms of comm and containing this comm rank

(subcomm ordering is assumed to be deadlock-free)

Output Parameters:

  • count - global number of distinct subcommunicators on objlist (may be > len)
  • numbering - global numbers of objlist entries (allocated by user)

Level: developer

See also: PetscCommDuplicate(), PetscObjectDestroy()

External Links

source
PETSc.LibPETSc.PetscObjectsView — Method
PetscObjectsView(petsclib::PetscLibType, viewer::PetscViewer)

Prints the currently existing objects.

Logically Collective

Input Parameter:

  • viewer - must be an PETSCVIEWERASCII viewer

Level: advanced

See also: PetscObject

External Links

source

PetscLog

PETSc.LibPETSc.PetscLogHandlerCreate — Method
handler::PetscLogHandler = PetscLogHandlerCreate(petsclib::PetscLibType, comm::MPI_Comm)

Create a log handler for profiling events and stages. PETSc provides several implementations of PetscLogHandler that interface to different ways to summarize or visualize profiling data: see PetscLogHandlerType for a list.

Collective

Input Parameter:

  • comm - the communicator for synchronizing and viewing events with this handler

Output Parameter:

  • handler - the PetscLogHandler

Level: developer

See also: PetscLogHandler, PetscLogHandlerSetType(), PetscLogHandlerStart(), PetscLogHandlerStop()

External Links

source
PETSc.LibPETSc.PetscLogHandlerCreateLegacy — Method
handler::PetscLogHandler = PetscLogHandlerCreateLegacy(petsclib::PetscLibType, comm::MPI_Comm, PetscLogPLB::external, PetscLogPLE::external, PetscLogPHC::external, PetscLogPHD::external)

Create a PetscLogHandler from callbacks matching PETSc's legacy log handler callbacks

Collective

Input Parameters:

  • comm - an MPI communicator
  • PetscLogPLB - a function to call during PetscLogHandlerEventBegin() (or NULL)
  • PetscLogPLE - a function to call during PetscLogHandlerEventEnd() (or NULL)
  • PetscLogPHC - a function to call during PetscLogHandlerObjectCreate() (or NULL)
  • PetscLogPHD - a function to call during PetscLogHandlerObjectDestroy() (or NULL)

Output Parameter:

  • handler - a PetscLogHandler

Calling sequence of PetscLogPLB:

  • e - a PetscLogEvent that is beginning
  • _i - deprecated, unused
  • o1 - a PetscObject associated with e (or NULL)
  • o2 - a PetscObject associated with e (or NULL)
  • o3 - a PetscObject associated with e (or NULL)
  • o4 - a PetscObject associated with e (or NULL)

Calling sequence of PetscLogPLE:

  • e - a PetscLogEvent that is beginning
  • _i - deprecated, unused
  • o1 - a PetscObject associated with e (or NULL)
  • o2 - a PetscObject associated with e (or NULL)
  • o3 - a PetscObject associated with e (or NULL)
  • o4 - a PetscObject associated with e (or NULL)

Calling sequence of PetscLogPHC:

  • o - a PetscObject that has just been created

Calling sequence of PetscLogPHD:

  • o - a PetscObject that is about to be destroyed

Level: developer

Notes: This is for transitioning from the deprecated function PetscLogSet() and should not be used in new code.

PetscLogLegacyCallbacksBegin(), which calls this function, creates and starts (PetscLogHandlerStart()) a log handler, should be used in almost all cases.

External Links

source
PETSc.LibPETSc.PetscLogHandlerCreateTrace — Method
file::Libc.FILE,handler::PetscLogHandler = PetscLogHandlerCreateTrace(petsclib::PetscLibType, comm::MPI_Comm)

Create a logger that traces events and stages to a given file descriptor

Collective, No Fortran Support

Input Parameters:

  • comm - an MPI communicator
  • file - a file descriptor

Output Parameters:

  • handler - a PetscLogHandler of typePETSCLOGHANDLERTRACE`

Level: developer

See also: PetscLogHandler, PetscLogHandlerTraceBegin()

External Links

source
PETSc.LibPETSc.PetscLogHandlerDestroy — Method
PetscLogHandlerDestroy(petsclib::PetscLibType, handler::Union{PetscLogHandler, Ref{PetscLogHandler}})

Destroy a PetscLogHandler

Logically collective

Input Parameter:

  • handler - handler to be destroyed

Level: developer

See also: PetscLogHandler, PetscLogHandlerCreate()

External Links

source
PETSc.LibPETSc.PetscLogHandlerDump — Method
PetscLogHandlerDump(petsclib::PetscLibType, handler::PetscLogHandler, sname::String)

Dump the records of a log handler to file

Not collective

Input Parameters:

  • handler - a PetscLogHandler
  • sname - the name of the file to dump log data to

Level: developer

Note: The default log handler PETSCLOGHANDLERDEFAULT implements this function, but others generally do not. You can use PetscLogDump() to call this function for the default log handler that is connected to the global logging state (PetscLogGetState()).

External Links

source
PETSc.LibPETSc.PetscLogHandlerEventBegin — Method
PetscLogHandlerEventBegin(petsclib::PetscLibType, h::PetscLogHandler, e::PetscLogEvent, o1, o2, o3, o4)

Record the beginning of an event in a log handler

Not collective

Input Parameters:

  • h - the PetscLogHandler
  • e - a registered PetscLogEvent
  • o1 - PetscObject associated with the event (may be NULL)
  • o2 - PetscObject associated with the event (may be NULL)
  • o3 - PetscObject associated with the event (may be NULL)
  • o4 - PetscObject associated with the event (may be NULL)

Level: developer

See also: PetscLogHandler, PetscLogEventBegin(), PetscLogEventEnd(), PetscLogEventSync(), PetscLogHandlerEventEnd(), PetscLogHandlerEventSync()

External Links

source
PETSc.LibPETSc.PetscLogHandlerEventDeactivatePop — Method
PetscLogHandlerEventDeactivatePop(petsclib::PetscLibType, handler::PetscLogHandler, stage::PetscLogStage, event::PetscLogEvent)

Undo temporary deactivation a logging event for a log handler

Not collective

Input Parameters:

  • handler - a PetscLogHandler
  • stage - a PetscLogStage (or PETSC_DEFAULT for the current stage)
  • event - a PetscLogEvent

Level: developer

See also: PetscLogHandlerEventDeactivatePush()

External Links

source
PETSc.LibPETSc.PetscLogHandlerEventDeactivatePush — Method
PetscLogHandlerEventDeactivatePush(petsclib::PetscLibType, handler::PetscLogHandler, stage::PetscLogStage, event::PetscLogEvent)

Temporarily deactivate a logging event for a log handler

Not collective

Input Parameters:

  • handler - a PetscLogHandler
  • stage - a PetscLogStage (or PETSC_DEFAULT for the current stage)
  • event - a PetscLogEvent

Level: developer

See also: PetscLogHandlerEventDeactivatePop()

External Links

source
PETSc.LibPETSc.PetscLogHandlerEventEnd — Method
PetscLogHandlerEventEnd(petsclib::PetscLibType, h::PetscLogHandler, e::PetscLogEvent, o1, o2, o3, o4)

Record the end of an event in a log handler

Not collective

Input Parameters:

  • h - the PetscLogHandler
  • e - a registered PetscLogEvent
  • o1 - PetscObject associated with the event (may be NULL)
  • o2 - PetscObject associated with the event (may be NULL)
  • o3 - PetscObject associated with the event (may be NULL)
  • o4 - PetscObject associated with the event (may be NULL)

Level: developer

See also: PetscLogHandler, PetscLogEventBegin(), PetscLogEventEnd(), PetscLogEventSync(), PetscLogHandlerEventBegin(), PetscLogHandlerEventSync()

External Links

source
PETSc.LibPETSc.PetscLogHandlerEventSync — Method
PetscLogHandlerEventSync(petsclib::PetscLibType, h::PetscLogHandler, e::PetscLogEvent, comm::MPI_Comm)

Synchronize a logging event

Collective

Input Parameters:

  • h - the PetscLogHandler
  • e - a registered PetscLogEvent
  • comm - the communicator over which to synchronize e

Level: developer

See also: PetscLogHandler, PetscLogEventBegin(), PetscLogEventEnd(), PetscLogEventSync(), PetscLogHandlerEventBegin(), PetscLogHandlerEventEnd()

External Links

source
PETSc.LibPETSc.PetscLogHandlerEventsPause — Method
PetscLogHandlerEventsPause(petsclib::PetscLibType, handler::PetscLogHandler)

Put event logging into "paused" mode (see PetscLogEventsPause() for details.) for a log handler

Not collective

Input Parameter:

  • handler - a PetscLogHandler

Level: developer

See also: PetscLogHandlerEventsResume()

External Links

source
PETSc.LibPETSc.PetscLogHandlerEventsResume — Method
PetscLogHandlerEventsResume(petsclib::PetscLibType, handler::PetscLogHandler)

Resume event logging that had been put into "paused" mode (see PetscLogEventsPause() for details.) for a log handler

Not collective

Input Parameter:

  • handler - a PetscLogHandler

Level: developer

See also: PetscLogHandlerEventsPause()

External Links

source
PETSc.LibPETSc.PetscLogHandlerGetEventPerfInfo — Method
event_info::Ptr{PetscEventPerfInfo} = PetscLogHandlerGetEventPerfInfo(petsclib::PetscLibType, handler::PetscLogHandler, stage::PetscLogStage, event::PetscLogEvent)

Get a direct reference to the PetscEventPerfInfo of a stage and event

Not collective, No Fortran Support

Input Parameters:

  • handler - a PetscLogHandler
  • stage - a PetscLogStage (or PETSC_DEFAULT for the current stage)
  • event - a PetscLogEvent

Output Parameter:

  • event_info - a pointer to a performance log for event during stage (or NULL if this handler does not use

PetscEventPerfInfo to record performance data); writing to event_info will change the record in handler

Level: developer

See also: PetscLogEventGetPerfInfo(), PETSCLOGHANDLERDEFAULT

External Links

source
PETSc.LibPETSc.PetscLogHandlerGetNumObjects — Method
num_objects::PetscInt = PetscLogHandlerGetNumObjects(petsclib::PetscLibType, handler::PetscLogHandler)

Get the number of objects that were logged with a log handler

Not Collective

Input Parameter:

  • handler - a PetscLogHandler

Output Parameter:

  • num_objects - the number of objects whose creations and destructions were logged with handler

(PetscLogHandlerObjectCreate() / PetscLogHandlerObjectDestroy()), or -1 if the handler does not keep track of this number.

Level: developer

Note: The default log handler PETSCLOGHANDLERDEFAULT implements this function, but others generally do not.

External Links

source
PETSc.LibPETSc.PetscLogHandlerGetStagePerfInfo — Method
stage_info::Ptr{PetscEventPerfInfo} = PetscLogHandlerGetStagePerfInfo(petsclib::PetscLibType, handler::PetscLogHandler, stage::PetscLogStage)

Get a direct reference to the PetscEventPerfInfo of a stage

Not collective, No Fortran Support

Input Parameters:

  • handler - a PetscLogHandler
  • stage - a PetscLogStage (or PETSC_DEFAULT for the current stage)

Output Parameter:

  • stage_info - a pointer to a performance log for stage (or NULL if this handler does not use PetscEventPerfInfo

to record performance data); writing to stage_info will change the record in handler

Level: developer

See also: PetscLogEventGetPerfInfo(), PETSCLOGHANDLERDEFAULT

External Links

source
PETSc.LibPETSc.PetscLogHandlerGetState — Method
state::PetscLogState = PetscLogHandlerGetState(petsclib::PetscLibType, h::PetscLogHandler)

Get the logging state that provides the stream of events and stages for a log handler.

Logically collective

Input Parameter:

  • h - the PetscLogHandler

Output Parameter:

  • state - the PetscLogState

Level: developer

See also: PetscLogHandler, PetscLogState, PetscLogEventBegin(), PetscLogHandlerStart()

External Links

source
PETSc.LibPETSc.PetscLogHandlerGetType — Method
name::String = PetscLogHandlerGetType(petsclib::PetscLibType, handler::PetscLogHandler)

Gets the PetscLoagHandlerType (as a string) from the PetscLogHandler object.

Not collective

Input Parameter:

  • handler - the PetscLogHandler

Output Parameter:

  • name - The PetscLogHandlerType name

Level: developer

See also: PetscLogHandler, PetscLogHandlerCreate(), PetscLogHandlerRegister(), PetscLogHandlerSetType()

External Links

source
PETSc.LibPETSc.PetscLogHandlerObjectCreate — Method
PetscLogHandlerObjectCreate(petsclib::PetscLibType, h::PetscLogHandler, obj)

Record the creation of an object in a log handler.

Not collective

Input Parameters:

  • h - the PetscLogHandler
  • obj - a newly created PetscObject

Level: developer

See also: PetscLogHandler, PetscLogObjectCreate(), PetscLogObjectDestroy(), PetscLogHandlerObjectDestroy()

External Links

source
PETSc.LibPETSc.PetscLogHandlerObjectDestroy — Method
PetscLogHandlerObjectDestroy(petsclib::PetscLibType, h::PetscLogHandler, obj)

Record the destruction of an object in a log handler.

Not collective

Input Parameters:

  • h - the PetscLogHandler
  • obj - a newly created PetscObject

Level: developer

See also: PetscLogHandler, PetscLogObjectCreate(), PetscLogObjectDestroy(), PetscLogHandlerObjectCreate()

External Links

source
PETSc.LibPETSc.PetscLogHandlerRegister — Method
PetscLogHandlerRegister(petsclib::PetscLibType, sname::String, fnc::external)

Register a new PetscLogHandler

Not Collective, No Fortran Support

Input Parameters:

  • sname - The name of a new user-defined creation routine
  • function - The creation routine

See also: PetscLogHandler, PetscLogHandlerCreate(), PetscLogHandlerSetType(), PetscLogHandlerGetType()

External Links

source
PETSc.LibPETSc.PetscLogHandlerSetLogActions — Method
PetscLogHandlerSetLogActions(petsclib::PetscLibType, handler::PetscLogHandler, flag::PetscBool)

Determines whether actions are logged for a log handler.

Not Collective

Input Parameters:

  • handler - a PetscLogHandler
  • flag - PETSC_TRUE if actions are to be logged (ignored if handler does not log actions)

Level: developer

See also: PetscLogSetLogActions(), PetscLogStagePush(), PetscLogStagePop(), PetscLogGetDefaultHandler()

External Links

source
PETSc.LibPETSc.PetscLogHandlerSetLogObjects — Method
PetscLogHandlerSetLogObjects(petsclib::PetscLibType, handler::PetscLogHandler, flag::PetscBool)

Determines whether objects are logged for a log handler.

Not Collective

Input Parameters:

  • handler - a PetscLogHandler
  • flag - PETSC_TRUE if objects are to be logged (ignored if handler does not log objects)

Level: developer

See also: PetscLogSetLogObjects(), PetscLogStagePush(), PetscLogStagePop(), PetscLogGetDefaultHandler()

External Links

source
PETSc.LibPETSc.PetscLogHandlerSetState — Method
PetscLogHandlerSetState(petsclib::PetscLibType, h::PetscLogHandler, state::PetscLogState)

Set the logging state that provides the stream of events and stages for a log handler.

Logically collective

Input Parameters:

  • h - the PetscLogHandler
  • state - the PetscLogState

Level: developer

See also: PetscLogHandler, PetscLogState, PetscLogEventBegin(), PetscLogHandlerStart()

External Links

source
PETSc.LibPETSc.PetscLogHandlerSetType — Method
PetscLogHandlerSetType(petsclib::PetscLibType, handler::PetscLogHandler, name::String)

Set the type of a PetscLogHandler

Input Parameters:

  • handler - the PetscLogHandler
  • name - The kind of log handler

Level: developer

See also: PetscLogHandler, PetscLogHandlerCreate(), PetscLogHandlerRegister(), PetscLogHandlerGetType()

External Links

source
PETSc.LibPETSc.PetscLogHandlerStageGetVisible — Method
isVisible::PetscBool = PetscLogHandlerStageGetVisible(petsclib::PetscLibType, handler::PetscLogHandler, stage::PetscLogStage)

Get the visibility of logging stage in PetscLogHandlerView() for a log handler

Not collective

Input Parameters:

  • handler - a PetscLogHandler
  • stage - a PetscLogStage

Output Parameter:

  • isVisible - the visibility flag, PETSC_TRUE to print, else PETSC_FALSE (defaults to PETSC_TRUE)

Level: developer

See also: PetscLogHandlerStageSetVisible()

External Links

source
PETSc.LibPETSc.PetscLogHandlerStagePop — Method
PetscLogHandlerStagePop(petsclib::PetscLibType, h::PetscLogHandler, stage::PetscLogStage)

End the current logging stage in a log handler.

Not collective

Input Parameters:

  • h - the PetscLogHandler
  • stage - a registered PetscLogStage

Level: developer

See also: PetscLogHandler, PetscLogStagePush(), PetscLogStagePop(), PetscLogHandlerStagePush()

External Links

source
PETSc.LibPETSc.PetscLogHandlerStagePush — Method
PetscLogHandlerStagePush(petsclib::PetscLibType, h::PetscLogHandler, stage::PetscLogStage)

Begin a new logging stage in a log handler.

Not collective

Input Parameters:

  • h - the PetscLogHandler
  • stage - a registered PetscLogStage

Level: developer

See also: PetscLogHandler, PetscLogStagePush(), PetscLogStagePop(), PetscLogHandlerStagePop()

External Links

source
PETSc.LibPETSc.PetscLogHandlerStageSetVisible — Method
PetscLogHandlerStageSetVisible(petsclib::PetscLibType, handler::PetscLogHandler, stage::PetscLogStage, isVisible::PetscBool)

Set the visibility of logging stage in PetscLogHandlerView() for a log handler

Not collective

Input Parameters:

  • handler - a PetscLogHandler
  • stage - a PetscLogStage
  • isVisible - the visibility flag, PETSC_TRUE to print, else PETSC_FALSE (defaults to PETSC_TRUE)

Level: developer

See also: PetscLogHandlerStageGetVisible()

External Links

source
PETSc.LibPETSc.PetscLogHandlerStart — Method
PetscLogHandlerStart(petsclib::PetscLibType, h::PetscLogHandler)

Connect a log handler to PETSc's global logging stream and state.

Logically collective

Input Parameters:

  • h - a PetscLogHandler

Level: developer

See also: PetscLogHandler, PetscLogState, PetscLogHandlerStop(), PetscInitialize()

External Links

source
PETSc.LibPETSc.PetscLogHandlerStop — Method
PetscLogHandlerStop(petsclib::PetscLibType, h::PetscLogHandler)

Disconnect a log handler from PETSc's global logging stream.

Logically collective

Input Parameters:

  • h - a PetscLogHandler

Level: developer

See also: PetscLogHandler, PetscLogState, PetscLogHandlerStart()

External Links

source
PETSc.LibPETSc.PetscLogHandlerView — Method
PetscLogHandlerView(petsclib::PetscLibType, h::PetscLogHandler, viewer::PetscViewer)

View the data recorded in a log handler.

Collective

Input Parameters:

  • h - the PetscLogHandler
  • viewer - the PetscViewer

Level: developer

See also: PetscLogHandler, PetscLogView()

External Links

source
PETSc.LibPETSc.PetscLogStateClassGetInfo — Method
info::PetscLogClassInfo = PetscLogStateClassGetInfo(petsclib::PetscLibType, state::PetscLogState, clss::PetscLogClass)

Get the registration information of an class

Not collective

Input Parameters:

  • state - a PetscLogState
  • clss - a registered PetscLogClass

Output Parameter:

  • info - the PetscLogClassInfo of the class will be copied into info

Level: developer

See also: PetscLogState, PetscLogStateClassRegister(), PetscLogStateGetClassFromName()

External Links

source
PETSc.LibPETSc.PetscLogStateClassRegister — Method
logclass::PetscLogClass = PetscLogStateClassRegister(petsclib::PetscLibType, state::PetscLogState, name::String, id::PetscClassId)

Register a class to with a PetscLogState used by PetscLogHandlers.

Logically collective on PETSC_COMM_WORLD

Input Parameters:

  • state - a PetscLogState
  • name - the name of a class registered with PetscClassIdRegister()
  • id - the PetscClassId obtained from PetscClassIdRegister()

Output Parameter:

  • logclass - a PetscLogClass for this class with this state

Level: developer

See also: PetscLogStateClassGetInfo(), PetscLogStateGetClassFromName(), PetscLogStateGetClassFromClassId()

External Links

source
PETSc.LibPETSc.PetscLogStateClassSetActive — Method
PetscLogStateClassSetActive(petsclib::PetscLibType, state::PetscLogState, stage::PetscLogStage, classid::PetscClassId, isActive::PetscBool)

Set logging events associated with an event as active or inactive during a logging stage.

Not collective

Input Parameters:

  • state - a PetscLogState
  • stage - a registered PetscLogStage, or PETSC_DEFAULT for the current stage
  • classid - a PetscClassId
  • isActive - if PETSC_FALSE, PetscLogStateEventGetActive() will return

PETSC_FALSE for this stage and all events that were associated with this class when they were registered (see PetscLogStateEventRegister()).

Level: developer

See also: PetscLogState, PetscLogEventGetActive(), PetscLogStateEventSetActive()

External Links

source
PETSc.LibPETSc.PetscLogStateClassSetActiveAll — Method
PetscLogStateClassSetActiveAll(petsclib::PetscLibType, state::PetscLogState, classid::PetscClassId, isActive::PetscBool)

Set logging events associated with an event as active or inactive for all logging stages

Not collective

Input Parameters:

  • state - a PetscLogState
  • classid - a PetscClassId
  • isActive - if PETSC_FALSE, PetscLogStateEventGetActive() will return

PETSC_FALSE for all events that were associated with this class when they were registered (see PetscLogStateEventRegister()).

Level: developer

See also: PetscLogState, PetscLogEventGetActive(), PetscLogStateClassSetActive()

External Links

source
PETSc.LibPETSc.PetscLogStateDestroy — Method
PetscLogStateDestroy(petsclib::PetscLibType, state::Union{PetscLogState, Ref{PetscLogState}})

Destroy a logging state.

Not collective

Input Parameters:

  • state - a PetscLogState

Level: developer

See also: PetscLogState, PetscLogStateCreate()

External Links

source
PETSc.LibPETSc.PetscLogStateEventGetActive — Method
isActive::PetscBool = PetscLogStateEventGetActive(petsclib::PetscLibType, state::PetscLogState, stage::PetscLogStage, event::PetscLogEvent)

Check if a logging event is active or inactive during a logging stage.

Not collective

Input Parameters:

  • state - a PetscLogState
  • stage - a registered PetscLogStage, or PETSC_DEFAULT for the current stage
  • event - a registered PetscLogEvent

Output Parameter:

  • isActive - If PETSC_FALSE, log handlers should not be notified of the event's beginning or end.

Level: developer

See also: PetscLogState, PetscLogEventGetActive(), PetscLogStateGetCurrentStage(), PetscLogHandler()

External Links

source
PETSc.LibPETSc.PetscLogStateEventGetInfo — Method
info::PetscLogEventInfo = PetscLogStateEventGetInfo(petsclib::PetscLibType, state::PetscLogState, event::PetscLogEvent)

Get the registration information of an event

Not collective

Input Parameters:

  • state - a PetscLogState
  • event - a registered PetscLogEvent

Output Parameter:

  • info - the PetscLogEventInfo of the event will be copied into info

Level: developer

See also: PetscLogState, PetscLogStateEventRegister(), PetscLogStateGetEventFromName()

External Links

source
PETSc.LibPETSc.PetscLogStateEventRegister — Method
event::PetscLogEvent = PetscLogStateEventRegister(petsclib::PetscLibType, state::PetscLogState, sname::String, id::PetscClassId)

Register a new event with a logging state

Not collective

Input Parameters:

  • state - a PetscLogState
  • sname - a unique name
  • id - the PetscClassId for the type of object most closely associated with this event

Output Parameter:

  • event - the identifier for the registered event

Level: developer

See also: PetscLogState, PetscLogStageRegister()

External Links

source
PETSc.LibPETSc.PetscLogStateEventSetActive — Method
PetscLogStateEventSetActive(petsclib::PetscLibType, state::PetscLogState, stage::PetscLogStage, event::PetscLogEvent, isActive::PetscBool)

Set a logging event as active or inactive during a logging stage.

Not collective

Input Parameters:

  • state - a PetscLogState
  • stage - a registered PetscLogStage, or PETSC_DEFAULT for the current stage
  • event - a registered PetscLogEvent
  • isActive - if PETSC_FALSE, PetscLogStateEventGetActive() will return PETSC_FALSE for this stage and this event

Level: developer

See also: PetscLogState, PetscLogEventGetActive(), PetscLogStateGetCurrentStage(), PetscLogEventSetActiveAll()

External Links

source
PETSc.LibPETSc.PetscLogStateEventSetActiveAll — Method
PetscLogStateEventSetActiveAll(petsclib::PetscLibType, state::PetscLogState, event::PetscLogEvent, isActive::PetscBool)

Set logging event as active or inactive for all logging stages

Not collective

Input Parameters:

  • state - a PetscLogState
  • event - a registered PetscLogEvent
  • isActive - if PETSC_FALSE, PetscLogStateEventGetActive() will return PETSC_FALSE for all stages and all events

Level: developer

See also: PetscLogState, PetscLogEventGetActive()

External Links

source
PETSc.LibPETSc.PetscLogStateEventSetCollective — Method
PetscLogStateEventSetCollective(petsclib::PetscLibType, state::PetscLogState, event::PetscLogEvent, collective::PetscBool)

Set the collective nature of a logging event

Logically collective

Input Parameters:

  • state - a PetscLogState
  • event - a registered PetscLogEvent
  • collective - if PETSC_TRUE, MPI processes synchronize during this event, and PetscLogHandlerEventSync() can be used to help measure the delays between when the processes begin the event

Level: developer

See also: PetscLogState, PetscLogEventRegister()

External Links

source
PETSc.LibPETSc.PetscLogStateGetClassFromClassId — Method
clss::PetscLogClass = PetscLogStateGetClassFromClassId(petsclib::PetscLibType, state::PetscLogState, classid::PetscClassId)

Get a PetscLogClass from the PetscClassId it was registered with.

Not collective

Input Parameters:

  • state - a PetscLogState
  • classid - a PetscClassId

Output Parameter:

  • clss - the classes's logging id

Level: developer

See also: PetscLogState, PetscLogStateClassRegister(), PetscLogStateClassGetInfo()

External Links

source
PETSc.LibPETSc.PetscLogStateGetClassFromName — Method
clss::PetscLogClass = PetscLogStateGetClassFromName(petsclib::PetscLibType, state::PetscLogState, name::String)

Get a PetscLogClass from the name of the class it was registered with.

Not collective

Input Parameters:

  • state - a PetscLogState
  • name - the name string of the class

Output Parameter:

  • clss - the classes's logging id

Level: developer

See also: PetscLogState, PetscLogStateClassRegister(), PetscLogStateClassGetInfo()

External Links

source
PETSc.LibPETSc.PetscLogStateGetCurrentStage — Method
current::PetscLogStage = PetscLogStateGetCurrentStage(petsclib::PetscLibType, state::PetscLogState)

Get the last stage that was started

Not collective

Input Parameter:

  • state - a PetscLogState

Output Parameter:

  • current - the last PetscLogStage started with PetscLogStateStagePop()

Level: developer

See also: PetscLogState, PetscLogStateStageRegister(), PetscLogStateStagePush(), PetscLogStateStagePop()

External Links

source
PETSc.LibPETSc.PetscLogStateGetEventFromName — Method
event::PetscLogEvent = PetscLogStateGetEventFromName(petsclib::PetscLibType, state::PetscLogState, name::String)

Get a PetscLogEvent from the name it was registered with.

Not collective

Input Parameters:

  • state - a PetscLogState
  • name - an event's name

Output Parameter:

  • event - the event's id

Level: developer

See also: PetscLogState, PetscLogStateEventRegister(), PetscLogStateEventGetInfo()

External Links

source
PETSc.LibPETSc.PetscLogStateGetNumClasses — Method
numClasses::PetscInt = PetscLogStateGetNumClasses(petsclib::PetscLibType, state::PetscLogState)

Get the number of registered classes in a logging state.

Not collective

Input Parameter:

  • state - a PetscLogState

Output Parameter:

  • numClasses - the number of registered PetscLogClasss

Level: developer

See also: PetscLogState, PetscLogStateClassRegister()

External Links

source
PETSc.LibPETSc.PetscLogStateGetNumEvents — Method
numEvents::PetscInt = PetscLogStateGetNumEvents(petsclib::PetscLibType, state::PetscLogState)

Get the number of registered events in a logging state.

Not collective

Input Parameter:

  • state - a PetscLogState

Output Parameter:

  • numEvents - the number of registered PetscLogEvents

Level: developer

See also: PetscLogState, PetscLogStateEventRegister()

External Links

source
PETSc.LibPETSc.PetscLogStateGetNumStages — Method
numStages::PetscInt = PetscLogStateGetNumStages(petsclib::PetscLibType, state::PetscLogState)

Get the number of registered stages in a logging state.

Not collective

Input Parameter:

  • state - a PetscLogState

Output Parameter:

  • numStages - the number of registered PetscLogStages

Level: developer

See also: PetscLogState, PetscLogStateStageRegister()

External Links

source
PETSc.LibPETSc.PetscLogStateGetStageFromName — Method
stage::PetscLogStage = PetscLogStateGetStageFromName(petsclib::PetscLibType, state::PetscLogState, name::String)

Get a PetscLogStage from the name it was registered with.

Not collective

Input Parameters:

  • state - a PetscLogState
  • name - a stage's name

Output Parameter:

  • stage - the stage's id

Level: developer

See also: PetscLogState, PetscLogStateStageRegister(), PetscLogStateStageGetInfo()

External Links

source
PETSc.LibPETSc.PetscLogStateStageGetActive — Method
isActive::PetscBool = PetscLogStateStageGetActive(petsclib::PetscLibType, state::PetscLogState, stage::PetscLogStage)

Check if a logging stage is active or inactive.

Not collective

Input Parameters:

  • state - a PetscLogState
  • stage - a registered PetscLogStage

Output Parameter:

  • isActive - if PETSC_FALSE, the state should not send logging events to log handlers during this stage.

Level: developer

See also: PetscLogState, PetscLogStageSetActive(), PetscLogHandler, PetscLogHandlerStart(), PetscLogHandlerEventBegin(), PetscLogHandlerEventEnd()

External Links

source
PETSc.LibPETSc.PetscLogStateStageGetInfo — Method
info::PetscLogStageInfo = PetscLogStateStageGetInfo(petsclib::PetscLibType, state::PetscLogState, stage::PetscLogStage)

Get the registration information of an stage

Not collective

Input Parameters:

  • state - a PetscLogState
  • stage - a registered PetscLogStage

Output Parameter:

  • info - the PetscLogStageInfo of the stage will be copied into info

Level: developer

See also: PetscLogState, PetscLogStateStageRegister(), PetscLogStateGetStageFromName()

External Links

source
PETSc.LibPETSc.PetscLogStateStagePop — Method
PetscLogStateStagePop(petsclib::PetscLibType, state::PetscLogState)

End a running logging stage.

Not collective

Input Parameter:

  • state - a PetscLogState

Level: developer

See also: PetscLogState, PetscLogStateStageRegister(), PetscLogStateStagePush(), PetscLogStateGetCurrentStage()

External Links

source
PETSc.LibPETSc.PetscLogStateStagePush — Method
PetscLogStateStagePush(petsclib::PetscLibType, state::PetscLogState, stage::PetscLogStage)

Start a new logging stage.

Not collective

Input Parameters:

  • state - a PetscLogState
  • stage - a registered PetscLogStage

Level: developer

See also: PetscLogState, PetscLogStateStageRegister(), PetscLogStateStagePop(), PetscLogStateGetCurrentStage()

External Links

source
PETSc.LibPETSc.PetscLogStateStageRegister — Method
stage::PetscLogStage = PetscLogStateStageRegister(petsclib::PetscLibType, state::PetscLogState, sname::String)

Register a new stage with a logging state

Not collective

Input Parameters:

  • state - a PetscLogState
  • sname - a unique name

Output Parameter:

  • stage - the identifier for the registered stage

Level: developer

See also: PetscLogState, PetscLogStateStagePush(), PetscLogStateStagePop()

External Links

source
PETSc.LibPETSc.PetscLogStateStageSetActive — Method
PetscLogStateStageSetActive(petsclib::PetscLibType, state::PetscLogState, stage::PetscLogStage, isActive::PetscBool)

Mark a stage as active or inactive.

Not collective

Input Parameters:

  • state - a PetscLogState
  • stage - a registered PetscLogStage
  • isActive - if PETSC_FALSE, PetscLogStateEventGetActive() will return PETSC_FALSE for all events during this stage

Level: developer

See also: PetscLogState, PetscLogStateEventSetActive()

External Links

source

PetscDevice

PETSc.LibPETSc.PetscDeviceInitializePackage — Method
PetscDeviceInitializePackage(petsclib::PetscLibType)

This function initializes everything in the PetscDevice package. It is called on the first call to PetscDeviceContextCreate() or PetscDeviceCreate() when using shared or static libraries.

Level: developer

See also: PetscInitialize(), PetscDeviceFinalizePackage(), PetscDeviceContextCreate(), PetscDeviceCreate()

External Links

source

PetscContainer

PETSc.LibPETSc.PetscContainerCreate — Method
container::PetscContainer = PetscContainerCreate(petsclib::PetscLibType, comm::MPI_Comm)

Creates a PETSc object that has room to hold a single pointer.

Collective, No Fortran Support

Input Parameter:

  • comm - MPI communicator that shares the object

Output Parameter:

  • container - the container created

Level: advanced

See also: PetscContainerDestroy(), PetscContainerSetPointer(), PetscContainerGetPointer(), PetscObjectCompose(), PetscObjectQuery(), PetscContainerSetCtxDestroy(), PetscObject, PetscObjectContainerCompose(), PetscObjectContainerQuery()

External Links

source
PETSc.LibPETSc.PetscContainerDestroy — Method
PetscContainerDestroy(petsclib::PetscLibType, obj::Union{PetscContainer, Ref{PetscContainer}})

Destroys a PETSc container object.

Collective, No Fortran Support

Input Parameter:

  • obj - an object that was created with PetscContainerCreate()

Level: advanced

See also: PetscContainerCreate(), PetscContainerSetCtxDestroy(), PetscObject, PetscObjectContainerCompose(), PetscObjectContainerQuery()

External Links

source
PETSc.LibPETSc.PetscContainerGetPointer — Method
ptr::Ptr{Cvoid} = PetscContainerGetPointer(petsclib::PetscLibType, obj::PetscContainer)

Gets the pointer value contained in the container that was provided with PetscContainerSetPointer()

Not Collective, No Fortran Support

Input Parameter:

  • obj - the object created with PetscContainerCreate()

Output Parameter:

  • ptr - the pointer value

Level: advanced

See also: PetscContainerCreate(), PetscContainerDestroy(), PetscObject, PetscContainerSetPointer(), PetscObjectContainerCompose(), PetscObjectContainerQuery()

External Links

source
PETSc.LibPETSc.PetscContainerSetCtxDestroy — Method
PetscContainerSetCtxDestroy(petsclib::PetscLibType, obj::PetscContainer, des::Ptr{Cvoid})

Sets the destroy function for the data provided to the PetscContainer with PetscContainerSetPointer()

Logically Collective, No Fortran Support

Input Parameters:

  • obj - an object that was created with PetscContainerCreate()
  • des - name of the ctx destroy function, see PetscCtxDestroyFn for its calling sequence

Level: advanced

See also: PetscContainerDestroy(), PetscContainerUserDestroyDefault(), PetscMalloc(), PetscMalloc1(), PetscCalloc(), PetscCalloc1(), PetscObject, PetscObjectContainerCompose(), PetscObjectContainerQuery()

External Links

source
PETSc.LibPETSc.PetscContainerSetPointer — Method
PetscContainerSetPointer(petsclib::PetscLibType, obj::PetscContainer, ptr::Ptr{Cvoid})

Sets the pointer value contained in the container.

Logically Collective, No Fortran Support

Input Parameters:

  • obj - the object created with PetscContainerCreate()
  • ptr - the pointer value

Level: advanced

See also: PetscContainerCreate(), PetscContainerDestroy(), PetscObjectCompose(), PetscObjectQuery(), PetscObject, PetscContainerGetPointer(), PetscObjectContainerCompose(), PetscObjectContainerQuery()

External Links

source

PetscFunctionList

PETSc.LibPETSc.PetscFunctionListClear — Method
PetscFunctionListClear(petsclib::PetscLibType, fl::PetscFunctionList)

Clear a PetscFunctionList

Not Collective

Input Parameter:

  • fl - The PetscFunctionList to clear

Level: developer

See also: PetscFunctionList, PetscFunctionListDestroy(), PetscFunctionListAdd()

External Links

source
PETSc.LibPETSc.PetscFunctionListDestroy — Method
PetscFunctionListDestroy(petsclib::PetscLibType, fl::Union{PetscFunctionList, Ref{PetscFunctionList}})

Destroys a list of registered routines.

Input Parameter:

  • fl - pointer to list

Level: developer

See also: PetscFunctionListAdd(), PetscFunctionList, PetscFunctionListClear()

External Links

source
PETSc.LibPETSc.PetscFunctionListDuplicate — Method
nl::PetscFunctionList = PetscFunctionListDuplicate(petsclib::PetscLibType, fl::PetscFunctionList)

Creates a new list from a given function list PetscFunctionList.

Input Parameter:

  • fl - pointer to list

Output Parameter:

  • nl - the new list (should point to NULL to start, otherwise appends)

Level: developer

See also: PetscFunctionList, PetscFunctionListAdd(), PetscFlistDestroy()

External Links

source
PETSc.LibPETSc.PetscFunctionListGet — Method
array::String,n::Cint = PetscFunctionListGet(petsclib::PetscLibType, list::PetscFunctionList)

Gets an array the contains the entries in PetscFunctionList, this is used by help etc.

Not Collective, No Fortran Support

Input Parameter:

  • list - list of types

Output Parameters:

  • array - array of names
  • n - length of array

Level: developer

See also: PetscFunctionListAdd(), PetscFunctionList

External Links

source
PETSc.LibPETSc.PetscFunctionListPrintAll — Method
PetscFunctionListPrintAll(petsclib::PetscLibType)

Prints the names of all functions registered in every PetscFunctionList known to PETSc

Not Collective

Level: developer

See also: PetscFunctionList, PetscFunctionListPrintNonEmpty(), PetscFunctionListAdd(), PetscFunctionListView()

External Links

source
PETSc.LibPETSc.PetscFunctionListPrintNonEmpty — Method
PetscFunctionListPrintNonEmpty(petsclib::PetscLibType, fl::PetscFunctionList)

Print composed names for non NULL function pointers

Logically Collective, No Fortran Support

Input Parameter:

  • fl - the function list

Level: developer

See also: PetscFunctionListAdd(), PetscFunctionList, PetscObjectQueryFunction()

External Links

source
PETSc.LibPETSc.PetscFunctionListPrintTypes — Method
PetscFunctionListPrintTypes(petsclib::PetscLibType, comm::MPI_Comm, fd::Libc.FILE, prefix::String, name::String, text::String, man::String, list::PetscFunctionList, def::String, newv::String)

Prints the methods available in a list of functions

Collective, No Fortran Support

Input Parameters:

  • comm - the communicator (usually MPI_COMM_WORLD)
  • fd - file to print to, usually stdout
  • prefix - prefix to prepend to name (optional)
  • name - option string (for example, -ksp_type)
  • text - short description of the object (for example, "Krylov solvers")
  • man - name of manual page that discusses the object (for example, KSPCreate)
  • list - list of types
  • def - default (current) value
  • newv - new value

Level: developer

See also: PetscFunctionListAdd(), PetscFunctionList

External Links

source
PETSc.LibPETSc.PetscFunctionListView — Method
PetscFunctionListView(petsclib::PetscLibType, list::PetscFunctionList, viewer::PetscViewer)

prints out contents of a PetscFunctionList

Collective

Input Parameters:

  • list - the list of functions
  • viewer - the PetscViewer used to view the PetscFunctionList

Level: developer

See also: PetscFunctionListAdd(), PetscFunctionListPrintTypes(), PetscFunctionList

External Links

source

PetscDLLibrary

PETSc.LibPETSc.PetscDLLibraryAppend — Method
outlist::PetscDLLibrary = PetscDLLibraryAppend(petsclib::PetscLibType, comm::MPI_Comm, path::String)

Appends another dynamic link library to the end of the search list

Collective, No Fortran Support

Input Parameters:

  • comm - MPI communicator
  • path - name of the library

Output Parameter:

  • outlist - list of libraries

Level: developer

See also: PetscDLLibrary, PetscDLLibraryOpen(), PetscLoadDynamicLibrary(), PetscDLLibraryRetrieve(), PetscDLLibraryPrepend()

External Links

source
PETSc.LibPETSc.PetscDLLibraryClose — Method
PetscDLLibraryClose(petsclib::PetscLibType, list::PetscDLLibrary)

Destroys the search path of dynamic libraries and closes the libraries.

Collective, No Fortran Support

Input Parameter:

  • list - library list

Level: developer

See also: PetscDLLibrary, PetscDLLibraryOpen(), PetscLoadDynamicLibrary(), PetscDLLibraryRetrieve(), PetscDLLibraryAppend(), PetscDLLibraryPrepend()

External Links

source
PETSc.LibPETSc.PetscDLLibraryOpen — Method
entry::PetscDLLibrary = PetscDLLibraryOpen(petsclib::PetscLibType, comm::MPI_Comm, path::String)

Opens a PETSc dynamic link library

Collective, No Fortran Support

Input Parameters:

  • comm - MPI processes that are opening the library
  • path - name of the library, can be a relative or absolute path

Output Parameter:

  • entry - a PETSc dynamic link library entry

Level: developer

See also: PetscDLLibrary, PetscLoadDynamicLibrary(), PetscDLLibraryAppend(), PetscDLLibraryRetrieve(), PetscDLLibrarySym(), PetscDLLibraryClose()

External Links

source
PETSc.LibPETSc.PetscDLLibraryPrepend — Method
outlist::PetscDLLibrary = PetscDLLibraryPrepend(petsclib::PetscLibType, comm::MPI_Comm, path::String)

Add another dynamic library to search for symbols to the beginning of the search list

Collective, No Fortran Support

Input Parameters:

  • comm - MPI communicator
  • path - name of the library

Output Parameter:

  • outlist - list of libraries

Level: developer

See also: PetscDLLibrary, PetscDLLibraryOpen(), PetscLoadDynamicLibrary(), PetscDLLibraryRetrieve(), PetscDLLibraryAppend()

External Links

source
PETSc.LibPETSc.PetscDLLibraryPrintPath — Method
PetscDLLibraryPrintPath(petsclib::PetscLibType, libs::PetscDLLibrary)

Prints the names of all dynamic libraries in a PetscDLLibrary list to the PETSc error output stream

Not Collective

Input Parameter:

  • libs - the linked list of currently opened dynamic libraries

Level: developer

See also: PetscDLLibrary, PetscDLLibraryOpen(), PetscDLLibrarySym(), PetscDLLibraryAppend(), PetscDLLibraryClose()

External Links

source
PETSc.LibPETSc.PetscDLLibraryRetrieve — Method
found::PetscBool = PetscDLLibraryRetrieve(petsclib::PetscLibType, comm::MPI_Comm, libname::String, lname::String, llen::Csize_t)

Copies a PETSc dynamic library from a remote location (if it is remote), then indicates if it exits and its local name.

Collective

Input Parameters:

  • comm - MPI processes that will be opening the library
  • libname - name of the library, can be a relative or absolute path and be a URL
  • llen - length of the name buffer

Output Parameters:

  • lname - actual name of the file on local filesystem if found
  • found - true if the file exists

Level: developer

See also: PetscFileRetrieve()

External Links

source
PETSc.LibPETSc.PetscDLLibrarySym — Method
value::Ptr{Cvoid} = PetscDLLibrarySym(petsclib::PetscLibType, comm::MPI_Comm, outlist::PetscDLLibrary, path::String, insymbol::String)

Load a symbol from a list of dynamic link libraries.

Collective, No Fortran Support

Input Parameters:

  • comm - the MPI communicator that will load the symbol
  • outlist - list of already open libraries that may contain symbol (can be NULL and only the executable is searched for the function)
  • path - optional complete library name (if provided it checks here before checking outlist)
  • insymbol - name of symbol

Output Parameter:

  • value - if symbol not found then this value is set to NULL

Level: developer

See also: PetscDLLibrary, PetscLoadDynamicLibrary(), PetscDLLibraryAppend(), PetscDLLibraryRetrieve(), PetscDLLibraryOpen(), PetscDLLibraryClose()

External Links

source