1. 01 Nov, 2017 1 commit
    • Christopher Subich's avatar
      Make timing code compile-time optional (TIMINGS=true) · d68f6d2b
      Christopher Subich authored
      This changeset adds a compile-time option on whether to include the
      timing code.  If SPINS is compiled without TIMINGS=true, the timing code
      is #defined to a no-op and should not otherwise affect the performance
      of the software; timing_stack_report will instead print a short error
      message.
      
      Because this affects #defines in header files, changing from
      TIMINGS=true to false (or vice versa) should only be done with a 'make
      clean'.  Not doing so could leave the timing code in an inconsistent
      state and result in either link-time errors (if older code calls timing
      code that is #defined away) or a corrupted/growing timing stack (if for
      example a timing_push() is compiled in but the corresponding
      timing_pop() is removed.)
      d68f6d2b
  2. 26 Jun, 2017 1 commit
    • Christopher Subich's avatar
      Stack-structured timing code · 0a4781c9
      Christopher Subich authored
      This commit adds stack-structured timing code, such that bits of SPINS
      can be instrumented with
      
      >  timing_push("short name")
      >  [... work goes here]
      >  timing_pop()
      
      This is recursive, such that already-timed portions of the code can call
      the timing code to further instrument subroutines or discrete code
      segments, and the resulting structure follows the -dynamic- call stack.
      This does have the odd result that portions of the code that are re-used
      (namely spectral derivatives) can show up as several 'leaf' nodes in the
      graph.
      
      To print out the report to standard error, call
      
      >  timing_stack_report()
      
      The exact format of the report should be considered tentative.
      0a4781c9