Commits

Jed Brown committed e7b0c45 Merge with conflicts

Merge branch 'knepley/fix-plex-ghost-cells' into jed/sr-driver

DMLabelFilter is needed by this SR work, but was lost when Matt rebased.

* knepley/fix-plex-ghost-cells: (114 commits)
DMPlex: Fixed DMPlexConstructGhostCells() to filter out non-faces from the label
DMPlex: Added DMLabelFilter()
...

Conflicts:
src/ts/examples/tutorials/makefile

  • Participants
  • Parent commits c56f055, 46c796b
  • Branches jed/sr-driver, madams/sr-driver2

Comments (0)

Files changed (133)

 
 Andy Terrel <aterrel@uchicago.edu>
 Aron Ahmadia <aron@ahmadia.net>                 <ahmadia@harley.mcs.anl.gov>
+Barry Smith <bsmith@mcs.anl.gov>                BarryFSmith
 Blaise Bourdin <bourdin@lsu.edu>
 Brad Aagaard <baagaard@usgs.gov>                <baagaard at usgs.gov>
 Ethan Coon <ecoon@lanl.gov>

File bin/maint/dos/makecpp.tcl

         #
         regsub  -all  "\ninclude" $databuff  "\n!include" databuff
         #
-        # Change -D__SDIR__='"${LOCDIR}"' to /D__SDIR__="\"${LOCDIR}\""
         # Change -DPETSC_DIR='"${PETSC_DIR}"' to /DPETSC_DIR="\"${PETSC_DIR}\""
         #
         regsub -all  "\\\-D" $databuff "/D" databuff

File bin/maint/dos/rules_win32

 PETSC_INCLUDE  = /I$(PETSC_DIR) /I$(PETSC_DIR)\include $(MPI_INCLUDE) \
                  /I$(PETSC_DIR)\bmake\$(PETSC_ARCH) $(AMS_INCLUDE) $(PETSC_BLASLAPACK_FLAGS)
 CCPPFLAGS      = $(PETSC_INCLUDE) $(PCONF) $(PETSCFLAGS) $(CPPFLAGS)
-# __SDIR__ is not required as, on NT, the absolute path is used when compiling a
-# source file (which already includes the __SDIR__ information
-#		/D__SDIR__="\"$(LOCDIR)\""
 FCPPFLAGS      = $(PETSC_INCLUDE) $(PCONF) $(PETSCFLAGS) $(FPPFLAGS)
 PETSC_SYS_LIB  = libpetsc.lib $(EXTERNAL_LIB) $(BLASLAPACK_LIB) \
                  $(MPE_LIB) $(MPI_LIB) $(X11_LIB) $(SYS_LIB)

File bin/maint/gcov.py

 
 def main():
 
-    USER = os.environ>['USER']
+    USER = os.environ['USER']
     gcov_dir = "/tmp/gcov-"+USER
 
     if (sys.argv[1] == "-run_gcov"):

File config/BuildSystem/build/buildGraph.py

   def addSubgraph(self, graph):
     '''Add the vertices and edges of another graph into this one'''
     map(self.addVertex, graph.vertices)
-    map(lambda v: apply(self.addEdges, (v,)+graph.getEdges(v)), graph.vertices)
+    map(lambda v: self.addEdges(v, *graph.getEdges(v)), graph.vertices)
     return
 
   def removeSubgraph(self, graph):

File config/BuildSystem/config/__init__.py

 all = ['base', 'compilers', 'framework', 'functions', 'headers', 'libraries', 'types', 'atomics']
+
+from config.util import *

File config/BuildSystem/config/base.py

   def __str__(self):
     return ''
 
+  def logError(self, component, status, output, error):
+    if status:
+      exitstr = ' exit code ' + str(status)
+    else:
+      exitstr = ''
+    self.framework.log.write('Possible ERROR while running %s:%s\n' % (component, exitstr))
+    if output:
+      self.framework.log.write('stdout:\n' + output)
+    if error:
+      self.framework.log.write('stderr:\n' + error)
+
   def executeTest(self, test, args = [], kargs = {}):
     import time
 
     if test.__doc__: self.logWrite('  '+test.__doc__+'\n')
     #t = time.time()
     if not isinstance(args, list): args = [args]
-    ret = apply(test, args,kargs)
+    ret = test(*args,**kargs)
     #self.logPrint('  TIME: '+str(time.time() - t)+' sec', debugSection = 'screen', indent = 0)
     return ret
 
   def preprocess(self, codeStr, timeout = 600.0):
     def report(command, status, output, error):
       if error or status:
-        self.framework.log.write('Possible ERROR while running preprocessor: '+error)
-        if status: self.framework.log.write('ret = '+str(status)+'\n')
-        if error: self.framework.log.write('error message = {'+error+'}\n')
+        self.logError('preprocessor', status, output, error)
         self.framework.log.write('Source:\n'+self.getCode(codeStr))
-      return
 
     command = self.getPreprocessorCmd()
     if self.compilerDefines: self.framework.outputHeader(self.compilerDefines)
     '''Return the error output from this compile and the return code'''
     def report(command, status, output, error):
       if error or status:
-        self.framework.log.write('Possible ERROR while running compiler: '+output)
-        if status: self.framework.log.write('ret = '+str(status)+'\n')
-        if error: self.framework.log.write('error message = {'+error+'}\n')
-        self.framework.log.write('Source:\n'+self.getCode(includes, body, codeBegin, codeEnd))
+        self.logError('compiler', status, output, error)
       else:
         self.framework.log.write('Successful compile:\n')
-        self.framework.log.write('Source:\n'+self.getCode(includes, body, codeBegin, codeEnd))
-      return
+      self.framework.log.write('Source:\n'+self.getCode(includes, body, codeBegin, codeEnd))
 
     cleanup = cleanup and self.framework.doCleanup
     command = self.getCompilerCmd()
   def filterLinkOutput(self, output):
     return self.framework.filterLinkOutput(output)
 
-  def outputLink(self, includes, body, cleanup = 1, codeBegin = None, codeEnd = None, shared = 0, linkLanguage=None):
+  def outputLink(self, includes, body, cleanup = 1, codeBegin = None, codeEnd = None, shared = 0, linkLanguage=None, examineOutput=lambda ret,out,err:None):
     import sys
 
     (out, err, ret) = self.outputCompile(includes, body, cleanup = 0, codeBegin = codeBegin, codeEnd = codeEnd)
+    examineOutput(ret, out, err)
     out = self.filterCompileOutput(out+'\n'+err)
     if ret or len(out):
       self.framework.logPrint('Compile failed inside link\n'+out)
     linkerObj = self.linkerObj
     def report(command, status, output, error):
       if error or status:
-        self.framework.log.write('Possible ERROR while running linker: '+error)
-        self.framework.log.write(' output: '+output)
-        if status: self.framework.log.write('ret = '+str(status)+'\n')
-        if error: self.framework.log.write('error message = {'+error+'}\n')
-        self.framework.log.write(' in '+self.getLinkerCmd()+'\n')
-        self.framework.log.write('Source:\n'+self.getCode(includes, body, codeBegin, codeEnd))
+        self.logError('linker', status, output, error)
+        examineOutput(status, output, error)
       return
     (out, err, ret) = Configure.executeShellCommand(cmd, checkCommand = report, log = self.framework.log)
     self.linkerObj = linkerObj
       if os.path.isfile(pdbfile): os.remove(pdbfile)
     return (out+err, ret)
 
-  def checkLink(self, includes = '', body = '', cleanup = 1, codeBegin = None, codeEnd = None, shared = 0, linkLanguage=None):
-    (output, returnCode) = self.outputLink(includes, body, cleanup, codeBegin, codeEnd, shared, linkLanguage)
+  def checkLink(self, includes = '', body = '', cleanup = 1, codeBegin = None, codeEnd = None, shared = 0, linkLanguage=None, examineOutput=lambda ret,out,err:None):
+    (output, returnCode) = self.outputLink(includes, body, cleanup, codeBegin, codeEnd, shared, linkLanguage, examineOutput)
     output = self.filterLinkOutput(output)
     return not (returnCode or len(output))
 

File config/BuildSystem/config/compilers.py

     self.cStaticInlineKeyword = 'static'
     self.pushLanguage('C')
     for kw in ['static inline', 'static __inline']:
-      if self.checkCompile(kw+' int foo(int a) {return a;}','int i = foo(1);'):
+      if self.checkCompile(kw+' int foo(int a) {return a;}','foo(1);'):
         self.cStaticInlineKeyword = kw
         self.logPrint('Set C StaticInline keyword to '+self.cStaticInlineKeyword , 4, 'compilers')
         break
     self.cxxStaticInlineKeyword = 'static'
     self.pushLanguage('C++')
     for kw in ['static inline', 'static __inline']:
-      if self.checkCompile(kw+' int foo(int a) {return a;}','int i = foo(1);'):
+      if self.checkCompile(kw+' int foo(int a) {return a;}','foo(1);'):
         self.cxxStaticInlineKeyword = kw
         self.logPrint('Set Cxx StaticInline keyword to '+self.cxxStaticInlineKeyword , 4, 'compilers')
         break

File config/BuildSystem/config/framework.py

       for dir in files:
         if re.match(nextDirs[0], dir):
           if nextDirs[1:]:
-            rest = apply(os.path.join, nextDirs[1:])
+            rest = os.path.join(*nextDirs[1:])
           else:
             rest = None
           dirs.extend(self.listDirs(os.path.join(base, dir),rest ))
           config.setupDependencies(self)
           break
     if config is None:
-      config = apply(type, [self], keywordArgs)
+      config = type(self, *keywordArgs)
       self.addChild(config)
       config.showHelp = 0
       config.logName  = self.logName

File config/BuildSystem/config/functions.py

   def haveFunction(self, function):
     return self.getDefineName(function) in self.defines
 
-  def check(self, funcName, libraries = None):
+  def check(self, funcs, libraries = None, examineOutput=lambda ret,out,err:None):
     '''Checks for the function "funcName", and if found defines HAVE_"funcName"'''
-    self.framework.log.write('Checking for function '+funcName+'\n')
+    if isinstance(funcs, set): funcs = list(funcs)
+    if isinstance(funcs, str): funcs = [funcs]
+    self.framework.log.write('Checking for functions ['+' '.join(funcs)+']\n')
+    def genIncludes(funcName):
+      return 'char %s();\n' % funcName
+    def genBody(funcName):
+      # The GNU C library defines __stub_* for functions that it implements
+      # to always fail with ENOSYS.  Some functions are actually named
+      # something starting with __ and the normal name is an alias.
+      return '''
+#if defined (__stub_%(func)s) || defined (__stub___%(func)s)
+%(func)s_will_always_fail_with_ENOSYS();
+#else
+%(func)s();
+#endif
+''' % dict(func=funcName)
+
     # Don't include <ctype.h> because on OSF/1 3.0 it includes <sys/types.h>
     # which includes <sys/select.h> which contains a prototype for
     # select.  Similarly for bzero.
-    includes  = '/* System header to define __stub macros and hopefully few prototypes, which can conflict with char '+funcName+'(); below. */\n'
-    includes += '''
-    #include <assert.h>
-    /* Override any gcc2 internal prototype to avoid an error. */
-    '''
-    if self.language[-1] == 'Cxx':
-      includes += '''
+    includes = '''
+/* System header to define __stub macros and hopefully no other prototypes since they would conflict with our 'char funcname()' declaration below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
 #ifdef __cplusplus
-extern "C"
+extern "C" {
 #endif
 '''
     includes += '''
 /* We use char because int might match the return type of a gcc2
 builtin and then its argument prototype would still apply. */
 '''
-    includes += 'char '+funcName+'();\n'
-    body = '''
-/* The GNU C library defines this for functions which it implements
-to always fail with ENOSYS.  Some functions are actually named
-something starting with __ and the normal name is an alias.  */
-#if defined (__stub_'''+funcName+''') || defined (__stub___'''+funcName+''')
-choke me
-#else
-'''+funcName+'''();
+    includes += ''.join(map(genIncludes,funcs))
+    includes += '''
+#ifdef __cplusplus
+}
 #endif
 '''
+    body = ''.join(map(genBody,funcs))
     if libraries:
       oldLibs = self.compilers.LIBS
       if not isinstance(libraries, list):
           self.compilers.LIBS += ' '+library
         else:
           self.compilers.LIBS += ' -l'+library
-    found = self.checkLink(includes, body)
+    found = self.checkLink(includes, body, examineOutput=examineOutput)
     if libraries:
       self.compilers.LIBS = oldLibs
     if found:
-      self.addDefine(self.getDefineName(funcName), 1)
+      for funcName in funcs:
+        self.addDefine(self.getDefineName(funcName), 1)
     return found
 
