Cygwin mpi 代码运行报错,请问是安装时少选择了文件吗?

图片说明

Cygwin mpi 代码运行报错,请问是安装时少选择了文件吗?

Fortran90代码如下:

PROGRAM TUTE2Q1
IMPLICIT NONE
INCLUDE 'mpif.h'

! Variable declartion
INTEGER :: i,pid,nprocs,ierr

CALL MPI_INIT(ierr)                                                      ! Initialize MPI Program
CALL MPI_COMM_SIZE(MPI_COMM_WORLD,nprocs,ierr) ! Get Size of Communicator (Number of procs)
CALL MPI_COMM_RANK(MPI_COMM_WORLD,pid,ierr)      ! Get Rank of Communicator (proc id)

! If root write header
IF (pid.EQ.0) THEN
    WRITE(*,1100) "N Procs","PID","Message"
ENDIF

! Synchronize
CALL MPI_BARRIER(MPI_COMM_WORLD,ierr)

! Write out sequentially
DO i = 0,nprocs-1
    IF (pid.EQ.i) THEN
        ! Write out data
        WRITE(*,1200) nprocs,pid,"Hello World"  
    ENDIF
    ! Synchronize
    CALL MPI_BARRIER(MPI_COMM_WORLD,ierr)
ENDDO   

1100 FORMAT(3(A12,1x))
1200 FORMAT(2(I12.1,1x),A12)    

! Finalize MPI program
CALL MPI_FINALIZE(ierr)

END PROGRAM TUTE2Q1

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问