This is really new to me. I am testing this hello world code on a machine.
program hello
include 'mpif.h'
integer rank, size, ierror, tag, status(MPI_STATUS_SIZE)
character(12) message
call MPI_INIT(ierror)
call MPI_COMM_SIZE(MPI_COMM_WORLD, size, ierror)
call MPI_COMM_RANK(MPI_COMM_WORLD, rank, ierror)
tag = 100
if(rank .eq. 0) then
message = 'Hello, world'
do i=1, size-1
call MPI_SEND(message, 12, MPI_CHARACTER, i, tag,&
MPI_COMM_WORLD, ierror)
enddo
else
call MPI_RECV(message, 12, MPI_CHARACTER, 0, tag,&
MPI_COMM_WORLD, status, ierror)
endif
write(*,*) 'node', rank, ':', message
call MPI_FINALIZE(ierror)
end program hello
I used mpif90 to compile it and submitted the job with 4 nodes. And this is what the output file looks like:
nodenodenode 2 1 0:: Hello, worldHello, world:Hello, world
node 3 :Hello, world
So I am really worried about this format. Again I don't have much experience with MPI. I tested it on another machine and it looked like this:
node 1 :Hello, world
node 0 :Hello, world
node 2 :Hello, world
node 3 :Hello, world
Could you tell me if this is an unusual output or it really just differs from machine to machine? Thank you so much. ~