Skip to content

clean_channels() leads to different channel removed results when using parallel processing #865

Open
@leima1

Description

@leima1

Description

This is more a minor suggestion than a bug report. When running clean_channels() using parallel processing, each worker uses an independent random number stream. This causes reproducibility issues when re-running the analysis with parallel processing (i.e., the same worker might not be assigned to run the same subject or trial when clean_channels() called, leading to a different outcome for that subject or trial).

According to https://www.mathworks.com/help/parallel-computing/control-random-number-streams-on-workers.html, setting rng(0, 'Philox'), instead of rng('default') ensures that all workers use the same random number generator. In our experience, replacing that line within clean_channels() has stabilized the channel removal results across repeated runs.


#### Versions
OS version [Windows 10]
Matlab version [2023b]
EEGLAB version [2025]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions