MPI version of the CAF library: undefined references.

Tobias Burnus burnus@net-b.de
Fri Nov 18 21:47:00 GMT 2011


Hi Jorge,

Jorge D'ELIA wrote:
> I try to make the MPI version of the GNU Fortran coarray
> communication library

First, I would really discourage the use of libcaf_mpi in 4.7.

The reason is that despite its name, there is currently no communication 
supported. Thus, you can correctly use 
ucobound/lcobound/this_image/num_images - and (with limitations) ERROR 
STOP and SYNC with any number of images. However, anything which 
involves communication will fail *silently* (or rather operate on the 
local image) - thus, by construction, it only works correctly if you 
have a single MPI process (mpiexec -np 1) or if you use only the above 
mentioned feature. -- However, any reasonable hello-world program will 
use other features and thus will fail with multiple images.

I think I should put a huge warning on the wikipage ... which I did now.

> $ gfortran-beta -Wall -std=f2008 -fcoarray=lib -c test01.f90
> $ mpif90 -lcaf_mpi -o test01.exe test01.o
> test01.f90:(.text+0x140): undefined reference to `_gfortran_caf_init'

Wrong order: The "-lcaf_mpi" needs to be placed after the "test01.o".

  * * *

I actually had hoped that we could implement some working hello-world 
support for 4.7. However, implementing all the missing single-image 
support took more time that anticipated. Except for some diagnostics and 
bugs, only two items are missing: Polymorphic (scalar/array) coarrays 
and the intrinsic assignment shouldn't reallocate coarray components.

For the library version, a lot of work went into the infrastructure such 
as passing coarrays as actual argument to procedures and full support 
for registering static and allocatable coarrays. (Actually, the initial 
plan was to add only minimal support for those and deferred it after 
hello-world support was implemented.)

Still planed for 4.7:
- Polymorphic coarrays: This is planned to get completed shortly after 
Paul's polymophic array support. (One day of work?)
- Avoid realloc of coarray components with intrinsic DT assignment (one 
day?)
- Implement missing bits for coarray deallocation/degregistering. (two 
days?)

4.8 items:
a) Implement a request-handling loop in the library* (two weeks?)
b) Use it to properly implement SYNC and ERROR STOP (two days?)
c) Start implementation of some simple communication (three/four days?)

I hope that as soon as (c) works, implementing more will be quicker as 
the motivation to complete a half-working feature is larger than to do 
all the preparatory work.

(* This part does not require any knowledge of the GCC internals and 
could be merged until just before the 4.7.0 release. However, I don't 
think any work will be done for 4.7.)

Tobias



More information about the Fortran mailing list