1. An apparatus for generating, for a particular parallel hardware configuration that includes at least a first particular hardware resource and a second particular hardware resource heterogeneous to the first particular hardware resource, a program based on a graph associated with an application, the apparatus comprising: a memory configured to store data descriptive of a graph, the graph including: a first node representing a first execution task of a program, a second node representing a second execution task of the program, and an edge representing a data transfer between the first node and the second node; and a processor configured to generate, based on the data, program code of the program, the program code including a first state indicator that is associated with the first node and that indicates whether a first execution of a first instance of the first execution task is scheduled at the first particular hardware resource and whether a second execution of a second instance of the first execution task is scheduled at the second particular hardware resource.