| Contents | Index |
| On this page… |
|---|
Cluster Profiles let you define certain properties for your cluster, then have these properties applied when you create cluster, job, and task objects in the MATLAB client. Some of the functions that support the use of cluster profiles are
You create and modify profiles through the Cluster Profile Manager. You access the Cluster Profile Manager using the Parallel pull-down menu on the MATLAB desktop. To open the Cluster Profile Manager, select Parallel > Manage Cluster Profiles.

The first time you open the Cluster Profile Manager, it lists only one profile called local, which at first is the default profile and has only default settings.

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 some jobs being run in an MJS cluster. The following example illustrates a possible workflow, where you create two profiles differentiated only by the number of workers.
In the Cluster Profile Manager, select New > MATLAB Job Scheduler (MJS). This specifies that you want a new profile whose type of cluster is an MJS.

This creates and displays a new profile, called Profile1.
Double-click the profile name in the listing, and enter a profile name MyMJSprofile1.
Click Edit in the lower-right corner so that you can set your profile property values.
In the Description field, enter the text MJS with 4 workers, as shown in the following figure. Enter the host name for the machine on which the MJS is running and the name of the MJS. If you are entering information for an actual MJS already running on your network, enter the appropriate text. If you are unsure about MJS (also known as a job manager) names and locations on your network, ask your system administrator for help.
Scroll down to the Workers section, and for the Range of number of workers, enter [4 4]. This specifies that jobs using this profile require at least four workers and no more than four workers. Therefore, the job runs on exactly four workers, even if it has to wait until four workers are available before starting.

You might want to edit other properties depending on your particular situation.
Click Done to save the profile.
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:
In the Cluster Profile Manager, right-click the profile MyMJSprofile1 in the list and select Duplicate.
The duplicate profile is created with a name based on the original profile name prefixed with Copy_Of_.
Double-click the new profile name and edit its name to be MyMJSprofile2.
Click Edit to allow you to change the profile property values.
Edit the description field to change its text to MJS with any workers.
Scroll down to the Workers section, and for the Range of number of workers, clear the [4 4] and leave the field blank.

Click Done to save the profile and 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.
For examples of profiles for different kinds of supported schedulers, see the MATLAB Distributed Computing Server installation instructions on the web at mathworks.com/distconfig.
The Cluster Profile Manager includes a tool for validating profiles.
To validate a profile, follow these steps:
Open the Cluster Profile Manager by selecting on the desktop Parallel > Manage Cluster Profiles.
In the Cluster Profile Manager, click the name of the profile you want to test. Note that you can highlight a profile this way without changing the selected default profile. So a profile selected for validation does not need to be your default profile.
Click Validate.
Profile validation includes five stages:
Connects to the cluster (parcluster)
Runs an independent job (createJob) on the cluster using the profile
Runs an SPMD-type communicating job on the cluster using the profile
Runs a pool-type communicating job on the cluster using the profile
Runs a MATLAB pool job on the cluster using the profile
While the tests are running, the Cluster Profile Manager displays their progress as shown here:

Note When using an mpiexec scheduler, a failure is expected for the Independent Job stage. It is normal for the test then to proceed to the Communicating Job and Matlabpool stages. |
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.
The Validation Results tab keeps the test results available until the current MATLAB session closes.
In the MATLAB client where you create and define your parallel computing objects, you can use cluster profiles when creating the objects.
Some functions support default profiles, so that if you do not specify a profile for them to use, they automatically apply the default. There are several ways to specify which of your profiles should be used as the default profile:
In the MATLAB desktop, click Parallel > Select Cluster Profile, and from there, all your profiles are available. The current default profile appears with a dot next to it. You can select any profile in the list as the default.
In the Cluster Profile Manager, a dot indicates which is currently 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.defaultProfile('MyMJSprofile1')
matlabpool openor
matlabpool open MyMJSprofile1
The parcluster function creates a cluster object in your workspace according to the specified profile. The profile identifies a particular cluster and applies property values. For example,
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.
Because the properties of cluster, job, and task objects can be defined in a profile, you do not have to explicitly define them in your application. Therefore, your code can accommodate any type of cluster without being modified. For example, the following code uses one profile to set properties on cluster, job, and task objects:
c = parcluster('myProfile1);
job1 = createJob(c); % Uses profile of cluster c.
createTask(job1,@rand,1,{3}) % Uses profile of c.Cluster profiles are stored as part of your MATLAB preferences, so they are generally available on an individual user basis. To make a cluster profile available to someone else, you can export it to a separate .settings file. In this way, a repository of profiles can be created so that all users of a computing cluster can share common profiles.
To export a cluster profile:
In the Profile Clusters Manager, select (highlight) the profile you want to export.
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
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 names if you want to.
Profiles saved in this way can then be imported by other MATLAB users:
In the Cluster Profile Manager, click Import.
In the Import profiles from file dialog box, browse to find the .settings file for the profile you want to import. Select the file and click Open.
The imported profile appears in your Cluster Profile Manager list. Note that the list contains the profile name, which is not necessarily the file name. If you already have a profile with the same name as the one you are importing, the imported profile gets an extension added to its name so you can distinguish it.
You can also export and import profiles programmatically with the parallel.exportProfile and parallel.importProfile functions.
You can use an exported profile with MATLAB Compiler to identify cluster setup information for running compiled applications on a cluster. For example, the setmcruserdata function can use the exported profile file name to set the value for the key ParallelProfile. For more information and examples of deploying parallel applications, see Deploying Applications Created Using Parallel Computing Toolbox in the MATLAB Compiler documentation.
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).
![]() | Create Simple Independent Jobs | Job Monitor | ![]() |

See how to solve large problems with minimal effort and reduce simulation time.
Get free kit| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |