Timers are never started

Issue #1420 closed
Steven R. Brandt created an issue

I modified clock.cc to add a boolean named "started". I initialized it to false in the constructor, set it to true inside the start() method, and call abort() inside stop() if "started" is false. It fails for me during every run.

This is a problem because the variable "last" inside the clock class is uninitialized, and is potentially random.

I'm not sure what's going wrong, as it appears that funcs->start() is being called inside CactusTimers.c, but somehow the relevant start function isn't called in clock.cc.

Keyword:

Comments (6)

  1. Erik Schnetter
    • removed comment

    The file "clock.cc" is not part of the flesh. Who wrote this file? Can you point to it, or attach it?

  2. Ian Hinder
    • removed comment

    This ticket is in the "carpet" component, so I guess it is

    Carpet/CycleClock/src/clock.cc
    
  3. Steven R. Brandt reporter
    • removed comment

    Yes, that is the file. Sorry, I didn't know of any other clock.cc.

  4. Erik Schnetter
    • removed comment

    I think that timers that are running when a clock is created have clocks added that are not started. The problem is that Cactus does not keep track of whether a timer is running, and thus does not know whether to start such clocks. In other clocks, I either add a "bool is_running", or implicitly call start when the clock is created.

  5. Log in to comment