CmPA / iPic3D

Particle-in-Cell code using the implicit moment method
72 stars 55 forks source link

Improve TimeTasks #54

Open alecjohnson opened 11 years ago

alecjohnson commented 11 years ago

Issue #17 introduced the TimeTasks class to implement basic profiling.

A simpler and more general approach is possible based on macros and automatic destructors.

Create a set of time_task macros to be used as follows:

  void mymethod()
  {
    // record time from this point to the end of this scope.
    timeTasks_set_main_task(Task::PARTICLES);
    ...
    // block that does communication
    {
        // mode is reset to communication until end of scope
        timeTasks_set_communicating();
        ...
    }
  }

Improvements: