Skip to content

All ops should implement progress reporting #42

Closed

Description

@ctrueden

Ops need to report progress. Our current solution is the OpMonitor, although we may want to review whether we are happy with this mechanism before diving in to add progress reporting to all ops in the system.

See also:

Activity

  1. added this to the 1.0.0 milestone on Jun 26, 2020
  2. gselzer commented on May 13, 2021

    @gselzer
    Member

    Time commitment: 3 weeks

  3. gselzer commented on Jun 7, 2021

    @gselzer
    Member

    I've been thinking about this, and I'm thinking that OpMonitor is not good enough. There are really two components to OpMonitor that should be partitioned out:

    1. The cancellation feature
    2. The progress reporting feature

    OpMonitor should probably be remade into an agglomeration of two Objects tailored to each of these two functions. We also might get use of a Hints in there as well, but I wouldn't put it in to start.

    I'm also not a fan of passing the OpMonitor through as a parameter. A BiFunction<Double, Double, Double> should not become a Functions.Arity3<Double, Double, OpMonitor, Double> because the OpMonitor is not an input to the algorithm. In other words, the specifics of the OpMonitor do not affect the output of the Op in the way that the two Double inputs do. So I'd like to find a better way to log progress reporting. I'd like to do it in some quasi-static way; it might be nice to have a ConcurrentHashMap<Object, ProgressReporter> where the Object is almost always this. This would also allow Ops to access the ProgressReporter of their OpDependency. Could we allow a static Map in DefaultOpEnvironment, where every Op call initializes a ProgressReporter placeholder? Is there any reason why one Map throughout the whole application is a bad idea? Then, once the user calls apply, the Op can do the progress reporting (if it chooses)? I might try to prototype something tomorrow...

    I do like many of the ideas of the progress reporter created within ITK, and think we should do something similar.

  4. hinerm commented on Jun 25, 2021

    @hinerm
    Member

    @gselzer and I discussed a bit today. Highlights:

    • Using UUIDs in the creation of a ProgressReporter to differentiate multiple runs of the same Op. Ideally, could this be linked into the creation of the OpExecutionSummary?
    • Use injection instead of setProgressReporter... like injecting a "slot", or "populator", so that Ops could decide what kind of progress reporter to create without needing to store them at an instance level (e.g. so that static methods & multiple runs on the same object will report progress properly). This would probably work similar to Op dependencies..
    • Ternary progress reporting (start, stop, in-progress) would be managed by the OpWrapper, with the "injection" scheme mentioned above as a supplement to provide stepwise progress.
  5. gselzer commented on Jul 25, 2023

    @gselzer
    Member

    I think this issue has been solved for a good amount of time. Ops can report progress through the Progress class, and at the very least all Ops exhibit binary (ternary?) progress reporting when called through the OpBuilder, thanks to AbstractRichOp. So I think we're done here!

  6. ctrueden commented on Jul 25, 2023

    @ctrueden
    MemberAuthor

    I think it is premature to close this. There are many ops that could easily report their progress with Progress but do not currently do so, and in my view, this issue is about adding those calls. For example, coloc.pValue is an expensive operation that calls another coloc op repeatedly in a loop, in order to measure some statistical significance, which would really benefit from progress reporting to communicate how long the user must wait.

  7. gselzer commented on Jul 25, 2023

    @gselzer
    Member

    There are many ops that could easily report their progress with Progress but do not currently do so, and in my view, this issue is about adding those calls

    Heh, that was not what I understood this issue to be. I was focusing on this, from the original message, especially since the following comments were the foundation of what has become scijava-progress:

    although we may want to review whether we are happy with this mechanism before diving in to add progress reporting to all ops in the system.

    With that being said:

    For example, coloc.pValue is an expensive operation that calls another coloc op repeatedly in a loop, in order to measure some statistical significance, which would really benefit from progress reporting to communicate how long the user must wait.

    I agree we should do this, but I figured it would come up in another, more dedicated issue, because it isn't clear to me that it belongs here. I filed #128 to track this.

  8. added a commit that references this issue on May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions