Main Content

parallel.importProfile

Import cluster profiles from file

Description

profile = parallel.importProfile(filename) imports the profiles stored in the specified file, filename, and returns the names of the imported profiles. If filename has no extension, the function assumes .mlsettings is the file extension. You must specify the file extension for configuration files with the .mat extension.

Configuration MAT files contain only one profile, but profile MLSETTINGS files can contain one or more profiles. If the file contains only one profile, then profile is a character vector that reflects the name of the profile. If the file contains multiple profiles, then profile is a cell array of character vectors. If a profile with the same name as an imported profile already exists, the function adds an extension to the name of the imported profile.

You can use the imported profile with any functions that support profiles. parallel.importProfile does not set any of the imported profiles as the default. To set a default profile, use the parallel.defaultProfile function.

During the import, parallel.importProfile upgrades profiles that you exported in a previous release. Configurations are automatically converted to cluster profiles.

Imported profiles are saved as a part of your MATLAB® settings, so these profiles are available in subsequent MATLAB sessions without importing again.

example

Examples

collapse all

Import a profile from the ProfileMain.mlsettings file and set it as the default cluster profile.

profile_main = parallel.importProfile('ProfileMain');
parallel.defaultProfile(profile_main)

Import all the profiles from the ManyProfiles.mlsettings file, and use the first one to open a parallel pool.

profs = parallel.importProfile('ManyProfiles');
parpool(profs{1})

Import a configuration from the OldConfiguration.mat file, and set it as the default parallel profile.

old_conf = parallel.importProfile('OldConfiguration.mat')
parallel.defaultProfile(old_conf)

Input Arguments

collapse all

File name of profile to import, specified as a string array or character vector.

Data Types: char | string

Output Arguments

collapse all

Name of the imported profile, returned as a character vector or a cell array of character vectors.

Version History

Introduced in R2012a