- #1
natski
- 267
- 2
Hi all,
I have been running mpi fortran code on Linux based systems without any trouble for some time but making the same code run on a Mac is causing me some headaches. I installed mpi using the guide at: http://www.macresearch.org/compiling-mpi-f90-support-snow-leopard
I am trying to run some simple "hello world" code:
! Fortran example
program hello
include 'mpif.h'
integer rank, size, ierror, tag, status(MPI_STATUS_SIZE)
call MPI_INIT(ierror)
call MPI_COMM_SIZE(MPI_COMM_WORLD, size, ierror)
call MPI_COMM_RANK(MPI_COMM_WORLD, rank, ierror)
print*, 'node', rank, ': Hello world'
call MPI_FINALIZE(ierror)
end
Compiling with mpif90 -o mpihello mpihello.f90 and then executing with mpirun -np 4 mpihello I get...
node 0 : Hello world
node 0 : Hello world
node 0 : Hello world
node 0 : Hello world
So essentially I am calling node 0 four times rather than actually parallelizing anything. Has anyone else encountered this problem? The same code runs fine on Linux FYI. Any tips/suggestions would be extremely appreciated!
Natski
I have been running mpi fortran code on Linux based systems without any trouble for some time but making the same code run on a Mac is causing me some headaches. I installed mpi using the guide at: http://www.macresearch.org/compiling-mpi-f90-support-snow-leopard
I am trying to run some simple "hello world" code:
! Fortran example
program hello
include 'mpif.h'
integer rank, size, ierror, tag, status(MPI_STATUS_SIZE)
call MPI_INIT(ierror)
call MPI_COMM_SIZE(MPI_COMM_WORLD, size, ierror)
call MPI_COMM_RANK(MPI_COMM_WORLD, rank, ierror)
print*, 'node', rank, ': Hello world'
call MPI_FINALIZE(ierror)
end
Compiling with mpif90 -o mpihello mpihello.f90 and then executing with mpirun -np 4 mpihello I get...
node 0 : Hello world
node 0 : Hello world
node 0 : Hello world
node 0 : Hello world
So essentially I am calling node 0 four times rather than actually parallelizing anything. Has anyone else encountered this problem? The same code runs fine on Linux FYI. Any tips/suggestions would be extremely appreciated!
Natski