(j3.2006) (SC22WG5.4049) Writing reliable MPI code [was LOCK/UNLOCK question]
N.M. Maclaren
nmm1
Fri Jun 26 08:28:16 EDT 2009
On Jun 25 2009, Van Snyder wrote:
>On Thu, 2009-06-25 at 02:09 -0700, Malcolm Cohen wrote:
>>
>> > Maybe they are all "experts".
>>
>> If they have a working parallel program with MPI, probably pretty
>> close.
>
>A pretty big "if." More likely, instead of a "working parallel program"
>they have a program that almost always gets believable answers, and
>hardly ever goes into deadlock.
Actually, that depends. There are ways of using MPI that are pretty
easy to get right - certainly no harder than writing complicated serial
code. The difficulty is that they perform well only on problems that
match the BSP model fairly closely - which is a major handicap.
I regard most MPI courses as seriously misdesigned, and I start by
teaching the principles, how to use the routines, built-in datatypes and
collectives (over MPI_WORLD). That's it.
If you stick to just those facilities, and use MPI_Barrier to force
synchronisation of the collectives, MPI is not hard to use - indeed,
it's little harder than BSP and easier than coarrays (even sticking to
just SYNC ALL), because you don't have ANY problems with inter-image
aliasing.
Quite a lot of programs use just those facilities, and many of them get
their MPI use correct. Where MPI gets tricky is when you need
point-to-point, non-blocking transfers, subset communicators,
user-defined MPI datatypes, and other 'fancy' features. But, as I
said, the simple use will work only for some problems.
Not totally independently, the basic features bring in NONE of the
difficulties that are currently being discussed, and it would be trivial
to design good Fortran 90/95/2003/2008 interfaces for them.
Unfortunately, I think that the restriction to built-in types is too
restrictive for a new interface.
Regards,
Nick Maclaren,
University of Cambridge Computing Service,
New Museums Site, Pembroke Street, Cambridge CB2 3QH, England.
Email: nmm1 at cam.ac.uk
Tel.: +44 1223 334761 Fax: +44 1223 334679
More information about the J3
mailing list