We discuss a parallel implementation of a collisionless N-body code on
the Gray T3D. The code was previously successfully implemented on the
Connection Machine CM-5. The algorithm evolves self-gravitating syste
ms with approximate spheroidal symmetry by solving Poisson's equation
for the global potential, given a realization of the density, and then
advances the particle distribution under its own potential, solving f
or the new potential iteratively, The algorithm is naturally parallel
and can be efficiently implemented on current massively parallel archi
tectures. We discuss some of the issues that arise in porting efficien
t codes between different parallel architectures and show how changing
the structure of the code can produce dramatic speedups on different
architectures. We discuss some implications for automatic parallelizat
ion and optimization with portable compilers. (C) 1997 American Instit
ute of Physics.