* Re: DEC Alpha-> Vax conversion
1997-03-20 5:00 DEC Alpha-> Vax conversion Roger Peden
1997-03-20 5:00 ` Jan Vorbrueggen
@ 1997-03-20 5:00 ` Dr Ivan D Reid, muSR Facility
1997-03-20 5:00 ` Roger Peden
1997-03-20 5:00 ` Robert Koehler
` (2 subsequent siblings)
4 siblings, 1 reply; 9+ messages in thread
From: Dr Ivan D Reid, muSR Facility @ 1997-03-20 5:00 UTC (permalink / raw)
In article <5gr59p$ich@romeo.logica.co.uk>, Roger Peden wrote:
>Does anyone have any experience of converting 64 bit files on an Alpha back to
>a 32 bit VAX readable form?
I don't see the problem. Can you explain in more detail?
--
Ivan Reid, Paul Scherrer Institute, CH. reid@psi.ch
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: DEC Alpha-> Vax conversion
1997-03-20 5:00 ` Dr Ivan D Reid, muSR Facility
@ 1997-03-20 5:00 ` Roger Peden
1997-03-20 5:00 ` Adrian Putley
0 siblings, 1 reply; 9+ messages in thread
From: Roger Peden @ 1997-03-20 5:00 UTC (permalink / raw)
In article <slrn5j2fid.g203ih.reid@PSW086.PSI.CH>,
reid@psi.ch (Dr Ivan D Reid, muSR Facility) wrote:
>In article <5gr59p$ich@romeo.logica.co.uk>, Roger Peden wrote:
>>Does anyone have any experience of converting 64 bit files on an Alpha back
to
>>a 32 bit VAX readable form?
>
> I don't see the problem. Can you explain in more detail?
>
As I understand it (I am dealing with this problem second hand), our code has
been compiled to use IEEE standard floating point. Thus the numbers generated
in the binary file are stored in this 64 bit format.
When this file is copied to the VAX to be read by the software there, it
cannot be read because the VAX expects 32 bit number formats. (I expect there
would be a similar problem if it was copied to , say , a PC)
I hope this clarifies the situation.
Roger
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: DEC Alpha-> Vax conversion
1997-03-20 5:00 DEC Alpha-> Vax conversion Roger Peden
@ 1997-03-20 5:00 ` Jan Vorbrueggen
1997-03-20 5:00 ` Dr Ivan D Reid, muSR Facility
` (3 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Jan Vorbrueggen @ 1997-03-20 5:00 UTC (permalink / raw)
pedenr@logica.com (Roger Peden) writes:
> As I understand it (I am dealing with this problem second hand), our code has
> been compiled to use IEEE standard floating point. Thus the numbers generate
> in the binary file are stored in this 64 bit format.
0) Get on of the Alpha FORTRAN compilers.
1) Write a little FORTRAN programme that:
a) reads in the data in native ALPHA format
b) writes out the data to a new file opened with the CONVERT (IIRC) option
2) Compile, link and run said programme.
"DEC has had it for some time now!"
Jan
^ permalink raw reply [flat|nested] 9+ messages in thread
* DEC Alpha-> Vax conversion
@ 1997-03-20 5:00 Roger Peden
1997-03-20 5:00 ` Jan Vorbrueggen
` (4 more replies)
0 siblings, 5 replies; 9+ messages in thread
From: Roger Peden @ 1997-03-20 5:00 UTC (permalink / raw)
Hi,
Does anyone have any experience of converting 64 bit files on an Alpha back to
a 32 bit VAX readable form?
We have ported an application from VAX to Alpha which as part of its normal
processing generates a binary file that is read by other third party software.
Unfortunately this other software is going to remain on a VAX, so we need to
be able to convert the binary file back. This is quite urgent as the
application is running live.
We could get someone to write a utility to do this, but if there is some
generic application out there , it would be useful to have in case of any
further difficulties in the future.
Replies by e-mail if poss.
Thanks in advance,
Roger Peden
pedenr@logica.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: DEC Alpha-> Vax conversion
1997-03-20 5:00 ` Roger Peden
@ 1997-03-20 5:00 ` Adrian Putley
1997-03-25 5:00 ` Stephen Hoff Hoffman
0 siblings, 1 reply; 9+ messages in thread
From: Adrian Putley @ 1997-03-20 5:00 UTC (permalink / raw)
>>Roger Peden wrote:
>>>Does anyone have any experience of converting 64 bit files on an Alpha back
>>>to a 32 bit VAX readable form?
>>
>> I don't see the problem. Can you explain in more detail?
>>
>
>As I understand it (I am dealing with this problem second hand), our code has
>been compiled to use IEEE standard floating point. Thus the numbers generated
>in the binary file are stored in this 64 bit format.
>
>When this file is copied to the VAX to be read by the software there, it
>cannot be read because the VAX expects 32 bit number formats. (I expect there
>would be a similar problem if it was copied to , say , a PC)
There is no generic way of doing this. You will need to know the exact format
of the data in the file and to understand exactly which fields are affected in
this way.
What I expect you will find is that numerically-encoded items (eg integers as
well as floating point) are held in different-sized formats on the 64-bit
Alphas as compared to VAXes. The exact details will depend on how the file is
written and what language the application is in.
For example, a C/C++ long is also 4 bytes (32 bits) on a VAX but 8 (64) on an
Alpha. If the program is setting up the fields of a data structure in memory
and then writing this out eg using 'write', then the size and shape of the
data will be different between the two platforms.
It may be simpler to modify the original application to keep the file format
compatible, eg change the declarations of 'long' to 'int', which happens to be
4 bytes on both platforms.
The only way to convert such files is to write a bespoke converter that
understands the formats of the files in detail and explicitly converts the one
to the other.
Finally, re floating-point formats, there is also a 32-bit IEEE standard
format. We used this all over the place in MC2000, eg between Alphas, MIPS
systems, VAXes and Intel PCs.
HTH
Adrian
------------------------------------------------------------------------------
Adrian Putley | Logica UK Ltd, Medina House, Business Park 4, |
putleya@logica.com | Randalls Way, Leatherhead, Surrey KT22 7TW, UK |
(+44 171) 446 5715 | fax: 01372 227019 |
------------------------------ These are my opinions, not my employer's ------
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: DEC Alpha-> Vax conversion
1997-03-20 5:00 DEC Alpha-> Vax conversion Roger Peden
1997-03-20 5:00 ` Jan Vorbrueggen
1997-03-20 5:00 ` Dr Ivan D Reid, muSR Facility
@ 1997-03-20 5:00 ` Robert Koehler
1997-03-21 5:00 ` Immo Huneke
1997-03-23 5:00 ` Boris Gubenko
4 siblings, 0 replies; 9+ messages in thread
From: Robert Koehler @ 1997-03-20 5:00 UTC (permalink / raw)
Roger Peden (pedenr@logica.com) wrote:
: Hi,
: Does anyone have any experience of converting 64 bit files on an Alpha back to
: a 32 bit VAX readable form?
They're probably the same. The data in the files depends on mostly on the
program that wrote them, not the platform that they were written on. If
your storing floating point in the files, the default on the VAX is F_FLOAT
for single and D_FLOAT for double precision, but you can use a compiler switch
to generate code using G_FLOAT for double precision. On the Alpha the defaults
are F_FLOAT for single and G_FLOAT for double, but you can get D_FLOAT for
double (calculation precision limitted to that of G_FLOAT, but D_FLOAT format
storage), or IEEE S for single and T for double.
And if you've written your Alpha program to use 64 bit integers (you have to
specifically code for that our you'll get 32 bit integers), there's no direct
support in most compilers on the VAX, but its highly unlikely that you had
needed to do that.
I exchange data between VAXen and Alphas all day, and so do thousands of sites
running mixed architecture clusters, whithout a sinlge byte of conversion.
------------------------------------------------------------------------------
Bob Koehler | Computer Sciences Corporation
rkoehler@csc.com | System Sciences Division
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: DEC Alpha-> Vax conversion
1997-03-20 5:00 DEC Alpha-> Vax conversion Roger Peden
` (2 preceding siblings ...)
1997-03-20 5:00 ` Robert Koehler
@ 1997-03-21 5:00 ` Immo Huneke
1997-03-23 5:00 ` Boris Gubenko
4 siblings, 0 replies; 9+ messages in thread
From: Immo Huneke @ 1997-03-21 5:00 UTC (permalink / raw)
In article <5gr59p$ich@romeo.logica.co.uk>, pedenr@logica.com (Roger
Peden) wrote:
> Hi,
>
> Does anyone have any experience of converting 64 bit files on an Alpha
back to
> a 32 bit VAX readable form?
If you do need to convert binary file formats, you will need to know the
precise file format. Provided this is available, the simplest converter
you can lay your hands on is the Perl 5.003 interpreter, which is public
domain and available for a wide variety of operating systems. The 'unpack'
function will extract bit and byte fields in any format (it's a bit like
sscanf in C, but for packed binary).
Best regards,
Immo.
--
** Any opinions expressed above are solely the author's (Immo Huneke)
Comms Divisn, Logica UK Ltd., Stephenson Ho., London NW1 2PL, England
Ph +44-171-637 9111 Fx +44-171-344 3633 Mail Huneke_Immo@Logica.Co.UK
*N: N mathematicians to f(lightbulb)? None - exercise for the reader*
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: DEC Alpha-> Vax conversion
1997-03-20 5:00 DEC Alpha-> Vax conversion Roger Peden
` (3 preceding siblings ...)
1997-03-21 5:00 ` Immo Huneke
@ 1997-03-23 5:00 ` Boris Gubenko
4 siblings, 0 replies; 9+ messages in thread
From: Boris Gubenko @ 1997-03-23 5:00 UTC (permalink / raw)
This is a multi-part message in MIME format.
--------------1C41C908177338A144D65AC6
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Roger Peden wrote:
>
> Hi,
>
> Does anyone have any experience of converting 64 bit files on an Alpha back to
> a 32 bit VAX readable form?
>
> We have ported an application from VAX to Alpha which as part of its normal
> processing generates a binary file that is read by other third party software.
> Unfortunately this other software is going to remain on a VAX, so we need to
> be able to convert the binary file back. This is quite urgent as the
> application is running live.
>
> We could get someone to write a utility to do this, but if there is some
> generic application out there , it would be useful to have in case of any
> further difficulties in the future.
>
> Replies by e-mail if poss.
>
> Thanks in advance,
>
> Roger Peden
> pedenr@logica.com
--------------1C41C908177338A144D65AC6
Content-Type: text/plain; charset=us-ascii; name="B.B.2"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="B.B.2"
First of all, you have to figure out what 64-bit floating point format
is used while writing the data and what 32-bit floating point format is
expected on the other side.
You can use cvt$convert_float Run-Time Library routine to convert different
floating-point data (the help attached).
Boris Gubenko
------------------------------------------------------------------------------
RTL_ROUTINES
CVT$
CVT$CONVERT_FLOAT
The CVT$CONVERT_FLOAT routine converts floating-point data types
to other supported floating-point data types.
Format
CVT$CONVERT_FLOAT input_value, input_type_code, output_value,
output_type_code, options
Argument
input_value
OpenVMS usage varying_arg
type unspecified
access read only
mechanism by reference
The address of a data area containing a floating-point number
that is to be converted. The input_value argument may contain
floating-point data in F_Floating, D_Floating, G_Floating, H_
Floating, IEEE_S_Floating, IEEE_T_Floating, IEEE_X_Floating, IBM_
Long_Floating, IBM_Short_Floating, or Cray_Floating format. The
value of the input_type_code argument determines the format and
size of the input_value argument.
Input_type_code Format Size in Bytes
CVT$K_VAX_F F_Floating 4
CVT$K_VAX_D D_Floating 8
CVT$K_VAX_G G_Floating 8
CVT$K_VAX_H H_Floating 16
CVT$K_IEEE_S IEEE_S_Floating 4
CVT$K_IEEE_T IEEE_T_Floating 8
CVT$K_IEEE_X IEEE_X_Floating 16
CVT$K_IBM_SHORT IBM_Short_Floating 4
CVT$K_IBM_LONG IBM_Long_Floating 8
CVT$K_CRAY Cray_Floating 8
input_type_code
OpenVMS usage mask_longword
type longword (unsigned)
access read only
mechanism by value
The address of a longword bit mask specifying the type of
floating-point data being passed in the input_value argument.
Valid type codes are:
CVT$K_VAX_F
CVT$K_VAX_D
floating-point data being passed in the input_value argument.
Valid type codes are:
CVT$K_VAX_F
CVT$K_VAX_D
CVT$K_VAX_G
CVT$K_VAX_H
CVT$K_IEEE_S
CVT$K_IEEE_T
CVT$K_IEEE_X
CVT$K_IBM_LONG
CVT$K_IBM_SHORT
CVT$K_CRAY
output_value
OpenVMS usage varying_arg
type unspecified
access write only
mechanism by reference
The address of a data area that receives the converted floating-
point number. The output_value argument can contain floating-
point data in F_Floating, D_Floating, G_Floating, H_Floating,
IEEE_S_Floating, IEEE_T_Floating, IEEE_X_Floating, IBM_Long_
Floating, IBM_Short_Floating, or Cray_Floating format. The value
of the output_type_code argument determines the size and format
of the data placed into the output_value argument.
Output_type_code Format Size in Bytes
CVT$K_VAX_F F_Floating 4
CVT$K_VAX_D D_Floating 8
CVT$K_VAX_G G_Floating 8
CVT$K_VAX_H H_Floating 16
CVT$K_IEEE_S IEEE_S_Floating 4
CVT$K_IEEE_T IEEE_T_Floating 8
CVT$K_IEEE_X IEEE_X_Floating 16
CVT$K_IBM_SHORT IBM_Short_Floating 4
CVT$K_IBM_LONG IBM_Long_Floating 8
CVT$K_CRAY Cray_Floating 8
output_type_code
OpenVMS usage mask_longword
type longword (unsigned)
access read only
mechanism by value
The address of a longword bit mask specifying the type of
floating-point data that the input_value argument will be
converted into and returned in the output_value argument. Valid
type codes are:
CVT$K_VAX_F
CVT$K_VAX_D
CVT$K_VAX_G
CVT$K_VAX_H
CVT$K_IEEE_S
CVT$K_IEEE_T
CVT$K_IEEE_X
CVT$K_IBM_LONG
CVT$K_IBM_SHORT
CVT$K_CRAY
options
OpenVMS usage mask_longword
type longword (unsigned)
access read only
mechanism by value
Conversion option specifier. The options argument is the address
of a longword bit mask in which each option bit set causes the
corresponding option to be used during the conversion.
The following options can be specified using the options
argument:
CVT$M_ROUND_TO_NEAREST
CVT$M_TRUNCATE
CVT$M_ROUND_TO_POS
CVT$M_ROUND_TO_NEG
CVT$M_VAX_ROUNDING
CVT$M_BIG_ENDIAN
CVT$M_ERR_UNDERFLOW
| All the opinions voiced are mine alone and do not reflect anyone else's |
| opinion, including my employer's. |
--------------1C41C908177338A144D65AC6--
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: DEC Alpha-> Vax conversion
1997-03-20 5:00 ` Adrian Putley
@ 1997-03-25 5:00 ` Stephen Hoff Hoffman
0 siblings, 0 replies; 9+ messages in thread
From: Stephen Hoff Hoffman @ 1997-03-25 5:00 UTC (permalink / raw)
In article <5grfba$11r0_001@logica.co.uk>, putleya@logica.com (Adrian Putley) writes:
:>>Roger Peden wrote:
:>>>Does anyone have any experience of converting 64 bit files on an Alpha back
:>>>to a 32 bit VAX readable form?
The file formats are compatible and interchangeable -- the VMScluster
would not work otherwise. Individual fields in files may or may not
be compatible -- floating point can be one potential problem area.
There are compatible floating point formats between VAX and Alpha,
and there are formats that require conversions.
For conversions, see CVT$CONVERT_FLOAT, in the back of the LIB$
RTL manual. (Be aware that floating point conversions can cause
"interesting" behaviour with values that result from the extension
or the truncation of the bits in the floating point values, as the
formats are converted...) There are routines and techniques that
can also be used to convert floating point formats, but most (all?)
will also inherently introduce "errors"...
--
Adrian, aren't you and Roger at the same site?
-------------------------- pure personal opinion ---------------------------
Hoff (Stephen) Hoffman OpenVMS Engineering h*ffman@xdelta.enet.dec.c*m
headers and addresses munged to avoid automated spammers: junk-e-mail
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~1997-03-25 5:00 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-03-20 5:00 DEC Alpha-> Vax conversion Roger Peden
1997-03-20 5:00 ` Jan Vorbrueggen
1997-03-20 5:00 ` Dr Ivan D Reid, muSR Facility
1997-03-20 5:00 ` Roger Peden
1997-03-20 5:00 ` Adrian Putley
1997-03-25 5:00 ` Stephen Hoff Hoffman
1997-03-20 5:00 ` Robert Koehler
1997-03-21 5:00 ` Immo Huneke
1997-03-23 5:00 ` Boris Gubenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox