Execution control program, execution control method and information processing apparatus

By classifying tasks and setting priorities in programs with data dependence, the frequency of context switches is reduced, preventing deadlocks and enhancing program performance.

JP2024129675AInactive Publication Date: 2024-09-27FUJITSU LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
JP2023039026
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-03-13
Publication Date
2024-09-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Conventional programs with data dependence in task parallelism experience frequent context switches to avoid deadlocks, leading to deteriorated performance.

Method used

Analyze the program to classify tasks into communication, synchronization, and calculation tasks based on processing content, assigning priorities such that communication tasks are executed first, followed by calculation tasks, and synchronization tasks last, while ensuring data dependencies are respected.

Benefits of technology

Reduces context switches and prevents deadlocks, thereby improving program performance by ensuring communication tasks are completed before synchronization tasks occupy threads.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024129675000001
    Figure 2024129675000001
Patent Text Reader

Abstract

To improve the performance of a program by reducing a context switch in the program.SOLUTION: An information processing apparatus 101 analyzes a program 110 to detect tasks 1, 2, 3. The information processing apparatus 101 classifies the detected respective tasks 1, 2, 3 into any of a communication task 121, a synchronous task 122 and an operation task 123 depending on the processing contents of the tasks 1, 2, 3. The information processing apparatus 101 sets priorities to each of the detected tasks 1, 2, 3 so that the classified communication task 121 is more preferentially executed than the operation task 123 and the synchronous task 122, and the operation task 123 is more preferentially executed than the synchronous task 122. The information processing apparatus 101 controls the execution of the detected tasks 1, 2, 3 based on the set priorities.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to an execution control program, an execution control method, and an information processing device. [Background technology]

[0002] Traditionally, one of the programming techniques in distributed memory environments is task parallelism with data dependency. In a program written in task parallelism with data dependency, communication may be performed within a task to share data between processes. In addition, a task that performs synchronization to ensure communication completion may occupy a thread, resulting in a deadlock.

[0003] Prior art techniques include a technique in which a higher priority is given to tasks that take longer from the start of execution to the end of the entire program, and whenever the processor has free space, the execution status is calculated as if the highest priority task currently executable were assigned, and the priority of the task is then changed.

[0004] There is also a technique for determining whether a specific process included in a task will take less time to execute using a coprocessor or without using a coprocessor. There is also a technique for controlling the operation of a GPU based on a deadline by which a GPU task must be completed, the time required to complete the execution of a running GPU task, and an estimate of the time required to execute other GPU tasks. [Prior art documents] [Patent documents]

[0005] [Patent Document 1] Japanese Patent Application Publication No. 5-242051 [Patent Document 2] JP 2019-106065 A [Patent Document 3] US Patent Application Publication No. 2018 / 0365062 [Patent Document 4] US Patent Application Publication No. 2018 / 0373562 Summary of the Invention [Problem to be solved by the invention]

[0006] However, in the conventional technology, in a program such as a task-parallel description with data dependency, context switching to avoid deadlock occurs frequently, resulting in a problem of degradation in program performance.

[0007] In one aspect, the present invention aims to reduce context switches in a program to improve the performance of the program. [Means for solving the problem]

[0008] In one embodiment, an execution control program is provided which analyzes a program to detect tasks, classifies each of the detected tasks into one of a communication task that performs communication related to data sharing, a synchronization task that waits for completion of communication started by the communication task, and a calculation task different from the communication task and the synchronization task depending on the processing content of the task, sets a priority for each of the detected tasks so that the classified communication task is executed with priority over the calculation task and the synchronization task, and the calculation task is executed with priority over the synchronization task, and controls the execution of each of the detected tasks based on the set priority. Effect of the Invention

[0009] Advantageous Effects of Invention According to one aspect of the present invention, it is possible to reduce context switches in a program and improve the performance of the program. [Brief description of the drawings]

[0010] [Figure 1] FIG. 1 is a diagram illustrating an example of an execution control method according to an embodiment. [Diagram 2] FIG. 2 is an explanatory diagram showing an example of a program written in task parallelism with data dependency. [Diagram 3] FIG. 3 is an explanatory diagram illustrating an example of non-blocking communication. [Figure 4A] FIG. 4A is an explanatory diagram showing the first communication pattern. [Figure 4B] FIG. 4B is an explanatory diagram showing the second communication pattern. [Diagram 5] FIG. 5 is a block diagram showing an example of the hardware configuration of the information processing device 101. As shown in FIG. [Figure 6] FIG. 6 is a block diagram showing an example of the functional configuration of the information processing device 101. As shown in FIG. [Figure 7] FIG. 7 is an explanatory diagram showing a specific example of the target program. [Figure 8A] FIG. 8A is an explanatory diagram (part 1) showing an example of task classification. [Figure 8B] FIG. 8B is an explanatory diagram (part 2) showing an example of task classification. [Figure 8C] FIG. 8C is an explanatory diagram (part 3) showing an example of task classification. [Figure 9A] FIG. 9A is an explanatory diagram (part 1) showing an example of setting priorities for tasks. [Figure 9B] FIG. 9B is an explanatory diagram (part 2) showing an example of setting priorities for tasks. [Figure 9C] FIG. 9C is an explanatory diagram (part 3) showing an example of setting priorities for tasks. [Figure 10] FIG. 10 is a flowchart showing an example of a procedure of a priority setting process of the information processing device 101. [Figure 11] FIG. 11 is a flowchart showing an example of an execution control processing procedure of the information processing device 101. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0011] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, an embodiment of an execution control program, an execution control method, and an information processing device according to the present invention will be described in detail with reference to the accompanying drawings.

