Operating System - OpenVMS
1745825 Members
4142 Online
108722 Solutions
New Discussion юеВ

Floating Points on VAX and Alpha

 
Vir Thanvi
Advisor

Floating Points on VAX and Alpha

Hello All,

I am having problems with running the applications ported from VAX to Alpha that are using REAL*8 variables. My software mainly uses REAL*8 for time stamps with double precision on VAX. When I ported this to Alpha, all the time stamps values became non-understandable.
From what I read in literature is that VAX supports D-floating type values for double precision by default and those are not at all supported on Alpha because Alpha supports only G-floating types for double precision values.
I resolved one of the issue by changing "REAL*8 TIME" to "REAL*4 TIME(2)" and using only TIME(1) for software purposes. Now I have several other applications indicating the same problem and not being fixed by the above mentioned procedure.
Please help...
8 REPLIES 8
Antoniov.
Honored Contributor

Re: Floating Points on VAX and Alpha

Floating point were not portable in the past, so IEEE some year ago proposed a new standard for all floating point.
VAX use its own binary format while alpha use IEEE standard floating point.
So, if you have to port source code without data, you can recompile on alpha with /IEE qualifier.
If you have to export some old data from may be a trouble. I know some language on alpha has VAX floating point emulator but not all format are supported and don't forget execution is slow because CPU can't use internal FP processor but has to call a little convertion routine.

Antonio Vigliotti
Antonio Maria Vigliotti
Ian Miller.
Honored Contributor

Re: Floating Points on VAX and Alpha

See also
http://h71028.www7.hp.com/ERC/downloads/i64-floating-pt-wp.pdf
____________________
Purely Personal Opinion
Bojan Nemec
Honored Contributor

Re: Floating Points on VAX and Alpha

Vir,

I suppose you are using FORTRAN. Please see this link:

http://h71000.www7.hp.com/doc/82final/6443/6443pro_006.html#index_x_500

It instruct you how to compile the program to use different types of floating point types. The unsuported floating point types are converted in supported in run-time and then used.

Bojan
Robert Gezelter
Honored Contributor

Re: Floating Points on VAX and Alpha

Vir,

Are these timestamps returned as floating point values? Or, are they the OpenVMS standard 64-bit binary integers?

If they are the binary integers, being stored in a floating variable may be a problem. The FORTRAN on the Alpha has a variety of language features that will be better at mapping the binary time stamps than the old FORTRAN practice of using REAL*8.

Please let us know if this is the case, it will make the answers more precise.

- Bob Gezelter, http://www.rlgsc.com
John Gillings
Honored Contributor

Re: Floating Points on VAX and Alpha

Vir,

Please show us how a time value gets put into one of these variables. Floating point data types should only be used for floating point values. Any other use is asking for trouble.

If your time stamps are OpenVMS time values, then you can declare your variables as:

INTEGER*8 TIME

However, I'd recommend you make it more obvious that these aren't "ordinary" values, and make it easier to modify your code for different ways of representing times:

STRUCTURE /TimeType/
INTEGER*8 TimeValue ! may change
END SRUCTURE

RECORD /TimeType/Time

CALL SYS$GETIM(Time)

A crucible of informative mistakes
Vir Thanvi
Advisor

Re: Floating Points on VAX and Alpha

Hi All,

Here are some pieces of info:

1. The language being used is FORTRAN.
2. The time stamps are mainly Julian Seconds (e.g. 0.4631000E+10) from a particular day. These times are then converted to Calendar time (e.g. 2005/271/12:20:00.0)for further use in the code.
3. The time stamps are current julian time, and the times stamps on data read from a unformatted Sequential files that has been copied from VAX to Alpha.

I have been testing with "CONVERT='VAXD'" in OPEN statments. It didn't seem to work. I tested by compiling the code with /FLOAT=D_FLOAT, and that didn't work either.
Please note that the code has been migrated from VAX to Alpha and the data files are also copied from VAX to Alpha.
If I run the code to create my final file on Alpha and then perform analysis on it, it is very easily accessible and results are fine. When I copy the final product to VAX and try to run the same analysis using the code on VAX, all the errors kick in.

I hope this will help.

Best Regards,
Vir
Bojan Nemec
Honored Contributor

Re: Floating Points on VAX and Alpha

Vir,

Take a look to the CVT$CONVERT_FLOAT run time routine. This routine can convert between different floating point types.

$ HELP RTL_ROUTINES CVT$ CVT$CONVERT_FLOAT

You can use this routine to convert yours time stamps when reading them from the file or (maybe better) you can write a program which convert all the time stamps in the file. Then you run this program as part of the VAX to Alpha port of data.

Bojan
Antoniov.
Honored Contributor

Re: Floating Points on VAX and Alpha

Vir,
I can't get if you are using floating point or integer number.
If you are using integers, there are NO ANY DIFFERENCE between Vax, Alpha or Itanium architecture.
Floating Point architecture is more complex.
In early '80 years, every h/w CPU used its own FP binary format. Main difference among various formats was how many bits were reserved by exponent.
IEEE proposed a new format early became standard for all platforms.
Because Vax architecture was designed before IEEE standard, it still uses DEC FP. Alpha & Itanium use IEEE.
There is little reason to still use Vax FP:
1) If you have to share information between Vax and Alpha/Itanium (e.g. cluster, exchange of data)
2) You cannot convert old data for some reason.

However,
while you are migrating code, could you redesign it?
I think integer is best practice for Julian date use. And integer is really readable on any CPU.

Antonio Vigliotti
Antonio Maria Vigliotti