Professional Documents
Culture Documents
On this page…
batch
parpool
parcluster
To create, edit, and import cluster profiles, you can do this from the Cluster Profile Manager. To open the
Cluster Profile Manager, on the Home tab in the Environment section, click Parallel > Manage Cluster
Profiles.
Discover Clusters
You can let MATLAB discover clusters for you. Use either of the following techniques to discover those
clusters which are available for you to use:
On the Home tab in the Environment section, click Parallel > Discover Clusters.
In the Cluster Profile Manager, click Discover Clusters.
This opens the Discover Clusters dialog box, where you select the location of your clusters. As clusters are
discovered, they populate a list for your selection:
http://www.mathworks.com/help/distcomp/clusters-and-cluster-profiles.html 1/8
9/27/2014 Clusters and Cluster Profiles - MATLAB & Simulink
If you already have a profile for any of the listed clusters, those profile names are included in the list. If you
want to create a new profile for one of the discovered clusters, select the name of the cluster you want to
use, and click Next. The subsequent dialog box lets you choose if you want to make your new profile the
default.
MJS — Discover clusters functionality uses the multicast networking protocol to search for head nodes.
MATLAB job schedulers (MJS) require that multicast networking protocol is enabled and working on the
network that connects the MJS head nodes (where the schedulers are running) and the client machines.
HPC Server — Discover clusters functionality uses Active Directory Domain Services to discover head
nodes. HPC Server head nodes are added to the Active Directory during installation of the HPC Server
software.
Amazon EC2 — Discover clusters functionality requires a working network connection between the
client and the Cloud Center web services running in mathworks.com.
1. In the Profile Clusters Manager, select (highlight) the profile you want to export.
2. Click Export > Export. (Alternatively, you can right-click the profile in the listing and select Export.)
If you want to export all your profiles to a single file, click Export > Export All
3. In the Export profiles to file dialog box, specify a location and name for the file. The default file name is
the same as the name of the profile it contains, with a .settings extension appended; you can alter the
http://www.mathworks.com/help/distcomp/clusters-and-cluster-profiles.html 2/8
9/27/2014 Clusters and Cluster Profiles - MATLAB & Simulink
Profiles saved in this way can then be imported by other MATLAB users:
You can also export and import profiles programmatically with the parallel.exportProfile and
parallel.importProfile functions.
A compiled application has the same default profile and the same list of alternative profiles that the
compiling user had when the application was compiled. This means that in many cases the profile file is not
needed, as might be the case when using the local profile for local workers. If an exported file is used, the
first profile in the file becomes the default when imported. If any of the imported profiles have the same
name as any of the existing profiles, they are renamed during import (though their names in the file remain
unchanged).
http://www.mathworks.com/help/distcomp/clusters-and-cluster-profiles.html 3/8
9/27/2014 Clusters and Cluster Profiles - MATLAB & Simulink
The following example provides instructions on how to create and modify profiles using the Cluster Profile
Manager.
Suppose you want to create a profile to set several properties for jobs to run in an MJS cluster. The
following example illustrates a possible workflow, where you create two profiles differentiated only by the
number of workers they use.
1. In the Cluster Profile Manager, select Add > Custom > MATLAB Job Scheduler (MJS). This specifies
that you want a new profile for an MJS cluster.
Note If the MJS is using a nondefault BASE_PORT setting as defined in the mdce_def file, the Host
property in the cluster profile must be appended with this BASE_PORT number. For example, MJS-
Host:40000.
4. Scroll down to the Workers section, and for the Range of number of workers, enter the two-element
vector [4 4]. This specifies that jobs using this profile require at least four workers and no more than
four workers. Therefore, a job using this profile runs on exactly four workers, even if it has to wait until
four workers are available before starting.
http://www.mathworks.com/help/distcomp/clusters-and-cluster-profiles.html 4/8
9/27/2014 Clusters and Cluster Profiles - MATLAB & Simulink
You might want to edit other properties depending on your particular network and cluster situation.
5. Click Done to save the profile settings.
To create a similar profile with just a few differences, you can duplicate an existing profile and modify only
the parts you need to change, as follows:
1. In the Cluster Profile Manager, right-click the profile name MyMJSprofile1 in the list and select
Duplicate.
This creates a duplicate profile with a name based on the original profile name appended with _Copy.
2. Double-click the new profile name and edit its name to be MyMJSprofile2.
3. Click Edit to allow you to change the profile property values.
4. Edit the description field to change its text to MJS with any workers.
5. Scroll down to the Workers section, and for the Range of number of workers, clear the [4 4] and leave
the field blank, as highlighted in the following figure:
http://www.mathworks.com/help/distcomp/clusters-and-cluster-profiles.html 5/8
9/27/2014 Clusters and Cluster Profiles - MATLAB & Simulink
6. Click Done to save the profile settings and to close the properties editor.
You now have two profiles that differ only in the number of workers required for running a job.
When creating a job, you can apply either profile to that job as a way of specifying how many workers it
should run on.
You can see examples of profiles for different kinds of supported schedulers in the MATLAB Distributed
http://www.mathworks.com/help/distcomp/clusters-and-cluster-profiles.html 6/8
9/27/2014 Clusters and Cluster Profiles - MATLAB & Simulink
1. Open the Cluster Profile Manager on the Home tab in the Environment section, by clicking Parallel >
Manage Cluster Profiles.
2. In the Cluster Profile Manager, click the name of the profile you want to test. You can highlight a profile
without changing the selected default profile. So a profile selected for validation does not need to be
your default profile.
3. Click Validate.
While the tests are running, the Cluster Profile Manager displays their progress as shown here:
Note Validation will fail if you already have a parallel pool open.
When the tests are complete, you can click Show Details to get more information about test results. This
information includes any error messages, debug logs, and other data that might be useful in diagnosing
problems or helping to determine proper network settings.
http://www.mathworks.com/help/distcomp/clusters-and-cluster-profiles.html 7/8
9/27/2014 Clusters and Cluster Profiles - MATLAB & Simulink
The Validation Results tab keeps the test results available until the current MATLAB session closes.
On the Home tab in the Environment section, click Parallel > Default Cluster, and from there, all your
profiles are available. The default profile is indicated. You can select any profile in the list as the default.
The Cluster Profile Manager indicates which is the default profile. You can select any profile in the list,
then click Set as Default.
You can get or set the default profile programmatically by using the parallel.defaultClusterProfile
function. The following sets of commands achieve the same thing:
parallel.defaultClusterProfile('MyMJSprofile1')
parpool
or
parpool('MyMJSprofile1')
c = parcluster('myMJSprofile')
This command finds the cluster defined by the settings of the profile named myMJSprofile and sets property
values on the cluster object based on settings in the profile. By applying different profiles, you can alter your
cluster choices without changing your MATLAB application code.
c = parcluster('myProfile1');
job1 = createJob(c); % Uses profile of cluster object c.
createTask(job1,@rand,1,{3}) % Uses profile of cluster object c.
http://www.mathworks.com/help/distcomp/clusters-and-cluster-profiles.html 8/8