下文是转载的国创队友xianb同学的技术文章,一开始我用虚拟机fedora 14配置openmpi时失败,后来换用装有debian 7的龙芯重新尝试,configure过程进行顺利,但是make过程出现了许多warning,导致至今未成功,在此记录下来.
此次学习的目的是为了学习dlb以及OmpSs的安装。
环境:debian7.2 wheezy
这里简单介绍了DLB的概念及作用,dlb可以让各个CPU core的负载更为均衡。
DLB is a dynamic library designed to speed up hybrid applications with nested parallelism by improving the load balance inside each computational node.
这里说明dlb安装好了以后基本不需要可以去修改,重新编译原有程序,dlb都是自动实现的。
The DLB library uses an interposition technique during runtime, therefor in most of the cases it is not necessary to analyze previously the application, modify it or recompile
这里是安装dlb的环境要求
The current version of DLB supports the following programming models:
· MPI + OpenMP
· MPI + OMPSs 我们选择的是这个
· MPI + SMPSs (not maintained)
要安装DLB,首先要有MPI和OMPSs两个API,所以,我们首先需要安装这两个API。
MPI我们选择openmpi这个实现。
而OMPSs则在pm.bsc.es里。
一. 安装OpenMPI:
1. 到openmpi官网中下载最新的源码包www.open-mpi.org/software/ompi/v1.6/。
2. 解压 tar -zxvf openmpi-1.6.5.tar.gz.
3. configure --prefix=/usr/local/openmpi-1.6.5指定安装目录。
4. make
5. make install
6. 在 ~/.bashrc中加入如下语句
export OPENMPI=/usr/local/openmpi-1.6.5
export LD_LIBRARY_PATH=$OPENMPI/lib
export PATH=$OPENMPI/bin:$PATH
7. source ~/.bashrc
8. cd example文件夹,执行mpirun -np 4 hello_c
9. 输出结果
10. 若无异常则安装成功
二:安装OMPSs
原文见pm.bsc.es/ompss-downloads
有两种办法可以安装ompss
In order to have an implementation of OmpSs programming model you must install Nanos++ runtime library and Mercurium compiler. You can get the snapshots from the links below in this page. Check here to have a guide to install Nanos++ and here to Mercurium installation quick guide. You can also use a binary package (following section) which includes both components: runtime and compiler.
A. OmpSs Snapshots
B. OmpSs Packages
由于第二种办法下载速度太慢,所以我选择了第一种办法
http://pm.bsc.es/ompss-docs/user-guide/installation.html#installation-of-mercurium-c-c-compiler
这里有具体安装步骤,注意extrae是可选的,由于依赖过多,所以我没有安装成功。因此忽略这个,然后按照教程安装nanos++接着是mercurium c/c++。
三. 安装dlb
1.https://pm.bsc.es/projects/dlb/wiki/Downloads
https://pm.bsc.es/projects/dlb
在这里下载源码包,选择1.0版本,解压,执行./configure&&make&&make install即可。
到这里就完成了dlb以及OmpSs环境的安装了,接下来就是进行的测试了。