Setup Dr Hook in Rose

Setup Dr Hook

Options to setup Dr Hook in `rose edit':

  • ->fcm_make_um
    • ->env
      • ->Basic compilation
        • ->prebuild: MAKE EMPTY
        • drhook: SELECT on
  • ->um
    • ->env
      • ->Dr Hook Settings
        • ->DR_HOOK: SELECT on
        • ->DR_HOOK_OPT: SELECT wallprof AND noself (or whatever you want)

If it all works well, you should find a lot of drhook.prof* files in a directory something like ~/cylc-run/mi-<run id>/work/19.../atmos_main/

Common Dr Hook problem

It's not unusual for there to be one module where the line

REAL(KIND=jprb)               :: zhook_handle

has been added at the top of the module and not added for each of the subroutines and functions in the module. Each routine must have its own zhook_handle for it to interface with the Dr Hook code and so this will cause a runtime crash. Searching the error output for `hook' should give you clue as to where Dr Hook has crashed. The last routine it reached for most PEs is likely to be culprit (however on a given PE, it may crash in a perfectly good routine if an error has been encountered on another PE which brings Dr Hook crashing down).

If you find one of these errors, it's likely that someone else has already created a branch to fix it. Hence, it's worth going to the trunk and see if the code has been changed - and if so look at the log history to determine which branch made the change. You should then add this branch to your code.