Commits

Lisandro Dalcin committed 2055fb7

Separate LogEvents for SNES and TS

Comments (0)

Files changed (7)

 
 /* ---------------------------------------------------------------- */
 
+PETSC_EXTERN PetscLogEvent IGA_FormScalar;
+PETSC_EXTERN PetscLogEvent IGA_FormSystem;
+PETSC_EXTERN PetscLogEvent IGA_FormFunction;
+PETSC_EXTERN PetscLogEvent IGA_FormJacobian;
+PETSC_EXTERN PetscLogEvent IGA_FormIFunction;
+PETSC_EXTERN PetscLogEvent IGA_FormIJacobian;
+
 PETSC_EXTERN PetscErrorCode IGAFormScalar(IGA iga,Vec U,PetscInt n,PetscScalar S[],
                                           IGAUserScalar Scalar,void *ctx);
 
 #include "petiga.h"
 
-PETSC_EXTERN PetscLogEvent IGA_FormSystem;
-
 PETSC_STATIC_INLINE
 PetscBool IGAElementNextUserSystem(IGAElement element,IGAUserSystem *sys,void **ctx)
 {
 #include "petiga.h"
 
 PETSC_EXTERN PetscBool     IGARegisterAllCalled;
-PETSC_EXTERN PetscLogEvent IGA_FormScalar;
-PETSC_EXTERN PetscLogEvent IGA_FormSystem;
-PETSC_EXTERN PetscLogEvent IGA_FormFunction;
-PETSC_EXTERN PetscLogEvent IGA_FormJacobian;
 
 #if PETSC_VERSION_LE(3,3,0)
 #define PCRegisterAll() PCRegisterAll(0)
 PetscLogEvent IGA_FormSystem = 0;
 PetscLogEvent IGA_FormFunction = 0;
 PetscLogEvent IGA_FormJacobian = 0;
+PetscLogEvent IGA_FormIFunction = 0;
+PetscLogEvent IGA_FormIJacobian = 0;
 
 #undef  __FUNCT__
 #define __FUNCT__ "IGARegisterAll"
   ierr = PetscLogEventRegister("IGAFormSystem",IGA_CLASSID,&IGA_FormSystem);CHKERRQ(ierr);
   ierr = PetscLogEventRegister("IGAFormFunction",IGA_CLASSID,&IGA_FormFunction);CHKERRQ(ierr);
   ierr = PetscLogEventRegister("IGAFormJacobian",IGA_CLASSID,&IGA_FormJacobian);CHKERRQ(ierr);
+  ierr = PetscLogEventRegister("IGAFormIFunction",IGA_CLASSID,&IGA_FormIFunction);CHKERRQ(ierr);
+  ierr = PetscLogEventRegister("IGAFormIJacobian",IGA_CLASSID,&IGA_FormIJacobian);CHKERRQ(ierr);
   /* Additional option handlers */
   ierr = SNESAddOptionsChecker(SNESSetFromOptions_FDColoring);CHKERRQ(ierr);
   /* Register finalization routine */
 #include "petiga.h"
 
-PETSC_EXTERN PetscLogEvent IGA_FormScalar;
-
 #undef  __FUNCT__
 #define __FUNCT__ "IGAFormScalar"
 /*@
    IGAFormScalar - Evaluates a linear functional of a given vector
-   
+
    Collective on IGA
 
    Input Parameters:
 +  p - point at which to evaluate the functional
 .  U - the vector
 .  n - the number of scalars being computed
-.  S - an array [0:n-1] of scalars 
+.  S - an array [0:n-1] of scalars
 -  ctx - [optional] user-defined context for evaluation routine
 
-   Notes: 
+   Notes:
    This function can be used to evaluate linear functionals of the
    solution. Use this when you wish to compute errors in the energy
    norm or moments of the solution.
 #include "petiga.h"
 
-PETSC_EXTERN PetscLogEvent IGA_FormFunction;
-PETSC_EXTERN PetscLogEvent IGA_FormJacobian;
-
 PETSC_STATIC_INLINE
 PetscBool IGAElementNextUserFunction(IGAElement element,IGAUserFunction *fun,void **ctx)
 {
 #include "petiga.h"
 
-PETSC_EXTERN PetscLogEvent IGA_FormFunction;
-PETSC_EXTERN PetscLogEvent IGA_FormJacobian;
-
 PETSC_STATIC_INLINE
 PetscBool IGAElementNextUserIFunction(IGAElement element,IGAUserIFunction *fun,void **ctx)
 {
   ierr = IGAGetLocalVecArray(iga,vecV,&localV,&arrayV);CHKERRQ(ierr);
   ierr = IGAGetLocalVecArray(iga,vecU,&localU,&arrayU);CHKERRQ(ierr);
 
-  ierr = PetscLogEventBegin(IGA_FormFunction,iga,vecV,vecU,vecF);CHKERRQ(ierr);
+  ierr = PetscLogEventBegin(IGA_FormIFunction,iga,vecV,vecU,vecF);CHKERRQ(ierr);
 
   /* Element loop */
   ierr = IGABeginElement(iga,&element);CHKERRQ(ierr);
   }
   ierr = IGAEndElement(iga,&element);CHKERRQ(ierr);
 
