home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.cray:243 comp.sys.super:909
- Path: sparky!uunet!dtix!darwin.sura.net!mips!apple!apple!malcolm
- From: malcolm@Apple.COM (Malcolm Slaney)
- Newsgroups: comp.unix.cray,comp.sys.super
- Subject: Re: Are there specific tools to assist in porting C to CRAY
- Summary: Use GREP
- Message-ID: <71317@apple.Apple.COM>
- Date: 18 Aug 92 04:45:38 GMT
- References: <1992Aug17.234228.16195@leland.Stanford.EDU>
- Organization: Apple Computer Inc, Cupertino, CA
- Lines: 33
-
- In article <1992Aug17.234228.16195@leland.Stanford.EDU> buc@leland.stanford.edu (Robert Richards) writes:
- >
- >I am trying to port a C program to the Cray under UNICOS. The slowest
- >part of the port is the 32-bit references that I have to convert to
- >CRAY's 64-bit world. Are there any tools that help one find where
- >code is not 64-bit world compatible?
-
- I've lost count of how many codes I've ported to the Cray. It's not always
- hard, but then people are always doing things to screw you up. I don't know
- of any specific tools, but I usually run a lot of greps.
-
- First step, get the code to compile and run correctly with an ANSI C compiler
- on a 32 bit machine (or wherever the code is known to work correctly.)
- Most 64 bit portability problems won't be caught by the compiler but you
- really should start with a clean program.
-
- Step two, look for all references (grep) to read and/or write. Quite often
- this indicates that the program is doing binary IO...there is nothing wrong
- with this but it can indicate a problem with moving files to other machines.
- Redefine all binary IO in terms of a stream of bytes.
-
- Look for unions (this one just got me).....these could be indications of
- somebody trying to mess with the bits (overlaying a float and an integer,
- for example.) Since you are doing ME and not EE I suspect you won't see
- too much bit twiddling, either.
-
- Finally, run the program and see where it stops.
-
- It's really not hard to write portable 64/32 bit code.....keep your fingers
- crossed. Going the other way is even harder.
-
- Malcolm Slaney
- Apple ATG
-