JP7333889B2 - Software design support system, software design support method and software design support program - Google Patents
Software design support system, software design support method and software design support program Download PDFInfo
- Publication number
- JP7333889B2 JP7333889B2 JP2023523250A JP2023523250A JP7333889B2 JP 7333889 B2 JP7333889 B2 JP 7333889B2 JP 2023523250 A JP2023523250 A JP 2023523250A JP 2023523250 A JP2023523250 A JP 2023523250A JP 7333889 B2 JP7333889 B2 JP 7333889B2
- Authority
- JP
- Japan
- Prior art keywords
- false
- data
- parallelization
- dependency
- structural data
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Devices For Executing Special Programs (AREA)
- Stored Programmes (AREA)
Description
本開示は、ソフトウェアの並列化を支援するための技術に関するものである。 The present disclosure relates to technology for supporting parallelization of software.
マルチコアプロセッサを用いた並列実行が性能向上に対して有望である。そのため、ソースコードを解析して自動で並列実行用のソースコードを出力する自動並列化技術が期待される。
ソースコードを解析するためのオープンソースのツールとして、コンパイラフロントエンドであるClangとコンパイラバックエンドであるLLVMといったコンパイラ基盤が知られている。Parallel execution using multi-core processors is promising for performance improvement. Therefore, an automatic parallelization technology that analyzes the source code and automatically outputs the source code for parallel execution is expected.
As open source tools for analyzing source code, compiler platforms such as Clang as a compiler front end and LLVM as a compiler back end are known.
特許文献1には、無視可能なデータ依存関係を示す無視情報から同期必須依存関係を抽出し、同期必須依存関係を有する2つの処理の同時実行を回避しつつ並列化効果を向上させる発明が記載されている。
レガシーコードと呼ばれる古くから存在するソースコードは、並列化されることを前提とした作りになっていない。また、既存の並列化コンパイラは、ソースコードの実装が正しく行われたことを前提にして、ソースコードを解析する。しかし、本質的には依存性がないデータ依存関係が実装時にソースコードに作りこまれる。そのため、本質的には依存性がないデータ依存関係が並列化の阻害要因となってしまう。 Source code that has existed for a long time, called legacy code, is not designed to be parallelized. Also, existing parallelizing compilers analyze the source code on the assumption that the source code has been correctly implemented. However, data dependencies that are essentially independent are built into the source code at implementation time. Therefore, the data dependency, which is essentially independent, becomes a hindrance to parallelization.
本開示は、本質的には依存性がないデータ依存関係を考慮してソフトウェアを並列化できるようにすることを目的とする。 The present disclosure aims to allow software to be parallelized taking into account data dependencies that are essentially independent.
本開示のソフトウェア設計支援システムは、
複数の処理ブロックを含むソースコードを解析して前記ソースコードの構造データを生成する構造解析部と、
前記構造データに基づいて、互いに影響を与えないデータ依存関係を偽依存として検出する偽依存検出部と、
前記構造データを修正することによって、検出された偽依存が解消された場合の前記ソースコードの構造データを修正済みの構造データとして生成する構造データ修正部と、
前記修正済みの構造データに基づいて前記複数の処理ブロックの並列化を実施する並列化部と、
前記並列化によって得られて前記複数の処理ブロックのスケジュールを示す並列化結果を出力する結果出力部と、を備える。The software design support system of the present disclosure is
a structural analysis unit that analyzes a source code including a plurality of processing blocks to generate structural data of the source code;
a false dependency detection unit that detects data dependencies that do not affect each other as false dependencies based on the structural data;
a structural data correction unit that generates, as corrected structural data, structural data of the source code when the detected false dependency is eliminated by correcting the structural data;
a parallelization unit that parallelizes the plurality of processing blocks based on the modified structural data;
and a result output unit for outputting a parallelization result obtained by the parallelization and indicating a schedule of the plurality of processing blocks.
本開示によれば、本質的には依存性がないデータ依存関係(偽依存)を考慮してソフトウェアを並列化することが可能になる。 According to the present disclosure, software can be parallelized taking into account data dependencies that are essentially independent (false dependencies).
実施の形態および図面において、同じ要素または対応する要素には同じ符号を付している。説明した要素と同じ符号が付された要素の説明は適宜に省略または簡略化する。図中の矢印はデータの流れ又は処理の流れを主に示している。 The same or corresponding elements are denoted by the same reference numerals in the embodiments and drawings. Descriptions of elements having the same reference numerals as those described will be omitted or simplified as appropriate. Arrows in the figure mainly indicate the flow of data or the flow of processing.
実施の形態1.
ソフトウェア設計支援システム100について、図1から図23に基づいて説明する。
A software design support system 100 will be described with reference to FIGS. 1 to 23. FIG.
***構成の説明***
図1に基づいて、ソフトウェア設計支援システム100の構成を説明する。
ソフトウェア設計支援システム100は、並列化装置200と、改修候補抽出装置300と、を備える。但し、ソフトウェア設計支援システム100は、1台の装置または3台以上の装置で実現されてもよい
並列化装置200と改修候補抽出装置300は、ネットワーク101を介して互いにデータを受け渡す。但し、データの受け渡しは人手によって行われてもよい。*** Configuration description ***
The configuration of the software design support system 100 will be described based on FIG.
A software design support system 100 includes a
図2に基づいて、並列化装置200の構成を説明する。
並列化装置200は、プロセッサ201とメモリ202と補助記憶装置203と通信装置204と入出力インタフェース205といったハードウェアを備えるコンピュータである。これらのハードウェアは、信号線を介して互いに接続されている。The configuration of the
The
プロセッサ201は、演算処理を行うICであり、他のハードウェアを制御する。例えば、プロセッサ201は、CPU、DSPまたはGPUである。
ICは、Integrated Circuitの略称である。
CPUは、Central Processing Unitの略称である。
DSPは、Digital Signal Processorの略称である。
GPUは、Graphics Processing Unitの略称である。A
IC is an abbreviation for Integrated Circuit.
CPU is an abbreviation for Central Processing Unit.
DSP is an abbreviation for Digital Signal Processor.
GPU is an abbreviation for Graphics Processing Unit.
メモリ202は揮発性または不揮発性の記憶装置である。メモリ202は、主記憶装置またはメインメモリとも呼ばれる。例えば、メモリ202はRAMである。メモリ202に記憶されたデータは必要に応じて補助記憶装置203に保存される。
RAMは、Random Access Memoryの略称である。
RAM is an abbreviation for Random Access Memory.
補助記憶装置203は不揮発性の記憶装置である。例えば、補助記憶装置203は、ROM、HDDまたはフラッシュメモリである。補助記憶装置203に記憶されたデータは必要に応じてメモリ202にロードされる。
ROMは、Read Only Memoryの略称である。
HDDは、Hard Disk Driveの略称である。
ROM is an abbreviation for Read Only Memory.
HDD is an abbreviation for Hard Disk Drive.
通信装置204はレシーバ及びトランスミッタである。例えば、通信装置204は通信チップまたはNICである。並列化装置200の通信は通信装置204を用いて行われる。
NICは、Network Interface Cardの略称である。
NIC is an abbreviation for Network Interface Card.
入出力インタフェース205は、入力装置および出力装置が接続されるポートである。例えば、入出力インタフェース205はUSB端子であり、入力装置はキーボードおよびマウスであり、出力装置はディスプレイである。並列化装置200の入出力は入出力インタフェース205を用いて行われる。
USBは、Universal Serial Busの略称である。The input/
USB is an abbreviation for Universal Serial Bus.
並列化装置200は、ソースコード受付部211と構造解析部212と修正依頼部213と並列化部214と結果出力部215といった要素を備える。これらの要素はソフトウェアで実現される。
The
補助記憶装置203には、ソースコード受付部211と構造解析部212と修正依頼部213と並列化部214と結果出力部215としてコンピュータを機能させるための並列化プログラムが記憶されている。並列化プログラムは、メモリ202にロードされて、プロセッサ201によって実行される。
補助記憶装置203には、さらに、OSが記憶されている。OSの少なくとも一部は、メモリ202にロードされて、プロセッサ201によって実行される。
プロセッサ201は、OSを実行しながら、並列化プログラムを実行する。
OSは、Operating Systemの略称である。The
The
The
OS is an abbreviation for Operating System.
並列化プログラムの入出力データは記憶部290に記憶される。
メモリ202は記憶部290として機能する。但し、補助記憶装置203、プロセッサ201内のレジスタおよびプロセッサ201内のキャッシュメモリなどの記憶装置が、メモリ202の代わりに、又は、メモリ202と共に、記憶部290として機能してもよい。Input/output data of the parallelized program are stored in the
並列化装置200は、プロセッサ201を代替する複数のプロセッサを備えてもよい。
The
図3に基づいて、改修候補抽出装置300の構成を説明する。
改修候補抽出装置300は、プロセッサ301とメモリ302と補助記憶装置303と通信装置304と入出力インタフェース305といったハードウェアを備えるコンピュータである。これらのハードウェアは、信号線を介して互いに接続されている。The configuration of the repair
The modification
プロセッサ301は、演算処理を行うICであり、他のハードウェアを制御する。例えば、プロセッサ301はCPU、DSPまたはGPUである。
メモリ302は揮発性または不揮発性の記憶装置である。メモリ302は、主記憶装置またはメインメモリとも呼ばれる。例えば、メモリ302はRAMである。メモリ302に記憶されたデータは必要に応じて補助記憶装置303に保存される。
補助記憶装置303は不揮発性の記憶装置である。例えば、補助記憶装置303は、ROM、HDDまたはフラッシュメモリである。補助記憶装置303に記憶されたデータは必要に応じてメモリ302にロードされる。
通信装置304はレシーバ及びトランスミッタである。例えば、通信装置304は通信チップまたはNICである。改修候補抽出装置300の通信は通信装置304を用いて行われる。
入出力インタフェース305は、入力装置および出力装置が接続されるポートである。例えば、入出力インタフェース305はUSB端子であり、入力装置はキーボードおよびマウスであり、出力装置はディスプレイである。改修候補抽出装置300の入出力は入出力インタフェース305を用いて行われる。A
The input/
改修候補抽出装置300は、制約受付部311と定義取得部312と偽依存検出部313と構造データ修正部314と改修候補抽出部315と改修候補出力部316といった要素を備える。これらの要素はソフトウェアで実現される。
The modification
補助記憶装置303には、制約受付部311と定義取得部312と偽依存検出部313と構造データ修正部314と改修候補抽出部315と改修候補出力部316としてコンピュータを機能させるための改修候補抽出プログラムが記憶されている。改修候補抽出プログラムは、メモリ302にロードされて、プロセッサ301によって実行される。
補助記憶装置303には、さらに、OSが記憶されている。OSの少なくとも一部は、メモリ302にロードされて、プロセッサ301によって実行される。
プロセッサ301は、OSを実行しながら、改修候補抽出プログラムを実行する。
The
The
改修候補抽出プログラムの入出力データは記憶部390に記憶される。
メモリ302は記憶部390として機能する。但し、補助記憶装置303、プロセッサ301内のレジスタおよびプロセッサ301内のキャッシュメモリなどの記憶装置が、メモリ302の代わりに、又は、メモリ302と共に、記憶部390として機能してもよい。The input/output data of the repair candidate extraction program are stored in the
改修候補抽出装置300は、プロセッサ301を代替する複数のプロセッサを備えてもよい。
The modification
図4に、ソフトウェア設計支援システム100の機能構成を示す。図中の各矢印はデータの流れ又は処理の流れを示している。
ソフトウェア設計支援システム100における各要素の動作および各データの内容について後述する。FIG. 4 shows the functional configuration of the software design support system 100. As shown in FIG. Each arrow in the figure indicates the flow of data or the flow of processing.
The operation of each element and the contents of each data in the software design support system 100 will be described later.
***動作の説明***
ソフトウェア設計支援システム100の動作の手順はソフトウェア設計支援方法に相当する。また、ソフトウェア設計支援システム100の動作の手順はソフトウェア設計支援プログラムによる処理の手順に相当する。
ソフトウェア設計支援プログラムは、並列化プログラムと改修候補抽出プログラムとを含む。ソフトウェア設計支援プログラムは、光ディスクまたはフラッシュメモリ等の不揮発性の記録媒体にコンピュータ読み取り可能に記録(格納)することができる。***Description of operation***
The operation procedure of the software design support system 100 corresponds to the software design support method. Further, the operation procedure of the software design support system 100 corresponds to the procedure of processing by the software design support program.
The software design support program includes a parallelization program and a modification candidate extraction program. The software design support program can be recorded (stored) in a computer-readable manner in a non-volatile recording medium such as an optical disc or flash memory.
図5に基づいて、ソフトウェア設計支援方法(並列化)を説明する。
ソフトウェア設計支援方法(並列化)は、ソースコード111の中の複数の処理ブロックを並列化させる方法であり、並列化装置200によって実行される。
処理ブロックは、並列に実行される最小の処理単位である。処理ブロックの具体例は関数である。A software design support method (parallelization) will be described based on FIG.
The software design support method (parallelization) is a method of parallelizing a plurality of processing blocks in the
A processing block is the smallest unit of processing that is executed in parallel. A specific example of a processing block is a function.
ステップS101において、ソースコード受付部211は、ソースコード111を受け付ける。
例えば、利用者がソースコード111を並列化装置200に入力し、ソースコード受付部211は入力されたソースコード111を受け付ける。
ソースコード111は複数の処理ブロックを含む。
少なくともいずれかの処理ブロック間には、偽依存というデータ依存関係がある。
データ依存関係は、一方の処理ブロックのデータアクセスが他方の処理ブロックのデータアクセスに影響を与える関係である。
偽依存は、偽のデータ依存関係を意味する。つまり、偽依存は、2つの処理ブロックが同じ名前のデータにアクセスするがそれぞれのデータアクセスが互いに影響を与えない関係を意味する。例えば、偽依存は、本質的にはデータ依存関係がないにも関わらず実装時にソースコード111に作りこまれる。
真のデータ依存関係を「真依存」と称する。In step S<b>101 , the source
For example, a user inputs the
There is a data dependency called false dependency between at least one of the processing blocks.
A data dependency is a relationship in which data access of one processing block affects data access of another processing block.
False dependencies refer to false data dependencies. In other words, a false dependency means that two processing blocks access data with the same name but their data accesses do not affect each other. For example, a false dependency is built into the
A true data dependency is called a "true dependency".
図6に、ソースコード111の具体例を示す。
ソースコード111は、func1()とfunc2()とfunc3()といった関数(処理ブロック)を含んでいる。ソースコード111のファイル名は「mysample1.c」である。
ソースコード111において、func1()とfunc2()の組とfunc2()とfunc3()の組とのそれぞれにWAR依存がある。WARはWrite After Readの略称である。
WAR依存は、偽依存の具体例であり、データがリードされた後に同じデータがライトされる関係を意味する。
ソースコード111において、func2()とfunc3()の組にRAW依存がある。RAWはRead After Writeの略称である。
RAW依存は、真依存の具体例であり、データがライトされた後に同じデータがリードされる関係を意味する。A specific example of the
The
In the
A WAR dependency is a specific example of a false dependency, and means a relationship in which the same data is written after the data is read.
In the
RAW dependence is a specific example of true dependence, and means a relationship in which the same data is read after data is written.
図5に戻り、ステップS102から説明を続ける。
ステップS102において、構造解析部212は、ソースコード111を解析し、ソースコード111の構造データ112を生成する。例えば、構造解析部212は、ソースコード111を入力にして、既存の解析ツールを実行する。既存の解析ツールの具体例はLLVMまたはIRと呼ばれるツールである。
構造データ112は、順序情報112Aとアクセス情報112Bを含む。
順序情報112Aは、ソースコード111の中の複数の処理ブロックの実行順序を特定する情報である。実行順序の特定には、条件分岐および繰り返しが考慮される。
アクセス情報112Bは、それぞれの処理ブロックの中のデータアクセスを特定する情報である。Returning to FIG. 5, the description continues from step S102.
In step S<b>102 , the
The
The access information 112B is information specifying data access in each processing block.
図7に、ソースコード111(図6を参照)の構造データ112を示す。
順序情報112Aは関数間の呼び出し関係を示している。関数間の呼び出し関係によって、複数の関数の実行順序が特定される。具体的には、順序情報112Aの各行は「呼び出し元関数名,呼び出し先関数名,呼び出し行番号」を示している。関数の呼び出し行番号は、ソースコード111において呼び出し先関数が呼び出し元関数を呼び出す命令が記載されている行の番号である。
アクセス情報112Bの各行は「変数名,関数名,アクセスタイプ,行番号,ファイル名」を示している。アクセスタイプはリード(r)とライト(w)といったデータアクセスの種類を示す。FIG. 7 shows
The
Each line of the access information 112B indicates "variable name, function name, access type, line number, file name". The access type indicates the type of data access such as read (r) and write (w).
図5に戻り、ステップS103から説明を続ける。
ステップS103において、修正依頼部213は、ソースコード111の構造データ112の修正を改修候補抽出装置300に依頼する。
具体的には、修正依頼部213は、ソースコード111の構造データ112を改修候補抽出装置300に受け渡す。
構造データ112の修正により、構造データ112は、偽依存が解消された場合のソースコード111の構造データ124に更新される。Returning to FIG. 5, the description continues from step S103.
In step S<b>103 , the
Specifically, the
By modifying the
ステップS104において、修正依頼部213は、構造データ124を改修候補抽出装置300から受け取る。
構造データ124は、修正済みの構造データ112である。構造データ124の形式は構造データ112の形式と同じである。In step S<b>104 , the
ステップS105において、並列化部214は、構造データ124に基づいて、ソースコード111の中の複数の処理ブロックの並列化を実施する。
例えば、並列化部214は、ソースコード111と構造データ124とを入力にして、既存の並列化ツールを実行する。In step S<b>105 , the
For example, the
そして、並列化部214は、並列化結果113を生成する。
並列化結果113は、マルチコアプロセッサに対する複数の処理ブロックの割り当てと、複数の処理ブロックのスケジュールと、を示すデータである。The
The
図8に、ソースコード111(図6を参照)の並列化結果113を示す。
並列化結果113は、処理ブロックごとに、ブロック名と割り当てコアと開始時刻と終了時刻とを示している。割り当てコアは処理ブロックが割り当てられるプロセッサコアである。開始時刻および終了時刻は処理ブロックのスケジュールを特定する。処理ブロックは、開始時刻から終了時刻まで実行される。FIG. 8 shows the
The
図9に、ソースコード111(図6を参照)の並列化の前後における3つの処理ブロックの実行タイミングを示す。
並列化前の場合、3つの処理ブロック(func1、func2、func3)が順に実行される。func1とfunc2の間に偽依存がある。また、func2とfunc3の間に真依存がある。
並列化後の場合、偽依存が解消され、2つのプロセッサコア(コア0、コア1)によって1つの処理ブロック(func1)と2つの処理ブロック(func2、func3)が並列に実行される。FIG. 9 shows execution timings of three processing blocks before and after parallelization of the source code 111 (see FIG. 6).
Before parallelization, three processing blocks (func1, func2, func3) are executed in order. There is a false dependency between func1 and func2. Also, there is a true dependency between func2 and func3.
After parallelization, false dependence is eliminated, and one processing block (func1) and two processing blocks (func2, func3) are executed in parallel by two processor cores (core0, core1).
図5に戻り、ステップS106を説明する。
ステップS106において、結果出力部215は、並列化結果113を出力する。
例えば、結果出力部215は、並列化結果113をディスプレイに表示する。また、結果出力部215は、並列化結果113を改修候補抽出装置300に受け渡す。Returning to FIG. 5, step S106 will be described.
In step S<b>106 , the
For example, the
図10に基づいて、ソフトウェア設計支援方法(偽依存)を説明する。
ソフトウェア設計支援方法(偽依存)は、偽依存が存在するソースコード111の構造データ112を偽依存が解消された場合のソースコード111の構造データ124に修正する方法であり、改修候補抽出装置300によって実行される。A software design support method (false dependence) will be described with reference to FIG.
The software design support method (false dependency) is a method of correcting the
ステップS111において、制約受付部311は、制約データ121を受け付ける。
例えば、利用者が制約データ121を改修候補抽出装置300に入力し、制約受付部311は入力された制約データ121を受け付ける。
制約データ121は、解消してはいけない偽依存を指定するためのデータである。In step S<b>111 , the
For example, the user inputs the
ステップS112において、定義取得部312は、定義データ122を取得する。
例えば、定義データ122は記憶部390に予め記憶され、定義取得部312は記憶部390から定義データ122を取得する。
定義データ122は、偽依存の定義を示す。In step S<b>112 , the
For example, the
ステップS113において、偽依存検出部313は、構造データ112を並列化装置200から受け取る。
In step S<b>113 , the false
ステップS120において、偽依存検出部313は、構造データ112を解析することによって、ソースコード111に存在する1つ以上の偽依存を検出する。
このとき、制約データ121によって指定される偽依存を除いて、定義データ122に示される定義に合う偽依存が検出される。In step S<b>120 , the
At this time, except for the false dependencies specified by the
そして、偽依存検出部313は、偽依存一覧123を生成する。
偽依存一覧123は、検出された1つ以上の偽依存を特定する情報を示すデータである。Then, the false
The
図11に、ソースコード111(図6を参照)の偽依存一覧123を示す。
偽依存一覧123は、ソースコード111に存在する複数の偽依存(WAR依存)を示している。
具体的には、偽依存一覧123は、処理ブロック組をヘッダとして示し、ヘッダの下にライトアクセスの情報を示している。
例えば、ヘッダ「func1-func2」は、リードアクセスを行う処理ブロック(func1)とライトアクセスを行う処理ブロック(func2)との組を示している。また、ヘッダ「func1-func2」の下の1つ目の行は、変数aについてfunc1とfunc2の間にWAR依存が存在し、mysample1.cの15行目で変数aのライトアクセスが実行されることを示している。
図11において、変数bに関する記載は省略している。FIG. 11 shows the
A
Specifically, the
For example, the header "func1-func2" indicates a set of a processing block (func1) for read access and a processing block (func2) for write access. Also, the first line under the header "func1-func2" indicates that there is a WAR dependency between func1 and func2 for variable a, and mysample1. The 15th line of c indicates that write access to variable a is executed.
In FIG. 11, the description regarding the variable b is omitted.
図12に基づいて、ステップS120の手順を説明する。
ステップS121において、偽依存検出部313は、アクセス情報112Bから、データを選択する。選択されたデータを「選択データ」と称する。Based on FIG. 12, the procedure of step S120 will be described.
In step S121, the false
ステップS122において、偽依存検出部313は、アクセス情報112Bから、選択データのアクセス情報を選択する。選択されるアクセス情報を「選択アクセス情報」と称する。また、選択アクセス情報が示すデータアクセスを「選択アクセス」と称する。
In step S122, the false
ステップS123において、偽依存検出部313は、順序情報112Aを参照し、選択アクセスを実行する処理ブロックの次の処理ブロックを判定する。
次に、偽依存検出部313は、次の処理ブロックによる選択データへのアクセスを示すアクセス情報をアクセス情報112Bから抽出する。抽出されるアクセス情報を「次アクセス情報」と称する。また、次アクセス情報が示すデータアクセスを「次アクセス」と称する。
そして、偽依存検出部313は、選択アクセス情報と次アクセス情報を比較し、選択アクセスと次アクセスが偽依存であるか判定する。
選択アクセス情報のアクセスタイプがリード(r)であり、次アクセス情報のアクセスタイプがライト(w)であれば、選択アクセスと次アクセスは偽依存(WAR依存)である。
選択アクセスと次アクセスが偽依存である場合、処理はステップS124に進む。
選択アクセスと次アクセスが偽依存でない場合、処理はステップS125に進む。In step S123, the false
Next, the false
Then, the false
If the access type of the selected access information is read (r) and the access type of the next access information is write (w), the selected access and the next access are false dependent (WAR dependent).
If the selected access and the next access are false dependencies, the process proceeds to step S124.
If the selected access and the next access are not false dependencies, the process proceeds to step S125.
ステップS124において、偽依存検出部313は、選択アクセスと次アクセスの偽依存を特定する情報を偽依存一覧123に登録する。
具体的には、偽依存検出部313は、処理ブロック組(ヘッダ)が偽依存一覧123に記載されていなければ処理ブロック組を偽依存一覧123に記載する。また、偽依存検出部313は、次アクセス情報(ライトアクセス情報)を偽依存一覧123に記載する。In step S<b>124 , the false
Specifically, the false
ステップS125において、偽依存検出部313は、選択データの未選択のアクセス情報があるか判定する。
選択データの未選択のアクセス情報がある場合、処理はステップS122に進む。
選択データの未選択のアクセス情報がない場合、処理はステップS126に進む。In step S125, the false
If there is unselected access information for the selected data, the process proceeds to step S122.
If there is no unselected access information for selected data, the process proceeds to step S126.
ステップS126において、偽依存検出部313は、未選択のデータがあるか判定する。
未選択のデータがある場合、処理はステップS121に進む。
未選択のデータがない場合、処理は終了する。In step S126, the false
If there is unselected data, the process proceeds to step S121.
If there are no unselected data, the process ends.
図10に戻り、ステップS130から説明を続ける。
ステップS130において、構造データ修正部314は、偽依存一覧123に基づいて構造データ112を修正することによって、構造データ124を生成する。
構造データ124は、修正済みの構造データ112である。Returning to FIG. 10, the description continues from step S130.
In step S<b>130 , the structural
図13に、構造データ112(図7を参照)を修正して得られる構造データ124を示す。
構造データ124は、順序情報124Aとアクセス情報124Bを含む。
順序情報124Aは、順序情報112A(図7を参照)と同じである。
アクセス情報124Bは、修正済みのアクセス情報112B(図7を参照)である。
WAR依存は、リネームによって解消される。つまり、WAR依存は、データ名(変数名)を変更することによって解消される。
アクセス情報124Bにおいて、func2とfunc3のそれぞれのアクセス情報において変数aおよび変数cがリネームされている。
図13において、変数bに関する記載は省略している。FIG. 13 shows
Order information 124A is the same as
Access information 124B is modified access information 112B (see FIG. 7).
WAR dependencies are resolved by renaming. In other words, WAR dependency is resolved by changing the data name (variable name).
In the access information 124B, the variables a and c are renamed in the access information of func2 and func3.
In FIG. 13, the description of the variable b is omitted.
図14に基づいて、ステップS130の手順を説明する。
ステップS131において、構造データ修正部314は、偽依存一覧123から偽依存を選択する。Based on FIG. 14, the procedure of step S130 will be described.
In step S<b>131 , the structural
ステップS132において、構造データ修正部314は、選択された偽依存に対応するアクセス情報を構造データ112から抽出し、抽出されたアクセス情報を選択された偽依存が解消されるように修正する。
具体的には、構造データ修正部314は、選択された偽依存(WAR依存)のライトアクセスに対応するライトアクセス情報を構造データ112から抽出し、抽出されたアクセス情報の中のデータ名をリネームする。例えば、データ名の末尾が数字であれば、構造データ修正部314は、その数字を1増やした値に変更する。また、データ名の末尾が数字でなければ、構造データ修正部314は、データ名の末尾に数字(例えば“1”)を付加する。In step S132, the structural
Specifically, the structure
ステップS133において、構造データ修正部314は、未選択の偽依存があるか判定する。
未選択の偽依存がある場合、処理はステップS131に進む。
未選択の偽依存がない場合、処理は終了する。In step S133, the structural
If there are unselected false dependencies, the process proceeds to step S131.
If there are no unselected false dependencies, processing ends.
図10に戻り、ステップS141を説明する。
ステップS141において、構造データ修正部314は、構造データ124を並列化装置200に受け渡す。Returning to FIG. 10, step S141 will be described.
In step S<b>141 , the structural
図15に基づいて、ソフトウェア設計支援方法(改修候補)を説明する。
ソフトウェア設計支援方法(改修候補)は、偽依存一覧123から改修候補を抽出する方法であり、改修候補抽出装置300によって実行される。
改修候補は、並列化結果113に示されるスケジュール通りに複数の処理ブロックを実行するために改修が必要な偽依存である。Based on FIG. 15, the software design support method (repair candidate) will be described.
The software design support method (modification candidate) is a method for extracting modification candidates from the
Modification candidates are false dependencies that require modification in order to execute multiple processing blocks according to the schedule shown in the
ステップS151において、改修候補抽出部315は、並列化結果113を並列化装置200から受け取る。
In step S<b>151 , the modification
ステップS160において、改修候補抽出部315は、並列化結果113に示される複数の処理ブロックのスケジュールに基づいて、改修候補となる偽依存を偽依存一覧123から抽出する。
In step S<b>160 , the modification
そして、改修候補抽出部315は、改修候補データ125を生成する。
改修候補データ125は、改修候補となる偽依存についての情報を示すデータである。Then, the modification
The
図16に、改修候補データ125の具体例を示す。
改修候補データ125は、改修候補となる偽依存(WAR依存)と、偽依存の解消方法(リネーム)と、を示している。FIG. 16 shows a specific example of the
The
図17に基づいて、ステップS160の手順を説明する。
ステップS161において、改修候補抽出部315は、並列化結果113から処理ブロック組を選択する。処理ブロック組は2つの処理ブロックである。
処理ブロック組において、開始時刻が早い方の処理ブロックを「先行ブロック」と称し、開始時刻が遅い方の処理ブロックを「後行ブロック」と称する。Based on FIG. 17, the procedure of step S160 will be described.
In step S<b>161 , the modification
In the processing block set, the processing block with the earlier start time is called the "preceding block", and the processing block with the later start time is called the "following block".
ステップS162において、改修候補抽出部315は、並列化結果113を参照し、先行ブロックの終了前に後行ブロックが開始されるか判定する。
具体的には、改修候補抽出部315は、先行ブロックの終了時刻と後行ブロックの開始時刻を比較する。そして、改修候補抽出部315は、後行ブロックの開始時刻が先行ブロックの終了時刻より先であるか判定する。
先行ブロックの終了前に後行ブロックが開始される場合、処理はステップS163に進む。
先行ブロックの終了前に後行ブロックが開始されない場合、処理はステップS164に進む。In step S162, the modification
Specifically, the modification
If the succeeding block begins before the preceding block ends, processing proceeds to step S163.
If the succeeding block does not begin before the preceding block ends, processing proceeds to step S164.
ステップS163において、改修候補抽出部315は、先行ブロックと後行ブロックの組の偽依存を偽依存一覧123から抽出する。
そして、改修候補抽出部315は、抽出された偽依存の情報を改修候補データ125に登録する。In step S<b>163 , the modification
Then, the modification
ステップS164において、改修候補抽出部315は、未選択のブロック組があるか判定する。
未選択のブロック組がある場合、処理はステップS161に進む。
未選択のブロック組がない場合、処理は終了する。In step S164, the modification
If there is an unselected block set, the process proceeds to step S161.
If there is no unselected block set, the process ends.
図15に戻り、ステップS171を説明する。
ステップS171において、改修候補出力部316は、改修候補データ125を出力する。
例えば、改修候補出力部316は、改修候補データ125をディスプレイに表示する。Returning to FIG. 15, step S171 will be described.
In step S<b>171 , the modification
For example, the repair
図18に基づいて、WAR依存について補足する。
WAR依存は、[元コード]のように変数を使いまわすようなプログラムによくみられる。
[元コード]において、変数valに対する処理(A)のreadと変数valに対する処理(B)のwriteとの間にWAR依存が成り立っている。
[並列化修正後コード]のように処理(A)と処理(B)の少なくとも一方の変数valを別名の変数val2にリネームすることで、[元コード]のWAR依存は解消される。Based on FIG. 18, the WAR dependence is supplemented.
WAR dependency is often seen in programs like [original code] that reuse variables.
In [original code], WAR dependency is established between the read of the process (A) for the variable val and the write of the process (B) for the variable val.
By renaming the variable val of at least one of process (A) and process (B) to the alias variable val2 as in [parallelization corrected code], the [original code] is free from WAR dependency.
***実施の形態1の効果***
実施の形態1は、アイデア(1)およびアイデア(2)により、偽依存を解消して並列化の性能を向上させることができる。
アイデア(1)は、ソースコードに存在する偽依存を抽出して解消することである。ソフトウェア設計支援システム100は、コンパイラフロントエンドのようなS/W構造解析ツールを用いてソースコードのS/W構造情報を抽出し、そのS/W構造情報をもとに偽依存を抽出する。次に、ソフトウェア設計支援システム100は、抽出した偽依存が解消されるようにS/W構造情報を修正し、そのS/W構造情報をもとに並列化を行う。そして、ソフトウェア設計支援システム100は、偽依存が解消された場合の最適な並列化結果を出力する。「S/W」はソフトウェアを意味する。
アイデア(2)は、並列化結果が示す並列実行のために必要十分な解消すべき偽依存を抽出し、抽出した偽依存を偽依存改修候補として出力することである。ソフトウェア設計支援システム100は、アイデア(1)の並列化結果が示す並列実行を行うために必要十分な解消すべき偽依存を抽出し、抽出した偽依存を偽依存改修候補として提示する。偽依存を解消していいかどうかを解析対象としたソースコードの解析だけで判断することは困難であり、S/W(解析対象を除く)およびH/Wによるデータアクセスの有無などを考慮して設計者が判断する必要がある。そのため、偽依存改修候補が提示される。また、アイデア(1)の並列化結果が示す並列実行を行うためには必ずしも全ての偽依存の解消が必要ではない。そのため、偽依存改修候補となる偽依存が必要十分な解消すべき偽依存に絞り込まれる。これにより、設計者に強いる判断の量を減らす効果が得られる。*** Effect of
According to idea (1) and idea (2), the first embodiment can eliminate false dependencies and improve parallelization performance.
Idea (1) is to extract and resolve false dependencies that exist in the source code. The software design support system 100 extracts source code S/W structure information using a S/W structure analysis tool such as a compiler front end, and extracts false dependencies based on the S/W structure information. Next, the software design support system 100 corrects the S/W structure information so as to eliminate the extracted false dependence, and parallelizes based on the S/W structure information. Then, the software design support system 100 outputs the optimum parallelization result when the false dependence is resolved. "S/W" means software.
Idea (2) is to extract necessary and sufficient false dependencies to be resolved for parallel execution indicated by the parallelization result, and to output the extracted false dependencies as false dependency repair candidates. The software design support system 100 extracts necessary and sufficient false dependencies to be resolved for parallel execution indicated by the parallelization result of idea (1), and presents the extracted false dependencies as false dependency correction candidates. It is difficult to judge whether or not false dependencies can be resolved only by analyzing the source code that is the target of analysis. Designers have to decide. Therefore, false dependency modification candidates are presented. Moreover, it is not always necessary to eliminate all false dependencies in order to perform parallel execution indicated by the parallelization result of idea (1). Therefore, false dependencies that are candidates for false dependency repair are narrowed down to necessary and sufficient false dependencies that should be eliminated. This has the effect of reducing the amount of judgment imposed on the designer.
図19は、従来技術による並列化の前後のスケジュールを示している。
従来技術では、偽依存が真依存と判断される。そのため、細かい粒度での並列化が行われた場合でも図19に示すような並列化結果が得られる。つまり、ブロックAとブロックBの間に偽依存があるため、ブロックBの実行は、ブロックAの中の偽依存に関わる処理の実行が終わった後に開始される。なお、細かい粒度での並列化は、タスクのような大きなプログラムの塊を処理単位とした並列化ではなく、関数または命令群のような小さなプログラムの塊を処理単位とする精密な並列化を意味する。
図20は、実施の形態1による並列化の前後のスケジュールを示している。
実施の形態1では、アイデア(1)により、図20に示すような並列化結果が得られる。つまり、ブロックAとブロックBの間に真依存がないため、ブロックAとブロックBが並列に実行される。また、アイデア(2)により、並列化結果が示す並列実行を行うために解消が必要な偽依存が偽依存改修候補として出力される。図20の場合、並列化結果が示す並列実行を実現するためには、ブロックAとブロックBの間の偽依存を解消する必要がある。そのため、ブロックAとブロックBの間の偽依存が偽依存改修候補として提示される。設計者は、並列化結果および偽依存改修候補を確認し、解消して問題ない偽依存についてソースコードに対して偽依存を解消するための措置を講じる。これにより、偽依存が排除されたソースコードを作成することが可能になる。そして、偽依存が排除されたソースコードを従来の並列化コンパイラの入力にすることで、図20に示すような並列化結果が実現される。また、設計者が解消して問題がある偽依存を並列実行制約として指定し、再度偽依存の解析および並列化結果の出力が行われることで、制約の範囲内で並列化結果および偽依存改修候補が得られる。FIG. 19 shows the schedule before and after parallelization according to the prior art.
In the prior art, false dependence is determined to be true dependence. Therefore, even when parallelization is performed with a fine granularity, a parallelization result as shown in FIG. 19 can be obtained. That is, since there is a false dependency between block A and block B, the execution of block B is started after execution of processing relating to the false dependency in block A is finished. Note that fine-grained parallelization means precise parallelization that uses small program blocks such as functions or instruction groups as processing units, rather than parallelization that uses large program blocks such as tasks as processing units. do.
FIG. 20 shows schedules before and after parallelization according to the first embodiment.
In the first embodiment, idea (1) yields a parallelization result as shown in FIG. That is, since there is no true dependency between block A and block B, block A and block B are executed in parallel. Also, according to the idea (2), false dependencies that need to be eliminated for parallel execution indicated by the parallelization result are output as false dependency repair candidates. In the case of FIG. 20, in order to realize the parallel execution indicated by the parallelization result, it is necessary to eliminate the false dependency between block A and block B. FIG. Therefore, the false dependency between block A and block B is presented as a false dependency repair candidate. The designer confirms the parallelization result and the false dependency repair candidate, and takes measures to eliminate the false dependency in the source code for the false dependency that can be resolved without any problem. This makes it possible to create source code from which false dependencies are eliminated. Then, by inputting the source code from which false dependencies have been eliminated to a conventional parallelizing compiler, a parallelization result as shown in FIG. 20 is realized. In addition, the designer designates a false dependency that has been resolved and has a problem as a parallel execution constraint, and by analyzing the false dependency again and outputting the parallelization result, the parallelization result and the false dependency repair are performed within the constraints. Candidates are obtained.
図21は、実施の形態1による並列化の前後のスケジュールを示している。ブロックAとブロックBの組とブロックBとブロックCの組とのそれぞれに偽依存がある。
実施の形態1では、アイデア(1)により、図20に示すような並列化結果が得られる。つまり、一方のプロセッサコアにブロックAが割り当てられ、他方のプロセッサコアにブロックBとブロックCが割り当てられ、ブロックBとブロックCがブロックAと並列に実行される、という最適なスケジューリングが実現される。また、アイデア(2)により、並列化結果が示す並列実行を行うために解消が必要な偽依存が偽依存改修候補として出力される。図21の場合、並列化結果が示す並列実行を実現するためには、ブロックAとブロックBの間の偽依存を解消する必要がある。ブロックBとブロックCの間の偽依存を解消する必要はない。そのため、ブロックAとブロックBの間の偽依存が偽依存改修候補として提示される。つまり、2つの偽依存を解消して最適な並列化結果が得られ、最適な並列化結果が示す並列実行を実現するために1つの偽依存の改修が必要である。そのため、1つの偽依存が偽依存改修候補として提示される。FIG. 21 shows the schedule before and after parallelization according to the first embodiment. There is a false dependency in each of the sets of blocks A and B and the sets of blocks B and C.
In the first embodiment, idea (1) yields a parallelization result as shown in FIG. In other words, optimal scheduling is realized such that block A is assigned to one processor core, block B and block C are assigned to the other processor core, and block B and block C are executed in parallel with block A. . Also, according to the idea (2), false dependencies that need to be eliminated for parallel execution indicated by the parallelization result are output as false dependency repair candidates. In the case of FIG. 21, in order to realize the parallel execution indicated by the parallelization result, it is necessary to eliminate the false dependency between block A and block B. FIG. There is no need to resolve the false dependency between block B and block C. Therefore, the false dependency between block A and block B is presented as a false dependency repair candidate. In other words, it is necessary to correct one false dependency in order to eliminate two false dependencies to obtain an optimal parallelization result and to realize parallel execution indicated by the optimal parallelization result. Therefore, one false dependency is presented as a false dependency repair candidate.
従来技術では、偽依存に関わる並列性を抽出できなかった。一方、実施の形態1は、アイデア(1)により、偽依存を解消できる。そのため、より多くの並列性を抽出することができる。また、アイデア(1)だけでは、自動で解消した全ての偽依存についてソースコードを改修して問題ないかを人手で判断しなくてはならない。しかし、実施の形態1は、アイデア(2)により、並列化結果が示す並列実行を行うために必要十分な解消すべき偽依存が抽出される。そのため、ソースコードを改修して問題ないかについて人手による判断の量を削減することができる。 In the prior art, parallelism related to false dependence could not be extracted. On the other hand, according to the first embodiment, idea (1) can eliminate false dependence. Therefore, more parallelism can be extracted. Also, with idea (1) alone, it is necessary to manually determine whether or not there is a problem by modifying the source code for all automatically resolved false dependencies. However, according to idea (2), the first embodiment extracts necessary and sufficient false dependencies to be resolved in order to perform parallel execution indicated by the parallelization result. Therefore, it is possible to reduce the amount of manual judgment as to whether there is a problem by modifying the source code.
***実施の形態1の実施例***
WAR依存以外の偽依存の具体例を説明する。
***実施例1***
WAW依存は、偽依存の具体例であり、データがライトされた後に同じデータがライトされる関係を意味する。WAWは、Write After Writeの略称である。
偽依存検出部313は、偽依存の一つとしてWAW依存を抽出する(ステップS120)。具体的には、選択アクセス情報のアクセスタイプがライト(w)であり、次アクセス情報のアクセスタイプがライト(w)である場合、偽依存検出部313は、選択アクセスと次アクセスが偽依存(WAW依存)であると判定する(ステップS123)。
構造データ修正部314は、WAW依存が解消されるように、構造データ112のアクセス情報を修正する(ステップS132)。
WAW依存は、WAR依存と同じく、少なくとも一方の変数をリネーム(複製)することによって解消される。*** Example of
A specific example of false dependence other than WAR dependence will be described.
***Example 1***
A WAW dependency is a specific example of a false dependency, and means a relationship in which the same data is written after the data is written. WAW is an abbreviation for Write After Write.
The
The structural
WAW dependence can be resolved by renaming (duplicating) at least one variable, like WAR dependence.
***実施例2***
スコープ変数依存は、偽依存の具体例であり、互いに異なるスコープが決められて同じ名前を有する複数の変数に対するアクセスを意味する。
スコープが決められた変数を「スコープ変数」と称する。スコープ変数の具体例は、static変数である。
スコープ変数依存は、ソースコードには依存として存在しないにも関わらず、依存として存在する、と並列化の際に誤って解析される。
変数のスコープを関数内(またはファイル内)に限定し、他の関数(または他のファイル)に設けられる変数と同一の変数名の変数を各関数(または各ファイル)に設けることが可能である。並列化では、これらの変数が同一の変数であると誤って解析される可能性がある。このように、並列化の際に別々の変数が同一の変数であると誤って解析されてしまうケースに対しても、構造データ112を修正することによって、並列化の際に誤解析がなされないようにすることができる。
偽依存検出部313は、偽依存の一つとしてスコープ変数依存を抽出する(ステップS120)。
構造データ修正部314は、スコープ変数依存が解消されるように、構造データ112のアクセス情報を修正する(ステップS132)。
スコープ変数依存は、WAR依存と同じく、少なくとも一方の変数をリネーム(複製)することによって解消される。***Example 2***
A scoped variable dependency is a specific example of a false dependency, meaning access to multiple variables with the same name but with different scopes.
A variable whose scope is determined is called a "scope variable". A specific example of a scope variable is a static variable.
Scope variable dependencies are erroneously parsed during parallelization to exist as dependencies, even though they do not exist as dependencies in the source code.
It is possible to limit the scope of variables within a function (or within a file), and to provide variables with the same variable name as variables provided in other functions (or other files) in each function (or each file). . Parallelization may incorrectly parse these variables as being the same variable. In this way, even in cases where different variables are erroneously analyzed as the same variable during parallelization, by correcting the
The false
The structural
Scope variable dependencies are resolved by renaming (duplicating) at least one variable, similar to WAR dependencies.
***実施例3***
外部宣言依存は、偽依存の具体例であり、互いに異なる外部ファイルで宣言されて同じ名前を有する複数の変数に対するアクセスを意味する。外部ファイルの具体例はライブラリである。例えば、C言語の外部ファイルでは、変数がextern宣言される。
外部宣言依存は、ソースコードには依存として存在しないにも関わらず、依存として存在する、と並列化の際に誤って解析される。
同一の変数名の変数が異なるファイルで使用され各変数が異なる外部ファイルで宣言されている場合、並列化では、これらの変数が同一の変数であると誤って解析される可能性がある。このように、並列化の際に別々の変数が同一の変数であると誤って解析されてしまうケースに対しても、構造データ112を修正することによって、並列化の際に誤解析がなされないようにすることができる。
構造データ修正部314は、外部宣言依存が解消されるように、構造データ112のアクセス情報を修正する(ステップS132)。
外部宣言依存は、WAR依存と同じく、少なくとも一方の変数をリネーム(複製)することによって解消される。***Example 3***
An externally declared dependency is a specific example of a false dependency, meaning access to multiple variables with the same name declared in different external files. A specific example of an external file is a library. For example, in a C language external file, variables are declared extern.
Externally declared dependencies are erroneously parsed during parallelization to exist as dependencies, even though they do not exist as dependencies in the source code.
If variables with the same variable name are used in different files and each variable is declared in a different external file, parallelization can incorrectly parse these variables as being the same variable. In this way, even in cases where different variables are erroneously analyzed as the same variable during parallelization, by correcting the
The structural
An external declaration dependency is resolved by renaming (duplicating) at least one variable, like a WAR dependency.
実施の形態2.
解消すべき偽依存の解消後の並列化結果を得る形態について、主に実施の形態1と異なる点を図22から図24に基づいて説明する。
A mode for obtaining a parallelization result after elimination of false dependencies to be eliminated will be described mainly with reference to FIGS. 22 to 24 for differences from the first embodiment.
***構成の説明***
ソフトウェア設計支援システム100は、さらに、偽依存改修装置400を備える。*** Configuration description ***
The software design support system 100 further comprises a false
図22に基づいて、偽依存改修装置400の構成を説明する。
偽依存改修装置400は、プロセッサ401とメモリ402と補助記憶装置403と通信装置404と入出力インタフェース405といったハードウェアを備えるコンピュータである。これらのハードウェアは、信号線を介して互いに接続されている。Based on FIG. 22, the configuration of the false
False
プロセッサ401は、演算処理を行うICであり、他のハードウェアを制御する。例えば、プロセッサ401はCPU、DSPまたはGPUである。
メモリ402は揮発性または不揮発性の記憶装置である。メモリ402は、主記憶装置またはメインメモリとも呼ばれる。例えば、メモリ402はRAMである。メモリ402に記憶されたデータは必要に応じて補助記憶装置403に保存される。
補助記憶装置403は不揮発性の記憶装置である。例えば、補助記憶装置403は、ROM、HDDまたはフラッシュメモリである。補助記憶装置403に記憶されたデータは必要に応じてメモリ402にロードされる。
通信装置404はレシーバ及びトランスミッタである。例えば、通信装置404は通信チップまたはNICである。偽依存改修装置400の通信は通信装置404を用いて行われる。
入出力インタフェース405は、入力装置および出力装置が接続されるポートである。例えば、入出力インタフェース405はUSB端子であり、入力装置はキーボードおよびマウスであり、出力装置はディスプレイである。偽依存改修装置400の入出力は入出力インタフェース405を用いて行われる。A
The input/
偽依存改修装置400は、偽依存受付部411と偽依存解析部412と構造データ再修正部413といった要素を備える。これらの要素はソフトウェアで実現される。
The false
補助記憶装置403には、偽依存受付部411と偽依存解析部412と構造データ再修正部413としてコンピュータを機能させるための偽依存改修プログラムが記憶されている。偽依存改修プログラムは、メモリ402にロードされて、プロセッサ401によって実行される。
補助記憶装置403には、さらに、OSが記憶されている。OSの少なくとも一部は、メモリ402にロードされて、プロセッサ401によって実行される。
プロセッサ401は、OSを実行しながら、偽依存改修プログラムを実行する。The
The
The
偽依存改修プログラムの入出力データは記憶部490に記憶される。
メモリ402は記憶部490として機能する。但し、補助記憶装置403、プロセッサ401内のレジスタおよびプロセッサ401内のキャッシュメモリなどの記憶装置が、メモリ402の代わりに、又は、メモリ402と共に、記憶部490として機能してもよい。The input/output data of the false dependency repair program are stored in the
偽依存改修装置400は、プロセッサ401を代替する複数のプロセッサを備えてもよい。
False
偽依存改修プログラムは、ソフトウェア設計支援プログラムに含まれる。 The false dependency repair program is included in the software design support program.
図23に、ソフトウェア設計支援システム100の機能構成を示す。改修候補抽出装置300の機能構成の図示は省略している。
ソフトウェア設計支援システム100における各要素の動作および各データの内容について後述する。FIG. 23 shows the functional configuration of the software design support system 100. As shown in FIG. Illustration of the functional configuration of the repair
The operation of each element and the contents of each data in the software design support system 100 will be described later.
***動作の説明***
図24に基づいて、ソフトウェア設計支援方法(改修)を説明する。
ソフトウェア設計支援方法(改修)は、解消すべき偽依存を解消して並列化結果を得る方法であり、偽依存改修装置400と並列化装置200によって実行される。***Description of operation***
Based on FIG. 24, the software design support method (improvement) will be described.
The software design support method (modification) is a method of obtaining a parallelization result by resolving false dependencies to be resolved, and is executed by the false
ステップS181において、偽依存受付部411は、偽依存データ131を受け付ける。
偽依存データ131は、実施の形態1の改修候補データ125に相当する。具体的には、偽依存データ131は、改修候補データ125に示される偽依存のうち利用者が改修してよいと判断した偽依存について、偽依存と偽依存の解消方法とを示す。In step S<b>181 , the false
The
ステップS182において、偽依存解析部412は、実施の形態1の構造データ112を受け付ける。
In step S182, false
ステップS183において、偽依存解析部412は、偽依存データ131と構造データ112を解析することによって、偽依存一覧132を生成する。
偽依存一覧132の生成方法は、実施の形態1における偽依存一覧123の生成方法と同じである。偽依存一覧132の形式は、実施の形態1における偽依存一覧123の形式と同じである。
但し、偽依存一覧132には、偽依存データ131に示される各偽依存についてのみ、各偽依存を特定する情報が登録される。In step S<b>183 , the false
The method for generating the
However, in the
ステップS184において、構造データ再修正部413は、偽依存一覧132に基づいて構造データ112を修正することによって、構造データ133を生成する。
構造データ133は、再修正済みの構造データ112である。
構造データ133の生成方法は、実施の形態1における構造データ124の生成方法と同じである。In step S<b>184 , the structural
A method for generating the
ステップS185において、構造データ再修正部413は、構造データ133を並列化装置200に受け渡す。
修正依頼部213は、偽依存改修装置400から構造データ133を受け取る。In step S<b>185 , the structural
The
ステップS186において、並列化部214は、構造データ133に基づいて並列化を実施し、並列化結果114を生成する。
ステップS186は、実施の形態1のステップS105に相当する。In step S<b>186 , the
Step S186 corresponds to step S105 of the first embodiment.
ステップS187において、結果出力部215は、並列化結果114を出力する。
ステップS187は、実施の形態1のステップS106に相当する。In step S<b>187 , the
Step S187 corresponds to step S106 of the first embodiment.
***実施の形態2の効果***
実施の形態2は、実施の形態1の改修候補データ125に示される偽依存のみが解消された場合の並列化結果114を得ることができる。
実施の形態1では、利用者による偽依存の解消可否の判断がなされずに、検出された全ての偽依存が解消された場合の並列化結果113が得られる。
一方、実施の形態2では、利用者によって解消可能と判断された偽依存が解消された場合の並列化結果114を得ることが可能である。*** Effect of
The second embodiment can obtain the
In
On the other hand, in the second embodiment, it is possible to obtain the
***実施の形態の補足***
図25に基づいて、並列化装置200のハードウェア構成を説明する。
並列化装置200は処理回路209を備える。
処理回路209は、ソースコード受付部211と構造解析部212と修正依頼部213と並列化部214と結果出力部215とを実現するハードウェアである。
処理回路209は、専用のハードウェアであってもよいし、メモリ202に格納されるプログラムを実行するプロセッサ201であってもよい。*** Supplement to the embodiment ***
Based on FIG. 25, the hardware configuration of the
The
The
処理回路209が専用のハードウェアである場合、処理回路209は、例えば、単一回路、複合回路、プログラム化したプロセッサ、並列プログラム化したプロセッサ、ASIC、FPGAまたはこれらの組み合わせである。
ASICは、Application Specific Integrated Circuitの略称である。
FPGAは、Field Programmable Gate Arrayの略称である。If
ASIC is an abbreviation for Application Specific Integrated Circuit.
FPGA is an abbreviation for Field Programmable Gate Array.
並列化装置200は、処理回路209を代替する複数の処理回路を備えてもよい。
The
処理回路209において、一部の機能が専用のハードウェアで実現されて、残りの機能がソフトウェアまたはファームウェアで実現されてもよい。
In the
このように、並列化装置200の機能はハードウェア、ソフトウェア、ファームウェアまたはこれらの組み合わせで実現することができる。
Thus, the functions of the
図26に基づいて、改修候補抽出装置300のハードウェア構成を説明する。
改修候補抽出装置300は処理回路309を備える。
処理回路309は、制約受付部311と定義取得部312と偽依存検出部313と構造データ修正部314と改修候補抽出部315と改修候補出力部316とを実現するハードウェアである。
処理回路309は、専用のハードウェアであってもよいし、メモリ302に格納されるプログラムを実行するプロセッサ301であってもよい。Based on FIG. 26, the hardware configuration of the repair
The modification
The
The
処理回路309が専用のハードウェアである場合、処理回路309は、例えば、単一回路、複合回路、プログラム化したプロセッサ、並列プログラム化したプロセッサ、ASIC、FPGAまたはこれらの組み合わせである。
If
改修候補抽出装置300は、処理回路309を代替する複数の処理回路を備えてもよい。
The modification
処理回路309において、一部の機能が専用のハードウェアで実現されて、残りの機能がソフトウェアまたはファームウェアで実現されてもよい。
In the
このように、改修候補抽出装置300の機能はハードウェア、ソフトウェア、ファームウェアまたはこれらの組み合わせで実現することができる。
Thus, the functions of the modification
図27に基づいて、偽依存改修装置400のハードウェア構成を説明する。
偽依存改修装置400は処理回路409を備える。
処理回路409は、偽依存受付部411と偽依存解析部412と構造データ再修正部413とを実現するハードウェアである。
処理回路409は、専用のハードウェアであってもよいし、メモリ402に格納されるプログラムを実行するプロセッサ401であってもよい。Based on FIG. 27, the hardware configuration of the false
False
The
The
処理回路409が専用のハードウェアである場合、処理回路409は、例えば、単一回路、複合回路、プログラム化したプロセッサ、並列プログラム化したプロセッサ、ASIC、FPGAまたはこれらの組み合わせである。
If
偽依存改修装置400は、処理回路409を代替する複数の処理回路を備えてもよい。
False
処理回路409において、一部の機能が専用のハードウェアで実現されて、残りの機能がソフトウェアまたはファームウェアで実現されてもよい。
In the
このように、偽依存改修装置400の機能はハードウェア、ソフトウェア、ファームウェアまたはこれらの組み合わせで実現することができる。
In this way, the functions of false
各実施の形態は、好ましい形態の例示であり、本開示の技術的範囲を制限することを意図するものではない。各実施の形態は、部分的に実施してもよいし、他の形態と組み合わせて実施してもよい。フローチャート等を用いて説明した手順は、適宜に変更してもよい。 Each embodiment is an example of a preferred form and is not intended to limit the technical scope of the present disclosure. Each embodiment may be implemented partially or in combination with other embodiments. The procedures described using flowcharts and the like may be changed as appropriate.
ソフトウェア設計支援システム100の要素である「部」は、「処理」、「工程」、「回路」または「サーキットリ」と読み替えてもよい。 The “unit” that is an element of the software design support system 100 may be read as “processing”, “process”, “circuit” or “circuitry”.
100 ソフトウェア設計支援システム、101 ネットワーク、111 ソースコード、112 構造データ、112A 順序情報、112B アクセス情報、113 並列化結果、121 制約データ、122 定義データ、123 偽依存一覧、124 構造データ、124A 順序情報、124B アクセス情報、125 改修候補データ、200 並列化装置、201 プロセッサ、202 メモリ、203 補助記憶装置、204 通信装置、205 入出力インタフェース、209 処理回路、211 ソースコード受付部、212 構造解析部、213 修正依頼部、214 並列化部、215 結果出力部、290 記憶部、300 改修候補抽出装置、301 プロセッサ、302 メモリ、303 補助記憶装置、304 通信装置、305 入出力インタフェース、309 処理回路、311 制約受付部、312 定義取得部、313 偽依存検出部、314 構造データ修正部、315 改修候補抽出部、316 改修候補出力部、390 記憶部、400 偽依存改修装置、401 プロセッサ、402 メモリ、403 補助記憶装置、404 通信装置、405 入出力インタフェース、409 処理回路、411 偽依存受付部、412 偽依存解析部、413 構造データ再修正部。
100 software design support system, 101 network, 111 source code, 112 structure data, 112A order information, 112B access information, 113 parallelization result, 121 constraint data, 122 definition data, 123 false dependency list, 124 structure data, 124A order information , 124B access information, 125 modification candidate data, 200 parallelization device, 201 processor, 202 memory, 203 auxiliary storage device, 204 communication device, 205 input/output interface, 209 processing circuit, 211 source code reception unit, 212 structure analysis unit, 213 correction request unit, 214 parallelization unit, 215 result output unit, 290 storage unit, 300 modification candidate extraction device, 301 processor, 302 memory, 303 auxiliary storage device, 304 communication device, 305 input/output interface, 309 processing circuit, 311
Claims (7)
前記構造データに基づいて、互いに影響を与えないデータ依存関係を偽依存として検出する偽依存検出部と、
前記構造データを修正することによって、検出された偽依存が解消された場合の前記ソースコードの構造データを修正済みの構造データとして生成する構造データ修正部と、
前記修正済みの構造データに基づいて前記複数の処理ブロックの並列化を実施する並列化部と、
前記並列化によって得られて前記複数の処理ブロックのスケジュールを示す並列化結果を出力する結果出力部と、
検出された偽依存の一覧から、前記並列化結果に示される前記スケジュールの通りに前記複数の処理ブロックを実行するために改修が必要な偽依存を改修候補として抽出する改修候補抽出部と、
前記改修候補となる偽依存についての情報を示す改修候補データを出力する改修候補出力部と、
を備えるソフトウェア設計支援システム。 a structural analysis unit that analyzes a source code including a plurality of processing blocks to generate structural data of the source code;
a false dependency detection unit that detects data dependencies that do not affect each other as false dependencies based on the structural data;
a structural data correction unit that generates, as corrected structural data, structural data of the source code when the detected false dependency is eliminated by correcting the structural data;
a parallelization unit that parallelizes the plurality of processing blocks based on the modified structural data;
a result output unit for outputting a parallelization result obtained by the parallelization and indicating a schedule of the plurality of processing blocks;
a modification candidate extracting unit that extracts, from a list of detected false dependencies, as modification candidates, false dependencies that require modification in order to execute the plurality of processing blocks according to the schedule indicated in the parallelization result;
a modification candidate output unit that outputs modification candidate data indicating information about the false dependency that is the modification candidate;
A software design support system with
解消してはいけない偽依存を指定する制約データを受け付ける制約受付部を備え、
前記偽依存検出部は、前記制約データに示される偽依存以外の偽依存を検出する
請求項1に記載のソフトウェア設計支援システム。 The software design support system is
a constraint reception unit that accepts constraint data specifying a false dependency that must not be resolved;
2. The software design support system according to claim 1, wherein said false dependency detector detects false dependencies other than false dependencies indicated in said constraint data.
請求項1から請求項3のいずれか1項に記載のソフトウェア設計支援システム。 4. The modification candidate extraction unit extracts, as the modification candidate, a false dependence of a pair of the preceding block and the succeeding block when the succeeding block starts before the preceding block ends. The software design support system according to any one of items 1 and 2.
前記構造データを再修正することによって、前記改修候補となる前記偽依存が解消された場合の前記ソースコードの構造データを再修正済みの構造データとして生成する構造データ再修正部を備え、
前記並列化部は、前記再修正済みの構造データに基づいて前記複数の処理ブロックの並列化を実施し、
前記結果出力部は、前記並列化によって得られて前記複数の処理ブロックのスケジュールを示す並列化結果を出力する
請求項1から請求項4のいずれか1項に記載のソフトウェア設計支援システム。 The software design support system is
a structural data recorrecting unit that generates structural data of the source code when the false dependency that is the correction candidate is eliminated by recorrecting the structural data, as recorrected structural data;
The parallelization unit parallelizes the plurality of processing blocks based on the re-corrected structural data,
5. The software design support system according to any one of claims 1 to 4, wherein said result output unit outputs a parallelization result obtained by said parallelization and indicating a schedule of said plurality of processing blocks.
複数の処理ブロックを含むソースコードを解析して前記ソースコードの構造データを生成し、
前記構造データに基づいて、前記ソースコードに存在する互いに影響を与えないデータ依存関係を偽依存として検出し、
前記構造データを修正することによって、検出された偽依存が解消された場合の前記ソースコードの構造データを修正済みの構造データとして生成し、
前記修正済みの構造データに基づいて前記複数の処理ブロックの並列化を実施し、
前記並列化によって得られて前記複数の処理ブロックのスケジュールを示す並列化結果を出力し、
検出された偽依存の一覧から、前記並列化結果に示される前記スケジュールの通りに前記複数の処理ブロックを実行するために改修が必要な偽依存を改修候補として抽出し、
前記改修候補となる偽依存についての情報を示す改修候補データを出力する
ソフトウェア設計支援方法。 The software design support system
parsing a source code including a plurality of processing blocks to generate structural data for the source code;
Detecting data dependencies that do not affect each other existing in the source code as false dependencies based on the structural data;
generating the structural data of the source code when the detected false dependency is eliminated by correcting the structural data as corrected structural data;
performing parallelization of the plurality of processing blocks based on the modified structural data;
outputting a parallelization result obtained by the parallelization and indicating a schedule of the plurality of processing blocks;
Extracting, from a list of detected false dependencies, false dependencies that require modification in order to execute the plurality of processing blocks according to the schedule indicated in the parallelization result as modification candidates;
A software design support method for outputting modification candidate data indicating information about the false dependency as the modification candidate.
前記構造データに基づいて、互いに影響を与えないデータ依存関係を偽依存として検出する偽依存検出処理と、
前記構造データを修正することによって、検出された偽依存が解消された場合の前記ソースコードの構造データを修正済みの構造データとして生成する構造データ修正処理と、
前記修正済みの構造データに基づいて前記複数の処理ブロックの並列化を実施する並列化処理と、
前記並列化によって得られて前記複数の処理ブロックのスケジュールを示す並列化結果を出力する結果出力処理と、
検出された偽依存の一覧から、前記並列化結果に示される前記スケジュールの通りに前記複数の処理ブロックを実行するために改修が必要な偽依存を改修候補として抽出する改修候補抽出処理と、
前記改修候補となる偽依存についての情報を示す改修候補データを出力する改修候補出力処理と、
をコンピュータに実行させるためのソフトウェア設計支援プログラム。 a structural analysis process of analyzing a source code including a plurality of processing blocks to generate structural data of the source code;
false dependency detection processing for detecting data dependencies that do not affect each other as false dependencies based on the structural data;
a structural data correction process for generating the structural data of the source code as corrected structural data when the detected false dependency is eliminated by correcting the structural data;
Parallelization processing for parallelizing the plurality of processing blocks based on the modified structural data;
A result output process for outputting a parallelization result obtained by the parallelization and indicating a schedule of the plurality of processing blocks;
a modification candidate extraction process for extracting, from a list of detected false dependencies, as modification candidates, false dependencies that need to be modified in order to execute the plurality of processing blocks according to the schedule indicated in the parallelization result;
a modification candidate output process for outputting modification candidate data indicating information about the false dependency as the modification candidate;
A software design support program for executing on a computer.
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/JP2021/019604 WO2022249236A1 (en) | 2021-05-24 | 2021-05-24 | Software design assistance system, software design assistance method, and software design assistance program |
Publications (3)
| Publication Number | Publication Date |
|---|---|
| JPWO2022249236A1 JPWO2022249236A1 (en) | 2022-12-01 |
| JPWO2022249236A5 JPWO2022249236A5 (en) | 2023-07-05 |
| JP7333889B2 true JP7333889B2 (en) | 2023-08-25 |
Family
ID=84229636
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2023523250A Active JP7333889B2 (en) | 2021-05-24 | 2021-05-24 | Software design support system, software design support method and software design support program |
Country Status (3)
| Country | Link |
|---|---|
| JP (1) | JP7333889B2 (en) |
| TW (1) | TW202246971A (en) |
| WO (1) | WO2022249236A1 (en) |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2009175882A (en) | 2008-01-22 | 2009-08-06 | Fujitsu Ltd | Parallelization program generation method, parallelization program generation program, and parallelization program generation apparatus |
| WO2012004972A1 (en) | 2010-07-05 | 2012-01-12 | パナソニック株式会社 | Program generation device, program production method, and program |
| JP2016143378A (en) | 2015-02-05 | 2016-08-08 | 株式会社デンソー | Parallelization compilation method, parallelization compiler, and electronic device |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH09106351A (en) * | 1995-10-12 | 1997-04-22 | Hitachi Ltd | Variable renaming method |
-
2021
- 2021-05-24 JP JP2023523250A patent/JP7333889B2/en active Active
- 2021-05-24 WO PCT/JP2021/019604 patent/WO2022249236A1/en not_active Ceased
- 2021-09-15 TW TW110134362A patent/TW202246971A/en unknown
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2009175882A (en) | 2008-01-22 | 2009-08-06 | Fujitsu Ltd | Parallelization program generation method, parallelization program generation program, and parallelization program generation apparatus |
| WO2012004972A1 (en) | 2010-07-05 | 2012-01-12 | パナソニック株式会社 | Program generation device, program production method, and program |
| JP2016143378A (en) | 2015-02-05 | 2016-08-08 | 株式会社デンソー | Parallelization compilation method, parallelization compiler, and electronic device |
Also Published As
| Publication number | Publication date |
|---|---|
| WO2022249236A1 (en) | 2022-12-01 |
| TW202246971A (en) | 2022-12-01 |
| JPWO2022249236A1 (en) | 2022-12-01 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US8607208B1 (en) | System and methods for object code hot updates | |
| US10133560B2 (en) | Link time program optimization in presence of a linker script | |
| US9081586B2 (en) | Systems and methods for customizing optimization/transformation/ processing strategies | |
| US20150324200A1 (en) | Methods and apparatus to compile instructions for a vector of instruction pointers processor architecture | |
| US20180052667A1 (en) | Emulation device, emulation method, and recording medium storing emulation program | |
| US9841957B2 (en) | Apparatus and method for handling registers in pipeline processing | |
| JP6651977B2 (en) | Information processing apparatus, compiling method, and compiling program | |
| WO2024239815A1 (en) | Automated test architecture for instruction set and micro-architecture of processor | |
| JP7333889B2 (en) | Software design support system, software design support method and software design support program | |
| JP2008276735A (en) | Program code conversion apparatus and program code conversion method | |
| CN112313626B (en) | Deadlock detection and synchronization-aware optimization methods on asynchronous processor architectures | |
| US7146600B2 (en) | Method and apparatus for deriving multiple test source files from one source file | |
| US20170344351A1 (en) | Information processing apparatus, compiling management method, and recording medium | |
| JP2001022560A (en) | How to upgrade library functions | |
| WO2012066635A1 (en) | Test method, test device, and test execution program | |
| CN114385242A (en) | Method and device for taking over MIPS (Mobile industry processor System) architecture assembly instruction | |
| JP7026563B2 (en) | High-level synthesis method, high-level synthesis program, high-level synthesis device | |
| JP2023084609A (en) | Conversion program and conversion method | |
| JP6933001B2 (en) | Parallelization method, parallelization tool | |
| JP5353587B2 (en) | Embedded program development apparatus and embedded program development method | |
| JP2022125690A (en) | Information processing device, information processing program, and program development support method | |
| JP2001290659A (en) | Register allocation method | |
| JP2005301415A (en) | Compile method, simulator, emulator and program development support system | |
| CN116975879A (en) | Smart contract security processing methods, compilation processing methods, devices and compilers | |
| JP2007114934A (en) | Compiler system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20230417 |
|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20230417 |
|
| A871 | Explanation of circumstances concerning accelerated examination |
Free format text: JAPANESE INTERMEDIATE CODE: A871 Effective date: 20230417 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20230530 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20230703 |
|
| 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: 20230718 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20230815 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 7333889 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |