JP2016143377A - Parallelization compilation method, parallelization compiler, and electronic device - Google Patents

Parallelization compilation method, parallelization compiler, and electronic device Download PDF

Info

Publication number
JP2016143377A
JP2016143377A JP2015021112A JP2015021112A JP2016143377A JP 2016143377 A JP2016143377 A JP 2016143377A JP 2015021112 A JP2015021112 A JP 2015021112A JP 2015021112 A JP2015021112 A JP 2015021112A JP 2016143377 A JP2016143377 A JP 2016143377A
Authority
JP
Japan
Prior art keywords
program
conditional
executed
macrotasks
parallel
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.)
Granted
Application number
JP2015021112A
Other languages
Japanese (ja)
Other versions
JP6488738B2 (en
Inventor
重仁 鍋田
Shigehito Nabeta
重仁 鍋田
範幸 鈴木
Noriyuki Suzuki
範幸 鈴木
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.)
Denso Corp
Original Assignee
Denso Corp
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 Denso Corp filed Critical Denso Corp
Priority to JP2015021112A priority Critical patent/JP6488738B2/en
Priority to DE102016201614.8A priority patent/DE102016201614A1/en
Publication of JP2016143377A publication Critical patent/JP2016143377A/en
Application granted granted Critical
Publication of JP6488738B2 publication Critical patent/JP6488738B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/445Exploiting fine grain parallelism, i.e. parallelism at instruction level

Abstract

PROBLEM TO BE SOLVED: To facilitate the quality maintenance and management of parallelization programs.SOLUTION: A sequential program, which is executed by a single processor system and contains conditional descriptions comprising a series of descriptions consisting of a plurality of parts to be individually selected or unselected as compiling targets in accordance with input information by means of conditional compiling, is divided into a plurality of macro tasks regardless of the input information. All or some of parallelly executable macro tasks are then assigned to different processor units to produce a parallelization program to be executed by a multi-processor system, where multiple macro tasks corresponding to a process associated with one conditional description are assigned to the same processor unit (S110).SELECTED DRAWING: Figure 2

Description

本発明は、並列化コンパイル方法、並列化コンパイラ、及び、電子装置に関する。   The present invention relates to a parallel compilation method, a parallel compiler, and an electronic apparatus.

マルチコアプロセッサが搭載された車載装置において、各コアに機能を分散させることでスループットを向上させることが知られている(非特許文献1)。また、シングルコアプロセッサ用のプログラム(逐次プログラム)から、マルチコアプロセッサにより並列処理可能な並列化プログラムを生成する並列化コンパイラが知られている。   In an in-vehicle device in which a multi-core processor is mounted, it is known that throughput is improved by distributing functions to each core (Non-Patent Document 1). A parallel compiler that generates a parallel program that can be processed in parallel by a multi-core processor from a program (sequential program) for a single core processor is known.

K Seo,J Yoon,J Kim,T Chung,K Yi,N Chang、「Coordinated implementation and processing of a unified chassis control algorithm with multi-central processing unit」、JAUTO1346 IMechE、2009年、Vol.224 Part DK Seo, J Yoon, J Kim, T Chung, K Yi, N Chang, “Coordinated implementation and processing of a unified chassis control algorithm with multi-central processing unit”, JAUTO1346 IMechE, 2009, Vol.224 Part D

ここで、逐次プログラムにおいて、条件コンパイルスイッチにより仕向地等に応じてコンパイル対象となる記述を選択する場合がある(条件付コンパイル)。並列化コンパイラを用いてこのような逐次プログラムから並列化プログラムを生成する場合、一般的に、まず、条件コンパイルスイッチに基づき逐次プログラムの中からコンパイルの対象となる部分が特定され、該部分から並列化プログラムが生成される。   Here, in a sequential program, there are cases where a description to be compiled is selected according to a destination by a conditional compilation switch (conditional compilation). When a parallelized program is generated from such a sequential program using a parallelizing compiler, generally, a part to be compiled is first identified from the sequential program based on a conditional compilation switch, and then the parallel program is determined from the part. A generalized program is generated.

しかしながら、コンパイルの対象となる部分が変更されると、逐次プログラムを構成するマクロタスク間のデータ依存性や制御依存性が変化する可能性がある。これにより、条件付コンパイルスイッチが設けられた一連の記述に基づく複数の処理が、異なるプロセッサコアに割り当てられる場合がある。   However, if the part to be compiled is changed, there is a possibility that the data dependency and control dependency between the macro tasks constituting the sequential program may change. As a result, a plurality of processes based on a series of descriptions provided with conditional compilation switches may be assigned to different processor cores.

このような場合、同一の逐次プログラムから生成された仕向地等の異なる複数の並列化プログラムが、同一の逐次プログラムから生成され、同等の機能を有するにも関わらず、各プロセッサコアに割り当てられる処理内容が大きく異なる可能性がある。その結果、品質の維持や並列化プログラムの管理が困難になる。   In such a case, a plurality of parallel programs with different destinations generated from the same sequential program are generated from the same sequential program and assigned to each processor core even though they have equivalent functions. The contents may vary greatly. As a result, it becomes difficult to maintain quality and manage parallelized programs.

本発明は、並列化プログラムの品質の維持や管理を容易にすることを目的とする。   An object of the present invention is to facilitate the maintenance and management of the quality of a parallelized program.

本発明の一側面である並列化コンパイル方法は、シングルプロセッサシステムにより実行されるプログラムであって、条件付コンパイルにより入力情報に応じてコンパイル対象とするか否かが切り替えられる複数の部分から構成される一連の記述である条件付記述が含まれている逐次プログラムに記述された処理を、入力情報に関わらず複数のマクロタスクに分割する分割手順と(S210)、マクロタスク間のデータ依存性に基づき、マルチプロセッサシステムを構成する複数のプロセッサユニットにより並列実行可能なマクロタスクを抽出する抽出手順と(S220)、それぞれのマクロタスクをいずれかのプロセッサユニットに割り当てる処理であって、並列実行可能なマクロタスクのうちの全部又は一部を、異なるプロセッサユニットに割り当て、マルチプロセッサシステムにより実行される並列化プログラムを生成するスケジューリング手順と(S110)、を備え、スケジューリング手順において、1の条件付記述に基づく処理に対応する複数のマクロタスクを、同一のプロセッサユニットに割り当てる。   A parallelized compiling method according to one aspect of the present invention is a program executed by a single processor system, and includes a plurality of portions that are switched depending on input information by conditional compilation. A division procedure for dividing a process described in a sequential program including a conditional description as a series of descriptions into a plurality of macro tasks regardless of input information (S210), and data dependency between macro tasks An extraction procedure for extracting macrotasks that can be executed in parallel by a plurality of processor units constituting the multiprocessor system (S220), and a process for assigning each macrotask to any one of the processor units, which can be executed in parallel All or some of the macro tasks can be transferred to different processor units. And a scheduling procedure for generating a parallelized program executed by the multiprocessor system (S110). In the scheduling procedure, a plurality of macro tasks corresponding to processing based on one conditional description are assigned to the same processor Assign to a unit.

このような構成によれば、スケジューリング手順により条件付記述を全て含んだ状態で逐次プログラムから並列化プログラムが生成される。そして、入力情報を設定することで、該並列化プログラムにおける条件付記述の中からコンパイルの対象外となる部分を除去し、入力情報に対応する種別の並列化プログラムを生成することができる。   According to such a configuration, the parallelized program is generated from the sequential program in a state in which all conditional descriptions are included by the scheduling procedure. Then, by setting the input information, it is possible to remove a part that is not subject to compilation from the conditional description in the parallelized program and generate a type of parallelized program corresponding to the input information.

スケジューリング手順により生成された段階の並列化プログラムでは、1の条件付記述に基づく各処理は、同一のプロセッサユニットに割り当てられる。このため、入力情報を設定することで仕向地等の異なる複数の種別の並列化プログラムが生成される場合であっても、各種別の並列化プログラムの共通性をより一層高めることができ、その結果、並列化プログラムの品質の維持や管理が容易になる。   In the parallelized program at the stage generated by the scheduling procedure, each process based on one conditional description is assigned to the same processor unit. For this reason, even when multiple types of parallelized programs with different destinations are generated by setting input information, the commonality of various parallelized programs can be further enhanced. As a result, it is easy to maintain and manage the quality of the parallelized program.

なお、この欄及び特許請求の範囲に記載した括弧内の符号は、1つの態様として後述する実施形態に記載の具体的手段との対応関係を示すものであって、本発明の技術的範囲を限定するものではない。   In addition, the code | symbol in the parenthesis described in this column and a claim shows the correspondence with the specific means as described in embodiment mentioned later as one aspect, Comprising: The technical scope of this invention is shown. It is not limited.

自動並列化コンパイラがインストールされたPCの構成を示すブロック図である。It is a block diagram which shows the structure of PC in which the automatic parallelizing compiler was installed. 自動並列化処理のフローチャートである。It is a flowchart of an automatic parallelization process. ソフト構造解析処理のフローチャートである。It is a flowchart of a soft structure analysis process. 車載装置の構成を示すブロック図である。It is a block diagram which shows the structure of a vehicle-mounted apparatus. 具体例における逐次プログラムや割当情報の説明図である。It is explanatory drawing of the sequential program and allocation information in a specific example.

以下、本発明の実施形態について図面を用いて説明する。なお、本発明の実施の形態は、下記の実施形態に何ら限定されることはなく、本発明の技術的範囲に属する限り種々の形態を採りうる。   Hereinafter, embodiments of the present invention will be described with reference to the drawings. The embodiment of the present invention is not limited to the following embodiment, and can take various forms as long as they belong to the technical scope of the present invention.

[本実施形態について]
1.自動並列化コンパイラについて
本実施形態の自動並列化コンパイラは、組込みシステム向けのシングルプロセッサシステム用のソースプログラム(逐次プログラム)から、組込みシステム向けのマルチプロセッサシステム用の並列化プログラムを生成する機能を有している。
[About this embodiment]
1. About the automatic parallelizing compiler The automatic parallelizing compiler of this embodiment has a function of generating a parallel processing program for a multiprocessor system for an embedded system from a source program (sequential program) for a single processor system for an embedded system. doing.

1−1.自動並列化コンパイラの設計概念
本実施形態の自動並列化コンパイラは、以下の機能を有している。
(1)マルチグレイン並列処理
(2)コンパイル時のスタティックスケジューリングコードの挿入
(3)実行時のダイナミックスケジューリングコードの生成
(4)階層型マクロデータフローの実現
(5)マクロタスクの分割/融合,Loop distribution/interchange等の並列性抽出
(6)データローカライズによるデータ転送効率の向上
(7)コンパイラによる電力削減
1−2.自動並列化コンパイラの内部処理
自動並列化コンパイラは、Front End(FE),Middle Path(MP),Back End(BE)の3つのステージを有している。各ステージは実行形態として独立しており、FE,MPから生成される中間言語によりコード授受が行われる。
1-1. Design concept of automatic parallelizing compiler The automatic parallelizing compiler of this embodiment has the following functions.
(1) Multigrain parallel processing (2) Static scheduling code insertion at compile time (3) Dynamic scheduling code generation at runtime (4) Realization of hierarchical macro data flow (5) Split / fusion of macro tasks, Loop Extraction of parallelism such as distribution / interchange (6) Improvement of data transfer efficiency by data localization (7) Power reduction by compiler 1-2. Internal processing of automatic parallelizing compiler The automatic parallelizing compiler has three stages of Front End (FE), Middle Path (MP), and Back End (BE). Each stage is independent as an execution form, and code is exchanged by an intermediate language generated from FE and MP.

