Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

MPI Fortran on Mac OSX

  1. Jul 15, 2013 #1
    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)

    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!

  2. jcsd
  3. Jul 15, 2013 #2
    By looping the inner code and re-running I notice in Activity Monitor that four parallel versions of the code are in fact running. So this seems simply something wrong with the rank being returned by MPI_COMM_RANK - is this a normal issue for Macs?
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Discussions: MPI Fortran on Mac OSX
  1. IDE's for MPI on a mac (Replies: 3)

  2. MPI in Fortran (Replies: 2)