SALSA Analysis Modules
|
While this library comes with a number of categories supplied, you can write your own category, taking any of the given ones as example.
Each analysis module has to have the following prototype:
static PetscErrorCode MyModule(Mat A,AnalysisItem *rv,PetscBool *flg)
where
A
is the input matrixrv
is the return valueflg
is true if the quantity was succesfully computed, false otherwiseThe module return code should be 0 for success, anything else for (catastrophic) failure. A simple failure (or refusal) to compute should be indicated through the flg
variable.
The modules (including the return type of their computed quantities) are declared to the system by calling routine
PetscErrorCode RegisterMyModules() { PetscErrorCode ierr; PetscFunctionBegin; ierr = RegisterModule ("mycategory","mymodule",THERESULTTYPE,&MyModule); CHKERRQ(ierr); ....
or you can make the invidual calls to RegisterModule(). See types and Array type handling.