24小时热门版块排行榜    

CyRhmU.jpeg
查看: 1843  |  回复: 10
【奖励】 本帖被评价7次,作者zxzj05增加金币 6.5
当前主题已经存档。
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

[资源] 【分享】ABINIT 并行安装与应用

ABINIT 并行安装
IFORT ,MPICH 安装好,并且在.BASHRC中把路径指好后
在ABINIT目录里运行如下命令

./configure --prefix=/home/abinit FC=mpif90   --enable-mpi=yes
make
make install
就会在/home/abinit的指定路径里找到BIN目录,然后找到可执行文件

##########################################

ABINIT 并行应用

0) ABINIT 并行方法的实施
     - ABINIT 可以应用 K点 ,自旋极化并行,能带并行三种并行算法。对于线性响应理论,可以自动进行能带并行。对于基态能计算,也可以使用能带并行,但是需要额外输入变量来控制,并且使用能带并行和不使用能带并行采用的算法有所不同,而且可能会不稳定。

     K点,自旋极化,能带 并行方法对于线性响应理论基本上可以不受限制的使用,但是如果你进行基态能计算,并且你只用一个K点(这个情况经常出现在大箱子的分子体系,和超过20个原子的大体系),你并行的时候会受到一些限制,只能够使用能带并行,通常4-8个节点或者更少。K点并行方法在通讯上要求较高,所以
对于CLUSTER,需要100M网卡或者1000M网卡。而且如果使用MKMEM=0命令,K点并行时候不会降低每个节点内存的使用(相对于单机)。能带并行方法效率相对低些,但是你可能很高兴使用这个方法,这取决于你的问题和你的机器。

     1) 如何建立ABINIT并行程序
      你应该建立一个makefile_macros文件,这个文件的选择依据你使用的机器有所不同,它们可以在~/abinit/Mach_dept_files 找到。并行成功后产生的ABINIT并行程序名称为ABINIP

     2) 如何使用ABINIT并行程序
     不同测试实例可以在TEST目录里找到。并行命令的使用依据机器的不同可能会不同,通常你需要在命令行里定义机器的进程数,当然你也可以在输入文件中的环境变量里定义。只有在基态能带并行时候,并行版本和单机版本输入文件是一样的。   

     作为并行输入命令机器不同而有所不同
      - 在 CRAY 机器上, 并行命令为
       mpprun -n number_of_processors abinip < files >& log
       or
   mpirun -np number_of_processors abinip < files >& log
        number_of_processors 是进程数

  
     - 在 IBM cluster上, 使用LAM并行程序, 你必须首先引导CLUSTER,使用命令  lamboot cluster_file,然后运行并行命令
   mpirun -w -c number_of_processors abinip < files >& log
      
     - 在 a DEC Cluster, 使用 MPICH并行程序,
   mpirun -np number_of_processors-machinefile cluster_file abinip < files >& log

     
         3) 优化
     与单机版本相比,这里几乎没有另外的速度,内存,硬盘命令提供给使用者     
     - 我们已经知道了如何指定CPU数量,即进程数。
     - 如果你没有把mkmem设置为0 , 不同K点或者自旋极化的波函数会散播到不同的进程(CPU)上,.这样会节省内存的使用。 但是如果你已经把mkmen设置为0,一个K点的波函数都存储到内存,你不会体验到并行带来任何的优势。 你应该注意输入参数"localrdwf"的使用, 它的默认是为0。
     In this case, the default is always
     0, as it is usually more convenient to work with only
     one file, read by one processor, then transmitted to the others.

     4) Usaged of compilation options and keywords for parallelisation

      - if the option -DMPI is introduced in cpp flags, the parallelisation over
        k-points, spin or perturbations is activated.
      - A band/FFT parallelisation can be added to the previous one with the keywords paral_kgb.
        To be activated, band/FFT parallelisation requires the option compilation -DMPI to be present.
        Thus, the work load is split over the two dimensions of a band/FFT 3d cartesian grid.
        By default, this parallelisation is off.
        This parallelisation can not be specified for each datasets.
