JP4830108B2 - Program processing apparatus, program processing method, parallel processing program compiler, and recording medium storing parallel processing program compiler - Google Patents

Program processing apparatus, program processing method, parallel processing program compiler, and recording medium storing parallel processing program compiler Download PDF

Info

Publication number
JP4830108B2
JP4830108B2 JP2006008779A JP2006008779A JP4830108B2 JP 4830108 B2 JP4830108 B2 JP 4830108B2 JP 2006008779 A JP2006008779 A JP 2006008779A JP 2006008779 A JP2006008779 A JP 2006008779A JP 4830108 B2 JP4830108 B2 JP 4830108B2
Authority
JP
Japan
Prior art keywords
data
instruction
thread
program
input
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2006008779A
Other languages
Japanese (ja)
Other versions
JP2007193423A (en
Inventor
剛 一色
博昭 ▲国▼枝
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tokyo Institute of Technology NUC
Original Assignee
Tokyo Institute of Technology NUC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tokyo Institute of Technology NUC filed Critical Tokyo Institute of Technology NUC
Priority to JP2006008779A priority Critical patent/JP4830108B2/en
Publication of JP2007193423A publication Critical patent/JP2007193423A/en
Application granted granted Critical
Publication of JP4830108B2 publication Critical patent/JP4830108B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Devices For Executing Special Programs (AREA)

Description

本発明は、並列処理システムを実現するためのプログラム開発技術、特に、並列処理システムを実現するためのコンパイラの技術に関する。   The present invention relates to a program development technique for realizing a parallel processing system, and more particularly to a compiler technique for realizing a parallel processing system.

従来、並列処理システムを実現するためのプログラム開発技術には、主に二つの技術が存在していた。一つは、逐次プログラムの自動並列コンパイラをベースとした開発環境を提供する技術(自動並列コンパイラ技術)であり、もう一つは、逐次処理言語を拡張した並列処理言語を用いた開発環境を提供する技術(並列処理言語技術)である。   Conventionally, there are mainly two techniques for program development techniques for realizing a parallel processing system. One is a technology that provides a development environment based on an automatic parallel compiler for sequential programs (automatic parallel compiler technology), and the other is a development environment that uses a parallel processing language that is an extension of the sequential processing language. Technology (parallel processing language technology).

前者の自動並列コンパイラ技術として、マルチプロセッサ用自動並列化コンパイラ技術がある(例えば、非特許文献1、2または3参照)。これは、高級プログラミング言語(主にFortranまたはC言語)によって記述された逐次プログラムから並列処理プログラムを自動生成する技術である。具体的には、ループ(繰り返し処理部分)を分割して、それぞれの分割されたループを別々のプロセッサが並列実行するループ並列や、並列して実行することが可能な処理部分を別々のプロセッサが並列実行するブロック並列などが主な並列化手法である。   As the former automatic parallel compiler technology, there is an automatic parallel compiler technology for multiprocessors (see, for example, Non-Patent Documents 1, 2, or 3). This is a technique for automatically generating a parallel processing program from a sequential program written in a high-level programming language (mainly Fortran or C language). Specifically, the loop (repetition processing part) is divided, and each divided loop is executed in parallel by different processors, or the processing parts that can be executed in parallel are processed by different processors. Block parallel execution that executes in parallel is the main parallelization technique.

また、自動並列コンパイラ技術として、命令レベル並列化コンパイラ技術がある(例えば、非特許文献4または5参照)。これは、高級プログラミング言語(主にC言語)またはそれに類似する言語によって記述された逐次プログラムから、VLIW(Very Long Instruction Word)型プロセッサ(複数の演算器を持つプロセッサ)のための実行コードを自動生成する技術である。この実行コードは、水平命令コードと言われ、すべての演算器に対する実行命令が一つの命令の中に埋め込まれたものである。また、VLIWは、依存関係にない複数の命令を一つの命令にまとめて同時に実行するマイクロプロセッサの高速化技術の一つである。   As an automatic parallel compiler technology, there is an instruction level parallel compiler technology (for example, see Non-Patent Document 4 or 5). It automatically executes execution code for a VLIW (Very Long Instruction Word) type processor (processor having a plurality of arithmetic units) from a sequential program written in a high-level programming language (mainly C language) or a similar language. It is a technology to generate. This execution code is called a horizontal instruction code, and execution instructions for all the arithmetic units are embedded in one instruction. VLIW is one of techniques for increasing the speed of a microprocessor that combines a plurality of instructions that are not dependent on each other and executes them simultaneously.

後者の並列処理言語技術として、並列プログラミング言語がある(例えば、非特許文献6、7または8参照)。これは、マルチプロセッサ用並列処理プログラムを直接記述する言語である。高級プログラミング言語をベースに、並列実行ループや並列実行ブロックなどを明示的に記述するための拡張をしたものであり、数多くの並列プログラミング言語が提唱されている。なお、非特許文献6はVPP Fortranについて、非特許文献7はHPF(High Performance Fortran)について、非特許文献8はConcurrent Cについて記載されたものである。   As the latter parallel processing language technology, there is a parallel programming language (see, for example, Non-Patent Document 6, 7 or 8). This is a language for directly describing a multiprocessor parallel processing program. Based on a high-level programming language, it has been expanded to explicitly describe parallel execution loops and parallel execution blocks, and many parallel programming languages have been proposed. Non-Patent Document 6 describes VPP Fortran, Non-Patent Document 7 describes HPF (High Performance Fortran), and Non-Patent Document 8 describes Concurrent C.

また、並列処理言語技術として、メッセージ通信方式プログラミング技術がある(例えば、非特許文献9または10参照)。これは、高級プログラミング言語(主にFortranまたはC言語)に、プロセッサ間メッセージ通信関数をライブラリ化した並列プログラミング環境(MPI:Message Passing Interface, PVM:Parallel Virtual Machine)を提供する技術である。このメッセージ通信方式プログラミング技術では、ネットワークを介して接続された複数のPC(Personal Computer)や、ワークステーションなどでプログラムを並列実行する。さらに、このメッセージ通信方式プログラミング技術は、分散メモリ型マルチプロセッサシステムや共有メモリ型マルチプロセッサシステムのための並列実行プログラムの開発にも利用される。なお、非特許文献9はMPI(Message Passing Interface)について、非特許文献10はPVM(Parallel Virtual Machine)について記載されたものである。   In addition, as a parallel processing language technology, there is a message communication system programming technology (see, for example, Non-Patent Document 9 or 10). This is a technology that provides a parallel programming environment (MPI: Message Passing Interface, PVM: Parallel Virtual Machine) in which high-level programming languages (mainly Fortran or C language) are libraryed with inter-processor message communication functions. In this message communication system programming technique, a program is executed in parallel on a plurality of PCs (Personal Computers) or workstations connected via a network. Further, this message communication system programming technique is also used for developing a parallel execution program for a distributed memory type multiprocessor system or a shared memory type multiprocessor system. Non-Patent Document 9 describes MPI (Message Passing Interface), and Non-Patent Document 10 describes PVM (Parallel Virtual Machine).

岡本、合田、宮沢、本多、笠原、「OSCARマルチグレインコンパイラにおける階層型マクロデータフロー処理」、情報処理学会論文誌、Vol. 35, No. 4, pp.513-521 (1994)Okamoto, Goda, Miyazawa, Honda, Kasahara, "Hierarchical Macro Data Flow Processing in OSCAR Multigrain Compiler", Transactions of Information Processing Society of Japan, Vol. 35, No. 4, pp.513-521 (1994) Eigenmann, Hoeflinger, Padua, “On the Automatic Parallelization of the Perfect Benchmarks”, IEEE Trans. on Parallel and Distributed Systems, Vol. 9, No.1, pp.5-21 (1998)Eigenmann, Hoeflinger, Padua, “On the Automatic Parallelization of the Perfect Benchmarks”, IEEE Trans. On Parallel and Distributed Systems, Vol. 9, No. 1, pp. 5-21 (1998) Hall, Anderson, Amarasinghe, Murphy, Liao, Bugnion, Lam, “Maximizing Multiprocessor Performance with the SUIF Compiler”, IEEE Computer, Vol. 29, No. 12, pp.84-89 (1996)Hall, Anderson, Amarasinghe, Murphy, Liao, Bugnion, Lam, “Maximizing Multiprocessor Performance with the SUIF Compiler”, IEEE Computer, Vol. 29, No. 12, pp.84-89 (1996) Fisher, “Trace scheduling: A Technique for global Microcode Compaction”, IEEE Trans. Computers, Vol. 30, No. 7, pp.478-490, 1981Fisher, “Trace scheduling: A Technique for global Microcode Compaction”, IEEE Trans. Computers, Vol. 30, No. 7, pp.478-490, 1981 Wakabayashi, Tanaka, “Global Scheduling Independent of Control Dependencies Based on Condition Vectors”, Proceedings of 29th ACM/IEEE Conference on Design Automation, pp.112-115, 1992Wakabayashi, Tanaka, “Global Scheduling Independent of Control Dependencies Based on Condition Vectors”, Proceedings of 29th ACM / IEEE Conference on Design Automation, pp.112-115, 1992 岩下英俊、「HPFからみたVPP Fortran」、情報処理、38巻2号、pp.114-121、1997年2月Hidetoshi Iwashita, "VPP Fortran as seen from HPF", Information Processing, Vol.38, No.2, pp.114-121, February 1997 “HPF推進協議会 (HPFPC)”、[online]、[平成17年8月10日検索]、インターネット<URL : http://www.hpfpc.org/>“HPF Promotion Council (HPFPC)”, [online], [searched on August 10, 2005], Internet <URL: http://www.hpfpc.org/> Gehani, et al, “Concurrent C”, Software, Practice and Experience, Vol.16, No. 9, pp.821-844, 1986Gehani, et al, “Concurrent C”, Software, Practice and Experience, Vol.16, No. 9, pp.821-844, 1986 “Message Passing Interface Forum”、[online]、[平成17年8月10日検索]、インターネット<URL : http://www.mpi-forum.org/index.html>“Message Passing Interface Forum”, [online], [searched August 10, 2005], Internet <URL: http://www.mpi-forum.org/index.html> “PVM”、[online]、[平成17年8月10日検索]、インターネット<URL : http://www.csm.ornl.gov/pvm/pvm_home.html>“PVM”, [online], [Search August 10, 2005], Internet <URL: http://www.csm.ornl.gov/pvm/pvm_home.html>

しかしながら、前記自動並列コンパイラ技術によれば、逐次プログラムから並列処理プログラムを自動的に生成することが可能であるが、プログラムの分割方法や、分割されたプログラムのプロセッサへの割当方法などを柔軟に変更することができないため、プログラマがプログラム分割や、プロセッサ割当などに直接関与することができない。また、サーバ用途のCMP(Chip MultiProcessor)への応用が進んでおり、計算負荷が大きい科学計算などが主な応用分野であるが、応用分野が限定されており、例えば、システムLSI(Large Scale Integration)などといった分野に応用する技術がない。ここで、CMPとは、複数のプロセッサを1チップに集積し、共有バスで結合する技術のことをいう。   However, according to the automatic parallel compiler technology, it is possible to automatically generate a parallel processing program from a sequential program. However, the method for dividing the program and the method for assigning the divided program to the processor are flexible. Since it cannot be changed, the programmer cannot be directly involved in program partitioning, processor allocation, or the like. In addition, application to CMP (Chip MultiProcessor) for server applications is progressing, and scientific calculation with a large calculation load is the main application field, but the application field is limited, for example, system LSI (Large Scale Integration) There is no technology that can be applied to such fields. Here, CMP refers to a technology in which a plurality of processors are integrated on a single chip and coupled by a shared bus.

また、前記命令レベル並列化コンパイラ技術は、専用IC(Integrated Circuit)の回路設計にも応用されており、実用的な技術ではあるが、実現できる並列度が比較的低い。したがって、比較的高い並列度の並列処理システムには応用できない。   The instruction level parallel compiler technology is also applied to circuit design of a dedicated IC (Integrated Circuit), and although it is a practical technology, the parallelism that can be realized is relatively low. Therefore, it cannot be applied to a parallel processing system having a relatively high degree of parallelism.

さらに、前記並列プログラミング言語は、科学技術分野などの特定の分野が対象となっており、限定された分野においてのみ使用されている。したがって、さらに幅広い分野には応用できない。   Furthermore, the parallel programming language is targeted for a specific field such as a science and technology field, and is used only in a limited field. Therefore, it cannot be applied to a wider range of fields.

また、前記メッセージ通信方式プログラミング技術は、システムLSIの上流設計においても採用されている技術であるが、個々のプロセッサ用にプログラムを開発し、通信命令を明示的に記述する必要があるために、プログラムの開発効率が悪い。つまり、プログラムのデバッグが困難であり、プロセッサに対する処理の割当の変更などのチューニングが困難である。   In addition, the message communication system programming technique is also used in the upstream design of the system LSI, but since it is necessary to develop a program for each processor and explicitly describe the communication instruction, The program development efficiency is poor. That is, it is difficult to debug the program, and tuning such as changing the allocation of processing to the processor is difficult.

そこで本発明は、以上のような問題点に鑑みてなされたものであり、プログラマ等が逐次プログラムに簡単な記述を追加するだけで、マルチプロセッサシステムが高性能な並列処理を実行するための実行コードを生成することを可能にすることを課題とする。   Therefore, the present invention has been made in view of the above problems, and an execution for a multiprocessor system to execute high-performance parallel processing by simply adding a simple description to a sequential program by a programmer or the like. The problem is to make it possible to generate code.

本発明は、課題を解決するために創案されたものであり、請求項1に記載のプログラム処理装置は、プロセッサが実行するプログラムの単位であるスレッドの有効な範囲に関する記述であるスレッド記述が追加された並列処理プログラムを入力し、各スレッドに当該プログラムを分割し、マルチプロセッサシステムのための実行コードの生成を行うプログラム処理装置であって、前記プログラム処理装置が、記憶部と、処理部とを備え、前記処理部が、前記記憶部に入力された前記並列処理プログラム中の各スレッドの開始地点および終了地点を、予約されたキーワードまたは記号によって特定し、特定された開始地点および終了地点によって指定されたスレッド領域に含まれる各演算命令に、当該演算命令それぞれがどのスレッドに含まれるかを判別するための情報であるスレッド属性を付加した中間語を生成する構文解析部と、前記中間語を入力し、当該中間語から命令ブロック入出力データを抽出して、当該命令ブロック入出力データに基づいて、単一演算命令によって生成または参照されるデータの依存性である単一データ依存性に関する情報と、データ構造に作用する命令間のデータ依存性であるデータ構造依存性に関する情報とを含むデータ依存枝情報を生成するデータ依存性抽出部と、前記中間語と前記データ依存枝情報とを入力し、当該データ依存枝情報に基づいて、当該中間語から異なるスレッド同士を接続するデータ依存枝と、当該データ依存枝に対応するスレッド出力データ生成命令およびスレッド入力参照命令とを抽出して、スレッド間データ依存命令対情報を生成するスレッド間データ依存性抽出部と、前記中間語と前記スレッド間データ依存命令対情報とを入力し、前記スレッド間データ依存命令対情報に基づいて、前記中間語に、前記スレッド間で依存するデータの通信命令を挿入して、当該通信命令を含むプログラムを生成する通信命令挿入部と、前記通信命令を含むプログラムを入力し、当該プログラムを各命令の前記スレッド属性に基づいて前記各スレッドに分割し、実行コードに変換するプログラム分割・コード生成部とを備える構成とした。 The present invention was devised to solve the problem, and the program processing device according to claim 1 is added with a thread description that is a description of an effective range of threads that are units of a program executed by the processor. The parallel processing program is input, the program is divided into each thread, and an execution code is generated for the multiprocessor system. The program processing device includes a storage unit, a processing unit, And the processing unit specifies a start point and an end point of each thread in the parallel processing program input to the storage unit by a reserved keyword or symbol, and the specified start point and end point each operation instruction included in the specified thread area, respectively the operation instruction included in any thread A syntax analysis unit for generating an intermediate language by adding a thread attribute is information for determining whether to enter the intermediate language, extracts the command block input and output data from the intermediate language, the instruction block input Information about single data dependencies, which are dependencies of data generated or referenced by a single operation instruction based on data, and information about data structure dependencies, which are data dependencies between instructions that act on data structures A data dependency extraction unit that generates data dependency branch information including the data, and the intermediate language and the data dependency branch information are input, and based on the data dependency branch information, data connecting different threads from the intermediate language By extracting the dependency branch, the thread output data generation instruction and the thread input reference instruction corresponding to the data dependency branch, the inter-thread data dependency instruction pair is extracted. An inter-thread data dependency extraction unit for generating information, the intermediate word and the inter-thread data dependent instruction pair information are input, and the inter-thread data dependent instruction pair information is input to the intermediate word based on the inter-thread data dependent instruction pair information. A communication command insertion unit that generates a program including the communication command, and a program including the communication command, and inputs the program based on the thread attribute of each command. It is configured to include a program division / code generation unit that divides each thread and converts it into an execution code.

このような構成によれば、構文解析部は、スレッド記述が追加された並列処理プログラムからスレッド領域に含まれる各演算命令にスレッド属性を付加した中間語を生成することが可能である。また、データ依存性抽出部は、構文解析部によって生成された中間語から命令ブロック入出力データを抽出し、単一演算命令によって生成または参照されるデータの依存性である単一データ依存性に関する情報と、データ構造に作用する命令間のデータ依存性であるデータ構造依存性に関する情報とを含むデータ依存枝情報を生成することが可能である。さらに、スレッド間データ依存性抽出部は、構文解析部によって生成された中間語から、データ依存性抽出部によって抽出されたデータ依存枝情報に基づいて、異なるスレッド同士を接続するデータ依存枝と、データ依存枝に対応するスレッド出力データ生成命令およびスレッド入力参照命令とを抽出して、スレッド間データ依存命令対情報を生成することが可能である。また、通信命令挿入部は、スレッド間データ依存命令対情報に基づいて、構文解析部によって生成された中間語にスレッド間で依存するデータの通信命令を挿入して、通信命令を含むプログラムを生成することが可能である。さらに、プログラム分割・コード生成部は、通信命令を含むプログラムを、構文解析部によって各命令に付加されたスレッド属性に基づいて各スレッドに分割し、実行コードに変換することが可能である。したがって、プログラム処理装置は、スレッド記述が追加された並列処理プログラムを入力して、マルチプロセッサシステムが高性能な並列処理を実行するための実行コードを生成することが可能である。   According to such a configuration, the syntax analysis unit can generate an intermediate language in which a thread attribute is added to each operation instruction included in the thread area from the parallel processing program to which the thread description is added. The data dependency extraction unit extracts instruction block input / output data from the intermediate language generated by the syntax analysis unit, and relates to single data dependency that is dependency of data generated or referenced by a single operation instruction. It is possible to generate data dependency branch information including information and information related to data structure dependency which is data dependency between instructions operating on the data structure. Further, the inter-thread data dependency extraction unit, based on the data dependency branch information extracted by the data dependency extraction unit from the intermediate language generated by the syntax analysis unit, a data dependency branch that connects different threads, It is possible to extract the thread output data generation instruction and the thread input reference instruction corresponding to the data dependency branch and generate the inter-thread data dependency instruction pair information. In addition, the communication command insertion unit generates a program including a communication command by inserting a data communication command depending on the thread into the intermediate language generated by the syntax analysis unit based on the inter-thread data dependent command pair information. Is possible. Further, the program division / code generation unit can divide a program including a communication instruction into each thread based on the thread attribute added to each instruction by the syntax analysis unit, and convert it into an execution code. Therefore, the program processing apparatus can input a parallel processing program to which a thread description is added, and generate an execution code for the multiprocessor system to execute high-performance parallel processing.

さらに、請求項に記載のプログラム処理方法は、プロセッサが実行するプログラムの単位であるスレッドの有効な範囲に関する記述であるスレッド記述が追加された並列処理プログラムを入力し、各スレッドに当該プログラムを分割し、マルチプロセッサシステムのための実行コードの生成を行うプログラム処理装置によるプログラム処理方法であって、前記プログラム処理装置が、記憶部と、処理部とを備え、前記処理部が、前記記憶部に入力された前記並列処理プログラム中の各スレッドの開始地点および終了地点を、予約されたキーワードまたは記号によって特定し、特定された開始地点および終了地点によって指定されたスレッド領域に含まれる各演算命令に、当該演算命令それぞれがどのスレッドに含まれるかを判別するための情報であるスレッド属性を付加した中間語を生成し、前記中間語を入力し、当該中間語から命令ブロック入出力データを抽出して、当該命令ブロック入出力データに基づいて、単一演算命令によって生成または参照されるデータの依存性である単一データ依存性に関する情報と、データ構造に作用する命令間のデータ依存性であるデータ構造依存性に関する情報とを含むデータ依存枝情報を生成し、前記中間語と前記データ依存枝情報とを入力し、当該データ依存枝情報に基づいて、当該中間語から異なるスレッド同士を接続するデータ依存枝と、当該データ依存枝に対応するスレッド出力データ生成命令およびスレッド入力参照命令とを抽出して、スレッド間データ依存命令対情報を生成し、前記中間語と前記スレッド間データ依存命令対情報とを入力し、前記スレッド間データ依存命令対情報に基づいて、前記中間語に、前記スレッド間で依存するデータの通信命令を挿入して、当該通信命令を含むプログラムを生成し、前記通信命令を含むプログラムを入力し、当該プログラムを各命令の前記スレッド属性に基づいて前記各スレッドに分割し、実行コードに変換する方法とした。 Furthermore, the program processing method according to claim 2 inputs a parallel processing program to which a thread description, which is a description about an effective range of a thread that is a unit of a program executed by a processor, is input, and the program is transmitted to each thread. A program processing method by a program processing device that divides and generates an execution code for a multiprocessor system, wherein the program processing device includes a storage unit and a processing unit, and the processing unit includes the storage unit The start point and end point of each thread in the parallel processing program input to is specified by a reserved keyword or symbol, and each calculation instruction included in the thread area specified by the specified start point and end point in, for determining whether each said operation instruction is included in which the thread Generates an intermediate language by adding a thread attributes is broadcast, enter the intermediate language, extracts the command block input and output data from the intermediate language, based on the instruction block output data, by a single operation instruction Generate data dependency branch information including information on single data dependency, which is the dependency of data to be generated or referenced, and data structure dependency, which is data dependency between instructions operating on the data structure; The intermediate language and the data dependency edge information are input, and based on the data dependency edge information, a data dependency edge that connects different threads from the intermediate language, and a thread output data generation instruction corresponding to the data dependency edge And thread input reference instructions are extracted to generate inter-thread data dependent instruction pair information, and the intermediate language and inter-thread data dependent instruction pair are generated. Information is input, and based on the inter-thread data dependence instruction pair information, a communication instruction of data dependent on the thread is inserted into the intermediate language to generate a program including the communication instruction, and the communication A method including inputting a program including an instruction, dividing the program into the threads based on the thread attribute of each instruction, and converting the program into an execution code.

このような方法によれば、プログラム処理装置の処理部は、スレッド記述が追加された並列処理プログラムからスレッド領域に含まれる各演算命令にスレッド属性を付加した中間語を生成することが可能である。また、プログラム処理装置の処理部は、中間語から命令ブロック入出力データを抽出し、単一演算命令によって生成または参照されるデータの依存性である単一データ依存性に関する情報と、データ構造に作用する命令間のデータ依存性であるデータ構造依存性に関する情報とを含むデータ依存枝情報を生成することが可能である。さらに、プログラム処理装置の処理部は、中間語から、データ依存枝情報に基づいて、異なるスレッド同士を接続するデータ依存枝とデータ依存枝に対応するスレッド出力データ生成命令およびスレッド入力参照命令とを抽出して、スレッド間データ依存命令対情報を生成することが可能である。また、プログラム処理装置の処理部は、スレッド間データ依存命令対情報に基づいて、中間語にスレッド間で依存するデータの通信命令を挿入して、通信命令を含むプログラムを生成することが可能である。さらに、プログラム処理装置の処理部は、通信命令を含むプログラムを、各命令に付加されたスレッド属性に基づいて各スレッドに分割し、実行コードに変換することが可能である。したがって、プログラム処理装置は、このような方法を実行することで、スレッド記述が追加された並列処理プログラムを入力して、マルチプロセッサシステムが高性能な並列処理を実行するための実行コードを生成することが可能である。   According to such a method, the processing unit of the program processing device can generate an intermediate language in which a thread attribute is added to each operation instruction included in the thread area from a parallel processing program to which a thread description is added. . In addition, the processing unit of the program processing device extracts instruction block input / output data from the intermediate language, and stores information on single data dependency, which is dependency of data generated or referenced by a single operation instruction, and a data structure. It is possible to generate data dependency edge information including information on data structure dependency that is data dependency between acting instructions. Further, the processing unit of the program processing device outputs, from the intermediate language, a data dependency branch for connecting different threads, a thread output data generation instruction and a thread input reference instruction corresponding to the data dependency branch, based on the data dependency branch information. It is possible to extract and generate inter-thread data dependent instruction pair information. In addition, the processing unit of the program processing device can generate a program including a communication instruction by inserting a communication instruction of data depending on the thread in the intermediate language based on the inter-thread data dependent instruction pair information. is there. Furthermore, the processing unit of the program processing device can divide a program including a communication command into each thread based on a thread attribute added to each command and convert the program into an execution code. Therefore, the program processing apparatus executes such a method to input a parallel processing program to which a thread description is added and generate an execution code for the multiprocessor system to execute high-performance parallel processing. It is possible.

さらに、請求項に記載の並列処理プログラム用コンパイラは、請求項2に記載のプログラム処理方法をコンピュータに実行させるための並列処理プログラム用コンパイラとした。 Furthermore, the compiler for parallel processing program according to claim 3, was a parallel processing program compiler for executing a program processing method according to claim 2 to the computer.

このような構成によれば、並列処理プログラム用コンパイラは、コンピュータに前記したプログラム処理方法を実行させることが可能である。したがって、この並列処理プログラム用コンパイラをコンピュータに組み込み、コンピュータに前記したプログラム処理方法を実行させることによって、スレッド記述が追加された並列処理プログラムを入力して、マルチプロセッサシステムが高性能な並列処理を実行するための実行コードを生成することが可能である。 According to such a configuration, the parallel processing program compiler can cause the computer to execute the above-described program processing method. Therefore, by incorporating this parallel processing program compiler into a computer and causing the computer to execute the program processing method described above, the multiprocessor system performs high-performance parallel processing by inputting a parallel processing program with an added thread description. It is possible to generate an execution code for execution.

また、請求項に記載の記録媒体は、請求項に記載の並列処理プログラム用コンパイラを格納した記録媒体とした。 A recording medium according to claim 4 is a recording medium storing the compiler for parallel processing programs according to claim 3 .

このような構成によれば、記録媒体に格納された並列処理プログラム用コンパイラをコンピュータに組み込み、コンピュータに前記したプログラム処理方法を実行させることによって、スレッド記述が追加された並列処理プログラムを入力して、マルチプロセッサシステムが高性能な並列処理を実行するための実行コードを生成することが可能である。 According to such a configuration, the parallel processing program compiler stored in the recording medium is incorporated in the computer, and the computer executes the program processing method described above, thereby inputting the parallel processing program to which the thread description is added. The multiprocessor system can generate execution code for executing high-performance parallel processing.

請求項1に記載のプログラム処理装置によれば、スレッド記述が追加された並列処理プログラムを入力して、マルチプロセッサシステムが高性能な並列処理を実行するための実行コードを生成することが可能である。したがって、プログラマ等が逐次プログラムに簡単な記述を追加するだけで、マルチプロセッサシステムが高性能な並列処理を実行するための実行コードを生成することが可能になる。   According to the program processing device of the first aspect, it is possible to input a parallel processing program to which a thread description is added and generate an execution code for the multiprocessor system to execute high-performance parallel processing. is there. Therefore, it becomes possible for the multiprocessor system to generate an execution code for executing high-performance parallel processing only by adding a simple description to the sequential program by a programmer or the like.

さらに、請求項に記載のプログラム処理方法によれば、プログラム処理装置が、プログラム処理方法を実行することで、スレッド記述が追加された並列処理プログラムを入力して、マルチプロセッサシステムが高性能な並列処理を実行するための実行コードを生成することが可能である。したがって、プログラマ等が逐次プログラムに簡単な記述を追加するだけで、マルチプロセッサシステムが高性能な並列処理を実行するための実行コードを生成することが可能になる。 Furthermore, according to the program processing method of the second aspect , the program processing device executes the program processing method, thereby inputting the parallel processing program to which the thread description is added, so that the multiprocessor system has a high performance. It is possible to generate an execution code for executing parallel processing. Therefore, it becomes possible for the multiprocessor system to generate an execution code for executing high-performance parallel processing only by adding a simple description to the sequential program by a programmer or the like.

また、請求項に記載の並列処理プログラム用コンパイラによれば、この並列処理プログラム用コンパイラをコンピュータに組み込み、コンピュータに前記したプログラム処理方法を実行させることによって、コンピュータは、スレッド記述が追加された並列処理プログラムを入力して、マルチプロセッサシステムが高性能な並列処理を実行するための実行コードを生成することが可能である。したがって、プログラマ等が逐次プログラムに簡単な記述を追加するだけで、マルチプロセッサシステムが高性能な並列処理を実行するための実行コードを生成することが可能になる。 According to the compiler for a parallel processing program according to claim 3 , the thread description is added to the computer by incorporating the compiler for the parallel processing program into the computer and causing the computer to execute the program processing method described above. It is possible to input a parallel processing program and generate an execution code for the multiprocessor system to execute high-performance parallel processing. Therefore, it becomes possible for the multiprocessor system to generate an execution code for executing high-performance parallel processing only by adding a simple description to the sequential program by a programmer or the like.

さらに、請求項に記載の記録媒体によれば、この記録媒体に格納された並列処理プログラム用コンパイラをコンピュータに組み込み、コンピュータに前記したプログラム処理方法を実行させることによって、スレッド記述が追加された並列処理プログラムを入力して、マルチプロセッサシステムが高性能な並列処理を実行するための実行コードを生成することが可能である。したがって、プログラマ等が逐次プログラムに簡単な記述を追加するだけで、マルチプロセッサシステムが高性能な並列処理を実行するための実行コードを生成することが可能になる。 Furthermore, according to the recording medium of claim 4 , the thread description is added by incorporating the compiler for the parallel processing program stored in the recording medium into the computer and causing the computer to execute the program processing method described above. It is possible to input a parallel processing program and generate an execution code for the multiprocessor system to execute high-performance parallel processing. Therefore, it becomes possible for the multiprocessor system to generate an execution code for executing high-performance parallel processing only by adding a simple description to the sequential program by a programmer or the like.

(第1の実施形態)
以下、図面(図1〜図16)を用いて本発明の第1の実施形態について説明する。
図1は、プログラム処理装置の機能例を示す機能ブロック図である。図1に示すように、プログラム処理装置1Aは、並列処理プログラム50Aを入力して、通信命令を含む分割プログラム55Aを出力する。ここで、図2および図3を用いて、本実施形態で用いる並列処理プログラム50Aの説明をする。
(First embodiment)
Hereinafter, a first embodiment of the present invention will be described with reference to the drawings (FIGS. 1 to 16).
FIG. 1 is a functional block diagram illustrating an example of functions of the program processing apparatus. As shown in FIG. 1, the program processing apparatus 1A inputs a parallel processing program 50A and outputs a divided program 55A including a communication command. Here, the parallel processing program 50A used in the present embodiment will be described with reference to FIGS.

図2に示すプログラムは、プログラマ等が記述したプログラムであり、スレッド記述を追加する前のプログラムの一例である。なお、このプログラムはC言語で記述されたものである。   The program shown in FIG. 2 is a program described by a programmer or the like, and is an example of a program before adding a thread description. This program is written in C language.

また、図3に示すプログラムは、プログラマ等が記述したプログラムであり、図2に示したプログラムにスレッド記述を追加した後のプログラム(以下、並列処理プログラムともいう)の一例である。ここで、「スレッド」とは、一つのプロセッサが実行するプログラムの単位であるとし、これらのスレッドを別々のプロセッサで並列処理することを想定している。
なお、このプログラムは、C言語に「THREAD」という新たなキーワードが追加された拡張C言語によって記述されており、THREADに続く「(スレッド名)」によってスレッド名が指定され、これに続く括弧記号{ … }で囲まれたコード領域(スレッド領域)によってスレッドの有効な範囲が示されている。スレッド記述が追加されたプログラム(並列処理プログラム)とは、このようにスレッドの有効な範囲が記述されたプログラムのことを指すものとする。なお、いずれのスレッドにも含まれないコード領域の処理は「ベーススレッド」と呼ぶことにし、その他のスレッドと同等に扱うこととする。既存のCコンパイラを用いて、この拡張C言語によって書かれたソースコードから実行コードを生成するためには、例えばスレッド宣言を無効化するプリプロセッサ「#define THREAD(n)」を予めプログラムの最上部(またはプログラム内)に挿入すればよい。このプリプロセッサにより、例えば「THREAD(p1)」が空の文字列に変換され、これに続く括弧記号{ … }が通常のC言語におけるスコープ宣言として解釈され、既存のCコンパイラで正常に処理される。
The program shown in FIG. 3 is a program written by a programmer or the like, and is an example of a program (hereinafter also referred to as a parallel processing program) after adding a thread description to the program shown in FIG. Here, the “thread” is a unit of a program executed by one processor, and it is assumed that these threads are processed in parallel by different processors.
This program is described in the extended C language in which a new keyword “THREAD” is added to the C language. A thread name is designated by “(thread name)” following THREAD, and a parenthesis symbol following this An effective range of threads is indicated by a code area (thread area) surrounded by {. A program to which a thread description is added (parallel processing program) refers to a program in which an effective range of threads is described in this way. It should be noted that the processing of a code area not included in any thread is called a “base thread” and is handled in the same way as other threads. In order to generate an execution code from the source code written in the extended C language using an existing C compiler, for example, a preprocessor “#define THREAD (n)” for invalidating the thread declaration is previously set at the top of the program. (Or in the program). By this preprocessor, for example, “THREAD (p1)” is converted into an empty character string, and the parenthesis symbols {...} Following this are interpreted as a scope declaration in a normal C language and processed normally by an existing C compiler. .

図1に戻って、プログラム処理装置1Aの説明を続ける。
図1に示すように、プログラム処理装置1Aは、構文解析部31と、データ依存性抽出部32Aと、スレッド間データ依存性抽出部33と、通信命令挿入部35Aと、プログラム分割・コード生成部39とを含んで構成されている。以下、プログラム処理装置1Aを構成する各要素について説明する。
Returning to FIG. 1, the description of the program processing apparatus 1A will be continued.
As shown in FIG. 1, the program processing apparatus 1A includes a syntax analysis unit 31, a data dependency extraction unit 32A, an inter-thread data dependency extraction unit 33, a communication instruction insertion unit 35A, and a program division / code generation unit. 39. Hereinafter, each element constituting the program processing apparatus 1A will be described.

(構文解析部31の説明)
構文解析部31は、並列処理プログラム50Aを入力して、当該プログラムの構文を解析する。また、並列処理プログラム50Aから中間語を生成する。構文解析部31は、通常のコンパイラが有する公知の構文解析の機能に加え、拡張C言語の予約語に追加されたTHREADキーワードを認識し、それに続く「(スレッド名)」でスレッド名を抽出し、これに続くスコープ({…})で囲まれるコード領域(スレッド領域)が、このスレッドであることを判別し、中間語に変換された各演算命令にスレッドの属性(スレッド属性)を付加する機能を有する。スレッド属性は、各演算命令がどのスレッドに含まれるかを判別するための情報であり、各スレッドに固有の番号を予め割り当てておき、スレッドに含まれるすべての演算命令にこの番号を割り振ることでスレッド属性情報を付加することができる。
(Description of syntax analysis unit 31)
The syntax analysis unit 31 inputs the parallel processing program 50A and analyzes the syntax of the program. Further, an intermediate language is generated from the parallel processing program 50A. The syntax analysis unit 31 recognizes the THREAD keyword added to the reserved word of the extended C language in addition to the well-known syntax analysis function of a normal compiler, and extracts the thread name with “(thread name)” that follows. , It is determined that the code area (thread area) enclosed by the following scope ({...}) is this thread, and a thread attribute (thread attribute) is added to each operation instruction converted to an intermediate language. It has a function. The thread attribute is information for determining in which thread each operation instruction is included. A unique number is assigned to each thread in advance, and this number is assigned to all operation instructions included in the thread. Thread attribute information can be added.

ここで、スレッド領域が入れ子構造をなす場合、即ち、あるスレッド領域の中に別のスレッド領域が存在する場合、各演算命令は、これを含むスレッド領域のうち最も内側のもののスレッド属性を持つとする。例えば、
THREAD(p0){
a = 1;
THREAD(p1){
b = 2;
}
}
という入れ子構造(スレッドp0の領域内にスレッドp1が含まれる構造)が存在した場合、演算b = 2;はスレッドp0とスレッドp1とに含まれる。このとき、この演算b = 2;は、最も内側のスレッドp1のスレッド属性を持つ。また、演算a = 1;のスレッド属性はスレッドp0である。
さらに、スレッド領域に関数呼出し命令が含まれる場合、その関数のベーススレッドは関数呼出し命令が属するスレッドと同一であるものとする。例えば、図3に示した並列処理プログラム50Aの21行目(RandomSignal())および25行目(printf())の命令は、それぞれスレッドp4内およびスレッドp5内における関数呼出し命令であり、これらの関数の処理は、これらを呼び出したスレッドで実行されることになるので、RandomSignal()およびprintf()のベーススレッドは、それぞれスレッドp4およびスレッドp5と同一となる。
また、説明の都合上、以下では、中間語として適宜、並列処理プログラム50Aを用いて説明することにする。
Here, when the thread area has a nested structure, that is, when another thread area exists in a certain thread area, each operation instruction has a thread attribute of the innermost thread area including the thread instruction. To do. For example,
THREAD (p0) {
a = 1;
THREAD (p1) {
b = 2;
}
}
If there is a nested structure (a structure in which the thread p1 is included in the area of the thread p0), the operation b = 2; is included in the thread p0 and the thread p1. At this time, this operation b = 2; has the thread attribute of the innermost thread p1. The thread attribute of the operation a = 1; is the thread p0.
Furthermore, when a function call instruction is included in the thread area, the base thread of the function is assumed to be the same as the thread to which the function call instruction belongs. For example, the instructions on the 21st line (RandomSignal ()) and 25th line (printf ()) of the parallel processing program 50A shown in FIG. 3 are function call instructions in the thread p4 and the thread p5, respectively. Since the processing of the function is executed by the thread that calls them, the base threads of RandomSignal () and printf () are the same as the thread p4 and the thread p5, respectively.
For convenience of explanation, the following description will be given using the parallel processing program 50A as an intermediate language.

(データ依存性抽出部32Aの説明)
データ依存性抽出部32Aは、構文解析部31によって生成された中間語を入力し、データ依存性を抽出する。データ依存性抽出部32Aは、命令参照・生成データ抽出部321と、関数内間接参照・生成データ抽出部323と、命令ブロック抽出部324と、命令ブロック入出力データ抽出部325Aと、データ依存枝生成部326と、出力データ生成命令・入力データ参照命令抽出部327とを含んで構成されている。
(Description of Data Dependency Extractor 32A)
The data dependency extraction unit 32A receives the intermediate language generated by the syntax analysis unit 31 and extracts data dependency. The data dependency extraction unit 32A includes an instruction reference / generation data extraction unit 321, an in-function indirect reference / generation data extraction unit 323, an instruction block extraction unit 324, an instruction block input / output data extraction unit 325A, a data dependency branch A generation unit 326 and an output data generation instruction / input data reference instruction extraction unit 327 are included.

(命令参照・生成データ抽出部321の説明)
命令参照・生成データ抽出部321は、構文解析部31によって生成された中間語を入力し、中間語内の各命令の参照データリストおよび生成データリストを生成する。
命令参照・生成データ抽出部321で生成される各命令の参照データリストは、その命令が直接参照するすべてのデータからなり、単項演算命令の場合は一つの参照データを持ち、二項演算命令の場合は二つの参照データを持ち、関数呼出し命令の場合は関数呼出引数データすべてが参照データと見なされる。
また、命令参照・生成データ抽出部321で生成される各命令の生成データリストは、その命令が直接生成するデータからなり、戻り値のない関数の関数呼出し命令では直接生成するデータはなく、それ以外の命令では一つの直接生成するデータを持つ。
命令参照・生成データ抽出部321によって生成された参照データリストおよび生成データリストは、関数内間接参照・生成データ抽出部323に引き渡される。また、命令参照・生成データ抽出部321によって生成された参照データリストおよび生成データリストは、各命令の依存性を抽出する処理において、適宜利用される。
(Description of instruction reference / generated data extraction unit 321)
The instruction reference / generation data extraction unit 321 inputs the intermediate language generated by the syntax analysis unit 31, and generates a reference data list and a generation data list for each instruction in the intermediate language.
The reference data list of each instruction generated by the instruction reference / generated data extraction unit 321 includes all data directly referred to by the instruction. In the case of a unary operation instruction, the reference data list has one reference data. In the case of a function call instruction, all the function call argument data are regarded as reference data.
In addition, the generated data list of each instruction generated by the instruction reference / generated data extraction unit 321 includes data directly generated by the instruction, and there is no data directly generated by a function call instruction of a function having no return value. Instructions other than have one directly generated data.
The reference data list and the generated data list generated by the instruction reference / generated data extraction unit 321 are delivered to the in-function indirect reference / generated data extraction unit 323. Further, the reference data list and the generated data list generated by the instruction reference / generated data extraction unit 321 are appropriately used in the process of extracting the dependency of each instruction.

(関数内間接参照・生成データ抽出部323の説明)
関数内間接参照・生成データ抽出部323は、命令参照・生成データ抽出部321によって生成された参照データリストと生成データリストとを入力し、関数呼出し命令が存在した場合、呼出された関数内で参照または生成されるグローバル変数やポインタ型関数引数によるポインタ参照データ(以下、間接依存データという)を抽出するものである。
関数呼出し命令のデータ依存性解析においては、通常の演算命令としてのデータ依存性(以下、直接的データ依存性という)を考慮しなければならない他、関数内部の演算で発生したデータ依存性のうち関数呼出し側まで伝播する依存性(以下、間接的データ依存性という)を考慮しなくてはならない場合がある。直接的データ依存性を示すものとしては、関数呼出し引数(直接参照データ)や関数戻り値(直接生成データ)などがあり、この直接参照データおよび直接生成データは、命令参照・生成データ抽出部321から受け取った参照データリストおよび生成データリスト内に存在している。
(Description of function indirect reference / generated data extraction unit 323)
The in-function indirect reference / generated data extraction unit 323 inputs the reference data list and the generated data list generated by the instruction reference / generated data extraction unit 321. If there is a function call instruction, Pointer reference data (hereinafter referred to as indirect dependency data) based on global variables or pointer type function arguments that are referred to or generated is extracted.
In the data dependency analysis of the function call instruction, the data dependency as a normal operation instruction (hereinafter referred to as direct data dependency) must be taken into account. Dependencies that propagate to the function caller (hereinafter referred to as indirect data dependencies) may need to be considered. Examples of direct data dependency include a function call argument (direct reference data) and a function return value (direct generation data). The direct reference data and the direct generation data are used as the instruction reference / generation data extraction unit 321. Exists in the reference data list and generated data list received from.

関数内間接参照・生成データ抽出部323は、命令参照・生成データ抽出部321から受け取った参照データリストおよび生成データリストを参照して、関数内部で参照される(関数引数以外の)間接依存データ(関数内間接参照データ)を抽出し、各関数呼出し命令の参照データリストに追加する。また、関数内間接参照・生成データ抽出部323は、命令参照・生成データ抽出部321から受け取った参照データリストおよび生成データリストを参照して、関数内部で生成される(書換えられる)(関数戻り値以外の)関数依存データ(関数内間接生成データ)を抽出し、各関数呼出し命令の生成データリストに追加する。関数内間接参照・生成データ抽出部323の処理は、通常のコンパイラが有する公知の間接依存データを抽出する処理と特に変わらないため、説明を省略する。
関数内間接参照・生成データ抽出部323によって生成された関数呼出し命令の参照データリストおよび生成データリストは、各命令の依存性を抽出する処理において、適宜利用される。これにより、並列処理プログラム50A内の大局的なデータ依存性が抽出できるようになる。
The indirect reference / generated data extracting unit 323 in the function refers to the reference data list and the generated data list received from the instruction reference / generated data extracting unit 321 and refers to indirect dependent data (other than the function argument) referred to inside the function. (Indirect reference data in function) is extracted and added to the reference data list of each function call instruction. Also, the in-function indirect reference / generated data extraction unit 323 refers to the reference data list and the generated data list received from the instruction reference / generated data extraction unit 321 and is generated (rewritten) inside the function (function return). Function-dependent data (indirectly generated data within a function) other than the value is extracted and added to the generated data list of each function call instruction. The processing of the indirect in-function reference / generated data extraction unit 323 is not particularly different from the processing of extracting known indirect dependency data included in a normal compiler, and thus description thereof is omitted.
The function call instruction reference data list and the generated data list generated by the in-function indirect reference / generated data extraction unit 323 are appropriately used in the process of extracting the dependency of each instruction. As a result, the global data dependency in the parallel processing program 50A can be extracted.

(命令ブロック抽出部324の説明)
命令ブロック抽出部324は、構文解析部31によって生成された中間語を入力し、その中間語から命令ブロックを抽出する。ここで、命令ブロックとは、プログラムを分岐点、合流点および関数呼出命令の前後と、スレッド境界とを境界線として分割した結果生じるブロックのことである。以下、図3および図4を用いて、命令ブロック抽出部324の機能の一例について説明する。
(Description of instruction block extraction unit 324)
The instruction block extraction unit 324 receives the intermediate language generated by the syntax analysis unit 31 and extracts an instruction block from the intermediate language. Here, the instruction block is a block that is generated as a result of dividing the program before and after the branch point, the junction point, and the function call instruction and the thread boundary as a boundary line. Hereinafter, an example of the function of the instruction block extraction unit 324 will be described with reference to FIGS. 3 and 4.

命令ブロック抽出部324は、並列処理プログラム50Aの7行目にある繰り返し文を見付け、条件式「t<signalLength」の前でプログラムが合流すると判定し、プログラム合流点(合流ブロック)C1を抽出する。また、命令ブロック抽出部324は、並列処理プログラム50Aの7行目にある条件式「t<signalLength」の後でプログラムが分岐すると判定し、プログラム分岐点(分岐ブロック)B1を抽出する(図4参照)。さらに、命令ブロック抽出部324は、並列処理プログラム50Aの21行目にある関数呼出命令D1「RandomSignal」と、25行目にある関数呼出命令D2「printf」とを抽出する(図4参照)。また、命令ブロック抽出部324は、並列処理プログラム50Aから各スレッドp1〜p5による処理の直前と直後の各スレッド境界E1〜E6を抽出する(図4参照)。   The instruction block extraction unit 324 finds a repetition statement in the seventh line of the parallel processing program 50A, determines that the program is merged before the conditional expression “t <signalLength”, and extracts a program merge point (merging block) C1. . The instruction block extraction unit 324 determines that the program branches after the conditional expression “t <signalLength” in the seventh line of the parallel processing program 50A, and extracts a program branch point (branch block) B1 (FIG. 4). reference). Further, the instruction block extraction unit 324 extracts the function call instruction D1 “RandomSignal” on the 21st line and the function call instruction D2 “printf” on the 25th line of the parallel processing program 50A (see FIG. 4). Further, the instruction block extraction unit 324 extracts the thread boundaries E1 to E6 immediately before and after the processing by the threads p1 to p5 from the parallel processing program 50A (see FIG. 4).

図4は、命令ブロック抽出部324が、構文解析部31によって生成された中間語から命令ブロックを抽出した結果を示すプログラムグラフである。なお、図4の各演算の左に示した記号(例えば[p1])は、その演算を実行するスレッド名を示しており、[*]は前記説明のベーススレッドを示している。構文解析部31によって生成された中間語における各演算処理は、2項演算または単項演算に分割される(演算が分割される際に利用される途中変数には、「$xx」という名の一時変数が割り当てられる)。   FIG. 4 is a program graph showing a result of the instruction block extraction unit 324 extracting an instruction block from the intermediate language generated by the syntax analysis unit 31. Note that a symbol (for example, [p1]) shown on the left of each operation in FIG. 4 indicates a thread name for executing the operation, and [*] indicates the base thread described above. Each operation processing in the intermediate language generated by the parsing unit 31 is divided into binary operation or unary operation (the intermediate variable used when the operation is divided is a temporary variable named “$ xx”. Variable is assigned).

以上説明した命令ブロック抽出部324の機能によって、命令ブロック抽出部324は、並列処理プログラム50Aからプログラム分岐点B1、プログラム合流点C1、関数呼出命令D1、関数呼出命令D2およびスレッド境界E1〜E6を抽出することによって、図4に示すように、並列処理プログラム50Aを命令ブロックA1〜A7に分割することができる。このように、命令ブロック抽出部324は、並列処理プログラム50A内の各命令に命令ブロックおよびスレッドを対応付けた命令ブロックに関する情報(命令ブロック情報)を生成することができる。   By the function of the instruction block extraction unit 324 described above, the instruction block extraction unit 324 changes the program branch point B1, the program junction point C1, the function call instruction D1, the function call instruction D2, and the thread boundaries E1 to E6 from the parallel processing program 50A. By extracting, as shown in FIG. 4, the parallel processing program 50A can be divided into instruction blocks A1 to A7. In this way, the instruction block extraction unit 324 can generate information (instruction block information) regarding an instruction block in which an instruction block and a thread are associated with each instruction in the parallel processing program 50A.

また、命令ブロック抽出部324によって生成された命令ブロックに関する情報(命令ブロック情報)は、命令ブロック入出力データ抽出部325Aに引き渡される。   Further, information (instruction block information) regarding the instruction block generated by the instruction block extraction unit 324 is delivered to the instruction block input / output data extraction unit 325A.

(命令ブロック入出力データ抽出部325Aの説明)
命令ブロック入出力データ抽出部325Aは、構文解析部31によって生成された中間語と、命令ブロック抽出部324によって抽出された命令ブロック情報とを入力し、その命令ブロック情報を用いて、その中間語から命令ブロック入力データと、命令ブロック出力データとを抽出する。命令ブロック入力データとは、命令ブロック内の各命令が参照するデータのうち、別の命令ブロック内で生成されるものである。また、命令ブロック出力データとは、命令ブロック内の各命令が生成するデータのうち、別のブロック内で参照されるものである。以下、図3および図5を用いて、命令ブロック入出力データ抽出部325Aの機能の一例について説明する。
(Description of instruction block input / output data extraction unit 325A)
The instruction block input / output data extraction unit 325A receives the intermediate language generated by the syntax analysis unit 31 and the instruction block information extracted by the instruction block extraction unit 324, and uses the instruction block information to generate the intermediate language. Instruction block input data and instruction block output data are extracted. The instruction block input data is data generated in another instruction block among data referred to by each instruction in the instruction block. The instruction block output data is data that is referred to in another block among data generated by each instruction in the instruction block. Hereinafter, an example of the function of the instruction block input / output data extraction unit 325A will be described with reference to FIGS.

命令ブロック入出力データ抽出部325Aは、命令ブロック内の各命令が参照するデータとして、例えば、並列処理プログラム50Aの9行目にある変数sigIn2を見付ける。命令ブロック入出力データ抽出部325Aは、命令ブロック抽出部324によって抽出された命令ブロック情報を参照して、この変数sigIn2が命令ブロックA3内の命令で参照されていると判定する。また、命令ブロック入出力データ抽出部325Aは、命令ブロック抽出部324によって抽出された命令ブロック情報と、命令参照・生成データ抽出部321によって生成された参照データリストおよび生成データリストとを参照して、この変数sigIn2が、参照される命令ブロックA3以外の命令ブロック(命令ブロックA1内の命令または命令ブロックA4)で生成されていると判定する。その結果、命令ブロック入出力データ抽出部325Aは、命令ブロック入力データとして、変数sigIn2を抽出することができる。   The instruction block input / output data extraction unit 325A finds, for example, a variable sigIn2 on the ninth line of the parallel processing program 50A as data referred to by each instruction in the instruction block. The instruction block input / output data extraction unit 325A refers to the instruction block information extracted by the instruction block extraction unit 324, and determines that the variable sigIn2 is referred to by an instruction in the instruction block A3. The instruction block input / output data extraction unit 325A refers to the instruction block information extracted by the instruction block extraction unit 324, and the reference data list and the generation data list generated by the instruction reference / generation data extraction unit 321. It is determined that this variable sigIn2 is generated in an instruction block (an instruction in the instruction block A1 or an instruction block A4) other than the instruction block A3 to be referred to. As a result, the instruction block input / output data extraction unit 325A can extract the variable sigIn2 as the instruction block input data.

また、命令ブロック入出力データ抽出部325Aは、命令ブロック内の各命令が生成するデータとして、例えば、並列処理プログラム50Aの10行目にある変数sigOutを見付ける。命令ブロック入出力データ抽出部325Aは、命令ブロック抽出部324によって抽出された命令ブロック情報を参照して、この変数sigOutが命令ブロックA3内の命令で生成されていると判定する。また、命令ブロック入出力データ抽出部325Aは、命令ブロック抽出部324によって抽出された命令ブロック情報と、命令参照・生成データ抽出部321によって生成された参照データリストおよび生成データリストとを参照して、この変数sigOutが、生成される命令ブロックA3以外の命令ブロック(命令ブロックA4)で参照されていると判定する。その結果、命令ブロック入出力データ抽出部325Aは、命令ブロック出力データとして、変数sigOutを抽出することができる。   Further, the instruction block input / output data extraction unit 325A finds, for example, a variable sigOut on the 10th line of the parallel processing program 50A as data generated by each instruction in the instruction block. The instruction block input / output data extraction unit 325A refers to the instruction block information extracted by the instruction block extraction unit 324 and determines that the variable sigOut is generated by an instruction in the instruction block A3. The instruction block input / output data extraction unit 325A refers to the instruction block information extracted by the instruction block extraction unit 324, and the reference data list and the generation data list generated by the instruction reference / generation data extraction unit 321. The variable sigOut is determined to be referenced in an instruction block (instruction block A4) other than the instruction block A3 to be generated. As a result, the instruction block input / output data extraction unit 325A can extract the variable sigOut as the instruction block output data.

図5は、命令ブロック入出力データ抽出部325Aが、構文解析部31によって生成された中間語から命令ブロック入力データと、命令ブロック出力データとを抽出した結果を示すプログラムグラフである。図5には、例として、命令ブロック入力データF1や、命令ブロック出力データG1などが示されている。   FIG. 5 is a program graph showing the result of the instruction block input / output data extraction unit 325A extracting the instruction block input data and the instruction block output data from the intermediate language generated by the syntax analysis unit 31. As an example, FIG. 5 shows instruction block input data F1, instruction block output data G1, and the like.

以上説明した命令ブロック入出力データ抽出部325Aの機能によって、命令ブロック入出力データ抽出部325Aは、命令ブロック情報を用いて、図5に示すように、並列処理プログラム50Aから命令ブロック入出力データを抽出することができる。このように、命令ブロック入出力データ抽出部325Aは、命令ブロック抽出部324によって抽出された命令ブロックと、その命令ブロック内の入出力データとを対応付けた命令ブロック入出力データに関する情報(命令ブロック入出力データ情報)を生成することができる。   By the function of the instruction block input / output data extraction unit 325A described above, the instruction block input / output data extraction unit 325A uses the instruction block information to receive the instruction block input / output data from the parallel processing program 50A as shown in FIG. Can be extracted. As described above, the instruction block input / output data extraction unit 325A includes information (instruction block) regarding the instruction block input / output data in which the instruction block extracted by the instruction block extraction unit 324 is associated with the input / output data in the instruction block. Input / output data information) can be generated.

また、命令ブロック抽出部324によって生成された命令ブロック情報と、命令ブロック入出力データ抽出部325Aによって生成された命令ブロック入出力データに関する情報(命令ブロック入出力データ情報)とは、データ依存枝生成部326に引き渡される。   The instruction block information generated by the instruction block extraction unit 324 and the information (instruction block input / output data information) related to the instruction block input / output data generated by the instruction block input / output data extraction unit 325A are generated as data dependency branches. Delivered to part 326.

(データ依存枝生成部326の説明)
データ依存枝生成部326は、構文解析部31によって生成された中間語と、命令ブロック抽出部324によって生成された命令ブロック情報と、命令ブロック入出力データ抽出部325Aによって生成された命令ブロック入出力データ情報とを入力し、その命令ブロック情報と命令ブロック入出力データ情報とを用いて、データ依存枝を生成する。
データ依存枝とは、入力データと出力データとの間に依存関係(あるブロックの出力データを別のブロックが入力データとして使うという関係)が存在する場合に、命令ブロックの入出力データを「ノード(頂点)」とみなし、出力データノードから入力データノードに向けて接続するものである。ただし、このデータ依存関係が分岐点や合流点を隔てる場合は、対応する分岐ブロックまたは合流ブロックにデータノードを付加して、データ依存枝がこのデータノードを経由するようにする。なお、このデータ依存枝のグラフ構造は、公知の論文であるJohnson, Pingali, "Dependence-Based Program Analysis", ACM Conference on Programming Language Design and Implementation, pp.78-89 (1993)によって提案されたDependence Flow Graphがベースとなっている。このDependence Flow Graphは、前記説明の分岐点や合流点を隔てるデータ依存関係において、対応する分岐ブロックまたは合流ブロックにデータノードを付加して、データ依存枝がこのデータノードを経由することを特徴とするデータ依存関係を表現するためのグラフ構造である。以下、図3、図5および図6を用いて、データ依存枝生成部326の機能の一例について説明する。
(Description of Data Dependent Edge Generation Unit 326)
The data dependency branch generation unit 326 includes the intermediate language generated by the syntax analysis unit 31, the instruction block information generated by the instruction block extraction unit 324, and the instruction block input / output generated by the instruction block input / output data extraction unit 325A. Data information is input, and a data dependency branch is generated using the instruction block information and instruction block input / output data information.
A data dependency branch refers to the input / output data of an instruction block when a dependency exists between input data and output data (a relationship in which another block uses the output data of one block as input data). (Vertex) "and connected from the output data node to the input data node. However, when this data dependency relationship separates a branch point or a merge point, a data node is added to the corresponding branch block or merge block so that the data dependency branch passes through this data node. The graph structure of this data dependence branch is a dependency paper proposed by Johnson, Pingali, "Dependence-Based Program Analysis", ACM Conference on Programming Language Design and Implementation, pp. 78-89 (1993). Based on Flow Graph. This Dependence Flow Graph is characterized in that, in the data dependency relationship between the branch point and the merge point described above, a data node is added to the corresponding branch block or merge block, and the data dependency branch passes through this data node. It is a graph structure for expressing data dependency to be performed. Hereinafter, an example of the function of the data dependence edge generation unit 326 will be described with reference to FIGS. 3, 5, and 6.

図6は、データ依存枝生成部326が、構文解析部31によって生成された中間語からデータ依存枝を生成した結果を示すプログラムグラフである。   FIG. 6 is a program graph showing a result of the data dependency branch generation unit 326 generating a data dependency branch from the intermediate language generated by the syntax analysis unit 31.

データ依存枝生成部326は、命令ブロック入出力データ抽出部325Aによって生成された命令ブロック入出力データ情報を参照して、例えば、命令ブロックA5の命令ブロック入力データとしてsigIn0を見付ける。ここで、命令ブロックA5からプログラムグラフ上を逆方向に辿りながら、sigIn0を生成する命令ブロック(即ち出力データとしてsigIn0を持つ命令ブロック)を探索する。この逆方向探索の途中で分岐ブロックB1をT分岐枝(命令ブロックA2の条件文が成立する、即ち「True」の場合にプログラムが進行する方向)を経由して通過するので、その分岐ブロックB1にsigIn0(T)のデータノードを付加し、このデータノードと命令ブロックA5の入力データノードsigIn0の間をデータ依存枝K1で接続する。さらに探索を続けると、合流ブロックC1を通過するので、この合流ブロックC1にもsigIn0のデータノードを付加し、このデータノードと分岐ブロックB1のデータノードsigIn0(T)の間をデータ依存枝K2で接続する。合流ブロックC1からの探索は、命令ブロックA1と命令ブロックA7への2つの合流元の方向に続ける。命令ブロックA1は出力データとしてsigIn0を持つので、この出力データノードと合流ブロックC1のデータノードsigIn0をデータ依存枝K3で接続し、この方向の探索を終了する。一方、命令ブロックA7への探索については、その後、出力データとしてsigIn0を持つ命令ブロックA6に到達するので、同様に、この出力データノードと合流ブロックC1のデータノードsigIn0をデータ依存枝K4で接続し、全体の探索が終了する。
なお、分岐ブロックB1に付加された出力データノードsigIn0には、sigIn0(T)と記されているが、これは、命令ブロックA2の条件文が成立する場合(Trueの場合)に、分岐ブロックB1に付加された出力データノードsigIn0を経由することを表している。
The data dependency branch generation unit 326 refers to the instruction block input / output data information generated by the instruction block input / output data extraction unit 325A and finds, for example, sigIn0 as instruction block input data of the instruction block A5. Here, an instruction block that generates sigIn0 (that is, an instruction block having sigIn0 as output data) is searched while tracing back on the program graph from the instruction block A5. During this backward search, the branch block B1 is passed through the T branch branch (the conditional statement of the instruction block A2 is satisfied, that is, the direction in which the program proceeds when “True”), so that branch block B1 Is added with a data node of sigIn0 (T), and the data node and the input data node sigIn0 of the instruction block A5 are connected by the data dependence branch K1. If the search is further continued, since it passes through the merge block C1, a data node of sigIn0 is added to this merge block C1, and a data dependence branch K2 is provided between this data node and the data node sigIn0 (T) of the branch block B1. Connecting. The search from the merge block C1 continues in the direction of the two merge sources to the instruction block A1 and the instruction block A7. Since the instruction block A1 has sigIn0 as output data, this output data node and the data node sigIn0 of the merge block C1 are connected by the data dependence branch K3, and the search in this direction is completed. On the other hand, for the search to the instruction block A7, since it reaches the instruction block A6 having sigIn0 as output data, this output data node and the data node sigIn0 of the merge block C1 are similarly connected by the data dependence branch K4. The entire search is finished.
The output data node sigIn0 added to the branch block B1 is described as sigIn0 (T). This is true when the conditional statement of the instruction block A2 is satisfied (when true). This means that the output data node sigIn0 added to the URL is routed.

