MPI(Message-Passing Interface)ライブラリを使った並列プログラミングに関するコミュです。
なかったので、作ってみました。
誰か入るんかいな。
バージョン:1.0, 2.0, 3.0
Program hellompi
include 'mpif.h'
integer istatus(MPI_STATUS_SIZE)
call MPI_Init(ierr)
call MPI_Comm_rank(MPI_COMM_WORLD, Nrank, ierr)
call MPI_Comm_size(MPI_COMM_WORLD, Nproc, ierr)
if (Nrank /= 0) then
call MPI_Send(Nrank, 1, MPI_INTEGER, 0, 0, MPI_COMM_WORLD, ierr)
else
write(*,*) "Hello MPI I'm Rank 0"
do Nsrc=1,NProc-1
call MPI_Recv(Nrank, 1, MPI_INTEGER, Nsrc, 0, MPI_COMM_WORLD, istatus, ierr)
write(*,*) "Hello MPI from Adress", Nrank
end do
end if
call MPI_Finalize(ierr);
End Program