MPI 环境搭建

本文档详细介绍了如何在多台机器上搭建MPI环境,以解决lda单机运行的性能瓶颈。首先,按照指定步骤在三台机器上安装mpich2-1.0.8,然后启动master和slaves节点,并通过mpdtrace测试验证MPI安装成功。最后,提供了运行plda测试样例的命令,强调了MPI中各机器的ring结构。此外,还提及了MPI的性能优化选项,如启用--enable-fast和--enable-ndebug等。
摘要由CSDN通过智能技术生成

搭建目的

为解决lda单机运行瓶颈,而plda的并行架构基于MPI。

MPI install

目标机器:10.210.228.63 10.210.228.64 10.210.228.65

安装步骤:

  1. Download mpich2-1.0.8.tar.gz from http://www.mpich.org/static/downloads/1.0.8/
  2. mkdir -p /data2/local/mpich2-1.0.8
  3. tar -zxvf mpich2-1.0.8.tar.gz
  4. cd mpich2-1.0.8
  5. ./configure --prefix=/data2/local/mpich2-1.0.8
  6. make && make install
  7. add $PATH /data2/local/mpich2-1.0.8/bin
  8. touch /etc/mpd.conf
  9. echo “secretword=sina_algo_mpi” > /etc/mpd.conf
  10. chmod 600 /etc/mpd.conf

在三台目标机器分别按如上步骤安装。

选定10.210.228.63为master,另外两台为slaves。

启动master,在master机器10.210.228.63上执行

mpd --daemon --listenport=55555

启动slaves,在slaves机器10.210.228.64 、10.210.228.65上执行

mpd --daemon -h 10.210.228.63 -p 55555

测试MPI是否正常,在master机器执行mpdtrace,可以看到三台机器说明MPI安装成功。

注意:plda wiki里要求mpi版本必须是 mpich2-1.0.8,当前mpi最新版本是mpich-3.0.4

运行plda测试例子

在plda目录下(/data2/local/plda)执行

mpiexec -n 5 ./mpi_lda --num_topics 2 --alpha 0.1 --beta 0.01 --training_data_file testdata/test_data.txt --model_file /tmp/lda_model.txt --total_iterations 150

注意:这里可以在目标机器上的任意一台机器运行,mpi各个机器之间是ring结构

MPI 优化

目前安装的都是defalut安装

Performance Options:

--enable-fast - Turns off error checking and collection of internal

timing information

--enable-timing=no - Turns off just the collection of internal timing

information

--enable-ndebug - Turns on NDEBUG, which disables asserts. This is a

subset of the optimizations provided by enable-fast,

but is useful in environments where the user wishes

to retain the debug symbols, e.g., this can be combined

with the --enable-g option.

Reference:

https://code.google.com/p/plda/wiki/PLDAManual

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值