なお、FEは、逐次プログラムのソースコードを字句解析・構文解析を行い、MPにおいてparse可能な中間言語を生成する部位である。FEの生成する中間言語は、基本的に4つのオペランドを持つ解析木(parse tree)で表現されており、全体として1つのブロックを形成していて構造化は行われていない。   Note that FE is a part that generates an intermediate language that can be parsed in MP by performing lexical analysis and syntax analysis on the source code of the sequential program. The intermediate language generated by the FE is basically expressed by a parse tree having four operands, forms one block as a whole, and is not structured.

また、MPは、制御依存性解析・データ依存性解析・最適化等を行う部位であり、そのデータを用いて粗粒度・中粒度・近細粒度並列化のマルチグレイン並列処理を行う。
また、BEは、MPが生成した並列化中間言語を読み込んで実際のマシンコードを生成する部位である。当該部位は、ターゲットとなっているマルチコアアーキテクチャのアセンブラコードを生成するBEの他、OpenMP用の並列化FortranコードやCコードを生成するBEを有している。さらには、当該部位は、後述する並列化APIによりメモリ配置,データ転送を含めて並列化したコードを生成するBE等、多様なアーキテクチャに対応したコードを出力するBEを有している。
MP is a part that performs control dependency analysis, data dependency analysis, optimization, and the like, and performs coarse grain, medium grain, and near fine grain parallel processing using the data.
The BE is a part that reads the parallelized intermediate language generated by the MP and generates an actual machine code. This part has BE that generates parallel Fortran code for OpenMP and C code in addition to BE that generates assembler code of the target multi-core architecture. Furthermore, the part has a BE that outputs codes corresponding to various architectures, such as a BE that generates a parallelized code including memory allocation and data transfer by a parallelized API described later.

1−3.自動並列化コンパイラの並列性解析
自動並列化コンパイラは、逐次プログラムを、基本ブロック(BB),繰り返しブロック(RB),サブルーチンブロック(SB)の3種類の粗粒度タスク(マクロタスク(MT))に分割するマクロデータフロー処理を行う。
1-3. Parallelism analysis of automatic parallelizing compiler The automatic parallelizing compiler converts sequential programs into three types of coarse-grained tasks (macrotasks (MT)): basic blocks (BB), repetitive blocks (RB), and subroutine blocks (SB). Performs macro data flow processing to be divided.

しかし、マクロデータフロー処理では、プログラムの形状によってはプロセッサの利用効率が上がらず、十分な粗粒度並列性が抽出できないという問題点がある。
そこで、自動並列化コンパイラでは、従来の単階層マクロデータフロー処理手法を拡張し、MT内部に対してマクロデータフロー処理を階層的に利用する階層型マクロデータフロー処理を採用している。階層的マクロデータフロー処理では、MTの階層的な定義を行い、各階層のマクロタスクに対してマクロタスク間の並列性の解析を行う。
However, the macro data flow processing has a problem that the utilization efficiency of the processor does not increase depending on the shape of the program, and sufficient coarse grain parallelism cannot be extracted.
Therefore, the automatic parallelizing compiler expands the conventional single-layer macro data flow processing method and employs hierarchical macro data flow processing that hierarchically uses the macro data flow processing inside the MT. In hierarchical macro data flow processing, MT is defined hierarchically and parallelism between macro tasks is analyzed for macro tasks in each hierarchy.

<マクロフローグラフ(MFG)の生成>
自動並列化コンパイラは、まず、生成された各階層のマクロタスクに対して、マクロタスク間の制御依存性とデータ依存性を解析する。この解析結果は、マクロフローグラフ(MFG)として表される。
<Generation of macro flow graph (MFG)>
The automatic parallelizing compiler first analyzes the control dependency and the data dependency between macrotasks for the generated macrotasks of each layer. The analysis result is represented as a macro flow graph (MFG).

<マクロタスクグラフ(MTG)の生成>
MFGは、マクロタスク間の制御依存性とデータ依存性を表すが、並列性は表していない。並列性を抽出するためには、各マクロタスクに対し、制御依存性とデータ依存性の両方を考慮した最早実行可能条件解析を行う必要がある。最早実行可能条件とは、そのMTが最も早い時点で実行可能になる条件であり、次のような実行条件から求められる。
<Generation of macro task graph (MTG)>
MFG expresses control dependency and data dependency between macro tasks, but does not express parallelism. In order to extract parallelism, it is necessary to perform the earliest feasible condition analysis considering both control dependency and data dependency for each macro task. The earliest executable condition is a condition in which the MT can be executed at the earliest time, and is obtained from the following execution condition.

(1)MTiがMTjにデータ依存するならば、MTjの実行が終了するまでMTiは実行できない。
(2)MTjの条件分岐先が確定すれば、MTjの実行が終了しなくても、MTjに制御依存するMTiは実行できる。
(1) If MTi is data-dependent on MTj, MTi cannot be executed until MTj has been executed.
(2) If the conditional branch destination of MTj is determined, MTi that is dependent on MTj can be executed even if execution of MTj is not completed.

したがって、最早実行可能条件の一般形は次のようになる。
(MTiが制御依存するMTjがMTiに分岐する)
AND
((MTiがデータ依存するMTk(0≦k≦|N|))が終了)OR(MTkが実行されないことが決定する))
マクロタスクの最早実行可能条件は、マクロタスクグラフ(MTG)で表される。
Therefore, the general form of the earliest feasible condition is as follows.
(MTj on which MTi depends on control branches to MTi)
AND
((MTk where MTi is data-dependent (0 ≦ k ≦ | N |) ends) OR (determines that MTk is not executed))
The earliest executable condition of the macro task is represented by a macro task graph (MTG).

1−4.マルチグレイン並列処理
自動並列化コンパイラでは、従来のループ並列化に加え、ループ間,サブルーチン間における粗粒度タスク間の並列性を利用する粗粒度タスク並列処理や、ステートメント間の並列性を利用する近細粒度並列処理を効果的に組み合わせたマルチグレイン並列処理(参考文献1(本多弘樹, 岩田雅彦, 笠原博徳、「Fortranプログラム粗粒度タスク間の並列性検出手法」、電子情報通信学会論文誌、1990年)参照)を実現している。
1-4. Multi-grain parallel processing In addition to the conventional loop parallelization, the automatic parallelizing compiler uses coarse-grained task parallelism that uses parallelism between coarse-grained tasks between loops and subroutines, and near-parallel processing that uses parallelism between statements. Multi-grain parallel processing that effectively combines fine-grain parallel processing (Reference 1 (Hiroki Honda, Masahiko Iwata, Hironori Kasahara, “Parallelity detection method between Fortran coarse-grained tasks”, IEICE Transactions, 1990))).

<粗粒度タスク並列処理>
自動並列化コンパイラは、BB,RB,SB等のMT間の制御依存性とデータ依存性を表現したマクロフローグラフ(MFG)を生成し、さらに、MFGから最早実行可能条件解析により引きだしたMT間の並列性を、マクロタスクグラフ(MTG)として表現する(参考文献1,参考文献2(笠原,合田,吉田,岡本,本多、「Fortranマクロデータフロー処理のマクロタスク生成手法」、信学論、1992年、Vol.J75-D-I、No.8、pp.511-525)参照)。
<Coarse grain task parallel processing>
The automatic parallelizing compiler generates a macro flow graph (MFG) that expresses the control dependency and data dependency between MTs such as BB, RB, SB, etc., and further, between MTs extracted from MFG by the earliest executable condition analysis Is expressed as a macrotask graph (MTG) (Reference 1, Reference 2 (Kasahara, Goda, Yoshida, Okamoto, Honda, “Macro Task Generation Method for Fortran Macro Data Flow Processing”), Science Theory 1992, Vol. J75-DI, No. 8, pp. 511-525)).

その後、自動並列化コンパイラは、MTG上のMTを、1つ以上のプロセッサエレメント(PE)をグルーピングしたプロセッサグループ(PG)に割り当てる。
<中粒度並列処理>
PGに割り当てられたMTが、DOALLループ、或いはイタレーションレベルで並列処理が可能なものであれば、そのMTには、プロセッサクラスタ内のプロセッサによって中粒度並列処理がなされる。この中粒度並列処理は、DOループイタレーション間の並列性を利用する並列処理のことであり、マルチプロセッサにおける並列処理では最も一般的なものである。
Thereafter, the automatic parallelizing compiler assigns the MT on the MTG to a processor group (PG) in which one or more processor elements (PE) are grouped.
<Medium-grain parallel processing>
If the MT assigned to the PG can be processed in parallel at the DOALL loop or iteration level, the MT is subjected to medium-grain parallel processing by the processors in the processor cluster. This medium-grain parallel processing is parallel processing using parallelism between DO loop iterations, and is the most common parallel processing in a multiprocessor.

<近細粒度並列処理>
ステートメントレベルの近細粒度タスクに対する並列処理を、近細粒度並列処理という。これによって、依存の無いステートメントも並列実行が可能になり、実行時間が短縮される。
<Near Fine Grain Parallel Processing>
Parallel processing for statement-level near-fine-grain tasks is called near-fine-grain parallel processing. As a result, statements that do not depend on can be executed in parallel, and the execution time is shortened.

1−5.マクロタスクスケジューリング
粗粒度タスク並列処理では、各階層で生成されたマクロタスクは、PGに割り当てられて実行される。どのPGにマクロタスクを割り当てるかを決定するスケジューリング手法として、下記のダイナミックスケジューリングとスタティックスケジューリングがあり、これらは、マクロタスクグラフの形状や実行時非決定性等を元に選択される。
1-5. Macrotask scheduling In coarse-grained task parallel processing, macrotasks generated at each level are assigned to PGs and executed. There are the following dynamic scheduling and static scheduling as scheduling methods for determining which PG a macro task is assigned to, and these are selected based on the shape of the macro task graph, non-determinism during execution, and the like.

<ダイナミックスケジューリング>
条件分岐等の実行時不確定性が存在する場合には、ダイナミックスケジューリングによって実行時にマクロタスクをPGに割り当てる。ダイナミックスケジューリングルーチンは、マクロタスクの終了や分岐方向の決定に応じてマクロタスク実行管理テーブルを操作し、各マクロタスクの最早実行可能条件を検査する。
<Dynamic scheduling>
When there is execution-time uncertainty such as conditional branching, a macrotask is assigned to a PG at the time of execution by dynamic scheduling. The dynamic scheduling routine operates the macro task execution management table according to the end of the macro task or the determination of the branch direction, and checks the earliest executable condition of each macro task.

マクロタスクが実行可能であれば、レディキューにマクロタスクが投入される。レディキュー内のマクロタスクは、その優先順位に従ってソートされ、レディキューの先頭のマクロタスクが、アイドル状態のプロセッサクラスタに割り当てられる。   If the macro task can be executed, the macro task is put into the ready queue. The macrotasks in the ready queue are sorted according to their priorities, and the first macrotask in the ready queue is assigned to an idle processor cluster.

