Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1068799
  • 博文数量: 264
  • 博客积分: 7225
  • 博客等级: 少将
  • 技术积分: 5096
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-17 08:53
文章分类

全部博文(264)

文章存档

2011年(33)

2010年(52)

2009年(152)

2008年(27)

我的朋友

分类:

2011-05-02 20:16:18

1.将siesta-3.0-rc2.tgz文件拷贝到一个临时的目录里面(如tem)

2.解压文件:$ tar -zxvf 

siesta-3.0-rc2.tgz

3.进入要生成执行文件的目录,可以自己随便建立。这样可以利用不同参数编译
不同版本的siesta 放在不同的目录里。这是与siesta-2.0.2 相比,采用的一种新的
执行文件生成机制,例如到Obj 目录生成执行文件:$ cd siesta-3.0-rc2/Obj/

4. 如果Obj 目录和Src 目录是平级的,运行:$ sh ../Src/obj_setup.sh
总之要在你要生成可执行文件的目录下用sh 运行Src/obj_setup.sh。

5. 在执行文件生成目录里运行Src/configure,即: $ ../Src/configure

6.进入/Src/MPI

7.修改Makefile 

vi Makefile  

ARCH_MAKE_DEFAULT=../arch.make

修改为绝对路径

ARCH_MAKE_DEFAULT=/home/zhou/soft/siesta/siesta-3.0-rc2/Obj/arch.make

8.再make

9.再切换到Obj目录

10.修改arch.make

#
# This file is part of the SIESTA package.
#
# Copyright (c) Fundacion General Universidad Autonoma de Madrid:
# E.Artacho, J.Gale, A.Garcia, J.Junquera, P.Ordejon, D.Sanchez-Portal
# and J.M.Soler, 1996- .
#
# Use of this software constitutes agreement with the full conditions
# given in the SIESTA license, as signed by all legitimate users.
#
.SUFFIXES:
.SUFFIXES: .f .F .o .a .f90 .F90

SIESTA_ARCH=x86_64-unknown-linux-gnu--Intel

FPP=
FPP_OUTPUT=
FC=/public/openmpi-141-icc/bin/mpif90
RANLIB=ranlib

SYS=nag

SP_KIND=4
DP_KIND=8
KINDS=$(SP_KIND) $(DP_KIND)

FFLAGS= -O2 -i-static
FFLAGS_DEBUG= -g
LDFLAGS=-Vaxlib
FPPFLAGS= -DMPI
# -DFC_HAVE_FLUSH -DFC_HAVE_ABORT -DMPI

ARFLAGS_EXTRA=

FCFLAGS_fixed_f=
FCFLAGS_free_f90=
FPPFLAGS_fixed_F=
FPPFLAGS_free_F90=

BLAS_LIBS=-L/public/intel/mkl/lib/em64t -lmkl_solver_lp64 -lmkl_intel_lp64 -lguide
LAPACK_LIBS=-L/public/intel/mkl/lib/em64t -lmkl_sequential -lmkl_core
BLACS_LIBS=-L/public/intel/mkl/lib/em64t -lmkl_blacs_openmpi_lp64
SCALAPACK_LIBS=-L/public/intel/mkl/lib/em64t -lmkl_scalapack_lp64

COMP_LIBS=

NETCDF_LIBS=
NETCDF_INTERFACE=

LIBS=$(SCALAPACK_LIBS) $(BLACS_LIBS) $(LAPACK_LIBS) $(BLAS_LIBS) $(NETCDF_LIBS)

#SIESTA needs an F90 interface to MPI
#This will give you SIESTA's own implementation
#If your compiler vendor offers an alternative, you may change
#to it here.
MPI_INTERFACE=/home/zhou/soft/siesta/siesta-3.0-rc2/Src/MPI/libmpi_f90.a
MPI_INCLUDE=/public/openmpi-141-icc/include

#Dependency rules are created by autoconf according to whether
#discrete preprocessing is necessary or not.
.F.o:
    $(FC) -c $(FFLAGS) $(INCFLAGS) $(FPPFLAGS) $(FPPFLAGS_fixed_F)  $<
