Difference between revisions of "Using the MATLAB service"

From ScientificComputing
Jump to: navigation, search
(Adds Troubleshooting section)
(Updates troubleshooting section)
Line 36: Line 36:
 
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.
 
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.
 
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.
# Remove the <tt>matlab_metadat.mat</tt> file in your current working directory.
+
# Remove the <tt>matlab_metadat.mat</tt> file in your current working directory on your workstation.
# Remove the <tt>$HOME/.matlab/local_cluster_jobs</tt> directory.
+
# Remove the <tt>$HOME/.matlab/local_cluster_jobs</tt> directory on your workstation. The actual location may depend on your operating system or installation options.
# Remove the entire <tt>$HOME/.matlab</tt> directory. Warning: Your MATLAB settings on Euler will be lost.
+
# Remove the entire <tt>$HOME/.matlab</tt> directory on your workstation. '''Warning''': Your MATLAB settings will be lost.

Revision as of 16:14, 14 February 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 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.