简体   繁体   English

是否可以使用 gfortran 和 openmpi 在 Linux 中编译 NASA Parallel Benchmarks (NPB) 文件?

[英]Is it possible to compile NASA Parallel Benchmarks (NPB) files in Linux using gfortran and openmpi?

I am attempting to run NPB benchmarking on my RHEL7.3 install but come into a similar issue as the question asked here我正在尝试在我的 RHEL7.3 安装上运行 NPB 基准测试,但遇到了与此处提出的问题类似的问题

Error while building NAS benchmarks 构建 NAS 基准测试时出错

Trying to make the BT benchmark, which is in fortran, I get the following error:尝试使用 fortran 进行 BT 基准测试时,出现以下错误:

cd BT; make NPROCS=16 CLASS=W SUBTYPE= VERSION=
make[1]: Entering directory '/mnt/npb_install/NPB3.3-MPI/BT'
make[2]: Entering directory '/mnt/npb_install/NPB3.3-MPI/sys'
make[2]: Nothing to be done for 'all'
make[2]: Leaving directory '/mnt/npb_install/NPB3.3-MPI/sys'
../sys/setparams bt 16 W
make[2]: Entering directory '/mnt/npb_install/NPB3.3-MPI/BT'
make[3]: Entering directory '/mnt/npb_install/NPB3.3-MPI/BT'
gfortran -O -o ../bin/bt.W.16 bt.o make_set.o initialize.o exact_solution.o exact_rhs.o set_constants.o adi.o define.o copy_faces.o rhs.o solve_subs.o x_solve.o y_solve.o z_solve.o add.o error.o verifiy.o setup_mpi.o ../common/print_results.o ../common/timers.o btio.o -L/usr/lib/openmpi-x84_64/ -lmpi
/bin/ld: cannot find -lmpi
collect2: error: ld returned 1 exit status
make[3]: *** [bt-bt] Error 1
make[3]: Leaving direc.......

However I am not using Intel MPI but rather OpenMPI, though I don't full understand the implication of that.然而,我没有使用英特尔 MPI,而是使用 OpenMPI,尽管我不完全理解它的含义。

My make.def file has the following mpi related settings我的 make.def 文件有以下与 mpi 相关的设置

#-------------------------------------
# This is the fortran compiler usedd for MPI programs
#-----------------------------------------
MPIF77 = gfortran
# This links MPI fortran programs; usually the same as ${MPIF77}
FLINK = ${MPIF77}

#------------------------------------------
# These macros are passed to the linker to help link with MPI correctly
#-------------------------------------------
FMPI_LIB = -L/usr/lib/openmpi/lib/ -lmpi

#-----------------------------------------
# These macros are passed to the compiler to help find 'mpif.h'
#------------------------------------------
FMPI_INC = -I/usr/include/openmpi-x86_64/

Similar to those posted in the above question.类似于上面问题中发布的那些。

From the error, I assume that the input parameters -lmpi is not a valid input parameter for gfortran when compiling but removing it leads to a screen full of undefined references like:从错误中,我假设输入参数 -lmpi 在编译时不是 gfortran 的有效输入参数,但删除它会导致屏幕充满未定义的引用,例如:

 file.f:(.text+0x123): undefined reference to 'mpi_whatever_'

Is it possible to compile NPB with gfortran?是否可以使用 gfortran 编译 NPB? Or am I clearly doing something wrong here?或者我在这里显然做错了什么? I have seen that using ifort is another option but I thought I'd ask the question before moving towards that possible solution我已经看到使用 ifort 是另一种选择,但我想我会在转向可能的解决方案之前提出这个问题

After hacking at it I resolved the issue with the following fixes, not sure what did it.在对它进行黑客攻击后,我通过以下修复解决了该问题,但不确定它做了什么。

OpenMPI may have not been installed properly (was unable to call mpicc or other wrappers/comps), to fix it I ran the following commands OpenMPI 可能没有正确安装(无法调用 mpicc 或其他包装器/comps),为了修复它,我运行了以下命令

module avail
#displayed the openmpi-x86_64 module
module add open-x86_64
which mpirun
#displayed location of mpirun

The more likely fix was simply changing gfortran in the make.def file to mpif77更可能的解决方法是将 make.def 文件中的gfortran更改为mpif77

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM