Skip to content

Add additional MATLAB documentation on creating a parallel pool #510

@monaghaa

Description

@monaghaa

Documents affected: https://curc.readthedocs.io/en/latest/software/matlab.html

Issue: This is related to a recent case we received, INC1368817. If a parallel pool ("parpool") is not explicitly created by a user prior to running a "parfor" loop, the number of workers will default to 12, no matter how many cores the user has requested. Our MATLAB documentation currently does not cover the creation of parallel pools, although it does cover "parfor" loops. Recommend that we include an example for creating a parallel pool, e.g.:

% Start pool safely
pool = gcp('nocreate');
if isempty(pool)
pool = parpool(16);
end

% Parallel work
parfor i = 1:16
fprintf("Hello, World from process %i\n", i);
end

% Clean shutdown
delete(pool);

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