1. A system comprising a processor, the system configured to perform a method comprising: accessing a control flow graph that defines a data dependency and an execution sequence of a plurality of tasks of an application that executes on a plurality of system components comprising a main processor and an accelerator chip, wherein the execution sequence in the control flow graph comprises the tasks scheduled to be executed by the main processor interleaved with one or more of the tasks scheduled to be executed by the accelerator chip with the data dependency between the main processor and the accelerator chip in the execution sequence; modifying, by the processor, the execution sequence of the tasks in the control flow graph as a clustered control flow graph that clusters active and idle phases of a system component while maintaining the data dependency and reducing a control transfer frequency between the main processor and the accelerator chip, and the clustered control flow graph combines non-successive tasks of the execution sequence in a same cluster to be executed by one of the main processor and the accelerator chip in a same active phase while the other of the main processor and the accelerator chip is idle; and sending the clustered control flow graph to an operating system, wherein the operating system utilizes the clustered control flow graph for scheduling the tasks.