(1)中的数组规范在mpif-sizeof.h中具有超过7个维度 [英] Array specification at (1) has more than 7 dimensions in mpif-sizeof.h

查看:98
本文介绍了(1)中的数组规范在mpif-sizeof.h中具有超过7个维度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下清单文件:

BIN_SUFFIX = cpu
OMP_FLAGS = -p
OPT_FLAGS = -ofast
compiler = mpifort
compiler = mpif90


#used in gfortran
MISC_FLAGS = -ffree-line-length-300 #

CFLAGS += $(OPT_FLAGS)
CFLAGS += $(OMP_FLAGS)
CFLAGS += $(MISC_FLAGS)

LFLAGS = $(CFLAGS)

COMPILE = ${compiler} -c
LINK = ${compiler}

objects = Main_multiphase.o Main_singlephase.o Module.o Init_multiphase.o Init_singlephase.o Misc.o IO_multiphase.o IO_singlephase.o Kernel_multiphase.o Kernel_singlephase.o Mpi_misc.o Mpi_pdf.o Mpi_pdf_acc.o Boundary_singlephase.o Boundary_singlephase_special_case.o Boundary_multiphase_inlet.o Boundary_multiphase_outlet.o Boundary_multiphase_other.o Boundary_multiphase_special_case.o Monitor.o Phase_gradient.o Monitor_special_case.o
LBM : $(objects)    
    ${LINK} $(LFLAGS) -o MF_LBM.$(BIN_SUFFIX) $(objects) 

Module.o : Module.F90
    ${COMPILE} $(CFLAGS) Module.F90
Main_multiphase.o : Main_multiphase.F90 Module.o
    ${COMPILE} $(CFLAGS) Main_multiphase.F90
Main_singlephase.o : Main_singlephase.F90 Module.o
    ${COMPILE} $(CFLAGS) Main_singlephase.F90
Misc.o : Misc.F90 Module.o  
    ${COMPILE} $(CFLAGS) Misc.F90
Monitor.o : Monitor.F90 Module.o    
    ${COMPILE} $(CFLAGS) Monitor.F90
Monitor_special_case.o : Monitor_special_case.F90 Module.o  
    ${COMPILE} $(CFLAGS) Monitor_special_case.F90
Boundary_multiphase_inlet.o : Boundary_multiphase_inlet.F90 Module.o    
    ${COMPILE} $(CFLAGS) Boundary_multiphase_inlet.F90
Boundary_multiphase_outlet.o : Boundary_multiphase_outlet.F90 Module.o  
    ${COMPILE} $(CFLAGS) Boundary_multiphase_outlet.F90
Boundary_multiphase_other.o : Boundary_multiphase_other.F90 Module.o    
    ${COMPILE} $(CFLAGS) Boundary_multiphase_other.F90
Boundary_multiphase_special_case.o : Boundary_multiphase_special_case.F90 Module.o  
    ${COMPILE} $(CFLAGS) Boundary_multiphase_special_case.F90
Boundary_singlephase.o : Boundary_singlephase.F90 Module.o  
    ${COMPILE} $(CFLAGS) Boundary_singlephase.F90
Boundary_singlephase_special_case.o : Boundary_singlephase_special_case.F90 Module.o    
    ${COMPILE} $(CFLAGS) Boundary_singlephase_special_case.F90
Kernel_multiphase.o : Kernel_multiphase.F90 Module.o    
    ${COMPILE} $(CFLAGS) Kernel_multiphase.F90
Kernel_singlephase.o : Kernel_singlephase.F90 Module.o  
    ${COMPILE} $(CFLAGS) Kernel_singlephase.F90
Init_multiphase.o : Init_multiphase.F90 Module.o
    ${COMPILE} $(CFLAGS) Init_multiphase.F90
Init_singlephase.o : Init_singlephase.F90 Module.o
    ${COMPILE} $(CFLAGS) Init_singlephase.F90
IO_multiphase.o : IO_multiphase.F90 Module.o
    ${COMPILE} $(CFLAGS) IO_multiphase.F90
IO_singlephase.o : IO_singlephase.F90 Module.o
    ${COMPILE} $(CFLAGS) IO_singlephase.F90
Phase_gradient.o : Phase_gradient.F90 Module.o
    ${COMPILE} $(CFLAGS) Phase_gradient.F90
Mpi_misc.o : Mpi_misc.F90 Module.o
    ${COMPILE} $(CFLAGS) Mpi_misc.F90
Mpi_pdf.o : Mpi_pdf.F90 Module.o
    ${COMPILE} $(CFLAGS) Mpi_pdf.F90