また、ダイナミックスケジューリングコード生成時には、一つの専用のプロセッサがスケジューリングを行う集中スケジューリング方式と、スケジューリング機能を各プロセッサに分散した分散スケジューリング方式を、使用するプロセッサ台数,システムの同期オーバーヘッドに応じて使い分けることができる。   Also, when generating dynamic scheduling code, a centralized scheduling method in which one dedicated processor performs scheduling and a distributed scheduling method in which the scheduling function is distributed to each processor can be used according to the number of processors used and the synchronization overhead of the system. it can.

<スタティックスケジューリング>
一方、スタティックスケジューリングは、マクロタスクグラフがデータ依存エッジのみを持つ場合に使用され、自動並列化コンパイラが、コンパイル時にPGへのマクロタスクの割り当てを決める方式である。
<Static scheduling>
On the other hand, static scheduling is used when the macrotask graph has only data-dependent edges, and the automatic parallelizing compiler determines the assignment of macrotasks to PGs during compilation.

スタティックスケジューリングは、実行時スケジューリングオーバーへッドを無くし、データ転送と同期のオーバーへッドを最小化することが可能であるため、粒度の細かいタスクのスケジューリングに対しても効果的に利用できる。   Static scheduling can be effectively used for scheduling fine-grained tasks because it eliminates runtime scheduling overhead and minimizes data transmission and synchronization overhead.

また、スタティックスケジューリングの際、タスクのコストは自動並列化コンパイラでのタスクコスト推定値を適用するが、自動並列化コンパイラのプロファイル自動フィードバック機能を用いることで、実コストでタスクスケジューリングを行うことも可能である。   In the case of static scheduling, the task cost estimate value of the automatic parallelizing compiler is applied to the task cost. However, it is also possible to perform task scheduling at the actual cost by using the automatic profile parallel feedback function of the automatic parallelizing compiler. It is.

プロファイル自動フィードバック機能を用いる場合、第1フェーズとして、逐次プログラムをMTに分解し、MT毎にプロファイラ関数を挿入して逐次プログラムを生成する。このプロファイラ関数では、タスク実行コスト(clock cycle)とタスク実行回数を計測する。このプロファイラ関数が挿入された逐次プログラムを一度ターゲットとなるマシン上で実行することで、ターゲットとなるマシン上でのタスク実行コストとタスク実行回数の情報を持つファイルを出力する。   When the profile automatic feedback function is used, as a first phase, the sequential program is decomposed into MTs, and a profiler function is inserted for each MT to generate a sequential program. This profiler function measures the task execution cost (clock cycle) and the number of task executions. By executing the sequential program in which the profiler function is inserted once on the target machine, a file having information on the task execution cost and the task execution number on the target machine is output.

そして、第2フェーズにて、この出力ファイルと逐次プログラムを入力として、実コストに基づきスケジューリングした並列化プログラムが生成される。
1−6.データローカライゼーション
自動並列化コンパイラは、プログラム全域に渡るキャッシュ最適化を行うことが可能である。自動並列化コンパイラは、ループ間などの並列性を解析した後、ループ間にデータ依存があることが分かると、依存があるループ間でのキャッシュのグローバル最適化を試みる(参考文献3(特許第4177681号公報)参照)。
Then, in the second phase, the parallelized program scheduled based on the actual cost is generated using the output file and the sequential program as input.
1-6. Data localization An automatic parallelizing compiler can perform cache optimization over the entire program. After analyzing the parallelism between loops, etc., if the automatic parallelizing compiler finds that there is data dependence between the loops, it tries to optimize the cache globally between the loops with dependence (Reference 3 (Patent No. 3). No. 4,177,681)).

具体的には、各ループでアクセスされる配列を調査し、同一の分割ループは同一の配列部分にアクセスするように調整することにより、同一の分割ループを同一プロセッサに割り当てる。これにより、同一の分割ループでは、全ての配列データがキャッシュ上で再利用されるようになる。   Specifically, the array accessed in each loop is investigated, and the same divided loop is allocated to the same processor by adjusting so as to access the same array portion. As a result, in the same divided loop, all the array data is reused on the cache.

また、このローカライズ技術は、
(1)任意のサイズのローカルメモリ或いは分散共有メモリが与えられた時に、DMA(DTU)(参考文献4(特許第4476267号公報)参照)を用いアクセスされる前に、前記プロセッサに近接したローカル或いは分散共有メモリに事前ロードし、プログラム全域で再利用する。
In addition, this localization technology
(1) When a local memory or a distributed shared memory of an arbitrary size is provided, a local memory close to the processor is accessed before being accessed using DMA (DTU) (see Reference 4 (Japanese Patent No. 4476267)). Alternatively, it is preloaded into the distributed shared memory and reused throughout the program.

(2)送付先のメモリが一杯の場合には、送付先プロセッサのDTUが、メモリからの掃き出し優先順位に従ってデータを共有メモリ等へ掃き出したことを同期フラグで知らされたら、自動的に空いたメモリにデータを転送する。   (2) When the destination memory is full, when the DTU of the destination processor is informed by the synchronization flag that the data has been flushed to the shared memory or the like according to the flushing priority from the memory, it is automatically freed Transfer data to memory.

(3)将来再利用されるデータであるが、暫くの間使用されず、メモリの領域を開ける必要がある場合には、CPUによるタスク実行の裏側でDTUが当該データを集中共有メモリに待避し、使用時までに再ロードする。   (3) Data that will be reused in the future, but will not be used for a while, and if the memory area needs to be opened, the DTU saves the data to the centralized shared memory behind the task execution by the CPU. Reload by use.