+  def checkClassify(self, funcs, libraries = None):
+    '''Recursive decompose to rapidly classify functions as found or missing
+    To confirm that a function is missing, we require a compile/link
+    failure with only that function in a compilation unit.  In contrast,
+    we can confirm that many functions are present by compiling them all
+    together in a large compilation unit.  We optimistically compile
+    everything together, then trim all functions that were named in the
+    error message and bisect the result.  The trimming is only an
+    optimization to increase the likelihood of a big-batch compile
+    succeeding; we do not rely on the compiler naming missing functions.
+    '''
+    def functional(funcs):
+      named = config.NamedInStderr(funcs)
+      if self.check(funcs, libraries, named.examineStderr):
+        return True
+      else:
+        return named.named
+    import config
+    found, missing = config.classify(funcs, functional)
+    return found, missing
+
   def checkMemcmp(self):
     '''Check for 8-bit clean memcmp'''
     if 'known-memcmp-ok' in self.framework.argDB:
       self.executeTest(self.checkSignalHandlerType)
     self.executeTest(self.checkFreeReturnType)
     self.executeTest(self.checkVariableArgumentLists)
-    map(lambda function: self.executeTest(self.check, function), set(self.functions))
+    self.executeTest(self.checkClassify, set(self.functions))
     return

File config/BuildSystem/config/libraries.py

     # no match - assuming the given name is already in short notation
     return lib
 
-  def check(self, libName, funcs, libDir = None, otherLibs = [], prototype = '', call = '', fortranMangle = 0, cxxMangle = 0, cxxLink = 0):
+  def check(self, libName, funcs, libDir = None, otherLibs = [], prototype = '', call = '', fortranMangle = 0, cxxMangle = 0, cxxLink = 0, examineOutput=lambda ret,out,err:None):
     '''Checks that the library "libName" contains "funcs", and if it does defines HAVE_LIB"libName"
        - libDir may be a list of directories
        - libName may be a list of library names'''
     if not isinstance(funcs,list): funcs = [funcs]
     if not isinstance(libName, list): libName = [libName]
-    for f, funcName in enumerate(funcs):
-      # Handle Fortran mangling
-      if fortranMangle:
-        funcName = self.compilers.mangleFortranFunction(funcName)
-      self.framework.logPrint('Checking for function '+str(funcName)+' in library '+str(libName)+' '+str(otherLibs))
+    def genPreamble(f, funcName):
+      # Construct prototype
       if self.language[-1] == 'FC':
-        includes = ''
+        return ''
+      if prototype:
+        if isinstance(prototype, str):
+          pre = prototype
+        else:
+          pre = prototype[f]
       else:
-        includes = '/* Override any gcc2 internal prototype to avoid an error. */\n'
-      # Handle C++ mangling
-      if self.language[-1] == 'Cxx' and not cxxMangle:
-        includes += '''
+        # We use char because int might match the return type of a gcc2 builtin and its argument prototype would still apply.
+        pre = 'char '+funcName+'();'
+      # Capture the function call in a static function so that any local variables are isolated from
+      # calls to other library functions.
+      return pre + '\nstatic void _check_%s() { %s }' % (funcName, genCall(f, funcName, pre=True))
+    def genCall(f, funcName, pre=False):
+      if self.language[-1] != 'FC' and not pre:
+        return '_check_' + fname + '();'
+      # Construct function call
+      if call:
+        if isinstance(call, str):
+          body = call
+        else:
+          body = call[f]
+      else:
+        body = funcName+'()'
+      if self.language[-1] != 'FC':
+        body += ';'
+      return body
+    # Handle Fortran mangling
+    if fortranMangle:
+      funcs = map(self.compilers.mangleFortranFunction, funcs)
+    if not funcs:
+      self.framework.logPrint('No functions to check for in library '+str(libName)+' '+str(otherLibs))
+      return True
+    self.framework.logPrint('Checking for functions ['+' '.join(funcs)+'] in library '+str(libName)+' '+str(otherLibs))
+    if self.language[-1] == 'FC':
+      includes = ''
+    else:
+      includes = '/* Override any gcc2 internal prototype to avoid an error. */\n'
+    # Handle C++ mangling
+    if self.language[-1] == 'Cxx' and not cxxMangle:
+      includes += '''
 #ifdef __cplusplus
 extern "C" {
 #endif
 '''
-      # Construct prototype
-      if not self.language[-1] == 'FC':
-        if prototype:
-          if isinstance(prototype, str):
-            includes += prototype
-          else:
-            includes += prototype[f]
-        else:
-          # We use char because int might match the return type of a gcc2 builtin and its argument prototype would still apply.
-          includes += 'char '+funcName+'();\n'
-      # Handle C++ mangling
-      if self.language[-1] == 'Cxx' and not cxxMangle:
-        includes += '''
+    includes += '\n'.join([genPreamble(f, fname) for f, fname in enumerate(funcs)])
+    # Handle C++ mangling
+    if self.language[-1] == 'Cxx' and not cxxMangle:
+      includes += '''
 #ifdef __cplusplus
 }
 #endif
 '''
-      # Construct function call
-      if call:
-        if isinstance(call, str):
-          body = call
-        else:
-          body = call[f]
+    body = '\n'.join([genCall(f, fname) for f, fname in enumerate(funcs)])
+    # Setup link line
+    oldLibs = self.setCompilers.LIBS
+    if libDir:
+      if not isinstance(libDir, list): libDir = [libDir]
+      for dir in libDir:
+        self.setCompilers.LIBS += ' -L'+dir
+    # new libs may/will depend on system libs so list new libs first!
+    # Matt, do not change this without talking to me
+    if libName and otherLibs:
+      self.setCompilers.LIBS = ' '+self.toString(libName+otherLibs) +' '+ self.setCompilers.LIBS
+    elif otherLibs:
+      self.setCompilers.LIBS = ' '+self.toString(otherLibs) +' '+ self.setCompilers.LIBS
+    elif libName:
+      self.setCompilers.LIBS = ' '+self.toString(libName) +' '+ self.setCompilers.LIBS
+    if cxxMangle: compileLang = 'Cxx'
+    else:         compileLang = self.language[-1]
+    if cxxLink: linklang = 'Cxx'
+    else: linklang = self.language[-1]
+    self.pushLanguage(compileLang)
+    found = 0
+    if self.checkLink(includes, body, linkLanguage=linklang, examineOutput=examineOutput):
+      found = 1
+      # add to list of found libraries
+      if libName:
+        for lib in libName:
+          shortlib = self.getShortLibName(lib)
+          if shortlib: self.addDefine(self.getDefineName(shortlib), 1)
+    self.setCompilers.LIBS = oldLibs
+    self.popLanguage()
+    return found
+
+  def checkClassify(self, libName, funcs, libDir=None, otherLibs=[], prototype='', call='', fortranMangle=0, cxxMangle=0, cxxLink=0):
+    '''Recursive decompose to rapidly classify functions as found or missing'''
+    import config
+    def functional(funcs):
+      named = config.NamedInStderr(funcs)
+      if self.check(libName, funcs, libDir, otherLibs, prototype, call, fortranMangle, cxxMangle, cxxLink):
+        return True
       else:
-        body = funcName+'()\n'
-      # Setup link line
-      oldLibs = self.setCompilers.LIBS
-      if libDir:
-        if not isinstance(libDir, list): libDir = [libDir]
-        for dir in libDir:
-          self.setCompilers.LIBS += ' -L'+dir
-      # new libs may/will depend on system libs so list new libs first!
-      # Matt, do not change this without talking to me
-      if libName and otherLibs:
-        self.setCompilers.LIBS = ' '+self.toString(libName+otherLibs) +' '+ self.setCompilers.LIBS
-      elif otherLibs:
-        self.setCompilers.LIBS = ' '+self.toString(otherLibs) +' '+ self.setCompilers.LIBS
-      elif libName:
-        self.setCompilers.LIBS = ' '+self.toString(libName) +' '+ self.setCompilers.LIBS
-      if cxxMangle: compileLang = 'Cxx'
-      else:         compileLang = self.language[-1]
-      if cxxLink: linklang = 'Cxx'
-      else: linklang = self.language[-1]
-      self.pushLanguage(compileLang)
-      found = 0
-      if self.checkLink(includes, body, linkLanguage=linklang):
-        found = 1
-        # add to list of found libraries
-        if libName:
-          for lib in libName:
-            shortlib = self.getShortLibName(lib)
-            if shortlib: self.addDefine(self.getDefineName(shortlib), 1)
-      self.setCompilers.LIBS = oldLibs
-      self.popLanguage()
-      if not found: return 0
-    return 1
+        return named.named
+    found, missing = config.classify(funcs, functional)
+    return found, missing
 
   def checkMath(self):
     '''Check for sin() in libm, the math library'''

File config/BuildSystem/config/package.py

     self.gitcommit        = None # Git commit to use for downloads (used in preference to tarball downloads)
     self.giturls          = []   # list of Git repository URLs to be used for downloads
     self.download         = []   # list of URLs where repository or tarballs may be found
+    self.downloadURLSetByUser = False # user overrode package file by providing download location
     self.deps             = []   # other packages whose dlib or include we depend on, usually we also use self.framework.require()
     self.defaultLanguage  = 'C'  # The language in which to run tests
     self.liblist          = [[]] # list of libraries we wish to check for (override with your own generateLibList())
     downloadPackageVal = self.framework.argDB['download-'+self.downloadname.lower()]
     if requireDownload and isinstance(downloadPackageVal, str):
       self.download = [downloadPackageVal]
+      self.downloadURLSetByUser = True
       downloadPackage = 1
     elif downloadPackageVal == 1 and requireDownload:
       downloadPackage = 1
         download_urls.append(url.replace('http://','ftp://'))
     # now attempt to download each url until any one succeeds.
     err =''
-    if hasattr(self.sourceControl, 'git') and self.gitcommit and self.gitPreReqCheck():
+    if not self.downloadURLSetByUser and hasattr(self.sourceControl, 'git') and self.gitcommit and self.gitPreReqCheck():
       for giturl in self.giturls: # First try to fetch using Git
         try:
           gitrepo = os.path.join(self.externalPackagesDir, self.downloadname)

File config/BuildSystem/config/packages/BlasLapack.py

     oldLibs = self.compilers.LIBS
     prototype = ''
     call      = ''
-    routine   = self.getPrefix()+routineIn
+    routine   = self.mangleBlas(routineIn)
     if fortranMangle=='stdcall':
       if routine=='ddot':
         prototype = 'double __stdcall DDOT(int*,double*,int*,double*,int*);'
   def checkLapack(self, lapackLibrary, otherLibs, fortranMangle, routinesIn = ['getrs', 'geev']):
     oldLibs = self.compilers.LIBS
     routines = list(routinesIn)
-    found   = 0
+    found   = 1
     prototypes = ['','']
     calls      = ['','']
-    for routine in range(len(routines)):
-      routines[routine] = self.getPrefix()+routines[routine]
+    routines   = map(self.mangleBlas, routines)
 
     if fortranMangle=='stdcall':
       if routines == ['dgetrs','dgeev']:
         calls      = ['DGETRS(0,0,0,0,0,0,0,0,0,0);',
                       'DGEEV(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);']
     for routine, prototype, call in zip(routines, prototypes, calls):
-      found = found or self.libraries.check(lapackLibrary, routine, otherLibs = otherLibs, fortranMangle = fortranMangle, prototype = prototype, call = call)
-      if found: break
+      found = found and self.libraries.check(lapackLibrary, routine, otherLibs = otherLibs, fortranMangle = fortranMangle, prototype = prototype, call = call)
+      if not found: break
     self.compilers.LIBS = oldLibs
     return found
 
     foundBlas   = 0
     foundLapack = 0
     self.f2c    = 0
-    self.f2cpkg = 0
     mangleFunc = self.compilers.fortranMangling
     foundBlas = self.checkBlas(blasLibrary, self.getOtherLibs(foundBlas, blasLibrary), mangleFunc,'dot')
     if foundBlas:
     else:
       self.framework.logPrint('Checking for no name mangling on BLAS/LAPACK')
       foundBlas = self.checkBlas(blasLibrary, self.getOtherLibs(foundBlas, blasLibrary), 0, 'dot')
-      foundLapack = self.checkLapack(lapackLibrary, self.getOtherLibs(foundBlas, blasLibrary), 0, ['getrs', 'geev'])
+      if foundBlas:
+        foundLapack = self.checkLapack(lapackLibrary, self.getOtherLibs(foundBlas, blasLibrary), 0, ['getrs', 'geev'])
       if foundBlas and foundLapack:
         self.framework.logPrint('Found no name mangling on BLAS/LAPACK')
         self.mangling = 'unchanged'
       else:
         self.framework.logPrint('Checking for underscore name mangling on BLAS/LAPACK')
         foundBlas = self.checkBlas(blasLibrary, self.getOtherLibs(foundBlas, blasLibrary), 0, 'dot_')
-        foundLapack = self.checkLapack(lapackLibrary, self.getOtherLibs(foundBlas, blasLibrary), 0, ['getrs_', 'geev_'])
+        if foundBlas:
+          foundLapack = self.checkLapack(lapackLibrary, self.getOtherLibs(foundBlas, blasLibrary), 0, ['getrs_', 'geev_'])
         if foundBlas and foundLapack:
           self.framework.logPrint('Found underscore name mangling on BLAS/LAPACK')
           self.mangling = 'underscore'
           self.f2c = 1
-    self.f2cpkg = self.checkBlas(blasLibrary, self.getOtherLibs(foundBlas, blasLibrary), 0, 'f2cblaslapack311_id')
     return (foundBlas, foundLapack)
 
   def generateGuesses(self):
       raise RuntimeError('Cannot use PESSL instead of ESSL!')
     return
 
+  def mangleBlas(self, baseName):
+    prefix = self.getPrefix()
+    if self.f2c and self.mangling == 'underscore':
+      return prefix+baseName+'_'
+    else:
+      return prefix+baseName
+
   def checkMissing(self):
     '''Check for missing LAPACK routines'''
     if self.foundLapack:
       mangleFunc = hasattr(self.compilers, 'FC') and not self.f2c
-      for baseName in ['trsen','gerfs','gges','tgsen','gesvd','getrf','getrs','geev','gelss','syev','syevx','sygv','sygvx','potrf','potrs','stebz','pttrf','pttrs','stein','orgqr','geqrf','gesv','hseqr','geqrf','steqr']:
-        prefix = self.getPrefix()
-        if self.f2c:
-          if self.mangling == 'underscore':
-            routine = prefix+baseName+'_'
-          else:
-            routine = prefix+baseName
-        else:
-          routine = prefix+baseName
-        oldLibs = self.compilers.LIBS
-        if not self.libraries.check(self.lapackLibrary, routine, otherLibs = self.getOtherLibs(), fortranMangle = mangleFunc):
-          self.missingRoutines.append(baseName)
-          self.addDefine('MISSING_LAPACK_'+baseName.upper(), 1)
-        self.compilers.LIBS = oldLibs
-    return
+    routines = ['trsen','gerfs','gges','tgsen','gesvd','getrf','getrs','geev','gelss','syev','syevx','sygv','sygvx','potrf','potrs','stebz','pttrf','pttrs','stein','orgqr','geqrf','gesv','hseqr','steqr']
+    oldLibs = self.compilers.LIBS
+    found, missing = self.libraries.checkClassify(self.lapackLibrary, map(self.mangleBlas,routines), otherLibs = self.getOtherLibs(), fortranMangle = mangleFunc)
+    for baseName in routines:
+      if self.mangleBlas(baseName) in missing:
+        self.missingRoutines.append(baseName)
+        self.addDefine('MISSING_LAPACK_'+baseName.upper(), 1)
+    self.compilers.LIBS = oldLibs
 
   def checklsame(self):
     ''' Do the BLAS/LAPACK libraries have a valid lsame() function with correction binding. Lion and xcode 4.2 do not'''

File config/BuildSystem/config/packages/MPI.py

       self.addDefine('HAVE_MPI_WIN_CREATE',1)
       self.addDefine('HAVE_MPI_REPLACE',1) # MPI_REPLACE is strictly for use with the one-sided function MPI_Accumulate
     funcs = '''MPI_Comm_spawn MPI_Type_get_envelope MPI_Type_get_extent MPI_Type_dup MPI_Init_thread
-      MPIX_Iallreduce MPI_Iallreduce MPI_Ibarrier MPI_Finalized MPI_Exscan'''.split()
-    for f in funcs:
+      MPI_Iallreduce MPI_Ibarrier MPI_Finalized MPI_Exscan'''.split()
+    found, missing = self.libraries.checkClassify(self.dlib, funcs)
+    for f in found:
+      self.addDefine('HAVE_' + f.upper(),1)
+    for f in ['MPIX_Iallreduce']: # Unlikely to be found
       if self.libraries.check(self.dlib, f):
         self.addDefine('HAVE_' + f.upper(),1)
 

File config/BuildSystem/config/setCompilers.py

 from __future__ import generators
 import config.base
+import config
 
 import os
 
     except RuntimeError:
       pass
     return 0
-  isGNU = staticmethod(isGNU)
+  isGNU = staticmethod(config.memoize(isGNU))
 
   def isClang(compiler):
     '''Returns true if the compiler is a Clang/LLVM compiler'''
     arcWindows = os.path.join(self.tmpDir, 'libconf1.lib')
     def checkArchive(command, status, output, error):
       if error or status:
-        self.framework.logPrint('Possible ERROR while running archiver: '+output)
-        if status: self.framework.logPrint('ret = '+str(status))
-        if error: self.framework.logPrint('error message = {'+error+'}')
+        self.logError('archiver', status, output, error)
         if os.path.isfile(objName):
           os.remove(objName)
         raise RuntimeError('Archiver is not functional')
       return
     def checkRanlib(command, status, output, error):
       if error or status:
-        self.framework.logPrint('Possible ERROR while running ranlib: '+output)
-        if status: self.framework.logPrint('ret = '+str(status))
-        if error: self.framework.logPrint('error message = {'+error+'}')
+        self.logError('ranlib', status, output, error)
         if os.path.isfile(arcUnix):
           os.remove(arcUnix)
         raise RuntimeError('Ranlib is not functional with your archiver.  Try --with-ranlib=true if ranlib is unnecessary.')

File config/BuildSystem/config/util.py

+# Stateless utilities
+#
+# This entire module is exported into the config.* namespace (see
+# __init__.py), so be careful to avoid namespace conflicts.  Do not
+# import config.util directly.  Instead, import config and access only
+# the exported objects.
+
+def classify(items, functional, args=(), kwargs=dict()):
+    '''Classify items as True or False using boolean functional on sets.
+
+    An item can only be identified as False if functional([item]) is
+    false, but an item is True if functional(List) is True and item in
+    List.
+
+    Functional may return True (all items are True), False (at least one
+    item is False) or a list of suggestions for items that may have been
+    False (implies that at least one item is False).  The list of
+    suggestions does not have to be accurate, but classification will be
+    faster if it is accurate.
+    '''
+    items = list(items)         # In case a set or other iterable was passed in
+
+    result = functional(items, *args, **kwargs)
+    if result is True:
+        return items, []        # All succeeded
+    if len(items) == 1:
+        return [], items        # Sole failure
+    if result is False:
+        suggested = []
+    else:
+        suggested = list(result)
+    items = [i for i in items if i not in suggested]
+    good = []
+    bad = []
+    if len(items) < 5:          # linear check
+        groups = [[i] for i in items]
+    else:                       # bisect
+        groups = [items[:len(items)/2], items[len(items)/2:]]
+    groups += [[i] for i in suggested]
+    for grp in groups:
+        g, b = classify(grp, functional, args, kwargs)
+        good += g
+        bad += b
+    return good, bad
+
+
+class NamedInStderr:
+    '''Hepler class to log the (string) items that are written to stderr on failure.
+
+    In the common case, all the missing items are named in the linker
+    error and the rest can be confirmed True in a single batch.
+    '''
+    def __init__(self, items):
+        self.named = []
+        self.items = items
+
+    def examineStderr(self, ret, out, err):
+        if ret:
+            self.named += [i for i in self.items if i in err]
+
+
+class memoize(dict):
+    '''Memoizing decorator.  No support for keyword arguments.'''
+    def __init__(self, func):
+        self.func = func
+
+    def __call__(self, *args):
+        try:
+            return self[args]
+        except KeyError:
+            ret = self[args] = self.func(*args)
+            return ret

File config/BuildSystem/graph.py

   def addSubgraph(self, graph):
     '''Add the vertices and edges of another graph into this one'''
     map(self.addVertex, graph.vertices)
-    map(lambda v: apply(self.addEdges, (v,)+graph.getEdges(v)), graph.vertices)
+    map(lambda v: self.addEdges(v, *graph.getEdges(v)), graph.vertices)
     return
 
   def removeSubgraph(self, graph):

File config/BuildSystem/nargs.py

     if not isinstance(value, str):
       raise TypeError('Invalid directory: '+str(value)+' for key '+str(self.key))
     value = os.path.expanduser(value)
+    value = os.path.abspath(value)
     if self.mustExist and value and not os.path.isdir(value):
       raise ValueError('Nonexistent directory: '+str(value)+' for key '+str(self.key))
     self.value = value

File config/BuildSystem/script.py

     def logOutput(log, output):
       import re
       # get rid of multiple blank lines
-      output = re.sub('\n[\n]*','\n', output)
-      if lineLimit:
-        output = '\n'.join(output.split('\n')[:lineLimit])
-      log.write('sh: '+output+'\n')
+      output = re.sub('\n[\n]*','\n', output).strip()
+      if output:
+        if lineLimit:
+          output = '\n'.join(output.split('\n')[:lineLimit])
+        if '\n' in output:      # multi-line output
+          log.write('stdout:\n'+output+'\n')
+        else:
+          log.write('stdout: '+output+'\n')
       return output
     def runInShell(command, log, cwd):
       if useThreads:
       else:
         return Script.runShellCommand(command, log, cwd)
 
-    log.write('sh: %s\n' % (command,))
     (output, error, status) = runInShell(command, log, cwd)
     output = logOutput(log, output)
     checkCommand(command, status, output, error)

File config/builder.py

                                                                 'requires': ['opencl']},
                                                                {'numProcs': 1, 'args': '-dm_view -refinement_limit 0.0 -compute_function -petscspace_order 1 -petscfe_type opencl -petscfe_num_blocks 2 -petscfe_num_batches 2 -dm_plex_print_fem 1 -dm_plex_print_tol 1.0e-06',
                                                                 'requires': ['opencl']},
-                                                               # 2D Laplacian Parallel Refinement 36-38
-                                                               {'numProcs': 2, 'args': '-dm_view -interpolate -refinement_limit 0.0625 -petscspace_order 1 -refinement_uniform -compute_function -batch -gpu -gpu_batches 2',
-                                                                'setup': './bin/pythonscripts/PetscGenerateFEMQuadrature.py 2 1 1 1 laplacian src/snes/examples/tutorials/ex52.h',
-                                                                'source': ['src/snes/examples/tutorials/ex52_integrateElement.cu'], 'requires': ['cuda']},
-                                                               {'numProcs': 2, 'args': '-dm_view -interpolate -refinement_limit 0.0625 -petscspace_order 1 -refinement_uniform -compute_function -batch -gpu -gpu_batches 2',
-                                                                'requires': ['opencl']},
-                                                               {'numProcs': 2, 'args': '-dm_view -interpolate -refinement_limit 0.0625 -petscspace_order 1 -refinement_uniform -refinement_rounds 3 -compute_function -batch -gpu -gpu_batches 2',
-                                                                'setup': './bin/pythonscripts/PetscGenerateFEMQuadrature.py 2 1 1 1 laplacian src/snes/examples/tutorials/ex52.h',
-                                                                'source': ['src/snes/examples/tutorials/ex52_integrateElement.cu'], 'requires': ['cuda']},
+                                                               # 2D Laplacian Parallel Refinement 36-37
+                                                               {'numProcs': 2, 'args': '-dm_view -interpolate -refinement_limit 0.0625 -petscspace_order 1 -refinement_uniform -compute_function -batch -gpu -gpu_batches 2', 'requires': ['opencl']},
+                                                               {'numProcs': 2, 'args': '-dm_view -interpolate -refinement_limit 0.0625 -petscspace_order 1 -refinement_uniform -refinement_rounds 3 -compute_function -batch -gpu -gpu_batches 2', 'requires': ['opencl']},
                                                                ],
                         'src/snes/examples/tutorials/ex62':   [# 2D serial P1 tests 0-3
                                                                {'numProcs': 1, 'args': '-run_type test -refinement_limit 0.0    -bc_type dirichlet -interpolate 0 -vel_petscspace_order 1 -pres_petscspace_order 1 -show_initial -dm_plex_print_fem 1'},
 
                                                                {'numProcs': 1, 'args': '-run_type test -refinement_limit 0.0625 -bc_type dirichlet -interpolate 1 -vel_petscspace_order 2 -pres_petscspace_order 1 -show_initial -dm_plex_print_fem 1'},
                                                                # Parallel tests 6-17
-                                                               {'numProcs': 2, 'args': '-run_type test -refinement_limit 0.0    -bc_type dirichlet -interpolate 0 -vel_petscspace_order 1 -pres_petscspace_order 1 -dm_plex_print_fem 1',
-                                                                'setup': './bin/pythonscripts/PetscGenerateFEMQuadrature.py 2 1 2 1 laplacian 2 1 1 1 gradient src/snes/examples/tutorials/ex62.h'},
+                                                               {'numProcs': 2, 'args': '-run_type test -refinement_limit 0.0    -bc_type dirichlet -interpolate 0 -vel_petscspace_order 1 -pres_petscspace_order 1 -dm_plex_print_fem 1'},
                                                                {'numProcs': 3, 'args': '-run_type test -refinement_limit 0.0    -bc_type dirichlet -interpolate 0 -vel_petscspace_order 1 -pres_petscspace_order 1 -dm_plex_print_fem 1'},
                                                                {'numProcs': 5, 'args': '-run_type test -refinement_limit 0.0    -bc_type dirichlet -interpolate 0 -vel_petscspace_order 1 -pres_petscspace_order 1 -dm_plex_print_fem 1'},
                                                                {'numProcs': 2, 'args': '-run_type test -refinement_limit 0.0    -bc_type dirichlet -interpolate 1 -vel_petscspace_order 1 -pres_petscspace_order 1 -dm_plex_print_fem 1'},
                                                                {'numProcs': 2, 'args': '-run_type full -refinement_limit 0.0625 -bc_type dirichlet -interpolate 1 -vel_petscspace_order 1 -pres_petscspace_order 1 -pc_type jacobi -ksp_rtol 1.0e-9 -snes_monitor_short -ksp_monitor_short -snes_converged_reason -snes_view'},
                                                                {'numProcs': 3, 'args': '-run_type full -refinement_limit 0.0625 -bc_type dirichlet -interpolate 1 -vel_petscspace_order 1 -pres_petscspace_order 1 -pc_type jacobi -ksp_rtol 1.0e-9 -snes_converged_reason -snes_view'},
                                                                {'numProcs': 5, 'args': '-run_type full -refinement_limit 0.0625 -bc_type dirichlet -interpolate 1 -vel_petscspace_order 1 -pres_petscspace_order 1 -pc_type jacobi -ksp_rtol 1.0e-9 -snes_converged_reason -snes_view'},
-                                                               {'numProcs': 1, 'args': '-run_type full -refinement_limit 0.0625 -bc_type dirichlet -interpolate 1 -vel_petscspace_order 2 -pres_petscspace_order 1 -pc_type jacobi -ksp_rtol 1.0e-9 -snes_monitor_short -ksp_monitor_short -snes_converged_reason -snes_view',
-                                                                'setup': './bin/pythonscripts/PetscGenerateFEMQuadrature.py 2 2 2 1 laplacian 2 1 1 1 gradient src/snes/examples/tutorials/ex62.h'},
+                                                               {'numProcs': 1, 'args': '-run_type full -refinement_limit 0.0625 -bc_type dirichlet -interpolate 1 -vel_petscspace_order 2 -pres_petscspace_order 1 -pc_type jacobi -ksp_rtol 1.0e-9 -snes_monitor_short -ksp_monitor_short -snes_converged_reason -snes_view'},
                                                                {'numProcs': 2, 'args': '-run_type full -refinement_limit 0.0625 -bc_type dirichlet -interpolate 1 -vel_petscspace_order 2 -pres_petscspace_order 1 -pc_type jacobi -ksp_rtol 1.0e-9 -snes_monitor_short -ksp_monitor_short -snes_converged_reason -snes_view'},
                                                                {'numProcs': 3, 'args': '-run_type full -refinement_limit 0.0625 -bc_type dirichlet -interpolate 1 -vel_petscspace_order 2 -pres_petscspace_order 1 -pc_type jacobi -ksp_rtol 1.0e-9 -snes_converged_reason -snes_view'},
                                                                {'numProcs': 5, 'args': '-run_type full -refinement_limit 0.0625 -bc_type dirichlet -interpolate 1 -vel_petscspace_order 2 -pres_petscspace_order 1 -pc_type jacobi -ksp_rtol 1.0e-9 -snes_converged_reason -snes_view'},
                                                                # Stokes preconditioners 30-36
                                                                #   Jacobi
-                                                               {'numProcs': 1, 'args': '-run_type full -refinement_limit 0.00625 -bc_type dirichlet -interpolate 1 -vel_petscspace_order 2 -pres_petscspace_order 1 -ksp_gmres_restart 100 -pc_type jacobi -ksp_rtol 1.0e-9 -snes_monitor_short -ksp_monitor_short -snes_converged_reason -snes_view -show_solution 0',
-                                                                'setup': './bin/pythonscripts/PetscGenerateFEMQuadrature.py 2 2 2 1 laplacian 2 1 1 1 gradient src/snes/examples/tutorials/ex62.h'},
+                                                               {'numProcs': 1, 'args': '-run_type full -refinement_limit 0.00625 -bc_type dirichlet -interpolate 1 -vel_petscspace_order 2 -pres_petscspace_order 1 -ksp_gmres_restart 100 -pc_type jacobi -ksp_rtol 1.0e-9 -snes_monitor_short -ksp_monitor_short -snes_converged_reason -snes_view -show_solution 0'},
                                                                #  Block diagonal \begin{pmatrix} A & 0 \\ 0 & I \end{pmatrix}
                                                                {'numProcs': 1, 'args': '-run_type full -refinement_limit 0.00625 -bc_type dirichlet -interpolate 1 -vel_petscspace_order 2 -pres_petscspace_order 1 -ksp_type fgmres -ksp_gmres_restart 100 -ksp_rtol 1.0e-9 -pc_type fieldsplit -pc_fieldsplit_type additive -fieldsplit_velocity_pc_type lu -fieldsplit_pressure_pc_type jacobi -snes_monitor_short -ksp_monitor_short -snes_converged_reason -snes_view -show_solution 0'},
                                                                #  Block triangular \begin{pmatrix} A & B \\ 0 & I \end{pmatrix}
                                                                #  Full Schur complement \begin{pmatrix} A & B \\ B^T & S \end{pmatrix}
                                                                {'numProcs': 1, 'args': '-run_type full -refinement_limit 0.00625 -bc_type dirichlet -interpolate 1 -vel_petscspace_order 2 -pres_petscspace_order 1 -jacobian_mf -ksp_type fgmres -ksp_gmres_restart 100 -ksp_rtol 1.0e-9 -pc_type fieldsplit -pc_fieldsplit_type schur -pc_fieldsplit_schur_factorization_type full -fieldsplit_pressure_ksp_rtol 1e-10 -fieldsplit_velocity_ksp_type gmres -fieldsplit_velocity_pc_type lu -fieldsplit_pressure_pc_type jacobi -snes_monitor_short -ksp_monitor_short -snes_converged_reason -snes_view -show_solution 0'},
                                                                # 3D serial P1 tests 43-45
-                                                               {'numProcs': 1, 'args': '-run_type test -dim 3 -refinement_limit 0.0    -bc_type dirichlet -interpolate 0 -vel_petscspace_order 1 -pres_petscspace_order 1 -show_initial -dm_plex_print_fem 1',
-                                                                'setup': './bin/pythonscripts/PetscGenerateFEMQuadrature.py 3 1 3 1 laplacian 3 1 1 1 gradient src/snes/examples/tutorials/ex62.h'},
+                                                               {'numProcs': 1, 'args': '-run_type test -dim 3 -refinement_limit 0.0    -bc_type dirichlet -interpolate 0 -vel_petscspace_order 1 -pres_petscspace_order 1 -show_initial -dm_plex_print_fem 1'},
                                                                {'numProcs': 1, 'args': '-run_type test -dim 3 -refinement_limit 0.0    -bc_type dirichlet -interpolate 1 -vel_petscspace_order 1 -pres_petscspace_order 1 -show_initial -dm_plex_print_fem 1'},
                                                                {'numProcs': 1, 'args': '-run_type test -dim 3 -refinement_limit 0.0125 -bc_type dirichlet -interpolate 0 -vel_petscspace_order 1 -pres_petscspace_order 1 -show_initial -dm_plex_print_fem 1'},
                                                                {'numProcs': 1, 'args': '-run_type test -dim 3 -refinement_limit 0.0125 -bc_type dirichlet -interpolate 1 -vel_petscspace_order 1 -pres_petscspace_order 1 -show_initial -dm_plex_print_fem 1'},
                                                                ],
-
-                        'src/snes/examples/tutorials/ex67':   [{'numProcs': 1, 'args': '-dm_view -snes_monitor -ksp_monitor -snes_view',
-                                                                'setup': 'bin/pythonscripts/PetscGenerateFEMQuadratureTensorProduct.py 2 1 2 1 laplacian 2 0 1 1 gradient src/snes/examples/tutorials/ex67.h'},
-                                                               {'numProcs': 2, 'args': '-dm_view -snes_monitor -ksp_monitor -snes_view'}],
                         'src/snes/examples/tutorials/ex72':   [# 2D serial P1 tests 0-1
                                                                {'numProcs': 1, 'args': '-run_type test -refinement_limit 0.0    -bc_type dirichlet -show_initial -dm_plex_print_fem 1 -show_jacobian',
                                                                 'setup': './bin/pythonscripts/PetscGenerateFEMQuadratureTensorProduct.py 2 1 2 1 laplacian 2 1 1 1 gradient src/snes/examples/tutorials/ex72.h'},
    flags.extend([self.configInfo.setCompilers.CPPFLAGS, self.configInfo.CHUD.CPPFLAGS]) # Add CPP_FLAGS
    if self.configInfo.compilers.generateDependencies[language]:
      flags.append(self.configInfo.compilers.dependenciesGenerationFlag[language])
-   if not language == 'FC':
-     flags.append('-D__INSDIR__='+os.getcwd().replace(self.petscDir, ''))               # Define __INSDIR__
    cmd      = ' '.join([compiler]+['-c']+includes+[packageIncludes]+flags+source)
    self.logWrite(cmd+'\n', debugSection = self.debugSection, forceScroll = True)
    if not self.dryRun:
    flags.extend([self.configInfo.setCompilers.CPPFLAGS, self.configInfo.CHUD.CPPFLAGS]) # Add CPP_FLAGS
    if self.configInfo.compilers.generateDependencies[language]:
      flags.append(self.configInfo.compilers.dependenciesGenerationFlag[language])
-   if not language == 'FC':
-     flags.append('-D__INSDIR__='+os.getcwd().replace(self.petscDir, ''))               # Define __INSDIR__
    cmd      = ' '.join([compiler]+['-c']+includes+[packageIncludes]+flags+source)
    if not self.dryRun:
      pipe = self.runShellCommandParallel(cmd)

File config/cmakegen.py

 
 include_directories ("${PETSc_SOURCE_DIR}/include" "${PETSc_BINARY_DIR}/include")
 
-add_definitions (-D__INSDIR__= ) # CMake always uses the absolute path
 set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PETSc_BINARY_DIR}/lib" CACHE PATH "Output directory for PETSc archives")
 set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PETSc_BINARY_DIR}/lib" CACHE PATH "Output directory for PETSc libraries")
 set (CMAKE_Fortran_MODULE_DIRECTORY "${PETSc_BINARY_DIR}/include" CACHE PATH "Output directory for fortran *.mod files")

File config/examples/arch-linux-complex-gcov.py

 configure_options = [
   '--with-clanguage=cxx',
   '--with-scalar-type=complex',
-  #'--with-gcov=1',
+  '--with-gcov=1',
   '--download-mpich=1',
   ]
 

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

 
 configure_options = [
   '--download-mpich=1',
-  #'--with-gcov=1'
+  '--with-gcov=1'
   ]
 
 if __name__ == '__main__':

File config/examples/arch-linux-pkgs-gcov.py

 #!/usr/bin/env python
 
 configure_options = [
-  #'--with-gcov=1',
+  '--with-gcov=1',
   '--download-mpich=1',
   '--download-f-blas-lapack=1',
   '--download-hypre=1',

File include/finclude/petsctsdef.h

 #define TSADAPTNONE  'none'
 #define TSADAPTCFL   'cfl'
 
+#define TSRKType character*(80)
+#define TSRK1FE   '1fe'
+#define TSRK2A    '2a'
+#define TSRK3     '3'
+#define TSRK3BS   '3bs'
+#define TSRK4     '4'
+#define TSRK5F    '5f'
+#define TSRK5DP   '5dp'
+
 #define TSARKIMEXType character*(80)
 #define TSARKIMEX1BEE   '1bee'
 #define TSARKIMEXA2     'a2'

File include/petsc-private/fortranimpl.h

 
 #define CHKFORTRANNULLINTEGER(a)  \
   if (FORTRANNULLDOUBLE(a) || FORTRANNULLSCALAR(a) || FORTRANNULLREAL(a) || FORTRANNULLOBJECT(a) || FORTRANNULLFUNCTION(a)) { \
-    PetscError(PETSC_COMM_SELF,__LINE__,"fortran_interface_unknown_file",__FILE__,__SDIR__,PETSC_ERR_ARG_WRONG,PETSC_ERROR_INITIAL, \
+    PetscError(PETSC_COMM_SELF,__LINE__,"fortran_interface_unknown_file",__FILE__,PETSC_ERR_ARG_WRONG,PETSC_ERROR_INITIAL, \
     "Use PETSC_NULL_INTEGER"); *ierr = 1; return; } \
   else if (FORTRANNULLINTEGER(a)) { a = NULL; }
 
 #define CHKFORTRANNULLSCALAR(a)   \
   if (FORTRANNULLINTEGER(a) || FORTRANNULLDOUBLE(a) || FORTRANNULLREAL(a) || FORTRANNULLOBJECT(a) || FORTRANNULLFUNCTION(a)) { \
-    PetscError(PETSC_COMM_SELF,__LINE__,"fortran_interface_unknown_file",__FILE__,__SDIR__,PETSC_ERR_ARG_WRONG,PETSC_ERROR_INITIAL, \
+    PetscError(PETSC_COMM_SELF,__LINE__,"fortran_interface_unknown_file",__FILE__,PETSC_ERR_ARG_WRONG,PETSC_ERROR_INITIAL, \
     "Use PETSC_NULL_SCALAR"); *ierr = 1; return; } \
   else if (FORTRANNULLSCALAR(a)) { a = NULL; }
 
 #define CHKFORTRANNULLDOUBLE(a)  \
   if (FORTRANNULLINTEGER(a) || FORTRANNULLSCALAR(a) || FORTRANNULLREAL(a) || FORTRANNULLOBJECT(a) || FORTRANNULLFUNCTION(a)) { \
-    PetscError(PETSC_COMM_SELF,__LINE__,"fortran_interface_unknown_file",__FILE__,__SDIR__,PETSC_ERR_ARG_WRONG,PETSC_ERROR_INITIAL, \
+    PetscError(PETSC_COMM_SELF,__LINE__,"fortran_interface_unknown_file",__FILE__,PETSC_ERR_ARG_WRONG,PETSC_ERROR_INITIAL, \
     "Use PETSC_NULL_DOUBLE"); *ierr = 1; return; } \
   else if (FORTRANNULLDOUBLE(a)) { a = NULL; }
 
 #define CHKFORTRANNULLREAL(a)  \
   if (FORTRANNULLINTEGER(a) || FORTRANNULLDOUBLE(a) || FORTRANNULLSCALAR(a) || FORTRANNULLOBJECT(a) || FORTRANNULLFUNCTION(a)) { \
-    PetscError(PETSC_COMM_SELF,__LINE__,"fortran_interface_unknown_file",__FILE__,__SDIR__,PETSC_ERR_ARG_WRONG,PETSC_ERROR_INITIAL, \
+    PetscError(PETSC_COMM_SELF,__LINE__,"fortran_interface_unknown_file",__FILE__,PETSC_ERR_ARG_WRONG,PETSC_ERROR_INITIAL, \
     "Use PETSC_NULL_REAL"); *ierr = 1; return; } \
   else if (FORTRANNULLREAL(a)) { a = NULL; }
 
 #define CHKFORTRANNULLOBJECT(a)  \
   if (FORTRANNULLINTEGER(a) || FORTRANNULLDOUBLE(a) || FORTRANNULLSCALAR(a) || FORTRANNULLREAL(a) || FORTRANNULLFUNCTION(a)) { \
-    PetscError(PETSC_COMM_SELF,__LINE__,"fortran_interface_unknown_file",__FILE__,__SDIR__,PETSC_ERR_ARG_WRONG,PETSC_ERROR_INITIAL, \
+    PetscError(PETSC_COMM_SELF,__LINE__,"fortran_interface_unknown_file",__FILE__,PETSC_ERR_ARG_WRONG,PETSC_ERROR_INITIAL, \
     "Use PETSC_NULL_OBJECT"); *ierr = 1; return; } \
   else if (FORTRANNULLOBJECT(a)) { a = NULL; }
 
 
 #define CHKFORTRANNULLOBJECTDEREFERENCE(a)  \
   if (FORTRANNULLSCALAR(a) || FORTRANNULLDOUBLE(a) || FORTRANNULLREAL(a) || FORTRANNULLINTEGER(a) || FORTRANNULLFUNCTION(a)) { \
-    PetscError(PETSC_COMM_SELF,__LINE__,"fortran_interface_unknown_file",__FILE__,__SDIR__,PETSC_ERR_ARG_WRONG,PETSC_ERROR_INITIAL, \
+    PetscError(PETSC_COMM_SELF,__LINE__,"fortran_interface_unknown_file",__FILE__,PETSC_ERR_ARG_WRONG,PETSC_ERROR_INITIAL, \
     "Use PETSC_NULL_OBJECT"); *ierr = 1; return; } \
   else if (FORTRANNULLOBJECT(a)) { *((void***)&a) = &PETSCNULLPOINTERADDRESS; }
 
 #define CHKFORTRANNULLFUNCTION(a)  \
   if (FORTRANNULLSCALAR(a) || FORTRANNULLDOUBLE(a) || FORTRANNULLREAL(a) || FORTRANNULLINTEGER(a) || FORTRANNULLOBJECT(a)) { \
-    PetscError(PETSC_COMM_SELF,__LINE__,"fortran_interface_unknown_file",__FILE__,__SDIR__,PETSC_ERR_ARG_WRONG,PETSC_ERROR_INITIAL, \
+    PetscError(PETSC_COMM_SELF,__LINE__,"fortran_interface_unknown_file",__FILE__,PETSC_ERR_ARG_WRONG,PETSC_ERROR_INITIAL, \
     "Use PETSC_NULL_FUNCTION"); *ierr = 1; return; } \
   else if (FORTRANNULLFUNCTION(a)) { a = NULL; }
 

File include/petsc-private/tsimpl.h

 
   PetscErrorCode (*prestep)(TS);
   PetscErrorCode (*prestage)(TS,PetscReal);
+  PetscErrorCode (*poststage)(TS,PetscReal,PetscInt,Vec*);
   PetscErrorCode (*poststep)(TS);
 
   /* ---------------------- IMEX support ---------------------------------*/

File include/petscdmplex.h

 PETSC_EXTERN PetscErrorCode DMLabelCreateIndex(DMLabel, PetscInt, PetscInt);
 PETSC_EXTERN PetscErrorCode DMLabelDestroyIndex(DMLabel);
 PETSC_EXTERN PetscErrorCode DMLabelHasPoint(DMLabel, PetscInt, PetscBool *);
+PETSC_EXTERN PetscErrorCode DMLabelFilter(DMLabel, PetscInt, PetscInt);
 
 PETSC_EXTERN PetscErrorCode DMPlexCreateLabel(DM, const char []);
 PETSC_EXTERN PetscErrorCode DMPlexGetLabelValue(DM, const char[], PetscInt, PetscInt *);

File include/petscerror.h

 
 #define PetscStringizeArg(a) #a
 #define PetscStringize(a) PetscStringizeArg(a)
-#define __SDIR__ ""
 
 #if defined(PETSC_USE_ERRORCHECKING)
 
 
 .seealso: PetscTraceBackErrorHandler(), PetscPushErrorHandler(), PetscError(), CHKERRQ(), CHKMEMQ, SETERRQ1(), SETERRQ2(), SETERRQ3()
 M*/
-#define SETERRQ(comm,n,s)              return PetscError(comm,__LINE__,PETSC_FUNCTION_NAME,__FILE__,__SDIR__,n,PETSC_ERROR_INITIAL,s)
+#define SETERRQ(comm,n,s)              return PetscError(comm,__LINE__,PETSC_FUNCTION_NAME,__FILE__,n,PETSC_ERROR_INITIAL,s)
 
 /*MC
    SETERRQ1 - Macro that is called when an error has been detected,
 
 .seealso: PetscTraceBackErrorHandler(), PetscPushErrorHandler(), PetscError(), CHKERRQ(), CHKMEMQ, SETERRQ(), SETERRQ2(), SETERRQ3()
 M*/
-#define SETERRQ1(comm,n,s,a1)          return PetscError(comm,__LINE__,PETSC_FUNCTION_NAME,__FILE__,__SDIR__,n,PETSC_ERROR_INITIAL,s,a1)
+#define SETERRQ1(comm,n,s,a1)          return PetscError(comm,__LINE__,PETSC_FUNCTION_NAME,__FILE__,n,PETSC_ERROR_INITIAL,s,a1)
 
 /*MC
    SETERRQ2 - Macro that is called when an error has been detected,
 
 .seealso: PetscTraceBackErrorHandler(), PetscPushErrorHandler(), PetscError(), CHKERRQ(), CHKMEMQ, SETERRQ1(), SETERRQ3()
 M*/
-#define SETERRQ2(comm,n,s,a1,a2)       return PetscError(comm,__LINE__,PETSC_FUNCTION_NAME,__FILE__,__SDIR__,n,PETSC_ERROR_INITIAL,s,a1,a2)
+#define SETERRQ2(comm,n,s,a1,a2)       return PetscError(comm,__LINE__,PETSC_FUNCTION_NAME,__FILE__,n,PETSC_ERROR_INITIAL,s,a1,a2)
 
 /*MC
    SETERRQ3 - Macro that is called when an error has been detected,
 
 .seealso: PetscTraceBackErrorHandler(), PetscPushErrorHandler(), PetscError(), CHKERRQ(), CHKMEMQ, SETERRQ1(), SETERRQ2()
 M*/
-#define SETERRQ3(comm,n,s,a1,a2,a3)    return PetscError(comm,__LINE__,PETSC_FUNCTION_NAME,__FILE__,__SDIR__,n,PETSC_ERROR_INITIAL,s,a1,a2,a3)
+#define SETERRQ3(comm,n,s,a1,a2,a3)    return PetscError(comm,__LINE__,PETSC_FUNCTION_NAME,__FILE__,n,PETSC_ERROR_INITIAL,s,a1,a2,a3)
 
-#define SETERRQ4(comm,n,s,a1,a2,a3,a4) return PetscError(comm,__LINE__,PETSC_FUNCTION_NAME,__FILE__,__SDIR__,n,PETSC_ERROR_INITIAL,s,a1,a2,a3,a4)
-#define SETERRQ5(comm,n,s,a1,a2,a3,a4,a5)       return PetscError(comm,__LINE__,PETSC_FUNCTION_NAME,__FILE__,__SDIR__,n,PETSC_ERROR_INITIAL,s,a1,a2,a3,a4,a5)
-#define SETERRQ6(comm,n,s,a1,a2,a3,a4,a5,a6)    return PetscError(comm,__LINE__,PETSC_FUNCTION_NAME,__FILE__,__SDIR__,n,PETSC_ERROR_INITIAL,s,a1,a2,a3,a4,a5,a6)
-#define SETERRQ7(comm,n,s,a1,a2,a3,a4,a5,a6,a7) return PetscError(comm,__LINE__,PETSC_FUNCTION_NAME,__FILE__,__SDIR__,n,PETSC_ERROR_INITIAL,s,a1,a2,a3,a4,a5,a6,a7)
-#define SETERRQ8(comm,n,s,a1,a2,a3,a4,a5,a6,a7,a8) return PetscError(comm,__LINE__,PETSC_FUNCTION_NAME,__FILE__,__SDIR__,n,PETSC_ERROR_INITIAL,s,a1,a2,a3,a4,a5,a6,a7,a8)
-#define SETERRABORT(comm,n,s)     do {PetscError(comm,__LINE__,PETSC_FUNCTION_NAME,__FILE__,__SDIR__,n,PETSC_ERROR_INITIAL,s);MPI_Abort(comm,n);} while (0)
+#define SETERRQ4(comm,n,s,a1,a2,a3,a4) return PetscError(comm,__LINE__,PETSC_FUNCTION_NAME,__FILE__,n,PETSC_ERROR_INITIAL,s,a1,a2,a3,a4)
+#define SETERRQ5(comm,n,s,a1,a2,a3,a4,a5)       return PetscError(comm,__LINE__,PETSC_FUNCTION_NAME,__FILE__,n,PETSC_ERROR_INITIAL,s,a1,a2,a3,a4,a5)
+#define SETERRQ6(comm,n,s,a1,a2,a3,a4,a5,a6)    return PetscError(comm,__LINE__,PETSC_FUNCTION_NAME,__FILE__,n,PETSC_ERROR_INITIAL,s,a1,a2,a3,a4,a5,a6)
+#define SETERRQ7(comm,n,s,a1,a2,a3,a4,a5,a6,a7) return PetscError(comm,__LINE__,PETSC_FUNCTION_NAME,__FILE__,n,PETSC_ERROR_INITIAL,s,a1,a2,a3,a4,a5,a6,a7)
+#define SETERRQ8(comm,n,s,a1,a2,a3,a4,a5,a6,a7,a8) return PetscError(comm,__LINE__,PETSC_FUNCTION_NAME,__FILE__,n,PETSC_ERROR_INITIAL,s,a1,a2,a3,a4,a5,a6,a7,a8)
+#define SETERRABORT(comm,n,s)     do {PetscError(comm,__LINE__,PETSC_FUNCTION_NAME,__FILE__,n,PETSC_ERROR_INITIAL,s);MPI_Abort(comm,n);} while (0)
 
 /*MC
    CHKERRQ - Checks error code, if non-zero it calls the error handler and then returns
 
 .seealso: PetscTraceBackErrorHandler(), PetscPushErrorHandler(), PetscError(), SETERRQ(), CHKMEMQ, SETERRQ1(), SETERRQ2(), SETERRQ2()
 M*/
-#define CHKERRQ(n)             do {if (PetscUnlikely(n)) return PetscError(PETSC_COMM_SELF,__LINE__,PETSC_FUNCTION_NAME,__FILE__,__SDIR__,n,PETSC_ERROR_REPEAT," ");} while (0)
+#define CHKERRQ(n)             do {if (PetscUnlikely(n)) return PetscError(PETSC_COMM_SELF,__LINE__,PETSC_FUNCTION_NAME,__FILE__,n,PETSC_ERROR_REPEAT," ");} while (0)
 
-#define CHKERRV(n)             do {if (PetscUnlikely(n)) {n = PetscError(PETSC_COMM_SELF,__LINE__,PETSC_FUNCTION_NAME,__FILE__,__SDIR__,n,PETSC_ERROR_REPEAT," ");return;}} while(0)
-#define CHKERRABORT(comm,n)    do {if (PetscUnlikely(n)) {PetscError(PETSC_COMM_SELF,__LINE__,PETSC_FUNCTION_NAME,__FILE__,__SDIR__,n,PETSC_ERROR_REPEAT," ");MPI_Abort(comm,n);}} while (0)
-#define CHKERRCONTINUE(n)      do {if (PetscUnlikely(n)) {PetscError(PETSC_COMM_SELF,__LINE__,PETSC_FUNCTION_NAME,__FILE__,__SDIR__,n,PETSC_ERROR_REPEAT," ");}} while (0)
+#define CHKERRV(n)             do {if (PetscUnlikely(n)) {n = PetscError(PETSC_COMM_SELF,__LINE__,PETSC_FUNCTION_NAME,__FILE__,n,PETSC_ERROR_REPEAT," ");return;}} while(0)
+#define CHKERRABORT(comm,n)    do {if (PetscUnlikely(n)) {PetscError(PETSC_COMM_SELF,__LINE__,PETSC_FUNCTION_NAME,__FILE__,n,PETSC_ERROR_REPEAT," ");MPI_Abort(comm,n);}} while (0)
+#define CHKERRCONTINUE(n)      do {if (PetscUnlikely(n)) {PetscError(PETSC_COMM_SELF,__LINE__,PETSC_FUNCTION_NAME,__FILE__,n,PETSC_ERROR_REPEAT," ");}} while (0)
 
 #ifdef PETSC_CLANGUAGE_CXX
 
 
 .seealso: PetscTraceBackErrorHandler(), PetscPushErrorHandler(), PetscError(), SETERRQ(), CHKERRQ(), CHKMEMQ
 M*/
-#define CHKERRXX(n)            do {if (PetscUnlikely(n)) {PetscError(PETSC_COMM_SELF,__LINE__,PETSC_FUNCTION_NAME,__FILE__,__SDIR__,n,PETSC_ERROR_IN_CXX,0);}} while(0)
+#define CHKERRXX(n)            do {if (PetscUnlikely(n)) {PetscError(PETSC_COMM_SELF,__LINE__,PETSC_FUNCTION_NAME,__FILE__,n,PETSC_ERROR_IN_CXX,0);}} while(0)
 
 #endif
 
 .seealso: PetscTraceBackErrorHandler(), PetscPushErrorHandler(), PetscError(), SETERRQ(), CHKMEMQ, SETERRQ1(), SETERRQ2(), SETERRQ3(),
           PetscMallocValidate()
 M*/
-#define CHKMEMQ do {PetscErrorCode _7_ierr = PetscMallocValidate(__LINE__,PETSC_FUNCTION_NAME,__FILE__,__SDIR__);CHKERRQ(_7_ierr);} while(0)
+#define CHKMEMQ do {PetscErrorCode _7_ierr = PetscMallocValidate(__LINE__,PETSC_FUNCTION_NAME,__FILE__);CHKERRQ(_7_ierr);} while(0)
 
-#define CHKMEMA PetscMallocValidate(__LINE__,PETSC_FUNCTION_NAME,__FILE__,__SDIR__)
+#define CHKMEMA PetscMallocValidate(__LINE__,PETSC_FUNCTION_NAME,__FILE__)
 
 #else /* PETSC_USE_ERRORCHECKING */
 
 
 PETSC_EXTERN PetscErrorCode PetscErrorPrintfInitialize(void);
 PETSC_EXTERN PetscErrorCode PetscErrorMessage(int,const char*[],char **);
-PETSC_EXTERN PetscErrorCode PetscTraceBackErrorHandler(MPI_Comm,int,const char*,const char*,const char*,PetscErrorCode,PetscErrorType,const char*,void*);
-PETSC_EXTERN PetscErrorCode PetscIgnoreErrorHandler(MPI_Comm,int,const char*,const char*,const char*,PetscErrorCode,PetscErrorType,const char*,void*);
-PETSC_EXTERN PetscErrorCode PetscEmacsClientErrorHandler(MPI_Comm,int,const char*,const char*,const char*,PetscErrorCode,PetscErrorType,const char*,void*);
-PETSC_EXTERN PetscErrorCode PetscMPIAbortErrorHandler(MPI_Comm,int,const char*,const char*,const char*,PetscErrorCode,PetscErrorType,const char*,void*);
-PETSC_EXTERN PetscErrorCode PetscAbortErrorHandler(MPI_Comm,int,const char*,const char*,const char*,PetscErrorCode,PetscErrorType,const char*,void*);
-PETSC_EXTERN PetscErrorCode PetscAttachDebuggerErrorHandler(MPI_Comm,int,const char*,const char*,const char*,PetscErrorCode,PetscErrorType,const char*,void*);
-PETSC_EXTERN PetscErrorCode PetscReturnErrorHandler(MPI_Comm,int,const char*,const char*,const char*,PetscErrorCode,PetscErrorType,const char*,void*);
-PETSC_EXTERN PetscErrorCode PetscError(MPI_Comm,int,const char*,const char*,const char*,PetscErrorCode,PetscErrorType,const char*,...);
-PETSC_EXTERN PetscErrorCode PetscPushErrorHandler(PetscErrorCode (*handler)(MPI_Comm,int,const char*,const char*,const char*,PetscErrorCode,PetscErrorType,const char*,void*),void*);
+PETSC_EXTERN PetscErrorCode PetscTraceBackErrorHandler(MPI_Comm,int,const char*,const char*,PetscErrorCode,PetscErrorType,const char*,void*);
+PETSC_EXTERN PetscErrorCode PetscIgnoreErrorHandler(MPI_Comm,int,const char*,const char*,PetscErrorCode,PetscErrorType,const char*,void*);
+PETSC_EXTERN PetscErrorCode PetscEmacsClientErrorHandler(MPI_Comm,int,const char*,const char*,PetscErrorCode,PetscErrorType,const char*,void*);
+PETSC_EXTERN PetscErrorCode PetscMPIAbortErrorHandler(MPI_Comm,int,const char*,const char*,PetscErrorCode,PetscErrorType,const char*,void*);
+PETSC_EXTERN PetscErrorCode PetscAbortErrorHandler(MPI_Comm,int,const char*,const char*,PetscErrorCode,PetscErrorType,const char*,void*);
+PETSC_EXTERN PetscErrorCode PetscAttachDebuggerErrorHandler(MPI_Comm,int,const char*,const char*,PetscErrorCode,PetscErrorType,const char*,void*);
+PETSC_EXTERN PetscErrorCode PetscReturnErrorHandler(MPI_Comm,int,const char*,const char*,PetscErrorCode,PetscErrorType,const char*,void*);
+PETSC_EXTERN PetscErrorCode PetscError(MPI_Comm,int,const char*,const char*,PetscErrorCode,PetscErrorType,const char*,...);
+PETSC_EXTERN PetscErrorCode PetscPushErrorHandler(PetscErrorCode (*handler)(MPI_Comm,int,const char*,const char*,PetscErrorCode,PetscErrorType,const char*,void*),void*);
 PETSC_EXTERN PetscErrorCode PetscPopErrorHandler(void);
 PETSC_EXTERN PetscErrorCode PetscSignalHandlerDefault(int,void*);
 PETSC_EXTERN PetscErrorCode PetscPushSignalHandler(PetscErrorCode (*)(int,void *),void*);
 typedef struct  {
   const char      *function[PETSCSTACKSIZE];
   const char      *file[PETSCSTACKSIZE];
-  const char      *directory[PETSCSTACKSIZE];
         int       line[PETSCSTACKSIZE];
         PetscBool petscroutine[PETSCSTACKSIZE];
         int       currentsize;
     if (petscstackp && (petscstackp->currentsize < PETSCSTACKSIZE)) {         \
       petscstackp->function[petscstackp->currentsize]  = funct;               \
       petscstackp->file[petscstackp->currentsize]      = __FILE__;            \
-      petscstackp->directory[petscstackp->currentsize] = __SDIR__;            \
       petscstackp->line[petscstackp->currentsize]      = __LINE__;            \
       petscstackp->petscroutine[petscstackp->currentsize] = petsc_routine;    \
       petscstackp->currentsize++;                                             \
       petscstackp->currentsize--;                                       \
       petscstackp->function[petscstackp->currentsize]  = 0;             \
       petscstackp->file[petscstackp->currentsize]      = 0;             \
-      petscstackp->directory[petscstackp->currentsize] = 0;             \
       petscstackp->line[petscstackp->currentsize]      = 0;             \
       petscstackp->petscroutine[petscstackp->currentsize] = PETSC_FALSE;\
     }                                                                   \

File include/petscpc.h

 #define PCGALERKIN        "galerkin"
 #define PCEXOTIC          "exotic"
 #define PCHMPI            "hmpi"
-#define PCSUPPORTGRAPH    "supportgraph"
 #define PCASA             "asa"
 #define PCCP              "cp"
 #define PCBFBT            "bfbt"

File include/petscsys.h

   Concepts: memory allocation
 
 M*/
-#define PetscMalloc(a,b)  ((a != 0) ? (*PetscTrMalloc)((a),__LINE__,PETSC_FUNCTION_NAME,__FILE__,__SDIR__,(void**)(b)) : (*(b) = 0,0) )
+#define PetscMalloc(a,b)  ((a != 0) ? (*PetscTrMalloc)((a),__LINE__,PETSC_FUNCTION_NAME,__FILE__,(void**)(b)) : (*(b) = 0,0) )
 
 /*MC
    PetscAddrAlign - Rounds up an address to PETSC_MEMALIGN alignment
   Concepts: memory allocation
 
 M*/
-#define PetscFree(a)   ((a) && ((*PetscTrFree)((void*)(a),__LINE__,PETSC_FUNCTION_NAME,__FILE__,__SDIR__) || ((a) = 0,0)))
+#define PetscFree(a)   ((a) && ((*PetscTrFree)((void*)(a),__LINE__,PETSC_FUNCTION_NAME,__FILE__) || ((a) = 0,0)))
 
 /*MC
    PetscFreeVoid - Frees memory
   Concepts: memory allocation
 
 M*/
-#define PetscFreeVoid(a) ((*PetscTrFree)((a),__LINE__,PETSC_FUNCTION_NAME,__FILE__,__SDIR__),(a) = 0)
+#define PetscFreeVoid(a) ((*PetscTrFree)((a),__LINE__,PETSC_FUNCTION_NAME,__FILE__),(a) = 0)
 
 
 /*MC
 #define PetscFree7(m1,m2,m3,m4,m5,m6,m7)   ((m7)=0,(m6)=0,(m5)=0,(m4)=0,(m3)=0,(m2)=0,PetscFree(m1))
 #endif
 
-PETSC_EXTERN PetscErrorCode (*PetscTrMalloc)(size_t,int,const char[],const char[],const char[],void**);
-PETSC_EXTERN PetscErrorCode (*PetscTrFree)(void*,int,const char[],const char[],const char[]);
-PETSC_EXTERN PetscErrorCode PetscMallocSet(PetscErrorCode (*)(size_t,int,const char[],const char[],const char[],void**),PetscErrorCode (*)(void*,int,const char[],const char[],const char[]));
+PETSC_EXTERN PetscErrorCode (*PetscTrMalloc)(size_t,int,const char[],const char[],void**);
+PETSC_EXTERN PetscErrorCode (*PetscTrFree)(void*,int,const char[],const char[]);
+PETSC_EXTERN PetscErrorCode PetscMallocSet(PetscErrorCode (*)(size_t,int,const char[],const char[],void**),PetscErrorCode (*)(void*,int,const char[],const char[]));
 PETSC_EXTERN PetscErrorCode PetscMallocClear(void);
 
 /*
 PETSC_EXTERN PetscErrorCode PetscMallocGetMaximumUsage(PetscLogDouble *);
 PETSC_EXTERN PetscErrorCode PetscMallocDebug(PetscBool);
 PETSC_EXTERN PetscErrorCode PetscMallocGetDebug(PetscBool*);
-PETSC_EXTERN PetscErrorCode PetscMallocValidate(int,const char[],const char[],const char[]);
+PETSC_EXTERN PetscErrorCode PetscMallocValidate(int,const char[],const char[]);
 PETSC_EXTERN PetscErrorCode PetscMallocSetDumpLog(void);
 PETSC_EXTERN PetscErrorCode PetscMallocSetDumpLogThreshold(PetscLogDouble);
 PETSC_EXTERN PetscErrorCode PetscMallocGetDumpLog(PetscBool*);

File include/petscts.h

 
 PETSC_EXTERN PetscErrorCode TSSetPreStep(TS, PetscErrorCode (*)(TS));
 PETSC_EXTERN PetscErrorCode TSSetPreStage(TS, PetscErrorCode (*)(TS,PetscReal));
+PETSC_EXTERN PetscErrorCode TSSetPostStage(TS, PetscErrorCode (*)(TS,PetscReal,PetscInt,Vec*));
 PETSC_EXTERN PetscErrorCode TSSetPostStep(TS, PetscErrorCode (*)(TS));
 PETSC_EXTERN PetscErrorCode TSPreStep(TS);
 PETSC_EXTERN PetscErrorCode TSPreStage(TS,PetscReal);
+PETSC_EXTERN PetscErrorCode TSPostStage(TS,PetscReal,PetscInt,Vec*);
 PETSC_EXTERN PetscErrorCode TSPostStep(TS);
 PETSC_EXTERN PetscErrorCode TSSetRetainStages(TS,PetscBool);
 PETSC_EXTERN PetscErrorCode TSInterpolate(TS,PetscReal,Vec);
 PETSC_EXTERN PetscErrorCode TSEIMEXSetOrdAdapt(TS,PetscBool);
 
 /*J
+    TSRKType - String with the name of a Runge-Kutta method.
+
+   Level: beginner
+
+.seealso: TSRKSetType(), TS, TSRK, TSRKRegister()
+J*/
+typedef const char* TSRKType;
+#define TSRK1FE   "1fe"
+#define TSRK2A    "2a"
+#define TSRK3     "3"
+#define TSRK3BS   "3bs"
+#define TSRK4     "4"
+#define TSRK5F    "5f"
+#define TSRK5DP   "5dp"
+PETSC_EXTERN PetscErrorCode TSRKGetType(TS ts,TSRKType*);
+PETSC_EXTERN PetscErrorCode TSRKSetType(TS ts,TSRKType);
+PETSC_EXTERN PetscErrorCode TSRKSetFullyImplicit(TS,PetscBool);
+PETSC_EXTERN PetscErrorCode TSRKRegister(TSRKType,PetscInt,PetscInt,const PetscReal[],const PetscReal[],const PetscReal[],const PetscReal[],PetscInt,const PetscReal[]);
+PETSC_EXTERN PetscErrorCode TSRKFinalizePackage(void);
+PETSC_EXTERN PetscErrorCode TSRKInitializePackage(void);
+PETSC_EXTERN PetscErrorCode TSRKRegisterDestroy(void);
+PETSC_EXTERN PetscErrorCode TSRKRegisterAll(void);
+
+/*J
     TSARKIMEXType - String with the name of an Additive Runge-Kutta IMEX method.
 
    Level: beginner
 PETSC_EXTERN PetscErrorCode TSSundialsSetMaxl(TS,PetscInt);
 #endif
 
-PETSC_EXTERN PetscErrorCode TSRKSetTolerance(TS,PetscReal);
-
 PETSC_EXTERN PetscErrorCode TSThetaSetTheta(TS,PetscReal);
 PETSC_EXTERN PetscErrorCode TSThetaGetTheta(TS,PetscReal*);
 PETSC_EXTERN PetscErrorCode TSThetaGetEndpoint(TS,PetscBool*);

File include/petscversion.h

 #define PETSC_VERSION_RELEASE    0
 #define PETSC_VERSION_MAJOR      3
 #define PETSC_VERSION_MINOR      4
-#define PETSC_VERSION_SUBMINOR   2
+#define PETSC_VERSION_SUBMINOR   3
 #define PETSC_VERSION_PATCH      0
 #define PETSC_RELEASE_DATE       "May, 13, 2013"
 #define PETSC_VERSION_DATE       "unknown"
 #
 ALL: all
 LOCDIR	 = ./
-DIRS	 = src include tutorials lua
+DIRS	 = src include tutorials interfaces
 CFLAGS	 =
 FFLAGS	 =
 CPPFLAGS =
 	 fi
 	@egrep -i "( error | error: |no such file or directory)" ${PETSC_ARCH}/conf/make.log | tee ${PETSC_ARCH}/conf/error.log > /dev/null
 	@if test -s ${PETSC_ARCH}/conf/error.log; then \
-           printf ${PETSC_TEXT_HILIGHT}"**************************ERROR************************************\n" 2>&1 | tee -a ${PETSC_ARCH}/conf/make.log; \
+           printf ${PETSC_TEXT_HILIGHT}"**************************ERROR*************************************\n" 2>&1 | tee -a ${PETSC_ARCH}/conf/make.log; \
            echo "  Error during compile, check ${PETSC_ARCH}/conf/make.log" 2>&1 | tee -a ${PETSC_ARCH}/conf/make.log; \
            echo "  Send it and ${PETSC_ARCH}/conf/configure.log to petsc-maint@mcs.anl.gov" 2>&1 | tee -a ${PETSC_ARCH}/conf/make.log;\
            printf "********************************************************************"${PETSC_TEXT_NORMAL}"\n" 2>&1 | tee -a ${PETSC_ARCH}/conf/make.log;\

File src/dm/dt/interface/dtfe.c

   {
     PetscReal    *work;
     PetscBLASInt *pivots;
+#ifndef PETSC_USE_COMPLEX
     PetscBLASInt  n = pdim, info;
+#endif
 
     ierr = DMGetWorkArray(dm, pdim, PETSC_INT, &pivots);CHKERRQ(ierr);
     ierr = DMGetWorkArray(dm, pdim, PETSC_REAL, &work);CHKERRQ(ierr);
 {
   const PetscInt  debug = 0;
   PetscQuadrature quad;
-  PetscScalar    *f0, *f1, *u, *gradU, *a, *gradA;
+  PetscScalar    *f0, *f1, *u, *gradU, *a, *gradA = NULL;
   PetscReal      *x, *realSpaceDer;
   PetscInt        dim, numComponents = 0, numComponentsAux = 0, cOffset = 0, cOffsetAux = 0, eOffset = 0, e, f;
   PetscErrorCode  ierr;
 {
   const PetscInt  debug = 0;
   PetscQuadrature quad;
-  PetscScalar    *f0, *f1, *u, *gradU, *a, *gradA;
+  PetscScalar    *f0, *f1, *u, *gradU, *a, *gradA = NULL;
   PetscReal      *x, *realSpaceDer;
   PetscInt        dim, numComponents = 0, numComponentsAux = 0, cOffset = 0, cOffsetAux = 0, eOffset = 0, e, f;
   PetscErrorCode  ierr;
   PetscInt        offsetI    = 0; /* Offset into an element vector for fieldI */
   PetscInt        offsetJ    = 0; /* Offset into an element vector for fieldJ */
   PetscQuadrature quad;
-  PetscScalar    *g0, *g1, *g2, *g3, *u, *gradU, *a, *gradA;
+  PetscScalar    *g0, *g1, *g2, *g3, *u, *gradU, *a, *gradA = NULL;
   PetscReal      *x, *realSpaceDerI, *realSpaceDerJ;
   PetscReal      *basisI, *basisDerI, *basisJ, *basisDerJ;
   PetscInt        NbI = 0, NcI = 0, NbJ = 0, NcJ = 0, numComponents = 0, numComponentsAux = 0;

File src/dm/impls/adda/adda.c

 
   ierr = PetscMemcpy(idx, lc, sizeof(PetscInt)*dim);
   if (ierr) {
-    PetscError(PETSC_COMM_SELF,__LINE__,__FUNCT__,__FILE__,__SDIR__,ierr,PETSC_ERROR_REPEAT," ");
+    PetscError(PETSC_COMM_SELF,__LINE__,__FUNCT__,__FILE__,ierr,PETSC_ERROR_REPEAT," ");
     return PETSC_FALSE;
   }
   for (i=0; i<dim; i++) {

File src/dm/impls/da/dageometry.c

 
 #undef __FUNCT__
 #define __FUNCT__ "DMDARestoreClosure"
+/* Zeros n and closure. */
 PetscErrorCode DMDARestoreClosure(DM dm, PetscSection section, PetscInt p,PetscInt *n,const PetscInt **closure)
 {
   PetscErrorCode ierr;
 
   PetscFunctionBegin;
   PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
-  PetscValidIntPointer(n,4);
-  PetscValidPointer(closure, 5);
+  if (n) PetscValidIntPointer(n,4);
+  if (closure) PetscValidPointer(closure, 5);
   ierr = RestorePointArray_Private(dm,n,closure);CHKERRQ(ierr);
   PetscFunctionReturn(0);
 }
 
 #undef __FUNCT__
 #define __FUNCT__ "DMDARestoreClosureScalar"
+/* values is set to NULL */
 PetscErrorCode DMDARestoreClosureScalar(DM dm, PetscSection section,PetscInt p,PetscScalar *vArray,const PetscScalar **values)
 {
   PetscErrorCode ierr;

File src/dm/impls/da/dagetarray.c

 +  da - the distributed array
 .  vec - the vector, either a vector the same size as one obtained with
          DMCreateGlobalVector() or DMCreateLocalVector()
--  array - the array
+-  array - the array, non-NULL pointer is zeroed
 
   Level: intermediate
 

File src/dm/impls/da/gr1.c

   PetscMPIInt       rank,size,tag1,tag2;
   PetscInt          i,n,N,step,istart,isize,j,nbounds;
   MPI_Status        status;
-  PetscReal         coors[4],ymin,ymax,min,max,xmin,xmax,tmp,xgtmp;
+  PetscReal         coors[4],ymin,ymax,min,max,xmin = 0.0,xmax = 0.0,tmp = 0.0,xgtmp = 0.0;
   const PetscScalar *array,*xg;
   PetscDraw         draw;
   PetscBool         isnull,showpoints = PETSC_FALSE;

File src/dm/impls/plex/plex.c

 + mesh - The DMPlex
 . p - The Sieve point, which must lie in the chart set with DMPlexSetChart()
 . useCone - PETSC_TRUE for in-edges,  otherwise use out-edges
-- points - If points is NULL on input, internal storage will be returned, otherwise the provided array is used
-
-  Output Parameters:
-+ numPoints - The number of points in the closure, so points[] is of size 2*numPoints
-- points - The points and point orientations, interleaved as pairs [p0, o0, p1, o1, ...]
+. numPoints - The number of points in the closure, so points[] is of size 2*numPoints, zeroed on exit
+- points - The points and point orientations, interleaved as pairs [p0, o0, p1, o1, ...], zeroed on exit
 
   Note:
   If not using internal storage (points is not NULL on input), this call is unnecessary
 
   PetscFunctionBegin;
   PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
+  if (numPoints) PetscValidIntPointer(numPoints,4);
+  if (points) PetscValidPointer(points,5);
   ierr = DMRestoreWorkArray(dm, 0, PETSC_INT, points);CHKERRQ(ierr);
+  if (numPoints) *numPoints = 0;
   PetscFunctionReturn(0);
 }
 

File src/dm/impls/plex/plexlabel.c

   PetscFunctionReturn(0);
 }
 
+#undef __FUNCT__
+#define __FUNCT__ "DMLabelFilter"
+PetscErrorCode DMLabelFilter(DMLabel label, PetscInt start, PetscInt end)
+{
+  PetscInt       v;
+  PetscErrorCode ierr;
+
+  PetscFunctionBegin;
+  label->pStart = start;
+  label->pEnd   = end;
+  if (label->bt) {ierr = PetscBTDestroy(&label->bt);CHKERRQ(ierr);}
+  /* Could squish offsets, but would only make sense if I reallocate the storage */
+  for (v = 0; v < label->numStrata; ++v) {
+    const PetscInt offset = label->stratumOffsets[v];
+    const PetscInt size   = label->stratumSizes[v];
+    PetscInt       off    = offset, q;
+
+    for (q = offset; q < offset+size; ++q) {
+      const PetscInt point = label->points[q];
+
+      if ((point < start) || (point >= end)) continue;
+      label->points[off++] = point;
+    }
+    label->stratumSizes[v] = off-offset;
+  }
+  ierr = DMLabelCreateIndex(label, start, end);CHKERRQ(ierr);
+  PetscFunctionReturn(0);
+}
+
 
 
 #undef __FUNCT__

File src/dm/impls/plex/plexsubmesh.c

   IS              valueIS;
   const PetscInt *values;
   PetscInt       *depthShift;
-  PetscInt        depth = 0, numFS, fs, ghostCell, cEnd, c;
+  PetscInt        depth = 0, numFS, fs, fStart, fEnd, ghostCell, cEnd, c;
   PetscErrorCode  ierr;
 
   PetscFunctionBegin;
+  ierr = DMPlexGetHeightStratum(dm, 1, &fStart, &fEnd);CHKERRQ(ierr);
   /* Count ghost cells */
   ierr = DMLabelGetValueIS(label, &valueIS);CHKERRQ(ierr);
   ierr = ISGetLocalSize(valueIS, &numFS);CHKERRQ(ierr);
   ierr = ISGetIndices(valueIS, &values);CHKERRQ(ierr);
-
   *numGhostCells = 0;
   for (fs = 0; fs < numFS; ++fs) {
-    PetscInt numBdFaces;
-
-    ierr = DMLabelGetStratumSize(label, values[fs], &numBdFaces);CHKERRQ(ierr);
+    IS              faceIS;
+    const PetscInt *faces;
+    PetscInt        numFaces, f, numBdFaces = 0;
 
+    ierr = DMLabelGetStratumIS(label, values[fs], &faceIS);CHKERRQ(ierr);
+    ierr = ISGetLocalSize(faceIS, &numFaces);CHKERRQ(ierr);
+    ierr = ISGetIndices(faceIS, &faces);CHKERRQ(ierr);
+    for (f = 0; f < numFaces; ++f) {
+      if ((faces[f] >= fStart) && (faces[f] < fEnd)) ++numBdFaces;
+    }
     *numGhostCells += numBdFaces;
+    ierr = ISDestroy(&faceIS);CHKERRQ(ierr);
   }
   ierr = DMPlexGetDepth(dm, &depth);CHKERRQ(ierr);
   ierr = PetscMalloc((depth+1) * sizeof(PetscInt), &depthShift);CHKERRQ(ierr);
     for (f = 0; f < numFaces; ++f) {
       PetscInt size;
 
+      if ((faces[f] < fStart) || (faces[f] >= fEnd)) continue;
       ierr = DMPlexGetSupportSize(dm, faces[f], &size);CHKERRQ(ierr);
       if (size != 1) SETERRQ2(PetscObjectComm((PetscObject)dm), PETSC_ERR_ARG_WRONG, "DM has boundary face %d with %d support cells", faces[f], size);
       ierr = DMPlexSetSupportSize(gdm, faces[f] + *numGhostCells, 2);CHKERRQ(ierr);
     ierr = DMLabelGetStratumIS(label, values[fs], &faceIS);CHKERRQ(ierr);
     ierr = ISGetLocalSize(faceIS, &numFaces);CHKERRQ(ierr);
     ierr = ISGetIndices(faceIS, &faces);CHKERRQ(ierr);
-    for (f = 0; f < numFaces; ++f, ++ghostCell) {
+    for (f = 0; f < numFaces; ++f) {
       PetscInt newFace = faces[f] + *numGhostCells;
 
+      if ((faces[f] < fStart) || (faces[f] >= fEnd)) continue;
       ierr = DMPlexSetCone(gdm, ghostCell, &newFace);CHKERRQ(ierr);
       ierr = DMPlexInsertSupport(gdm, newFace, 1, ghostCell);CHKERRQ(ierr);
+      ++ghostCell;
     }
     ierr = ISRestoreIndices(faceIS, &faces);CHKERRQ(ierr);
     ierr = ISDestroy(&faceIS);CHKERRQ(ierr);
   Level: developer
 
 .seealso: DMCreate()
-*/
+@*/
 PetscErrorCode DMPlexConstructGhostCells(DM dm, const char labelName[], PetscInt *numGhostCells, DM *dmGhosted)
 {
   DM             gdm;

File src/dm/impls/plex/plexvtk.c

     }
     for (proc = 1; proc < numProcs; ++proc) {
       PetscScalar *remoteValues;
-      PetscInt    size, d;
+      PetscInt    size = 0, d;
       MPI_Status  status;
 
       ierr = MPI_Recv(&size, 1, MPIU_INT, proc, tag, comm, &status);CHKERRQ(ierr);

File src/docs/doxygen/manual/dev/petsc-kernel.h

 
 The macro SETERRQ() is given by
 \code
-return PetscError(comm,__LINE__,__FUNCT__,__FILE__,__SDIR__,specific,''Error message'');
+return PetscError(comm,__LINE__,__FUNCT__,__FILE__,specific,''Error message'');
 \endcode
 It calls the error handler with the current function name and location: line number,
 file and directory, plus an error codes and an error message.

File src/docs/tex/manual/developers.tex

 
 The macro SETERRQ() is given by
 \begin{tabbing}
-return PetscError(\=comm,\_\_LINE\_\_,\_\_FUNCT\_\_,\_\_FILE\_\_,\_\_SDIR\_\_,error code,error type,\\
+return PetscError(\=comm,\_\_LINE\_\_,\_\_FUNCT\_\_,\_\_FILE\_\_,error code,error type,\\
 \> ''Error message'');
 \end{tabbing}
 It calls the error handler with the current function name and location: line number,
 
 The macro CHKERRQ() is defined by
 \begin{tabbing}
-  if (ierr)  PetscError(\=PETSC\_COMM\_SELF,\_\_LINE\_\_,PETSC\_FUNC\_\_,\_\_FILE\_\_,\_\_SDIR\_\_, \\
+  if (ierr)  PetscError(\=PETSC\_COMM\_SELF,\_\_LINE\_\_,PETSC\_FUNC\_\_,\_\_FILE\_\_, \\
  \>ierr,PETSC\_ERROR\_REPEAT," ");
 \end{tabbing}
 

File src/docs/tex/manual/part2.tex

 the Jacobians need not be provided.\footnote{PETSc will automatically translate the function provided to the appropriate form.}
 
 The Explicit Runge-Kutta timestepper with variable timesteps is an \sindex{Runge-Kutta}
-implementation of standard Runge-Kutta using Dormand-Prince \sindex{Dorman-Prince}
-5(4). It is easy to change this table if needed. Since the time-stepper is using variable timesteps, the
-``TSSetInitialTimeStep()'' function is not used.
-
-Setting the tolerance with
-\begin{tabbing}
-TSRKSetTolerance(TS ts,double tolerance)
-\end{tabbing}
-or \trl{-ts_rk_tol} \findex{-ts_rk_tol}
-defines the global tolerance, for the whole time
-period. The tolerance for each timestep is calculated relatively to
-the size of the timestep.
-
-The error in each timestep is calculated using the two solutions given
-from Dormand-Prince 5(4). The local error is calculated from the
-2-norm from the difference of the two solutions.
-
-Other timestep features:
-\begin{itemize}
-  \item The next timestep can be maximum 5 times the present timestep
-  \item The smallest timestep can be 1e-14 (to avoid machine precision
-  errors)
-\end{itemize}
-
-More details about the solver and code examples can be found at
-\trl{http://www.parallab.uib.no/projects/molecul/matrix/}.
-
+implementation of the standard Runge-Kutta with an embedded method. The error in each
+timestep is calculated using the solutions from the Runge-Kutta method and its embedded 
+method (the 2-norm of the difference is used). The default method is the \sindex{Bogacki-Shampine}
+$3$rd-order Bogacki-Shampine method with a $2$nd-order embedded method (TSRK3BS). 
+Other available methods are the \sindex{Fehlberg} $5$th-order Fehlberg RK scheme with a $4$th-order embedded 
+method (TSRK5F), and the \sindex{Dormand-Prince} $5$th-order Dormand-Prince RK scheme with a $4$th-order embedded method 
+(TSRK5DP). Variable timesteps cannot be used with RK schemes that do not have an embedded 
+method (TSRK1 - $1$st-order, $1$-stage forward Euler, TSRK2A - $2$nd-order, $2$-stage RK scheme, 
+TSRK3 - $3$rd-order, $3$-stage RK scheme, TSRK4 - $4$-th order, $4$-stage RK scheme).
 
 \subsection{Special Cases}
 

File src/docs/website/documentation/changes/dev.html

           systems that support it.  Use the runtime
           option <tt>-dynamic_library_preload</tt> for similar functionality.
         </li>
+        <li>
+          The <tt>__SDIR__</tt> macro (and <tt>__INSDIR__</tt>) is no longer used.
+          We recommend passing full paths or paths from the project root to the compiler so that error messages contain enough context.
+        </li>
       </ul>
       <h4>IS:</h4>
       <h4>PF:</h4>
         <li>MatGetRedundantMatrix(Mat mat,PetscInt nsubcomm,MPI_Comm
       subcomm,PetscInt mlocal_red,MatReuse reuse,Mat *matredundant) is
       replaced by MatRedundantMatrix(Mat mat,PetscInt nsubcomm,MPI_Comm subcomm,MatReuse reuse,Mat *matredundant).</li>
+        <li>MatSeqBAIJSetPreallocationCSR() and MatMPIBAIJSetPreallocationCSR() now take array arguments that are ordered with contiguous blocks and the ordering within blocks respects the MAT_ROW_ORIENTED option.</li>
+        <li>MatCreateMPIBAIJWithArrays() now takes input ordered with contiguous blocks using column-major ordering within blocks.</li>
       </ul>
       <h4>PC:</h4>
       <ul>

File src/docs/website/download/index.html

       <h3>PETSc Release Version 3.4</h3>
       <ul>
         <li>
-          <a href="http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-3.4.2.tar.gz">petsc-3.4.2.tar.gz</a>
+          <a href="http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-3.4.3.tar.gz">petsc-3.4.3.tar.gz</a>
           - full distribution (including all current patches) with documentation
         </li>
 
         <li>
-          <a href="http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.4.2.tar.gz">petsc-lite-3.4.2.tar.gz</a>
+          <a href="http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.4.3.tar.gz">petsc-lite-3.4.3.tar.gz</a>
           - smaller version with no documentation (all documentation may be accessed on line)
         </li>
 

File src/ksp/pc/impls/gamg/gamg.c

   {
     /* -pc_gamg_type */
     {
-      char tname[256] = PCGAMGAGG;
-      const char *deftype = pc_gamg->gamg_type_name ? pc_gamg->gamg_type_name : tname;
-      ierr = PetscOptionsList("-pc_gamg_type","Type of AMG method","PCGAMGSetType",GAMGList, tname, tname, sizeof(tname), &flag);CHKERRQ(ierr);
+      char tname[256];
+      ierr = PetscOptionsList("-pc_gamg_type","Type of AMG method","PCGAMGSetType",GAMGList, pc_gamg->gamg_type_name, tname, sizeof(tname), &flag);CHKERRQ(ierr);
       /* call PCCreateGAMG_XYZ */
-      if (flag || !pc_gamg->gamg_type_name) {
-        ierr = PCGAMGSetType(pc, flag ? tname : deftype);CHKERRQ(ierr);
+      if (flag) {
+        ierr = PCGAMGSetType(pc,tname);CHKERRQ(ierr);
       }
     }
     /* -pc_gamg_verbose */
 #endif
   }
 #endif
-
+  /* PCSetUp_GAMG assumes that the type has been set, so set it to the default now */
+  ierr = PCGAMGSetType(pc,PCGAMGAGG);CHKERRQ(ierr);
   PetscFunctionReturn(0);
 }
 

File src/ksp/pc/impls/makefile

 
 LIBBASE  = libpetscksp