Science Blog of Dr. Yuan分享 http://blog.sciencenet.cn/u/albumns This blog is mainly on Molecular molecular modelling and simulations

博文

Compiling Desmond 3.4 from source code.

已有 4312 次阅读 2013-2-14 17:30 |个人分类:科研笔记|系统分类:科研笔记| code, Source, SUSE, Compile, Desmond

Compiling Desmond from source code seems to be the most challenging work that I've ever found especially the latest V3.4. Fortunately, it was successfully compiled these days. During the sampling test, 2 CPU can even get up to 4 ns/day with NVE ensemble for a typical membrane system which is really amazing.

OS: SUSE Linux Enterprise 11 SP2
GCC: 4.3.4 (system implemented)
Boost: 1.49 (installed from SUSE system tool YAST)
Sqlite: 3.7.6 (system implemented)
Python: 2.6.7 (self compiled)
numpy: 1.5.0 (self compiled)
scons: 1.2 (self compiled)
Antlr: 3.2 (self compiled)
Pcre: 8.21 (self compiled)
openMPI: 1.4.3 (self compiled)

after compiling the all above necessary tools and libraries, it would be necessary to configure proper Python environment before compiling Desmond:

setenv PYTHONPATH /soft/python-2.6.7
alias scons /soft/python-2.6.7/bin/scons
alias python /soft/python-2.6.7/bin/python

The configuration file user-conf.sample.py are following:

# Boost;
boost_prefix =  ' /usr/include/boost'
EXTRA_INCLUDE_PATH += ' /usr/include'
EXTRA_LIBRARY_PATH += ' /usr/lib64'
EXTRA_LINK_FLAGS += ' -Wl,-rpath,/usr/lib64'
EXTRA_LIBS += ' -lboost_iostreams -lboost_thread'

# ANTLR, used in MSYS
EXTRA_INCLUDE_PATH += ' /soft/desmond-3.4/libantlr3c/include'
EXTRA_LIBRARY_PATH += ' /soft/desmond-3.4/libantlr3c/lib'
EXTRA_LINK_FLAGS   += ' -Wl,-rpath,/soft/desmond-3.4/libantlr3c/lib'
EXTRA_LIBS += ' -lantlr3c'

# PCRE, used in MSYS
EXTRA_INCLUDE_PATH += ' /soft/desmond-3.4/pcre-8.21/include'
EXTRA_LIBRARY_PATH += ' /soft/desmond-3.4/pcre-8.21/lib'
EXTRA_LINK_FLAGS   += ' -Wl,-rpath,/soft/desmond-3.4/pcre-8.21/lib'
EXTRA_LIBS += ' -lpcre'

# SQLITE - used in MSYS
EXTRA_INCLUDE_PATH += ' /usr/include'
EXTRA_LIBRARY_PATH += ' /usr/lib64'
EXTRA_LINK_FLAGS += ' -Wl,-rpath,/usr/lib64'
EXTRA_LIBS += ' -lsqlite3'

# MPI
WITH_MPI = 1
mpi_prefix = ' /soft/openmpi-1.4.3'
MPI_CPPFLAGS = " -I%s/include -pthread -DOMPI_SKIP_MPICXX" % mpi_prefix
MPI_LDFLAGS = " -L%s/lib -Wl,-rpath,%s/lib" % (mpi_prefix,mpi_prefix)


# Python
# DESRES installs Python and numpy in separate path locations; your installation
# will likely install numpy somewhere in the Python path hierarchy
python_prefix = ' /soft/python-2.6.7'
numpy_prefix = " /soft/python-2.6.7/lib/python2.6/site-packages"
EXTRA_INCLUDE_PATH += ' %s/include/python2.6' % python_prefix
EXTRA_LIBRARY_PATH += ' %s/lib' % python_prefix
EXTRA_LINK_FLAGS   += ' -Wl,-rpath,%s/lib' % python_prefix
EXTRA_INCLUDE_PATH += ' %s/numpy/core/include' % numpy_prefix
EXTRA_LIBRARY_PATH += ' %s/numpy/core' % numpy_prefix
EXTRA_LINK_FLAGS   += ' -Wl,-rpath,%s/numpy/core' % numpy_prefix
EXTRA_LIBS += ' -lboost_python -lpython2.6'



Now we can compile and install Desmond with following command:

scons --user-conf=user-conf.sample.py PREFIX=/soft/desmond-3.4/desmond -j4
scons --user-conf=user-conf.sample.py install PREFIX=/soft/desmond-3.4/desmond -j4

If everything goes well, we should see the following from terminal:

scons build done

Testing:
setenv DESMOND_PLUGIN_PATH /soft/desmond-3.4/desmond/lib/plugin
set path=(/soft/desmond-3.4/desmond/bin $path)

desmond --include ./share/samples/dhfr.cfg \
--cfg boot.file=./share/samples/dhfr.dms \
--cfg mdsim.plugin.eneseq.name=dhfr.eneseq

diff dhfr.eneseq ./share/samples/dhfr.eneseq.reference

the values printed should be correspond to steps 160 and 200 and should be identical to the final few lines of values obtained when running the first parallel simulation.


parallel testing:
setenv DESMOND_PLUGIN_PATH /soft/desmond-3.4/desmond/lib/plugin
set path=(/soft/desmond-3.4/desmond/bin $path)

mpirun -np 2 desmond
 --include ./share/samples/dhfr.cfg
--cfg boot.file=./share/samples/dhfr.dms
--cfg mdsim.plugin.eneseq.name=dhfr.eneseq.2
--destrier mpi

diff dhfr.eneseq.2 dhfr.eneseq


The first commands sets an environment variable that determines where Desmond will search for its dynamically loaded plugins.  Using the instructions above there are one or two plugins built that contain 'destriers'.  Destriers implement communication protocols in Desmond with the default protocol being one for a single processor.  The second command runs two mdsim.exe processes using the Open MPI job launcher orterun and the Desmond 'mpi' destrier.  The third command again compares the results obtained from the parallel run with those of the serial run.  Note,that in general these results will be different.


https://blog.sciencenet.cn/blog-355217-661800.html

上一篇:SUSE Linux Enterprise 11 SP3 is on the road
下一篇:SUSE Linux Enterprise 11 SP3 Authorized Beta Program
收藏 IP: 128.178.56.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...
扫一扫,分享此博文

全部作者的精选博文

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-12-22 16:54

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部