각 노드에 16 개의 프로세서가있는 클러스터에서 작업하고 있습니다. Open MPI의 내 버전은 입니다. 1.5.3. 내가 포트란에 다음과 같은 간단한 코드를 작성했습니다 :mpirun이 두 노드에서 작동하지 않습니다
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
및
/usr/lib64/openmpi/bin/mpirun -np 32 -hostfile nodefile test2
내 nodefile로 실행 다음과 같습니다
node1
node1
...
node2
node2
...
with node1 d 노드 2는 각각 16 번 반복됩니다.
나는 성공적으로 컴파일 할 수있다. 내가 -np 16 (한 노드 만)을 실행하면 이 작동합니다. 각 슬레이브는 작업을 완료하고 터미널에서 프롬프트를 다시 얻습니다. 하지만 내가 -np 32를 시도 할 때 모든 노예가 노예를 끝내지는 않는다.
실제로 32 개 노드로 프로그램은 나를 프롬프트로 다시 보내지 않으므로 어딘가에 프로그램이 스택되어있어 어떤 작업을 수행 할 때까지 기다리는 중입니다.
이 질문에 대한 답변을 드리겠습니다. 사소한 문제.
감사합니다.
시도해보십시오. node0 : 16 node1 : 16 – peaceman