Hello there,
In my fortran code, I used mpi_bcast to broadcast an array Q(21, 51,
14) (the size for it is 150,000,000) from the root to all the nodes. I
found when I used this bcast subroutine, it code will be very slow and
sometimes it hangs there. Once I commented this array, this code speed
Hello,
I'm trying to run this bit of code:
program test
use mpi
integer :: ierr, myrank, a(2) = 0
call MPI_Init(ierr)
call MPI_Comm_rank(MPI_COMM_WORLD,myrank,ierr)
if (myrank == 0) a(1) = 1; a(2) = 2
if (myrank == 1) a(1) = 3; a(2) = 4
call
MPI_Allreduce(MPI_IN_PLACE,a,2,MPI_INTEGER,MPI_SUM,MPI_
Hello,
Your syntax defining 'a' is not correct. This code works correctly.
program test
use mpi
integer :: ierr, myrank, a(2) = 0
call MPI_Init(ierr)
call MPI_Comm_rank(MPI_COMM_WORLD,myrank,ierr)
if (myrank == 0) then
a(1) = 1
a(2) = 2
else
a(1) = 3
a(2) = 4
endif
call
MPI_Allreduce(MPI_IN_
Thanks for the input but it still doesn't work for me... Here's the
version without MPI_IN_PLACE that does work:
program test
use mpi
integer :: ierr, myrank, a(2), a_loc(2) = 0
call MPI_Init(ierr)
call MPI_Comm_rank(MPI_COMM_WORLD,myrank,ierr)
if (myrank == 0) then
a_loc(1) = 1
a_loc(2) = 2