-  ierr = PetscLogEventEnd(IGA_FormFunction,iga,vecV,vecU,vecF);CHKERRQ(ierr);
+  ierr = PetscLogEventEnd(IGA_FormIFunction,iga,vecV,vecU,vecF);CHKERRQ(ierr);
 
   /* Restore local vectors V,U and arrays */
   ierr = IGARestoreLocalVecArray(iga,vecV,&localV,&arrayV);CHKERRQ(ierr);
   ierr = IGAGetLocalVecArray(iga,vecV,&localV,&arrayV);CHKERRQ(ierr);
   ierr = IGAGetLocalVecArray(iga,vecU,&localU,&arrayU);CHKERRQ(ierr);
 
-  ierr = PetscLogEventBegin(IGA_FormJacobian,iga,vecV,vecU,matJ);CHKERRQ(ierr);
+  ierr = PetscLogEventBegin(IGA_FormIJacobian,iga,vecV,vecU,matJ);CHKERRQ(ierr);
 
   /* Element Loop */
   ierr = IGABeginElement(iga,&element);CHKERRQ(ierr);
   }
   ierr = IGAEndElement(iga,&element);CHKERRQ(ierr);
 
-  ierr = PetscLogEventEnd(IGA_FormJacobian,iga,vecV,vecU,matJ);CHKERRQ(ierr);
+  ierr = PetscLogEventEnd(IGA_FormIJacobian,iga,vecV,vecU,matJ);CHKERRQ(ierr);
 
   /* Get local vectors V,U and arrays */
   ierr = IGARestoreLocalVecArray(iga,vecV,&localV,&arrayV);CHKERRQ(ierr);
   ierr = IGAGetLocalVecArray(iga,vecU,&localU,&arrayU);CHKERRQ(ierr);
   ierr = IGAGetLocalVecArray(iga,vecU0,&localU0,&arrayU0);CHKERRQ(ierr);
 
-  ierr = PetscLogEventBegin(IGA_FormFunction,iga,vecV,vecU,vecF);CHKERRQ(ierr);
+  ierr = PetscLogEventBegin(IGA_FormIFunction,iga,vecV,vecU,vecF);CHKERRQ(ierr);
 
   /* Element loop */
   ierr = IGABeginElement(iga,&element);CHKERRQ(ierr);
   }
   ierr = IGAEndElement(iga,&element);CHKERRQ(ierr);
 
-  ierr = PetscLogEventEnd(IGA_FormFunction,iga,vecV,vecU,vecF);CHKERRQ(ierr);
+  ierr = PetscLogEventEnd(IGA_FormIFunction,iga,vecV,vecU,vecF);CHKERRQ(ierr);
 
   /* Restore local vectors V,U,U0 and arrays */
   ierr = IGARestoreLocalVecArray(iga,vecV,&localV,&arrayV);CHKERRQ(ierr);
   ierr = IGAGetLocalVecArray(iga,vecU,&localU,&arrayU);CHKERRQ(ierr);
   ierr = IGAGetLocalVecArray(iga,vecU0,&localU0,&arrayU0);CHKERRQ(ierr);
 
