Alois Steindl wrote:
>
> Hello,
> I will try to outline my thoughts about this problem again.
>
> Let us first consider the server aspect and assume that the
> machine/compiler supports 6, 15 and 30 digits precision. (Case A)
> (If it doesn't support more than 23 digits, you are out of luck for
> p=24; you would have to get a different compiler or computer.)
> For case B we assume that it just supports 15 and 30 digits.
>
> Now you write your library for all available precisions, which in the
> current state is not so easy portably.
>
> Now if your program - the client - asks for p1=6 and p2=12, it will really get
> p1=6 and p2=15 in case A and p1=p2=15 in case B.
>
> If it asks for p1=12 and p2=24, it will get p1=15 and p2=30 in both
> cases.
>
> I really can't see your problem; you just have to distinguish the
> server's and the client's view.
>
A part of my problem is the portable generation of the libraries
(writting the routines for all available precisions, without
using REAL and DOUBLE PRECISION or equivalent (KIND(1.0D0), ...))
Let's assume that this is solved. The other part of my problem
is the following:
In case B, the client asks for p1=6 and p2=12: as you say, it gets
p1=p2=15, so that from the server side the same routine will
actually apply to both requests. But sometimes I don't
want to execute the same code for p1 and p2: in my previous simple example
of array summation, I need a 12 digits accumulator to apply on p1, and
a 24 digits one to apply on p2.
To solve this problem, the kind the dummy arguments should
be requested with a given precision:
SUBROUTINE mysum_6(a)
REAL(selected_real_kind(p=6)) :: a(:)
in toto_6, the server knows the client wants to process a(:) with
6 digits accuracy: a 12 digits accumulator is appropriate.
SUBROUTINE mysum_12(a)
REAL(selected_real_kind(p=12)) :: a(:)
in toto_12, the server knows the client wants to process a(:) with
12 digits accuracy: a 24 digits accumulator is appropriate.
To avoid conflicts in a generic interface, REAL(selected_real_kind(p=6))
and REAL(selected_real_kind(p=12)) should be considered by the compiler
as two different kinds, even if they are identical (same as in ADA, if
I've understood well?).
Also, everybody should use the same kinds (i.e. same requested precisions
and ranges), to make library calls as easy and portable as they are by using
standard REAL and DOUBLE PRECISION kinds...
Best Regards,
--
+-----------------------------------+----------------------------+
| Pierre Hugonnet | mail....CGG |
| | 1, rue Leon Migaux |
| Seismic Data Processing R&D | 91341 MASSY cedex |
| | FRANCE |
| COMPAGNIE GENERALE DE GEOPHYSIQUE | phone...(33) 164 47 45 59 |
| Massy processing centre (France) | fax.....(33) 164 47 32 49 |
| http://www.cgg.com | [log in to unmask] |
+-----------------------------------+----------------------------+
My opinions are not necessarily those of CGG
--------------------------------------------------------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|