modulefdoc_progress
Progress in the terminal: a live bar for each stage of the run, leaving a line with its time, and warnings that do not get mixed up with the bar. When standard output is not a terminal there are no bars or colours, just a line for each stage.
With --progress-lines there are lines for another program to read from standard output instead,
each written at once. Warnings stay on standard error, and a run that fails has no [end] line.
[ 42%] Parsing files 83/198
[done] Parsing files in 0.22 s
[end] 3456 pages written to ./doc in 2.31 s
Stages run in parallel loops. Any thread can count, and only the first draws. Nothing here calls a
function returning a deferred-length string (see example/slen_race.f90).
Uses
Used by
- fdoc
- fdoc_docs
- fdoc_graphs
- fdoc_input
- fdoc_links
- fdoc_markdown
- fdoc_pages
- fdoc_project
- fdoc_project_file
- fdoc_site
Variables
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
| BAR_WIDTH | integer | privateparameter | 30 | |
| colour | logical | private | .false. | true to use colours |
| done | integer | private | 0 | how many are finished |
| drawn | logical | private | .false. | true if a bar is on the screen |
| EMPTY | character(len=*) | privateparameter | achar(226)//achar(148)//achar(128) |
|
| enabled | logical | private | .false. | true to report progress |
| ESC | character(len=*) | privateparameter | achar(27) | |
| FULL | character(len=*) | privateparameter | achar(226)//achar(148)//achar(129) |
|
| label | character(len=LABEL_WIDTH) | private | '' | the current stage |
| LABEL_WIDTH | integer | privateparameter | 24 | |
| last_draw | integer(kind=int64) | private | 0 | when the bar was last drawn |
| last_percent | integer | private | -1 | the last percentage written, with |
| lines | logical | private | .false. | true to write lines for another program |
| live | logical | private | .false. | true if standard output is a terminal |
| rate | integer(kind=int64) | private | 1000 | clock ticks in a second |
| REDRAW_MILLISECONDS | integer(kind=int64) | privateparameter | 40 | |
| run_start | integer(kind=int64) | private | 0 | when the run started |
| stage_start | integer(kind=int64) | private | 0 | when the stage started |
| total | integer | private | 0 | how many steps the stage has |
Interfaces
c_isattybind(C)private
C isatty.
Subroutines
bar_textpure
The bar for steps of size steps, width characters wide, with its filled and empty parts.
progress_enable
Turn progress reports on, with lines for another program if for_programs.
progress_linepure
The line for another program of count of size steps done in stage name.
progress_start
Start stage name, of steps steps, or of unknown length if that is 0.
progress_tick
Count a step, or steps of them. This can be called from any thread.
warn
Write warning message to standard error, keeping the bar intact. This can be called from any
thread.
write_lineprivate
Write the line of count steps done, if its percentage is new. This can be called from any thread.