Skip to content
Snippets Groups Projects
  1. Dec 17, 2023
  2. Dec 01, 2023
  3. Sep 26, 2023
  4. Aug 16, 2023
  5. Apr 27, 2023
  6. Mar 11, 2023
  7. Feb 02, 2023
  8. Sep 21, 2022
  9. Sep 19, 2022
  10. Aug 22, 2022
  11. Aug 17, 2022
  12. Jun 23, 2022
    • Barry Smith's avatar
      Change if () { PetscCall() } three liner and friends to one liners · 1baa6e33
      Barry Smith authored and Satish Balay's avatar Satish Balay committed
      for i in `git ls-files | grep "\.[ch]$"` ; do sed 's?\$?ZZZ?g' $i | tr '\n' '$' | sed 's?\([ ]*\)if (\([-;,.\*+=a-z0-9A-Z_>]*\)) {\$[ ]*PetscCall(\([- ._+=a-z0-9A-Z>*,()]*);\)\$[ ]*}\$?\1if (\2) PetscCall(\3$?g' | tr '$' '\n' | sed 's?ZZZ?$?g' > $i.joe ; mv $i.joe $i  ; done
      
       for i in `git ls-files | grep "\.[hc]$"` ; do sed 's?\$?ZZZ?g' $i | tr '\n' '$' | sed 's?\([ }else]*\)if (\([-;,.\*+=a-z0-9A-Z_>]*\)) {\$[ ]*PetscCall(\([- ._+=a-z0-9A-Z>*,()]*);\)\$\([ ]*\)} \([- ._+=a-z0-9A-Z>*,()]*);\)\$?\1if (\2) PetscCall(\3$\4\5$?g' | tr '$' '\n' | sed 's?ZZZ?$?g' > $i.joe ; mv $i.joe $i  ; done
      
      Yes, really ugly but Barry still cannot master awk
      
      Commit-type: housekeeping
      1baa6e33
  13. Jun 21, 2022
    • Barry Smith's avatar
      Change matrix factor database options that occur in KSP/PC to always use KSP/PC options prefix · 26cc229b
      Barry Smith authored
      Add MatSetOptionsPrefixFactor() and MatAppendOptionsPrefixFactor() to allow controlling the options prefix
      used by factors created from this matrix
      
      Change MatSetOptionsPrefix() to no longer affect the options prefix used by factors created from this matrix
      
      As part of the above work the handling of the factor matrix options is now done in code in the factor matrix
      not in the code that originates the factor matrix
      
      Update examples output to the new approach where the factored matrix prefix is set from the KSP/PC
      
      Much of this work was performed by Hong Zhang
      
      Commit-type: usability
      /spend 5h
      26cc229b
  14. Jun 16, 2022
  15. May 04, 2022
  16. May 03, 2022
    • Patrick Sanan's avatar
      Docs: Fix man page .seealso entries missing spaces after commas · c2e3fba1
      Patrick Sanan authored
      ```python
      
      import os
      import re
      import fileinput
      
      START_PATTERN = re.compile(r"^( *\.seealso:? )(.*$)")
      FIX_PATTERN = re.compile(r",([^ $\n])")
      
      def _fix_comma(matchobj):
          return "`, `%s" % matchobj.group(1)
      
      def process_file(filename_full):
          """ Find/fix commas w/o trailing spaces or newlines in .seealso blocks """
          with fileinput.FileInput(filename_full, inplace=True) as the_file:
              in_block = False
              for line in the_file:
                  line_stripped = line.strip()
                  # end ".seealso blocks" on a blank line or C-style comment close
                  if not line_stripped:
                      in_block = False
                  elif line_stripped.endswith("*/"):
                      in_block = False
                  else:
                      match = re.match(START_PATTERN, line)  # not stripped line
                      if match:
                          in_block = True
                  if in_block:
                      if re.search(FIX_PATTERN, line):
                          line_fixed = re.sub(FIX_PATTERN, _fix_comma, line)
                          print(line_fixed, end="")  # prints to file
                      else:
                          print(line, end="")  # prints to file
                  else:
                      print(line, end="")  # prints to file
      
      BASE_DIRS = ["src", "include"]
      EXT = [".c", ".cxx", ".cpp", ".cu", ".h", ".hpp", ".hxx"]
      EXCLUDE_DIRS = ["tests", "tutorials", "ftn-auto", "ftn-custom", "benchmarks"]
      
      def main():
          """ Process files in local tree(s) """
          for base in BASE_DIRS:
              for root, dirs, files in os.walk(base):
                  for filename in files:
                      if os.path.splitext(filename)[1] in EXT:
                          filename_full = os.path.join(root, filename)
                          process_file(filename_full)
                  for exclude_dir in EXCLUDE_DIRS:
                      if exclude_dir in dirs:
                          dirs.remove(exclude_dir)
      
      if __name__ == "__main__":
          main()
      ```
      c2e3fba1
  17. May 01, 2022
  18. Apr 29, 2022
    • Patrick Sanan's avatar
      Docs: bulk add backticks to .seealso man page fields · db781477
      Patrick Sanan authored
      ```python
      import os
      import re
      import fileinput
      
      def _process_word(word):
          comma = "," if word.endswith(",") else ""
          return "`%s`%s" % (word.rstrip(","), comma)
      
      def _process_stripped_line(line):
          return " ".join(map(_process_word, line.split()))
      
      start_pattern = re.compile(r"^( *\.seealso:? )(.*$)")
      
      def process_file(filename_full):
          with fileinput.FileInput(filename_full, inplace=True) as f:
              in_block = False
              for line in f:
                  line_stripped = line.strip()
                  # end ".seealso blocks" on a blank line or C-style comment close
                  line_modified = None
                  if not line_stripped:
                      in_block = False
                  elif line_stripped.endswith("*/"):
                      in_block = False
                  else:
                      match = re.match(start_pattern,
                                       line)  # not stripped line
                      if match:
                          indent = " " * len(match.group(1))
                          in_block = True
                          line_modified = match.group(
                              1) + _process_stripped_line(
                                  match.group(2).strip())
                      elif in_block:
                          line_modified = indent + _process_stripped_line(
                              line_stripped)
                  if line_modified:
                      print(line_modified)  # prints to the file
                  else:
                      print(line, end="")  # prints to the file
      
      BASE_DIRS = ["src", "include"]
      EXT = [".c", ".cxx", ".cpp", ".cu", ".h", ".hpp", ".hxx"]
      EXCLUDE_DIRS = ["tests", "tutorials", "ftn-auto", "ftn-custom", "benchmarks"]
      
      def main():
          """ Process everything """
          for base in BASE_DIRS:
              for root, dirs, files in os.walk(base):
                  for filename in files:
                      if os.path.splitext(filename)[1] in EXT:
                          filename_full = os.path.join(root, filename)
                          print("FILE ---", filename_full)
                          process_file(filename_full)
                  for exclude_dir in EXCLUDE_DIRS:
                      if exclude_dir in dirs:
                          dirs.remove(exclude_dir)
      
      if __name__ == "__main__":
          main()
      ```
      db781477
    • Patrick Sanan's avatar
  19. Apr 10, 2022
    • Barry Smith's avatar
      Cleanup of introduction of PetscCall() · d0609ced
      Barry Smith authored and Satish Balay's avatar Satish Balay committed
      * remove bogus error flags from XXXBegin()/End() macros such as PetscOptionsBegin()/End()
      
      * rename for consistency certain XXXBegin()/End() macros such as MatPreallocateInitialize()/Finalize()
      
      * fix many lingering ierr = XXX that arose from multiline function calls
      
      * sync slepc/hpddm - to use snapshots with the same changes
      
      Commit-type: error-checking, style-fix
      /spend 8h
      d0609ced
  20. Mar 26, 2022
    • Jacob Faibussowitsch's avatar
      The great renaming: · 9566063d
      Jacob Faibussowitsch authored
      - CHKERRQ() -> PetscCall()
      - CHKERRV() -> PetscCallVoid()
      - CHKERRMPI() -> PetscCallMPI()
      - CHKERRABORT() -> PetscCallAbort()
      - CHKERRCONTINUE() -> PetscCallContinue()
      - CHKERRXX() -> PetscCallThrow()
      - CHKERRCXX() -> PetscCallCXX()
      - CHKERRCUDA() -> PetscCallCUDA()
      - CHKERRCUBLAS() -> PetscCallCUBLAS()
      - CHKERRCUSPARSE() -> PetscCallCUSPARSE()
      - CHKERRCUSOLVER() -> PetscCallCUSOLVER()
      - CHKERRCUFFT() -> PetscCallCUFFT()
      - CHKERRCURAND() -> PetscCallCURAND()
      - CHKERRHIP() -> PetscCallHIP()
      - CHKERRHIPBLAS() -> PetscCallHIPBLAS()
      - CHKERRHIPSOLVER() -> PetscCallHIPSOLVER()
      - CHKERRQ_CEED() -> PetscCallCEED()
      - CHKERR_FORTRAN_VOID_FUNCTION() -> PetscCallFortranVoidFunction()
      - CHKERRMKL() -> PetscCallMKL()
      - CHKERRMMG() -> PetscCallMMG()
      - CHKERRMMG_NONSTANDARD() -> PetscCallMMG_NONSTANDARD()
      - CHKERRCGNS() -> PetscCallCGNS()
      - CHKERRPTSCOTCH() -> PetscCallPTSCOTCH()
      - CHKERRSTR() -> PetscCallSTR()
      - CHKERRTC() -> PetscCallTC()
      9566063d
  21. Mar 25, 2022
  22. Mar 17, 2022
  23. May 24, 2021
  24. Apr 02, 2021
    • Barry Smith's avatar
      Introduce PCFactorSetDefaultOrdering_Factor() to allow each factorization package · 4ac6704c
      Barry Smith authored
      to indicate its preferered ordering, which may be external (its own) or one of PETSc.
      
      This also affects factorization like dense PETsc where the ordering passed in by PETSc is ignored and not needed.
      
      Also fixed options for MUMPS and SuiteSparse where users needed to pass a particular options database option
      to the package (MUMP or KLU) indicating they should use the PETSc provided ordering. Now if the PETSc provided ordering is provided
      these packages automatically use them without need a special option. This simplifies ordering usage for external packages
      
      Commit-type: optimization, bug-fix, testing-fix, style-fix
      /spend 6h
      4ac6704c
    • Barry Smith's avatar
      Change MatFactorGetUseOrdering() to MatFactorGetCanUseOrdering() · f73b0415
      Barry Smith authored
      We need to distinquish whether the package can use an external ordering and if that is desirable (the internal ordering may be faster).
      
      Commit-type: style-fix
      /spend 15m
      f73b0415
  25. Aug 25, 2020
  26. Jul 02, 2020
    • Barry Smith's avatar
      Most external factorization packages do not use the ordering provided by... · 2c7c0729
      Barry Smith authored
      Most external factorization packages do not use the ordering provided by PETSc, therefor only provide it when needed.
      
      Adds MatOrderingType external to indicate not to generate an ordering and use what the package needs
      Now -pc_view will not print the wrong PETSc ordering when the ordering is done externally
      
      Saves some memory and compute time.
      
      Commit-type: optimization
      Time:  1.2   hours
      Reported-by: default avatarJunchao Zhang <junchao.zhang@gmail.com>
      Thanks-to: Stefano Zampini <stefano.zampini@gmail.com>
      2c7c0729
  27. Jun 28, 2020
  28. Jun 04, 2020
  29. May 14, 2020
  30. Jan 06, 2020
  31. May 30, 2019
    • Patrick Sanan's avatar
      Man pages: remove Concepts: fields · 0f5d826a
      Patrick Sanan authored and Satish Balay's avatar Satish Balay committed
      These fields were previously stripped from the man pages by logic removed in 
      21a59cba2737d49dc2f0bd12c08db0d2a3f3f209
      
      Remove these fields from all man pages (but not from examples).
      
      This is accomplished with GNU sed (gsed on OS X), with the following commands.
      *Warning* that this type of command can corrupt a .git directory,
      so be cautious in reusing or modifying these commands. They first look
      for and delete matching lines with a following line consisting of only whitespace,
      and then delete any remaining matching lines.
      
          find src -type f -not -path "*/examples/*" -not -name "*.html"  -not -name "*.bib" -exec gsed -i '/Concepts:/ {N; /\n\s*$/d}' {} +
          find src -type f -not -path "*/examples/*" -not -name "*.html"  -not -name "*.bib" -exec gsed -i '/Concepts:/d' {} +
          find include -type f -not -path "*/examples/*" -not -name "*.html"  -not -name "*.bib" -exec gsed -i '/Concepts:/ {N; /\n\s*$/d}' {} +
          find include -type f -not -path "*/examples/*" -not -name "*.html"  -not -name "*.bib" -exec gsed -i '/Concepts:/d' {} +
      
      Hints on the sed command obtained from: https://unix.stackexchange.com/questions/100754/how-to-delete-a-specific-line-and-the-following-blank-line-using-gnu-sed
      0f5d826a
  32. May 06, 2019
  33. Jun 22, 2018
  34. Apr 16, 2018
    • Patrick Sanan's avatar
      Man pages: add newlines after "Notes:" · 95452b02
      Patrick Sanan authored
      This allows for proper formatting from sowing.
      
      On OS X (using gsed, not the default BSD sed), from the PETSc root directory:
      
          find src include -type f \( -name "*.c" -or -name "*.h" -or -name "*.cxx" \) | xargs gsed -i 's/Notes\s*:\s*\(\w.*\)/Notes:\n    \1/'
      
      This adds a newline and 4 spaces whenever "Notes:" is followed by any "word" character, in any .c, .h, or .cxx file in src/ or include/
      95452b02
  35. Jan 29, 2018
  36. Jan 26, 2018
  37. Dec 21, 2016
Loading