Linux环境模块或Conda环境

时间:2018-06-01 17:19:58

标签: mpi conda environment mpich environment-modules

我寻找Linux环境模块或Conda环境之间的区别,但我不清楚它们有何不同。基本上,我想在我的Ubuntu中安装OpenMPI和Mpich,但是它们共享几个编译器包装器。为了安全起见,我想隔离它们,那么我应该使用什么 - 模块或Conda环境或任何其他替代方案?

另外,如果我使用Conda Environment,我可以将编译后的软件二进制文件限制在环境中吗?我很惊讶我在基础环境中安装了一些软件,但我能够从另一个环境访问。

1 个答案:

答案 0 :(得分:0)

Environment Modules旨在使用户能够使用默认环境中不可用的软件。根据您的情况,您可以在隔离的路径中同时安装OpenMPI和Mpich,然后使用模块文件,用户可以启用他们选择的MPI版本。

例如,这是在Fedora系统上安装openmpimpich时默认提供的:

$ module show mpi/mpich-x86_64 
-------------------------------------------------------------------
/etc/modulefiles/mpi/mpich-x86_64:

conflict        mpi
setenv          MPI_BIN /usr/lib64/mpich/bin
setenv          MPI_SYSCONFIG   /etc/mpich-x86_64
setenv          MPI_FORTRAN_MOD_DIR     /usr/lib64/gfortran/modules/mpich
setenv          MPI_INCLUDE     /usr/include/mpich-x86_64
setenv          MPI_LIB /usr/lib64/mpich/lib
setenv          MPI_MAN /usr/share/man/mpich-x86_64
setenv          MPI_PYTHON_SITEARCH     /usr/lib64/python2.7/site-packages/mpich
setenv          MPI_PYTHON2_SITEARCH    /usr/lib64/python2.7/site-packages/mpich
setenv          MPI_PYTHON3_SITEARCH    /usr/lib64/python3.6/site-packages/mpich
setenv          MPI_COMPILER    mpich-x86_64
setenv          MPI_SUFFIX      _mpich
setenv          MPI_HOME        /usr/lib64/mpich
prepend-path    PATH /usr/lib64/mpich/bin
prepend-path    LD_LIBRARY_PATH /usr/lib64/mpich/lib
prepend-path    MANPATH /usr/share/man/mpich-x86_64
prepend-path    PKG_CONFIG_PATH /usr/lib64/mpich/lib/pkgconfig
-------------------------------------------------------------------
$ module show mpi/openmpi-x86_64 
-------------------------------------------------------------------
/usr/share/modulefiles/mpi/openmpi-x86_64:

conflict        mpi
prepend-path    PATH /usr/lib64/openmpi/bin
prepend-path    LD_LIBRARY_PATH /usr/lib64/openmpi/lib
prepend-path    PKG_CONFIG_PATH /usr/lib64/openmpi/lib/pkgconfig
prepend-path    MANPATH /usr/share/man/openmpi-x86_64
setenv          MPI_BIN /usr/lib64/openmpi/bin
setenv          MPI_SYSCONFIG   /etc/openmpi-x86_64
setenv          MPI_FORTRAN_MOD_DIR     /usr/lib64/gfortran/modules/openmpi
setenv          MPI_INCLUDE     /usr/include/openmpi-x86_64
setenv          MPI_LIB /usr/lib64/openmpi/lib
setenv          MPI_MAN /usr/share/man/openmpi-x86_64
setenv          MPI_PYTHON_SITEARCH     /usr/lib64/python2.7/site-packages/openmpi
setenv          MPI_PYTHON2_SITEARCH    /usr/lib64/python2.7/site-packages/openmpi
setenv          MPI_PYTHON3_SITEARCH    /usr/lib64/python3.6/site-packages/openmpi
setenv          MPI_COMPILER    openmpi-x86_64
setenv          MPI_SUFFIX      _openmpi
setenv          MPI_HOME        /usr/lib64/openmpi
-------------------------------------------------------------------