User`s guide
Developing an Application [3]
3.8 Porting Programs to the Cray XMT
Use the following information when you prepare to port C and C++ programs to
the Cray XMT platform.
64-bit issues
The following list describes important 64-bit issues.
Alignment On the Cray XMT, many data types are aligned
on 8-byte boundaries that other machines align on
2- or 4-byte boundaries. The Cray XMT uses the
following alignments:
• 1-byte boundaries: char, __int8
• 2-byte boundaries: __short16, __int16
• 4-byte boundaries: short, __short32,
float, __int32
• 8-byte boundaries: int, long, double, long
double, and all pointers
Bit shift and bit mask
Be careful when using bit shift or bit mask to extract
fields of a value. Problems can occur if the size of
the value type on the Cray XMT is different from the
size on the machine you are porting from.
Conversion of floating-point data types
In C and C++ programs, floating-point data types
are converted to doubles in all expressions. This
conversion is also made on the Cray XMT, except
for long doubles (16-bytes long) which are not
converted to doubles (8 bytes long).
Unions Unions sometimes contain assumptions about the
relative sizes of data types. For example, on some
machines, two int values use the same number
of bytes as a long. However, on the Cray XMT,
int and long values use the same number of
bytes. When in doubt, use the sizeof operator to
determine the size of data types.
Posix compliance
The following list describes issues related to IEEE Portable
Operating System Interface (Posix) compliance.
S–2479–20 43