Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Use Parallel Computing Toolbox in Deployed Applications

There are three ways to pass a cluster profile to a standalone application that uses the Parallel Computing Toolbox™:

  1. 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.

  2. Pass the cluster profile location to the application at run time.

    This option is useful if your application is run against different clusters.

  3. Embed the cluster profile in the application.

Pass Parallel Computing Toolbox Profile at Run Time

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:

  1. In the Home tab, in the Environment section, select Parallel > Manage Cluster Profiles.

  2. In the Cluster Profile Manager dialog, select a profile, and in the Manage section, click Export.

  3. package the application.

    Note

    If you are using the GPU feature of Parallel Computing Toolbox, you need to add the PTX and CU files.

  4. Write a shell script that calls the application using the -mcruserdata ParallelProfile:profile flag.

    myApp -mcruserdata ParallelProfile:C:\myprofile.settings

    Use the full path name for the cluster profile file to specify profile.

  5. 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.

Embed Parallel Computing Toolbox Profile

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:

  1. 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
  2. In the Home tab, in the Environment section, select Parallel > Manage Cluster Profiles.

  3. 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.

  4. Package the application.

    1. Use the run_parallel_funct as the main file for the application.

    2. In the Files required for your application to run field of the Application Compiler app, include the cluster profile and the MATLAB function for parallel_funct.

    If you are using the GPU feature of Parallel Computing Toolbox, you need to manually add the PTX and CU files.

  5. Distribute the generated installer to application users.

    Users of the application must have access to the cluster specified in the profile.