且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Fortran出现MPI错误

更新时间:2023-11-10 15:33:22

您必须将MPI内容(主要是变量)告知编译器.

You must tell the compiler about the MPI stuff (mainly variables).

现代方式正在引入

use mpi

在每个范围内.

过去也使用

include "mpif.h"

但是有几个缺点.即,因为它与FORTRAN 77兼容,所以它没有为任何MPI子例程引入显式接口,因此错误检查不及use mpi彻底.现代方法将帮助您更多地保持代码正确.

but that has several disadvantages. Namely, because it is compatible with FORTRAN 77, it does not introduce explicit interfaces for any MPI subroutines and therefore the error checking is less thorough than with use mpi. The modern method will help you more in keeping your code correct.

另一方面,如果使用use mpi,则必须使用与编译程序相同的编译器(有时甚至使用相同的版本)编译模块mpi.

On the other hand, if you use use mpi the module mpi must be compiled with the same compiler (sometimes even with the same version) which you use to compile your program.