🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.cray
Article #264

Re: Cray to IEEE, IEEE to Cray

#264
From: Baard Grimsmo
Date: Wed, 18 Nov 1992 08:06
74 lines
3706 bytes
In article <1992Nov17.233222.26999@draco.macsch.com> dnl@convex.is.macsch.com (David Lombard) writes:
>In article <haberman.722017708@msi.umn.edu> haberman@s23.msi.umn.edu (Joe Habermann) writes:
>>Is there a tool for converting a file containing unformatted 64-bit 
>>Cray floating point numbers into 32-bit IEEE floats and vice versa?
>>
>>I see that Unicos has a few routines for doing this (IEG2CRAY and
>>CRAY2IEG) but I want the code so that I can compile it for various 
>>machines.   
>
>The intent is that the Cray handles the conversions to/from other
>numerical/character formats.  If you're programming in Fortran, you
>can do the conversions on-the-fly using normal READ and WRITE statements,
>see (man assign).
>
>Regards,
>DNL

You could also consult "man asgcmd"

Here is the text I have written in my print-file:
c +++ When runned on the Cray, the asgcmd command allows the user to
c +++ assign necessary file characteristics to the given output file.
c +++
c +++ The asgcmd command can be invoked from a shell using a function or
c +++ an alias.  asgcmd looks at the environment variable SHELL to determine
c +++ which format environment syntax to use.  A function for sh(1), ksh(1)
c +++ or bash would be:
c +++
c +++      % function asg { eval `/usr/bin/asgcmd $*` }
c +++
c +++ An alias for csh(1) would be:
c +++
c +++      % alias asg 'eval `/usr/bin/asgcmd \!*`'
c +++
c +++ hese can be placed in your .cshrc or .profile for command line use.
c +++ Bourne/Korn shell scripts using the asg definition will have to
c +++ include the definition.
c +++
c +++ Example:
c +++      % cat prog.f
c +++      program prog
c +++      open(9,file='result/out.dat',form='unformatted')
c +++      n=1
c +++      to=2.
c +++      write(9) n,to
c +++      end
c +++      % cf77 -o prog prog.f
c +++      % asg -F f77.nonvax -N ieee result/out.dat
c +++      % prog
c +++      % rcp reult/out.dat unixworkstation:out.dat
c +++
c +++ The out.dat file can now be processed normally on an unix
c +++ workstation by an unformatted read.
c +++
c +++ NOTE: The descriptions of the output file must be identical for
c +++ the program and the asgcmd command.
c +++ 
c +++ Example:
c +++      open(9,file='result/out.dat',form='unformatted')
c +++      % asg -F f77.nonvax -N ieee /usr/users/me/result/out.dat << wrong
c +++      % asg -F f77.nonvax -N ieee ./result/out.dat             << wrong
c +++      % asg -F f77.nonvax -N ieee result/out.dat               << correct
c +++
c +++ The shell variable of the example:
c +++   _ASG_FCHAR=result/ut.dat##-C 0105000000000000 -F 0904000000000000+ %
c +++ This variable is lost after logging out.
c +++


-- 
Bard Grimsmo     |Mail: SINTEF/Varmeteknikk         |Home: Schives Gate 7
Dr.Ing           |      7034 Trondheim, Norway      |      N-7030 Trondheim
Research Engineer|Phone: +47 7 592505               |      Norway
SINTEF Division  |Fax:   +47 7 944513               |Home phone: +47 7 523801
Technical Details
Message-ID: <1992Nov18.080656.21529@ugle.unit.no>
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!ames!elroy.jpl.nasa.gov!usc!sol.ctr.columbia.edu!ira.uka.de!math.fu-berlin.de!news.netmbx.de!Germany.EU.net!mcsun!sunic!ugle.unit.no!termo.unit.no!bgitv
References: <haberman.722017708@msi.umn.edu> <1992Nov17.233222.26999@draco.macsch.com>

Show Full Headers
Complete Article Headers
Newsgroups: comp.unix.cray,comp.sys.misc,comp.sys.sgi
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!ames!elroy.jpl.nasa.gov!usc!sol.ctr.columbia.edu!ira.uka.de!math.fu-berlin.de!news.netmbx.de!Germany.EU.net!mcsun!sunic!ugle.unit.no!termo.unit.no!bgitv
From: bgitv@termo.unit.no (Baard Grimsmo)
Subject: Re: Cray to IEEE, IEEE to Cray
Message-ID: <1992Nov18.080656.21529@ugle.unit.no>
Keywords: ieee unformatted Cray SGI Sun
Sender: news@ugle.unit.no (NetNews Administrator)
Organization: SINTEF, The Norwegian Institute of Technology
References: <haberman.722017708@msi.umn.edu> <1992Nov17.233222.26999@draco.macsch.com>
Date: Wed, 18 Nov 92 08:06:56 GMT
Lines: 74