Skip to content

How to do multiple progress bars, especially when running nested futures? #125

@angel-bee2018

Description

@angel-bee2018

Hi,

For nested future.apply::future_apply, furrr::future_map and purrr::map, is it possible to construct a progress report neatly so that the hierarchical arrangement of sub-loops or child processes is clear. e.g. something like this (kind of like str):

plan(list(tweak(multicore, workers = 2),
              tweak(multicore, workers = 3)
       ) )

future.apply::future_apply(
    X = tibble("a" = 100:200),
    MARGIN = 1,
    FUN = function(a1) {

        future.apply::future_apply(
        X = tibble("b" = 1:a1),
        MARGIN = 1,
        FUN = function(b1) {

            return(b1^2)

        } )

    } )

Level 1 #1 |====================== | 64%
.... Level 2 #1 |=============================== | 90%
.... Level 2 #2 |====================== | 65%
.... Level 2 #3 |============ | 37%
Level 1 #2 |==================== | 43%
.... Level 2 #1 |==================== | 43%
.... Level 2 #2 |==================== | 43%
.... Level 2 #3 |==================== | 43%

From the vignette, it doesn't seem apparent as to how this may be done - it only contains examples to show only one overall bar. Is this a thing that can be done with progressr?

thanks in advance

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions