私は、各ノードが16のプロセッサを持つクラスタで作業しています。 Open MPIの私のバージョンは 1.5.3です。その後、私はコードをコンパイルmpirunは2つのノードで動作しません
program MAIN
implicit none
include 'mpif.h'
integer status(MPI_STATUS_SIZE)
integer ierr,my_rank,size
integer irep, nrep, iex
character*1 task
!Initialize MPI
call mpi_init(ierr)
call mpi_comm_rank(MPI_COMM_WORLD,my_rank,ierr)
call mpi_comm_size(MPI_COMM_WORLD,size,ierr)
do iex=1,2
if(my_rank.eq.0) then
!Task for the master
nrep = size
do irep=1,nrep-1
task='q'
print *, 'master',iex,task
call mpi_send(task,1,MPI_BYTE,irep,irep+1,
& MPI_COMM_WORLD,ierr)
enddo
else
!Here are the tasks for the slaves
!Receive the task sent by the master node
call mpi_recv(task,1,MPI_BYTE,0,my_rank+1,
& MPI_COMM_WORLD,status,ierr)
print *, 'slaves', my_rank,task
endif
enddo
call mpi_finalize(ierr)
end
:
/usr/lib64/openmpi/bin/mpif77 -o test2 test2.f
と私のnodefileはこのようになります
/usr/lib64/openmpi/bin/mpirun -np 32 -hostfile nodefile test2
でそれを実行します。
私はFortranで、次の簡単なコードを書かれていますnode1
node1
...
node2
node2
...
node1とdノード2はそれぞれ16回繰り返されます。
正常にコンパイルできます。私がそれを-np 16(1つのノードだけ)で動かすと、 :各スレーブはタスクを完了し、ターミナルでプロンプトを返します。しかし、私が-np 32を試してみると、すべての奴隷が の仕事を終えたわけではなく、16人だけです。
実際には32ノードでプログラムは私に プロンプトを返さないので、プログラムがどこかに積み重なっていると思って、 タスクが実行されるのを待っています。
私はこの 些細な問題にいくつかの時間を費やしている限り、あなたから任意のコメントを受け取りたい。
ありがとうございました。
node0:16 node1:16 – peaceman