(j3.2006) (SC22WG5.3809) Response on the TR29113 draft N1761
Aleksandar Donev
donev1 at llnl.gov
Tue Dec 9 23:50:41 EST 2008
Hi,
Concerning the question of whether it is intended to have only a single
Fortran descriptor (constant size) with just the fields changing for
different arrays: The intention was to not impose any particular choice.
The Fortran descriptors are opaque. Certainly it was intended that the
descriptors could be different (including byte count) for different ranks.
> You are referring to the case I described above ('construct_foo_c'),
> suppressing which seems to make excellent sense at this point.
I guess I still don't get it. I am referring to this example:
subroutine sub(x) bind(c) ! External procedure
real :: x(:)
end subroutine
program test
interface
subroutine sub(x) bind(c) ! External procedure
real :: x(:)
end subroutine
end interface
call sub(x) ! This will call two wrappers twice
end program
Did you intend to make this illegal? If yes, that seems contentious. If
not, how would it skip the wrappers if the compiler has no clue that the
procedure is actually written in C nor does it know the "local Fortran
name"?
> What does the C function pass to the wrapper for arguments not
> present?
> If the C function call passes NULL
OK, that is what I wasn't sure about. How does this resolve the issue of
VALUE+OPTIONAL then?
> True. But we'd then need to change the semantics of DIMENSION(*)
> in *generic interfaces*, and I don't see how this can be done while
> maintaining backward compatibility, *especially* if the scalar case
> is included. Some existing code could become invalid.
You are right. So now the question is: Is being able to use generic
interfaces enough to justify adding the new concept of
assumed-rank-and-size? Of course it would be better, but is it worth it.
I think so, but all of WG5 ought to be convinced.
Best,
Aleks
--
Aleksandar Donev, Ph.D.
Lawrence Postdoctoral Fellow @ Lawrence Livermore National Laboratory
High Performance Computational Materials Science and Chemistry
E-mail: donev1 at llnl.gov
Phone: (925) 424-6816 Fax: (925) 423-0785
Address: P.O.Box 808, L-367, Livermore, CA 94551-9900
Web: http://cherrypit.princeton.edu/donev
More information about the J3
mailing list