1. A method comprising: receiving a code stream having at least one statement including one or more induction variables; determining an affine partitioning result set for the code stream, the partition result set having a processor variable, the processor variable having a range; dividing the range into range portions according to a target processor quantity; and for each range portion performing the tasks of: copying the code stream into a code segment associated with the range portion; and determining a conditional expression to control the execution of the code segment, the conditional expression including replacement of the processor variable with a corresponding transformation of the one or more induction variables; merging code segments for the range portions into a single code segment; and adding a conditional statement to control which processing unit processes a range of the induction variables.