-  ierr = PetscLogEventBegin(IGA_FormJacobian,iga,vecV,vecU,matJ);CHKERRQ(ierr);
+  ierr = PetscLogEventBegin(IGA_FormIJacobian,iga,vecV,vecU,matJ);CHKERRQ(ierr);
 
   /* Element Loop */
   ierr = IGABeginElement(iga,&element);CHKERRQ(ierr);
   }
   ierr = IGAEndElement(iga,&element);CHKERRQ(ierr);
 
-  ierr = PetscLogEventEnd(IGA_FormJacobian,iga,vecV,vecU,matJ);CHKERRQ(ierr);
+  ierr = PetscLogEventEnd(IGA_FormIJacobian,iga,vecV,vecU,matJ);CHKERRQ(ierr);
 
   /* Restore local vectors V,U,U0 and arrays */
   ierr = IGARestoreLocalVecArray(iga,vecV,&localV,&arrayV);CHKERRQ(ierr);
 #include "petiga.h"
 #include "petscts2.h"
 
-PETSC_EXTERN PetscLogEvent IGA_FormFunction;
-PETSC_EXTERN PetscLogEvent IGA_FormJacobian;
-
 PETSC_STATIC_INLINE
 PetscBool IGAElementNextUserIFunction(IGAElement element,IGAUserIFunction2 *fun,void **ctx)
 {
   ierr = IGAGetLocalVecArray(iga,vecV,&localV,&arrayV);CHKERRQ(ierr);
   ierr = IGAGetLocalVecArray(iga,vecU,&localU,&arrayU);CHKERRQ(ierr);
 
-  ierr = PetscLogEventBegin(IGA_FormFunction,iga,vecV,vecU,vecF);CHKERRQ(ierr);
+  ierr = PetscLogEventBegin(IGA_FormIFunction,iga,vecV,vecU,vecF);CHKERRQ(ierr);
 
   /* Element loop */
   ierr = IGABeginElement(iga,&element);CHKERRQ(ierr);
   }
   ierr = IGAEndElement(iga,&element);CHKERRQ(ierr);
 
-  ierr = PetscLogEventEnd(IGA_FormFunction,iga,vecV,vecU,vecF);CHKERRQ(ierr);
+  ierr = PetscLogEventEnd(IGA_FormIFunction,iga,vecV,vecU,vecF);CHKERRQ(ierr);
 
   /* Restore local vectors V,U and arrays */
   ierr = IGARestoreLocalVecArray(iga,vecA,&localA,&arrayA);CHKERRQ(ierr);
   ierr = IGAGetLocalVecArray(iga,vecV,&localV,&arrayV);CHKERRQ(ierr);
   ierr = IGAGetLocalVecArray(iga,vecU,&localU,&arrayU);CHKERRQ(ierr);
 
-  ierr = PetscLogEventBegin(IGA_FormJacobian,iga,vecV,vecU,matJ);CHKERRQ(ierr);
+  ierr = PetscLogEventBegin(IGA_FormIJacobian,iga,vecV,vecU,matJ);CHKERRQ(ierr);
 
   /* Element Loop */
   ierr = IGABeginElement(iga,&element);CHKERRQ(ierr);
   }
   ierr = IGAEndElement(iga,&element);CHKERRQ(ierr);
 
-  ierr = PetscLogEventEnd(IGA_FormJacobian,iga,vecV,vecU,matJ);CHKERRQ(ierr);
+  ierr = PetscLogEventEnd(IGA_FormIJacobian,iga,vecV,vecU,matJ);CHKERRQ(ierr);
 
   /* Restore local vectors A,V,U and arrays */
   ierr = IGARestoreLocalVecArray(iga,vecA,&localA,&arrayA);CHKERRQ(ierr);