[0012] (Embodiment) Fig. 1 is an explanatory diagram showing an example of an execution control method according to an embodiment. In Fig. 1, an information processing device 101 is a computer that controls the execution of a program 110. The information processing device 101 is, for example, a PC (Personal Computer). The information processing device 101 may also be a server.

[0013] The program 110 is, for example, a program with a task parallel description with data dependency. A task parallel description with data dependency is a description for executing tasks in parallel by dividing operations into tasks and explicitly describing the read / write of data used within the tasks. A task is an execution unit of a program (for example, the program 110).

[0014] For example, in task parallelism with data dependencies using OpenMP (Open Multi-Processing), tasks are executed in parallel based on the data dependency descriptions (in, out) between tasks. OpenMP is an API (Application Programming Interface) that enables parallel programming on shared memory machines.

[0015] For example, by describing input / output processing (in, out) within a task, dependencies such as flow dependencies, reverse flow dependencies, and output dependencies can arise. A flow dependency is when data is written and then read (out → in). A reverse flow dependency is the opposite of a flow dependency, where a write occurs after a read (in → out). An output dependency is when a write occurs and then another value is written (out → out).

[0016] Tasks cannot be executed in parallel if there is a dependency between them based on data dependency, whether that be flow dependency, reverse flow dependency, or output dependency. For this reason, the compiler runtime schedules tasks based on the description of input / output processing (in, out) within the task, and executes them on each thread. The runtime is a component (function) for executing programs.