このように、データ依存枝生成部326は、データ依存枝を作成することができる。また、命令ブロック抽出部324によって生成された命令ブロック情報を用いて命令ブロックとスレッドとの対応を把握し、命令ブロック入出力データ抽出部325Aによって生成された命令ブロック入出力データ情報を用いて命令ブロックと入出力データノードとの対応を把握することで、ノード間を接続したデータ依存枝に関する情報(データ依存枝情報)を生成することができる。データ依存枝情報に関しては、図7を用いて説明する。   As described above, the data dependence edge generation unit 326 can create a data dependence edge. Further, the instruction block information generated by the instruction block extraction unit 324 is used to grasp the correspondence between the instruction block and the thread, and the instruction block input / output data information generated by the instruction block input / output data extraction unit 325A is used to execute the instruction. By grasping the correspondence between blocks and input / output data nodes, it is possible to generate information (data dependency edge information) related to data dependency edges connecting the nodes. Data dependency edge information will be described with reference to FIG.

図7は、データ依存枝生成部326が、構文解析部31によって生成された中間語と、命令ブロック抽出部324によって抽出された命令ブロック情報と、命令ブロック入出力データ抽出部325Aによって抽出された命令ブロック入出力データ情報とを用いて生成した、データ依存枝に関する情報(データ依存枝情報)を示す表である。データ依存枝情報100Aは、出力データノードに関する情報(出力データノードのブロック名、スレッド名および変数名)、入力データノードに関する情報(入力データノードのブロック名、スレッド名および変数名)、先行枝および後続枝を含むものである。
ここで、先行枝とは、そのデータ依存枝の始点ノード(命令ブロック出力ノード)を終点とする別のデータ依存枝を意味する。また、後続枝とは、そのデータ依存枝の終点ノード(命令ブロック入力ノード)を始点とする別のデータ依存枝を意味する。ただし、分岐ブロックや合流ブロックに付加されたデータノードはこれらのブロックの入力ノードであると同時に出力ノードでもあると見なす。データ依存枝生成部326は、例えば、データ依存枝「5」の始点ノード(命令ブロック出力ノード)を終点とする別のデータ依存枝としてデータ依存枝「4」を発見し、データ依存枝「5」の先行枝としてデータ依存枝「4」を設定する。また同様に、データ依存枝生成部326は、例えば、データ依存枝「4」の終点ノード(命令ブロック入力ノード)を始点とする別のデータ依存枝としてデータ依存枝「5」を発見し、データ依存枝「4」の先行枝としてデータ依存枝「5」を設定する。
In FIG. 7, the data dependency branch generation unit 326 is extracted by the intermediate language generated by the syntax analysis unit 31, the instruction block information extracted by the instruction block extraction unit 324, and the instruction block input / output data extraction unit 325A. It is a table | surface which shows the information (data dependence edge information) regarding a data dependence edge produced | generated using the instruction block input / output data information. The data dependency edge information 100A includes information on the output data node (block name, thread name, and variable name of the output data node), information on the input data node (block name, thread name, and variable name of the input data node), the preceding branch, and Includes trailing branches.
Here, the preceding branch means another data dependency branch whose end point is the start node (instruction block output node) of the data dependency branch. The succeeding branch means another data dependency branch starting from the end point node (instruction block input node) of the data dependency branch. However, the data node added to the branch block or the merge block is regarded as an output node as well as an input node of these blocks. For example, the data dependency branch generation unit 326 finds the data dependency branch “4” as another data dependency branch whose end point is the start node (instruction block output node) of the data dependency branch “5”, and the data dependency branch “5”. "4" is set as the leading branch of "." Similarly, the data dependency branch generation unit 326 finds the data dependency branch “5” as another data dependency branch starting from the end point node (instruction block input node) of the data dependency branch “4”, for example. The data dependency branch “5” is set as the preceding branch of the dependency branch “4”.

以上説明したデータ依存枝生成部326の機能によって、データ依存枝生成部326は、命令ブロック入出力データ抽出部325Aによって抽出された命令ブロック入出力データ情報を用いて、図7に示すように、並列処理プログラム50Aからデータ依存枝情報100Aを生成することができる。   With the function of the data dependency edge generation unit 326 described above, the data dependency edge generation unit 326 uses the instruction block input / output data information extracted by the instruction block input / output data extraction unit 325A, as shown in FIG. The data dependence edge information 100A can be generated from the parallel processing program 50A.

また、データ依存枝生成部326によって生成されたデータ依存枝情報100Aは、出力データ生成命令・入力データ参照命令抽出部327に引き渡される。   The data dependency edge information 100A generated by the data dependency edge generation unit 326 is delivered to the output data generation instruction / input data reference instruction extraction unit 327.

(出力データ生成命令・入力データ参照命令抽出部327の説明)
出力データ生成命令・入力データ参照命令抽出部327は、構文解析部31によって生成された中間語と、データ依存枝生成部326によって生成されたデータ依存枝情報100A(図7参照)とを入力し、出力データ生成命令および入力データ参照命令を抽出する。以下、図7および図8を用いて、出力データ生成命令・入力データ参照命令抽出部327の機能の一例について説明する。
(Description of Output Data Generation Instruction / Input Data Reference Instruction Extraction Unit 327)
The output data generation instruction / input data reference instruction extraction unit 327 receives the intermediate language generated by the syntax analysis unit 31 and the data dependency branch information 100A (see FIG. 7) generated by the data dependency branch generation unit 326. The output data generation instruction and the input data reference instruction are extracted. Hereinafter, an example of the function of the output data generation instruction / input data reference instruction extraction unit 327 will be described with reference to FIGS.

出力データ生成命令・入力データ参照命令抽出部327は、データ依存枝生成部326によって生成されたデータ依存枝情報100Aを参照して、まず、各データ依存枝の始点側の命令ブロック内でこのデータを生成する命令を探索する。データ依存枝が先行枝を持たない場合は、このデータ依存枝に関わるデータを生成する命令(データ生成命令)が始点側の命令ブロック内に存在することを意味するので、この命令ブロック内で、該当するデータ生成命令を抽出する。同一データを生成する命令が同一命令ブロック内に複数存在する場合は、これらのうち最後に実行される命令をデータ生成命令とする。逆に、データ依存枝が先行枝を持つ場合は、このデータ依存枝に関わるデータを生成する命令(データ生成命令)が始点側の命令ブロック内に存在しないことを意味する。
次に、各データ依存枝の終点側の命令ブロック内でこのデータを参照する命令を探索する。データ依存枝が後続枝を持たない場合は、このデータ依存枝に関わるデータを参照する命令(データ参照命令)が終点側の命令ブロック内に存在することを意味するので、この命令ブロック内で、該当するデータ参照命令を抽出する。同一データを参照する命令が同一命令ブロック内に複数存在する場合は、これらのうち最初に実行される命令をデータ参照命令とする。逆に、データ依存枝が後続枝を持つ場合は、このデータ依存枝に関わるデータを参照する命令(データ参照命令)が終点側の命令ブロック内に存在しないことを意味する。
The output data generation instruction / input data reference instruction extraction unit 327 refers to the data dependency edge information 100A generated by the data dependency edge generation unit 326, and first, this data in the instruction block on the start point side of each data dependency edge Search for instructions that generate. If the data dependency branch does not have a preceding branch, it means that an instruction (data generation instruction) for generating data related to the data dependency branch exists in the instruction block on the start point side. The corresponding data generation instruction is extracted. If there are a plurality of instructions that generate the same data in the same instruction block, the last instruction to be executed is set as the data generation instruction. Conversely, when the data dependency branch has a preceding branch, it means that an instruction (data generation instruction) for generating data related to the data dependency branch does not exist in the instruction block on the start point side.
Next, an instruction that refers to this data is searched for in the instruction block on the end point side of each data dependency branch. If the data dependency branch does not have a succeeding branch, it means that an instruction (data reference instruction) that refers to data related to the data dependency branch exists in the instruction block on the end point side. The corresponding data reference instruction is extracted. When there are a plurality of instructions that refer to the same data in the same instruction block, the first instruction to be executed among them is set as a data reference instruction. Conversely, if the data dependency branch has a subsequent branch, it means that an instruction (data reference instruction) for referring to data related to the data dependency branch does not exist in the instruction block on the end point side.

図8は、出力データ生成命令・入力データ参照命令抽出部327が、構文解析部31によって生成された中間語と、データ依存枝生成部326によって生成されたデータ依存枝情報100Aとを用いて前記データ生成命令探索および前記データ参照命令探索によって生成した、出力データ生成命令および入力データ参照命令に関する情報(出力データ生成命令・入力データ参照命令情報)を示す表である。出力データ生成命令・入力データ参照命令情報110Aは、各データ依存枝について、その始点側の命令ブロック内のデータ生成命令に関する情報(ブロック名、スレッド名および命令)、データ生成命令記号、その終点側の命令ブロック内のデータ参照命令に関する情報(ブロック名、スレッド名および命令)およびデータ参照命令記号を含むものである。   In FIG. 8, the output data generation instruction / input data reference instruction extraction unit 327 uses the intermediate language generated by the syntax analysis unit 31 and the data dependency branch information 100A generated by the data dependency edge generation unit 326. 10 is a table showing information (output data generation instruction / input data reference instruction information) related to an output data generation instruction and an input data reference instruction generated by a data generation instruction search and the data reference instruction search. The output data generation instruction / input data reference instruction information 110A includes, for each data dependency branch, information (block name, thread name and instruction) regarding the data generation instruction in the instruction block on the start point side, data generation instruction symbol, and end point side thereof Information (block name, thread name and instruction) and data reference instruction symbols in the instruction block.

データ生成命令記号は、データ生成命令に関する情報を記号化したものであり、「データ依存枝番号:DEF」と標記している。また、データ参照命令記号は、データ参照命令に関する情報を記号化したものであり、「データ依存枝番号:USE」と標記している。
図8には、図7で示されたデータ依存枝「6」〜「9」が存在しないが、これらのデータ依存枝がデータ生成命令と参照命令とをいずれも持たないからである。
The data generation instruction symbol is obtained by symbolizing information related to the data generation instruction, and is denoted as “data dependency branch number: DEF”. Further, the data reference instruction symbol is information obtained by symbolizing information related to the data reference instruction, and is denoted as “data dependency branch number: USE”.
In FIG. 8, the data dependency branches “6” to “9” shown in FIG. 7 do not exist, but these data dependency branches have neither a data generation instruction nor a reference instruction.

以上説明した出力データ生成命令・入力データ参照命令抽出部327の機能によって、出力データ生成命令・入力データ参照命令抽出部327は、データ依存枝生成部326によって生成されたデータ依存枝情報100Aを用いて、図8に示すように、出力データ生成命令・入力データ参照命令情報110Aを生成することができる。   By the function of the output data generation instruction / input data reference instruction extraction unit 327 described above, the output data generation instruction / input data reference instruction extraction unit 327 uses the data dependency edge information 100A generated by the data dependency edge generation unit 326. As shown in FIG. 8, the output data generation instruction / input data reference instruction information 110A can be generated.

また、データ依存枝生成部326によって生成されたデータ依存枝情報100Aと、出力データ生成命令・入力データ参照命令抽出部327によって生成された出力データ生成命令・入力データ参照命令情報110Aとは、スレッド間データ依存性抽出部33に引き渡される。   The data dependency edge information 100A generated by the data dependency edge generation unit 326 and the output data generation instruction / input data reference instruction information 110A generated by the output data generation instruction / input data reference instruction extraction unit 327 are a thread. It is delivered to the inter-data dependency extraction unit 33.

(スレッド間データ依存性抽出部33の説明)
スレッド間データ依存性抽出部33は、データ依存枝生成部326によって生成されたデータ依存枝情報100A(図7参照)と、出力データ生成命令・入力データ参照命令抽出部327よって生成された出力データ生成命令・入力データ参照命令情報110A(図8参照)とを入力し、スレッド間のデータ依存性を抽出する。スレッド間データ依存性抽出部33は、スレッド入出力データ抽出部331と、スレッド出力データ生成命令・スレッド入力データ参照命令抽出部332とを含んで構成されている。
(Description of inter-thread data dependency extraction unit 33)
The inter-thread data dependency extraction unit 33 includes the data dependency edge information 100A (see FIG. 7) generated by the data dependency edge generation unit 326 and the output data generated by the output data generation instruction / input data reference instruction extraction unit 327. The generation instruction / input data reference instruction information 110A (see FIG. 8) is input to extract data dependency between threads. The inter-thread data dependency extraction unit 33 includes a thread input / output data extraction unit 331 and a thread output data generation instruction / thread input data reference instruction extraction unit 332.

(スレッド入出力データ抽出部331の説明)
スレッド入出力データ抽出部331は、データ依存枝生成部326によって生成されたデータ依存枝情報100A(図7参照)を入力し、データ依存枝情報100A(図7参照)を用いて、スレッド入力データおよびスレッド出力データ(スレッド入出力データ)を抽出し、スレッド間データ依存枝情報120A(図9参照)を生成する。
スレッド入力データとは、スレッド内の各命令が参照するデータのうち、別のスレッド内で生成されるものである。また、スレッド出力データとは、スレッド内の各命令が生成するデータのうち、別のスレッド内で参照されるものである。つまり、スレッド境界E1〜E6(図6参照)を横切るデータ依存枝がスレッド入出力データを表す。以下、図6、図7および図9を用いて、スレッド入出力データ抽出部331の機能の一例について説明する。
(Description of thread input / output data extraction unit 331)
The thread input / output data extraction unit 331 receives the data dependency edge information 100A (see FIG. 7) generated by the data dependency edge generation unit 326, and uses the data dependency edge information 100A (see FIG. 7) to input thread input data. Then, thread output data (thread input / output data) is extracted, and inter-thread data dependency edge information 120A (see FIG. 9) is generated.
The thread input data is data generated in another thread among data referred to by each instruction in the thread. The thread output data is data that is referred to in another thread among data generated by each instruction in the thread. That is, the data dependence branch crossing the thread boundaries E1 to E6 (see FIG. 6) represents the thread input / output data. Hereinafter, an example of the function of the thread input / output data extraction unit 331 will be described with reference to FIGS. 6, 7, and 9.

スレッド入出力データ抽出部331は、データ依存枝生成部326によって生成されたデータ依存枝情報100Aを参照して、データ依存枝情報100Aにスレッド間データ依存枝を挿入したスレッド間データ依存枝情報120Aを生成する。ここで、スレッド間データ依存枝とは、異なるスレッドのデータノードを接続するデータ依存枝を意味する。
図7のデータ依存枝情報100Aに示すように、データ依存枝「1」〜「10」、「17」、「20」、「21」は、出力データノードのスレッドと入力データノードのスレッドとが同一であるので、出力データノードから入力データノードにスレッド間データ依存枝が接続されない。また、データ依存枝「11」〜「16」、「18」、「19」、「22」〜「24」は、出力データノードのスレッドと入力データノードのスレッドとが異なるので、出力データノードから入力データノードにスレッド間データ依存枝が接続される。
The thread input / output data extraction unit 331 refers to the data dependency edge information 100A generated by the data dependency edge generation unit 326, and inter-thread data dependency edge information 120A in which an inter-thread data dependency edge is inserted into the data dependency edge information 100A. Is generated. Here, the inter-thread data dependency branch means a data dependency branch connecting data nodes of different threads.
As shown in the data dependency edge information 100A of FIG. 7, the data dependency edges “1” to “10”, “17”, “20”, and “21” indicate that the thread of the output data node and the thread of the input data node are Since they are the same, the inter-thread data dependency branch is not connected from the output data node to the input data node. Also, since the data dependency branches “11” to “16”, “18”, “19”, “22” to “24” have different output data node threads and input data node threads, An inter-thread data dependency branch is connected to the input data node.

図9は、スレッド入出力データ抽出部331が、データ依存枝生成部326によって生成されたデータ依存枝情報100Aを用いて生成した、スレッド間データ依存枝情報120Aを示す表である。図7のデータ依存枝情報100Aと比較して、「スレッド間データ依存枝」の列が追加されており、そこにスレッド間データ依存枝であるか否かを示す値が各データ依存枝に対して設定できるようになっている。   FIG. 9 is a table showing the inter-thread data dependency edge information 120A generated by the thread input / output data extraction unit 331 using the data dependency edge information 100A generated by the data dependency edge generation unit 326. Compared with the data dependence edge information 100A of FIG. 7, a column of “inter-thread data dependence edge” is added, and a value indicating whether or not the data dependence edge is an inter-thread data dependence edge is added to each data dependence edge. Can be set.

また、スレッド入出力データ抽出部331によって生成されたスレッド間データ依存枝情報120Aは、スレッド出力データ生成命令・スレッド入力データ参照命令抽出部332に引き渡される。   Further, the inter-thread data dependency branch information 120A generated by the thread input / output data extraction unit 331 is delivered to the thread output data generation instruction / thread input data reference instruction extraction unit 332.

(スレッド出力データ生成命令・スレッド入力データ参照命令抽出部332の説明)
スレッド出力データ生成命令・スレッド入力データ参照命令抽出部332は、スレッド入出力データ抽出部331によって生成されたスレッド間データ依存枝情報120A(図9参照)と、出力データ生成命令・入力データ参照命令抽出部327によって生成された出力データ生成命令・入力データ参照命令情報110A(図8参照)とを参照して、スレッド入力データ参照命令を抽出する。ここで、スレッド入力データ参照命令とは、スレッド間データ依存枝に関わる入力データ参照命令のことである。以下、図8ないし図11を用いて、スレッド出力データ生成命令・スレッド入力データ参照命令抽出部332の機能の一例について説明する。
(Description of thread output data generation instruction / thread input data reference instruction extraction unit 332)
The thread output data generation instruction / thread input data reference instruction extraction unit 332 includes an inter-thread data dependency branch information 120A (see FIG. 9) generated by the thread input / output data extraction unit 331, and an output data generation instruction / input data reference instruction. The thread input data reference instruction is extracted with reference to the output data generation instruction / input data reference instruction information 110A (see FIG. 8) generated by the extraction unit 327. Here, the thread input data reference instruction is an input data reference instruction related to the inter-thread data dependency branch. Hereinafter, an example of the function of the thread output data generation instruction / thread input data reference instruction extraction unit 332 will be described with reference to FIGS.

図9に示すスレッド間データ依存枝情報120Aを用いて説明する。スレッド出力データ生成命令・スレッド入力データ参照命令抽出部332は、スレッド入力データ参照命令として、スレッド間データ依存枝「11」〜「16」、「18」、「19」、「22」〜「24」それぞれのデータ参照命令「11:USE」〜「16:USE」、「18:USE」、「19:USE」、「22:USE」〜「24:USE」を抽出する。また、スレッド出力データ生成命令・スレッド入力データ参照命令抽出部332は、抽出したデータ依存枝を用いて、出力データ生成命令・入力データ参照命令抽出部327によって生成された出力データ生成命令および入力データ参照命令を参照して、スレッド出力データ生成命令を抽出する。   This will be described using the inter-thread data dependency edge information 120A shown in FIG. The thread output data generation instruction / thread input data reference instruction extraction unit 332 uses inter-thread data dependency branches “11” to “16”, “18”, “19”, “22” to “24” as thread input data reference instructions. The respective data reference instructions “11: USE” to “16: USE”, “18: USE”, “19: USE”, and “22: USE” to “24: USE” are extracted. Further, the thread output data generation instruction / thread input data reference instruction extraction unit 332 uses the extracted data dependency branch to generate the output data generation instruction and input data generated by the output data generation instruction / input data reference instruction extraction unit 327. Referring to the reference instruction, a thread output data generation instruction is extracted.

図8に示す出力データ生成命令・入力データ参照命令情報110Aを用いて説明する。スレッド出力データ生成命令・スレッド入力データ参照命令抽出部332は、抽出したデータ依存枝「11」〜「16」、「18」、「19」、「22」〜「24」のうち、スレッド入力データ参照命令の直接のデータ生成命令が存在するか否かを判定する。
判定の結果、スレッド出力データ生成命令・スレッド入力データ参照命令抽出部332は、データ依存枝「13」、「14」、「16」、「18」、「19」については、スレッド入力データ参照命令の直接のデータ生成命令が存在するので(図8の出力データ生成命令・入力データ参照命令情報110Aを参照すると、データ参照命令と同一行にデータ生成命令が存在するので)、このデータ生成命令をスレッド出力データ生成命令として抽出する。
また、スレッド出力データ生成命令・スレッド入力データ参照命令抽出部332は、データ依存枝「11」、「12」、「15」については、スレッド入力データ参照命令の直接のデータ生成命令が存在しないので(図8の出力データ生成命令・入力データ参照命令情報110Aを参照すると、データ参照命令と同一行にデータ生成命令が存在しないので)、スレッド出力データ生成命令を探索する必要がある。この探索方法については、図10を用いて説明する。
This will be described using the output data generation instruction / input data reference instruction information 110A shown in FIG. The thread output data generation instruction / thread input data reference instruction extraction unit 332 includes the thread input data among the extracted data dependency branches “11” to “16”, “18”, “19”, and “22” to “24”. It is determined whether there is a direct data generation instruction of the reference instruction.
As a result of the determination, the thread output data generation instruction / thread input data reference instruction extraction unit 332 executes the thread input data reference instruction for the data dependency branches “13”, “14”, “16”, “18”, and “19”. Since there is a direct data generation instruction (referring to the output data generation instruction / input data reference instruction information 110A in FIG. 8, the data generation instruction exists on the same line as the data reference instruction), the data generation instruction Extracted as a thread output data generation instruction.
Also, the thread output data generation instruction / thread input data reference instruction extraction unit 332 has no direct data generation instruction of the thread input data reference instruction for the data dependency branches “11”, “12”, and “15”. (If the output data generation instruction / input data reference instruction information 110A in FIG. 8 is referred to, there is no data generation instruction on the same line as the data reference instruction), it is necessary to search for the thread output data generation instruction. This search method will be described with reference to FIG.

図10は、スレッド出力データ生成命令・スレッド入力データ参照命令抽出部332が、スレッド入力データ参照命令の直接のデータ生成命令が存在しない場合における、スレッド出力データ生成命令の探索方法を説明するための図である。
スレッド出力データ生成命令・スレッド入力データ参照命令抽出部332は、スレッド入力データ参照命令の直接のデータ生成命令が存在しない場合、先行枝方向にその出力データ生成命令を探索する。例えば、スレッド出力データ生成命令・スレッド入力データ参照命令抽出部332は、データ依存枝「11」の先行枝「8」を抽出する。そして、スレッド出力データ生成命令・スレッド入力データ参照命令抽出部332は、データ依存枝「8」のデータ生成命令記号が存在しないので、データ依存枝「8」の先行枝「3」と、先行枝「24」とを抽出する。
スレッド出力データ生成命令・スレッド入力データ参照命令抽出部332は、先行枝として抽出したデータ依存枝「3」のデータ生成命令記号「3:DEF」を抽出し、探索元のデータ依存枝「11」の生成命令リスト(スレッド入力データ参照命令のスレッド出力データ生成命令リスト)に追加する。
また、スレッド出力データ生成命令・スレッド入力データ参照命令抽出部332は、先行枝として抽出したデータ依存枝「24」のデータ生成命令記号「24:DEF」を抽出し、探索元のデータ依存枝「11」の生成命令リスト(スレッド入力データ参照命令のスレッド出力データ生成命令リスト)に追加する。
FIG. 10 illustrates a thread output data generation instruction search method when the thread output data generation instruction / thread input data reference instruction extraction unit 332 does not include a direct data generation instruction of the thread input data reference instruction. FIG.
When there is no direct data generation instruction of the thread input data reference instruction, the thread output data generation instruction / thread input data reference instruction extraction unit 332 searches for the output data generation instruction in the preceding branch direction. For example, the thread output data generation instruction / thread input data reference instruction extraction unit 332 extracts the leading branch “8” of the data dependence branch “11”. Then, the thread output data generation instruction / thread input data reference instruction extraction unit 332 does not have the data generation instruction symbol of the data dependency branch “8”, and therefore the preceding branch “3” of the data dependency branch “8” and the preceding branch “24” is extracted.
The thread output data generation instruction / thread input data reference instruction extraction unit 332 extracts the data generation instruction symbol “3: DEF” of the data dependency branch “3” extracted as the preceding branch, and the search source data dependency branch “11”. To the generation instruction list (thread input data generation instruction list of thread input data reference instruction).
Further, the thread output data generation instruction / thread input data reference instruction extraction unit 332 extracts the data generation instruction symbol “24: DEF” of the data dependency branch “24” extracted as the preceding branch, and the search source data dependency branch “ 11 ”is added to the generation instruction list (thread output data generation instruction list of the thread input data reference instruction).

以上説明したスレッド抽出データ生成命令の探索方法によって、スレッド出力データ生成命令・スレッド入力データ参照命令抽出部332は、スレッド入力データ参照命令のスレッド出力データ生成命令リストを生成することが可能である。   By the thread extraction data generation instruction search method described above, the thread output data generation instruction / thread input data reference instruction extraction unit 332 can generate a thread output data generation instruction list of thread input data reference instructions.

図11は、スレッド出力データ生成命令・スレッド入力データ参照命令抽出部332が、スレッド入力データ参照命令のスレッド出力データ生成命令リストを、スレッド入出力データ抽出部331が生成したスレッド間データ依存枝情報120A(図9参照)に挿入して生成した情報(スレッド間データ依存命令対情報)を示す表である。図11に示すように、スレッド入力データ参照命令のスレッド出力データ生成命令リストは、各データ依存枝に対して、複数存在する場合もある。   FIG. 11 shows a thread output data generation instruction / thread input data reference instruction extraction unit 332 that generates a thread output data generation instruction list of thread input data reference instructions, and inter-thread data dependency branch information generated by the thread input / output data extraction unit 331. It is a table | surface which shows the information (inter-thread data dependence instruction pair information) inserted and produced | generated in 120A (refer FIG. 9). As shown in FIG. 11, a plurality of thread output data generation instruction lists of thread input data reference instructions may exist for each data dependency branch.

また、スレッド入出力データ抽出部331によって生成されたスレッド間データ依存枝情報120Aと、スレッド出力データ生成命令・スレッド入力データ参照命令抽出部332によって生成されたスレッド間データ依存命令対情報130A(図11参照)とは、通信命令挿入部35Aに引き渡される。   Further, the inter-thread data dependency branch information 120A generated by the thread input / output data extraction unit 331 and the inter-thread data dependency instruction pair information 130A generated by the thread output data generation instruction / thread input data reference instruction extraction unit 332 (see FIG. 11) is delivered to the communication command insertion unit 35A.

(通信命令挿入部35Aの説明)
通信命令挿入部35Aは、構文解析部31によって生成された中間語と、スレッド入出力データ抽出部331によって生成されたスレッド間データ依存枝情報120A(図9参照)と、スレッド出力データ生成命令・スレッド入力データ参照命令抽出部332によって生成されたスレッド間データ依存命令対情報130A(図11参照)とを入力し、中間語に通信命令を挿入する。通信命令挿入部35Aは、データ送信命令挿入部351Aと、データ受信同期命令挿入部352Aとを含んで構成されている。
(Description of communication command insertion unit 35A)
The communication instruction insertion unit 35A includes the intermediate language generated by the syntax analysis unit 31, the inter-thread data dependency branch information 120A (see FIG. 9) generated by the thread input / output data extraction unit 331, and the thread output data generation instruction / The inter-thread data dependent instruction pair information 130A (see FIG. 11) generated by the thread input data reference instruction extraction unit 332 is input, and a communication instruction is inserted into the intermediate language. The communication command insertion unit 35A includes a data transmission command insertion unit 351A and a data reception synchronization command insertion unit 352A.

(データ送信命令挿入部351Aの説明)
データ送信命令挿入部351Aは、スレッド間データ依存命令対情報130A(図11参照)のスレッド入力データ参照命令のスレッド出力データ生成命令リストを参照して、中間語内のスレッド入力データ参照命令のスレッド出力データ生成命令の直後にデータ送信命令を挿入する。以下、図11を用いて、データ送信命令挿入部351Aの機能の一例について説明する。
(Description of Data Transmission Instruction Insertion Unit 351A)
The data transmission instruction insertion unit 351A refers to the thread output data generation instruction list of the thread input data reference instruction in the inter-thread data dependence instruction pair information 130A (see FIG. 11), and the thread of the thread input data reference instruction in the intermediate language A data transmission command is inserted immediately after the output data generation command. Hereinafter, an example of the function of the data transmission command insertion unit 351A will be described with reference to FIG.

データ送信命令挿入部351Aは、例えば、スレッド入力データ参照命令「13:USE」に対応するスレッド出力データ生成命令「13:DEF」の直後にデータ送信命令を挿入する。また、例えば、データ送信命令挿入部351Aは、スレッド入力データ参照命令「11:USE」に対応するスレッド出力データ生成命令「3:DEF」と「24:DEF」のそれぞれの直後にデータ送信命令を挿入する。
この際、送信先スレッドとしてスレッド入力データ参照命令「13:USE」が実行されるスレッド「p2」を指定する。
データ送信命令挿入部351Aは、データ送信命令として、例えば、既存の並列プログラミング用メッセージ通信ライブラリ関数のデータ送信処理を行う関数を呼び出す命令を中間語内に挿入することが可能である。
メッセージ通信方式の並列プログラミング環境であるMPIを例にとると、データ送信命令挿入部351Aは、データ送信処理を行う関数として、例えばMPI_Send()関数を呼び出す命令を挿入し、関数呼び出し引数として、データアドレス、データサイズ、データタイプ、送信先スレッド番号(各スレッドに予め割り当てられた固有の番号)、メッセージタグ番号(スレッド入力データ参照命令のデータ依存枝番号)を設定する。
For example, the data transmission instruction insertion unit 351A inserts a data transmission instruction immediately after the thread output data generation instruction “13: DEF” corresponding to the thread input data reference instruction “13: USE”. Further, for example, the data transmission command insertion unit 351A sends a data transmission command immediately after each of the thread output data generation commands “3: DEF” and “24: DEF” corresponding to the thread input data reference command “11: USE”. insert.
At this time, the thread “p2” in which the thread input data reference instruction “13: USE” is executed is designated as the destination thread.
The data transmission command insertion unit 351A can insert, for example, an instruction for calling a function for performing data transmission processing of an existing message communication library function for parallel programming into the intermediate language as a data transmission command.
Taking MPI, which is a message programming parallel programming environment, for example, the data transmission instruction insertion unit 351A inserts, for example, an instruction for calling the MPI_Send () function as a function for performing data transmission processing, and uses data as a function call argument. An address, a data size, a data type, a destination thread number (unique number assigned in advance to each thread), and a message tag number (data dependency branch number of a thread input data reference instruction) are set.

(データ受信同期命令挿入部352Aの説明)
データ受信同期命令挿入部352Aは、スレッド間データ依存命令対情報130A(図11参照)のスレッド入力データ参照命令のスレッド出力データ生成命令リストを参照して、中間語内のスレッド入力データ参照命令の直前にデータ受信同期命令を挿入する。以下、図11を用いて、データ受信同期命令挿入部352Aの機能の一例について説明する。
(Description of Data Reception Synchronization Command Insertion Unit 352A)
The data reception synchronization instruction insertion unit 352A refers to the thread output data generation instruction list of the thread input data reference instruction in the inter-thread data dependent instruction pair information 130A (see FIG. 11), and determines the thread input data reference instruction in the intermediate language. A data reception synchronization command is inserted immediately before. Hereinafter, an example of the function of the data reception synchronization command insertion unit 352A will be described with reference to FIG.

データ受信同期命令挿入部352Aは、例えば、スレッド入力データ参照命令「11:USE」の直前にデータ受信同期命令を挿入する。
データ受信同期命令挿入部352Aは、データ受信同期命令として、例えば、既存の並列プログラミング用メッセージ通信ライブラリ関数のデータ受信処理を行う関数を呼び出す命令を中間語内に挿入することが可能である。
メッセージ通信方式の並列プログラミング環境であるMPIを例にとると、データ受信同期命令挿入部352Aは、データ受信処理を行う関数として、例えばMPI_Recv()関数を呼び出す命令を挿入し、関数呼び出し引数として、データアドレス、データサイズ、データタイプ、送信元スレッド番号(MPI_ANY_SOURCE)、メッセージタグ番号(スレッド入力データ参照命令のデータ依存枝番号)を設定する。なお、送信元スレッド番号として「MPI_ANY_SOURCE」(「送信元は任意のスレッド」の意)としているのは、スレッド入力データ参照命令に対応するスレッド出力データ生成命令が複数個存在する場合に対応するためである。
For example, the data reception synchronization command insertion unit 352A inserts the data reception synchronization command immediately before the thread input data reference command “11: USE”.
The data reception synchronization instruction insertion unit 352A can insert, for example, an instruction for calling a function for performing data reception processing of an existing parallel programming message communication library function into the intermediate language as the data reception synchronization instruction.
Taking MPI, which is a message programming parallel programming environment, as an example, the data reception synchronization instruction insertion unit 352A inserts, for example, an instruction for calling an MPI_Recv () function as a function for performing data reception processing, and as a function call argument, A data address, a data size, a data type, a transmission source thread number (MPI_ANY_SOURCE), and a message tag number (data dependent branch number of a thread input data reference instruction) are set. Note that “MPI_ANY_SOURCE” (“transmission source is an arbitrary thread”) is used as the transmission source thread number in order to correspond to the case where there are a plurality of thread output data generation instructions corresponding to the thread input data reference instruction. It is.

また、通信命令挿入部35Aによって中間語に通信命令が挿入されて生成された通信命令を含むプログラムは、プログラム分割・コード生成部39に引き渡される。   A program including a communication command generated by inserting a communication command into the intermediate language by the communication command insertion unit 35A is delivered to the program division / code generation unit 39.

(プログラム分割・コード生成部39の説明)
プログラム分割・コード生成部39は、通信命令挿入部35Aによって生成された通信命令を含むプログラムを各プロセッサが行うスレッド処理に分割(プログラム分割)し、実行コード(機械コード)に変換(コード生成)するものである。その結果、プログラム分割・コード生成部39は、通信命令を含む分割プログラム55A(図1参照)を生成する。
プログラム分割の機能は、構文解析部31によって各命令に付加されたスレッド属性を参照して、プログラムを各スレッドの処理に分割するものである。
また、コード生成の機能は、通常のコンパイラが有する公知のコード生成の機能と特に変わらないため、コード生成の機能についてのさらに詳細な説明は省略する。
(Description of program division / code generation unit 39)
The program division / code generation unit 39 divides a program including the communication instruction generated by the communication instruction insertion unit 35A into thread processing performed by each processor (program division) and converts it into an execution code (machine code) (code generation). To do. As a result, the program division / code generation unit 39 generates a division program 55A (see FIG. 1) including a communication command.
The program dividing function refers to a thread attribute added to each instruction by the syntax analysis unit 31 and divides the program into processes of each thread.
Further, the code generation function is not particularly different from the known code generation function of a normal compiler, and therefore a more detailed description of the code generation function is omitted.

以上説明した第1の実施形態によれば、プログラム処理装置1Aは、並列処理プログラム50Aを解析し、既存の分散メモリシステムおよび既存の共有メモリシステムに適用可能な通信命令を含む分割プログラム55Aを生成することが可能である。   According to the first embodiment described above, the program processing apparatus 1A analyzes the parallel processing program 50A and generates a divided program 55A including communication instructions applicable to the existing distributed memory system and the existing shared memory system. Is possible.

図12は、プログラム処理装置1A(図1参照)のハードウェア構成の一例を示す図である。
図12に示すように、プログラム処理装置1Aは、コンピュータであり、中央処理装置(処理部)10と、主記憶装置(処理部)20と、ファイル装置(記憶部)40と、入力装置INと、出力装置OUTとを含んで構成されている。また、ファイル装置40は、並列処理プログラム50Aを含んで構成され、主記憶装置20は、並列処理コンパイラ30Aを含んで構成されている。
FIG. 12 is a diagram illustrating an example of a hardware configuration of the program processing apparatus 1A (see FIG. 1).
As shown in FIG. 12, the program processing device 1A is a computer, and includes a central processing unit (processing unit) 10, a main storage device (processing unit) 20, a file device (storage unit) 40, and an input device IN. , And the output device OUT. The file device 40 includes a parallel processing program 50A, and the main storage device 20 includes a parallel processing compiler 30A.

中央処理装置10は、例えばCPU(Central Processing Unit)等から構成され、主記憶装置20に格納されているプログラムを実行する機能を有する。
主記憶装置20は、例えばRAM(Random Access Memory)や、ROM(Read Only Memory)等から構成され、中央処理装置10が実行するプログラムやデータ等を格納するものである。
並列処理コンパイラ30Aは、並列処理プログラム50Aをマルチプロセッサシステムが実行できる形式に変換する(マルチプロセッサシステムのための実行コードを生成する)ためのプログラムである。
ファイル装置40は、ファイルを格納するための装置であり、並列処理プログラム50A等を格納するものである。
並列処理プログラム50Aは、マルチプロセッサシステムに並列処理を実行させるためのプログラムであり、プログラマ等によって記述されたものである。
入力装置INは、キーボードや、マウス等によって構成され、操作者からの指示を入力する機能を有する。
また、出力装置OUTは、ディスプレイや、プリンタ等によって構成され、文字や画像等を出力する機能を有する。
The central processing unit 10 is configured by, for example, a CPU (Central Processing Unit) and the like, and has a function of executing a program stored in the main storage device 20.
The main storage device 20 is composed of, for example, a RAM (Random Access Memory), a ROM (Read Only Memory), and the like, and stores programs, data, and the like executed by the central processing unit 10.
The parallel processing compiler 30A is a program for converting the parallel processing program 50A into a format that can be executed by the multiprocessor system (generating an execution code for the multiprocessor system).
The file device 40 is a device for storing files, and stores a parallel processing program 50A and the like.
The parallel processing program 50A is a program for causing a multiprocessor system to execute parallel processing, and is described by a programmer or the like.
The input device IN is configured by a keyboard, a mouse, and the like, and has a function of inputting an instruction from an operator.
The output device OUT is configured by a display, a printer, or the like, and has a function of outputting characters, images, and the like.

中央処理装置10は、主記憶装置20に格納された並列処理コンパイラ30Aの指令を受け、ファイル装置40に保存された並列処理プログラム50Aを主記憶装置20に読み出す。中央処理装置10は、主記憶装置20に読み出した並列処理プログラム50A中の命令の処理順序や、各命令が参照するデータと、各命令が生成するデータとを解析した結果得られるデータ依存枝情報100A(図7参照)およびスレッド間データ依存命令対情報130A(図11参照)を生成し、主記憶装置20に格納する。なお、並列処理プログラム50Aは、例えば、プログラマ等が入力装置INを介して入力し、ファイル装置40に格納することが可能である。   The central processing unit 10 receives a command from the parallel processing compiler 30 </ b> A stored in the main storage device 20, and reads out the parallel processing program 50 </ b> A stored in the file device 40 to the main storage device 20. The central processing unit 10 obtains data dependency branch information obtained as a result of analyzing the processing order of instructions in the parallel processing program 50A read to the main storage device 20, the data referred to by each instruction, and the data generated by each instruction. 100A (see FIG. 7) and inter-thread data dependent instruction pair information 130A (see FIG. 11) are generated and stored in the main storage device 20. Note that the parallel processing program 50A can be input by the programmer or the like via the input device IN and stored in the file device 40, for example.

次いで、中央処理装置10は、主記憶装置20に格納された並列処理コンパイラ30Aの指令を受け、データ依存枝情報100A(図7参照)およびスレッド間データ依存命令対情報130A(図11参照)を参照して、通信命令を主記憶装置20に格納された並列処理プログラム50A中に埋め込む。   Next, the central processing unit 10 receives the instruction of the parallel processing compiler 30A stored in the main storage device 20, and receives the data dependence branch information 100A (see FIG. 7) and the inter-thread data dependence instruction pair information 130A (see FIG. 11). Referring to the communication command, the communication command is embedded in the parallel processing program 50A stored in the main storage device 20.

次いで、中央処理装置10は、主記憶装置20に格納された並列処理コンパイラ30Aの指令を受け、通信命令が埋め込まれた並列処理プログラム50Aをスレッド毎に分割する。中央処理装置10は、スレッド毎に分割された通信命令を含む分割プログラム55Aをファイル装置40に保存する。また、中央処理装置10は、出力装置OUTを介して当該プログラムを出力することが可能である。   Next, the central processing unit 10 receives a command from the parallel processing compiler 30A stored in the main storage device 20, and divides the parallel processing program 50A in which the communication command is embedded for each thread. The central processing unit 10 stores the divided program 55A including the communication command divided for each thread in the file device 40. Further, the central processing unit 10 can output the program via the output device OUT.

図13は、プログラム処理装置1A(図1参照)の動作を示すフローチャートである。図13を参照して(適宜図1参照)、プログラム処理装置1Aの動作について説明する。   FIG. 13 is a flowchart showing the operation of the program processing apparatus 1A (see FIG. 1). The operation of the program processing apparatus 1A will be described with reference to FIG. 13 (see FIG. 1 as appropriate).

図13に示すように、まず、構文解析部31は、並列処理プログラム50Aの構文を解析する処理(構文解析処理)を行う(S10)。次に、データ依存性抽出部32Aは、構文解析処理の結果生成された中間語を用いて、データ依存性を抽出する処理(データ依存性抽出処理)を行う(S20)。スレッド間データ依存性抽出部33は、スレッド間のデータ依存性を抽出する処理(スレッド間データ依存性抽出処理)を行う(S30)。次に、通信命令挿入部35Aは、通信命令を挿入して通信命令を含むプログラムを生成する処理(通信命令挿入処理)を行う(S40A)。その後、プログラム分割・コード生成部39は、通信命令を含むプログラムを分割し、実行コードに変換する処理(プログラム分割・コード生成処理)を行う(S50)。   As shown in FIG. 13, the syntax analysis unit 31 first performs a process (syntax analysis process) of analyzing the syntax of the parallel processing program 50A (S10). Next, the data dependency extraction unit 32A performs a process of extracting data dependency (data dependency extraction process) using the intermediate language generated as a result of the syntax analysis process (S20). The inter-thread data dependency extraction unit 33 performs processing for extracting data dependency between threads (inter-thread data dependency extraction processing) (S30). Next, the communication command insertion unit 35A performs processing (communication command insertion processing) for generating a program including the communication command by inserting the communication command (S40A). Thereafter, the program division / code generation unit 39 performs a process (program division / code generation process) for dividing the program including the communication instruction and converting the program into an execution code (S50).

図14は、データ依存性抽出処理S20(図13参照)の詳細を示すフローチャートである。図14を参照して(適宜図1参照)、データ依存性抽出処理S20(図13参照)について説明する。   FIG. 14 is a flowchart showing details of the data dependency extraction process S20 (see FIG. 13). The data dependency extraction process S20 (see FIG. 13) will be described with reference to FIG. 14 (see FIG. 1 as appropriate).

図14に示すように、まず、中間語から命令参照・生成データ抽出部321は、各命令の参照・生成データを抽出する(S21)。次に、関数内間接参照・生成データ抽出部323は、中間語から関数内間接参照・生成データを抽出する(S22)。そして、命令ブロック抽出部324は、中間語から命令ブロックを抽出する(S23)。次に、命令ブロック入出力データ抽出部325Aは、中間語から命令ブロック入出力データを抽出する(S24)。そして、データ依存枝生成部326は、命令ブロック出力データとこれを入力する命令ブロック入力データとの間にデータ依存枝を付加する(S25)。この処理により、データ依存枝生成部326は、データ依存枝情報100A(図7参照)を生成することができる。その後、出力データ生成命令・入力データ参照命令抽出部327は、出力データ生成命令・入力データ参照命令を抽出する(S26)。この処理により、出力データ生成命令・入力データ参照命令抽出部327は、出力データ生成命令・入力データ参照命令情報110A(図8参照)を生成することができる。これらの処理により、データ依存性抽出部32Aは、中間語を用いて、データ依存枝情報100A(図7参照)および出力データ生成命令・入力データ参照命令情報110A(図8参照)を生成することができる。   As shown in FIG. 14, first, the instruction reference / generation data extraction unit 321 extracts the reference / generation data of each instruction from the intermediate language (S21). Next, the in-function indirect reference / generated data extraction unit 323 extracts in-function indirect reference / generated data from the intermediate language (S22). Then, the instruction block extraction unit 324 extracts an instruction block from the intermediate language (S23). Next, the instruction block input / output data extraction unit 325A extracts instruction block input / output data from the intermediate language (S24). Then, the data dependence edge generation unit 326 adds a data dependence edge between the instruction block output data and the instruction block input data that inputs the instruction block output data (S25). By this processing, the data dependency edge generation unit 326 can generate the data dependency edge information 100A (see FIG. 7). Thereafter, the output data generation instruction / input data reference instruction extraction unit 327 extracts the output data generation instruction / input data reference instruction (S26). By this processing, the output data generation instruction / input data reference instruction extraction unit 327 can generate the output data generation instruction / input data reference instruction information 110A (see FIG. 8). Through these processes, the data dependency extraction unit 32A generates the data dependency edge information 100A (see FIG. 7) and the output data generation instruction / input data reference instruction information 110A (see FIG. 8) using the intermediate language. Can do.

図15は、スレッド間データ依存性抽出処理S30(図13参照)の詳細を示すフローチャートである。図15を参照して(適宜図1参照)、スレッド間データ依存性抽出処理S30(図15参照)について説明する。   FIG. 15 is a flowchart showing details of the inter-thread data dependency extraction processing S30 (see FIG. 13). With reference to FIG. 15 (refer to FIG. 1 as appropriate), the inter-thread data dependency extraction processing S30 (see FIG. 15) will be described.

図15に示すように、まず、スレッド入出力データ抽出部331は、スレッド入出力データを抽出する(S31)。これにより、スレッド入出力データ抽出部331は、スレッド間データ依存枝情報120A(図9参照)を生成することができる。次に、スレッド出力データ生成命令・スレッド入力データ参照命令抽出部332は、スレッド出力データ生成命令・スレッド入力データ参照命令を抽出する(S32)。この処理により、スレッド出力データ生成命令・スレッド入力データ参照命令抽出部332は、スレッド間データ依存命令対情報130A(図11参照)を生成することができる。これらの処理により、スレッド間データ依存性抽出部33は、スレッド間データ依存命令対情報130A(図11参照)を生成することができる。   As shown in FIG. 15, first, the thread input / output data extraction unit 331 extracts thread input / output data (S31). Thereby, the thread input / output data extraction unit 331 can generate the inter-thread data dependency edge information 120A (see FIG. 9). Next, the thread output data generation instruction / thread input data reference instruction extraction unit 332 extracts a thread output data generation instruction / thread input data reference instruction (S32). Through this process, the thread output data generation instruction / thread input data reference instruction extraction unit 332 can generate the inter-thread data dependent instruction pair information 130A (see FIG. 11). Through these processes, the inter-thread data dependency extraction unit 33 can generate the inter-thread data dependency instruction pair information 130A (see FIG. 11).

図16は、通信命令挿入処理S40A(図13参照)の詳細を示すフローチャートである。図16を参照して(適宜図1参照)、通信命令挿入処理S40A(図16参照)について説明する。   FIG. 16 is a flowchart showing details of the communication command insertion process S40A (see FIG. 13). With reference to FIG. 16 (see FIG. 1 as appropriate), the communication command insertion process S40A (see FIG. 16) will be described.

図16に示すように、まず、データ送信命令挿入部351Aは、中間語内のスレッド入力データ参照命令のスレッド出力データ生成命令の直後にデータ送信命令を挿入する(S42A)。次に、データ受信同期命令挿入部352Aは、データ送信命令を含む中間語内のスレッド入力データ参照命令のスレッド入力データ参照命令の直前にデータ受信同期命令を挿入する(S43A)。これらの処理により、通信命令挿入部35Aは、中間語に通信命令を挿入することができる。   As shown in FIG. 16, first, the data transmission instruction insertion unit 351A inserts a data transmission instruction immediately after the thread output data generation instruction of the thread input data reference instruction in the intermediate language (S42A). Next, the data reception synchronization instruction insertion unit 352A inserts the data reception synchronization instruction immediately before the thread input data reference instruction of the thread input data reference instruction in the intermediate language including the data transmission instruction (S43A). Through these processes, the communication command insertion unit 35A can insert a communication command into the intermediate language.

プログラム分割・コード生成処理S50(図13参照)は、プログラム分割・コード生成部39が、通信命令挿入部35Aによって生成された通信命令を含むプログラムを各スレッドが行う処理に分割(プログラム分割)し、実行コードに変換(コード生成)する処理である。その結果、プログラム分割・コード生成部39は、通信命令を含む分割プログラム55A(図1参照)を生成することができる。プログラム分割およびコード生成の処理は、通常のコンパイラが有する公知のプログラム分割およびコード生成の処理と特に変わらないため、プログラム分割およびコード生成の処理についてのさらに詳細な説明は省略する。   In the program division / code generation process S50 (see FIG. 13), the program division / code generation unit 39 divides the program including the communication instruction generated by the communication instruction insertion unit 35A into processes performed by each thread (program division). This is a process of converting into an execution code (code generation). As a result, the program division / code generation unit 39 can generate a division program 55A (see FIG. 1) including a communication command. The program partitioning and code generation processing is not particularly different from the known program partitioning and code generation processing of an ordinary compiler, and therefore a more detailed description of the program partitioning and code generation processing is omitted.

(第2の実施形態)
続いて、図面(図17〜図22)を用いて本発明の第2の実施形態について説明する。第2の実施形態は、データ構造の依存性に関するものであり、並列処理プログラム内にデータ構造が含まれている場合に、データ構造に作用する命令間の依存性を抽出し、抽出結果を用いて、命令ブロックの入出力データの抽出とデータ依存枝情報の生成とを行い、その命令ブロックのデータ依存枝情報を用いて出力データ生成命令・入力データ参照命令を抽出し、出力データ生成命令・入力データ参照命令情報を生成する点が、第1の実施形態と異なる。したがって、それ以外の第1の実施形態と共通する部分については、同じ符号を付し、説明を省略する。
(Second Embodiment)
Subsequently, a second embodiment of the present invention will be described with reference to the drawings (FIGS. 17 to 22). The second embodiment relates to the dependency of the data structure. When the data structure is included in the parallel processing program, the dependency between instructions acting on the data structure is extracted and the extraction result is used. The input / output data of the instruction block and the generation of data dependency branch information are extracted, and the output data generation instruction / input data reference instruction is extracted using the data dependency branch information of the instruction block. It differs from the first embodiment in that input data reference command information is generated. Therefore, the parts common to those in the first embodiment are denoted by the same reference numerals, and the description thereof is omitted.

データ構造とは、配列データやC言語のstructure(structureは通称「構造体」と呼ばれる)のように複数の単一データから構成されるデータの集合体である。ここで、単一データとは、各命令によって生成・参照される情報の対象(演算命令が作用するデータの単位)のことであり、通常の「データ」のことである。以下では、説明の便宜上、各命令によって生成・参照される情報の対象を「単一データ」、複数の単一データから構成されるデータの集合体を「データ構造」と呼ぶことにする。   The data structure is an aggregate of data composed of a plurality of single data such as array data and C language structure (structure is commonly called “structure”). Here, the single data is a target of information generated / referenced by each instruction (a unit of data on which an operation instruction acts), and is normal “data”. Hereinafter, for convenience of explanation, an object of information generated / referenced by each instruction is referred to as “single data”, and a collection of data composed of a plurality of single data is referred to as “data structure”.

単一データの場合、これを生成する命令(代入命令)によって完全に書き換えられるので、データ生成命令からデータ参照命令へと単純なデータ依存性を派生する(データ参照命令がデータ生成命令に依存する)。この単純なデータ依存性がデータフローマシン(データ駆動型制御)の動作原理になる。また、このデータ依存性を単一データ依存性と呼ぶことにする。   In the case of single data, it is completely rewritten by the instruction that generates it (assignment instruction), so a simple data dependency is derived from the data generation instruction to the data reference instruction (the data reference instruction depends on the data generation instruction) ). This simple data dependency becomes the operation principle of the data flow machine (data driven control). This data dependency is referred to as single data dependency.

データ構造の場合、一つの演算命令がその一部(データ構造中の一要素)だけをアクセスし(アクセス=「書換え」または「読出し」)、しかも、アクセスするデータ構造要素の具体的な特定をコンパイル時に行うことが不可能な場合がある。例えば、変数インデックスによる配列アクセスやポインタ参照データがこれに該当する。このため、このデータ構造のアクセスの曖昧さを考慮した依存性(Read-after-write依存性(true dependency)およびWrite-after-write依存性(output dependency))を以下のように定義する。   In the case of a data structure, a single operation instruction accesses only a part (one element in the data structure) (access = “rewrite” or “read”), and specifies the specific data structure element to be accessed. Sometimes this is not possible at compile time. For example, array access by a variable index and pointer reference data correspond to this. For this reason, the dependency (Read-after-write dependency (true dependency) and Write-after-write dependency (output dependency)) in consideration of the ambiguity of access of this data structure is defined as follows.

Read-after-write依存性は、データ構造の任意の要素に対する「書換え命令」から同データ構造の任意の要素に対する「読出し命令」へ派生する依存性を意味するものとする。これは、単一データのデータ依存性と同性質のものであるが、書換え命令が作用する要素と読出し命令が作用する要素が同一であるとは限らない場合でも、前記した「アクセスの曖昧さ」を考慮して依存性を派生させるものである。   The read-after-write dependency means a dependency derived from a “rewrite instruction” for an arbitrary element of the data structure to a “read instruction” for an arbitrary element of the data structure. This is the same property as the data dependency of single data. However, even if the element on which the rewrite instruction operates and the element on which the read instruction operates are not necessarily the same, ”To derive the dependency.

Write-after-write依存性は、データ構造の任意の要素に対する「書換え命令」から同データ構造の任意の要素に対する「書換え命令」へ派生する依存性を意味するものとする。   The write-after-write dependency means a dependency derived from a “rewrite instruction” for an arbitrary element of the data structure to a “rewrite instruction” for an arbitrary element of the data structure.

単一データのデータ依存性では、Write-after-write依存性は存在しない。なぜならば、単一データに対するデータ生成命令は、それ以前に実行された同一データに対するデータ生成命令によって定義されたデータを完全に無効化し(完全に書換え)、これらのデータ生成命令が派生するデータ依存性は、論理的に分離されるためである。   There is no Write-after-write dependency for single data dependency. This is because a data generation instruction for a single data completely invalidates (completely rewrites) the data defined by the data generation instruction for the same data executed before, and the data dependency from which these data generation instructions are derived. This is because sex is logically separated.

データ構造に対する複数の「書換え命令」については、このような書換えの無効化が必ずしも起こらない(書換える要素が異なる場合がある)ため、データ構造の過去の書換え履歴をすべて記憶しておく必要が生じる。このような過去の書換え履歴をすべて記憶する手段を用いて、書換え命令同士のデータ依存枝による逐次化を図る。このWrite-after-write依存性は、データ構造に対する書換え命令が、仮想的には、「データ構造のすべての要素を読込む」「データ構造の一要素を書き換え、他のすべての要素をそのままにしてデータ構造全体を生成する」という2つの動作で構成されていると解釈することによって、通常のデータ依存性(単一データのデータ依存性)と同様の扱いが可能になる。また、データ構造に作用する命令間のデータ依存性をデータ構造依存性と呼ぶことにする。   For multiple “rewrite commands” for a data structure, such invalidation of rewrite does not necessarily occur (the elements to be rewritten may be different), so it is necessary to store all past rewrite history of the data structure. Arise. Using such means for storing all past rewrite histories, serialization is performed by rewriting instructions between data rewriting instructions. This write-after-write dependency is because the rewrite instruction for the data structure virtually "reads all elements of the data structure" "rewrites one element of the data structure and leaves all other elements as they are. By interpreting that it is composed of two operations of “generating the entire data structure”, it becomes possible to handle the same as normal data dependency (data dependency of single data). The data dependency between instructions that act on the data structure is called data structure dependency.

第2の実施形態は、データ構造を含む並列処理プログラム50B(図17参照)から命令ブロック入出力データを抽出し、データ依存枝情報および出力データ生成命令・入力データ参照命令を抽出することができる構成となっている。   In the second embodiment, instruction block input / output data can be extracted from a parallel processing program 50B (see FIG. 17) including a data structure, and data dependency branch information and an output data generation instruction / input data reference instruction can be extracted. It has a configuration.

図17は、第2の実施形態におけるプログラム処理装置の機能例を示す機能ブロック図である。図17に示すように、プログラム処理装置1Bは、データ構造を含む並列処理プログラム50Bを入力して、通信命令を含む分割プログラム55Bを出力する。第2の実施形態では、プログラム処理装置1Bのデータ依存性抽出部32Bに含まれる命令ブロック入出力データ抽出部325Bの機能が、第1の実施形態の命令ブロック入出力データ抽出部325Aの機能と異なる。以下、プログラム処理装置1Bを構成する各要素の中で、命令ブロック入出力データ抽出部325Bの機能について説明する。   FIG. 17 is a functional block diagram illustrating an example of functions of the program processing device according to the second embodiment. As shown in FIG. 17, the program processing apparatus 1B inputs a parallel processing program 50B including a data structure, and outputs a divided program 55B including a communication command. In the second embodiment, the function of the instruction block input / output data extraction unit 325B included in the data dependency extraction unit 32B of the program processing apparatus 1B is the same as the function of the instruction block input / output data extraction unit 325A of the first embodiment. Different. Hereinafter, the function of the instruction block input / output data extraction unit 325B will be described among the elements constituting the program processing apparatus 1B.

図18に示すプログラムは、プログラマ等が記述した並列処理プログラムであり、データ構造が含まれる並列処理プログラムの一例である。ここでは、構文解析部31が並列処理プログラム50Bを入力して、当該プログラムの構文を解析し、中間語を生成する場合について説明する。また、説明の都合上、以下では、中間語として適宜、並列処理プログラム50Bを用いて説明することにする。   The program shown in FIG. 18 is a parallel processing program written by a programmer or the like, and is an example of a parallel processing program including a data structure. Here, a case where the syntax analysis unit 31 inputs the parallel processing program 50B, analyzes the syntax of the program, and generates an intermediate language will be described. For convenience of explanation, the parallel processing program 50B will be used as an intermediate language as appropriate below.

(命令ブロック入出力データ抽出部325Bの説明)
命令ブロック入出力データ抽出部325Bは、構文解析部31によって生成された中間語と、命令ブロック抽出部324によって抽出された命令ブロック情報とを入力し、データ構造に作用する命令間の依存性を抽出し、その命令ブロック情報を用いて、その中間語から命令ブロック入力データと、命令ブロック出力データとを抽出する。以下、図18ないし図20を用いて(適宜図17参照)、命令ブロック入出力データ抽出部325Bの機能のうち、第1の実施形態における命令ブロック入出力データ抽出部325Aの機能との違い(データ構造に作用する命令間の依存性を抽出する機能)のみを説明する。
(Description of instruction block input / output data extraction unit 325B)
The instruction block input / output data extraction unit 325B inputs the intermediate language generated by the syntax analysis unit 31 and the instruction block information extracted by the instruction block extraction unit 324, and determines the dependency between instructions that affect the data structure. Using the instruction block information, the instruction block input data and the instruction block output data are extracted from the intermediate language. Hereinafter, using FIG. 18 to FIG. 20 (refer to FIG. 17 as appropriate), among the functions of the instruction block input / output data extraction unit 325B, the difference from the function of the instruction block input / output data extraction unit 325A in the first embodiment ( Only the function that extracts the dependency between instructions that act on the data structure will be described.

図19は、命令ブロック入出力データ抽出部325Bが、構文解析部31によって生成された中間語から命令ブロック入力データと、命令ブロック出力データとを抽出した結果を示すプログラムグラフである。図19には、例として、命令ブロック入力データノードF2や、命令ブロック出力データノードG2などが示されている。以下、命令ブロック入出力データ抽出部325Bによる命令ブロック入出力データの抽出方法を説明する。   FIG. 19 is a program graph showing the result of the instruction block input / output data extraction unit 325B extracting the instruction block input data and the instruction block output data from the intermediate language generated by the syntax analysis unit 31. FIG. 19 shows an instruction block input data node F2, an instruction block output data node G2, and the like as an example. The instruction block input / output data extraction method by the instruction block input / output data extraction unit 325B will be described below.

図19に示すように、並列処理プログラム50Bは、命令ブロック抽出部324によって命令ブロックA11〜A16に分割されている。例えば、図18に示した並列処理プログラム50Bの3行目のデータ構造要素に作用する命令「a[0] = 1;」は、構文解析部31によって、
$94 := a[0] ...... (1)
$94 = 1 ...... (2)
という2つの命令に分解される(命令ブロックA11参照)。命令(1)は、配列aの0番目の要素のアドレスを計算し、中間変数$94に記憶する演算である。命令(2)は、アドレス$94に右辺式「1」を代入する演算である。なお、データ構造要素のアドレスを表す中間変数(ここでは$94)は、任意の演算命令で引用される場合(以下に示す書換え命令および読出し命令)、そのアドレスに格納されている要素データ値を指す。
As shown in FIG. 19, the parallel processing program 50B is divided into instruction blocks A11 to A16 by the instruction block extraction unit 324. For example, the instruction “a [0] = 1;” acting on the data structure element on the third line of the parallel processing program 50B shown in FIG.
$ 94: = a [0] ...... (1)
$ 94 = 1 ...... (2)
(Refer to the instruction block A11). The instruction (1) is an operation for calculating the address of the 0th element of the array a and storing it in the intermediate variable $ 94. The instruction (2) is an operation for assigning the right-side expression “1” to the address $ 94. Note that the intermediate variable ($ 94 here) representing the address of the data structure element indicates the element data value stored at the address when quoted by an arbitrary operation instruction (rewrite instruction and read instruction shown below). .

命令ブロック入出力データ抽出部325Bは、例えば、配列aの要素のアドレスを計算して中間変数$94に記憶する命令「$94 := a[0]」を命令ブロックA11内に見付ける。また、命令ブロック入出力データ抽出部325Bは、この中間変数(データ構造要素アドレス)$94が代入式の左辺にある命令「$94 = 1」を命令ブロックA11内に見付け、この命令「$94 = 1」が、配列aに対する書換え命令(データ構造書換え命令)であると判定する。同様な方法を用いて、命令ブロック入出力データ抽出部325Bは、例えば、命令ブロックA12内にデータ構造書換え命令「$95 = b」、命令ブロックA14内にデータ構造書換え命令「$103 = $101」を見付ける。このようにして、命令ブロック入出力データ抽出部325Bは、データ構造書換え命令を抽出することができる。   The instruction block input / output data extraction unit 325B finds, for example, the instruction “$ 94: = a [0]” in the instruction block A11 which calculates the address of the element of the array a and stores it in the intermediate variable $ 94. Also, the instruction block input / output data extraction unit 325B finds the instruction “$ 94 = 1” in the instruction block A11 where the intermediate variable (data structure element address) $ 94 is on the left side of the assignment expression, and this instruction “$ 94 = 1”. Is a rewrite instruction (data structure rewrite instruction) for the array a. Using a similar method, the instruction block input / output data extraction unit 325B finds, for example, the data structure rewrite instruction “$ 95 = b” in the instruction block A12 and the data structure rewrite instruction “$ 103 = $ 101” in the instruction block A14. . In this way, the instruction block input / output data extraction unit 325B can extract the data structure rewriting instruction.

また、命令ブロック入出力データ抽出部325Bは、例えば、配列aの要素のアドレスを計算して中間変数$96に記憶する命令「$96 := a[i]」を命令ブロックA13内に見付ける。また、命令ブロック入出力データ抽出部325Bは、この中間変数(データ構造要素アドレス)$96が代入式の右辺にある命令「$97 := $96 + 1」を命令ブロックA13内に見付け、この命令「$97 := $96 + 1」が、配列aに対する読出し命令(データ構造読出し命令)であると判定する。同様な方法を用いて、命令ブロック入出力データ抽出部325Bは、例えば、命令ブロックA13内にデータ構造読出し命令「$100 := $99 - 1」、命令ブロックA16内にデータ構造読出し命令「$107 := printf(“a[i + 1] = %d\n”, $105)」を見付ける。このようにして、命令ブロック入出力データ抽出部325Bは、データ構造読出し命令を抽出することができる。   In addition, the instruction block input / output data extraction unit 325B finds, for example, the instruction “$ 96: = a [i]” to be stored in the intermediate variable $ 96 in the instruction block A13 by calculating the address of the element of the array a. The instruction block input / output data extraction unit 325B finds the instruction “$ 97: = $ 96 + 1” in which the intermediate variable (data structure element address) $ 96 is on the right side of the assignment expression in the instruction block A13. : = $ 96 + 1 ”is determined to be a read instruction (data structure read instruction) for the array a. Using a similar method, the instruction block input / output data extraction unit 325B, for example, reads the data structure read instruction “$ 100: = $ 99-1” in the instruction block A13 and the data structure read instruction “$ 107: = in the instruction block A16. Find printf (“a [i + 1] =% d \ n”, $ 105) ”. In this way, the instruction block input / output data extraction unit 325B can extract the data structure read instruction.

命令ブロック入出力データ抽出部325Bは、データ構造書換え命令からデータ構造書換え命令へと派生する依存関係が存在する場合、その依存関係を前記したWrite-after-write依存性であると判定する。また、データ構造書換え命令からデータ構造読出し命令へと派生する依存関係が存在する場合、その依存関係を前記したRead-after-write依存性であると判定する。   If there is a dependency derived from the data structure rewrite instruction to the data structure rewrite instruction, the instruction block input / output data extraction unit 325B determines that the dependency is the write-after-write dependency described above. Further, when there is a dependency derived from the data structure rewrite instruction to the data structure read instruction, the dependency is determined to be the above-described read-after-write dependency.

図20は、命令ブロック入出力データ抽出部325Bが抽出したデータ構造の依存性を説明するための図である。図20に示すように、例えば、データ構造書換え命令「$94 = 1」からデータ構造書換え命令「$95 = b」へ派生する依存性がWrite-after-write依存性として示されている。また、例えば、データ構造書換え命令「$95 = b」からデータ構造読出し命令「$97 := $96 + 1」へ派生する依存性がRead-after-write依存性として示されている。   FIG. 20 is a diagram for explaining the dependency of the data structure extracted by the instruction block input / output data extraction unit 325B. As shown in FIG. 20, for example, the dependency derived from the data structure rewriting instruction “$ 94 = 1” to the data structure rewriting instruction “$ 95 = b” is shown as the Write-after-write dependency. Further, for example, the dependency derived from the data structure rewriting instruction “$ 95 = b” to the data structure reading instruction “$ 97: = $ 96 + 1” is shown as the Read-after-write dependency.

命令ブロック入出力データ抽出部325Bは、Write-after-write依存性またはRead-after-write依存性の依存関係にあるデータを別ブロック内に探し、それを命令ブロック入出力データとして抽出する。命令ブロック入出力データ抽出部325Bは、命令ブロック抽出部324によって抽出された命令ブロック情報を参照して、例えば、配列aに対するデータ構造書換え命令「$94 = 1」が命令ブロックA11内にあると判定する。また、命令ブロック入出力データ抽出部325Bは、配列aに対するデータ構造書換え命令「$95 = b」が命令ブロックA11以外の命令ブロック(命令ブロックA12)に存在し、この命令が、データ構造書換え命令「$94 = 1」に対してWrite-after-write依存性を示すと判定する。その結果、命令ブロック入出力データ抽出部325Bは、命令ブロックA11の命令ブロック出力データとして、配列aを抽出することができる。同時に、命令ブロック入出力データ抽出部325Bは、命令ブロックA12の命令ブロック入力データとして、配列aを抽出することができる。図19には、それぞれ命令ブロック出力データノードG2および命令ブロック入力データノードF2として示されている。例えば、命令ブロック出力データノードG2および命令ブロック入力データノードF2には、*a<3>と標記されているが、これは配列a[3]の任意の要素を示している。   The instruction block input / output data extraction unit 325B searches for data having a dependency relationship of Write-after-write dependency or Read-after-write dependency in another block, and extracts it as instruction block input / output data. The instruction block input / output data extraction unit 325B refers to the instruction block information extracted by the instruction block extraction unit 324 and determines, for example, that the data structure rewrite instruction “$ 94 = 1” for the array a is in the instruction block A11. To do. Further, the instruction block input / output data extraction unit 325B has a data structure rewrite instruction “$ 95 = b” for the array a in an instruction block (instruction block A12) other than the instruction block A11. It is determined that Write-after-write dependency is shown for “$ 94 = 1”. As a result, the instruction block input / output data extraction unit 325B can extract the array a as the instruction block output data of the instruction block A11. At the same time, the instruction block input / output data extraction unit 325B can extract the array a as the instruction block input data of the instruction block A12. FIG. 19 shows the instruction block output data node G2 and the instruction block input data node F2, respectively. For example, the instruction block output data node G2 and the instruction block input data node F2 are marked with * a <3>, which indicates an arbitrary element of the array a [3].

このような方法により、命令ブロック入出力データ抽出部325Bは、命令ブロック入出力データを抽出することができる。抽出した結果得られた命令ブロック入出力データは、図19のプログラムグラフに付加された命令ブロック入出力データノードとして示されている。このように、命令ブロック入出力データ抽出部325Bは、命令ブロック抽出部324によって抽出された命令ブロックと、その命令ブロック内の入出力データ(データ構造を含む)とを対応付けた命令ブロック入出力データに関する情報(命令ブロック入出力データ情報)を生成することができる。   By such a method, the instruction block input / output data extraction unit 325B can extract the instruction block input / output data. The instruction block input / output data obtained as a result of the extraction is shown as an instruction block input / output data node added to the program graph of FIG. Thus, the instruction block input / output data extraction unit 325B associates the instruction block extracted by the instruction block extraction unit 324 with the input / output data (including the data structure) in the instruction block. Information about data (instruction block input / output data information) can be generated.

また、命令ブロック抽出部324によって生成された命令ブロック情報と、命令ブロック入出力データ抽出部325Bによって生成された命令ブロック入出力データ(データ構造を含む)に関する情報(命令ブロック入出力データ情報)とは、データ依存枝生成部326に引き渡される。   Also, the instruction block information generated by the instruction block extraction unit 324, the information (instruction block input / output data information) regarding the instruction block input / output data (including the data structure) generated by the instruction block input / output data extraction unit 325B, and Is passed to the data dependency edge generation unit 326.

図21は、データ依存枝生成部326(図17参照)によって生成されたデータ依存枝情報を示す表である。データ依存枝生成部326は、構文解析部31によって生成された中間語と、命令ブロック抽出部324によって生成された命令ブロック情報と、命令ブロック入出力データ抽出部325Bによって生成された命令ブロック入出力データ情報とを入力し、単一データのデータ依存枝情報を生成する際と同様の処理によって、データ構造のデータ依存枝情報を生成することが可能である。第2の実施形態においては、並列処理プログラム50Bを用いており、この場合、先行枝および後続枝が存在しないため、データ依存枝情報100Bには、先行枝の項目および後続枝の項目が省略されている。   FIG. 21 is a table showing data dependency edge information generated by the data dependency edge generation unit 326 (see FIG. 17). The data dependency branch generation unit 326 includes the intermediate language generated by the syntax analysis unit 31, the instruction block information generated by the instruction block extraction unit 324, and the instruction block input / output generated by the instruction block input / output data extraction unit 325B. It is possible to generate data dependency edge information of a data structure by inputting the data information and performing the same process as when generating data dependency edge information of single data. In the second embodiment, the parallel processing program 50B is used. In this case, since the preceding branch and the subsequent branch do not exist, the preceding branch item and the subsequent branch item are omitted from the data dependency branch information 100B. ing.

図22は、出力データ生成命令・入力データ参照命令抽出部327(図17参照)によって生成された出力データ生成命令・入力データ参照命令情報を示す表である。出力データ生成命令・入力データ参照命令抽出部327は、構文解析部31によって生成された中間語と、データ依存枝生成部326によって生成されたデータ依存枝情報100B(図21参照)とを入力し、単一データのデータ依存枝情報を生成する際と同様の処理によって、出力データ生成命令および入力データ参照命令を抽出することが可能である。   FIG. 22 is a table showing output data generation instruction / input data reference instruction information generated by the output data generation instruction / input data reference instruction extraction unit 327 (see FIG. 17). The output data generation instruction / input data reference instruction extraction unit 327 receives the intermediate language generated by the syntax analysis unit 31 and the data dependency branch information 100B (see FIG. 21) generated by the data dependency edge generation unit 326. The output data generation instruction and the input data reference instruction can be extracted by the same processing as that for generating data-dependent branch information of single data.

以上説明した第2の実施形態によれば、プログラム処理装置1Bは、データ構造を含む並列処理プログラム50Bを解析し、既存の分散メモリシステムおよび既存の共有メモリシステムに適用可能な通信命令を含む分割プログラム55Bを生成することが可能である。   According to the second embodiment described above, the program processing apparatus 1B analyzes the parallel processing program 50B including the data structure and divides the communication processing instructions that can be applied to the existing distributed memory system and the existing shared memory system. It is possible to generate the program 55B.

また、プログラム処理装置1Bのハードウェア構成については、プログラム処理装置1A(図1参照)のハードウェア構成と変わらないため、説明を省略する。   Further, the hardware configuration of the program processing device 1B is not different from the hardware configuration of the program processing device 1A (see FIG. 1), and thus the description thereof is omitted.

以上の第1の実施形態または第2の実施形態に係るプログラム処理装置によれば、プログラマ等が逐次プログラムに簡単な記述を追加するだけで、マルチプロセッサシステムが高性能な並列処理を実行するための実行コードを生成することが可能である。   According to the program processing apparatus according to the first embodiment or the second embodiment described above, the multiprocessor system executes high-performance parallel processing by simply adding a simple description to the sequential program by a programmer or the like. It is possible to generate the execution code.

第1の実施形態に係るプログラム処理装置の機能例を示す機能ブロック図である。It is a functional block diagram which shows the function example of the program processing apparatus which concerns on 1st Embodiment. 第1の実施形態に係るスレッド記述追加前のプログラムの一例である。It is an example of the program before the thread description addition according to the first embodiment. 第1の実施形態に係るスレッド記述追加後のプログラム(並列処理プログラム)の一例である。It is an example of a program (parallel processing program) after adding a thread description according to the first embodiment. 第1の実施形態に係る中間語から命令ブロックを抽出した結果を示すプログラムグラフである。It is a program graph which shows the result of having extracted the instruction block from the intermediate language which concerns on 1st Embodiment. 第1の実施形態に係る中間語から命令ブロック入出力データを抽出した結果を示すプログラムグラフである。It is a program graph which shows the result of having extracted the instruction block input / output data from the intermediate language according to the first embodiment. 第1の実施形態に係る中間語からデータ依存枝を生成した結果を示すプログラムグラフである。It is a program graph which shows the result of having generated the data dependence branch from the intermediate language concerning a 1st embodiment. 第1の実施形態に係るデータ依存枝情報を示す表である。It is a table | surface which shows the data dependence edge information which concerns on 1st Embodiment. 第1の実施形態に係る出力データ生成命令・入力データ参照命令情報を示す表である。4 is a table showing output data generation instruction / input data reference instruction information according to the first embodiment. 第1の実施形態に係るスレッド間データ依存枝情報を示す表である。It is a table | surface which shows the data dependence edge information between threads which concerns on 1st Embodiment. 第1の実施形態に係るスレッド出力データ生成命令の探索方法を説明するための図である。It is a figure for demonstrating the search method of the thread output data generation instruction which concerns on 1st Embodiment. 第1の実施形態に係るスレッド間データ依存命令対情報を示す表である。It is a table | surface which shows the data dependence instruction pair information between threads which concerns on 1st Embodiment. 第1の実施形態に係るプログラム処理装置のハードウェア構成の一例を示す図である。It is a figure which shows an example of the hardware constitutions of the program processing apparatus which concerns on 1st Embodiment. 第1の実施形態に係るプログラム処理装置の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the program processing apparatus which concerns on 1st Embodiment. 第1の実施形態に係るデータ依存性抽出処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the data dependence extraction process which concerns on 1st Embodiment. 第1の実施形態に係るスレッド間データ依存性抽出処理の詳細を示すフローチャートである。It is a flowchart which shows the detail of the data dependence extraction process between threads which concerns on 1st Embodiment. 第1の実施形態に係る通信命令挿入処理の詳細を示すフローチャートである。It is a flowchart which shows the detail of the communication command insertion process which concerns on 1st Embodiment. 第2の実施形態に係るプログラム処理装置の機能例を示す機能ブロック図である。It is a functional block diagram which shows the function example of the program processing apparatus which concerns on 2nd Embodiment. 第2の実施形態に係る並列処理プログラムの一例である。It is an example of the parallel processing program which concerns on 2nd Embodiment. 第2の実施形態に係る中間語から命令ブロック入出力データを抽出した結果を示すプログラムグラフである。It is a program graph which shows the result of having extracted the instruction block input / output data from the intermediate language according to the second embodiment. 第2の実施形態に係るデータ構造の依存性を説明するための図である。It is a figure for demonstrating the dependence of the data structure which concerns on 2nd Embodiment. 第2の実施形態に係るデータ依存枝情報を示す表である。It is a table | surface which shows the data dependence edge information which concerns on 2nd Embodiment. 第2の実施形態に係る出力データ生成命令・入力データ参照命令情報を示す表である。12 is a table showing output data generation instruction / input data reference instruction information according to the second embodiment.

符号の説明Explanation of symbols

1A、1B プログラム処理装置
10 中央処理装置(処理部)
20 主記憶装置(処理部)
30A 並列処理コンパイラ
31 構文解析部
32A、32B データ依存性抽出部
33 スレッド間データ依存性抽出部
35A 通信命令挿入部
39 プログラム分割・コード生成部
40 ファイル装置(記憶部)
50A、50B 並列処理プログラム
55A、55B 通信命令を含む分割プログラム
321 命令参照・生成データ抽出部
322 ポインタエイリアス解析部
323 関数内間接参照・生成データ抽出部
324 命令ブロック抽出部
325A、325B 命令ブロック入出力データ抽出部
326 データ依存枝生成部
327 出力データ生成命令・入力データ参照命令抽出部
331 スレッド入出力データ抽出部
332 スレッド出力データ生成命令・スレッド入力データ参照命令抽出部
333 プロセッサ間通信命令挿入部
341 スレッド間転送ポインタ抽出部
342 ポインタエイリアスID演算命令挿入部
351A データ送信命令挿入部
352A データ受信同期命令挿入部
353 スレッド起動命令挿入部
IN 入力装置
OUT 出力装置
1A, 1B Program processing device 10 Central processing unit (processing unit)
20 Main storage (processing unit)
30A Parallel processing compiler 31 Syntax analysis unit 32A, 32B Data dependency extraction unit 33 Inter-thread data dependency extraction unit 35A Communication instruction insertion unit 39 Program division / code generation unit 40 File device (storage unit)
50A, 50B Parallel processing program 55A, 55B Divided program including communication instructions 321 Instruction reference / generated data extraction unit 322 Pointer alias analysis unit 323 Indirect reference / generated data extraction unit 324 Instruction block extraction unit 325A, 325B Instruction block input / output Data extraction unit 326 Data dependency branch generation unit 327 Output data generation instruction / input data reference instruction extraction unit 331 Thread input / output data extraction unit 332 Thread output data generation instruction / thread input data reference instruction extraction unit 333 Inter-processor communication instruction insertion unit 341 Inter-thread transfer pointer extraction unit 342 Pointer alias ID operation instruction insertion unit 351A Data transmission instruction insertion unit 352A Data reception synchronization instruction insertion unit 353 Thread activation instruction insertion unit IN input device OUT output device

Claims (4)

プロセッサが実行するプログラムの単位であるスレッドの有効な範囲に関する記述であるスレッド記述が追加された並列処理プログラムを入力し、各スレッドに当該プログラムを分割し、マルチプロセッサシステムのための実行コードの生成を行うプログラム処理装置であって、
前記プログラム処理装置は、記憶部と、処理部とを備え、
前記処理部は、
前記記憶部に入力された前記並列処理プログラム中の各スレッドの開始地点および終了地点を、予約されたキーワードまたは記号によって特定し、特定された開始地点および終了地点によって指定されたスレッド領域に含まれる各演算命令に、当該演算命令それぞれがどのスレッドに含まれるかを判別するための情報であるスレッド属性を付加した中間語を生成する構文解析部と、
前記中間語を入力し、当該中間語から命令ブロック入出力データを抽出して、当該命令ブロック入出力データに基づいて、単一演算命令によって生成または参照されるデータの依存性である単一データ依存性に関する情報と、データ構造に作用する命令間のデータ依存性であるデータ構造依存性に関する情報とを含むデータ依存枝情報を生成するデータ依存性抽出部と、
前記中間語と前記データ依存枝情報とを入力し、当該データ依存枝情報に基づいて、当該中間語から異なるスレッド同士を接続するデータ依存枝と、当該データ依存枝に対応するスレッド出力データ生成命令およびスレッド入力参照命令とを抽出して、スレッド間データ依存命令対情報を生成するスレッド間データ依存性抽出部と、
前記中間語と前記スレッド間データ依存命令対情報とを入力し、前記スレッド間データ依存命令対情報に基づいて、前記中間語に、前記スレッド間で依存するデータの通信命令を挿入して、当該通信命令を含むプログラムを生成する通信命令挿入部と、
前記通信命令を含むプログラムを入力し、当該プログラムを各命令の前記スレッド属性に基づいて前記各スレッドに分割し、実行コードに変換するプログラム分割・コード生成部と
を備えることを特徴とするプログラム処理装置。
Input a parallel processing program to which a thread description, which is a description of the effective range of threads, which is a unit of a program executed by a processor, is input, divide the program into each thread, and generate an execution code for a multiprocessor system A program processing apparatus for performing
The program processing device includes a storage unit and a processing unit,
The processor is
The start point and end point of each thread in the parallel processing program input to the storage unit are specified by reserved keywords or symbols, and are included in the thread area specified by the specified start point and end point A syntax analysis unit that generates an intermediate language to which each operation instruction is added with a thread attribute that is information for determining which thread each operation instruction is included in ;
Single data which is a dependency of data generated or referred to by a single operation instruction based on the instruction block input / output data by inputting the intermediate language, extracting instruction block input / output data from the intermediate language A data dependency extraction unit that generates data dependency branch information including information on dependency and information on data structure dependency that is data dependency between instructions operating on the data structure;
The intermediate language and the data dependency edge information are input, and based on the data dependency edge information, a data dependency edge that connects different threads from the intermediate language, and a thread output data generation instruction corresponding to the data dependency edge And an inter-thread data dependency extraction unit that extracts the thread input reference instruction and generates inter-thread data dependence instruction pair information;
The intermediate language and the inter-thread data dependent instruction pair information are input, and based on the inter-thread data dependent instruction pair information, a data communication instruction depending on the thread is inserted into the intermediate language, A communication command insertion unit for generating a program including the communication command;
Program processing comprising: a program division / code generation unit that inputs a program including the communication instruction, divides the program into the threads based on the thread attribute of each instruction, and converts the program into an execution code. apparatus.
プロセッサが実行するプログラムの単位であるスレッドの有効な範囲に関する記述であるスレッド記述が追加された並列処理プログラムを入力し、各スレッドに当該プログラムを分割し、マルチプロセッサシステムのための実行コードの生成を行うプログラム処理装置によるプログラム処理方法であって、
前記プログラム処理装置は、記憶部と、処理部とを備え、
前記処理部は、
前記記憶部に入力された前記並列処理プログラム中の各スレッドの開始地点および終了地点を、予約されたキーワードまたは記号によって特定し、特定された開始地点および終了地点によって指定されたスレッド領域に含まれる各演算命令に、当該演算命令それぞれがどのスレッドに含まれるかを判別するための情報であるスレッド属性を付加した中間語を生成し、
前記中間語を入力し、当該中間語から命令ブロック入出力データを抽出して、当該命令ブロック入出力データに基づいて、単一演算命令によって生成または参照されるデータの依存性である単一データ依存性に関する情報と、データ構造に作用する命令間のデータ依存性であるデータ構造依存性に関する情報とを含むデータ依存枝情報を生成し、
前記中間語と前記データ依存枝情報とを入力し、当該データ依存枝情報に基づいて、当該中間語から異なるスレッド同士を接続するデータ依存枝と、当該データ依存枝に対応するスレッド出力データ生成命令およびスレッド入力参照命令とを抽出して、スレッド間データ依存命令対情報を生成し、
前記中間語と前記スレッド間データ依存命令対情報とを入力し、前記スレッド間データ依存命令対情報に基づいて、前記中間語に、前記スレッド間で依存するデータの通信命令を挿入して、当該通信命令を含むプログラムを生成し、
前記通信命令を含むプログラムを入力し、当該プログラムを各命令の前記スレッド属性に基づいて前記各スレッドに分割し、実行コードに変換する
ことを特徴とするプログラム処理方法。
Input a parallel processing program to which a thread description, which is a description of the effective range of threads, which is a unit of a program executed by a processor, is input, divide the program into each thread, and generate an execution code for a multiprocessor system A program processing method by a program processing device for performing
The program processing device includes a storage unit and a processing unit,
The processor is
The start point and end point of each thread in the parallel processing program input to the storage unit are specified by reserved keywords or symbols, and are included in the thread area specified by the specified start point and end point An intermediate language is generated by adding a thread attribute that is information for determining which thread each operation instruction is included in to each operation instruction.
Single data which is a dependency of data generated or referred to by a single operation instruction based on the instruction block input / output data by inputting the intermediate language, extracting instruction block input / output data from the intermediate language Generate data dependency branch information including information on dependency and information on data structure dependency which is data dependency between instructions operating on the data structure,
The intermediate language and the data dependency edge information are input, and based on the data dependency edge information, a data dependency edge that connects different threads from the intermediate language, and a thread output data generation instruction corresponding to the data dependency edge And thread input reference instructions are extracted to generate inter-thread data dependent instruction pair information,
The intermediate language and the inter-thread data dependent instruction pair information are input, and based on the inter-thread data dependent instruction pair information, a data communication instruction depending on the thread is inserted into the intermediate language, Generate a program containing communication instructions,
A program processing method comprising: inputting a program including the communication instruction, dividing the program into the threads based on the thread attribute of each instruction, and converting the program into an execution code.
プロセッサが実行するプログラムの単位であるスレッドの有効な範囲に関する記述であるスレッド記述が追加された並列処理プログラムを入力し、各スレッドに当該プログラムを分割し、マルチプロセッサシステムのための実行コードの生成を行うプログラム処理方法を、コンピュータに実行させるための並列処理プログラム用コンパイラであって、
前記コンピュータは、記憶部と、処理部とを備えており、
前記並列処理プログラム用コンパイラは、
前記記憶部に入力された前記並列処理プログラム中の各スレッドの開始地点および終了地点を、予約されたキーワードまたは記号によって特定し、特定された開始地点および終了地点によって指定されたスレッド領域に含まれる各演算命令に、当該演算命令それぞれがどのスレッドに含まれるかを判別するための情報であるスレッド属性を付加した中間語を生成する処理と
前記中間語を入力し、当該中間語から命令ブロック入出力データを抽出して、当該命令ブロック入出力データに基づいて、単一演算命令によって生成または参照されるデータの依存性である単一データ依存性に関する情報と、データ構造に作用する命令間のデータ依存性であるデータ構造依存性に関する情報とを含むデータ依存枝情報を生成する処理と
前記中間語と前記データ依存枝情報とを入力し、当該データ依存枝情報に基づいて、当該中間語から異なるスレッド同士を接続するデータ依存枝と、当該データ依存枝に対応するスレッド出力データ生成命令およびスレッド入力参照命令とを抽出して、スレッド間データ依存命令対情報を生成する処理と
前記中間語と前記スレッド間データ依存命令対情報とを入力し、前記スレッド間データ依存命令対情報に基づいて、前記中間語に、前記スレッド間で依存するデータの通信命令を挿入して、当該通信命令を含むプログラムを生成する処理と
前記通信命令を含むプログラムを入力し、当該プログラムを各命令の前記スレッド属性に基づいて前記各スレッドに分割し、実行コードに変換する処理と、
を前記処理部に実行させる
ことを特徴とする並列処理プログラム用コンパイラ。
Input a parallel processing program to which a thread description, which is a description of the effective range of threads, which is a unit of a program executed by a processor, is input, divide the program into each thread, and generate an execution code for a multiprocessor system A parallel processing program compiler for causing a computer to execute a program processing method for performing
The computer includes a storage unit and a processing unit,
The compiler for the parallel processing program is
The start point and end point of each thread in the parallel processing program input to the storage unit are specified by reserved keywords or symbols, and are included in the thread area specified by the specified start point and end point A process of generating an intermediate language in which a thread attribute, which is information for determining which thread each operation instruction is included in, is added to each operation instruction;
Single data which is a dependency of data generated or referred to by a single operation instruction based on the instruction block input / output data by inputting the intermediate language, extracting instruction block input / output data from the intermediate language Processing for generating data dependency branch information including information on dependency and information on data structure dependency which is data dependency between instructions operating on the data structure;
The intermediate language and the data dependency edge information are input, and based on the data dependency edge information, a data dependency edge that connects different threads from the intermediate language, and a thread output data generation instruction corresponding to the data dependency edge And a thread input reference instruction to generate an inter-thread data dependent instruction pair information;
The intermediate language and the inter-thread data dependent instruction pair information are input, and based on the inter-thread data dependent instruction pair information, a data communication instruction depending on the thread is inserted into the intermediate language, Processing for generating a program including communication instructions;
A process of inputting a program including the communication instruction, dividing the program into the threads based on the thread attribute of each instruction, and converting the program into an execution code ;
A compiler for a parallel processing program , wherein the processing unit is executed .
請求項に記載の並列処理プログラム用コンパイラを格納した記録媒体。 A recording medium storing the parallel processing program compiler according to claim 3 .
JP2006008779A 2006-01-17 2006-01-17 Program processing apparatus, program processing method, parallel processing program compiler, and recording medium storing parallel processing program compiler Active JP4830108B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006008779A JP4830108B2 (en) 2006-01-17 2006-01-17 Program processing apparatus, program processing method, parallel processing program compiler, and recording medium storing parallel processing program compiler

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006008779A JP4830108B2 (en) 2006-01-17 2006-01-17 Program processing apparatus, program processing method, parallel processing program compiler, and recording medium storing parallel processing program compiler

Publications (2)

Publication Number Publication Date
JP2007193423A JP2007193423A (en) 2007-08-02
JP4830108B2 true JP4830108B2 (en) 2011-12-07

Family

ID=38449100

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006008779A Active JP4830108B2 (en) 2006-01-17 2006-01-17 Program processing apparatus, program processing method, parallel processing program compiler, and recording medium storing parallel processing program compiler

Country Status (1)

Country Link
JP (1) JP4830108B2 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8312254B2 (en) 2008-03-24 2012-11-13 Nvidia Corporation Indirect function call instructions in a synchronous parallel thread processor
WO2010001766A1 (en) 2008-07-02 2010-01-07 国立大学法人 東京工業大学 Execution time estimation method, execution time estimation program, and execution time estimation device
GB0911099D0 (en) * 2009-06-26 2009-08-12 Codeplay Software Ltd Processing method
WO2013105158A1 (en) * 2012-01-13 2013-07-18 パナソニック株式会社 Data-dependent analysis assistance device, data-dependent analysis assistance program and data-dependent analysis assistance method
CN102929581A (en) * 2012-10-18 2013-02-13 无锡江南计算技术研究所 Code processing method and device
EP2767904B1 (en) * 2013-02-18 2018-07-04 Hybridserver Tec IP GmbH Method, processing modules and system for executing an executable code
KR102485935B1 (en) * 2018-02-23 2023-01-10 삼성전자주식회사 Electronic device and operating method thereof

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3641997B2 (en) * 2000-03-30 2005-04-27 日本電気株式会社 Program conversion apparatus and method, and recording medium

Also Published As

Publication number Publication date
JP2007193423A (en) 2007-08-02

Similar Documents

Publication Publication Date Title
JP4923240B2 (en) Program processing apparatus, parallel processing program, program processing method, parallel processing compiler, recording medium storing parallel processing compiler, and multiprocessor system
Lee et al. Dataflow architectures and multithreading
CN107347253B (en) Hardware instruction generation unit for special purpose processor
JP5851396B2 (en) Processing method
Auerbach et al. A compiler and runtime for heterogeneous computing
US8464214B2 (en) Apparatus, method and system for building software by composition
Goossens et al. Embedded software in real-time signal processing systems: Design technologies
JP4830108B2 (en) Program processing apparatus, program processing method, parallel processing program compiler, and recording medium storing parallel processing program compiler
CN103858099A (en) Technique for compiling and running high-level programs on heterogeneous computers
Bharadwaj et al. The Intel IA-64 compiler code generator
US20090328016A1 (en) Generalized expression trees
US20190079805A1 (en) Execution node selection method and information processing apparatus
Marzulo et al. Couillard: Parallel programming via coarse-grained data-flow compilation
Reissmann et al. RVSDG: An intermediate representation for optimizing compilers
Peccerillo et al. Task-dag support in single-source PHAST library: Enabling flexible assignment of tasks to cpus and gpus in heterogeneous architectures
Hu et al. A static timing analysis environment using Java architecture for safety critical real-time systems
Aguilar et al. Towards parallelism extraction for heterogeneous multicore android devices
Urfianto et al. Decomposition of task-level concurrency on C programs applied to the design of multiprocessor SoC
Krishnan et al. Executing sequential binaries on a clustered multithreaded architecture with speculation support
Brandner et al. Automatic generation of compiler backends
Krolik et al. rNdN: Fast Query Compilation for NVIDIA GPUs
Antoy et al. A target implementation for high-performance functional programs
Grelck et al. Persistent Asynchronous Adaptive Specialization for Generic Array Programming
Jesshope SVP and µTC-A dynamic model of concurrency and its implementation as a compiler target
CN105723336B (en) The method and system with type checking reference is parsed when for constructing

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20080919

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100615

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110405

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110603

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110621

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110803

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20110823

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150