diff --git a/OpenMP_cpu/adv_intro/2_timers/README_timer.md b/OpenMP_cpu/adv_intro/2_timers/README_timer.md index ecc5c05..60c4a52 100644 --- a/OpenMP_cpu/adv_intro/2_timers/README_timer.md +++ b/OpenMP_cpu/adv_intro/2_timers/README_timer.md @@ -1,47 +1,56 @@ -# Class Timer -- collects time measurements and reports them later. +# Class Timer_Collector -- collects time measurements and reports them later. ## BACKGROUND Fortran and CPP Timer classes have been created for measuring performance of code blocks demarked by start() and stop() class member functions. For each block a literal character string argument for start("my label") is used as a label when the times are reported with print(). - -See timer.hpp (CPP) and timer.f90 (F90) - +``` + Declare Timer_collector as timer + CPP F90 + timer.start("my label") call timer%start("my label") + + timer.stop() call timer%stop() + ... ... + timer.print() call timer%print() + + See timer.hpp (CPP) and timer.f90 (F90) + +``` ## Exercises 1.) - Look over time_print(.cpp|.f90). The todo's guide you + Look over time_print(.cpp|.f90). The TODOs guide you through instrumenting the code for timing a sleep routine, and - -- That's just to make sure the timer is working.--- + -- That is just to make sure the timer is working.--- a write to stdout (CPP: printf, F90: print*,) TODO 1: - Include the Timer class file (CPP: timer.hpp, F90: timer.f90) + Include the Timer_collector class file (CPP: timer.hpp, F90: timer.f90) at the beginning of the code. TODO 2: Instantiate the class in main as timer: - CPP: Just use "Timer time;" + CPP: Just use "Timer_Collector timer;" F90: Use the module defined in timer.f90 (mod_timer) - and define timer as type(cls_timer). + and define "timer" as type(Timer_Collector). TODO 3: Time the sleep and print statements: - Put time.start("