Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AMIEQueue] Add progress bar for each generation #45

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

falcaopetri
Copy link
Contributor

This PR modifies the AMIEQueue such that it reports the mining progress using a progress bar (if -verbose).
I've used the most active Java CLI progress bar I cound find (https://github.com/ctongfei/progressbar).

One (minor?) issue is that AMIE's logging conflicts with the line breaks, yielding some lines with both progressbar and AMIE logging. I think the only solution would be to use some logging module and redirect the different output types to different files.

I've also used a heuristic to set how often the progress bar should be updated. It seems to work on my small experiments, but I will still test it with bigger datasets.

I'm not sure yet about the overhead added by this (i) if verbose is not set, (ii) if verbose is set.

AMIEQueue with ProgressBar

@falcaopetri falcaopetri marked this pull request as draft September 13, 2020 12:20
@falcaopetri
Copy link
Contributor Author

Note that I've implemented the Progress Bar to update during AMIEQueue.dequeue. This means that the progress bar can reach 100%, while we still have rules being processed. In that case, the timer will continue to advance.

image

I did not realize that at implementation time. My consideration was only that:

  • Only AMIEQueue knows about the next generation (and I wanted one progress bar for each generation)
  • AMIEQueue.dequeue is already synchronized between all workers

An alternative implementation would move the responsibility of the ProgressBar to AMIE. This would require adding a lock (which is easy to do). This way, we would reach 100% only after processing all available rules.

@lajus
Copy link
Contributor

lajus commented Sep 18, 2020

Hi,

I like the idea of the progress bar. I also think AMIEQueue.dequeue is the place to do that.

As for the 100% progress problem, the number of processed rules should always be equal to: "number of dequeues" - "number of active threads" and this last number is always equal to maxThreads - waitingThreads if I am correct.

Jonathan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants