Commits

Jungho Lee  committed a983c5a Merge

Merge branch 'master' of bitbucket.org:petsc/petsc

  • Participants
  • Parent commits 312f529, 451b912

Comments (1)

Files changed (126)

 docs/manual.pdf
 docs/developers.pdf
 docs/troubleshooting.html
-src/docs/tex/manual/anchors
-src/docs/tex/manual/developerstmp.{aux,idx,out,tex}
-src/docs/tex/manual/intro.{aux,out,pdf}
-src/docs/tex/manual/manual1.{aux,bbl,blg,idx,ilg,ind,out,toc,tex}
+src/docs/website/publications/generated_topics.html
 src/dm/mesh/examples/tests/unitTests
 src/dm/mesh/examples/tutorials/*_quadrature.h
 src/dm/mesh/examples/tutorials/*.vtk
 testexamples_PTHREADCLASSES:
 testexamples_OPENMP:
 testexamples_NETCDF:
+testexamples_EXODUSII:
+testexamples_PCBDDC:
 
 buildexamples_C:
 	-@${OMAKE} testexamples_C TESTEXAMPLES_C=`echo ${TESTEXAMPLES_C} | sed s/runex[0-9]*[a-z0-9_]*//g`

File config/BuildSystem/config/package.py

         args.append('--with-'+d.package+'='+d.directory)
     for d in self.odeps:
       if hasattr(d,'found') and d.found:
-        args.append('--with-'+d.package+'='+d.directory)
+        if d.directory:
+          args.append('--with-'+d.package+'='+d.directory)
+        else:
+          args.append('--with-'+d.package)
+      else:
+        args.append('--without-'+d.package)
     return args
 
   def formGNUConfigureArgs(self):
         args.append('--disable-f90')
       args.append('F77="'+fc+'"')
       args.append('FFLAGS="'+self.getCompilerFlags().replace('-Mfree','')+'"')
+      args.append('FC="'+fc+'"')
+      args.append('FCLAGS="'+self.getCompilerFlags().replace('-Mfree','')+'"')
       self.popLanguage()
     else:
+      args.append('--disable-fortran')
+      args.append('--disable-fc')
       args.append('--disable-f77')
       args.append('--disable-f90')
     if self.framework.argDB['with-shared-libraries'] or self.framework.argDB['download-'+self.package+'-shared']:
-      if self.compilers.isGCC or config.setCompilers.Configure.isIntel(compiler):
-        if config.setCompilers.Configure.isDarwin():
-          args.append('--enable-sharedlibs=gcc-osx')
-        else:
-          args.append('--enable-sharedlibs=gcc')
-      elif config.setCompilers.Configure.isSun(compiler):
-        args.append('--enable-sharedlibs=solaris-cc')
-      else:
-        args.append('--enable-sharedlibs=libtool')
+      args.append('--enable-shared')
     else:
-        args.append('--disable-shared')
+      args.append('--disable-shared')
     args.extend(self.formGNUConfigureDepArgs())
     args.extend(self.formGNUConfigureExtraArgs())
     return args

File config/BuildSystem/config/packages/MOAB.py

     self.downloadfilename  = 'moab'
     self.downloadversion   = 'nightly'
     self.downloadext       = 'tar.gz'
-
-    self.functions         = ['iMesh_newMesh']
-    self.functionsFortran  = 1
-    self.includes          = ['iMesh.h']
-    self.liblist           = [['libiMesh.a', 'libMOAB.a']]
+    self.functions         = ['Core']
+    self.functionsCxx     = [1, 'namespace moab {class Core {public: Core();};}','moab::Core *mb = new moab::Core()']
+    self.includes          = ['moab/Core.hpp']
+    self.liblist           = [['libiMesh.a', 'libMOAB.a'],['libMOAB.a']]
     self.cxx               = 1
     return
 

File config/BuildSystem/config/packages/PETSc.py

   def checkWorkingLink(self):
     '''Checking that we can link a PETSc executable'''
     self.pushLanguage(self.languages.clanguage)
-    if not self.checkPETScLink('#include <petsclog.h>\n', 'PetscLogDouble time;\nPetscErrorCode ierr;\n\nierr = PetscGetTime(&time);CHKERRQ(ierr);\n'):
+    if not self.checkPETScLink('#include <petsctime.h>\n', 'PetscLogDouble time;\nPetscErrorCode ierr;\n\nierr = PetscTime(&time);CHKERRQ(ierr);\n'):
       self.logPrint('PETSc cannot link, which indicates a problem with the PETSc installation')
       return 0
     self.logPrint('PETSc can link with '+self.languages.clanguage)
     if hasattr(self.compilers, 'CXX') and self.languages.clanguage == 'C':
       self.pushLanguage('C++')
       self.sourceExtension = '.C'
-      if not self.checkPETScLink('#define PETSC_USE_EXTERN_CXX\n#include <petsc.h>\n', 'PetscLogDouble time;\nPetscErrorCode ierr;\n\nierr = PetscGetTime(&time);CHKERRQ(ierr);\n'):
+      if not self.checkPETScLink('#define PETSC_USE_EXTERN_CXX\n#include <petsc.h>\n', 'PetscLogDouble time;\nPetscErrorCode ierr;\n\nierr = PetscTime(&time);CHKERRQ(ierr);\n'):
         self.logPrint('PETSc cannot link C++ but can link C, which indicates a problem with the PETSc installation')
         self.popLanguage()
         return 0
     if hasattr(self.compilers, 'FC'):
       self.pushLanguage('FC')
       self.sourceExtension = '.F'
-      if not self.checkPETScLink('', '          integer ierr\n          real time\n          call PetscGetTime(time, ierr)\n'):
+      if not self.checkPETScLink('', '          integer ierr\n          real time\n          call PetscTime(time, ierr)\n'):
         self.logPrint('PETSc cannot link Fortran, but can link C, which indicates a problem with the PETSc installation\nRun with -with-fc=0 if you do not wish to use Fortran')
         self.popLanguage()
         return 0

File config/BuildSystem/config/packages/hdf5.py

       args.append('F9X="'+self.setCompilers.getCompiler()+'"')
       args.append('F90="'+self.setCompilers.getCompiler()+'"')
       self.setCompilers.popLanguage()
+    if self.framework.argDB['with-shared-libraries']:
+      args.append('--enable-shared')
+    else:
+      args.append('--disable-shared')
 
     args = ' '.join(args)
     fd = file(os.path.join(self.packageDir,'hdf5'), 'w')

File config/BuildSystem/config/packages/netcdf.py

     args = []
     args.append('AR="'+self.setCompilers.AR+'"')
     args.append('ARFLAGS="'+self.setCompilers.AR_FLAGS+'"')
-    args.append('CPPFLAGS="'+self.headers.toString(self.hdf5.include)+'"')
-    args.append('LIBS="'+self.libraries.toString(self.hdf5.lib)+'"')
     args.append('--libdir='+os.path.join(self.installDir,self.libdir))
+    if hasattr(self.hdf5,'found') and self.hdf5.found:
+      args.append('CPPFLAGS="'+self.headers.toString(self.hdf5.include)+'"')
+      args.append('LIBS="'+self.libraries.toString(self.hdf5.lib)+'"')
+      args.append('--enable-netcdf-4')
+    else:
+      args.append('--disable-netcdf-4')
     args.append('--disable-dap')
     args.append('--disable-hdf4')
-    args.append('--enable-netcdf-4')
     return args

File config/PETSc/Configure.py

       except (ImportError, KeyError), e:
         self.framework.logPrint('Importing cmakeboot failed:\n' + str(e))
       if self.cmakeboot_success:
-        if self.framework.argDB['with-cuda']: # Our CMake build does not support CUDA at this time
-          self.framework.logPrint('CMake configured successfully, but could not be used by default because --with-cuda was used\n')
-        elif hasattr(self.compilers, 'FC') and self.compilers.fortranIsF90 and not self.setCompilers.fortranModuleOutputFlag:
+        if hasattr(self.compilers, 'FC') and self.compilers.fortranIsF90 and not self.setCompilers.fortranModuleOutputFlag:
           self.framework.logPrint('CMake configured successfully, but could not be used by default because of missing fortranModuleOutputFlag\n')
         else:
           self.framework.logPrint('CMake configured successfully, using as default build\n')

File config/PETSc/packages/PTScotch.py

 class Configure(PETSc.package.NewPackage):
   def __init__(self, framework):
     PETSc.package.NewPackage.__init__(self, framework)
-    #'https://gforge.inria.fr/frs/download.php/28978/scotch_5.1.12b_esmumps.tar.gz'
-    self.download     = ['http://ftp.mcs.anl.gov/pub/petsc/externalpackages/scotch_5.1.12b_esmumps-p1.tar.gz']
+    self.download     = ['https://gforge.inria.fr/frs/download.php/31832/scotch_6.0.0_esmumps.tar.gz',
+                         'http://ftp.mcs.anl.gov/pub/petsc/externalpackages/scotch_6.0.0_esmumps.tar.gz']
     self.downloadfilename = 'scotch'
-    self.liblist      = [['libptesmumps.a', 'libptscotch.a','libptscotcherr.a']]
+    self.liblist      = [['libptesmumps.a','libptscotch.a','libptscotcherr.a','libscotch.a','libscotcherr.a']]
     self.functions    = ['SCOTCH_archBuild']
     self.includes     = ['ptscotch.h']
     self.requires32bitint = 0
     if self.libraries.add('-lz','gzwrite'):
       self.cflags = self.cflags + ' -DCOMMON_FILE_COMPRESS_GZ'
       ldflags += ' -lz'
-    if self.libraries.add('-lpthread','pthread_key_create'):
+    # OSX does not have pthread_barrierattr_t - so check for that
+    if self.libraries.add('-lpthread','pthread_barrierattr_t'):
       self.cflags = self.cflags + ' -DCOMMON_PTHREAD'
       ldflags += ' -lpthread'
     if self.libraries.add('-lm','sin'): ldflags += ' -lm'
     if self.libraries.add('-lrt','timer_create'): ldflags += ' -lrt'
-    self.cflags = self.cflags + '-DCOMMON_RANDOM_FIXED_SEED'
+    self.cflags = self.cflags + ' -DCOMMON_RANDOM_FIXED_SEED'
     # do not use -DSCOTCH_PTHREAD because requires MPI built for threads.
     self.cflags = self.cflags + ' -DSCOTCH_RENAME -Drestrict="" '
     # this is needed on the Mac, because common2.c includes common.h which DOES NOT include mpi.h because
 #        output,err,ret  = PETSc.package.NewPackage.executeShellCommand('cd '+os.path.join(self.packageDir,'src')+' && make clean scotch ptscotch', timeout=2500, log = self.framework.log)
 #
         if self.mpi.found:
-          output,err,ret  = PETSc.package.NewPackage.executeShellCommand('cd '+os.path.join(self.packageDir,'src')+' && make clean ptscotch', timeout=2500, log = self.framework.log)
+          output,err,ret  = PETSc.package.NewPackage.executeShellCommand('cd '+os.path.join(self.packageDir,'src')+' && make clean ptesmumps', timeout=2500, log = self.framework.log)
         else:
-          output,err,ret  = PETSc.package.NewPackage.executeShellCommand('cd '+os.path.join(self.packageDir,'src')+' && make clean scotch', timeout=2500, log = self.framework.log)
+          output,err,ret  = PETSc.package.NewPackage.executeShellCommand('cd '+os.path.join(self.packageDir,'src')+' && make clean esmumps', timeout=2500, log = self.framework.log)
       except RuntimeError, e:
         raise RuntimeError('Error running make on PTScotch: '+str(e))
 

File config/PETSc/petsc.py

   def checkWorkingLink(self):
     '''Checking that we can link a PETSc executable'''
     self.pushLanguage(self.languages.clanguage)
-    if not self.checkPETScLink('#include <petsclog.h>\n', 'PetscLogDouble time;\nPetscErrorCode ierr;\n\nierr = PetscGetTime(&time);CHKERRQ(ierr);\n'):
+    if not self.checkPETScLink('#include <petsctime.h>\n', 'PetscLogDouble time;\nPetscErrorCode ierr;\n\nierr = PetscTime(&time);CHKERRQ(ierr);\n'):
       self.logPrint('PETSc cannot link, which indicates a problem with the PETSc installation')
       return 0
     self.logPrint('PETSc can link with '+self.languages.clanguage)
     if hasattr(self.compilers, 'CXX') and self.languages.clanguage == 'C':
       self.pushLanguage('C++')
       self.sourceExtension = '.C'
-      if not self.checkPETScLink('#include <petscsys.h>\n', 'PetscLogDouble time;\nPetscErrorCode ierr;\n\nierr = PetscGetTime(&time);CHKERRQ(ierr);\n'):
+      if not self.checkPETScLink('#include <petsctime.h>\n', 'PetscLogDouble time;\nPetscErrorCode ierr;\n\nierr = PetscTime(&time);CHKERRQ(ierr);\n'):
         self.logPrint('PETSc cannot link C++ but can link C, which indicates a problem with the PETSc installation')
         self.popLanguage()
         return 0
     if hasattr(self.compilers, 'FC'):
       self.pushLanguage('FC')
       self.sourceExtension = '.F'
-      if not self.checkPETScLink('', '          integer ierr\n          real time\n          call PetscGetTime(time, ierr)\n'):
+      if not self.checkPETScLink('', '          integer ierr\n          real time\n          call PetscTime(time, ierr)\n'):
         self.logPrint('PETSc cannot link Fortran, but can link C, which indicates a problem with the PETSc installation\nRun with -with-fc=0 if you do not wish to use Fortran')
         self.popLanguage()
         return 0

File config/cmakeboot.py

    langlist = [('C','C')]
    if hasattr(self.compilers,'FC'):
      langlist.append(('FC','Fortran'))
+   if hasattr(self.compilers,'CUDAC'):
+     langlist.append(('CUDA','CUDA'))
    if (self.languages.clanguage == 'Cxx'):
      langlist.append(('Cxx','CXX'))
    win32fe = None
    for petsclanguage,cmakelanguage in langlist:
      self.setCompilers.pushLanguage(petsclanguage)
      compiler = self.setCompilers.getCompiler()
-     flags = [self.setCompilers.getCompilerFlags(),
-              self.setCompilers.CPPFLAGS,
-              self.CHUD.CPPFLAGS]
-     if compiler.split()[0].endswith('win32fe'): # Hack to support win32fe without changing the rest of configure
-       win32fe = compiler.split()[0] + '.exe'
-       compiler = ' '.join(compiler.split()[1:])
-     options.append('-DCMAKE_'+cmakelanguage+'_COMPILER:FILEPATH=' + compiler)
-     options.append('-DCMAKE_'+cmakelanguage+'_FLAGS:STRING=' + ''.join(flags))
-     self.setCompilers.popLanguage()
-   options.append('-DCMAKE_AR='+self.setCompilers.AR)
+     if (cmakelanguage == 'CUDA'):
+       self.cuda = self.framework.require('PETSc.packages.cuda',       None)
+       if (self.cuda.directory != None):
+         options.append('CUDA_TOOLKIT_ROOT_DIR ' + self.cuda.directory + ' CACHE FILEPATH')
+       options.append('CUDA_NVCC_FLAGS ' + self.setCompilers.getCompilerFlags() + ' CACHE STRING')
+     else:
+       flags = [self.setCompilers.getCompilerFlags(),
+                self.setCompilers.CPPFLAGS,
+                self.CHUD.CPPFLAGS]
+       if compiler.split()[0].endswith('win32fe'): # Hack to support win32fe without changing the rest of configure
+         win32fe = compiler.split()[0] + '.exe'
+         compiler = ' '.join(compiler.split()[1:])
+       options.append('CMAKE_'+cmakelanguage+'_COMPILER ' + compiler + ' CACHE FILEPATH')
+       options.append('CMAKE_'+cmakelanguage+'_FLAGS "' + ''.join(flags) + '" CACHE STRING')
+       if (petsclanguage == self.languages.clanguage): #CUDA host compiler is fed with the flags for the standard host compiler
+         flagstring = ''
+         for flag in flags:
+           for f in flag.split():
+             flagstring += ',' + f
+         options.append('PETSC_CUDA_HOST_FLAGS ' + flagstring + ' CACHE STRING')
+       self.setCompilers.popLanguage()
+   options.append('CMAKE_AR '+self.setCompilers.AR + " CACHE FILEPATH")
    ranlib = shlex.split(self.setCompilers.RANLIB)[0]
-   options.append('-DCMAKE_RANLIB='+ranlib)
+   options.append('CMAKE_RANLIB '+ranlib + " CACHE FILEPATH")
+   if win32fe:
+     options.append('PETSC_WIN32FE %s' % win32fe)
+     
+   archdir = os.path.join(self.petscdir.dir, self.arch.arch)
+   initial_cache_filename = os.path.join(archdir, 'initial_cache_file.cmake')  
+   cmd = [self.cmake.cmake, '--trace', '--debug-output', '-C' + str(initial_cache_filename), '-DPETSC_CMAKE_ARCH:STRING='+str(self.arch.arch), self.petscdir.dir] + args
    if win32fe:
-     options.append('-DPETSC_WIN32FE:FILEPATH=%s'%win32fe)
      # Default on Windows is to generate Visual Studio project files, but
      # 1. the build process for those is different, need to give different build instructions
      # 2. the current WIN32FE workaround does not work with VS project files
-     options.append('-GUnix Makefiles')
-   cmd = [self.cmake.cmake, '--trace', '--debug-output', self.petscdir.dir] + map(lambda x:x.strip(), options) + args
-   archdir = os.path.join(self.petscdir.dir, self.arch.arch)
+     cmd.append('-GUnix Makefiles')
+
+   # Create inital cache file:
+   initial_cache_file = open(initial_cache_filename, 'w')
+   self.logPrint('Contents of initial cache file %s :' % initial_cache_filename)
+   for option in options:
+     initial_cache_file.write('SET (' + option + ' "Dummy comment" FORCE)\n')
+     self.logPrint('SET (' + option + ' "Dummy comment" FORCE)\n')
+   initial_cache_file.close()   
    try:
      # Try to remove the old cache because some versions of CMake lose CMAKE_C_FLAGS when reconfiguring this way
+     self.logPrint('Removing: %s' % os.path.join(archdir, 'CMakeCache.txt'))
      os.remove(os.path.join(archdir, 'CMakeCache.txt'))
    except OSError:
      pass
    self.logPrint('Removing: %s' % os.path.join(archdir, 'CMakeFiles', version.vstring))
    shutil.rmtree(os.path.join(archdir, 'CMakeFiles', version.vstring), ignore_errors=True)
    log.write('Invoking: %s\n' % cmd)
-   output,error,retcode = self.executeShellCommand(cmd, checkCommand = noCheck, log=log, cwd=archdir,timeout=30)
+   output,error,retcode = self.executeShellCommand(cmd, checkCommand = noCheck, log=log, cwd=archdir,timeout=300)
    if retcode:
      self.logPrintBox('CMake setup incomplete (status %d), falling back to legacy build' % (retcode,))
      self.logPrint('Output: '+output+'\nError: '+error)

File config/cmakegen.py

                           'symmetric diff',sorted(smdirs.symmetric_difference(sdirs))))
   def compareSourceLists(msources, files):
     smsources = set(msources)
-    ssources  = set(f for f in files if os.path.splitext(f)[1] in ['.c', '.cxx', '.cc', '.cpp', '.F'])
+    ssources  = set(f for f in files if os.path.splitext(f)[1] in ['.c', '.cxx', '.cc', '.cu', '.cpp', '.F'])
     if not smsources.issubset(ssources):
       MISTAKES.append('Makefile contains file not on filesystem: %s: %r' % (root, sorted(smsources - ssources)))
     if not VERBOSE: return
       conditions.update(set(tuple(stripsplit(line)) for line in lines if line.startswith('#requires')))
     def relpath(filename):
       return os.path.join(root,filename)
+    sourcecu = makevars.get('SOURCECU','').split()
     sourcec = makevars.get('SOURCEC','').split()
     sourcef = makevars.get('SOURCEF','').split()
-    compareSourceLists(sourcec+sourcef, files) # Diagnostic output about unused source files
-    sources[repr(sorted(conditions))].extend(relpath(f) for f in sourcec + sourcef)
+    compareSourceLists(sourcec+sourcef+sourcecu, files) # Diagnostic output about unused source files
+    sources[repr(sorted(conditions))].extend(relpath(f) for f in sourcec + sourcef + sourcecu)
     allconditions[root] = conditions
   return sources
 
   f.write(r'''cmake_minimum_required (VERSION 2.6.2)
 project (PETSc C)
 
-include (${PETSc_BINARY_DIR}/conf/PETScConfig.cmake)
+include (${PETSC_CMAKE_ARCH}/conf/PETScConfig.cmake)
 
 if (PETSC_HAVE_FORTRAN)
   enable_language (Fortran)
   SET(CMAKE_Fortran_ARCHIVE_FINISH "<CMAKE_RANLIB> -c <TARGET> ")
 endif ()
 
+if (PETSC_HAVE_CUDA)
+  find_package (CUDA REQUIRED)
+  set (CUDA_PROPAGATE_HOST_FLAGS OFF)
+  set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} --compiler-options ${PETSC_CUDA_HOST_FLAGS})
+endif ()
+
 include_directories ("${PETSc_SOURCE_DIR}/include" "${PETSc_BINARY_DIR}/include")
 
 add_definitions (-D__INSDIR__= ) # CMake always uses the absolute path
       f.write(body(0))
   f.write('''
 if (NOT PETSC_USE_SINGLE_LIBRARY)
-  add_library (petsc%(pkg)s ${PETSC%(PKG)s_SRCS})
+  if (PETSC_HAVE_CUDA)
+    cuda_add_library (petsc%(pkg)s ${PETSC%(PKG)s_SRCS})
+  else ()
+    add_library (petsc%(pkg)s ${PETSC%(PKG)s_SRCS})
+  endif ()
   target_link_libraries (petsc%(pkg)s %(pkgdeps)s ${PETSC_PACKAGE_LIBS})
   if (PETSC_WIN32FE)
     set_target_properties (petsc%(pkg)s PROPERTIES RULE_LAUNCH_COMPILE "${PETSC_WIN32FE}")
         writePackage(f,pkg,deps.split())
       f.write ('''
 if (PETSC_USE_SINGLE_LIBRARY)
-  add_library (petsc %s)
+  if (PETSC_HAVE_CUDA)
+    cuda_add_library (petsc %(allsrc)s)
+  else ()
+    add_library (petsc %(allsrc)s)
+  endif ()
   target_link_libraries (petsc ${PETSC_PACKAGE_LIBS})
   if (PETSC_WIN32FE)
     set_target_properties (petsc PROPERTIES RULE_LAUNCH_COMPILE "${PETSC_WIN32FE}")
   endif ()
 
 endif ()
-''' % (' '.join([r'${PETSC' + pkg.upper() + r'_SRCS}' for pkg,deps in pkglist]),))
+''' % dict(allsrc=' '.join([r'${PETSC' + pkg.upper() + r'_SRCS}' for pkg,deps in pkglist])))
       f.write('''
 if (PETSC_CLANGUAGE_Cxx)
   foreach (file IN LISTS %s)

File config/examples/arch-freebsd-cxx-pkgs-opt.py

   '--download-umfpack=1',
   '--download-chaco=1',
   '--download-spai=1',
+  '--download-netcdf=1',
+  '--download-moab=1',
   ]
 
 if __name__ == '__main__':

File config/examples/arch-linux-mpich1.py

   sys.path.insert(0, os.path.abspath('config'))
   import configure
   configure_options = [
-    '--with-mpi-dir=/home/petsc/soft/linux-Ubuntu_12.04-x86_64/mpich-1.2.7p1', #intel
+    '--with-mpi-dir=/sandbox/petsc/software/mpich-1.2.7p1', #intel
     '--with-cxx=0',
     '--with-shared-libraries=0',
   ]

File config/examples/arch-linux-pkgs-cxx-mlib.py

   '--download-mumps=1',
   '--download-elemental=1',
   '--download-spai=1',
-  '--download-chaco=1'
+  '--download-chaco=1',
+  '--download-netcdf=1',
+  '--download-hdf5=1',
+  '--download-moab=1',
   ]
 
 if __name__ == '__main__':

File config/examples/arch-osx-10.6-cxx-pkgs-opt.py

   '--download-umfpack=1',
   '--download-chaco=1',
   '--download-spai=1',
+  '--download-moab=1',
   ]
 
 if __name__ == '__main__':

File include/petsc-private/dmimpl.h

   PetscErrorCode (*setup)(DM);
   PetscErrorCode (*createglobalvector)(DM,Vec*);
   PetscErrorCode (*createlocalvector)(DM,Vec*);
-  PetscErrorCode (*createlocaltoglobalmapping)(DM);
-  PetscErrorCode (*createlocaltoglobalmappingblock)(DM);
+  PetscErrorCode (*getlocaltoglobalmapping)(DM);
+  PetscErrorCode (*getlocaltoglobalmappingblock)(DM);
   PetscErrorCode (*createfieldis)(DM,PetscInt*,char***,IS**);
   PetscErrorCode (*createcoordinatedm)(DM,DM*);
 

File include/petsc-private/pcimpl.h

   PetscErrorCode (*modifysubmatrices)(PC,PetscInt,const IS[],const IS[],Mat[],void*); /* user provided routine */
   void           *modifysubmatricesP; /* context for user routine */
   void           *data;
-  PetscInt       reuse; /* flag for reusing the numerical factorization */
   PetscInt       presolvedone;  /* has PCPreSolve() already been run */
   void           *user;             /* optional user-defined context */
 };

File include/petsc-private/viewerimpl.h

 struct _p_PetscViewer {
   PETSCHEADER(struct _PetscViewerOps);
   PetscViewerFormat format,formats[10];
-  int               iformat;
+  int               iformat;   /* number of formats that have been pushed on formats[] stack */
   void              *data;
 };
 

File include/petsccusp.h

 #if !defined(__PETSCCUSP_H)
 #define __PETSCCUSP_H
-/*
-    This should only be included in user code that uses CUSP directly and hence the file name ends with .cu
-*/
-#include <../src/vec/vec/impls/dvecimpl.h>
-#include <../src/vec/vec/impls/seq/seqcusp/cuspvecimpl.h>
+
+#include <petscsys.h>
+#include <petscmath.h>
+#include <petscvec.h>
+#include <cusp/array1d.h>
+
+PETSC_EXTERN PetscErrorCode VecCUSPGetArrayReadWrite(Vec v, cusp::array1d<PetscScalar,cusp::device_memory> **a);
+PETSC_EXTERN PetscErrorCode VecCUSPRestoreArrayReadWrite(Vec v, cusp::array1d<PetscScalar,cusp::device_memory> **a);
+
+PETSC_EXTERN PetscErrorCode VecCUSPGetArrayRead(Vec v, cusp::array1d<PetscScalar,cusp::device_memory> **a);
+PETSC_EXTERN PetscErrorCode VecCUSPRestoreArrayRead(Vec v, cusp::array1d<PetscScalar,cusp::device_memory> **a);
+
+PETSC_EXTERN PetscErrorCode VecCUSPGetArrayWrite(Vec v, cusp::array1d<PetscScalar,cusp::device_memory> **a);
+PETSC_EXTERN PetscErrorCode VecCUSPRestoreArrayWrite(Vec v, cusp::array1d<PetscScalar,cusp::device_memory> **a);
+
 #endif

File include/petscmat.h

 */
 #ifdef PETSC_HAVE_MUMPS
 PETSC_EXTERN PetscErrorCode MatMumpsSetIcntl(Mat,PetscInt,PetscInt);
+PETSC_EXTERN PetscErrorCode MatMumpsSetCntl(Mat,PetscInt,PetscReal);
 #endif
 
 /*

File include/petscoptions.h

 PETSC_EXTERN PetscErrorCode PetscOptionsInsert(int*,char ***,const char[]);
 PETSC_EXTERN PetscErrorCode PetscOptionsInsertFile(MPI_Comm,const char[],PetscBool );
 #if defined(PETSC_HAVE_YAML)
-PETSC_EXTERN PetscErrorCode PetscOptionsInsertFile_YAML(MPI_Comm,const char[],PetscBool);
+PETSC_EXTERN PetscErrorCode PetscOptionsInsertFileYAML(MPI_Comm,const char[],PetscBool);
 #endif
 PETSC_EXTERN PetscErrorCode PetscOptionsInsertString(const char[]);
 PETSC_EXTERN PetscErrorCode PetscOptionsDestroy(void);

File include/petscsys.h

 PETSC_EXTERN PetscErrorCode PetscMemorySetGetMaximumUsage(void);
 
 PETSC_EXTERN PetscErrorCode PetscInfoAllow(PetscBool ,const char []);
-PETSC_EXTERN PetscErrorCode PetscGetTime(PetscLogDouble*);
-PETSC_EXTERN PetscErrorCode PetscGetCPUTime(PetscLogDouble*);
 PETSC_EXTERN PetscErrorCode PetscSleep(PetscReal);
 
 /*

File include/petsctime.h

 
 #if !defined(__PETSCTIME_H)
 #define __PETSCTIME_H
-
 #include <petscsys.h>
-#if defined(PETSC_HAVE_SYS_TIME_H)
-#include <sys/time.h>
-#endif
-#if defined(PETSC_NEEDS_GETTIMEOFDAY_PROTO)
-PETSC_EXTERN int gettimeofday(struct timeval *,struct timezone *);
-#endif
+
+PETSC_EXTERN PetscErrorCode PetscGetCPUTime(PetscLogDouble*);
 
 /* Global counters */
 PETSC_EXTERN PetscLogDouble petsc_BaseTime;
 
    Synopsis:
     #include "petsctime.h"
-   PetscTime(PetscLogDouble v)
+   PetscTime(PetscLogDouble *v)
 
    Not Collective
 
 
    Usage:
      PetscLogDouble v;
-     PetscTime(v);
+     PetscTime(&v);
      .... perform some calculation ...
      printf("Time for operation %g\n",v);
 
 
    Synopsis:
     #include "petsctime.h"
-   PetscTimeSubtract(PetscLogDouble v)
+   PetscTimeSubtract(&PetscLogDouble *v)
 
    Not Collective
 
 
    Synopsis:
     #include "petsctime.h"
-   PetscTimeAdd(PetscLogDouble v)
+   PetscTimeAdd(PetscLogDouble *v)
 
    Not Collective
 
     Some machines have very fast MPI_Wtime()
 */
 #if (defined(PETSC_HAVE_FAST_MPI_WTIME) && !defined(__MPIUNI_H))
-#define PetscTime(v)         (v)=MPI_Wtime();
-
-#define PetscTimeSubtract(v) (v)-=MPI_Wtime();
-
-#define PetscTimeAdd(v)      (v)+=MPI_Wtime();
+PETSC_STATIC_INLINE PetscErrorCode PetscTime(PetscLogDouble *v)
+{
+  *v = MPI_Wtime();
+  return 0;
+}
+
+PETSC_STATIC_INLINE PetscErrorCode PetscTimeSubtract(PetscLogDouble *v)
+{
+  *v -= MPI_Wtime();
+  return 0;
+}
+
+PETSC_STATIC_INLINE PetscErrorCode PetscTimeAdd(PetscLogDouble *v)
+{
+  *v += MPI_Wtime();
+  return 0;
+}
 
 /* ------------------------------------------------------------------
    IBM Power and PowerPC machines have a fast clock read_real_time()
 */
 #elif defined(PETSC_USE_READ_REAL_TIME)
 PETSC_EXTERN PetscLogDouble PetscReadRealTime(void);
-#define PetscTime(v)         (v)=PetscReadRealTime();
 
-#define PetscTimeSubtract(v) (v)-=PetscReadRealTime();
+PETSC_STATIC_INLINE PetscErrorCode PetscTime(PetscLogDouble *v)
+{
+  *v = PetscReadRealTime();
+  return 0;
+}
 
-#define PetscTimeAdd(v)      (v)+=PetscReadRealTime();
+PETSC_STATIC_INLINE PetscErrorCode PetscTimeSubtract(PetscLogDouble *v)
+{
+  *v -= PetscReadRealTime();
+  return 0;
+}
+
+PETSC_STATIC_INLINE PetscErrorCode PetscTimeAdd(PetscLogDouble *v)
+{
+  *v += PetscReadRealTime();
+  return 0;
+}
 
 /* ------------------------------------------------------------------
    Microsoft Windows has its own time routines
 #elif defined (PETSC_USE_MICROSOFT_TIME)
 #include <time.h>
 PETSC_EXTERN PetscLogDouble PetscMicrosoftTime(void);
-#define PetscTime(v)         (v)=PetscMicrosoftTime();
 
-#define PetscTimeSubtract(v) (v)-=PetscMicrosoftTime();
+PETSC_STATIC_INLINE PetscErrorCode PetscTime(PetscLogDouble *v)
+{
+  *v = PetscMicrosoftTime();
+  return 0;
+}
+
+PETSC_STATIC_INLINE PetscErrorCode PetscTimeSubtract(PetscLogDouble *v)
+{
+  *v -= PetscMicrosoftTime();
+  return 0;
+}
 
-#define PetscTimeAdd(v)      (v)+=PetscMicrosoftTime();
+PETSC_STATIC_INLINE PetscErrorCode PetscTimeAdd(PetscLogDouble *v)
+{
+  *v += PetscMicrosoftTime();
+  return 0;
+}
 
 /* ------------------------------------------------------------------
     The usual Unix time routines.
 */
 #else
-#define PetscTime(v)         do {                                       \
-    static struct timeval _tp;                                          \
-    gettimeofday(&_tp,(struct timezone *)0);                            \
-    (v)=((PetscLogDouble)_tp.tv_sec)+(1.0e-6)*(_tp.tv_usec);            \
-  } while (0)
-
-#define PetscTimeSubtract(v) do {                                       \
-    static struct timeval _tp;                                          \
-    gettimeofday(&_tp,(struct timezone *)0);                            \
-    (v)-=((PetscLogDouble)_tp.tv_sec)+(1.0e-6)*(_tp.tv_usec);           \
-  } while (0)
-
-#define PetscTimeAdd(v) do {                                            \
-    static struct timeval _tp;                                          \
-    gettimeofday(&_tp,(struct timezone *)0);                            \
-    (v)+=((PetscLogDouble)_tp.tv_sec)+(1.0e-6)*(_tp.tv_usec);           \
-  } while (0)
+
+#if defined(PETSC_HAVE_SYS_TIME_H)
+#include <sys/time.h>
 #endif
 
+#if defined(PETSC_NEEDS_GETTIMEOFDAY_PROTO)
+PETSC_EXTERN int gettimeofday(struct timeval *,struct timezone *);
 #endif
 
+PETSC_STATIC_INLINE PetscErrorCode PetscTime(PetscLogDouble *v)
+{
+  static struct timeval _tp;
+  gettimeofday(&_tp,(struct timezone *)0);
+  *v = ((PetscLogDouble)_tp.tv_sec)+(1.0e-6)*(_tp.tv_usec);
+  return 0;
+}
+
+PETSC_STATIC_INLINE PetscErrorCode PetscTimeSubtract(PetscLogDouble *v)
+{
+  static struct timeval _tp;
+  gettimeofday(&_tp,(struct timezone *)0);
+  *v -= ((PetscLogDouble)_tp.tv_sec)+(1.0e-6)*(_tp.tv_usec);
+  return 0;
+}
+
+PETSC_STATIC_INLINE PetscErrorCode PetscTimeAdd(PetscLogDouble *v)
+{
+  static struct timeval _tp;
+  gettimeofday(&_tp,(struct timezone *)0);
+  *v += ((PetscLogDouble)_tp.tv_sec)+(1.0e-6)*(_tp.tv_usec);
+  return 0;
+}
 
+#endif
+
+#endif
 
 
 
         datestr=`git log -1 --pretty=format:%ci | cut -d ' ' -f 1`; \
         export datestr; \
         find * -type d -wholename src/docs/website -prune -o -type d -wholename src/benchmarks/results -prune -o \
+          -type d -wholename config/BuildSystem/docs/website -prune -o -type d -wholename include/web -prune -o \
           -type d -wholename 'arch-*' -prune -o -type d -wholename src/tops -prune -o -type d -wholename externalpackages -prune -o \
           -type f -wholename tutorials/multiphysics/tutorial.html -prune -o -type f -name \*.html \
           -exec perl -pi -e 's^(<body.*>)^$$1\n   <div id=\"version\" align=right><b>$$ENV{petscversion} $$ENV{datestr}</b></div>^i' {} \; \

File src/benchmarks/Index.c

 
 #include <petscsys.h>
+#include <petsctime.h>
+
 
 extern int BlastCache(void);
 extern int test1(void);
 
 
   /* Take care of paging effects */
-  ierr = PetscGetTime(&t1);CHKERRQ(ierr);
+  ierr = PetscTime(&t1);CHKERRQ(ierr);
 
   /* Form the random set of integers */
   for (i=0; i<2000; i++) {
 
   ierr = BlastCache();CHKERRQ(ierr);
 
-  ierr = PetscGetTime(&t1);CHKERRQ(ierr);
+  ierr = PetscTime(&t1);CHKERRQ(ierr);
   for (i=0; i<2000; i++) x[i] = y[i];
-  ierr = PetscGetTime(&t2);CHKERRQ(ierr);
+  ierr = PetscTime(&t2);CHKERRQ(ierr);
   fprintf(stdout,"%-27s : %e sec\n","x[i] = y[i]",(t2-t1)/2000.0);
 
   ierr = BlastCache();CHKERRQ(ierr);
 
-  ierr = PetscGetTime(&t1);CHKERRQ(ierr);
+  ierr = PetscTime(&t1);CHKERRQ(ierr);
   for (i=0; i<500; i+=4) {
     x[i]   = y[z[i]];
     x[1+i] = y[z[1+i]];
     x[2+i] = y[z[2+i]];
     x[3+i] = y[z[3+i]];
   }
-  ierr = PetscGetTime(&t2);CHKERRQ(ierr);
+  ierr = PetscTime(&t2);CHKERRQ(ierr);
   fprintf(stdout,"%-27s : %e sec\n","x[i] = y[idx[i]] - unroll 4",(t2-t1)/2000.0);
 
   ierr = BlastCache();CHKERRQ(ierr);
 
-  ierr = PetscGetTime(&t1);CHKERRQ(ierr)
+  ierr = PetscTime(&t1);CHKERRQ(ierr)
   for (i=0; i<2000; i++) x[i] = y[z[i]];
-  ierr = PetscGetTime(&t2);CHKERRQ(ierr);
+  ierr = PetscTime(&t2);CHKERRQ(ierr);
   fprintf(stdout,"%-27s : %e sec\n","x[i] = y[idx[i]]",(t2-t1)/2000.0);
 
   ierr = BlastCache();CHKERRQ(ierr);
 
-  ierr = PetscGetTime(&t1);CHKERRQ(ierr);
+  ierr = PetscTime(&t1);CHKERRQ(ierr);
   for (i=0; i<1000; i+=2) {  x[i] = y[z[i]];  x[1+i] = y[z[1+i]]; }
-  ierr = PetscGetTime(&t2);CHKERRQ(ierr);
+  ierr = PetscTime(&t2);CHKERRQ(ierr);
   fprintf(stdout,"%-27s : %e sec\n","x[i] = y[idx[i]] - unroll 2",(t2-t1)/2000.0);
 
   ierr = BlastCache();CHKERRQ(ierr);
 
-  ierr = PetscGetTime(&t1);CHKERRQ(ierr);
+  ierr = PetscTime(&t1);CHKERRQ(ierr);
   for (i=0; i<2000; i++) x[z[i]] = y[i];
-  ierr = PetscGetTime(&t2);CHKERRQ(ierr);
+  ierr = PetscTime(&t2);CHKERRQ(ierr);
   fprintf(stdout,"%-27s : %e sec\n","x[z[i]] = y[i]",(t2-t1)/2000.0);
 
   ierr = BlastCache();CHKERRQ(ierr);
 
-  ierr = PetscGetTime(&t1);CHKERRQ(ierr);
+  ierr = PetscTime(&t1);CHKERRQ(ierr);
   for (i=0; i<2000; i++) x[z[i]] = y[zi[i]];
-  ierr = PetscGetTime(&t2);CHKERRQ(ierr);
+  ierr = PetscTime(&t2);CHKERRQ(ierr);
   fprintf(stdout,"%-27s : %e sec\n","x[z[i]] = y[zi[i]]",(t2-t1)/2000.0);
 
   ierr = PetscMemcpy(x,y,10);CHKERRQ(ierr);
   ierr = PetscRandomSetFromOptions(r);CHKERRQ(ierr);
 
   /* Take care of paging effects */
-  ierr = PetscGetTime(&t1);CHKERRQ(ierr);
+  ierr = PetscTime(&t1);CHKERRQ(ierr);
 
   for (i=0; i<20000; i++) {
     x[i]  = i;
 
   /* ierr = BlastCache();CHKERRQ(ierr); */
 
-  ierr = PetscGetTime(&t1);CHKERRQ(ierr);
+  ierr = PetscTime(&t1);CHKERRQ(ierr);
   for (i=0; i<2000; i++) x[i] = y[i];
-  ierr = PetscGetTime(&t2);CHKERRQ(ierr);
+  ierr = PetscTime(&t2);CHKERRQ(ierr);
   fprintf(stdout,"%-27s : %e sec\n","x[i] = y[i]",(t2-t1)/2000.0);
 
   /* ierr = BlastCache();CHKERRQ(ierr); */
 
-  ierr = PetscGetTime(&t1);CHKERRQ(ierr);
+  ierr = PetscTime(&t1);CHKERRQ(ierr);
   for (i=0; i<2000; i++) y[i] = x[z[i]];
-  ierr = PetscGetTime(&t2);CHKERRQ(ierr);
+  ierr = PetscTime(&t2);CHKERRQ(ierr);
   fprintf(stdout,"%-27s : %e sec\n","x[i] = y[idx[i]]",(t2-t1)/2000.0);
 
   /* ierr = BlastCache();CHKERRQ(ierr); */
 
-  ierr = PetscGetTime(&t1);CHKERRQ(ierr);
+  ierr = PetscTime(&t1);CHKERRQ(ierr);
   for (i=0; i<2000; i++) x[z[i]] = y[i];
-  ierr = PetscGetTime(&t2);CHKERRQ(ierr);
+  ierr = PetscTime(&t2);CHKERRQ(ierr);
   fprintf(stdout,"%-27s : %e sec\n","x[z[i]] = y[i]",(t2-t1)/2000.0);
 
   /* ierr = BlastCache();CHKERRQ(ierr); */
 
-  ierr = PetscGetTime(&t1);CHKERRQ(ierr);
+  ierr = PetscTime(&t1);CHKERRQ(ierr);
   for (i=0; i<2000; i++) y[z[i]] = x[zi[i]];
-  ierr = PetscGetTime(&t2);CHKERRQ(ierr);
+  ierr = PetscTime(&t2);CHKERRQ(ierr);
   fprintf(stdout,"%-27s : %e sec\n","x[z[i]] = y[zi[i]]",(t2-t1)/2000.0);
 
 

File src/benchmarks/PLogEvent.c

 
 #include <petscsys.h>
+#include <petsctime.h>
 
 #undef __FUNCT__
 #define __FUNCT__ "main"
   PetscInitialize(&argc,&argv,0,0);
   PetscLogEventRegister("*DummyEvent",0,&e1);
   /* To take care of the paging effects */
-  ierr = PetscGetTime(&x);CHKERRQ(ierr);
+  ierr = PetscTime(&x);CHKERRQ(ierr);
   ierr = PetscLogEventBegin(e1,&x,0,0,0);CHKERRQ(ierr);
   ierr = PetscLogEventEnd(e1,&x,0,0,0);CHKERRQ(ierr);
 
-  ierr = PetscGetTime(&x);CHKERRQ(ierr);
+  ierr = PetscTime(&x);CHKERRQ(ierr);
   /* 10 Occurences of the dummy event */
   ierr = PetscLogEventBegin(e1,&x,0,0,0);CHKERRQ(ierr);
   ierr = PetscLogEventEnd(e1,&x,0,0,0);CHKERRQ(ierr);
   ierr = PetscLogEventBegin(e1,&x,&e1,0,0);CHKERRQ(ierr);
   ierr = PetscLogEventEnd(e1,&x,&e1,0,0);CHKERRQ(ierr);
 
-  ierr = PetscGetTime(&y);CHKERRQ(ierr);
+  ierr = PetscTime(&y);CHKERRQ(ierr);
   fprintf(stderr,"%-15s : %e sec, with options : ","PetscLogEvent",(y-x)/10.0);
 
   ierr = PetscOptionsHasName(NULL,"-log",&flg);CHKERRQ(ierr);

File src/benchmarks/PetscGetTime.c

 
 #include <petscsys.h>
+#include <petsctime.h>
 
 #undef __FUNCT__
 #define __FUNCT__ "main"
 
   PetscInitialize(&argc,&argv,0,0);
   /* To take care of paging effects */
-  ierr = PetscGetTime(&y);CHKERRQ(ierr);
+  ierr = PetscTime(&y);CHKERRQ(ierr);
 
   for (i=0; i<2; i++) {
-    ierr = PetscGetTime(&x);CHKERRQ(ierr);
-    ierr = PetscGetTime(&y);CHKERRQ(ierr);
-    ierr = PetscGetTime(&y);CHKERRQ(ierr);
-    ierr = PetscGetTime(&y);CHKERRQ(ierr);
-    ierr = PetscGetTime(&y);CHKERRQ(ierr);
-    ierr = PetscGetTime(&y);CHKERRQ(ierr);
-    ierr = PetscGetTime(&y);CHKERRQ(ierr);
-    ierr = PetscGetTime(&y);CHKERRQ(ierr);
-    ierr = PetscGetTime(&y);CHKERRQ(ierr);
-    ierr = PetscGetTime(&y);CHKERRQ(ierr);
-    ierr = PetscGetTime(&y);CHKERRQ(ierr);
+    ierr = PetscTime(&x);CHKERRQ(ierr);
+    ierr = PetscTime(&y);CHKERRQ(ierr);
+    ierr = PetscTime(&y);CHKERRQ(ierr);
+    ierr = PetscTime(&y);CHKERRQ(ierr);
+    ierr = PetscTime(&y);CHKERRQ(ierr);
+    ierr = PetscTime(&y);CHKERRQ(ierr);
+    ierr = PetscTime(&y);CHKERRQ(ierr);
+    ierr = PetscTime(&y);CHKERRQ(ierr);
+    ierr = PetscTime(&y);CHKERRQ(ierr);
+    ierr = PetscTime(&y);CHKERRQ(ierr);
+    ierr = PetscTime(&y);CHKERRQ(ierr);
 
-    fprintf(stdout,"%-15s : %e sec\n","PetscGetTime",(y-x)/10.0);
+    fprintf(stdout,"%-15s : %e sec\n","PetscTime",(y-x)/10.0);
   }
 
   ierr = PetscFinalize();

File src/benchmarks/PetscMalloc.c

 
 #include <petscsys.h>
+#include <petsctime.h>
 
 #undef __FUNCT__
 #define __FUNCT__ "main"
   /* Take care of paging effects */
   ierr = PetscMalloc(100,&dummy);CHKERRQ(ierr);
   ierr = PetscFree(dummy);CHKERRQ(ierr);
-  ierr = PetscGetTime(&x);CHKERRQ(ierr);
+  ierr = PetscTime(&x);CHKERRQ(ierr);
 
   /* Do all mallocs */
   for (i=0; i< 1000; i++) {
     ierr = PetscMalloc(rand1[i],&arr[i]);CHKERRQ(ierr);
   }
 
-  ierr = PetscGetTime(&x);CHKERRQ(ierr);
+  ierr = PetscTime(&x);CHKERRQ(ierr);
 
   /* Do some frees */
   for (i=0; i< 1000; i+=2) {
   for (i=0; i< 1000; i+=2) {
     ierr = PetscMalloc(rand2[i],&arr[i]);CHKERRQ(ierr);
   }
-  ierr = PetscGetTime(&y);CHKERRQ(ierr);
+  ierr = PetscTime(&y);CHKERRQ(ierr);
 
   for (i=0; i< 1000; i++) {
     ierr = PetscFree(arr[i]);CHKERRQ(ierr);

File src/benchmarks/PetscMemcmp.c

 
 #include <petscsys.h>
+#include <petsctime.h>
 
 #undef __FUNCT__
 #define __FUNCT__ "main"
   }
   /* To take care of paging effects */
   PetscMemcmp(A,B,sizeof(PetscScalar)*0,&flg);
-  ierr = PetscGetTime(&x);CHKERRQ(ierr);
+  ierr = PetscTime(&x);CHKERRQ(ierr);
 
-  ierr = PetscGetTime(&x);CHKERRQ(ierr);
+  ierr = PetscTime(&x);CHKERRQ(ierr);
   PetscMemcmp(A,B,sizeof(PetscScalar)*10000,&flg);
   PetscMemcmp(A,B,sizeof(PetscScalar)*10000,&flg);
   PetscMemcmp(A,B,sizeof(PetscScalar)*10000,&flg);
   PetscMemcmp(A,B,sizeof(PetscScalar)*10000,&flg);
   PetscMemcmp(A,B,sizeof(PetscScalar)*10000,&flg);
   PetscMemcmp(A,B,sizeof(PetscScalar)*10000,&flg);
-  ierr = PetscGetTime(&y);CHKERRQ(ierr);
+  ierr = PetscTime(&y);CHKERRQ(ierr);
   PetscMemcmp(A,B,sizeof(PetscScalar)*0,&flg);
   PetscMemcmp(A,B,sizeof(PetscScalar)*0,&flg);
   PetscMemcmp(A,B,sizeof(PetscScalar)*0,&flg);
   PetscMemcmp(A,B,sizeof(PetscScalar)*0,&flg);
   PetscMemcmp(A,B,sizeof(PetscScalar)*0,&flg);
   PetscMemcmp(A,B,sizeof(PetscScalar)*0,&flg);
-  ierr = PetscGetTime(&z);CHKERRQ(ierr);
+  ierr = PetscTime(&z);CHKERRQ(ierr);
 
   fprintf(stdout,"%s : \n","PetscMemcmp");
   fprintf(stdout,"    %-15s : %e sec\n","Latency",(z-y)/10.0);

File src/benchmarks/PetscMemcpy.c

 
 #include <petscsys.h>
+#include <petsctime.h>
 
 #undef __FUNCT__
 #define __FUNCT__ "main"
   }
   /* To take care of paging effects */
   ierr = PetscMemcpy(A,B,sizeof(PetscScalar)*0);CHKERRQ(ierr);
-  ierr = PetscGetTime(&x);CHKERRQ(ierr);
+  ierr = PetscTime(&x);CHKERRQ(ierr);
 
-  ierr = PetscGetTime(&x);CHKERRQ(ierr);
+  ierr = PetscTime(&x);CHKERRQ(ierr);
   /*
   PetscMemcpy(A,B,sizeof(PetscScalar)*8000000);
   PetscMemcpy(A,B,sizeof(PetscScalar)*8000000);
     for (j = 0; j<10; j++)
       for (i=0; i<8000000; i++) B[i] = A[i];}
 
-  ierr = PetscGetTime(&y);CHKERRQ(ierr);
+  ierr = PetscTime(&y);CHKERRQ(ierr);
   ierr = PetscMemcpy(A,B,sizeof(PetscScalar)*0);CHKERRQ(ierr);
   ierr = PetscMemcpy(A,B,sizeof(PetscScalar)*0);CHKERRQ(ierr);
   ierr = PetscMemcpy(A,B,sizeof(PetscScalar)*0);CHKERRQ(ierr);
   ierr = PetscMemcpy(A,B,sizeof(PetscScalar)*0);CHKERRQ(ierr);
   ierr = PetscMemcpy(A,B,sizeof(PetscScalar)*0);CHKERRQ(ierr);
   ierr = PetscMemcpy(A,B,sizeof(PetscScalar)*0);CHKERRQ(ierr);
-  ierr = PetscGetTime(&z);CHKERRQ(ierr);
+  ierr = PetscTime(&z);CHKERRQ(ierr);
 
   fprintf(stdout,"%s : \n","PetscMemcpy");
   fprintf(stdout,"    %-15s : %e MB/s\n","Bandwidth",10.0*8*8/(y-x));

File src/benchmarks/PetscMemzero.c

 
 #include <petscsys.h>
+#include <petsctime.h>
 
 #undef __FUNCT__
 #define __FUNCT__ "main"
   PetscInitialize(&argc,&argv,0,0);
   /* To take care of paging effects */
   ierr = PetscMemzero(A,sizeof(PetscScalar)*0);CHKERRQ(ierr);
-  ierr = PetscGetTime(&x);CHKERRQ(ierr);
+  ierr = PetscTime(&x);CHKERRQ(ierr);
 
-  ierr = PetscGetTime(&x);CHKERRQ(ierr);
+  ierr = PetscTime(&x);CHKERRQ(ierr);
   ierr = PetscMemzero(A,sizeof(PetscScalar)*10000);CHKERRQ(ierr);
   ierr = PetscMemzero(A,sizeof(PetscScalar)*10000);CHKERRQ(ierr);
   ierr = PetscMemzero(A,sizeof(PetscScalar)*10000);CHKERRQ(ierr);
   ierr = PetscMemzero(A,sizeof(PetscScalar)*10000);CHKERRQ(ierr);
   ierr = PetscMemzero(A,sizeof(PetscScalar)*10000);CHKERRQ(ierr);
   ierr = PetscMemzero(A,sizeof(PetscScalar)*10000);CHKERRQ(ierr);
-  ierr = PetscGetTime(&y);CHKERRQ(ierr);
+  ierr = PetscTime(&y);CHKERRQ(ierr);
   ierr = PetscMemzero(A,sizeof(PetscScalar)*0);CHKERRQ(ierr);
   ierr = PetscMemzero(A,sizeof(PetscScalar)*0);CHKERRQ(ierr);
   ierr = PetscMemzero(A,sizeof(PetscScalar)*0);CHKERRQ(ierr);
   ierr = PetscMemzero(A,sizeof(PetscScalar)*0);CHKERRQ(ierr);
   ierr = PetscMemzero(A,sizeof(PetscScalar)*0);CHKERRQ(ierr);
   ierr = PetscMemzero(A,sizeof(PetscScalar)*0);CHKERRQ(ierr);
-  ierr = PetscGetTime(&z);CHKERRQ(ierr);
+  ierr = PetscTime(&z);CHKERRQ(ierr);
 
   fprintf(stdout,"%s : \n","PetscMemzero");
   fprintf(stdout,"    %-15s : %e sec\n","Latency",(z-y)/10.0);

File src/benchmarks/PetscTime.c

 
   PetscInitialize(&argc,&argv,0,0);
   /* To take care of paging effects */
-  PetscTime(y);
+  PetscTime(&y);
 
   for (i=0; i<2; i++) {
-    PetscTime(x);
-    PetscTime(y);
-    PetscTime(y);
-    PetscTime(y);
-    PetscTime(y);
-    PetscTime(y);
-    PetscTime(y);
-    PetscTime(y);
-    PetscTime(y);
-    PetscTime(y);
-    PetscTime(y);
+    PetscTime(&x);
+    PetscTime(&y);
+    PetscTime(&y);
+    PetscTime(&y);
+    PetscTime(&y);
+    PetscTime(&y);
+    PetscTime(&y);
+    PetscTime(&y);
+    PetscTime(&y);
+    PetscTime(&y);
+    PetscTime(&y);
 
     fprintf(stdout,"%-15s : %e sec\n","PetscTime",(y-x)/10.0);
   }
-  PetscTime(x);
+  PetscTime(&x);
   ierr = PetscSleep(10);CHKERRQ(ierr);
-  PetscTime(y);
+  PetscTime(&y);
   fprintf(stdout,"%-15s : %e sec - Slept for 10 sec \n","PetscTime",(y-x));
 
   ierr = PetscFinalize();

File src/benchmarks/PetscVecNorm.c

 
 #include <petscvec.h>
+#include <petsctime.h>
 
 #undef __FUNCT__
 #define __FUNCT__ "main"
   ierr = VecSetFromOptions(x);CHKERRQ(ierr);
 
   PetscPreLoadBegin(PETSC_TRUE,"VecNorm");
-  ierr = PetscGetTime(&t1);CHKERRQ(ierr);
+  ierr = PetscTime(&t1);CHKERRQ(ierr);
   ierr = VecNorm(x,NORM_2,&norm);CHKERRQ(ierr);
   ierr = VecNorm(x,NORM_2,&norm);CHKERRQ(ierr);
   ierr = VecNorm(x,NORM_2,&norm);CHKERRQ(ierr);
   ierr = VecNorm(x,NORM_2,&norm);CHKERRQ(ierr);
   ierr = VecNorm(x,NORM_2,&norm);CHKERRQ(ierr);
   PetscPreLoadEnd();
-  ierr = PetscGetTime(&t2);CHKERRQ(ierr);
+  ierr = PetscTime(&t2);CHKERRQ(ierr);
 
 
   fprintf(stdout,"%s : \n","VecNorm");

File src/benchmarks/streams/CUDAVersion.cu

 
   scalar=3.0f;
   for (k = 0; k < NTIMES; ++k) {
-    PetscTimeSubtract(cpuTimer);
+    PetscTimeSubtract(&cpuTimer);
     ierr = cudaEventRecord(start, 0);CHKERRQ(ierr);
     STREAM_Copy<<<dimGrid,dimBlock>>>(d_a, d_c, N);
     ierr = cudaEventRecord(stop, 0);CHKERRQ(ierr);
     ierr = cudaEventSynchronize(stop);CHKERRQ(ierr);
     //get the the total elapsed time in ms
-    PetscTimeAdd(cpuTimer);
+    PetscTimeAdd(&cpuTimer);
     if (bDontUseGPUTiming) times[0][k] = cpuTimer;
     else {
       ierr = cudaEventElapsedTime(&times[0][k], start, stop);CHKERRQ(ierr);
     }
 
     cpuTimer = 0.0;
-    PetscTimeSubtract(cpuTimer);
+    PetscTimeSubtract(&cpuTimer);
     ierr = cudaEventRecord(start, 0);CHKERRQ(ierr);
     STREAM_Copy_Optimized<<<dimGrid,dimBlock>>>(d_a, d_c, N);
     ierr = cudaEventRecord(stop, 0);CHKERRQ(ierr);
     ierr = cudaEventSynchronize(stop);CHKERRQ(ierr);
     //get the the total elapsed time in ms
-    PetscTimeAdd(cpuTimer);
+    PetscTimeAdd(&cpuTimer);
     if (bDontUseGPUTiming) times[1][k] = cpuTimer;
     else {
       ierr = cudaEventElapsedTime(&times[1][k], start, stop);CHKERRQ(ierr);
     }
 
     cpuTimer = 0.0;
-    PetscTimeSubtract(cpuTimer);
+    PetscTimeSubtract(&cpuTimer);
     ierr = cudaEventRecord(start, 0);CHKERRQ(ierr);
     STREAM_Scale<<<dimGrid,dimBlock>>>(d_b, d_c, scalar,  N);
     ierr = cudaEventRecord(stop, 0);CHKERRQ(ierr);
     ierr = cudaEventSynchronize(stop);CHKERRQ(ierr);
     //get the the total elapsed time in ms
-    PetscTimeAdd(cpuTimer);
+    PetscTimeAdd(&cpuTimer);
     if (bDontUseGPUTiming) times[2][k] = cpuTimer;
     else {
       ierr = cudaEventElapsedTime(&times[2][k], start, stop);CHKERRQ(ierr);
     }
 
     cpuTimer = 0.0;
-    PetscTimeSubtract(cpuTimer);
+    PetscTimeSubtract(&cpuTimer);
     ierr = cudaEventRecord(start, 0);CHKERRQ(ierr);
     STREAM_Scale_Optimized<<<dimGrid,dimBlock>>>(d_b, d_c, scalar,  N);
     ierr = cudaEventRecord(stop, 0);CHKERRQ(ierr);
     ierr = cudaEventSynchronize(stop);CHKERRQ(ierr);
     //get the the total elapsed time in ms
-    PetscTimeAdd(cpuTimer);
+    PetscTimeAdd(&cpuTimer);
     if (bDontUseGPUTiming) times[3][k] = cpuTimer;
     else {
       ierr = cudaEventElapsedTime(&times[3][k], start, stop);CHKERRQ(ierr);
     }
 
     cpuTimer = 0.0;
-    PetscTimeSubtract(cpuTimer);
+    PetscTimeSubtract(&cpuTimer);
     ierr = cudaEventRecord(start, 0);CHKERRQ(ierr);
     STREAM_Add<<<dimGrid,dimBlock>>>(d_a, d_b, d_c,  N);
     ierr = cudaEventRecord(stop, 0);CHKERRQ(ierr);
     ierr = cudaEventSynchronize(stop);CHKERRQ(ierr);
     //get the the total elapsed time in ms
-    PetscTimeAdd(cpuTimer);
+    PetscTimeAdd(&cpuTimer);
     if (bDontUseGPUTiming) times[4][k] = cpuTimer;
     else {
       ierr = cudaEventElapsedTime(&times[4][k], start, stop);CHKERRQ(ierr);
     }
 
     cpuTimer = 0.0;
-    PetscTimeSubtract(cpuTimer);
+    PetscTimeSubtract(&cpuTimer);
     ierr = cudaEventRecord(start, 0);CHKERRQ(ierr);
     STREAM_Add_Optimized<<<dimGrid,dimBlock>>>(d_a, d_b, d_c,  N);
     ierr = cudaEventRecord(stop, 0);CHKERRQ(ierr);
     ierr = cudaEventSynchronize(stop);CHKERRQ(ierr);
     //get the the total elapsed time in ms
-    PetscTimeAdd(cpuTimer);
+    PetscTimeAdd(&cpuTimer);
     if (bDontUseGPUTiming) times[5][k] = cpuTimer;
     else {
       ierr = cudaEventElapsedTime(&times[5][k], start, stop);CHKERRQ(ierr);
     }
 
     cpuTimer = 0.0;
-    PetscTimeSubtract(cpuTimer);
+    PetscTimeSubtract(&cpuTimer);
     ierr = cudaEventRecord(start, 0);CHKERRQ(ierr);
     STREAM_Triad<<<dimGrid,dimBlock>>>(d_b, d_c, d_a, scalar,  N);
     ierr = cudaEventRecord(stop, 0);CHKERRQ(ierr);
     ierr = cudaEventSynchronize(stop);CHKERRQ(ierr);
     //get the the total elapsed time in ms
-    PetscTimeAdd(cpuTimer);
+    PetscTimeAdd(&cpuTimer);
     if (bDontUseGPUTiming) times[6][k] = cpuTimer;
     else {
       ierr = cudaEventElapsedTime(&times[6][k], start, stop);CHKERRQ(ierr);
     }
 
     cpuTimer = 0.0;
-    PetscTimeSubtract(cpuTimer);
+    PetscTimeSubtract(&cpuTimer);
     ierr = cudaEventRecord(start, 0);CHKERRQ(ierr);
     STREAM_Triad_Optimized<<<dimGrid,dimBlock>>>(d_b, d_c, d_a, scalar,  N);
     ierr = cudaEventRecord(stop, 0);CHKERRQ(ierr);
     ierr = cudaEventSynchronize(stop);CHKERRQ(ierr);
     //get the the total elapsed time in ms
-    PetscTimeAdd(cpuTimer);
+    PetscTimeAdd(&cpuTimer);
     if (bDontUseGPUTiming) times[7][k] = cpuTimer;
     else {
       ierr = cudaEventElapsedTime(&times[7][k], start, stop);CHKERRQ(ierr);
 
   scalar=3.0;
   for (k = 0; k < NTIMES; ++k) {
-    PetscTimeSubtract(cpuTimer);
+    PetscTimeSubtract(&cpuTimer);
     ierr = cudaEventRecord(start, 0);CHKERRQ(ierr);
     STREAM_Copy_double<<<dimGrid,dimBlock>>>(d_a, d_c, N);
     ierr = cudaEventRecord(stop, 0);CHKERRQ(ierr);
     ierr = cudaEventSynchronize(stop);CHKERRQ(ierr);
     //get the the total elapsed time in ms
     if (bDontUseGPUTiming) {
-      PetscTimeAdd(cpuTimer);
+      PetscTimeAdd(&cpuTimer);
       times[0][k] = cpuTimer;
     } else {
       ierr = cudaEventElapsedTime(&times[0][k], start, stop);CHKERRQ(ierr);
     }
 
     cpuTimer = 0.0;
-    PetscTimeSubtract(cpuTimer);
+    PetscTimeSubtract(&cpuTimer);
     ierr = cudaEventRecord(start, 0);CHKERRQ(ierr);
     STREAM_Copy_Optimized_double<<<dimGrid,dimBlock>>>(d_a, d_c, N);
     ierr = cudaEventRecord(stop, 0);CHKERRQ(ierr);
     ierr = cudaEventSynchronize(stop);CHKERRQ(ierr);
     //get the the total elapsed time in ms
     if (bDontUseGPUTiming) {
-      PetscTimeAdd(cpuTimer);
+      PetscTimeAdd(&cpuTimer);
       times[1][k] = cpuTimer;
     } else {
       ierr = cudaEventElapsedTime(&times[1][k], start, stop);CHKERRQ(ierr);
     }
 
     cpuTimer = 0.0;
-    PetscTimeSubtract(cpuTimer);
+    PetscTimeSubtract(&cpuTimer);
     ierr = cudaEventRecord(start, 0);CHKERRQ(ierr);
     STREAM_Scale_double<<<dimGrid,dimBlock>>>(d_b, d_c, scalar,  N);
     ierr = cudaEventRecord(stop, 0);CHKERRQ(ierr);
     ierr = cudaEventSynchronize(stop);CHKERRQ(ierr);
     //get the the total elapsed time in ms
-    PetscTimeAdd(cpuTimer);
+    PetscTimeAdd(&cpuTimer);
     if (bDontUseGPUTiming) times[2][k] = cpuTimer;
     else {
       ierr = cudaEventElapsedTime(&times[2][k], start, stop);CHKERRQ(ierr);
     }
 
     cpuTimer = 0.0;
-    PetscTimeSubtract(cpuTimer);
+    PetscTimeSubtract(&cpuTimer);
     ierr = cudaEventRecord(start, 0);CHKERRQ(ierr);
     STREAM_Scale_Optimized_double<<<dimGrid,dimBlock>>>(d_b, d_c, scalar,  N);
     ierr = cudaEventRecord(stop, 0);CHKERRQ(ierr);
     ierr = cudaEventSynchronize(stop);CHKERRQ(ierr);
     //get the the total elapsed time in ms
-    PetscTimeAdd(cpuTimer);
+    PetscTimeAdd(&cpuTimer);
     if (bDontUseGPUTiming) times[3][k] = cpuTimer;
     else {
       ierr = cudaEventElapsedTime(&times[2][k], start, stop);CHKERRQ(ierr);
     }
 
     cpuTimer = 0.0;
-    PetscTimeSubtract(cpuTimer);
+    PetscTimeSubtract(&cpuTimer);
     ierr = cudaEventRecord(start, 0);CHKERRQ(ierr);
     STREAM_Add_double<<<dimGrid,dimBlock>>>(d_a, d_b, d_c,  N);
     ierr = cudaEventRecord(stop, 0);CHKERRQ(ierr);
     ierr = cudaEventSynchronize(stop);CHKERRQ(ierr);
     //get the the total elapsed time in ms
-    PetscTimeAdd(cpuTimer);
+    PetscTimeAdd(&cpuTimer);
     if (bDontUseGPUTiming) times[4][k] = cpuTimer;
     else {
       ierr = cudaEventElapsedTime(&times[3][k], start, stop);CHKERRQ(ierr);
     }
 
     cpuTimer = 0.0;
-    PetscTimeSubtract(cpuTimer);
+    PetscTimeSubtract(&cpuTimer);
     ierr = cudaEventRecord(start, 0);CHKERRQ(ierr);
     STREAM_Add_Optimized_double<<<dimGrid,dimBlock>>>(d_a, d_b, d_c,  N);
     ierr = cudaEventRecord(stop, 0);CHKERRQ(ierr);
     ierr = cudaEventSynchronize(stop);CHKERRQ(ierr);
     //get the the total elapsed time in ms
-    PetscTimeAdd(cpuTimer);
+    PetscTimeAdd(&cpuTimer);
     if (bDontUseGPUTiming) times[5][k] = cpuTimer;
     else {
       ierr = cudaEventElapsedTime(&times[3][k], start, stop);CHKERRQ(ierr);
     }
 
     cpuTimer = 0.0;
-    PetscTimeSubtract(cpuTimer);
+    PetscTimeSubtract(&cpuTimer);
     ierr = cudaEventRecord(start, 0);CHKERRQ(ierr);
     STREAM_Triad_double<<<dimGrid,dimBlock>>>(d_b, d_c, d_a, scalar,  N);
     ierr = cudaEventRecord(stop, 0);CHKERRQ(ierr);
     ierr = cudaEventSynchronize(stop);CHKERRQ(ierr);
     //get the the total elapsed time in ms
-    PetscTimeAdd(cpuTimer);
+    PetscTimeAdd(&cpuTimer);
     if (bDontUseGPUTiming) times[6][k] = cpuTimer;
     else {
       ierr = cudaEventElapsedTime(&times[4][k], start, stop);CHKERRQ(ierr);
     }
 
     cpuTimer = 0.0;
-    PetscTimeSubtract(cpuTimer);
+    PetscTimeSubtract(&cpuTimer);
     ierr = cudaEventRecord(start, 0);CHKERRQ(ierr);
     STREAM_Triad_Optimized_double<<<dimGrid,dimBlock>>>(d_b, d_c, d_a, scalar,  N);
     ierr = cudaEventRecord(stop, 0);CHKERRQ(ierr);
     ierr = cudaEventSynchronize(stop);CHKERRQ(ierr);
     //get the the total elapsed time in ms
-    PetscTimeAdd(cpuTimer);
+    PetscTimeAdd(&cpuTimer);
     if (bDontUseGPUTiming) times[7][k] = cpuTimer;
     else {
       ierr = cudaEventElapsedTime(&times[4][k], start, stop);CHKERRQ(ierr);

File src/benchmarks/streams/SSEVersion.c

 static double Second()
 {
   double t;
-  PetscTime(t);
+  PetscTime(&t);
   return t;
 }
 

File src/contrib/dvr/dvr.F

          enddo
       enddo
       print *, 'Norm of w is ',dsqrt(sum)
-!      call PetscGetTime(starttime,ierr)
+!      call PetscTime(starttime,ierr)
       call product3DNEW(A,B,v,w)
-!      call PetscGetTime(endtime,ierr)
+!      call PetscTime(endtime,ierr)
 
 !      print*,'Total Flop rate ',3*2.0d-6*n**(dim+1)/(endtime-starttime)
       sum = 0.0d0
 ! First do I x I x A
       elap1 = 0.0d0
       do itest = 1,ntest
-         call PetscGetTime(st1,ierr)
+         call PetscTime(st1,ierr)
          do p=1,n
             do q=1,n
                do r=1,n
                enddo
             enddo
          enddo
-         call PetscGetTime(et1,ierr)
+         call PetscTime(et1,ierr)
          elap1 = elap1 + (et1-st1)
       enddo
       elap1 = elap1/ntest
 ! Next do I x A x I
       elap2 = 0.0d0
       do itest = 1,ntest
-         call PetscGetTime(st2,ierr)
+         call PetscTime(st2,ierr)
          do p=1,n
             do q=1,n
                do r=1,n
                enddo
             enddo
          enddo
-         call PetscGetTime(et2,ierr)
+         call PetscTime(et2,ierr)
          elap2 = elap2 + (et2-st2)
       enddo
       elap2 = elap2/ntest
 ! Finally do A x I x I
       elap3 = 0.0d0
       do itest = 1,ntest
-         call PetscGetTime(st3,ierr)
+         call PetscTime(st3,ierr)
          do p=1,n
             do q=1,n
                do r=1,n
                enddo
             enddo
          enddo
-         call PetscGetTime(et3,ierr)
+         call PetscTime(et3,ierr)
          elap3 = elap3 + (et3-st3)
       enddo
       elap3 = elap3/ntest
 ! First do I x I x A
       elap1 = 0.0d0
       do itest = 1,ntest
-         call PetscGetTime(st1,ierr)
+         call PetscTime(st1,ierr)
          call mxm(A(1,1,1),n,v,n,w,n*n)
-         call PetscGetTime(et1,ierr)
+         call PetscTime(et1,ierr)
          elap1 = elap1 + (et1-st1)
       enddo
       elap1 = elap1/ntest
 ! Next do I x A x I
       elap2 = 0.0d0
       do itest = 1,ntest
-         call PetscGetTime(st2,ierr)
+         call PetscTime(st2,ierr)
          do p=1,n
             call mxm(v(1,1,p),n,B((n*n+1)),n,w1(1,1,p),n)
          enddo
-         call PetscGetTime(et2,ierr)
+         call PetscTime(et2,ierr)
          elap2 = elap2 + (et2-st2)
       enddo
       elap2 = elap2/ntest
 ! Finally do A x I x I
       elap3 = 0.0d0
       do itest = 1,ntest
-         call PetscGetTime(st3,ierr)
+         call PetscTime(st3,ierr)
          call mxm(v,n*n,B((2*n*n+1)),n,w2,n)
-         call PetscGetTime(et3,ierr)
+         call PetscTime(et3,ierr)
          elap3 = elap3 + (et3-st3)
       enddo
       elap3 = elap3/ntest
 ! First do I x I x A
       elap1 = 0.0d0
       do itest = 1,ntest
-         call PetscGetTime(st1,ierr)
+         call PetscTime(st1,ierr)
          call productIA(n,n*n,A(1,1,1),v,w)
-         call PetscGetTime(et1,ierr)
+         call PetscTime(et1,ierr)
          elap1 = elap1 + (et1-st1)
       enddo
       elap1 = elap1/ntest
 ! Next do I x A x I
       elap2 = 0.0d0
       do itest = 1,ntest
-         call PetscGetTime(st2,ierr)
+         call PetscTime(st2,ierr)
          call productIAI(n,n,n,B((n*n+1)),v,w1)
-         call PetscGetTime(et2,ierr)
+         call PetscTime(et2,ierr)
          elap2 = elap2 + (et2-st2)
       enddo
       elap2 = elap2/ntest
 ! Finally do A x I x I
       elap3 = 0.0d0
       do itest = 1,ntest
-         call PetscGetTime(st3,ierr)
+         call PetscTime(st3,ierr)
          call productAI(n,n*n,B((2*n*n+1)),v,w2)
-         call PetscGetTime(et3,ierr)
+         call PetscTime(et3,ierr)
          elap3 = elap3 + (et3-st3)
       enddo
       elap3 = elap3/ntest

File src/contrib/fun3d/comp/flow.c

 and ported into PETSc framework by D. K. Kaushik, ODU and ICASE.\n\n";
 
 #include <petscsnes.h>
+#include <petsctime.h>
 #include "user.h"
 
 typedef struct {
 
   if (SecondOrder) {
     ierr = VecGetArray(grid->grad,&grad);CHKERRQ(ierr);
-    ierr = PetscGetTime(&time_ini);CHKERRQ(ierr);
+    ierr = PetscTime(&time_ini);CHKERRQ(ierr);
     f77LSTGS(&grid->nnodesLoc,&grid->nedgeLoc,grid->eptr,
              qnode,grad,grid->x,grid->y,grid->z,
              grid->rxy,
              &rank,&grid->nvertices);
-    ierr       = PetscGetTime(&time_fin);CHKERRQ(ierr);
+    ierr       = PetscTime(&time_fin);CHKERRQ(ierr);
     grad_time += time_fin - time_ini;
     ierr       = VecRestoreArray(grid->grad,&grad);CHKERRQ(ierr);
     ierr       = VecScatterBegin(gradScatter,grid->grad,localGrad,INSERT_VALUES,
   ierr = VecGetLocalSize(tsCtx->qold, &vecSize);CHKERRQ(ierr);
   printf("Size of local vector tsCtx->qold is %d\n", vecSize);*/
   ierr = VecCopy(grid->qnode, tsCtx->qold);CHKERRQ(ierr);
-  ierr = PetscGetTime(&time1);
+  ierr = PetscTime(&time1);
   #if defined(PARCH_IRIX64) && defined(USE_HW_COUNTERS)
   /* if (!PreLoadFlag) {
     ierr = PetscOptionsGetInt(NULL,"-e0",&event0,&flg);CHKERRQ(ierr);
     ierr = PetscOptionsGetInt(NULL,"-e1",&event1,&flg);CHKERRQ(ierr);
-    ierr = PetscGetTime(&time_start_counters);CHKERRQ(ierr);
+    ierr = PetscTime(&time_start_counters);CHKERRQ(ierr);
     if ((gen_start = start_counters(event0,event1)) < 0)
     SETERRQ(PETSC_COMM_SELF,PETSC_ERR_PLIB,PETSC_ERROR_INITIAL,"Error in start_counters\n");
   } */
     ierr = VecCopy(grid->qnode,tsCtx->qold);CHKERRQ(ierr);
 
     /* Timing Info */
-    ierr = PetscGetTime(&time2);
+    ierr = PetscTime(&time2);
     /*cpu_fin = PetscGetCPUTime();*/
     cpuloc = time2-time1;
     cpuglo = 0.0;
     char str[256];
     /* if ((gen_read = read_counters(event0,&counter0,event1,&counter1)) < 0)
     SETERRQ(PETSC_COMM_SELF,1,"Error in read_counter\n");
-    ierr = PetscGetTime(&time_read_counters);CHKERRQ(ierr);
+    ierr = PetscTime(&time_read_counters);CHKERRQ(ierr);
     if (gen_read != gen_start) {
     SETERRQ(PETSC_COMM_SELF,1,"Lost Counters!! Aborting ...\n");
     }*/
   nnodesLoc = 0;
 
   for (i = 0; i < nnodes; i++) a2l[i] = -1;
-  ierr = PetscGetTime(&time_ini);CHKERRQ(ierr);
+  ierr = PetscTime(&time_ini);CHKERRQ(ierr);
 
   if (!rank) {
     if (CommSize == 1) {
     }
   }
 
-  ierr      = PetscGetTime(&time_fin);CHKERRQ(ierr);
+  ierr      = PetscTime(&time_fin);CHKERRQ(ierr);
   time_fin -= time_ini;
   ierr      = PetscPrintf(comm,"Partition Vector read successfully\n");CHKERRQ(ierr);
   ierr      = PetscPrintf(comm,"Time taken in this phase was %g\n",time_fin);CHKERRQ(ierr);
   remEdges    = nedge;
   ICALLOC(2*nedgeLocEst,&tmp);
   ierr = PetscBinarySynchronizedSeek(comm,fdes,0,PETSC_BINARY_SEEK_CUR,&currentPos);CHKERRQ(ierr);
-  ierr = PetscGetTime(&time_ini);CHKERRQ(ierr);
+  ierr = PetscTime(&time_ini);CHKERRQ(ierr);
   while (remEdges > 0) {
     readEdges = PetscMin(remEdges,nedgeLocEst);
-    /*time_ini = PetscGetTime();*/
+    /*time_ini = PetscTime();*/
     ierr = PetscBinarySynchronizedRead(comm,fdes,tmp,readEdges,PETSC_INT);CHKERRQ(ierr);
     ierr = PetscBinarySynchronizedSeek(comm,fdes,(nedge-readEdges)*PETSC_BINARY_INT_SIZE,PETSC_BINARY_SEEK_CUR,&newPos);CHKERRQ(ierr);
     ierr = PetscBinarySynchronizedRead(comm,fdes,tmp+readEdges,readEdges,PETSC_INT);CHKERRQ(ierr);
     ierr = PetscBinarySynchronizedSeek(comm,fdes,-nedge*PETSC_BINARY_INT_SIZE,PETSC_BINARY_SEEK_CUR,&newPos);CHKERRQ(ierr);
-    /*time_fin += PetscGetTime()-time_ini;*/
+    /*time_fin += PetscTime()-time_ini;*/
     for (j = 0; j < readEdges; j++) {
       node1 = tmp[j]-1;
       node2 = tmp[j+readEdges]-1;
     remEdges = remEdges - readEdges;
     ierr     = MPI_Barrier(comm);
   }
-  ierr      = PetscGetTime(&time_fin);CHKERRQ(ierr);
+  ierr      = PetscTime(&time_fin);CHKERRQ(ierr);
   time_fin -= time_ini;
   ierr      = PetscPrintf(comm,"Local edges counted with MPI_Bcast %d\n",nedgeLoc);CHKERRQ(ierr);
   ierr      = PetscPrintf(comm,"Local vertices counted %d\n",nvertices);CHKERRQ(ierr);
   ierr       = PetscBinarySynchronizedSeek(comm,fdes,currentPos,PETSC_BINARY_SEEK_SET,&newPos);CHKERRQ(ierr);
   currentPos = newPos;
 
-  ierr = PetscGetTime(&time_ini);CHKERRQ(ierr);
+  ierr = PetscTime(&time_ini);CHKERRQ(ierr);
   while (remEdges > 0) {
     readEdges = PetscMin(remEdges,nedgeLocEst);
     ierr      = PetscBinarySynchronizedRead(comm,fdes,tmp,readEdges,PETSC_INT);CHKERRQ(ierr);
     ierr     = MPI_Barrier(comm);
   }
   ierr = PetscBinarySynchronizedSeek(comm,fdes,currentPos+2*nedge*PETSC_BINARY_INT_SIZE,PETSC_BINARY_SEEK_SET,&newPos);CHKERRQ(ierr);
-  ierr = PetscGetTime(&time_fin);CHKERRQ(ierr);
+  ierr = PetscTime(&time_fin);CHKERRQ(ierr);
   time_fin -= time_ini;
   ierr = PetscPrintf(comm,"Local edges stored\n");CHKERRQ(ierr);
   ierr = PetscPrintf(comm,"Time taken in this phase was %g\n",time_fin);CHKERRQ(ierr);
   FCALLOC(nedgeLoc, &grid->xn);
   i = 0; k = 0;
   remEdges = nedge;
-  ierr     = PetscGetTime(&time_ini);CHKERRQ(ierr);
+  ierr     = PetscTime(&time_ini);CHKERRQ(ierr);
   while (remEdges > 0) {
     readEdges = PetscMin(remEdges,nedgeLocEst);
     ierr = PetscBinarySynchronizedRead(comm,fdes,ftmp,readEdges,PETSC_SCALAR);CHKERRQ(ierr);
   ierr = PetscFree(edge_bit);CHKERRQ(ierr);
   ierr = PetscFree(eperm);CHKERRQ(ierr);
   ierr = PetscFree(ftmp);CHKERRQ(ierr);
-  ierr = PetscGetTime(&time_fin);
+  ierr = PetscTime(&time_fin);
   time_fin -= time_ini;
   ierr = PetscPrintf(comm,"Edge normals partitioned\n");CHKERRQ(ierr);
   ierr = PetscPrintf(comm,"Time taken in this phase was %g\n",time_fin);CHKERRQ(ierr);
   FCALLOC(nvertices, &grid->x);
   remNodes = nnodes;
   i = 0;
-  ierr = PetscGetTime(&time_ini);CHKERRQ(ierr);
+  ierr = PetscTime(&time_ini);CHKERRQ(ierr);
   while (remNodes > 0) {
     readNodes = PetscMin(remNodes, nnodesLocEst);
     ierr = PetscBinarySynchronizedRead(comm,fdes,ftmp,readNodes,PETSC_SCALAR);CHKERRQ(ierr);
   }
 
   ierr = PetscFree(ftmp);CHKERRQ(ierr);
-  ierr = PetscGetTime(&time_fin);
+  ierr = PetscTime(&time_fin);
   time_fin -= time_ini;
   ierr = PetscPrintf(comm,"Coordinates remapped\n");CHKERRQ(ierr);
   ierr = PetscPrintf(comm,"Time taken in this phase was %g\n",time_fin);CHKERRQ(ierr);
 {
   int ierr;
   if ((*gen_start = start_counters(event0,event1)) < 0) SETERRQ(PETSC_COMM_SELF,1,"Error in start_counters\n");
-  ierr = PetscGetTime(time_start_counters);CHKERRQ(ierr);
+  ierr = PetscTime(&time_start_counters);CHKERRQ(ierr);
   return 0;
 }
 
   long long   _counter0, _counter1;
 
   if ((gen_read = read_counters(event0,&_counter0,event1,&_counter1)) < 0) SETERRQ(PETSC_COMM_SELF,1,"Error in read_counter\n");
-  ierr = PetscGetTime(&time_read_counters);CHKERRQ(ierr);
+  ierr = PetscTime(&&time_read_counters);CHKERRQ(ierr);
   if (gen_read != gen_start) SETERRQ(PETSC_COMM_SELF,1,"Lost Counters!! Aborting ...\n");
 
   counter0      += _counter0;

File src/contrib/fun3d/incomp/flow.c

 and ported into PETSc by D. K. Kaushik, ODU and ICASE.\n\n";
 
 #include <petscsnes.h>
+#include <petsctime.h>
 #include <petscao.h>
 #include "user.h"
 #if defined(_OPENMP)
   ierr = VecGetArray(localX,&qnode);CHKERRQ(ierr);
   ires = tsCtx->ires;
 
-  ierr = PetscGetTime(&time_ini);CHKERRQ(ierr);
+  ierr = PetscTime(&time_ini);CHKERRQ(ierr);
   f77LSTGS(&grid->nnodesLoc,&grid->nedgeLoc,grid->eptr,qnode,grad,grid->xyz,grid->rxy,
            &rank,&grid->nvertices);
-  ierr       = PetscGetTime(&time_fin);CHKERRQ(ierr);
+  ierr       = PetscTime(&time_fin);CHKERRQ(ierr);
   grad_time += time_fin - time_ini;
   ierr       = VecRestoreArray(grid->grad,&grad);CHKERRQ(ierr);
 
   fratio = 1.0;
   /*tsCtx->ptime = 0.0;*/
   ierr = VecCopy(grid->qnode,tsCtx->qold);CHKERRQ(ierr);
-  ierr = PetscGetTime(&time1);CHKERRQ(ierr);
+  ierr = PetscTime(&time1);CHKERRQ(ierr);
 #if defined(PARCH_IRIX64) && defined(USE_HW_COUNTERS)
   /* if (!user->PreLoading) {
     PetscBool  flg = PETSC_FALSE;
     ierr = PetscOptionsGetInt(NULL,"-e0",&event0,&flg);CHKERRQ(ierr);
     ierr = PetscOptionsGetInt(NULL,"-e1",&event1,&flg);CHKERRQ(ierr);
-    ierr = PetscGetTime(&time_start_counters);CHKERRQ(ierr);
+    ierr = PetscTime(&time_start_counters);CHKERRQ(ierr);
     if ((gen_start = start_counters(event0,event1)) < 0)
     SETERRQ(PETSC_COMM_SELF,1,"Error in start_counters\n");
   }*/
     ierr = VecCopy(grid->qnode,tsCtx->qold);CHKERRQ(ierr);
 
     c_info->ntt = tsCtx->itstep+1;
-    ierr        = PetscGetTime(&time2);CHKERRQ(ierr);
+    ierr        = PetscTime(&time2);CHKERRQ(ierr);
     cpuloc      = time2-time1;
     cpuglo      = 0.0;
     ierr        = MPI_Allreduce(&cpuloc,&cpuglo,1,MPIU_REAL,MPIU_MAX,PETSC_COMM_WORLD);CHKERRQ(ierr);
     char str[256];
     /* if ((gen_read = read_counters(event0,&counter0,event1,&counter1)) < 0)
     SETERRQ(PETSC_COMM_SELF,1,"Error in read_counter\n");
-    ierr = PetscGetTime(&time_read_counters);CHKERRQ(ierr);
+    ierr = PetscTime(&time_read_counters);CHKERRQ(ierr);
     if (gen_read != gen_start) {
     SETERRQ(PETSC_COMM_SELF,1,"Lost Counters!! Aborting ...\n");
     }*/
   nnodesLoc = 0;
 
   for (i = 0; i < nnodes; i++) a2l[i] = -1;
-  ierr = PetscGetTime(&time_ini);CHKERRQ(ierr);
+  ierr = PetscTime(&time_ini);CHKERRQ(ierr);
 
   if (!rank) {
     if (size == 1) {
     }
   }