Difference between revisions of "Using the MATLAB service"

From ScientificComputing
Jump to: navigation, search
(Updates troubleshooting section)
(Adds Euler III IP range and link to the IP ranges page.)
Line 9: Line 9:
 
Quick setup:
 
Quick setup:
 
# Install MATLAB version 8.5 (R2015a) on your workstation.
 
# Install MATLAB version 8.5 (R2015a) on your workstation.
# (optional but recommended) Open your firewall from 10.205.0.0/19 to ports 27370–27470 on your workstation.
+
# (optional but recommended) Open your firewall from [[Cluster_IP_ranges|10.205.0.0/19 and 10.205.96.0/19]] to ports 27370–27470 on your workstation.
 
# Unpack the [https://polybox.ethz.ch/index.php/s/gGWPWTvSuIEM5C3/download MATLAB interface files for Euler] into <tt>Documents\MATLAB</tt> (Windows) or <tt>~/Documents/MATLAB</tt> (Linux, Mac).
 
# Unpack the [https://polybox.ethz.ch/index.php/s/gGWPWTvSuIEM5C3/download MATLAB interface files for Euler] into <tt>Documents\MATLAB</tt> (Windows) or <tt>~/Documents/MATLAB</tt> (Linux, Mac).
 
# [http://www.mathworks.com/help/distcomp/clusters-and-cluster-profiles.html#brb8e5t-1 Import] the <tt>Euler_8.5.settings</tt> cluster profile into MATLAB.
 
# [http://www.mathworks.com/help/distcomp/clusters-and-cluster-profiles.html#brb8e5t-1 Import] the <tt>Euler_8.5.settings</tt> cluster profile into MATLAB.

Revision as of 12:14, 20 March 2017

Introduction

The MATLAB Distributed Computing Server (MDCS) is a service for offloading computationally-intensive calculations from your workstation to the Euler computer cluster as transparently as possible.

The most common use case is offloading a computationally-intensive parfor loop, which takes more than several hours to run on a normal workstation.

Setup

Quick setup:

  1. Install MATLAB version 8.5 (R2015a) on your workstation.
  2. (optional but recommended) Open your firewall from 10.205.0.0/19 and 10.205.96.0/19 to ports 27370–27470 on your workstation.
  3. Unpack the MATLAB interface files for Euler into Documents\MATLAB (Windows) or ~/Documents/MATLAB (Linux, Mac).
  4. Import the Euler_8.5.settings cluster profile into MATLAB.
  5. Log in to Euler to accept the usage agreement (if you are not already an Euler user)
  6. Validate the Euler cluster profile.

Still having problems? The full setup instructions are on a separate page.

Usage

Refer to Mathwork's Parallel Computing Toolbox (PCT) documentation on how to make use of Euler in your code.

Code that uses parfor or other PCT constructs can use the Euler MDCS by referring to the Euler cluster profile. For example,

cluster = parcluster('Euler');
squares = zeros(10,1);
parpool(cluster,4);
parfor i = 1:10
    squares(i) = i^2;
end
disp(squares)

If you set Euler to be the default cluster profile, then you need no changes to your code: all of the PCT constructs will use Euler by default.

Troubleshooting

Using parallel pools often results in hard-to-diagnose errors. Many of these errors are related to running several pools at the same time, which is not what MATLAB expects. If you encounter persistent problems starting pools, try to perform one of these commands. Before running them, make sure that you do not have a MATLAB processes running.

  1. Remove the matlab_metadat.mat file in your current working directory on your workstation.
  2. Remove the $HOME/.matlab/local_cluster_jobs directory on your workstation. The actual location may depend on your operating system or installation options.
  3. Remove the entire $HOME/.matlab directory on your workstation. Warning: Your MATLAB settings will be lost.