Skip to content

DoparParam: Captured stdout is relayed to stdout for some foreach adapters and stderr for others #277

@HenrikBengtsson

Description

@HenrikBengtsson

There is an inconsistency in how DoparParam() relays captured standard output. It appears to depend on which %dopar% adapter is registered.

For example,

> foreach::registerDoSEQ()
> out <- utils::capture.output(y <- BiocParallel::bplapply(1:2, print, BPPARAM = BiocParallel::DoparParam()), type = "output")
> out
[1] "[1] 1" "[1] 2"

relays the print() output to stdout, as expected.

But,

> doParallel::registerDoParallel(2)
> out <- utils::capture.output(y <- BiocParallel::bplapply(1:2, print, BPPARAM = BiocParallel::DoparParam()), type = "output")
[1] 1

[1] 2

> out <- utils::capture.output(y <- BiocParallel::bplapply(1:2, print, BPPARAM = BiocParallel::DoparParam()), type = "message")
> out
[1] "[1] 1" "[1] 2"

relays the print() output to stderr, which is not what one would expect from a print() call.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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