Difference between revisions of "Using the MATLAB service"

From ScientificComputing
Jump to: navigation, search
(Expands MDCS documentation with example usage.)
(Adds link to the interface files.)
Line 10: Line 10:
 
# 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 10.205.0.0/19 to ports 27370–27470 on your workstation.
# Unpack the 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.
 
# [[Accessing_the_clusters|Log in to Euler]] to accept the usage agreement (if you are not already an Euler user)
 
# [[Accessing_the_clusters|Log in to Euler]] to accept the usage agreement (if you are not already an Euler user)

Revision as of 15:01, 5 December 2016

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