[MITgcm-support] building with MPI on a dual-core mac
Brian Rose
brose at MIT.EDU
Fri Jul 17 18:44:19 EDT 2009
Hello MITgcmers,
This is not really a question, but I just wanted to report on my
recent experience with setting up MITgcm with MPI support on a new
Apple iMac with Intel Core 2 Duo processor. Though it's a single
machine, I got interested in building the model with MPI to take
advantage of the dual core processor. I didn't find much information
about this particular setup in the email archives, but I successfully
muddled through it on my own. I imagine this information is obvious
to some of you, but it certainly wasn't to me, so I figured it would
be useful contribution to this list.
My system:
iMac w/ 2.66 GHz Intel Core 2 Duo
OS X 10.5.7
gfortran 4.4.0 (installed via fink)
mpich2-1.1
I found many ways to install MPI that *didn't* work, and one way that
*did* work. There is a version of OpenMPI pre-installed with OS X
10.5, but without a Fortran compiler so it's pretty much useless for
our purposes.
What worked for me was to download the source code for the latest
stable release of MPICH2, and build it with gfortran using the same
compiler flags as I need to compile MITgcm. Specifically, I ran the
mpich2 configure script with the following flags
F90=gfortran F77=gfortran F90FLAGS='-fsecond-underscore' FFLAGS='-
fsecond-underscore'
and then proceeded to build mpich2 following the stock instructions
that came with the distribution.
(without the '-fsecond-underscore' flags, I got linker errors when
building MITgcm)
MITgcm now compiles and runs without complaint, using the optfile
attached below.
To run the model on two cores, I did the following:
- edit SIZE.h with nPx = 2
- follow the usual build sequence, using the '-mpi' option for genmake2
- before running the model, launch the 'mpd' daemon (that was
installed along with mpich2) by typing 'mpd &' on the command line
- to run the model: 'mpiexec -n 2 ./mitgcmuv'
And it works! The limited testing I have done shows a speed-up factor
of about 1.6 over a single-processor build.
Hope this information, and/or the optfile below, is useful to somebody.
Cheers
Brian
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
Brian Rose
Ph.D. Candidate, Climate Physics and Chemistry
Department of Earth, Atmospheric and Planetary Sciences
Massachusetts Institute of Technology
office: 54-1419 phone: 617-253-9345
email: brose at mit.edu
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mitgcm.org/pipermail/mitgcm-support/attachments/20090717/558f9687/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: darwin_ia32_gfortran+mpi
Type: application/octet-stream
Size: 1376 bytes
Desc: not available
URL: <http://mitgcm.org/pipermail/mitgcm-support/attachments/20090717/558f9687/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mitgcm.org/pipermail/mitgcm-support/attachments/20090717/558f9687/attachment-0001.htm>
More information about the MITgcm-support
mailing list