1. A method, in a data processing system, for optimizing code to be run in a heterogeneous data processing environment, comprising: generating a call graph for program code; identifying characteristics of procedures in the call graph, wherein identifying the characteristics of the procedures in the call graph further comprises, for each procedure in the procedures: identifying functions performed as part of the procedure; and identifying at least one of a service or another function called by the procedure; comparing the characteristics of the procedures to characteristics of processing units in the heterogeneous data processing environment, wherein comparing characteristics of the procedures to characteristics of processing units in the heterogeneous data processing environment comprises: identifying, for each characteristic of a procedure, a comparison rule for that characteristic, wherein the comparison rule identifies a characteristic of a processing unit that may offer a required feature for satisfying the characteristic of the procedure; determining a degree of matching of each processing unit of the heterogeneous data processing environment to the characteristics of the procedure; and selecting a processing unit based on the degree of matching of each processing unit of the heterogeneous data processing environment; selecting, for each of the procedures, a processing unit to execute the procedure based on results of the comparison, wherein selecting a processing unit to execute the procedure based on results of the comparison comprises: extracting a portion of the procedure to form a new procedure that is assigned to the selected processing unit for processing, and updating the call graph of the program code to include the new procedure; partitioning the program code in accordance with the selection of the processing unit for each procedure; and generating executable program code based on the partitioned program code.