next up previous 211
Next: Pointer references in Fortran 77
Up: ssn73
Previous: Changeover to 64-bit systems


Modifications to code

Making Starlink packages able to run in a 64-bit environment and handle appropriately large data sets requires changes to the source code of each package. For packages like HDS, which get their hands dirty with data structures on disk, extensive changes will be required. Most packages however can hopefully be fixed by making some more-or-less automatic changes to the source code. These changes boil down to making sure that Fortran pointers can address any allocated memory, and making sure that non-pointer integers in Fortran and C have enough bits to hold sufficiently large numbers.

Because of the difficulty of distinguishing, in any automatic fashion, variables which may need to hold big numbers from those which will not, the recommended approach is to change the type of all integer variables to a 64-bit type in 64-bit environments. There are undesirable consequences of this, the main one being that the HDS type _INTEGER becomes, as far as the user of HDS is concerned, a 64-bit type; it will still be stored on disk in 32 bits, but it is in any case a function of HDS to shield the user from the disk representation of defined types. Where images are mapped with _INTEGER type in the new system therefore, they will take up twice as much space as they need to in memory, and the process of mapping and unmapping them can be expected to be slower. There is nothing much to be done about this; fortunately, _INTEGER should not be a very common type for storing large data arrays in an NDF.

Once the increase in integer size has been made globally to the source code in a package, it would be a possibility to identify variables which do not need the extra size and change their declarations (and other parts of the code which depend on these) back to the normal integer types. In most cases such retrochanges will not be worthwhile, but they could be appropriate in either of the following situations:

The rest of this section describes the four main sets of changes which need to be made to each package.





next up previous 211
Next: Pointer references in Fortran 77
Up: ssn73
Previous: Changeover to 64-bit systems


Starlink System Note 73
Mark Taylor
13 August 2001
E-mail:ussc@star.rl.ac.uk

Copyright © 2001 Council for the Central Laboratory of the Research Councils