Monday, February 10, 2014

MATLAB Distributed Computing

1. Installing and Configuring Parallel Computing Toolbox and MATLAB Distributed Computing Server

1.1 System Requirements

Required:
SSE2

1.2 Parallel Computing with MATLAB on a Cluster
Interaction between the Distributed Computing productsParallel computing with MATLAB on a cluster requires two products:
  • Parallel Computing Toolbox (formerly Distributed Computing Toolbox) should be installed on the computer where you write your applications.
  • MATLAB Distributed Computing Server (formerly MATLAB Distributed Computing Engine) should be installed on each computer of the cluster that performs the computation.
1.2.1 Install Products and Configure Your Cluster (latest release)
1.2.1.1 install Licence Manager in Server

使用MDCE引擎建立集群,需要获得Mathworks公司的授权。Licence Manager可以通过Network方式下安装,在standalone方式下安装是没有的。在一个集群中只要一个Node安装License Manager,其它节点就可以获得授权。
  • 安装参考
选择network安装
1) choose "install manually without using the internet" 
2) enter the "file installation key"   xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
3) check out "license manager" option
4) use "license_server.dat" when asked for license file
  • 启动参考
Windows Platform
1) 以管理员模式运行$MATLABROOT$/etc/win64/lmtools.exe
2) 选择Start/Stop Reread标签,单击Start Server
Linux&Unix Platform
1) 在$MATLAB$/etc/license.dat中有SERVER一栏,后面填入your hostname
2) 将license server的端口设置成27000
3) 设置DAEMON MLM为DAEMON MLM $MATLAB$/etc/lm_matlab 
4) 设置OPTIONS=$MATLAB$/etc/lmopts.sh
5) 用普通用户运行./lmstart,开启License Manager

1.2.1.1 install Matlab Distrubuted Computing Engine (分布式计算引擎MDCE的安装)

  • Windows Platform
1) 用管理员启动cmd.exe, cd %MATLABROOT%/toolbox/distcomp/bin
2) > mdce install
3) > mdce start
4) WIN+R,输入services.msc,查看MDCS是否启动
5) 运行addMatlabToWindowsFirewall.bat, 配置防火墙,开放MDCE服务

说明windows服务默认Local System帐号启动,用Local System启动的服务是没有权限访问UNC(Universal Naming Convention)命名约定的网络资源,UNC格式为\\servername[server IP]\sharename\directory\filename。MDCE中传输和共享文件都是使用UNC命名约定,因此要使MDCE支持文件共享,启动它的用户需要有权限访问UNC网络资源。为了配置方便,用登入帐号启动MDCE服务,就可以访问共享资源。
  • Linux&Unix Platform
1) $cd $MATLABROOT$/toolbox/distcomp/bin
2) #./mdce install
3) #./mdce start
4) config iptables, make input chain ports tcp(135,139,445) and udp(137,138) open
说明在UNIX LIKE的系统中mdce是以ROOT身份启动的,可以轻松访问UNC格式的网络资源。
  • DNS设置
MDCE引擎使用机器名(hostname)在各个节点之间通信。为了能够正确解析集群中所有的node,需要在各个node的hosts文件中添加集群中所有机器的ip和hostname的映射条目。

1.2.1.2 调度程序(Job Manager)和work node启动配置

  • 启动Job Manager
在集群中所有的提交的Job都是通过Job Manager分配和管理的,所有的work node都是注册在Job Manager这台机器上,需要固定这台Job Manager主机。client端编写完任务就可以向这台Job Manager这台主机提交。MDCE支持当前所有主流的作业调度程序如LSF, CCS, PBS Pro等。作为实验性的环境,第三方调度程序没有配置,而是采用了随MDCE一起发布的Job Manager来管理集群中的作业调度。 Jm.jpg

Notes:

if you can't run matlabpool, try this in command line:>> distcomp.feature( 'LocalUseMpiexec', false )
or
>> matlabpool close

Reference:

No comments:

Post a Comment