When i run an "Open MPI" program, it generally assigns ranks in random order I want to know is there a way to always assign ranks in order?
So instead of this
Hello, World. I am 2 of 3
Hello, World. I am 0 of 3
Hello, World. I am 1 of 3
can i get this
Hello, World. I am 0 of 3
Hello, World. I am 1 of 3
Hello, World. I am 2 of 3
EDIT
here is the code
PROGRAM hello
INCLUDE 'mpif.h'
INTEGER*4 :: numprocs, rank, ierr
CALL MPI_INIT(ierr)
CALL MPI_COMM_SIZE(MPI_COMM_WORLD, numprocs, ierr)
CALL MPI_COMM_RANK(MPI_COMM_WORLD, rank, ierr)
write(*,*) 'Hello World. I am', rank, 'of', numprocs
CALL MPI_FINALIZE(ierr)
END PROGRAM hello
I have tested it on i5 processor (4 threads) when i run
mpirun -np 4 myprog
it works as i want it to, ranks printed in order 0-3, otherwise (like with 3 as shown above) it just wont do it (tested it like 100 time)