文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>NPB(nas parallel benchmark 的配置)

NPB(nas parallel benchmark 的配置)

时间:2007-05-02  来源:greek_zjb

NPB(nas parallel benchmark)是nasa提供的,用于评估并行超级计算机性能的测试程序,它是一套测试程序集。关于编译和安装过程我在这里就不说明了,README文件中有详细的过程。这里简单说一下关于该工程下用于编译的一个make依赖文件(make.def)的写法。 NPB提供的make.def文件已有的内容如下: #---------------------------------------------------------------------------
# This is the fortran compiler used for MPI programs
#---------------------------------------------------------------------------
MPIF77 = f77 (指定fortran的编译器)
# This links MPI fortran programs; usually the same as ${MPIF77}
FLINK = f77 (指定fortran的连接器)
#---------------------------------------------------------------------------
# These macros are passed to the linker to help link with MPI correctly
#---------------------------------------------------------------------------
FMPI_LIB  = -L/usr/local/lib -lmpi (指定mpi库的所在位置,通常名字为libmpich.a,静态库,注意:这里还要增加一个库:libpthread.a,因为NPB程序用到了pthread的相关函数)
#---------------------------------------------------------------------------
# These macros are passed to the compiler to help find 'mpif.h'
#---------------------------------------------------------------------------
FMPI_INC = -I/usr/local/include(指定mpif.h的所在目录)
#---------------------------------------------------------------------------
# Global *compile time* flags for Fortran programs
#---------------------------------------------------------------------------
FFLAGS = -O3 (编译选项)
# FFLAGS = -g
#---------------------------------------------------------------------------
# Global *link time* flags. Flags for increasing maximum executable
# size usually go here.
#---------------------------------------------------------------------------
FLINKFLAGS =(连接选项)
#---------------------------------------------------------------------------
# This is the C compiler used for MPI programs
#---------------------------------------------------------------------------
MPICC = cc(指定C语言的编译器)
# This links MPI C programs; usually the same as ${MPICC}
CLINK = cc(指定C语言的连接器)
#---------------------------------------------------------------------------
# These macros are passed to the linker to help link with MPI correctly
#---------------------------------------------------------------------------
CMPI_LIB  = -L/usr/local/lib -lmpi(指定mpi库的所在位置,通常名字为libmpich.a,静态库,注意:这里还要增加一个库:libpthread.a,因为NPB程序用到了pthread的相关函数)
#---------------------------------------------------------------------------
# These macros are passed to the compiler to help find 'mpi.h'
#---------------------------------------------------------------------------
CMPI_INC = -I/usr/local/include(指定mpi.h的所在目录)
#---------------------------------------------------------------------------
# Global *compile time* flags for C programs
#---------------------------------------------------------------------------
CFLAGS = -O3 (编译选项)

# CFLAGS = -g
#---------------------------------------------------------------------------
# Global *link time* flags. Flags for increasing maximum executable
# size usually go here.
#---------------------------------------------------------------------------
CLINKFLAGS =(连接选项)
  这个原有的内容说的已经很清楚了。其中bold部分是我家进去的内容。最重要一点就是关于libpthread.a的连接。因为文档中没有提及,所以容易被忽略掉。   改好这个文件之后,就可以开始编译了。:) 还要注意的就是NPB套件中的各个程序,在编译时要指定运行在多少个cpu之上的。不同的程序运行的cpu个数不同,原文所说的:Some benchmarks (cg, ft, mg, lu, is) run on a
   power-of-2 number of processes. Others (sp, bt) run on a square number
   of processes (1, 4, 9, ...)就是这个意思。编译时注意一下。
当编译好一个程序运行在2个cpu后,例如程序is,运行的方法为: mpirun -np 2 is.A.2 其中A为is程序被编译的类别,2表示运行在两个cpu之上。 好了就这么多了。
相关阅读 更多 +
排行榜 更多 +
追漫大师兄

追漫大师兄

浏览阅读 下载
手画攀爬者

手画攀爬者

休闲益智 下载
共享亿客

共享亿客

购物比价 下载