.F90.o:
    $(FC) -c $(FFLAGS) $(INCFLAGS) $(FPPFLAGS) $(FPPFLAGS_free_F90) $<
.f.o:
    $(FC) -c $(FFLAGS) $(INCFLAGS) $(FCFLAGS_fixed_f)  $<
.f90.o:
    $(FC) -c $(FFLAGS) $(INCFLAGS) $(FCFLAGS_free_f90)  $<

 

11,make

完成了

 

 这是我根据网上的编译不成功后自己看代码 改的


其实另外一个方法不会这么麻烦 就是我们在Sys目录下编译步骤如下:

1.将siesta-3.0-rc2.tgz文件拷贝到一个临时的目录里面(如tem)
2. tar -zxvf siesta-3.0-rc2.tgz

3 ,cd Syc

4 ,  cd ..

5  ,sh ./obj_setup.sh

6 , ./configure

7 , vi arch.make 内容和上面的一样

8 , cd MPI

9 , make

10 ,cd ..

11 ,make

siesta并行编译不能计算的两种解决方法

已有 629 次阅读 2010-12-8 17:45 |个人分类:生活点滴|系统分类:科研笔记

siesta-3.0-rc2的并行编译
网上很多人反映siesta-3.0-rc2的并行编译的时候没什么问题,但是不能并行计算,并行计算的时候往往会报错。比如堆栈和内存报错等等。这几天闲着没事,对siesta进行了编译,发现确实存在这类问题。
特别是用intel ifort11编译的时候。后来我发现用以下两种方法可以解决siesta并行计算的问题。
(一)如果你坚持要用intel ifort 11来进行编译。可以采取如下方式(siesta网站主页上的方法,见)
在生成的arch.make文件中新加入
DUMMY_FOX= --enable-dummy
FFLAGS_DEBUG= -g -O2
而后在Obj文件夹中的makefile文件修改第148-153行,将这几行写成如下形式
$(FoX_configured):
 (cd FoX; touch arch.make ; \
         CONFIGURE="$(VPATH)/FoX/configure"; \
         $$CONFIGURE VPATH="$(VPATH)/FoX" \
         FC="$(FC_SERIAL)" FCFLAGS="$(FFLAGS_DEBUG)" \
         --enable-wcml $(DUMMY_FOX) || false )
注意(cd FoX; touch arch.make ; \这一行前是一个Tab空格,而不是一个space空格
将这两个地方修改好后,
make clen
make
之后生成的siesta可执行文件并行计算不会出现问题。但要注意的是,arch.make文件中的优化级别是FFLAGS=-g -O2或FFLAGS=-g -O1或FFLAGS=-g -O0,不能是FFLAGS=-g -O3,我试了一下FFLAGS=-g -O3,发现计算过程中出现下面的错误
SPLIT: Orbitals with angular momentum L= 0

SPLIT: Basis orbitals for state 4s

   izeta = 1
                 lambda =    1.000000
                     rc =    6.000769
                 energy =   -0.359899
                kinetic =    0.368794
    potential(screened) =   -0.728693
       potential(ionic) =   -6.200046
WARNING: Minimum split_norm parameter:  0.52689. Will not be able to generate orbital with split_norm =  0.15000
See manual for new split options
ERROR STOP from Node:    0
当改用FFLAGS=-g -O2和FFLAGS=-g -O0或FFLAGS=-g -O1之后则没用出现类似的错误提示,具体原因我就没去深究了。当然不同的优化级别在计算时间上会有一些差异。
比如用FFLAGS=-g -O2时,运行时间如下(用的Fe.fdf例子)
* Running on    8 nodes in parallel
>> Start of run:   6-DEC-2010  17:19:33
>> End of run:   6-DEC-2010  17:27:54
当改用FFLAGS=-g -O0时,运行时间如下(用的Fe.fdf例子)
* Running on    8 nodes in parallel
>> Start of run:   6-DEC-2010  16:48:25
>> End of run:   6-DEC-2010  16:58:58

(二)如果你不使用ifort11编译器,而是使用ifort10或以下的版本,建议配合使用openmpi来进行并行计算。
1)安装openmpi,详细步骤不说了,只是在configure的时候我使用的是如下的命令:
./configure --prefix=要安装的目录 F77=ifort FC=ifort FCFLAGS=-em64t FFLAGS=-em64t
FCFLAGS和FFLAGS是告诉编译器用的是64位的编译器,如果机器不是64位的就不用了。
make
make install
安装完成后还得添加环境变量,至于怎么添加,网上很多,搜索一下就知道了。
2)编译siesta
步骤就写了,大家都知道。下面是我的arch.make文件
#
# This file is part of the SIESTA package.
#
# Copyright (c) Fundacion General Universidad Autonoma de Madrid:
# E.Artacho, J.Gale, A.Garcia, J.Junquera, P.Ordejon, D.Sanchez-Portal
# and J.M.Soler, 1996- .
#
# Use of this software constitutes agreement with the full conditions
# given in the SIESTA license, as signed by all legitimate users.
#
.SUFFIXES:
.SUFFIXES: .f .F .o .a .f90 .F90

