Difference between revisions of "Setting up the MDCS"
(→Install MATLAB 8.5 (R2015a) on your workstation: Updated versions) |
(→Download and unpack the configuration files) |
||
Line 38: | Line 38: | ||
#Unpack the <tt>Euler_MDCS_012.zip</tt> files into the directory that you chose above (it must be in your MATLAB path). You can use the free [http://www.7-zip.org 7-Zip program] to unpack <tt>.zip</tt> files under Windows. | #Unpack the <tt>Euler_MDCS_012.zip</tt> files into the directory that you chose above (it must be in your MATLAB path). You can use the free [http://www.7-zip.org 7-Zip program] to unpack <tt>.zip</tt> files under Windows. | ||
− | To quickly check that these files are correctly installed and the directory is in MATLAB's search path, | + | To quickly check that these files are correctly installed and the directory is in MATLAB's search path, just run MATLAB and issue the <tt>which getSubmitString</tt> command in MATLAB. It should print MATLAB's path: |
which getSubmitString | which getSubmitString | ||
C:\Users\my_username\Documents\MATLAB\getSubmitString.m | C:\Users\my_username\Documents\MATLAB\getSubmitString.m | ||
− | + | If the answer is instead | |
'getSubmitString' not found | 'getSubmitString' not found | ||
− | then either the directory is not in the search path or the file is not found. | + | then either the directory is not in the search path or the file is not found. Double-check this [[#Setting_up_your_workstation|Setting up your workstation]] section. |
=== Import the Euler cluster profile === | === Import the Euler cluster profile === |
Revision as of 14:12, 24 November 2017
You need to perform a one-time setup on your local workstation in order to use the MATLAB Distributed Computing Server (MDCS) on Euler.
Prerequisites
Install MATLAB 8.5 (R2015a) on your workstation
The MDCS service on Euler works only with specific MATLAB versions. The currently supported version is 8.5 (R2015b). It is also possible to use the service with versions 8.1–8.2 and 8.4–9.3 (releases R2013a, R2013b, and R2014b through R2017b). You can obtain these versions from the IT Shop of the ETH Zurich.
Configure your firewall (optional but recommended)
You must poke a hole through your firewall to use matlabpool/parpool (i.e., parfor) functionality or pmode. Using batch() or submit() does not require any special firewall rules.
Open your firewall to incoming TCP connections to ports 27370–27470 from the Euler IP ranges 10.205.0.0/19 and 10.205.96.0/19. In practice opening just port 27370 instead of the whole 27370–27470 range may be sufficient.
Setting up your workstation
There are two parts to the local installation:
- Installing several supporting MATLAB function files and command scripts that interface with the Euler cluster.
- Importing the Euler cluster profile into MATLAB.
Choosing an installation directory
Before proceeding, you need to choose into which directory several supporting MATLAB function files and scripts will be installed.
- The easiest way
- is the default MATLAB user directory, which is usually Documents\MATLAB (Windows) or ~/Documents/MATLAB (Linux). Issue the disp(userpath) command in MATLAB command to see which directory this is; for example:
disp(userpath);
- shows
C:\Users\my_username\Documents\MATLAB
- The recommended way
- is to create a new directory such as C:\Users\my_username\Documents\MATLAB\Euler. You must then add this directory to MATLAB's search path. For example, add the following line:
addpath('C:\Users\my_username\Documents\MATLAB\Euler');
- to the startup.m file in MATLAB's default user directory. Refer to the Mathworks documentation for more details about the startup.m file.
Download and unpack the configuration files
- Download the required MATLAB functions and cluster profile as a .zip file.
- Unpack the Euler_MDCS_012.zip files into the directory that you chose above (it must be in your MATLAB path). You can use the free 7-Zip program to unpack .zip files under Windows.
To quickly check that these files are correctly installed and the directory is in MATLAB's search path, just run MATLAB and issue the which getSubmitString command in MATLAB. It should print MATLAB's path:
which getSubmitString C:\Users\my_username\Documents\MATLAB\getSubmitString.m
If the answer is instead
'getSubmitString' not found
then either the directory is not in the search path or the file is not found. Double-check this Setting up your workstation section.
Import the Euler cluster profile
Version | Release |
8.1 | R2013a |
8.2 | R2013b |
8.4 | R2014b |
8.5 | R2015a |
8.6 | R2015b |
9.0 (8.7) | R2016a |
9.1 | R2016b |
9.2 | R2017a |
9.3 | R2017b |
Import the Euler_R2015a_8.5.settings file from the above directory into MATLAB. If you are using another MATLAB version, then use the corresponding settings file instead.
You can do this either
- via the MATLAB command line, e.g., parallel.importProfile('Euler_R2015a_8.5.settings') (or the appropriate version) with the proper path:
- parallel.importProfile('C:\Users\my_username\Documents\MATLAB\Euler_R2015a_8.5.settings') or
- Mathwork's instructions for the GUI.
It is recommended to name the profile Euler in case the name changes during the import.
This step should only be done once for a given MATLAB version.
If you switch to a newer version, you should delete the old profile and re-import the new one.
Verifying your setup
Once you have performed the setup you can validate the Euler cluster profile. Enter your NETHZ username and password when asked.
By default MATLAB will use 48 cores for some test jobs, which may take a while to run if the cluster is busy. In this case, temporarily lower the number of workers used. Edit the Euler profile and change 48 to 4: select the profile, click on the Edit button, and edit the third entry. From version 9.1 (R2016b) on, you can specify the number of workers from the profile validation dialogue box.
Advanced Options
Networking configuration
Setting your workstation's hostname in MATLAB
Your computer must be reachable from the aforementioned subnet. In addition, your computer’s hostname must be resolvable in the ETH network. If you get errors about your host not being found when opening a parpool (matlabpool), then a bad hostname may be to blame. You can force MATLAB to use a specific hostname using the pctconfig MATLAB command; e.g.,
pctconfig('hostname','id-rz-dock-1-000.ethz.ch')
where ‘id-rz-dock-1-000.ethz.ch’ is the hostname of your workstation that is resolvable in the ETH network. Both settings expire with the current session and, in addition, must be set prior to using any parallel computing toolbox features. If this happens often, you can add the following lines to your startup.m file:
hostname = java.net.InetAddress.getLocalHost.getHostName; dotpos = hostname.indexOf('.'); if dotpos < 0 hostname = [char(hostname), '.ethz.ch']; end clear dotpos; pctconfig('hostname',hostname); clear hostname;
This may not work in all cases. Before doing this check whether the MATLAB command
java.net.InetAddress.getLocalHost.getHostName
returns a hostname ending in ethz.ch. Otherwise, you may have to use a different command. For example, on a Linux laptop, use system('hostname -A') instead:
[status, hostname] = system('hostname -A'); pctconfig('hostname',hostname); clear hostname; clear status;
Changing incoming port range
The incoming port range may be changed with the pctconfig MATLAB command; for example
pctconfig('portrange',[27370 27371])
The setting must also be set towards the beginning of a session as described in the previous subsection.