There are three ways to pass a cluster profile to a standalone application that uses the Parallel Computing Toolbox™:
Save the cluster profile to your MATLAB® preferences.
The cluster profile will be automatically bundled with the generated application and available to the Parallel Computing Toolbox code.
Pass the cluster profile location to the application at run time.
This option is useful if your application is run against different clusters.
Embed the cluster profile in the application.
You can deploy standalone application in a cluster environment using the Parallel Computing Toolbox by passing the cluster profile to the compiled application at run time.
To deploy a standalone application written with Parallel Computing Toolbox:
In the Home tab, in the Environment section, select Parallel > Manage Cluster Profiles.
In the Cluster Profile Manager dialog, select a profile, and in the Manage section, click Export.
Compile the application.
Note: If you are using the GPU feature of Parallel Computing Toolbox, you need to add the PTX and CU files. |
Write a shell script that calls the application using
the -mcruserdata ParallelProfile:
flag.profile
myApp -mcruserdata ParallelProfile:C:\myprofile.settings
Use the full path name for the cluster profile file to specify profile
.
Distribute the following files to application users:
Generated installer
Cluster profile
Script that starts the application using the cluster profile
Users of the application must have access to the cluster specified in the profile.
Note: As of R2012a, Parallel Configurations and MAT files have been replaced with Parallel Profiles. For more information, see the release notes for the Deployment products and Parallel Computing Toolbox. To use existing MAT files and ensure backward compatibility with this change, issue a command such as the following, in the above example: pct_Compiled.exe 200 -mcruserdata ParallelProfile:C:\work9b\pctdeploytool\pct_Compiled\distrib\myconfig.mat If you continue to use MAT files, remember to specify the full path to the MAT file. |
You can deploy standalone applications in a cluster environment using Parallel Computing Toolbox by including the cluster profile with the compiled application.
You can use the default configuration from settings. The steps are similar to using a standard compiled application with the following additional steps.
To deploy a standalone application written with Parallel Computing Toolbox:
Write a MATLAB function that uses setmcruserdata
to
load the cluster profile and pass it to the MATLAB Runtime.
function run_parallel_funct setmcruserdata('ParallelProfile', 'profile') a = parallel_funct end
In the Home tab, in the Environment section, select Parallel > Manage Cluster Profiles.
In the Cluster Profile Manager dialog, select a profile, and in the Manage section, click Export.
The saved cluster profile should match the profile
value
in setmcruserdata
.
Compile the application.
Use the run_
as
the main file for the application.parallel_funct
In the Files required for your application to
run field of the Application Compiler app, include the
cluster profile and the .m
file for parallel_funct
.
If you are using the GPU feature of Parallel Computing Toolbox, you need to manually add the PTX and CU files.
Distribute the generated installer to application users.
Users of the application must have access to the cluster specified in the profile.