1. A method of compiling a program to be executed on a multicore processor, the method comprising: generating an initial solution by mapping a task to a source processing element (PE) and a destination PE, and selecting a communication scheme for transmission of the task from the source PE to the destination PE; approximately optimizing the mapping and communication scheme included in the initial solution; and scheduling the task, wherein the communication scheme is designated in a compiling process.