There are two typical ways for a compiler to generate parallel code for distributed memory multiprocessors. One is to generate
explicit message passing code and the other is to generate code for a distributed shared memory software layer. In this paper,
we propose a new compiler design that combines message passing and distributed shared memory for a single program, depending
on how data is accessed. The Linear Memory Access Descriptor (LMAD) is used to represent data distribution and data accesses
in our compiler. The LMAD can represent complex distribution and access patterns accurately. We show how LMADs may be used
to generate message passing operations. Experimental results indicate that our technique is useful for programs with both
regular and irregular access patterns.