#include <petscsys.h> PetscErrorCode PetscInfo(PetscObject obj, const char message[]) PetscErrorCode PetscInfo1(PetscObject obj, const char formatmessage[],arg1) PetscErrorCode PetscInfo2(PetscObject obj, const char formatmessage[],arg1,arg2) ...Collective on obj
obj | - object most closely associated with the logging statement or NULL | |
message | - logging message | |
formatmessage | - logging message using standard "printf" format | |
arg1, arg2, ... | - arguments of the format |
Extent of the printed messages can be controlled using the option database key -info as follows.
-info [filename][:[~]<list,of,classnames>[:[~]self]]
No filename means standard output PETSC_STDOUT is used.
The optional <list,of,classnames> is a comma separated list of enabled classes, e.g. vec,mat,ksp. If this list is not specified, all classes are enabled. Prepending the list with ~ means inverted selection, i.e. all classes except the listed are enabled. A special classname sys relates to PetscInfo() with obj being NULL.
The optional self keyword specifies that PetscInfo() is enabled only for communicator size = 1 (e.g. PETSC_COMM_SELF), i.e. only PetscInfo() calls which print from every rank of PETSC_COMM_WORLD are enabled. By contrast, ~self means that PetscInfo() is enabled only for communicator size > 1 (e.g. PETSC_COMM_WORLD), i.e. those PetscInfo() calls which print from every rank of PETSC_COMM_WORLD are disabled.
All classname/self matching is case insensitive. Filename is case sensitive.
Mat A;
PetscInt alpha;
...
PetscInfo1(A,"Matrix uses parameter alpha=%D\n",alpha);
PetscInfo(obj, msg);
PetscInfo1(obj, msg, arg1);
PetscInfo2(obj, msg, arg1, arg2);is evaluated as follows.
-info or -info :: prints msg to PETSC_STDOUT, for any obj regardless class or communicator
-info :mat:self prints msg to PETSC_STDOUT only if class of obj is Mat, and its communicator has size = 1
-info myInfoFileName:~vec:~self prints msg to file named myInfoFileName, only if the obj's class is NULL or other than Vec, and obj's communicator has size > 1
-info :sys prints to PETSC_STDOUT only if obj is NULLNote that
-info :sys:~selfdeactivates all info messages because sys means obj = NULL which implies PETSC_COMM_SELF but ~self filters out everything on PETSC_COMM_SELF.