Porting between 32 and 64 bit addressing

From HP-SEE Wiki

Jump to: navigation, search

Section contributed by IICT-BAS

The porting between 32- and 64-bit addressing of the application SET was relatively straight-forward. Since the data structures used did not exceed 2^31 in size, we did not have substantial issues with array addressing. The main tweeks that we had were during installation of the SPRNG package, which has some performance gains on 64-bit architectures. We also had to fix some issues with the relations between size of memory pointers and integers.

In general it is advisable to use standardized names like uintptr_t for an unsigned int that is of the same size as a pointer in order to do arithmetic operations with pointers. In the codes for generating the Sobol sequences we had some operations on integers which were later re-interpreted as double precision floating point numbers, for performance reasons. Such cases are best taken care of by a configure script that could detect the sizes of various types and setup proper macros that can be used later in the program. In our case we did not have problem with the different endianness of the Power and Intel processors, but in principle this issues can also be resolved by using AC_C_BIGENDIAN macro in autoconf or by including <endian.h> header directly.

Personal tools