自己做的简单翻译,可能有很多错误,大家见谅

下面是原文

     Paral_use
     HOW TO RUN THE PARALLEL VERSION OF ABINIT ?
     Copyright (C) 1999-2008 ABINIT group (XG,DCA)
     This file is distributed under the terms of the
     GNU General Public License, see ~abinit/COPYING
     or http://www.gnu.org/copyleft/gpl.txt .
     For the initials of contributors, see ~abinit/doc/developers/contributors.txt .
     
     The reader should have read the ~abinit/doc/users/abinis_help.html file,
     and be sufficiently experienced with the use of the sequential
     code (abinis).
     The parallelisation described in this document is the one
     implemented using MPI. There is another parallelisation,
     in development, based on OpenMP, for SMP machines.
     Since this parallelisation is in development, it is
     not yet described in detail. Let us simply mention that
     it uses comments (parallelisation directives),
     except in the Src_*/rhohxc.f routine,
     for which the -DOPENMP directive should be used at compile time.
     ========================================
     0) Present implementation of parallelism.
     - ABINIT can benefit of parallelism for different k-points and
      spin-polarisation
     - ABINIT can also benefit of parallelism for different bands,
      in the case of response functions, quite automatically.
     - ABINIT can also benefit of parallelism for different bands,
      for the ground-state calculations, but the user has
      to set up a few input variables, and moreover, the algorithm
      that is used is not exactly the same as without band
      parallelism (and might not be as stable).
  
     There is little limitations of this combined approach
     (k-points, spin-polarisation, bands) for
     response functions, but if you are conducting ground-state
     calculations, and if you are using only ONE k-point (which is frequent
     for molecules in a big box, or for large systems - more than
     20 atoms) you will be quite limited, by using the only available
     band parallelisation (typically, 4-8 processors or less).
     The parallelisation over k-points is very efficient in terms
     of communications (so that running
     it on a cluster of workstations linked by an Ethernet
     100 Mbits/sec network is OK). However, it cannot decrease the memory
     needed for each node with respect to the memory of the same
     run in sequential, ran with mkmem=0.
     The parallelisation over bands is less efficient, but you might
     be very happy with it, depending on your problem, and your type
     of machines.
     The library of routines called MPI has been used to implement
     the parallelism. So, MPI must be available on the machine(s)
     you want to use.

     1) How to make the parallel code
     You should set up a makefile_macros file with specific indications
     for parallelism. Presently, there are examples of such files for :
     - SMP machines (DEC/Compaq, CRAY_T3E, SGI Origin, HP, Compaq,
      Fujitsu, Ultrasparc, Intel)
     - cluster running MPI under MPICH (DEC/Compaq, Intel)
     - cluster running MPI under LAM (IBM workstations)
     They can be found in the appropriate subdirectories of the
     ~/abinit/Mach_dept_files directory.
     You might also have to provide a machine-dependent
     mpif.h file also (or more precisely, a link from mpif.h
     in the ~abinit directory to the appropriate mpif.h file).
     Then, supposing that the library archives have already been
     made (nothing special about them in the parallel case) you have to issue :
     make abinip
     This will make 'abinip', the parallel version of ABINIT.

     2) How to use the parallel code.
     
     Different examples are given in the Test_paral directory.
     The command to be used will differ from machine to machine.
     Usually, you will have to define the number of processor
     in the command (alternatively, sometimes, this number
     is specified in an environment variable).
     Except in the case of ground-state band parallelism (see later), the input file
     in the sequential case is the same as in the parallel case.
     For example (compare with the sequential case) :
     - on a CRAY machine, the command line might be
       mpprun -n number_of_processors abinip < files >& log
       or
       mpirun -np number_of_processors abinip < files >& log
       where number_of_processors is the number of processors on which
       the job must be run. The user's path might have to be updated
       to find the commands mpprun or mpirun.
  
     - on an IBM cluster, under LAM, one has first to boot the cluster,
       using a command like
       lamboot cluster_file
       where cluster_file is a file that contains the name of machines
       belonging to the cluster. Then, one will issue
       mpirun -w -c number_of_processors abinip < files >& log
       where number_of_processors is the number of processors on which
       the job must be run. The user's path might have to be updated
       to find the command mpirun. Then, one might have to wipe the cluster :
       wipe cluster_file
     - on a DEC cluster, under MPICH, one will issue
       mpirun -np number_of_processors                           \ (continued)
            -machinefile cluster_file abinip < files >& log
       where cluster_file is a file that contains the name of machines
       belonging to the cluster, and number_of_processors is the
       number of processors on which
       the job must be run. The user's path might have to be updated
       to find the command mpirun.
     
     When running on a cluster, one might have to pay attention to
     paths for files in the "files" file. Depending on the way the
     cluster is set up, one might be forced to use absolute paths
     for these file names instead of relative paths.
     The "log" file is actually closed by each processor, at the
     very beginning of the run, and a new file, different
     for each processor, is created. Its name
     is derived from the tmp root name,
     followed by "LOG", and the number of the processor.
     In order to use the band parallelism for the ground-state,
     you need to use the following input variables :
     wfoptalg 1
     nbdblock  (to be set to the number of processors
                you would like to use to treat one k point,
                typically 4-8, higher might cause unstabilities)
     See Test_v3#41 for an example.

     3) Optimisation
     Compared with the sequential version, there is nearly no
     additional tuning of speed, memory or disk usage to be
     done by the user.
     
     - We have already seen how to define the number of processor.
     - In the case you have not set mkmem 0 , the wavefunctions
      belonging to different k points and/or spin polarization
      will be spread on the different processors. This will save
      a lot of memory. However, if you are already only storing
      the wavefunctions of one k point in core memory, and using
      files for the other k points (input variable mkmem set to 0),
      then, you will gain nothing thanks to the use of the
      parallelism.
     - One might also pay attention to the input variable
     "localrdwf", for which the above-mentioned issue is
     also important, although less critical for cluster machines.
     In this case, the default is always
     0, as it is usually more convenient to work with only
     one file, read by one processor, then transmitted to the others.

     4) Usaged of compilation options and keywords for parallelisation

      - if the option -DMPI is introduced in cpp flags, the parallelisation over
        k-points, spin or perturbations is activated.
      - A band/FFT parallelisation can be added to the previous one with the keywords paral_kgb.
        To be activated, band/FFT parallelisation requires the option compilation -DMPI to be present.
        Thus, the work load is split over the two dimensions of a band/FFT 3d cartesian grid.
        By default, this parallelisation is off.
        This parallelisation can not be specified for each datasets.

[ Last edited by zxzj05 on 2009-3-21 at 15:54 ]
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

beyondstar

木虫 (正式写手)


呵呵,转发我博客上的
4楼2009-03-25 12:40:04
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 11 个回答

tjpm

金虫 (正式写手)


★★★ 三星级,支持鼓励

我昨天也自己编译了abinit
对于这个是新手,还不大会用。
安装到比较简单吧
我先编译并行版本的时候mpif90编译的很慢,也不知道是杂的/
后来就只用ifort编译的
2楼2009-03-21 17:25:57
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

狼狼乾坤

铁杆木虫 (职业作家)


★★★★★ 五星级,优秀推荐

好复杂好复杂~
3楼2009-03-22 19:32:52
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

zk2004707

木虫 (小有名气)


我的5.8.2的版本在suse linux10.2系统下却并行不了,郁闷
9楼2009-09-15 10:54:26
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
☆ 无星级 ★ 一星级 ★★★ 三星级 ★★★★★ 五星级
普通表情 高级回复(可上传附件)
信息提示
请填处理意见