Main Content

Run MATLAB Parallel Server from Microsoft Azure Marketplace

This topic describes how to use the Azure® Marketplace to quickly deploy and run MATLAB® Parallel Server™ in Azure. The elasticity of the cloud infrastructure combined with MATLAB Parallel Server enables you to leverage greater computing resources and keep your calculations close to your data.

Anyone with a valid MATLAB license that includes MATLAB Parallel Server and an Azure account can run MATLAB Parallel Server in the cloud. This offering is called MATLAB Parallel Server (BYOL) because you "Bring Your Own License."

Requirements

To complete these instructions, you need:

Licensing

By default, the MATLAB Parallel Server (BYOL) offering in the Azure Marketplace uses online licensing. The following table summarizes which licenses support running MATLAB Parallel Server on the cloud using online licensing.

License TypeCloud Availability

Individual (a license that only you use that is in your name; not a Home or Student license)

Your license is already configured for MATLAB Parallel Server in the cloud.

Campus-Wide License (a license that you use that belongs to your academic institution)

Your license is already configured for MATLAB Parallel Server in the cloud.

Home and Student (that only you use and is in your name)

These license types are not eligible to use MATLAB Parallel Server in the cloud.

All other license types, including Concurrent and Network Named User

Contact your license administrator.*

The license administrator might need to make some changes to the license to enable you to run MATLAB Parallel Server in the cloud.

Administrators: For more information on this process, see Configure MATLAB Parallel Server Licensing for Cloud Platforms (MATLAB Parallel Server).

*Not sure who the license administrator is? Sign in to your MathWorks Account, click the license you are using, then click the tab marked “Contact Administrators.”

To use a license that is managed using a network license manager, you can specify the port and host name or IP address of the network license manager when you create the cloud resources in Azure. You can either specify the location of an existing license manager, or deploy a new license manager in the cloud. You must make sure that the license manager can communicate with your cloud resources. To deploy a Network Manager in Azure using an Azure Marketplace software plan developed by MathWorks®, follow the steps at Run Network License Manager from Microsoft Azure Marketplace.

Deploy MATLAB Parallel Server Resources in Azure

Configure and Deploy Template from Marketplace

Use the following steps to configure and deploy MATLAB Parallel Server (BYOL) resources in a resource group.

  1. Navigate to https://portal.azure.com and log in to your Azure account.

  2. From the Portal, click Create a Resource.

  3. Search for “matlab parallel server” in the marketplace and select the MATLAB Parallel Server (BYOL) offering.

  4. Click Create on the offering page to begin setup.

    Picture of the MATLAB Parallel Server (BYOL) offering in the Azure Marketplace.

  5. The setup process uses a Resource Manager template to help you configure the virtual machine (VM) and networking settings. To make setup easy, many of the fields come prepopulated with suitable values. The following table describes how to set the various options in each menu of the template. Click Next at the end of each step to proceed to the next menu.

    MenuOptionDescription

    Basics

    Subscription

    Select an Azure subscription to use.

    Resource group

    You can select an existing resource group from the drop-down menu, or click Create New to create a new resource group. If you select an existing resource group, then it must not have any currently deployed resources.

    Region

    Select a region from the drop-down list.

    Cluster Settings

    Cluster name

    Select a name for the cluster. The default name is myCluster.

    Num worker nodes

    The number of Azure instances to start for the workers to run on.

    Num workers per node

    The number of MATLAB workers to start on each instance. Specify one worker for every two vCPUs to assign one worker per physical core. For example, a Standard_D64s_v3 instance has 64 vCPUs, so can support 32 MATLAB workers. For details on the number of vCPUs for each instance type, see https://docs.microsoft.com/en-us/azure/virtual-machines/sizes.

    Headnode instance type

    The Azure instance type to use for the head node, which runs the job manager. No workers are started on this node, so this node can be a smaller instance type than the worker nodes. For a list of instance types and sizes, see https://docs.microsoft.com/en-us/azure/virtual-machines/sizes.

    Worker instance type

    The Azure instance type to use for the workers. For a list of instance types and sizes, see https://docs.microsoft.com/en-us/azure/virtual-machines/sizes.

    Database volume size

    The size of the volume in gigabytes used to store the database files. If you set this value to 0, a separate volume is not created and the root volume is used for the database.
    Client IP addressThe IP address range that can be used to access the cluster from MATLAB. The range must be a valid IP CIDR range of the form x.x.x.x/x. Use a value of the form x.x.x.x/32 to restrict access to only your computer.
    PasswordChoose the admin password for the user "matlab". This password is required when you log into any instance (headnode or worker) using remote desktop protocol. Your password must have at least 12 characters and meet the Azure password requirements. For information on the password requirements, see What are the password requirements when creating a VM?
    Confirm passwordRetype your chosen password.

    Network license manager port@server

    If you are using a network license manager, enter the port and hostname or IP address. Make sure that the network license manager can communicate with your Azure resources. To deploy a network license manager in Azure, see Run Network License Manager from Microsoft Azure Marketplace.

    Networking

    Virtual network

    The Virtual network field is prepopulated with a new virtual network resource named vnet01.

    • You can configure the name, address space, or subnets of the new virtual network resource by clicking Create new.

    • You can select an existing virtual network resource in the drop-down menu. If you choose to use an existing resource, then the template does not create any new virtual network resources.

    Subnets

    The Subnet field is prepopulated with a new subnet named subnet-1 and an associated subnet address.

    • You can select a different subnet of the selected virtual network in the drop-down menu.

    • If you selected an existing virtual network rather than creating a new one, then you can click Manage subnet configuration to configure the subnets for the network.

    Review and Create

    When you advance to the Review and Create menu, Azure automatically runs some final validation checks on the information entered on previous screens. If Azure finds any errors, then you must fix them before proceeding.

    After the validation completes successfully, review the MathWorks terms of use and privacy policy. You are responsible for all associated costs once you deploy MATLAB Parallel Server in Azure.

    Once you are satisfied with the values you have entered, click Create to finalize setup and begin deploying the selected resources, or click Download a template for automation to get a copy of the completed template.

    • The deployment can take several minutes. You get a notification in the Azure Portal once the deployment is complete.

    • When the deployment is complete, follow the instructions in Connect to your Cluster from MATLAB to use the cluster you set up.