といったローカルメモリ管理,データ転送技術へと進化している(参考文献5(英国特許第2478874号明細書)。
1−7.並列化プログラムの生成
自動並列化コンパイラにおける並列化プログラムの生成は、自動並列化API(参考文献7(早稲田大学、「Optimally Scheduled Advanced Multiprocessor Application Program Interface」、2008年)参照)を用い、並列化C或いは並列化Fortranのような、source-to-sourceで並列化を行うことが可能である。
It has evolved to local memory management and data transfer technology (Reference 5 (UK Patent No. 2478874)).
1-7. Generation of a parallelized program Parallelized programs are generated by an automatic parallelizing compiler using an automatic parallelizing API (see Reference 7 (Waseda University, "Optimally Scheduled Advanced Multiprocessor Application Program Interface", 2008)). Alternatively, parallelization can be done with source-to-source, such as parallelized Fortran.

この場合には、自動並列化コンパイラは、様々なプラットフォームにおいて並列化プログラムを実行可能とするため、後述する自動並列化API標準解釈系を用いて、各プロセッサ用のC或いはFortranのディレクティブ部分をランタイムライブラリコールに変換する。その後、自動並列化コンパイラは、各プロセッサ用のコードを逐次コンパイラでコンパイルしてバイナリを生成し、このバイナリをリンクすると、対象となるマルチプロセッサ上で並列化プログラムを実行可能となる。   In this case, the automatic parallelizing compiler can execute the parallelized program on various platforms, so that the C or Fortran directive part for each processor is executed at runtime using the automatic parallelizing API standard interpretation system described later. Convert to library call. Thereafter, the automatic parallelizing compiler compiles the code for each processor with a sequential compiler to generate a binary, and when this binary is linked, the parallelized program can be executed on the target multiprocessor.

2.組み込みシステム用の逐次プログラムの並列化手順と手法
次に、組み込みシステム用の逐次プログラムの特徴について述べ、本実施形態の自動並列化コンパイラによる並列化手法について説明する。なお、組み込みシステムとは、例えば、車載装置であっても良いし、車載装置以外の電子装置であっても良い。また、逐次プログラムは、モデルベース設計により自動生成されたもの(一例として、MathWork社のMatlab(登録商標),Simulink(登録商標)にて自動生成されたもの)であっても良い。
2. Next, features of the sequential program for the embedded system will be described, and a parallelization method by the automatic parallelizing compiler of this embodiment will be described. Note that the embedded system may be, for example, an in-vehicle device or an electronic device other than the in-vehicle device. The sequential program may be automatically generated by model-based design (as an example, automatically generated by MatWork (registered trademark) or Simulink (registered trademark) of MathWork).

自動並列化コンパイラは、条件分岐と代入文により構成され、処理が細かい逐次プログラムに対して、インライン展開やリネーミングを行い、並列性を抽出する。また、リアルタイム性を順守するために条件分岐隠蔽のためのタスク融合を行い、オーバーヘッドが低くなるようにスタティックスケジューリングを行う。さらに、実コストでスタティックスケジューリングを行うために、プロファイル自動フィードバック機能を適用しても良い。   The automatic parallelizing compiler is composed of conditional branches and assignment statements, and performs inline expansion and renaming on sequential programs with fine processing to extract parallelism. In addition, task scheduling for conditional branch concealment is performed in order to comply with real-time characteristics, and static scheduling is performed so as to reduce overhead. Further, an automatic profile feedback function may be applied to perform static scheduling at an actual cost.

また、逐次プログラムにおいて、条件コンパイルスイッチ(プリプロセッサへの命令)により、仕向地や機能やハードウェアの構成等が異なる組み込みシステムの各種別に応じてコンパイルの対象となる記述を選択する条件付コンパイルが行われる場合がある。このような場合、逐次プログラムの各条件コンパイルスイッチの引数として、いずれかの種別に対応する情報(仕向地等を示す情報)を設定することで、逐次プログラムから、該種別に対応するバイナリコードが生成される。なお、条件付コンパイルスイッチの引数に応じてコンパイル対象とするか否かが切り替えられる複数の部分から構成される一連の記述を、条件付記述と記載する。   In a sequential program, conditional compilation (selection to the preprocessor) performs conditional compilation to select a description to be compiled according to various types of embedded systems with different destinations, functions, hardware configurations, etc. May be. In such a case, by setting information corresponding to one of the types (information indicating the destination) as an argument of each conditional compilation switch of the sequential program, the binary code corresponding to the type can be obtained from the sequential program. Generated. A series of descriptions composed of a plurality of portions that are switched to be compiled according to the argument of the conditional compilation switch are referred to as conditional descriptions.

これに対し、本実施形態の自動並列化コンパイラは、条件付コンパイルによるコンパイル対象の選択を無視し、逐次プログラムの全ての部分を対象としてマクロタスクの分割や並列性の抽出やスタティックスケジューリング等を行い、並列化プログラムを生成する。その後、並列化プログラムから、条件付コンパイルによりコンパイルの対象外となる記述を特定し、該記述を除いた状態で、マルチコアプロセッサを動作させるためのバイナリデータを生成する。さらに、自動並列化コンパイラは、スタティックスケジューリングにおいて、1の条件付記述に基づく全処理に対応するマクロタスクについては、全て同一のPGに割り当てる。   On the other hand, the automatic parallelizing compiler of this embodiment ignores the selection of the compilation target by conditional compilation, performs macro task division, parallelism extraction, static scheduling, etc. for all parts of the sequential program. Generate a parallelized program. Thereafter, a description that is not subject to compilation is identified from the parallelized program by conditional compilation, and binary data for operating the multi-core processor is generated without the description. Further, the automatic parallelizing compiler assigns all macro tasks corresponding to all processes based on one conditional description to the same PG in static scheduling.

2−1.自動並列化コンパイラの動作環境等について
自動並列化コンパイラ1は、例えば、DVD,CD−ROM,USBメモリ,メモリカード(登録商標)等の光ディスク,磁気ディスク,半導体製メモリ等として構成された記憶媒体18に記憶された状態で、ユーザに提供される(図1参照)。無論、ネットワークを経由してユーザに提供されても良い。
2-1. Operating Environment of Automatic Parallelizing Compiler The automatic parallelizing compiler 1 is a storage medium configured as, for example, an optical disk such as a DVD, CD-ROM, USB memory, or memory card (registered trademark), a magnetic disk, a semiconductor memory, or the like. 18 is provided to the user in the state stored in 18 (see FIG. 1). Of course, it may be provided to the user via the network.

そして、自動並列化コンパイラ1がインストールされたパーソナルコンピュータ(PC)10は、自動並列化コンパイル装置として動作する。PC10は、ディスプレイ11,HDD12,CPU13,ROM14,RAM15,入力装置16,読取部17等を備える。   The personal computer (PC) 10 in which the automatic parallelizing compiler 1 is installed operates as an automatic parallelizing compiling device. The PC 10 includes a display 11, an HDD 12, a CPU 13, a ROM 14, a RAM 15, an input device 16, a reading unit 17, and the like.

ディスプレイ11は、CPU13から受けた映像信号を、ユーザに対して映像として表示する。
また、入力装置16は、キーボード、マウス等から構成され、ユーザが操作することにより、その操作に応じた信号をCPU13に出力する。
The display 11 displays the video signal received from the CPU 13 as a video to the user.
The input device 16 includes a keyboard and a mouse, and outputs a signal corresponding to the operation to the CPU 13 when operated by the user.

また、読取部17は、自動並列化コンパイラ1等が記憶された記憶媒体18からデータを読み取る部位である。
また、RAM15は読み出し、書き込み可能な揮発性メモリであり、ROM14は読み出し専用の不揮発性メモリであり、HDD12は読み出し,書き込みが可能な不揮発性メモリである。ROM14,HDD12には、CPU13が読み出して実行するプログラム等が予め記憶されている。
The reading unit 17 is a part that reads data from the storage medium 18 in which the automatic parallelizing compiler 1 or the like is stored.
The RAM 15 is a readable / writable volatile memory, the ROM 14 is a read-only nonvolatile memory, and the HDD 12 is a readable / writable nonvolatile memory. In the ROM 14 and the HDD 12, programs that are read and executed by the CPU 13 are stored in advance.

また、RAM15は、CPU13がROM14,HDD12に記憶されたプログラムを実行する際に、そのプログラムを一時的に保存するための記憶領域や、作業用のデータを一時的に保存するための記憶領域として用いられる。   The RAM 15 is a storage area for temporarily storing the program when the CPU 13 executes the program stored in the ROM 14 or the HDD 12 or a storage area for temporarily storing work data. Used.

また、CPU13は、OSをHDD12から読み出して実行し、HDD12に記録されている各種プログラムをOS上のプロセスとして実行する。また、CPU13は、このプロセスにおいて、必要に応じて入力装置16から信号の入力を受け付け、ディスプレイ11に映像信号を出力し、RAM15,HDD12に対してデータの読み出し/書き込みの制御を行う。   Further, the CPU 13 reads the OS from the HDD 12 and executes it, and executes various programs recorded on the HDD 12 as processes on the OS. In this process, the CPU 13 receives an input of a signal from the input device 16 as necessary, outputs a video signal to the display 11, and controls data read / write to the RAM 15 and the HDD 12.

また、PC10には、読取部17を介して記憶媒体18から読み取られた自動並列化コンパイラ1がインストールされており、自動並列化コンパイラ1は、HDD12に保存され、OS上のプロセスとして実行されるアプリケーションの1つとなっている。   In addition, the automatic parallelizing compiler 1 read from the storage medium 18 via the reading unit 17 is installed in the PC 10, and the automatic parallelizing compiler 1 is stored in the HDD 12 and executed as a process on the OS. One of the applications.

なお、この自動並列化コンパイル装置は、車載装置等といった組み込みシステム向けの並列化プログラムの開発に用いられる。しかしながら、これに限定されることは無く、例えば情報家電等といった様々な用途の組込みシステム向けの並列化プログラムの開発や、組込みシステム以外の他の用途の並列化プログラムの開発に用いることができる。   This automatic parallel compilation device is used for developing a parallel program for an embedded system such as an in-vehicle device. However, the present invention is not limited to this, and can be used, for example, for developing parallel programs for embedded systems for various uses such as information appliances, and for developing parallel programs for other uses other than embedded systems.

2−2.自動並列化処理について
次に、条件付コンパイルがなされる逐次プログラムに基づき並列化プログラムを生成する自動並列化処理について、図2のフローチャートを用いて説明する。なお、条件付コンパイルにより、該逐次プログラムからは、条件コンパイルスイッチにて参照される引数の値に対応する種別の組み込みシステムに搭載されるバイナリデータが生成される。また、本処理は、PC10にて動作している自動並列化コンパイラ1がユーザからの指示に応じて開始する。
2-2. Automatic Parallelization Processing Next, automatic parallelization processing for generating a parallelized program based on a sequential program that is subjected to conditional compilation will be described with reference to the flowchart of FIG. By the conditional compilation, binary data mounted on the embedded system of the type corresponding to the argument value referenced by the conditional compilation switch is generated from the sequential program. Further, this process is started in response to an instruction from the user by the automatic parallelizing compiler 1 operating on the PC 10.

S100では、自動並列化コンパイラ1は、逐次プログラムに記述されている条件コンパイルスイッチに基づき、逐次プログラムから条件付記述を特定し、S105に処理を移行する。   In S100, the automatic parallelizing compiler 1 identifies the conditional description from the sequential program based on the conditional compilation switch described in the sequential program, and shifts the processing to S105.

S105では、自動並列化コンパイラ1は、ソフト構造解析処理(図3参照)を実行し、MTGを生成し、S110に処理を移行する。
S110では、自動並列化コンパイラ1は、ソフト構造解析処理で生成されたMTGに基づきスタティックスケジューリングを行う。これにより、並列実行可能なマクロタスクの全部又は一部が異なるPGに割り当てられ(該割り当ての結果を示す情報を割当情報とする)、並列化プログラムが生成される。この時、1の条件付記述に基づく処理に対応するマクロタスクは、全て同一のPGに割り当てられる。
In S105, the automatic parallelizing compiler 1 executes a software structure analysis process (see FIG. 3), generates an MTG, and shifts the process to S110.
In S110, the automatic parallelizing compiler 1 performs static scheduling based on the MTG generated by the software structure analysis process. As a result, all or part of the macro tasks that can be executed in parallel are assigned to different PGs (information indicating the result of the assignment is assigned information), and a parallelized program is generated. At this time, all macrotasks corresponding to processing based on one conditional description are assigned to the same PG.

なお、並列化プログラムでは、各条件付記述に対応する記述に対し、逐次プログラムにおける該条件付記述に設定されていた条件コンパイルスイッチと同等の内容の条件コンパイルスイッチが設定されている。このため、並列化プログラムの条件コンパイルスイッチの引数をいずれかの種別に対応する値に設定すると、該種別に対応する並列化プログラムとなる。   In the parallelized program, a conditional compilation switch having the same content as the conditional compilation switch set in the conditional description in the sequential program is set for the description corresponding to each conditional description. For this reason, when the argument of the conditional compilation switch of the parallelized program is set to a value corresponding to any type, a parallelized program corresponding to the type is obtained.

また、自動並列化コンパイラ1は、スタティックスケジューリングにおいて、プロファイル自動フィードバック機能により各マクロタスクを実行する際の実コスト(一例として処理時間)を特定しても良い。そして、各条件付記述に基づく処理に対応するマクロタスクを同一のPGに割り当てつつ、各PGの処理負荷が同程度となるように、並列実行可能なマクロタスクを各PGに割り当てても良い。   Further, the automatic parallelizing compiler 1 may specify the actual cost (processing time as an example) when executing each macrotask by the profile automatic feedback function in the static scheduling. Then, macro tasks that can be executed in parallel may be assigned to each PG so that the processing loads of the PGs are approximately the same while assigning the macro tasks corresponding to the processing based on the conditional descriptions to the same PG.

また、この時、自動並列化コンパイラ1は、並列化プログラムを様々なプラットフォームで動作させるため、自動並列化API標準解釈系を用いて、自動並列化APIが加えられた並列化プログラムをランタイムライブラリが実装された並列化プログラムに変換しても良い。   At this time, since the automatic parallelizing compiler 1 operates the parallelized program on various platforms, the runtime library uses the automatic parallelizing API standard interpretation system to execute the parallelized program to which the automatic parallelizing API is added. It may be converted into an implemented parallelized program.

S115では、自動並列化コンパイラ1は、各条件付記述に基づく処理に対応するマクロタスクを特定すると共に、ソフト構造解析処理で生成されたMTGに基づき、各々の条件付記述について、対応する各マクロタスクが並列化可能であるか否かを判定する。そして、マクロタスクを並列化可能と判定された条件付記述を特定し、S120に処理を移行する。   In S115, the automatic parallelizing compiler 1 specifies a macro task corresponding to the processing based on each conditional description, and for each conditional description, the corresponding macro for each conditional description based on the MTG generated by the software structure analysis processing. Determine whether a task can be parallelized. Then, the conditional description for which it is determined that the macrotask can be parallelized is specified, and the process proceeds to S120.

S120では、自動並列化コンパイラ1は、並列化プログラムの性能を検証する。具体的には、例えば、自動並列化コンパイラ1は、各マクロタスクの処理時間を特定すると共に、各PGについて、該PGに割り当てられた全マクロタスクの処理時間の総和を算出しても良い。この時、他のPGでの処理の終了を待つ必要があるPGについては(例えば、データ依存性を有するマクロタスクに対応する処理が他のPGで行われる場合等)、待ち時間を算出し、該待ち時間をPGの処理時間の総和に加算する。そして、各PGの処理時間の総和うち、最大値(並列実行時間)を特定し、これを検証結果としても良い。   In S120, the automatic parallelizing compiler 1 verifies the performance of the parallelized program. Specifically, for example, the automatic parallelizing compiler 1 may specify the processing time of each macro task and calculate the sum of the processing times of all the macro tasks assigned to the PG for each PG. At this time, for a PG that needs to wait for the end of processing in another PG (for example, when processing corresponding to a macro task having data dependency is performed in another PG), the waiting time is calculated, The waiting time is added to the total processing time of PG. Then, the maximum value (parallel execution time) of the total processing time of each PG may be specified and used as the verification result.

この他にも、例えば、同様にして並列実行時間を算出すると共に、全マクロタスクの処理時間の総和(最大処理時間)を、シングルコアプロセッサが逐次プログラムを実行した際の処理時間として算出しても良い。そして、並列実行時間を最大処理時間で除算した値を、低減率(並列化により処理速度がどの程度向上するかを示す値)として算出し、これを検証結果としても良い。   In addition to this, for example, the parallel execution time is calculated in the same manner, and the total processing time (maximum processing time) of all macro tasks is calculated as the processing time when the single core processor executes the sequential program. Also good. Then, a value obtained by dividing the parallel execution time by the maximum processing time is calculated as a reduction rate (a value indicating how much the processing speed is improved by parallelization), and this may be used as a verification result.

なお、自動並列化コンパイラ1は、生成された並列化プログラムの性能の検証結果を報知しても良い。
S125では、自動並列化コンパイラ1は、並列化プログラムの性能の検証結果に基づき、並列化プログラムの性能が一定の水準に達しているか否かを判定する。具体的には、例えば、並列実行時間が予め定められた閾値以下である場合や、低減率が予め定められた閾値以下である場合等には、並列化プログラムの性能が一定の水準に達しているとみなしても良い。この他にも、例えば、並列実行時間と低減率の双方が閾値以下である場合には、並列化プログラムの性能が一定の水準に達しているとみなしても良い。そして、肯定判定が得られた場合には(S125:Yes)、S130に処理を移行し、否定判定が得られた場合には(S125:No)、S135に移行する。
Note that the automatic parallelizing compiler 1 may notify the verification result of the performance of the generated parallelized program.
In S125, the automatic parallelizing compiler 1 determines whether or not the performance of the parallelized program has reached a certain level based on the verification result of the performance of the parallelized program. Specifically, for example, when the parallel execution time is less than or equal to a predetermined threshold, or when the reduction rate is less than or equal to a predetermined threshold, the performance of the parallelized program reaches a certain level. You may consider it. In addition, for example, when both the parallel execution time and the reduction rate are equal to or less than the threshold value, it may be considered that the performance of the parallelized program has reached a certain level. If an affirmative determination is obtained (S125: Yes), the process proceeds to S130, and if a negative determination is obtained (S125: No), the process proceeds to S135.

S130では、自動並列化コンパイラ1は、S115で特定された条件付記述(対応する各マクロタスクの並列化が可能である条件付記述)を示すレポートを生成し、HDD12に保存する。なお、1の条件付記述に基づく処理に対応する並列化可能な複数のマクロタスクを示すレポートを生成しても良いし、該条件付記述と該マクロタスクの双方又は一方をディスプレイ11に表示しても良い。   In S130, the automatic parallelizing compiler 1 generates a report indicating the conditional description specified in S115 (conditional description in which each corresponding macrotask can be parallelized), and stores the report in the HDD 12. Note that a report indicating a plurality of parallelizable macro tasks corresponding to processing based on one conditional description may be generated, or both or one of the conditional description and the macro task may be displayed on the display 11. May be.

S135では、自動並列化コンパイラ1は、並列化プログラムに記述されているコンパイラスイッチを解析し、解析結果に応じた処理を行うプリプロ処理を実行する。この時、条件コンパイルスイッチに基づき、並列化プログラムの中から、引数に対応する種別にてコンパイルの対象となる記述を特定し、S140に移行する。   In S135, the automatic parallelizing compiler 1 analyzes the compiler switch described in the parallelized program, and executes pre-pro processing that performs processing according to the analysis result. At this time, based on the conditional compilation switch, the description to be compiled is specified from the parallelized program by the type corresponding to the argument, and the process proceeds to S140.

S140では、自動並列化コンパイラ1は、並列化プログラムにおけるコンパイルの対象となる記述から、マルチコアプロセッサを動作させるためのバイナリデータを生成し、本処理を終了する。   In S140, the automatic parallelizing compiler 1 generates binary data for operating the multi-core processor from the description to be compiled in the parallelized program, and ends this processing.

2−3.ソフト構造解析処理について
次に、逐次プログラムからMTGを生成するソフト構造解析処理について、図3のフローチャートを用いて説明する。本処理は、自動並列化処理にて実行される。
2-3. Software Structure Analysis Processing Next, software structure analysis processing for generating MTG from a sequential program will be described using the flowchart of FIG. This processing is executed by automatic parallelization processing.

S200では、自動並列化コンパイラ1は、逐次プログラムに対し、インライン展開(サブルーチンをコールする記述を、該サブルーチンにて定義されている処理の記述に置き換える)を行い、S205に移行する。組み込みシステム用の逐次プログラムは、一般的に処理が細かく、粗い粒度での並列化が困難であるが、インライン展開を行うことで、サブルーチン内の並列性をも有効活用できるようになる。   In S200, the automatic parallelizing compiler 1 performs inline expansion (replaces the description for calling the subroutine with the description of the process defined in the subroutine) for the sequential program, and proceeds to S205. A sequential program for an embedded system is generally finely processed and difficult to parallelize with a coarse granularity. However, by performing inline expansion, the parallelism within the subroutine can be effectively utilized.

S205では、自動並列化コンパイラ1は、ローカル変数のリネームを行う。例えばSimulinkモデルから自動生成された逐次プログラム等では、ROM使用量削減のため、多くの箇所で同じローカル変数が繰り返し使用される場合があり、これにより、並列性解析の際にデータ依存があると特定され、並列性が十分引き出せなくなってしまう。そこで、使い回しされているローカル変数のリネームが行われる。   In S205, the automatic parallelizing compiler 1 renames the local variable. For example, in a sequential program automatically generated from a Simulink model, the same local variable may be used repeatedly in many places to reduce ROM usage. As a result, the parallelism cannot be extracted sufficiently. Therefore, the local variables being reused are renamed.

具体的には、自動並列化コンパイラ1は、逐次プログラムの各関数内において、同一名称のローカル変数が用いられている複数の処理ブロックを特定すると共に、特定した各処理ブロックにおいて独自の名称のローカル変数が用いられるよう、逐次プログラムを改変する。   Specifically, the automatic parallelizing compiler 1 specifies a plurality of processing blocks in which local variables with the same name are used in each function of the sequential program, and each local block with a unique name in each specified processing block. Modify the sequential program so that variables are used.

なお、処理ブロックとは、例えば、ループ処理や、if文やswitch-case文等の分岐処理のステートメントと、これに付随する代入文等から構成される記述の集合体であっても良い。また、このほかにも、例えば、逐次プログラムを生成したSimulinkモデルにおける各ブロックに対応する記述の集合体を、処理ブロックとしても良い。   The processing block may be, for example, a collection of descriptions including a loop processing, a branch processing statement such as an if statement or a switch-case statement, and an assignment statement accompanying the statement. In addition, for example, a collection of descriptions corresponding to each block in the Simulink model that generated the sequential program may be used as a processing block.

S210では、自動並列化コンパイラ1は、これらの処理がなされた逐次プログラムをマクロタスクに分割する。そして、各マクロタスク間のデータ依存性と制御依存性を解析してMFGを生成し、S215に移行する。   In S210, the automatic parallelizing compiler 1 divides the sequential program that has been subjected to these processes into macro tasks. Then, an MFG is generated by analyzing data dependency and control dependency between the macro tasks, and the process proceeds to S215.

S215では、自動並列化コンパイラ1は、MFGが示す制御依存性に基づき、異なるマクロタスクに分岐するマクロタスクを始端タスクとして特定する。また、自動並列化コンパイラ1は、該始端タスクを始点として順次実行される複数の一連の処理の全てにおいて共通して実行されるマクロタスクのうち、最初に実行されるものを終端タスクとして特定する。   In S215, the automatic parallelizing compiler 1 identifies a macro task that branches to a different macro task as a start task based on the control dependency indicated by the MFG. Further, the automatic parallelizing compiler 1 identifies the macro task that is executed first among the macro tasks that are executed in common among all of the series of processes that are sequentially executed starting from the start task as the end task. .

そして、自動並列化コンパイラ1は、特定した始端タスクと、該始端タスクを始点とする処理における終端タスクと、該始端タスクの実行後であって、該終端タスクの実行前に実行される全てのマクロタスクとを、1つのマクロタスクに融合させ(タスク融合)、S220に移行する。   Then, the automatic parallelizing compiler 1 executes the specified start task, the end task in the process starting from the start task, and all the processes executed after the start task and before the end task is executed. The macro task is merged into one macro task (task fusion), and the process proceeds to S220.

なお、マクロタスクの粒度を細かくするためには、S215での処理のように、始端タスクを始点として順次実行される複数の一連の処理の全てにおいて共通して実行されるマクロタスクのうち、最初に実行されるマクロタスクを終端タスクとして特定するのが好適である。しかし、これに限らず、これらのマクロタスクのうち、2番目以降に実行されるいずれか一つのマクロタスクを終端タスクとして特定しても良い。   In order to make the granularity of the macro task fine, among the macro tasks that are commonly executed in all of a plurality of series of processes that are sequentially executed starting from the start task as in the process in S215, It is preferable to specify a macro task to be executed as a termination task. However, the present invention is not limited to this, and any one of these macrotasks executed after the second may be specified as a termination task.

組み込みシステム(特に車載装置)向けの逐次プログラムは、ループ構造が少ないため、近細粒度並列化か粗粒度タスク並列化を適用することが考えられるが、実行オーバーヘッドを小さく抑えるため、自動並列化コンパイラ1は、粗粒度タスク並列化を適用する。   Sequential programs for embedded systems (especially in-vehicle devices) have few loop structures, so it may be possible to apply near fine-grain parallelism or coarse-grained task parallelism. 1 applies coarse-grained task parallelization.

また、逐次プログラムでは、各マクロタスクのコストは数10クロック程度であるが、自動並列化コンパイラ1によりダイナミックスケジューリングを行った場合には、通常数10から数100クロックのオーバーヘッドが生じる。このため、ダイナミックスケジューリングは、逐次プログラムには不向きである。   In the sequential program, the cost of each macrotask is about several tens of clocks. However, when dynamic scheduling is performed by the automatic parallelizing compiler 1, an overhead of several tens to several hundreds of clocks is usually generated. For this reason, dynamic scheduling is not suitable for sequential programs.

しかしながら、条件分岐を持つマクロタスクは、その実行時に動的に分岐先が決定されるため、そのままでは、コンパイル時にプロセッサコアを割り当てるスタティックスケジューリングが適用できないという問題がある。   However, since a macrotask having a conditional branch is dynamically determined at the time of execution of the macrotask, static scheduling that assigns a processor core at the time of compilation cannot be applied as it is.

そこで、自動並列化コンパイラ1は、タスク融合アルゴリズムにより、条件分岐をもつマクロタスクと、その分岐先のマクロタスクまでを1つの粗粒度タスク(Blockタスク)に融合するタスク融合を行う。タスク融合を行うことで、MFGは制御依存性が無い状態となり、スタティックスケジューリングが可能となる。   Therefore, the automatic parallelizing compiler 1 performs task fusion by fusing a macro task having a conditional branch and a macro task at the branch destination into one coarse-grained task (Block task) by a task fusion algorithm. By performing task fusion, the MFG has no control dependency, and static scheduling is possible.

S220では、自動並列化コンパイラ1は、タスク融合がなされたMFGに基づき、各マクロタスクの最早実行可能条件を解析し、MTGを生成する。そして、本処理を終了する。   In S220, the automatic parallelizing compiler 1 analyzes the earliest executable condition of each macro task based on the MFG subjected to task fusion, and generates an MTG. Then, this process ends.

3.車載装置の構成について
次に、本実施形態の自動並列化コンパイラ1により生成された並列化プログラムにより動作する車載装置20の構成について説明する(図4参照)。無論、自動並列化コンパイラ1は、車載装置20に限らず、同様の構成を有する様々な電子装置を動作させる並列化プログラムを生成可能である。
3. Next, the configuration of the in-vehicle device 20 that operates according to the parallelized program generated by the automatic parallelizing compiler 1 of the present embodiment will be described (see FIG. 4). Of course, the automatic parallelizing compiler 1 is capable of generating parallelized programs that operate not only the in-vehicle device 20 but also various electronic devices having the same configuration.

車載装置20は、マルチコアプロセッサ21,通信部22,センサ部23,入出力ポート24等を備える。
マルチコアプロセッサ21は、ROM21aと、RAM21bと、複数のPE21c,21d…等を有している。
The in-vehicle device 20 includes a multi-core processor 21, a communication unit 22, a sensor unit 23, an input / output port 24, and the like.
The multi-core processor 21 includes a ROM 21a, a RAM 21b, and a plurality of PEs 21c, 21d, etc.

また、ROM21aは、自動並列化コンパイラ1により生成された並列化プログラム21a−1(バイナリデータ)が保存されている。マルチコアプロセッサ21は、並列化プログラム21a−1に従い動作し、車載装置20を統括制御する。   The ROM 21a stores a parallelized program 21a-1 (binary data) generated by the automatic parallelizing compiler 1. The multi-core processor 21 operates according to the parallelized program 21a-1 and performs overall control of the in-vehicle device 20.

また、RAM21bは、PE21c,21d…等によりアクセスされる部位である。
また、通信部22は、車内LAN等を介して接続された他のECUと通信を行う部位である。
The RAM 21b is a part accessed by the PEs 21c, 21d, etc.
The communication unit 22 is a part that communicates with another ECU connected via an in-vehicle LAN or the like.

また、センサ部23は、制御対象等の状態を検出するための各種センサから構成される部位である。
また、入出力ポート24は、制御対象を制御するための各種信号の送受信を行う部位である。
Moreover, the sensor part 23 is a site | part comprised from the various sensors for detecting states, such as a control object.
The input / output port 24 is a part that transmits and receives various signals for controlling the control target.

[具体例について]
次に、本実施形態の自動並列化コンパイラ1により並列化プログラムを生成する処理の具体例について説明する。以下の説明において、処理A等といった記載がなされるが、これは、各種演算や代入や分岐処理や関数コール等からなる一連の処理の記述を意味する。
[Specific examples]
Next, a specific example of processing for generating a parallelized program by the automatic parallelizing compiler 1 of the present embodiment will be described. In the following description, description such as process A is made, which means a description of a series of processes including various operations, assignments, branch processes, function calls, and the like.

本具体例では、2種類の引数(“CSW1,2”)を参照する条件付コンパイルが行われる逐次プログラム300に基づき並列化プログラムが生成される(図5参照)。並列化プログラムは、2つのPE(第1,第2コア)を有するマルチコアプロセッサにて実行され、各マクロタスクは、これらのコアに割り当てられる。なお、図中、逐次プログラム300には“処理A〜E”の処理が含まれているが、これら以外の処理がさらに含まれていても良い。   In this specific example, a parallelized program is generated based on a sequential program 300 that is subjected to conditional compilation that refers to two types of arguments (“CSW1, 2”) (see FIG. 5). The parallelized program is executed by a multi-core processor having two PEs (first and second cores), and each macrotask is assigned to these cores. In the figure, the sequential program 300 includes the processes of “Processes A to E”, but other processes may be included.

逐次プログラム300では、“処理B及びC”,“処理D及びE”が条件付記述となっている。条件コンパイルスイッチ301により、“処理B”と“処理C”のうちの一方がコンパイルの対象として選択され、条件コンパイルスイッチ302により、“処理D”と“処理E”のうちの一方がコンパイルの対象として選択される。具体的には、“CSW1=A”の場合には“処理B”が、“CSW1≠A”の場合には処理Cがコンパイルの対象として選択される。また、“CSW2=B”の場合には“処理D”が、“CSW2≠B”の場合には処理Eがコンパイルの対象として選択される。   In the sequential program 300, “Processing B and C” and “Processing D and E” are conditional descriptions. One of “Process B” and “Process C” is selected as a compilation target by the conditional compilation switch 301, and one of “Process D” and “Process E” is the compilation target by the conditional compilation switch 302. Selected as. Specifically, when “CSW1 = A”, “Process B” is selected as a target for compilation, and when “CSW1 ≠ A”, Process C is selected as a target for compilation. In addition, when “CSW2 = B”, “Process D” is selected as a target for compilation, and when “CSW2 ≠ B”, Process E is selected as a target for compilation.

自動並列化コンパイラ1は、自動並列化処理のS100にて、逐次プログラム300の“処理B及びC”,“処理D及びE”の各々を条件付記述として特定する。
また、S105(ソフト構造解析処理)では、自動並列化コンパイラ1は、“処理A〜E”の各々を異なるマクロタスク(“A”〜“E”)に分割し、MTGを生成する。なお、マクロタスク“A”〜“E”は、それぞれ、“処理A〜E”に対応する。
The automatic parallelizing compiler 1 specifies each of “Processing B and C” and “Processing D and E” of the sequential program 300 as a conditional description in S100 of the automatic parallelization processing.
In S105 (software structure analysis process), the automatic parallelizing compiler 1 divides each of the “processes A to E” into different macro tasks (“A” to “E”) to generate an MTG. The macro tasks “A” to “E” correspond to “processes A to E”, respectively.

そして、S110において、自動並列化コンパイラ1は、生成されたMTGに基づきスタティックスケジューリングを行う。A〜Dパターン310〜313は、該スタティックスケジューリングにより生成される可能性のある割当情報を示している。   In S110, the automatic parallelizing compiler 1 performs static scheduling based on the generated MTG. A to D patterns 310 to 313 indicate allocation information that may be generated by the static scheduling.

スタティックスケジューリングにより、マクロタスクである“B,C”,“D,E”は、同じコアに割り当てられる。Aパターン310では、“B,C”は第1コアに、“D,E”は第2コアに割り当てられ、Bパターン311では、“B,C”は第2コアに、“D,E”は第1コアに割り当てられる。また、Cパターン312では、“B,C”及び“D,E”は第1コアに割り当てられ、Dパターン313では、“B,C”及び“D,E”は第2コアに割り当てられる。   By static scheduling, “B, C”, “D, E” as macro tasks are assigned to the same core. In the A pattern 310, “B, C” is assigned to the first core, and “D, E” is assigned to the second core. In the B pattern 311, “B, C” is assigned to the second core, “D, E”. Is assigned to the first core. In the C pattern 312, “B, C” and “D, E” are assigned to the first core, and in the D pattern 313, “B, C” and “D, E” are assigned to the second core.

ここで、タスク融合により、1の条件付記述に基づく処理に対応するマクロタスクの一部と、該条件付記述の前後の記述に基づく処理に対応するマクロタスクが、1つのマクロタスクに融合される場合も想定される。このような場合、自動並列化コンパイラ1は、スタティックスケジューリングにおいて、融合されたマクロタスクと、該条件付記述に対応する残りのマクロタスクとを、1つのコアに割り当てる。   Here, by task fusion, a part of the macro task corresponding to processing based on one conditional description and the macro task corresponding to processing based on descriptions before and after the conditional description are merged into one macro task. It is also assumed that In such a case, the automatic parallelizing compiler 1 assigns the merged macrotask and the remaining macrotask corresponding to the conditional description to one core in static scheduling.

より詳しく説明すると、上記具体例においては、タスク融合の結果、“A”,“B”が1のマクロタスク(マクロタスクA+B)に融合される可能性もある。このような場合には、“C”とマクロタスクA+Bとが同一のコアに割り当てられる。   More specifically, in the above specific example, as a result of task fusion, “A” and “B” may be merged into one macro task (macro task A + B). In such a case, “C” and macrotask A + B are assigned to the same core.

また、タスク融合により、1の条件付記述に基づく処理に対応するマクロタスクの一部と、該条件付記述の前後の条件付記述に基づく処理に対応するマクロタスクの一部(又は全部)が、1つのマクロタスクに融合される場合も想定される。このような場合においても、自動並列化コンパイラ1は、スタティックスケジューリングにおいて、融合されたマクロタスクと、上記条件付記述に対応する残りのマクロタスクとを、1つのコアに割り当てる。   Also, by task fusion, a part of the macrotask corresponding to the process based on one conditional description and a part (or all) of the macrotask corresponding to the process based on the conditional description before and after the conditional description A case where it is merged into one macro task is also assumed. Even in such a case, the automatic parallelizing compiler 1 assigns the merged macrotask and the remaining macrotask corresponding to the conditional description to one core in the static scheduling.

より詳しく説明すると、上記具体例においては、タスク融合の結果、“C”,“D”が1のマクロタスク(マクロタスクC+D)に融合される可能性もある。このような場合には、“B”と“E”とマクロタスクC+Dとが同一のコアに割り当てられる。また、上記具体例において、タスク融合の結果、“C”〜“E”が1のマクロタスク(マクロタスクC+D+E)に融合される可能性もある。このような場合には、“B”とマクロタスクC+D+Eとが同一のコアに割り当てられる。   More specifically, in the above specific example, as a result of task fusion, “C” and “D” may be merged into one macro task (macro task C + D). In such a case, “B”, “E”, and macrotask C + D are assigned to the same core. In the above specific example, as a result of task fusion, “C” to “E” may be merged into one macro task (macro task C + D + E). In such a case, “B” and macrotask C + D + E are assigned to the same core.

なお、本具体例における条件付記述(“処理B,C”や“処理D,E”)は、1の引数を参照する条件付コンパイルスイッチにより、コンパイル対象とするか否かが切り替えられる2つの部分からなる一連の記述として構成されている。しかしながら、これに限らず、条件付記述は、2以上の引数を参照する条件付コンパイルスイッチにより構成されていても良いし、コンパイル対象とするか否かが切り替えられる3以上の部分から構成されていても良い。   Note that the conditional description (“process B, C” or “process D, E”) in this specific example can be switched between two types depending on whether a conditional compilation switch refers to one argument or not. It is structured as a series of descriptions consisting of parts. However, the present invention is not limited to this, and the conditional description may be configured by a conditional compile switch that refers to two or more arguments, or is configured by three or more parts that can be switched to be compiled. May be.

[効果]
本実施形態の自動並列化コンパイラ1は、条件付記述を全て含んだ状態の逐次プログラムに基づきスタティックスケジューリング等を行い、並列化プログラムを生成する。そして、条件コンパイルスイッチの引数に応じて条件付記述の中からコンパイルの対象外となる部分を並列化プログラムから除去し、入力情報に対応する種別の並列化プログラムを生成する。
[effect]
The automatic parallelizing compiler 1 according to the present embodiment performs static scheduling and the like based on a sequential program including all conditional descriptions, and generates a parallelized program. Then, according to the argument of the conditional compilation switch, a part of the conditional description that is not subject to compilation is removed from the parallelized program, and a type of parallelized program corresponding to the input information is generated.

スタティックスケジューリングが行われた段階の並列化プログラムでは、1の条件付記述に基づく各処理は、同一のPGに割り当てられる。このため、条件コンパイルスイッチの引数を設定することで仕向地等の異なる複数の種別の並列化プログラムが生成される場合であっても、各種別の並列化プログラムの共通性をより一層高めることができ、その結果、並列化プログラムの品質の維持や管理が容易になる。   In the parallelized program at the stage where static scheduling is performed, each process based on one conditional description is assigned to the same PG. For this reason, even when multiple types of parallelized programs with different destinations are generated by setting an argument of the conditional compilation switch, the commonality of various types of parallelized programs can be further enhanced. As a result, it becomes easy to maintain and manage the quality of the parallelized program.

ここで、1の条件付記述に対応する各処理を異なるPGに割り当て可能(並列化可能)である場合には、これらの処理が同一のPGに割り当てることで、並列化プログラムの性能が低下してしまう。   Here, if each process corresponding to one conditional description can be assigned to different PGs (can be parallelized), the performance of the parallelized program is reduced by assigning these processes to the same PG. End up.

これに対し、自動並列化コンパイラ1は、対応する複数のマクロタスクを並列化可能な条件付記述を特定すると共に、並列化プログラムの性能を検証する。そして、並列化プログラムの性能が一定の水準に達しない場合には、対応するマクロタスクを並列化可能な条件付記述を示すレポートを生成することで、該条件付記述をユーザに報知する。   On the other hand, the automatic parallelizing compiler 1 specifies a conditional description that can parallelize a plurality of corresponding macro tasks and verifies the performance of the parallelized program. If the performance of the parallelized program does not reach a certain level, a report indicating the conditional description that can parallelize the corresponding macrotask is generated to notify the user of the conditional description.

これにより、本実施形態の自動並列化処理を行った結果、十分な性能の並列化プログラムを得られなかった場合には、ユーザは、上記レポートに基づき、並列化プログラムの性能を向上させるための対策を講じることができる。   Thereby, as a result of performing the automatic parallel processing of the present embodiment, when a parallel program with sufficient performance cannot be obtained, the user can improve the performance of the parallel program based on the above report. Measures can be taken.

[他の実施形態]
以上、本発明の実施形態について説明したが、本発明は上記実施形態に限定されることなく、種々の形態を採り得る。
[Other Embodiments]
As mentioned above, although embodiment of this invention was described, this invention can take a various form, without being limited to the said embodiment.

(1)本実施形態の自動並列化処理では、並列化可能な条件付記述が特定される(S115)と共に、生成された並列化プログラムの性能が検証され(S120)、性能が一定の水準に達しない場合には、並列化可能な条件付記述を示すレポートが生成される(S130)。   (1) In the automatic parallelization processing of this embodiment, a conditional description that can be parallelized is specified (S115), and the performance of the generated parallelized program is verified (S120), and the performance is kept at a certain level. If not, a report indicating a conditional description that can be parallelized is generated (S130).

しかしながら、生成された並列化プログラムの性能に関わらず、並列化可能な条件付記述を示すレポートを生成するようにしても良い。このような場合であっても、ユーザは、該レポートに基づき、並列化プログラムの性能をさらに向上させるための対策を講じることができる。   However, a report indicating a conditional description that can be parallelized may be generated regardless of the performance of the generated parallelized program. Even in such a case, the user can take measures for further improving the performance of the parallelized program based on the report.

また、並列化可能な条件付記述を特定すること無く、生成された並列化プログラムの性能の検証結果を報知しても良い。こうすることにより、本実施形態の自動並列化処理によりどの程度の性能の並列化プログラムが得られたかを把握することができ、自動並列化コンパイラ1の利便性を高めることができる。   Further, the verification result of the performance of the generated parallelized program may be notified without specifying a conditional description that can be parallelized. By doing so, it is possible to grasp how much of the parallelized program has been obtained by the automatic parallelization processing of the present embodiment, and the convenience of the automatic parallelizing compiler 1 can be improved.

(2)本実施形態の自動並列化コンパイラ1は、ソフト構造解析処理のS200にて逐次プログラムのインライン展開を行うと共に、S205にてローカル変数のリネームを行うが、これらの処理の双方または一方を行わない構成としても良い。このような場合であっても、逐次プログラムの構造によっては、同様の効果が得られる。   (2) The automatic parallelizing compiler 1 of the present embodiment performs inline expansion of the sequential program in S200 of the software structure analysis process and renames local variables in S205. Both or one of these processes is performed. It is good also as a structure which does not perform. Even in such a case, the same effect can be obtained depending on the structure of the sequential program.

(3)上記実施形態における1つの構成要素が有する機能を複数の構成要素として分散させたり、複数の構成要素が有する機能を1つの構成要素に統合させたりしても良い。また、上記実施形態の構成の少なくとも一部を、同様の機能を有する公知の構成に置き換えてもよい。また、上記実施形態の構成の一部を省略してもよい。また、上記実施形態の構成の少なくとも一部を、他の上記実施形態の構成に対して付加又は置換してもよい。なお、特許請求の範囲に記載した文言のみによって特定される技術思想に含まれるあらゆる態様が本発明の実施形態である。   (3) The functions of one constituent element in the above embodiment may be distributed as a plurality of constituent elements, or the functions of a plurality of constituent elements may be integrated into one constituent element. Further, at least a part of the configuration of the above embodiment may be replaced with a known configuration having the same function. Moreover, you may abbreviate | omit a part of structure of the said embodiment. In addition, at least a part of the configuration of the above embodiment may be added to or replaced with the configuration of the other embodiment. In addition, all the aspects included in the technical idea specified only by the wording described in the claim are embodiment of this invention.

(4)上述した自動並列化コンパイラや自動並列化コンパイル装置の他、自動並列化コンパイラを記憶した媒体や、自動並列化コンパイラにより行われる処理に相当する方法等、種々の形態で本発明を実現することもできる。   (4) In addition to the above-described automatic parallelizing compiler and automatic parallelizing compiling device, the present invention is realized in various forms such as a medium storing the automatic parallelizing compiler and a method corresponding to processing performed by the automatic parallelizing compiler. You can also

[特許請求の範囲との対応]
上記実施形態の説明で用いた用語と、特許請求の範囲の記載に用いた用語との対応を示す。
[Correspondence with Claims]
The correspondence between the terms used in the description of the above embodiment and the terms used in the description of the claims is shown.

自動並列化コンパイラ1が並列化コンパイラの一例に、車載装置20が電子装置の一例に相当する。
また、PGや、具体例におけるPE(第1,第2コア)が、プロセッサユニットの一例に相当する。
The automatic parallelizing compiler 1 corresponds to an example of a parallelizing compiler, and the in-vehicle device 20 corresponds to an example of an electronic device.
PG and PE (first and second cores) in the specific example correspond to an example of a processor unit.

また、自動並列化処理のS110が、スケジューリング手順,スケジューリング手段の一例に、S120が検証手順,検証手段の一例に、S130が報知手順,報知手段の一例に相当する。   Further, S110 of the automatic parallel processing corresponds to an example of a scheduling procedure and a scheduling unit, S120 corresponds to an example of a verification procedure and a verification unit, and S130 corresponds to an example of a notification procedure and a notification unit.

また、ソフト構造解析処理のS210が、分割手順,分割手段の一例に、S220が、抽出手順,抽出手段の一例に相当する。
また、条件コンパイルスイッチの引数の値が、入力情報の一例に相当する。
Further, S210 of the software structure analysis process corresponds to an example of a dividing procedure and dividing means, and S220 corresponds to an example of an extracting procedure and extracting means.
The value of the argument of the conditional compilation switch corresponds to an example of input information.

1…自動並列化コンパイラ、10…PC、11…ディスプレイ、12…HDD、13…CPU、14…ROM、15…RAM、16…入力装置、17…読取部、18…記憶媒体、20…車載装置、21…マルチコアプロセッサ、21a…ROM、21b…RAM、21c,21d…プロセッサエレメント(PE)、22…通信部、23…センサ部、24…入出力ポート。   DESCRIPTION OF SYMBOLS 1 ... Automatic parallelizing compiler, 10 ... PC, 11 ... Display, 12 ... HDD, 13 ... CPU, 14 ... ROM, 15 ... RAM, 16 ... Input device, 17 ... Reading part, 18 ... Storage medium, 20 ... In-vehicle device 21 ... multi-core processor, 21a ... ROM, 21b ... RAM, 21c, 21d ... processor element (PE), 22 ... communication unit, 23 ... sensor unit, 24 ... input / output port.

Claims (6)

シングルプロセッサシステムにより実行されるプログラムであって、条件付コンパイルにより入力情報に応じてコンパイル対象とするか否かが切り替えられる複数の部分から構成される一連の記述である条件付記述が含まれている逐次プログラムに記述された処理を、前記入力情報に関わらず複数のマクロタスクに分割する分割手順と(S210)、
前記マクロタスク間のデータ依存性に基づき、マルチプロセッサシステムを構成する複数のプロセッサユニットにより並列実行可能な前記マクロタスクを抽出する抽出手順と(S220)、
それぞれの前記マクロタスクをいずれかの前記プロセッサユニットに割り当てる処理であって、並列実行可能な前記マクロタスクのうちの全部又は一部を、異なる前記プロセッサユニットに割り当て、前記マルチプロセッサシステムにより実行される並列化プログラムを生成するスケジューリング手順と(S110)、を備え、
前記スケジューリング手順において、1の前記条件付記述に基づく処理に対応する複数の前記マクロタスクを、同一の前記プロセッサユニットに割り当てること、
を特徴とする並列化コンパイル方法。
A program that is executed by a single processor system and includes a conditional description that is a series of descriptions composed of a plurality of parts that are switched depending on input information by conditional compilation. A division procedure for dividing the process described in the sequential program into a plurality of macro tasks regardless of the input information (S210);
An extraction procedure for extracting the macrotasks that can be executed in parallel by a plurality of processor units constituting a multiprocessor system based on the data dependency between the macrotasks (S220);
A process of assigning each of the macrotasks to any one of the processor units, wherein all or part of the macrotasks that can be executed in parallel are assigned to different processor units and executed by the multiprocessor system. A scheduling procedure for generating a parallelized program (S110),
Assigning a plurality of macrotasks corresponding to processing based on one conditional description to the same processor unit in the scheduling procedure;
Parallelizing compilation method characterized by
請求項1に記載の並列化コンパイル方法において、
異なる前記プロセッサユニットに割り当て可能な複数の前記マクロタスクに対応する処理に係る前記条件付記述に関する報知を行う報知手順(S130)をさらに備えること、
を特徴とする並列化コンパイル方法。
In the parallel compilation method according to claim 1,
A notification procedure (S130) for performing notification regarding the conditional description relating to processing corresponding to the plurality of macro tasks that can be allocated to the different processor units;
Parallelizing compilation method characterized by
請求項1又は請求項2に記載の並列化コンパイル方法において、
前記並列化プログラムの性能を検証する検証手順(S120)をさらに備えること、
を特徴とする並列化コンパイル方法。
In the parallel compilation method according to claim 1 or 2,
A verification procedure (S120) for verifying the performance of the parallelized program;
Parallelizing compilation method characterized by
請求項1から請求項3のうちのいずれか1項に記載の並列化コンパイル方法において、
前記並列化プログラムの性能を検証する検証手順(S120)と、
前記検証手順での検証結果から前記並列化プログラムの性能が一定の水準に達しない場合には、異なる前記プロセッサユニットに割り当て可能な複数の前記マクロタスクに対応する処理に係る前記条件付記述に関する報知を行う報知手順(S130)と、
をさらに備えることを特徴とする並列化コンパイル方法。
In the parallel compilation method according to any one of claims 1 to 3,
A verification procedure (S120) for verifying the performance of the parallelized program;
When the performance of the parallelized program does not reach a certain level from the verification result in the verification procedure, notification regarding the conditional description related to the processing corresponding to the plurality of macrotasks that can be allocated to the different processor units A notification procedure (S130) for performing
A parallel compilation method, further comprising:
シングルプロセッサシステムにより実行されるプログラムであって、条件付コンパイルにより入力情報に応じてコンパイル対象とするか否かが切り替えられる複数の部分から構成される一連の記述である条件付記述が含まれている逐次プログラムに記述された処理を、前記入力情報に関わらず複数のマクロタスクに分割する分割手段と(S210)、
前記マクロタスク間のデータ依存性に基づき、マルチプロセッサシステムを構成する複数のプロセッサユニットにより並列実行可能な前記マクロタスクを抽出する抽出手段と(S220)、
それぞれの前記マクロタスクをいずれかの前記プロセッサユニットに割り当てる処理であって、並列実行可能な前記マクロタスクのうちの全部又は一部を、異なる前記プロセッサユニットに割り当て、前記マルチプロセッサシステムにより実行される並列化プログラムを生成するスケジューリング手段として(S110)、コンピュータを動作させることを特徴とし、
前記スケジューリング手段は、1の前記条件付記述に基づく処理に対応する複数の前記マクロタスクを、同一の前記プロセッサユニットに割り当てること、
を特徴とする並列化コンパイラ(1)。
A program that is executed by a single processor system and includes a conditional description that is a series of descriptions composed of a plurality of parts that are switched depending on input information by conditional compilation. Dividing means for dividing the processing described in the sequential program into a plurality of macro tasks regardless of the input information (S210);
Extraction means for extracting the macrotask that can be executed in parallel by a plurality of processor units constituting a multiprocessor system based on data dependency between the macrotasks (S220);
A process of assigning each of the macrotasks to any one of the processor units, wherein all or part of the macrotasks that can be executed in parallel are assigned to different processor units and executed by the multiprocessor system. As a scheduling means for generating a parallelized program (S110), the computer is operated,
The scheduling means allocates a plurality of the macrotasks corresponding to processing based on the one conditional description to the same processor unit;
Parallelizing compiler (1) characterized by
シングルプロセッサシステムにより実行されるプログラムであって、条件付コンパイルにより入力情報に応じてコンパイル対象とするか否かが切り替えられる複数の部分から構成される一連の記述である条件付記述が含まれている逐次プログラムに記述された処理を、前記入力情報に関わらず複数のマクロタスクに分割する分割手順と(S210)、
前記マクロタスク間のデータ依存性に基づき、マルチプロセッサシステムを構成する複数のプロセッサユニットにより並列実行可能な前記マクロタスクを抽出する抽出手順と(S220)、
それぞれの前記マクロタスクをいずれかの前記プロセッサユニットに割り当てる処理であって、並列実行可能な前記マクロタスクのうちの全部又は一部を、異なる前記プロセッサユニットに割り当て、前記マルチプロセッサシステムにより実行される並列化プログラムを生成するスケジューリング手順と(S110)、を備え、
前記スケジューリング手順において、1の前記条件付記述に基づく処理に対応する複数の前記マクロタスクを、同一の前記プロセッサユニットに割り当てること、
を特徴とする並列化コンパイル方法により生成された前記並列化プログラムにより動作する前記マルチプロセッサシステムを備えることを特徴とする電子装置(20)。
A program that is executed by a single processor system and includes a conditional description that is a series of descriptions composed of a plurality of parts that are switched depending on input information by conditional compilation. A division procedure for dividing the process described in the sequential program into a plurality of macro tasks regardless of the input information (S210);
An extraction procedure for extracting the macrotasks that can be executed in parallel by a plurality of processor units constituting a multiprocessor system based on the data dependency between the macrotasks (S220);
A process of assigning each of the macrotasks to any one of the processor units, wherein all or part of the macrotasks that can be executed in parallel are assigned to different processor units and executed by the multiprocessor system. A scheduling procedure for generating a parallelized program (S110),
Assigning a plurality of macrotasks corresponding to processing based on one conditional description to the same processor unit in the scheduling procedure;
An electronic device (20) comprising the multiprocessor system that operates according to the parallelized program generated by the parallelized compiling method.
JP2015021112A 2015-02-05 2015-02-05 Parallelizing compilation method and parallelizing compiler Active JP6488738B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2015021112A JP6488738B2 (en) 2015-02-05 2015-02-05 Parallelizing compilation method and parallelizing compiler
DE102016201614.8A DE102016201614A1 (en) 2015-02-05 2016-02-03 Parallelization compilation method, parallelization compiler and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015021112A JP6488738B2 (en) 2015-02-05 2015-02-05 Parallelizing compilation method and parallelizing compiler

Publications (2)

Publication Number Publication Date
JP2016143377A true JP2016143377A (en) 2016-08-08
JP6488738B2 JP6488738B2 (en) 2019-03-27

Family

ID=56498722

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015021112A Active JP6488738B2 (en) 2015-02-05 2015-02-05 Parallelizing compilation method and parallelizing compiler

Country Status (2)

Country Link
JP (1) JP6488738B2 (en)
DE (1) DE102016201614A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020181407A (en) * 2019-04-25 2020-11-05 株式会社デンソー Parallelization method, semiconductor control device, and on-vehicle control device
JP7441861B2 (en) 2020-01-09 2024-03-01 日立Astemo株式会社 Arithmetic device and inspection method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02245934A (en) * 1989-03-20 1990-10-01 Fujitsu Ltd Data processor
JP2002251288A (en) * 2001-02-26 2002-09-06 Mitsubishi Electric Corp Compiling method
JP2004227500A (en) * 2003-01-27 2004-08-12 Denso Corp Code generation device, code generation program, simulator, simulation program, model generation device, and model generation program
JP2007133620A (en) * 2005-11-10 2007-05-31 Fujitsu Ltd Task distribution program and task distribution apparatus for processor apparatus having multiprocessor
JP2010262471A (en) * 2009-05-07 2010-11-18 Mitsubishi Electric Corp Parallel scheduling device
JP2015001807A (en) * 2013-06-14 2015-01-05 株式会社デンソー Parallelization compilation method, parallelization compiler, parallelization compilation device, and on-vehicle device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04177681A (en) 1990-11-13 1992-06-24 Canon Inc Tape cassette
JP4476267B2 (en) 2006-10-06 2010-06-09 株式会社日立製作所 Processor and data transfer unit
JP5224498B2 (en) 2007-02-28 2013-07-03 学校法人早稲田大学 MEMORY MANAGEMENT METHOD, INFORMATION PROCESSING DEVICE, PROGRAM CREATION METHOD, AND PROGRAM

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02245934A (en) * 1989-03-20 1990-10-01 Fujitsu Ltd Data processor
JP2002251288A (en) * 2001-02-26 2002-09-06 Mitsubishi Electric Corp Compiling method
JP2004227500A (en) * 2003-01-27 2004-08-12 Denso Corp Code generation device, code generation program, simulator, simulation program, model generation device, and model generation program
JP2007133620A (en) * 2005-11-10 2007-05-31 Fujitsu Ltd Task distribution program and task distribution apparatus for processor apparatus having multiprocessor
JP2010262471A (en) * 2009-05-07 2010-11-18 Mitsubishi Electric Corp Parallel scheduling device
JP2015001807A (en) * 2013-06-14 2015-01-05 株式会社デンソー Parallelization compilation method, parallelization compiler, parallelization compilation device, and on-vehicle device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
梅田 弾、金羽木洋平、見神広紀、林 明宏、谷 充弘、森 裕司、木村啓二、笠原博徳: "エンジン基本制御ソフトウェアモデルのマルチコア上での並列処理", 情報処理学会研究報告 2012(平成24)年度▲3▼[CD−ROM], vol. Vol.2012-ARC-201, No.22, JPN6014012891, 15 October 2012 (2012-10-15), JP, pages 1 - 7, ISSN: 0003755656 *
横山祐司、日高隆博、山本晋一郎、小林隆志、手嶋茂晴、阿草清滋: "バリエーション並行開発のための版管理ツールと統合開発環境", 情報処理学会研究報告 平成21年度▲6▼[DVD−ROM], vol. Vol.2010-SE-167,No.6, JPN6018008675, 15 April 2010 (2010-04-15), JP, pages 1 - 8, ISSN: 0003755655 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020181407A (en) * 2019-04-25 2020-11-05 株式会社デンソー Parallelization method, semiconductor control device, and on-vehicle control device
JP7107275B2 (en) 2019-04-25 2022-07-27 株式会社デンソー PARALLELIZATION METHOD, SEMICONDUCTOR CONTROL DEVICE, AND VEHICLE CONTROL DEVICE
JP7441861B2 (en) 2020-01-09 2024-03-01 日立Astemo株式会社 Arithmetic device and inspection method

Also Published As

Publication number Publication date
DE102016201614A1 (en) 2016-08-11
JP6488738B2 (en) 2019-03-27

Similar Documents

Publication Publication Date Title
JP6018022B2 (en) Parallel compilation method, parallel compiler, parallel compilation device, and in-vehicle device
JP6427054B2 (en) Parallelizing compilation method and parallelizing compiler
JP6319880B2 (en) Parallelism extraction method and program creation method
JP4784827B2 (en) Global compiler for heterogeneous multiprocessors
Hormati et al. Sponge: portable stream programming on graphics engines
Zhong et al. Uncovering hidden loop level parallelism in sequential applications
Bellens et al. CellSs: a programming model for the Cell BE architecture
US8683468B2 (en) Automatic kernel migration for heterogeneous cores
JP4936517B2 (en) Control method for heterogeneous multiprocessor system and multi-grain parallelizing compiler
US8561046B2 (en) Pipelined parallelization with localized self-helper threading
US10430191B2 (en) Methods and apparatus to compile instructions for a vector of instruction pointers processor architecture to enable speculative execution and avoid data corruption
JP6488739B2 (en) Parallelizing compilation method and parallelizing compiler
JP6427053B2 (en) Parallelizing compilation method and parallelizing compiler
JP2017228029A (en) Parallelization method, parallelization tool, on-vehicle device
JP6488738B2 (en) Parallelizing compilation method and parallelizing compiler
Mehrara et al. Multicore compilation strategies and challenges
Dubrulle et al. A low-overhead dedicated execution support for stream applications on shared-memory CMP
Chandraiah et al. Code and data structure partitioning for parallel and flexible MPSoC specification using designer-controlled recoding
Benoit et al. Using an intermediate representation to map workloads on heterogeneous parallel systems
Chandraiah et al. Designer-controlled generation of parallel and flexible heterogeneous MPSoC specification
Sura et al. Using multiple threads to accelerate single thread performance
Ying Scaling sequential code with hardware-software co-design for fine-grain speculative parallelization
Aiken et al. Modulo Scheduling
Zhou et al. Automatically Tuning Task-Based Programs for Multicore Processors
KR20130028505A (en) Reconfiguable processor, apparatus and method for converting code thereof

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170605

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20180223

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20180313

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20180424

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20181002

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20181206

A911 Transfer to examiner for re-examination before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20181214

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: 20190129

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20190211

R151 Written notification of patent or utility model registration

Ref document number: 6488738

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250