Main Content

Access Cloud Clusters Using the Command-Line

Find Clusters on Cloud

As an alternative to downloading a profile and importing it through the Profile Manager, you can use the fetchCloudClusters function to create cluster objects in MATLAB® for your own clusters on the cloud. A pop-up dialog box might require you to log in to your MathWorks® account when you execute this command. If you have more than one cluster running on the cloud, fetchCloudClusters returns an array of cluster objects; if you have only one cluster running, it returns just a single object:

c = fetchCloudClusters

MJSComputeCloud Cluster Information

           Modified: true
          NumWorkers: 32
  JobStorageLocation: Database on
   ClusterMatlabRoot: /mnt/matlab
     OperatingSystem: unix

 - Assigned Jobs

      Number Pending: 0
       Number Queued: 0
      Number Running: 0
     Number Finished: 0

 - MJSComputeCloud Specific Properties

                Name: MyCluster
               State: online
      NumBusyWorkers: 0
      NumIdleWorkers: 32

Now you can use the cluster object to create jobs and tasks in the usual manner. For example:




If you are the cluster owner, you can also start and stop cloud clusters using the cluster object, using the functions start (Parallel Computing Toolbox) and shutdown (Parallel Computing Toolbox). You are the cluster owner if you created the cluster. The function wait (cluster) (Parallel Computing Toolbox) enables you to wait to submit jobs until all cluster workers are available.

Use Downloaded Profile for Cloud Cluster

As an alternative to fetchCloudClusters, you can use the profile downloaded from the Cloud Center to identify the cluster you want to access. For example, suppose you downloaded the profile settings file to a file named C:\temp\MyCluster.settings. You can access and use this profile programmatically with:

c = parcluster('MyProfile')

Then proceed to use this cluster for creating jobs or running parallel algorithms:




Related Topics