[0017] Here, we will explain an example of a program written in task parallelism with data dependency using Figure 2. In OpenMP, tasks are written using directives to the compiler called pragma directives (#pragma).

[0018] Fig. 2 is an explanatory diagram showing an example of a program written in task parallelism with data dependency. In Fig. 2, a program 200 is an example of a program implemented in task parallelism with data dependency. Depend is a directive clause for describing input / output processing (in, out) within a task.

[0019] In program 200, task 1 writes to variable A, so out:A. task 2 writes to variable B, so out:B. task 3 reads variables A and B, so in:A,B, and writes to variable C, so out:C. In program 200, there is no dependency between task 1 and task 2, so they are executed in parallel. On the other hand, task 3 has a flow dependency with tasks 1 and 2, so it is executed after tasks 1 and 2 are completed.

[0020] In one execution form of task parallelism with data dependency, for example, a process is assigned to each node, threads corresponding to cores are generated within the process, and tasks are executed on the threads. In order to share data between processes, communication may be performed within the task.

[0021] The communication between processes is performed, for example, by non-blocking communication. Unlike blocking communication, which does not allow other processing after transmission or reception is completed, non-blocking communication allows other processing to be performed until synchronization is achieved after transmission or reception is completed in order to speed up the program.

[0022] Here, an example of non-blocking communication will be described with reference to FIG.

[0023] FIG. 3 is an explanatory diagram showing an example of non-blocking communication. As shown in FIG. 3, in non-blocking communication, after Isend / Irecv is executed, another process (e.g., Calc) can be executed before Wait is executed. Isend / Irecv represents sending / receiving process. Wait represents synchronization process for ensuring completion of communication. Calc represents calculation process. Note that after Isend / Irecv is executed, the actual start of communication is indicated by a dashed arrow because it is determined by runtime.

[0024] On the other hand, depending on the number of executing threads and the number of communications that can be executed simultaneously without data dependency, a task that performs synchronization (guaranteeing communication completion) (synchronous task) may occupy a thread, causing a deadlock. A deadlock occurs when two or more processing units wait for each other to finish processing, resulting in none of the processes being able to proceed further.

[0025] Here, an example of a communication pattern when inter-process communication is performed within a task by non-blocking communication will be described with reference to Figures 4A and 4B. Here, we assume that a task involving four communications (Isend0~3 / Irecv0~3, Wait0~3) with no data dependency from process 0 to process 1 is executed according to the existing runtime scheduling.

[0026] Fig. 4A is an explanatory diagram showing a first communication pattern. Fig. 4B is an explanatory diagram showing a second communication pattern. Fig. 4A shows the first communication pattern in which inter-process communication is performed within a task by non-blocking communication. Fig. 4B shows the second communication pattern in which inter-process communication is performed within a task by non-blocking communication. However, Figs. 4A and 4B show only some of the tasks.

[0027] In the first communication pattern, a deadlock does not occur because a communication pair (tasks with the same suffix) is created between processes 0 and 1 as a result of tasks being assigned to threads in each process 0 and 1. On the other hand, in the second communication pattern, a deadlock occurs because a communication pair is not created between processes 0 and 1 as a result of tasks being assigned to threads in each process 0 and 1.

[0028] Specifically, in the second communication pattern, communication is not completed, and each synchronous task occupies a thread, causing a deadlock. For example, in process 0, communication Isend0,1 is not completed, and each synchronous task (Wait0,1) occupies a thread. Also, in process 1, communication Irecv2,3 is not completed, and each synchronous task (Wait2,3) occupies a thread. This causes a deadlock.

[0029] Thus, in the conventional technology, the communication pattern can be either the first communication pattern or the second communication pattern depending on the runtime scheduling.

[0030] Here, a deadlock can be avoided by using a context switch to evacuate the synchronous task being executed and give priority to other tasks. However, because a context switch has overhead, frequent context switches can cause a decrease in program performance.

[0031] The overhead of a context switch includes, for example, the overhead of saving and restoring the ongoing process, as well as the time until the same task is submitted again. If there are a large number of tasks in the queue, the time until the same task is submitted again becomes longer.

[0032] Therefore, in this embodiment, an execution control method will be described that prevents deadlock due to synchronous tasks and reduces context switches in order to speed up the program 110. Here, an example of processing by the information processing device 101 will be described.

[0033] (1) The information processing device 101 analyzes the program 110 to detect tasks. Specifically, for example, the information processing device 101 analyzes the program 110 to identify task instructions. A task instruction is an instruction for generating a task. Then, the information processing device 101 detects tasks corresponding to each of the identified task instructions from the program 110.

[0034] In the example of FIG. 1, it is assumed that tasks 1, 2, and 3 are detected from a program 110.

[0035] (2) The information processing device 101 classifies each of the detected tasks 1, 2, and 3 into a communication task 121, a synchronization task 122, and a calculation task 123 according to the processing content of the task 1, 2, or 3. Here, the communication task 121 is a task that performs communication related to data sharing. The synchronization task 122 is a task that waits for the completion of the communication started by the communication task 121. The calculation task 123 is a task different from the communication task 121 and the synchronization task 122.

[0036] Specifically, for example, the information processing device 101 classifies each of the tasks 1, 2, and 3 into a communication task 121, a synchronization task 122, or an arithmetic task 123 based on the processing contents of the statements of the tasks 1, 2, and 3. A statement is a statement such as an individual procedure, command, or declaration that is a constituent unit of a program (for example, the program 110), and includes, for example, an expression, a function call, and the like.

[0037] In the example of FIG. 1, it is assumed that task 1 is classified as a computation task 123, task 2 is classified as a communication task 121, and task 3 is classified as a synchronization task 122.

[0038] (3) The information processing device 101 sets priorities for the detected tasks 1, 2, and 3 so that the classified communication task 121 is executed with priority over the calculation task 123 and the synchronization task 122, and the calculation task 123 is executed with priority over the synchronization task 122. The priorities are used, for example, to determine which task is to be executed with priority in a compiler (runtime) when the program 110 is executed.

[0039] In the example of FIG. 1, it is assumed that task 2 classified as communication task 121 is set to a high priority, task 1 classified as computation task 123 is set to a medium priority, and task 3 classified as synchronization task 122 is set to a low priority.

[0040] (4) The information processing device 101 controls the execution of the detected tasks 1, 2, and 3 based on the set priorities. Specifically, for example, in the runtime of the compiler, scheduling is performed according to the priorities set for each of the tasks 1, 2, and 3. As a result, the tasks 1, 2, and 3 are executed in the order of highest priority: "task 2 ⇒ task 1 ⇒ task 3."

[0041] However, if there is a data dependency between tasks, the data dependency takes precedence over the priority. For example, even if task 2 has a "high" priority, if there is a data dependency with another task, it will not be executed until that data dependency is satisfied. In the example of Figure 1, it is assumed that there is no dependency other than the dependency between communication task 121 and synchronization task 122.

[0042] As a result, according to the information processing apparatus 101, it is possible to prevent the occurrence of a deadlock due to a synchronous task (for example, the synchronous task 122) while reducing context switches in the program 110, thereby improving the performance of the program 110.

[0043] 1, among tasks 1, 2, and 3, the communication task 121 (task 2) is executed first, which brings the start of communication forward, and then the calculation task 123 (task 1) is executed, which performs calculations until the communication is completed. Then, when the synchronization task 122 (task 3) is executed last, if the communication of the communication task 121 (task 2) is completed, it becomes unnecessary to execute a context switch, and it is possible to prevent the performance of the program 110 from deteriorating.

[0044] (Example of hardware configuration of information processing device 101) Next, an example of the hardware configuration of the information processing device 101 will be described with reference to FIG.

[0045] Fig. 5 is a block diagram showing an example of a hardware configuration of the information processing device 101. In Fig. 5, the information processing device 101 has a CPU (Central Processing Unit) 501, a memory 502, a disk drive 503, a disk 504, a communication I / F (Interface) 505, a display 506, an input device 507, a portable recording medium I / F 508, and a portable recording medium 509. In addition, each component is connected to each other by a bus 500.

[0046] Here, the CPU 501 is responsible for the overall control of the information processing device 101. The CPU 501 may have multiple cores. The memory 502 has, for example, a read only memory (ROM), a random access memory (RAM), and a flash ROM. Specifically, for example, the flash ROM stores an operating system (OS) program, the ROM stores application programs, and the RAM is used as a work area for the CPU 501. The programs stored in the memory 502 are loaded into the CPU 501 to cause the CPU 501 to execute the coded processes.

[0047] The disk drive 503 controls reading / writing of data from / to the disk 504 under the control of the CPU 501. The disk 504 stores data written under the control of the disk drive 503. The disk 504 is, for example, a magnetic disk, an optical disk, or the like.

[0048] The communication I / F 505 is connected to a network 510 through a communication line, and is connected to an external computer via the network 510. The communication I / F 505 manages the interface between the network 510 and the inside of the device, and controls input and output of data from the external computer. The network 510 is, for example, the Internet, a LAN (Local Area Network), or a WAN (Wide Area Network). The communication I / F 505 is, for example, a modem or a LAN adapter.

[0049] The display 506 is a display device that displays a cursor, an icon, a tool box, and data such as documents, images, function information, etc. The display 506 is, for example, a liquid crystal display or an organic EL (Electroluminescence) display.

[0050] The input device 507 has keys for inputting characters, numbers, various instructions, etc., and is used to input data. The input device 507 may be a keyboard, a mouse, or a touch panel type input pad or numeric keypad.

[0051] The portable recording medium I / F 508 controls reading / writing of data from / to the portable recording medium 509 under the control of the CPU 501. The portable recording medium 509 stores data written under the control of the portable recording medium I / F 508. The portable recording medium 509 is, for example, a CD (Compact Disc)-ROM, a DVD (Digital Versatile Disk), or a USB (Universal Serial Bus) memory.

[0052] It should be noted that the information processing device 101 does not necessarily have to include, for example, the disk drive 503, the disk 504, the portable recording medium I / F 508, and the portable recording medium 509 among the above-mentioned components.

[0053] (Example of functional configuration of information processing device 101) Next, an example of the functional configuration of the information processing device 101 will be described with reference to FIG.

[0054] FIG. 6 is a block diagram showing an example of a functional configuration of the information processing device 101. In FIG. 6, the information processing device 101 includes a reception unit 601, a detection unit 602, a classification unit 603, a setting unit 604, and an execution control unit 605. The reception unit 601 to the execution control unit 605 are functions that become the control unit 600, and specifically, the functions are realized by making the CPU 501 execute a program stored in a storage device such as the memory 502, the disk 504, or the portable recording medium 509 shown in FIG. 5, or by the communication I / F 505. The processing results of each functional unit are stored in a storage device such as the memory 502 or the disk 504. To explain in more detail, for example, the reception unit 601 to the execution control unit 605 are realized by a compiler of the information processing device 101.

[0055] The receiving unit 601 receives a program to be executed. The program to be executed is, for example, a program written in task parallelism with data dependency, and is a program for HPC (High Performance Computing) using OpenMP. The target program corresponds to, for example, a process.

[0056] In the following description, a program to be executed may be referred to as a “target program.” A specific example of a target program will be described later with reference to FIG.

[0057] Specifically, for example, the reception unit 601 receives the target program through a user's operation input using the input device 507 illustrated in Fig. 5. The reception unit 601 may also receive the target program from an external computer via the communication I / F 505, thereby receiving the target program.

[0058] The detection unit 602 analyzes the target program to detect tasks. Specifically, for example, the detection unit 602 analyzes the target program to identify task directives from the target program. A task directive is a directive for generating a task. For example, in the case of OpenMP, the task directive is "#pragma omp task." Then, the detection unit 602 detects tasks corresponding to each of the identified task directives from the target program.

[0059] An example of task detection will be described later with reference to FIG.

[0060] The classification unit 603 classifies each detected task into a communication task, a synchronization task, or a computation task different from the communication task and the synchronization task, depending on the processing content of the task. Here, a communication task is a task that performs communication related to data sharing. Data sharing is, for example, data sharing between processes. A synchronization task is a task that waits for the completion of communication started by a communication task. A computation task is a task other than a communication task and a synchronization task.

[0061] Specifically, for example, the classification unit 603 classifies each detected task into a communication task, a synchronization task, or an arithmetic task based on the processing content of the statement of each task. A statement is a building block of a program, and corresponds to the processing executed in a task. Here, one task is assumed to have one statement.

[0062] To explain in more detail, for example, when the processing content of the detected task (description indicating the processing content of the statement) includes a first function (character string representing the first function), the classification unit 603 may classify the detected task as a communication task. Here, the first function is a function used when executing a communication task, and is set in advance. The character string (function name) representing the first function is, for example, Isend, Irecv, etc.

[0063] Furthermore, the classification unit 603 may classify the detected task into a synchronization task when the processing content of the detected task includes a second function (a character string representing the second function). Here, the second function is a function used when executing a synchronization task, and is set in advance. The character string representing the second function (function name) is, for example, Wait. Furthermore, the classification unit 603 may classify the detected task into a calculation task when the processing content of the detected task does not include either the first function or the second function.

[0064] Examples of task classification will be described later with reference to FIGS. 8A, 8B, and 8C.

[0065] The setting unit 604 sets a priority for each of the detected tasks so that the classified communication tasks are executed with priority over the computation tasks and synchronization tasks, and the computation tasks are executed with priority over the synchronization tasks. For example, in the case of OpenMP, the setting unit 604 uses a priority clause to set a priority for each of the detected tasks. For example, the larger the priority value, the higher the priority and the higher the execution priority.

[0066] Specifically, for example, the setting unit 604 sets a priority of "10" for each task classified as a communication task in the target program using a priority clause. The setting unit 604 also sets a priority of "5" for each task classified as a computation task in the target program using a priority clause. The setting unit 604 also sets a priority of "0" for each task classified as a synchronization task in the target program using a priority clause.

[0067] An example of setting priorities for tasks in a target program will be described later with reference to FIGS. 9A, 9B, and 9C.

[0068] The execution control unit 605 controls the execution of each detected task based on the set priority. Specifically, for example, the execution control unit 605 executes a task with a priority of "10" before a task with a priority of "5,0". Also, the execution control unit 605 executes a task with a priority of "5" before a task with a priority of "0".

[0069] However, in the case of a program described in task parallelism with data dependency, a data dependency may exist between tasks. In this case, the data dependency takes precedence over the priority. Specifically, for example, the execution control unit 605 controls the execution of each detected task based on the set priority and the data dependency between tasks described in the target program.

[0070] As a result, among the tasks detected from the target program, those that have data dependencies with other tasks are executed according to the set priority after the data dependencies with the other tasks are satisfied. The execution order of the tasks is controlled, for example, by the runtime of the compiler.

[0071] (Specific examples of applicable programs) Next, a specific example of the target program will be described with reference to FIG.

[0072] Fig. 7 is an explanatory diagram showing a specific example of a target program. In Fig. 7, a target program 700 is a program written in task parallelism with data dependency using OpenMP. OpenMP directives are written using pragmas (#pragma) and take the form "#pragma omp...".

[0073] For example, "#pragma omp task" specifies a task. task0, task1, task2, task3, task4, task5, task6, task7, and task8 are identifiers for identifying tasks. In the target program 700, Irecv and Wait are executed four times and func is executed once, which may cause a deadlock.

[0074] Specifically, there is a dependency between the communication task (Irecv) and the synchronization task (Wait) of "communication buffer and MPI_Request output dependency: out → out". The communication task (Irecv) and the synchronization task (Wait) are associated with each other by req# (#=0,1,2,3). For example, Irecv of task0 is associated with Wait of task5 by req0. There is no dependency between tasks other than the communication task (Irecv) and the synchronization task (Wait).

[0075] Here, an example of task detection will be described.

[0076] The detection unit 602 analyzes the target program 700 and identifies task directives (#pragma omp task) from the target program 700. The detection unit 602 then detects tasks corresponding to each of the identified task directives from the target program 700. Here, task0 to task8 are detected.

[0077] Note that N*N task4s are generated because of a for loop (tasks are executed within a loop). Here, the detection unit 602 detects task4 as one task (since there is no problem in detecting it as one task for the purpose of assigning priority).

[0078] (Task classification example) Next, an example of task classification will be described with reference to FIGS. 8A, 8B, and 8C.

[0079] 8A, 8B, and 8C are explanatory diagrams showing examples of task classification. In FIG. 8A, a program 810 shows task0, task1, task2, and task3 classified as communication tasks among task0 to task8 detected from the target program 700. The processing content of each of task0, task1, task2, and task3 includes the character string "Irecv" that represents a function used when executing a communication task. Therefore, task0, task1, task2, and task3 are classified as communication tasks.

[0080] 8B, program 820 shows task 5, task 6, task 7, and task 8 classified as synchronous tasks among task 0 to task 8 detected from target program 700. The processing content of each of task 5, task 6, task 7, and task 8 includes the character string "Wait" which represents a function used when executing the synchronous task. Therefore, task 5, task 6, task 7, and task 8 are classified as synchronous tasks.

[0081] 8C, the program 830 shows task 4, which is classified as a computation task among tasks 0 to 8 detected from the target program 700. The processing content of task 4 does not include the character string "Irecv,Wait" which indicates a function used when executing a communication task or a synchronization task. Therefore, task 4 is classified as a computation task.

[0082] (Example of setting priority for a task) Next, an example of setting priorities for tasks in a target program will be described with reference to FIGS. 9A, 9B and 9C.

[0083] 9A, 9B, and 9C are diagrams showing examples of setting priorities for tasks. Here, it is assumed that the priorities (PRIO_COMM, PRIO_CALC, PRIO_SYNC) are defined as follows. The larger the priority value, the higher the priority (PRIO_COMM>PRIO_CALC>PRIO_SYNC).

[0084] #define PRIO_COMM 10 #define PRIO_CALC 5 #define PRIO_SYNC 0

[0085] 9A, the program 810 shows task0, task1, task2, and task3 classified as communication tasks. The setting unit 604 sets a priority of "10" for each of task0, task1, task2, and task3 classified as communication tasks using a priority clause. Here, "priority(PRIO_COMM)" is output for each of task0, task1, task2, and task3.

[0086] 9B, the program 820 shows task5, task6, task7, and task8 classified as synchronous tasks. The setting unit 604 sets a priority of "0" to each of task5, task6, task7, and task8 classified as synchronous tasks using a priority clause. Here, "priority(PRIO_SYNC)" is output for each of task5, task6, task7, and task8.

[0087] 9C, the program 830 shows task4 classified as a computation task. The setting unit 604 sets a priority level of "5" for task4 classified as a computation task using a priority clause. Here, "priority(PRIO_CALC)" is output for task4. Note that the actual priority levels for each of tasks 0 to 8 are set for the target program 700, for example.

[0088] If no priority is assigned to tasks 0 to 8, a deadlock as shown in Fig. 4B may occur due to communication pairs not being aligned depending on the method of runtime scheduling. For example, a deadlock may occur when "task2→task7" is executed in thread 0 of process 1 shown in Fig. 4B, and "task3→task8" is executed in thread 1. Also, a synchronization task may be executed immediately after the execution of a communication task, and the synchronization task may occupy the thread until the communication is completed, or a context switch may be executed.

[0089] In response to this, the information processing device 101 assigns priorities to each of task0 to task8, so that the synchronization tasks (task5, task6, task7, task8) are executed after all communication tasks (task0, task1, task2, task3) are completed. In addition, by assigning priorities of "communication task>calculation task>synchronous task", the calculation task (task4) is executed during communication (after execution of tasks0 to task3), and then the synchronization tasks (task5 to task8) are executed. If the communication is completed during the execution of the calculation task (task4), it is possible to prevent the synchronization tasks (task5 to task8) from occupying threads and the execution of context switching. In addition, even if the communication is not completed even after the calculation task (task4) is completed, the processing of the target program 700 is completed earlier by the amount that the calculation task (task4) has been completed, compared to the case where the synchronization tasks (task5 to task8) are executed immediately after the execution of the communication tasks (task0 to task3).

[0090] (Various processing procedures of the information processing device 101) Next, a description will be given of various processing procedures of the information processing device 101. First, a priority setting processing procedure of the information processing device 101 will be described with reference to FIG.

[0091] Fig. 10 is a flowchart showing an example of a priority setting process procedure of the information processing device 101. In the flowchart of Fig. 10, first, the information processing device 101 analyzes a target program to detect tasks (step S1001). Next, the information processing device 101 selects an unselected task from the detected tasks (step S1002).

[0092] Then, the information processing device 101 refers to the processing content of the statement of the selected task and judges whether the selected task is a communication task or not (step S1003). If it is judged to be a communication task (step S1003: Yes), the information processing device 101 sets a priority according to the communication task for the selected task (step S1004) and proceeds to step S1008. The priority according to the communication task is, for example, a priority of "10".

[0093] Also, in step S1003, if the selected task is not a communication task (step S1003: No), the information processing device 101 refers to the processing content of the statement of the selected task and determines whether the selected task is a synchronous task (step S1005).

[0094] If it is determined that the task is a synchronous task (step S1005: Yes), the information processing device 101 sets a priority according to the synchronous task for the selected task (step S1006) and proceeds to step S1008. The priority according to the synchronous task is, for example, a priority of "0".

[0095] In addition, in step S1005, if the selected task is not a synchronous task (step S1005: No), the information processing device 101 sets a priority according to the computation task for the selected task (step S1007). The priority according to the computation task is, for example, a priority of "5".

[0096] Next, the information processing device 101 determines whether or not there is an unselected task among the detected tasks (step S1008). If there is an unselected task (step S1008: Yes), the information processing device 101 returns to step S1002. On the other hand, if there is no unselected task (step S1008: No), the information processing device 101 ends a series of processes according to this flowchart.

[0097] As a result, the information processing device 101 can classify each task in the target program into a communication task, a synchronization task, or a calculation task according to the processing content of the task, and set a different priority according to the classification result. For example, when three types of tasks are mixed in a queue, the information processing device 101 can set a priority for each task so that the communication task is executed with priority over the calculation task and the synchronization task, and the calculation task is executed with priority over the synchronization task.

[0098] Next, the execution control processing procedure of the information processing device 101 will be described with reference to FIG. 11. Here, a model is assumed in which one thread in a process generates a task, and another thread executes the task. The thread that generates a task generates the task and inserts the generated task into a queue. Also, assuming that a task without a priority may be written by a user, two types of queues are provided to separate tasks with a priority set from tasks without a priority set. Tasks with a priority set are sorted in descending order of priority when inserted into a queue. The execution control processing of the information processing device 101 is executed, for example, by a runtime.

[0099] Fig. 11 is a flowchart showing an example of an execution control processing procedure of the information processing device 101. In the flowchart of Fig. 11, first, the information processing device 101 determines whether or not the priority queue is empty (step S1101). If the priority queue is not empty (step S1101: No), the information processing device 101 proceeds to step S1103.

[0100] On the other hand, if the priority queue is empty (step S1101: Yes), the information processing device 101 determines whether the other queue that is not the priority queue is empty (step S1102). If the queue is not empty (step S1102: No), the information processing device 101 proceeds to step S1103.

[0101] Then, the information processing device 101 extracts tasks from the target queue (step S1103). If the target queue is a priority queue, tasks are extracted in order of priority. If the target queue is the other queue that is not a priority queue, tasks are extracted in the order in which they were added to the queue, for example.

[0102] Next, the information processing device 101 judges whether the data dependency of the extracted task is satisfied (step S1104). The data dependency being satisfied means that the data dependency with other tasks is satisfied or there is no data dependency with other tasks.

[0103] If the data dependency is satisfied (step S1104: Yes), the information processing device 101 executes the extracted task (step S1105). Then, the information processing device 101 changes the state to one in which the target data dependency is satisfied (step S1106), and returns to step S1101.

[0104] Note that changing to a state where the target data dependency is satisfied corresponds to, for example, when a depend(in:A) task is executed, the runtime holds the state "reading of variable A is completed." This state allows the runtime to determine whether the data dependency is satisfied and to determine the next task that can be executed.

[0105] If the data dependency is not satisfied in step S1104 (step S1104: No), the information processing device 101 returns the extracted task to the target queue (step S1107) and returns to step S1101. If the queue is empty in step S1102 (step S1102: Yes), the information processing device 101 ends the series of processes according to this flowchart.

[0106] This allows the information processing device 101 to control the execution of tasks in the target program so that communication tasks are executed with priority over computation tasks and synchronization tasks, and computation tasks are executed with priority over synchronization tasks.

[0107] Note that context switching is automatically performed within a function of MPI (Message Passing Interface) communication depending on the processing status of a task, for example. Also, a context switch can be inserted by the user at any point in the target program using a directive (in the case of OpenMP).

[0108] As described above, the information processing device 101 according to the embodiment can analyze a target program to detect tasks, and classify each detected task into a communication task, a synchronization task, or a computation task according to the processing content of the task. The target program is, for example, a program with a task parallel description with data dependency. Then, the information processing device 101 can set a priority for each detected task so that the classified communication task is executed with priority over the computation task and the synchronization task, and the computation task is executed with priority over the synchronization task, and can control the execution of each detected task based on the set priority.

[0109] As a result, the information processing device 101 can reduce context switching while preventing the occurrence of deadlock due to a synchronization task in the target program, thereby improving the performance of the target program. A synchronization task is a task that executes synchronization to ensure the completion of communication executed within a task to share data between processes. For example, the information processing device 101 can make it easier for a computation task to be executed after the execution of a communication task, and then for a synchronization task to be executed thereafter, by prioritizing the tasks as "communication task>calculation task>synchronization task". As a result, if communication is completed during the execution of a computation task, the information processing device 101 can prevent the synchronization task from occupying a thread or the occurrence of a context switch. Even if communication is not completed even after all computation tasks have been completed, the processing of the target program is completed earlier by the amount that all computation tasks have been completed, compared to the case where a synchronization task is executed immediately after the execution of a communication task.

[0110] Furthermore, according to the information processing device 101, it is possible to control the execution of each of the detected tasks based on the set priority and the data dependency between the tasks described in the target program.

[0111] In this way, the information processing device 101 can control the execution of tasks so as to satisfy data dependencies (flow dependencies, reverse flow dependencies, output dependencies, etc.) in consideration of data dependencies between tasks. For example, among tasks detected from the target program, a task having a data dependency with another task is executed according to a set priority after the data dependency with the other task is satisfied.

[0112] Moreover, according to the information processing device 101, when the processing content of the detected task includes a first function used when executing a communication task, the detected task can be classified as a communication task. Moreover, according to the information processing device 101, when the processing content of the detected task includes a second function used when executing a synchronization task, the detected task can be classified as a synchronization task. Moreover, according to the information processing device 101, when the processing content of the detected task includes neither the first function nor the second function, the detected task can be classified as a calculation task.

[0113] This allows the information processing apparatus 101 to classify tasks using predetermined function names such as Isend, Irecv, and Wait as clues.

[0114] Furthermore, the information processing device 101 can analyze a target program, identify task instructions from the target program, and detect tasks corresponding to the respective identified task instructions from the target program.

[0115] This allows the information processing device 101 to detect a task using a task directive such as "#pragma omp task" of OpenMP as a clue.

[0116] Furthermore, according to the information processing apparatus 101, it is possible to set a priority for each detected task by using a priority clause.

[0117] This enables the information processing device 101 to assign a priority to each task so that the priority can be recognized on the runtime side of the compiler.

[0118] From these points, the information processing device 101 makes it possible to classify tasks and set priorities of a task-parallel program with data dependencies using a compiler, and control the execution of multiple tasks that have no dependencies or whose dependencies are satisfied. This enables the information processing device 101 to reduce context switches while preventing the occurrence of deadlocks, thereby improving the performance of HPC programs and the like.

[0119] The execution control method described in this embodiment can be realized by executing a prepared program on a computer such as a personal computer or a workstation. This execution control program is recorded on a computer-readable recording medium such as a hard disk, a flexible disk, a CD-ROM, a DVD, or a USB memory, and is executed by being read from the recording medium by the computer. This execution control program may also be distributed via a network such as the Internet.

[0120] The following supplementary notes are further disclosed regarding the above-described embodiment.

[0121] (Appendix 1) Analyze the program to detect tasks, classifying each of the detected tasks into one of a communication task for performing communication related to data sharing, a synchronization task for waiting for completion of communication started by the communication task, and a calculation task different from the communication task and the synchronization task, according to the processing content of the task; setting a priority for each of the detected tasks so that the classified communication tasks are executed with priority over the computation tasks and the synchronization tasks, and the computation tasks are executed with priority over the synchronization tasks; Controlling execution of each of the detected tasks based on the set priorities. An execution control program that causes a computer to execute a process.

[0122] (Additional Note 2) The control process is controlling the execution of each of the detected tasks based on the set priority and data dependencies between the tasks described in the program; 2. The execution control program according to claim 1 .

[0123] (Appendix 3) The classification process is classifying the task as the communication task when a first function used in executing the communication task is included in the processing content of the detected task; classifying the task as the synchronous task when a second function used in executing the synchronous task is included in the processing content of the detected task; classifying the task into the calculation task when the detected processing content of the task does not include either the first function or the second function; 3. The execution control program according to claim 1 or 2.

[0124] (Appendix 4) The detection process includes: Analyzing the program to identify task directives from the program; detecting a task corresponding to each of the identified task instructions from the program; 4. The execution control program according to claim 1,

[0125] (Appendix 5) The setting process is as follows: 5. The execution control program according to claim 1, further comprising: setting a priority for each of the detected tasks by using a priority clause.

[0126] (Appendix 6) The execution control program according to appendix 2, characterized in that among the detected tasks, a task that has a data dependency with another task is executed according to the set priority after the data dependency with the other task is satisfied.

[0127] (Supplementary Note 7) The execution control program according to any one of Supplementary Notes 1 to 6, wherein the program is a program written in task parallelism with data dependency.

[0128] (Appendix 8) Analyze the program to detect tasks, classifying each of the detected tasks into one of a communication task for performing communication related to data sharing, a synchronization task for waiting for completion of communication started by the communication task, and a calculation task different from the communication task and the synchronization task, according to the processing content of the task; setting a priority for each of the detected tasks so that the classified communication tasks are executed with priority over the computation tasks and the synchronization tasks, and the computation tasks are executed with priority over the synchronization tasks; Controlling execution of each of the detected tasks based on the set priorities. An execution control method, characterized in that processing is executed by a computer.

[0129] (Appendix 9) Analyze the program to detect tasks, classifying each of the detected tasks into one of a communication task for performing communication related to data sharing, a synchronization task for waiting for completion of communication started by the communication task, and a calculation task different from the communication task and the synchronization task, according to the processing content of the task; setting a priority for each of the detected tasks so that the classified communication tasks are executed with priority over the computation tasks and the synchronization tasks, and the computation tasks are executed with priority over the synchronization tasks; Controlling execution of each of the detected tasks based on the set priorities. An information processing device comprising a control unit. [Explanation of symbols]

[0130] 101 Information processing device 110,200,810,820,830 Programs 121 Communication Task 122 Synchronization Tasks 123 Calculation Tasks 500 Bus 501 CPU 502 Memory 503 Disk Drive 504 Disk 505 Communication I / F 506 Display 507 Input Device 508 Portable Recording Media I / F 509 Portable Recording Media 510 Network 600 Control section 601 Reception 602 Detection unit 603 Classification Department 604 Settings 605 Execution Control Unit 700 Target Programs

Claims

1. Analyze the program to detect tasks, classifying each of the detected tasks into one of a communication task for performing communication related to data sharing, a synchronization task for waiting for completion of communication started by the communication task, and a calculation task different from the communication task and the synchronization task, according to the processing content of the task; setting a priority for each of the detected tasks so that the classified communication tasks are executed with priority over the computation tasks and the synchronization tasks, and the computation tasks are executed with priority over the synchronization tasks; Controlling execution of each of the detected tasks based on the set priorities. An execution control program that causes a computer to execute a process.

2. The control process includes: controlling the execution of each of the detected tasks based on the set priority and data dependencies between the tasks described in the program; 2. The execution control program according to claim 1.

3. The classification process includes: classifying the task as the communication task when a first function used in executing the communication task is included in the processing content of the detected task; classifying the task as the synchronous task when a second function used in executing the synchronous task is included in the processing content of the detected task; classifying the task into the calculation task when the detected processing content of the task does not include either the first function or the second function; 2. The execution control program according to claim 1.

4. 4. The execution control program according to claim 1, wherein the program is a program written in a task-parallel format with data dependency.

5. Analyze the program to detect tasks, classifying each of the detected tasks into one of a communication task for performing communication related to data sharing, a synchronization task for waiting for completion of communication started by the communication task, and a calculation task different from the communication task and the synchronization task, according to the processing content of the task; setting a priority for each of the detected tasks so that the classified communication tasks are executed with priority over the computation tasks and the synchronization tasks, and the computation tasks are executed with priority over the synchronization tasks; Controlling execution of each of the detected tasks based on the set priorities. An execution control method, characterized in that processing is executed by a computer.

6. Analyze the program to detect tasks, classifying each of the detected tasks into one of a communication task for performing communication related to data sharing, a synchronization task for waiting for completion of communication started by the communication task, and a calculation task different from the communication task and the synchronization task, according to the processing content of the task; setting a priority for each of the detected tasks so that the classified communication tasks are executed with priority over the computation tasks and the synchronization tasks, and the computation tasks are executed with priority over the synchronization tasks; Controlling execution of each of the detected tasks based on the set priorities. An information processing device comprising a control unit.

Citation Information

Patent Citations

  • Task scheduling system

    JP1993242051A

  • Task execution method, compiler, and electronic control device

    JP2019106065A

  • Controlling scheduling of a GPU

    US20180365062A1

  • Controlling operation of a GPU

    US20180373562A1