SIESTA_ARCH=x86_64-unknown-linux-gnu--unknown

FPP=
FPP_OUTPUT=
FC=mpif90
RANLIB=ranlib

SYS=nag

SP_KIND=4
DP_KIND=8
KINDS=$(SP_KIND) $(DP_KIND)

FFLAGS=-g -O2  #-i-static
FPPFLAGS= -DFC_HAVE_FLUSH -DFC_HAVE_ABORT -DMPI
LDFLAGS=
FFLAGS_DEBUG= -g -O2    # whatever options you might need,guohuazhong
DUMMY_FOX= --enable-dummy # whatever options you might need,guohuazhong

ARFLAGS_EXTRA=

FCFLAGS_fixed_f=
FCFLAGS_free_f90=
FPPFLAGS_fixed_F=
FPPFLAGS_free_F90=


BLAS_LIBS=-L/public/software/intel/Compiler/11.1/059/mkl/lib/em64t -lmkl_intel_lp64 -lmkl_sequential -lmkl_lapack -lmkl_core -lguide -pthread
LAPACK_LIBS=-L/public/software/intel/Compiler/11.1/059/mkl/lib/em64t -lmkl_sequential -lmkl_core -pthread
BLACS_LIBS=-L/public/software/intel/Compiler/11.1/059/mkl/lib/em64t -lmkl_blacs_openmpi_lp64 -pthread
SCALAPACK_LIBS=-L/public/software/intel/Compiler/11.1/059/mkl/lib/em64t -lmkl_scalapack_lp64 -pthread

COMP_LIBS=
COMP_LIBS=dc_lapack.a liblapack.a libblas.a ######guohuazhong screened

NETCDF_LIBS=
NETCDF_INTERFACE=

LIBS=$(SCALAPACK_LIBS) $(BLACS_LIBS) $(LAPACK_LIBS) $(BLAS_LIBS) $(NETCDF_LIBS)

#SIESTA needs an F90 interface to MPI
#This will give you SIESTA's own implementation
#If your compiler vendor offers an alternative, you may change
#to it here.
MPI_INTERFACE=libmpi_f90.a
MPI_INCLUDE=/public/software/mpi/openmpi1.4.2-intel/include

#Dependency rules are created by autoconf according to whether
#discrete preprocessing is necessary or not.
.F.o:
 $(FC) -c $(FFLAGS) $(INCFLAGS) $(FPPFLAGS) $(FPPFLAGS_fixed_F)  $<
.F90.o:
 $(FC) -c $(FFLAGS) $(INCFLAGS) $(FPPFLAGS) $(FPPFLAGS_free_F90) $<
.f.o:
 $(FC) -c $(FFLAGS) $(INCFLAGS) $(FCFLAGS_fixed_f)  $<
.f90.o:
 $(FC) -c $(FFLAGS) $(INCFLAGS) $(FCFLAGS_free_f90)  $<
 
编译成功,祝好运!

阅读(2219) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~