Mpi_pdf_acc.o : Mpi_pdf_acc.F90 Module.o
    ${COMPILE} $(CFLAGS) Mpi_pdf_acc.F90

clean:
    rm -f *.o *.mod
    rm MF_LBM.$(BIN_SUFFIX)

当我运行以下命令: make 时,出现以下错误:

When I run the following command: make, I get the following errors:

$ make
mpif90  -c   -ofast -p -ffree-line-length-300   Main_multiphase.F90
Main_multiphase.F90:485:0:

 #endif

Warning: null character(s) ignored
mpif-sizeof.h:66:41:

Error: Array specification at (1) has more than 7 dimensions
mpif-sizeof.h:72:41:

Error: Array specification at (1) has more than 7 dimensions
mpif-sizeof.h:78:41:

Error: Array specification at (1) has more than 7 dimensions
mpif-sizeof.h:84:41:

Error: Array specification at (1) has more than 7 dimensions
mpif-sizeof.h:90:41:

.
.
.

Error: Ambiguous interfaces in generic interface 'mpi_sizeof' for ‘mpi_sizeof_real64_r14’ at (1) and ‘mpi_sizeof_real64_r15’ at (2)
mpif-sizeof.h:2631:39:

mpif-sizeof.h:2638:39:

Error: Ambiguous interfaces in generic interface 'pmpi_sizeof' for ‘pmpi_sizeof_real64_r14’ at (1) and ‘pmpi_sizeof_real64_r15’ at (2)
mpif-sizeof.h:1315:38:

mpif-sizeof.h:1322:38:

Error: Ambiguous interfaces in generic interface 'mpi_sizeof' for ‘mpi_sizeof_real64_r14’ at (1) and ‘mpi_sizeof_real64_r15’ at (2)
mpif-sizeof.h:2631:39:

mpif-sizeof.h:2638:39:

Error: Ambiguous interfaces in generic interface 'pmpi_sizeof' for ‘pmpi_sizeof_real64_r14’ at (1) and ‘pmpi_sizeof_real64_r15’ at (2)
make: *** [makefile:43: Main_multiphase.o] Error 1

我安装了以下版本的Fortran:

I have the following version of Fortran installed:

$ mpif90 --version
GNU Fortran (GCC) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

是由于编译器不兼容引起的此问题吗?我的系统正在运行Windows 10 64位版本,并且我正在使用Cygwin.

Is this issue due to the incompatibility of the compiler? My system is running Windows 10 64-bit version and I am using Cygwin.

在Cygwin中安装Openmpi

Openmpi installation in Cygwin

推荐答案

正如我们在注释中解决的那样,您需要使用与所使用的OpenMPI兼容的编译器,或者以其他方式使用与OpenMPI兼容的编译器.MPI的标头 mpif.h 标头不仅包含对gfortran 7排名过多的数组声明,而且一旦使用了更现代的Fortran功能,您还将遇到数组描述符和因此模块文件不兼容.

As we resolved in the comments you need to use the compiler compatible with OpenMPI you are using or the other way use the compiler compatible with your OpenMPI. Not only the header mpif.h headers of your MPI contain declarations of arrays with too many ranks for gfortran 7, but once you would use more modern Fortran features you would also hit the incompatibility of the array descriptors and hence the incompatibility of module files.

当您尝试使用更现代的功能,例如 use mpi use mpi_f08 而不是 include"mpif.h"时,这种不兼容性将变得更加明显..如果MPI库中的模块文件来自不兼容的版本,则它们将立即被编译器拒绝.必须为确切的主编译器版本编译MPI库.这也意味着,现代化应用程序将无法解决您当前的问题.

That incompatibility will become even apparent when you try to use the more modern features like use mpi or use mpi_f08 instead of include "mpif.h". The module files from the MPI library will be immediately rejected by the compiler if they come from an incompatible version. The MPI library must be compiled for the exact main compiler version. That also means that modernizing your application will not fix your current problem.

您的项目中还有一个模块文件 .mod.,该文件使用的模块版本为14,由gfortran 5制作.此文件将与任何其他gfortran版本不兼容.您将需要重新编译它.如果您拥有源代码,只需删除项目中的所有 .mod 文件.如果没有源文件,则需要获取它.

There is also a module file .mod. in your project, that uses module version 14 and was made by gfortran 5. This file will be incompatible with any other gfortran version. You will need to have it recompiled. If you ave the source code, just delete all .mod files in your project. If you do not have the source files, you need to get it.

这篇关于(1)中的数组规范在mpif-sizeof.h中具有超过7个维度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