Connect to your Cluster from MATLAB

Once you have successfully configured and deployed the MATLAB Parallel Server (BYOL) resources, use the following steps to connect to the cluster you set up.

  1. From the Azure Portal, navigate to the resource group with the resources you deployed.

  2. Select the Storage Account ending with storage.

  3. Select the Files container type.

  4. Select the File Share named "shared."

  5. Download the .settings file.

  6. Open MATLAB on your client machine.

  7. In the Parallel drop-down menu in the MATLAB toolstrip, select Create and Manage Clusters....

  8. Click Import.

  9. Select the downloaded profile and click open.

  10. Click Set as Default.

  11. (Optional) Validate your cluster by clicking the Validate button.

After you set the cloud cluster as the default, the next time you run a parallel language command (such as parfor, spmd, parfeval, or batch), MATLAB connects to the cluster. The first time you connect, you are prompted for your MathWorks account login. The first time you run a task on a worker, it can take several minutes for the worker MATLAB to start. This delay is due to provisioning the instance disk. This is a one-time operation, and subsequent tasks begin much faster.

Your cluster is now ready to use. The cluster remains running after you close MATLAB on the client machine.

Caution

Use the profile and client IP address range to control access to your cloud resources. Anyone with the .settings file can connect to your resources from a machine within the specified IP address range and run jobs on it.

Port Requirements for Accessing MATLAB Parallel Server

To access a MATLAB Parallel Server cluster from your client MATLAB, your client machine must be able to communicate on specific ports. Make sure that the network firewall allows the following outgoing connections.

Required PortsDescription
TCP 27350 to 27358 + 4*NPorts 27350 to 27358 + 4*N, where N is the maximum number of workers on a single node
TCP 443HTTPS access to (at least) *.mathworks and *.microsoft.com
TCP 3389Remote Desktop Protocol for access to cluster nodes

Delete MATLAB Parallel Server Resources from Azure

You can remove the resource group and all associated resources when you are done with them to help save on costs.

  1. Log in to the Azure Portal.

  2. Select the resource group containing the MATLAB Parallel Server (BYOL) resources you deployed.

  3. Click the Delete resource group icon to delete all resources deployed in the group.

  4. You are prompted to confirm the deletion.

The deletion is final, and files do not persist between deployments. You must create the resources to make them available again.

Architecture and Resources for MATLAB Parallel Server in Azure

Deploying MATLAB Parallel Server in Azure creates several resources in your resource group. The deployment sets up a single Azure VM for the headnode, an Azure virtual machine scaling set (VMSS) for the workers, a network interface with a public IP address to connect to the VM, a network security group that controls network traffic, and a virtual network for communication between resources. The following table summarizes the resources that are created.

Resource NameDefault Resource Name in AzureDescription
Virtual machinemyclus-headnodeA compute instance for the cluster headnode. The MATLAB install is part of the VM image and the job database is stored either locally on the root volume. Optionally, a separate data disk can be used. Communication between clients and the headnode is secured using SSL.
Virtual machine scaling setmycl-vmssA scaling set for worker instances to be launched into. The scaling features are not currently used. The scaling set is configured to attach an extension to each instance that is configured at deployment time as a worker node of the cluster. Communication between clients and workers is secured using SSL.
Network interfacemyclus-headnodenicEnables the headnode and workers to communicate with the internet, Azure, and on-premises resources.
Network security groupmycluster-nsgAllows or denies traffic to and from sources and destinations.
Virtual networkvnet01Enables resources to communicate with each other. If you select an existing virtual network resource, then the template does not create this resource.

The architecture of these resources is summarized in the following diagram.

From the client machine, you connect to the MATLAB Parallel Server cluster on Azure via SSH through a Network Security Group. The Virtual Network contains the headnode and the MATLAB workers inside a Network Security Group. The File Share contains the cluster profile file and the shared secret.

VM Software

A preconfigured Windows® VM is provided to make deployment easy. The VM contains the following software:

  • MATLAB, Simulink®, toolboxes, and support for GPUs.

    The license used to run MATLAB determines which products and toolboxes are available for you to use. However, all products are installed on the VM, so the ver command returns a list of all products. To add new products to your license, see Products and Services.

  • Add-Ons: Deep Learning Toolbox™ Model for AlexNet Network, Deep Learning Toolbox Model for GoogLeNet Network, and Deep Learning Toolbox Model for ResNet-50 Network.

Marketplace vs. Reference Architecture

The Azure Marketplace offering runs only the latest release of MATLAB Parallel Server. If you want to run older releases of MATLAB Parallel Server, or customize the templates and automation scripts more extensively, then you can use the MATLAB Parallel Server Reference Architecture for Microsoft Azure instead.

Support

If you encounter an unexpected problem, search MATLAB Answers for solutions first. Most likely, other people have run into the same problem and resolved it already.

If the problem persists, or there are not any relevant posts on MATLAB Answers for the issue, contact Technical Support.

External Websites