This application claims priority to and the benefit of Korean Patent Application No. 10-2016-0002842, filed on Jan. 8, 2016, in the Korean Intellectual Property Office, the entire contents of which are incorporated herein by reference in their entirety.
1. Field
An aspect of the present disclosure relates to a method and an apparatus for visualizing a scheduling result in a multicore system.
2. Description of the Related Art
A multicore program is an application program embedded and executed in multicore hardware, and improves system performance by executing in parallel tasks using a plurality of cores. A multicore system supporting a multicore program allows tasks to be operated in parallel in several cores, thereby providing fast performance to a user. To this end, the multicore system should be developed such that tasks are efficiently distributed in several cores.
However, when the multicore system is used, the improvement of performance is not always ensured. For example, when scheduling between tasks goes wrong in the multicore system, the performance of the system may be deteriorated, or performance as high as expected may not be exhibited.
Therefore, a function of enabling a user to confirm a scheduling result of tasks should be provided so as to confirm whether the multicore system has efficiently parallelized the tasks and to control the parallelism of the tasks. Particularly, a scheduling result in a multicore system in which the movement of tasks from one core to another core is possible has its complicated contents, and hence it is essential to use a tool for visualizing the scheduling result in a form easy to understand and helping with analysis.
In one of methods for visualizing a scheduling result in a multicore system, as shown in
However, in the case of a multicore program in which interruption, synchronization, and movement of tasks between cores frequently occur, a few hundreds of context switch events may occur for a short period time of one second. Therefore, when a scheduling result including a few thousands of context switch events is visualized in the form of a two-dimensional graph on one screen, the user's degree of understanding is decreased.
In addition, when a scheduling result from a few of minutes to a few of days are collected with respect to the above-described multicore program, the size of the collected data is excessively large, and hence an overload occurs when the scheduling result is visualized in the form of a two-dimensional graph.
Consequently, methods for visualizing a scheduling result according to related arts have a disadvantage in that only a scheduling result for a short period of time is visualized. Since a complicated scheduling result is not simply visualized, a user cannot easily understand the scheduling result. Also, according to the related arts, when a scheduling result including a large amount of data is visualized, an overload occurs.
Embodiments provide a method and an apparatus for visualizing a scheduling result in a multicore system, in which, when a scheduling result including a large amount of scheduling data is visualized, a visualization is performed by reducing the scheduling data according to a preset condition.
According to an aspect of the present disclosure, there is provided a method for visualizing a scheduling result of a plurality of tasks with respect to a plurality of cores in a multicore system, the method including: extracting scheduling data in a time section to be visualized; determining whether the number of the extracted scheduling data exceeds a preset first threshold value; if the number of the extracted scheduling data exceeds the preset first threshold value, performing reduction of the extracted scheduling data; and visualizing and outputting the reduced scheduling data.
According to an aspect of the present disclosure, there is provided an apparatus for visualizing a scheduling result of a plurality of tasks with respect to a plurality of cores in a multicore system, the apparatus including: a scheduling data reduction unit configured to extract scheduling data in a time section to be visualized, determine whether the number of the extracted scheduling data exceeds a preset first threshold value, and, if the number of the extracted scheduling data exceeds the preset first threshold value, perform reduction of the extracted scheduling data; and a scheduling result output unit configured to visualize and output the reduced scheduling data.
Example embodiments will now be described more fully hereinafter with reference to the accompanying drawings; however, they may be embodied in different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the example embodiments to those skilled in the art.
In the drawing figures, dimensions may be exaggerated for clarity of illustration. It will be understood that when an element is referred to as being “between” two elements, it can be the only element between the two elements, or one or more intervening elements may also be present. Like reference numerals refer to like elements throughout.
The present disclosure now will be described more fully hereinafter with reference to the accompanying drawings, in which embodiments of the present disclosure are shown. The present disclosure should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the present disclosure to those skilled in the art.
It will be further understood that the terms “includes” and/or “including”, when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence and/or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
As used herein, the singular forms are intended to include the plural forms as well, unless the context clearly indicates otherwise.
Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings.
In the multicore system in which the visualization apparatus 100 is operated according to the embodiment of the present disclosure, tasks of a multicore program (multicore application program) 300 are parallelly processed in a plurality of cores (e.g., CPUs) 501 to 504.
A multicore scheduler 400 operated in the multicore system schedules the tasks of the multicore program 300 with respect to the plurality of cores 501 to 504, so that the tasks can be efficiently processed. Specifically, the multicore scheduler 400 assigns the tasks of the multicore program 300, which are input thereto, to the respective cores 501 to 504 according to a scheduling policy.
A scheduling data collector (or may be called as a profiler) 200 collects, as scheduling data (profiling data), processing events occurring as the multicore scheduler 400 assigns tasks to a core. In various embodiments, the processing event may be, for example, a context switch event. In an embodiment, the scheduling data collector 200 may collect scheduling data for each of the cores 501 to 504. The collected scheduling data may include information on a core in which corresponding scheduling data is scheduled, information on a kind of task, and information on a performance time.
The scheduling data collector 200 may transmit the collected scheduling data to the visualization apparatus 100.
The visualization apparatus 100 according to the embodiment of the present disclosure visualizes and outputs the scheduling data transmitted from the scheduling data collector 200. In various embodiments, when it is determined that a delay is to occur in a visualization process because the amount of scheduling data is enormous, the visualization apparatus 100 minimizes the delay, and reduces and visualizes the scheduling data such that a visualization result suitable for the size of a display can be output.
To this end, the visualization apparatus 100 according to the embodiment of the present disclosure, as shown in
The scheduling data analysis unit 110 analyzes scheduling data transmitted from the scheduling data collector 200 by sorting the scheduling data for each of the cores 501 to 504 and aligning the sorted scheduling data in a chronological order as shown in Table 1.
The scheduling data for each of the cores 501 to 504, analyzed by the scheduling data analysis unit 110, may constitute a scheduling result (profiling result).
In Table 1, a scheduling result of context switch events occurring for 0 to 92,010 ms when the processing event is a context switch event is shown as an example. Referring to Table 1, it can be seen that 9010 context switch events have occurred in core 1. For example, task 1 was performed for 0 to 100 ms, and then, as a context switch event occurred, an idle thread was performed for 100 to 200 ms. After that, task 1 was again performed for 200 to 201 ms, and task 2 was sequentially performed for 201 to 260 ms.
When it is determined that the amount of the scheduling data analyzed (aligned) by the scheduling data analysis unit 110 is too enormous to be visualized, the scheduling data reduction unit 120 performs an operation for reducing the amount of the scheduling data.
Specifically, the scheduling data reduction unit 120 extracts scheduling data on a time section to be visualized among the scheduling data. The scheduling data analyzed by the scheduling data analysis unit 110 are linked with information on performance times as shown in Table 1. Thus, the scheduling data reduction unit 120 can extract scheduling data included in the time section to be visualized, based on the information on performance times.
For example, in the embodiment of Table 1, when the visualization apparatus 100 visualizes a scheduling result included in a time section of 0 to 92,010 ms, the scheduling data reduction unit 120 extracts scheduling data performed in the time section of 0 to 92,010 ms for each of the cores 501 to 504 among the scheduling data analyzed as shown in Table 1. In the embodiment of Table 1, the extracted scheduling data may be scheduling data on 9010 context switch events with respect to core 1 (501), 9009 context switch events with respect to core 2 (502), 9010 context switch events with respect to core 3 (503), and 3010 context switch events with respect to core 4 (504), i.e., a total of 36039 context switch events.
If the number of the extracted scheduling data is equal to or greater than a preset first threshold value, the scheduling data reduction unit 120 performs data reduction.
If the number of the extracted scheduling data exceeds the first threshold value, the scheduling data reduction unit 120 determines that, although the extracted scheduling data are visualized, a user will have difficulty in understanding visualization contents.
The first threshold value means the number of scheduling data determined that the user can easily understand or easily grasp visualization contents. The first threshold value may be previously set based on a resolution of a display on which a visualization result is to be output. In various embodiments, the first threshold value may be previously set to a value that is ½ of a resolution of one side of the display on which the visualization result is to be output. The resolution of the one side of the display, which determines the first threshold value, may be a resolution of one side of the display, at which a time axis of the visualization result is to be displayed.
In the embodiment of Table 1, if the resolution of the display on which the visualization result to be output is 3682×2071 (width height), and a lateral side of the display is the one side at which the time axis of the visualization result is to be displayed, the first threshold value may be previously set to 3682/2=1841.
If the number of the extracted scheduling data exceeds the first threshold value, the scheduling data reduction unit 120 performs data reduction. In various embodiments, the scheduling data reduction unit 120 performs data reduction by excluding, from a visualization target, a portion of scheduling data extracted based on a performance time of each scheduling data. Specifically, if the performance time of scheduling data is smaller than a preset second threshold value, the scheduling data reduction unit 120 excludes the corresponding scheduling data from the visualization target. That is, the scheduling data reduction unit 120 extracts only scheduling data, each of which performance time is equal to or greater than the preset second threshold value, thereby selecting scheduling data to be finally visualized.
The second threshold value means the length of a performance time determined that, when scheduling data is visualized because its performance time is sufficiently long, the user can visually recognize and understand the scheduling data. In various embodiments, the second threshold value may be determined based on a time section to be visualized and the first threshold value. For example, the second threshold value may be previously set to time section to be visualized/first threshold value. In the embodiment of Table 1, the second threshold value is time section to be visualized/first threshold value—92,010 ms/1841—about 50 ms.
In the embodiment of Table 1, scheduling data, each of which performance time is less than 50 ms, are scheduling data indicated by bold letters in the following Table 2, and the scheduling data reduction unit 120 excludes the scheduling data from the visualization target. That is, the scheduling data reduction unit 120 determines that the scheduling data, each of which performance time is less than 50 ms, are scheduling data that the user cannot recognize even though they are visualized, and excludes the scheduling data from the visualization target.
According to the above-described embodiment of the present disclosure, a result obtained by reducing the scheduling data is shown in Table 3.
The scheduling data reduction unit 120 may transmit the reduced scheduling data to the scheduling result output unit 130.
The scheduling result output unit 130 visualizes and outputs a scheduling result including scheduling data. To this end, the scheduling result output unit 130 may include at least one display. According to implementation, the scheduling result output unit 130 may include a sound output unit, a vibration output unit, etc. The display included in the scheduling result output unit 130 may have an arbitrary resolution, and the resolution of the display may be used to determine the first threshold value.
The scheduling result output unit 130 may output the scheduling data reduced by the scheduling data reduction unit 120 in a preset form, e.g., in the form of a two-dimensional graph. For example, the scheduling result output unit 130 may output a scheduling result including the reduced scheduling data, as shown in
Specifically, in
In this case, the scheduling result output unit 130 may visualize in which core each scheduling data has been performed. For example, the scheduling result output unit 130, as shown in
However, the sorting of the cores 501 to 504 is not necessarily limited to colors, and the scheduling result output unit 130 may output a scheduling result such that the cores 501 to 504 are sorted in various manners such as patterns and index marks.
In the embodiment of
The above-described components are merely divided in a software manner, and the scheduling data analysis unit 110, the scheduling data reduction unit 120, and the scheduling result output unit 130 may be configured as one controller. However, in various embodiments, the display provided in the scheduling result output unit 130 may be configured as a separate display unit.
In the graph of
Meanwhile, in the graph of
Referring to
Next, the visualization apparatus 100 sorts the collected scheduling data for each core and aligns the sorted scheduling data in a chronological order (602). The visualization apparatus 100 may sort the scheduling data for each core in which corresponding scheduling data is scheduled, and align the scheduling data for each core in a chronological order, based on information included in the scheduling data.
The visualization apparatus 100 extracts scheduling data in a time section to be visualized from the scheduling data (603). The visualization apparatus 100 extracts scheduling data in a time section to be visualized, based on information on performance times, included in the scheduling data.
Next, the visualization apparatus 100 determines whether the number of the extracted scheduling data exceeds a preset first threshold value (604). In various embodiments, the first threshold value may be previously set based on a resolution of a display on which a visualization result is to be output. For example, the first threshold value may be set to a value that is ½ of a resolution of one side of the display on which the visualization result is to be output.
If the number of the collected scheduling data exceeds the first threshold value, the visualization apparatus 100 performs data reduction (605). Specifically, the visualization apparatus 100 selects scheduling data, each of which performance time is equal to or greater than a preset second threshold value among the extracted scheduling data. In various embodiments, the second threshold value may be previously set based on a time section to be visualized and the first threshold value. For example, the second threshold value may be previously set to length of time section to be visualized/first threshold value.
Subsequently, the visualization apparatus 100 visualizes and outputs the reduced scheduling data (606). That is, the visualized apparatus 100 visualizes and outputs the selected scheduling data. In various embodiments, the visualization apparatus 100 may output the selected scheduling data in the form of a two-dimensional graph. For example, the visualization apparatus 100 may output the selected scheduling data in the form of a two-dimensional graph using performance time and task as respective horizontal and vertical axes.
Also, in various embodiments, the visualization apparatus 100 may visualize scheduling data for each core in which the scheduling data are scheduled. For example, the visualization apparatus 100 may visualize scheduling data by assigning different colors to respective cores.
Meanwhile, if the number of the collected scheduling data does not exceed the preset first threshold value (604), the visualization apparatus 100 does not perform the data reduction but immediately visualizes and outputs the collected scheduling data (606).
In the visualization method and the visualization apparatus according to the present disclosure, the size of scheduling data is reduced to be suitable for the size of a display to be visualized, and the reduced scheduling data are visualized, so that a user can easily understand a scheduling result.
Also, although a scheduling result including a large amount of scheduling data is visualized, the scheduling result can be quickly visualized without any delay.
Example embodiments have been disclosed herein, and although specific terms are employed, they are used and are to be interpreted in a generic and descriptive sense only and not for purpose of limitation. In some instances, as would be apparent to one of ordinary skill in the art as of the filing of the present application, features, characteristics, and/or elements described in connection with a particular embodiment may be used singly or in combination with features, characteristics, and/or elements described in connection with other embodiments unless otherwise specifically indicated. Accordingly, it will be understood by those of skill in the art that various changes in form and details may be made without departing from the spirit and scope of the present disclosure as set forth in the following claims.
Number | Date | Country | Kind |
---|---|---|---|
10-2016-0002842 | Jan 2016 | KR | national |