PYRROS is a tool for scheduling and parallel code generation for distributed memory message passing architectures . In this paper, we discuss several compile-time optimization techniques used in PYRROS. The scheduling part of PYRROS optimizes both data and program mapping so that the parallel time is minimized. The communication and storage optimization part facilitates the generation of efficient parallel codes. The related issues of partitioning and 'owner computes rule' are discussed and the importance of program scheduling is demonstrated.