The availability of a very accurate dependence graph for a scalar code
is the basis for the automatic generation of an efficient parallel im
plementation. The strategy for this task which is encapsulated in a co
mprehensive data partitioning code generation algorithm is described.
This algorithm involves the data partition, calculation of assignment
ranges for partitioned arrays, addition of a comprehensive set of exec
ution control masks, altering loop limits, addition and optimisation o
f communications for all data. In this context, the development and im
plementation of strategies to merge communications wherever possible h
as proved an important feature in producing efficient parallel impleme
ntations for numerical mesh based codes. The code generation strategie
s described here are embedded within the Computer Aided Parallelisatio
n tools (CAPTools) software as a key part of a toolkit for automating
as much as possible of the parallelisation process for mesh based nume
rical codes. The algorithms used enables parallelisation of real compu
tational mechanics codes with only minor user interaction and without
any prior manual customisation of the serial code to suit the parallel
isation tool.