Print

Print


Ted Stern wrote:
> On 23 Aug 2010 00:33:39 -0700, Tobias Burnus wrote:
>> While I do like coarrays, I do not see them as being "an enormous
>> leap forward"; they make Fortran more attractive, they offer some
>> nice features and integrate nicely into the language, but one has to
>> do the same effort as with MPI to parallelize the code. (The coarray
>> syntax seems to be easier, but the structure of the program is the
>> same as with MPI.)
> 
> There are some crucial differences between Co-Array Fortran and MPI:
> 
> While it is indeed true that MPI2 supports one-sided parallelism,
> 
> (1) It is much easier and clearer to implement one-sided parallelism
>     with CAF.  Ease of code maintenance should not be dismissed
>     lightly :-).
> 
> (2) MPI2 support for one-sided parallelism is not
>     integrated with the compiler and is less reliably supported.  Many
>     codes still use MPI1.
> 
> (3) If OpenMP and Co-Array Fortran are both being handled in the
>     compiler rather than putting distributed parallelism into a
>     separate library, one has more confidence that threading and
>     parallel memory allocation will be handled appropriately.  Getting
>     mixed mode OpenMP + MPI to work can be a nightmare.
> 
> Ted

I agree with Ted's comments, though I might go farther and guess that 
*most* MPI codes are the two-sided variety.  However, I think that 
Tobias' "structure of the program" comment was intended in a more 
general sense: Fortran 2008 and MPI both use the SPMD programming model. 
Multiple instances of the program execute concurrently and interact with 
each other for the purposes of exchanging data values and 
synchronization.  In most cases, the harder part of writing the program 
is the up front design work to decompose the data and work/algorithms to 
fit into the SPMD model.  Once you are past that, actually writing the 
code is, in my opinion, easier using coarrays.

While Ted mentions interaction with OpenMP, I would also expect codes to 
contain both MPI and coarrays.  Particularly codes that are currently 
written with MPI and are evolving by the gradual introduction of 
coarrays.  The most common case will have each image corresponding to an 
MPI rank. It is also possible to imagine dual levels of parallelism 
where multiple coarray programs (not necessarily the same programs) are 
bridged together with only image 1 in each being a rank in the higher 
level MPI structure.  A state of "peaceful coexistence" between coarrays 
and MPI is not required in the Fortran standard (which does not discuss 
MPI), but will certainly be a practical implementation requirement.

Cheers,
Bill





-- 
Bill Long                                           [log in to unmask]
Fortran Technical Support    &                 voice: 651-605-9024
Bioinformatics Software Development            fax:   651-605-9142
Cray Inc./Cray Plaza, Suite 210/380 Jackson St./St. Paul, MN 55101