Access Cloud Clusters Using the Command Line
When your cloud cluster in Cloud Center is starting or online, you can access the Cloud Cluster in MATLAB® using the command line in MATLAB. Alternatively, you can let MATLAB discover clusters for you. For details, see Discover Clusters. You can also access clusters created by others in MATLAB using the cluster profile. For details, see Import Cluster Profiles and Access Cloud Clusters.
Find Clusters on Cloud
You can use the fetchCloudClusters function to create cluster objects
in MATLAB for your own clusters on the cloud. When you run this command, a dialog box
might appear. Log into your MathWorks® account by entering your credentials into the dialog box. 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 one
object.
c = fetchCloudClusters
MJSComputeCloud Cluster Information
===================================
Profile:
Modified: true
Host: ec2-107-21-71-51.compute-1.amazonaws.com
NumWorkers: 32
JobStorageLocation: Database on MyCluster@ec2-107-21-71-51.compute-1.amazonaws.com
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: 32Now you can use the cluster object to create jobs and tasks as an input argument to functions that create jobs and tasks on the cluster. For example:
parpool(c,8)
or
createJob(c)
If you are the cluster owner, you can also start and stop cloud clusters using the
cluster object. Use the function start (Parallel Computing Toolbox) to start
a cluster and use the shutdown (Parallel Computing Toolbox)
function to stop a cluster. You are the cluster owner if you created the cluster. The
function wait (Parallel Computing Toolbox) enables
you to wait to submit jobs until all cluster workers are available.