JP6933063B2 - Parallelization method, parallelization tool, in-vehicle device - Google Patents
Parallelization method, parallelization tool, in-vehicle device Download PDFInfo
- Publication number
- JP6933063B2 JP6933063B2 JP2017172395A JP2017172395A JP6933063B2 JP 6933063 B2 JP6933063 B2 JP 6933063B2 JP 2017172395 A JP2017172395 A JP 2017172395A JP 2017172395 A JP2017172395 A JP 2017172395A JP 6933063 B2 JP6933063 B2 JP 6933063B2
- Authority
- JP
- Japan
- Prior art keywords
- variable
- array
- character
- name
- array variable
- 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
- G06F8/45—Exploiting coarse grain parallelism in compilation, i.e. parallelism between groups of instructions
- G06F8/456—Parallelism detection
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)
Description
本開示は、シングルコアマイコン用のシングルプログラムから、マルチコアマイコン用の並列プログラムを生成する並列化方法、並列化ツール、および並列化方法で生成された並列プログラムを備えた車載装置に関する。 The present disclosure relates to a parallelization method for generating a parallel program for a multi-core microcomputer from a single program for a single-core microcomputer, a parallelization tool, and an in-vehicle device including a parallel program generated by the parallelization method.
従来、シングルプログラムから並列プログラムを生成する並列化方法の一例として特許文献1に開示された並列化コンパイル方法がある。
Conventionally, there is a parallel compilation method disclosed in
ところで、シングルコアマイコンは、シングルプログラムを実行することで、配列変数にアクセスすることもありうる。つまり、シングルプログラムには、配列変数が含まれていることがある。上記並列化コンパイル方法では、このようなシングルプログラムから並列プログラムを生成する場合、配列変数の全要素をまとめて一つの変数として扱い、依存関係の解析、処理順序の抽出、各コアへの配置を行うことになる。 By the way, a single-core microcomputer may access an array variable by executing a single program. That is, a single program may contain array variables. In the above parallel compilation method, when a parallel program is generated from such a single program, all the elements of the array variable are treated as one variable, dependency analysis, processing order extraction, and placement in each core are performed. Will do.
この場合、配列変数の各要素へのアクセスを示す各処理は、依存関係がないにもかかわらず、依存関係があるものとして扱われることがある。このため、並列化コンパイル方法で生成された並列プログラムは、依存関係がない処理間の依存関係を保つために、同期処理や空きが必要以上に多くなるという問題がある。また、マルチコアマイコンは、このような並列プログラムを実行することで、同期処理の分だけ処理負荷が増加したり、依存関係を保つための空きの分だけ処理効率が低下するという問題がある。 In this case, each process indicating access to each element of the array variable may be treated as having a dependency even though there is no dependency. Therefore, the parallel program generated by the parallel compilation method has a problem that the synchronous processing and the free space become larger than necessary in order to maintain the dependency between the processes having no dependency. Further, the multi-core microcomputer has a problem that by executing such a parallel program, the processing load increases by the amount of synchronous processing, and the processing efficiency decreases by the amount of free space for maintaining the dependency.
本開示は、上記問題点に鑑みなされたものであり、配列変数へのアクセスを示す処理を含んだシングルプログラムであっても適切に並列プログラムを生成できる並列化方法、並列化ツールを提供することを一つの目的とする。また、上記問題点に鑑みなされたものであり、複数のコアで適切に処理を行なうことができる車載装置を提供することを他の目的とする。 The present disclosure has been made in view of the above problems, and provides a parallelization method and a parallelization tool capable of appropriately generating a parallel program even if it is a single program including a process indicating access to an array variable. Is one purpose. Further, the present invention has been made in view of the above problems, and another object is to provide an in-vehicle device capable of appropriately performing processing with a plurality of cores.
上記目的を達成するために本開示は、
コアが一つであるシングルコアマイコン用に記述された複数の処理を含むシングルプログラムから、コアが複数であるマルチコアマイコン用に並列化可能な処理を並列化した並列プログラムを生成する並列化方法であって、
シングルプログラムから、複数の配列要素を含む配列変数であることを示す配列変数文字を検索して、配列変数を特定する配列変数特定手順(S12)と、
配列変数が特定された場合、配列変数における配列要素ごとに、配列変数の名称である配列変数名と、配列要素の番号である要素番号と、配列変数文字とを結合した文字列を変数名として定義する変数名定義手順(S14)と、
変数名定義手順で変数名が定義された定義済変数を含む変数をシングルプログラムから抽出して、変数にアクセスする複数の処理の依存関係を解析し、複数の処理の依存関係が保たれた並列プログラムを生成する生成手順(S17)と、を備えていることを特徴とする。
To achieve the above objectives, this disclosure is:
A parallelization method that generates a parallel program that parallelizes processes that can be parallelized for a multi-core microcomputer with multiple cores from a single program that includes multiple processes written for a single-core microcomputer with one core. There,
An array variable specification procedure (S12) for identifying an array variable by searching for an array variable character indicating that the array variable contains a plurality of array elements from a single program, and
When an array variable is specified, for each array element in the array variable, the character string that combines the array variable name that is the name of the array variable, the element number that is the number of the array element, and the array variable character is used as the variable name. Variable name definition procedure (S14) to be defined and
Variables containing the defined variables whose variable names are defined in the variable name definition procedure are extracted from a single program, the dependencies of multiple processes that access the variables are analyzed, and the dependencies of multiple processes are maintained in parallel. It is characterized in that it includes a generation procedure (S17) for generating a program.
このように、本開示は、シングルプログラムから配列変数を特定すると、この配列変数における配列要素ごとに、配列変数の名称である配列変数名と、配列要素の番号である要素番号と、配列変数文字とを結合した文字列を変数名として定義する。このため、本開示は、配列変数を一つの変数として扱うのではなく、配列変数に含まれる複数の配列要素のそれぞれを一つの変数として扱うことができる。 As described above, in the present disclosure, when an array variable is specified from a single program, the array variable name which is the name of the array variable, the element number which is the number of the array element, and the array variable character are used for each array element in this array variable. Define a character string that combines and as a variable name. Therefore, in the present disclosure, instead of treating an array variable as one variable, each of a plurality of array elements included in the array variable can be treated as one variable.
そして、本開示は、このように定義した定義済変数を含む変数をシングルプログラムから抽出して、変数にアクセスする複数の処理の依存関係を解析し、複数の処理の依存関係が保たれた並列プログラムを生成する。ことのとき、本開示は、複数の配列要素のそれぞれを一つの変数として扱って依存関係を解析するので、依存関係がないにもかかわらず、依存関係があるとすることを抑制できる。よって、本開示は、同期処理や依存関係を保つための空きが必要以上に多くなることを抑制でき、適切に並列プログラムを生成できる。 Then, in the present disclosure, variables including the defined variables defined in this way are extracted from a single program, the dependencies of a plurality of processes for accessing the variables are analyzed, and the dependencies of the plurality of processes are maintained in parallel. Generate a program. In this case, since the present disclosure treats each of the plurality of array elements as one variable and analyzes the dependency, it is possible to suppress the fact that there is a dependency even though there is no dependency. Therefore, in the present disclosure, it is possible to suppress an unnecessarily large amount of space for synchronous processing and maintaining the dependency, and it is possible to appropriately generate a parallel program.
また、上記目的を達成するさらなる特徴は、
コアが一つであるシングルコアマイコン用に記述された複数の処理を含むシングルプログラムから、コアが複数であるマルチコアマイコン用に並列化可能な処理を並列化した並列プログラムを生成する、コンピュータを含む並列化ツールであって、
シングルプログラムから、複数の配列要素を含む配列変数であることを示す配列変数文字を検索して、配列変数を特定する配列変数特定部(S12)と、
配列変数が特定された場合、配列変数における配列要素ごとに、配列変数の名称である配列変数名と、配列要素の番号である要素番号と、配列変数文字とを結合した文字列を変数名として定義する変数名定義部(S14)と、
変数名定義部で変数名が定義された定義済変数を含む変数をシングルプログラムから抽出して、変数にアクセスする複数の処理の依存関係を解析し、複数の処理の依存関係が保たれた並列プログラムを生成する生成部(S17)と、を備えている点にある。
In addition, further features that achieve the above objectives are
Includes a computer that generates a parallel program that parallelizes processes that can be parallelized for a multi-core microcomputer with multiple cores from a single program that includes multiple processes written for a single-core microcomputer with one core. It ’s a parallelization tool,
An array variable identification unit (S12) that identifies an array variable by searching for an array variable character indicating that it is an array variable containing a plurality of array elements from a single program, and
When an array variable is specified, for each array element in the array variable, the character string that combines the array variable name that is the name of the array variable, the element number that is the number of the array element, and the array variable character is used as the variable name. Variable name definition unit (S14) to be defined and
Variables containing the defined variables whose variable names are defined in the variable name definition section are extracted from a single program, the dependencies of multiple processes that access the variables are analyzed, and the dependencies of multiple processes are maintained in parallel. The point is that it includes a generation unit (S17) for generating a program.
このように、並列化ツールでは、上記並列化方法と同様に、同期処理や依存関係を保つための空きが必要以上に多くなることを抑制でき、適切に並列プログラムを生成できる。 As described above, in the parallelization tool, similarly to the above parallelization method, it is possible to suppress an unnecessarily large amount of space for maintaining synchronization processing and dependencies, and it is possible to appropriately generate a parallel program.
また、上記目的を達成するさらなる特徴は、
複数のコア(21c、21d)を有するマルチコアマイコン(21)と、コアが一つであるシングルコアマイコン用のシングルプログラムにおける複数の処理からマルチコアマイコン用に並列化された並列プログラム(21a1)と、を備えた車載装置であって、
並列プログラムは、
シングルプログラムから、複数の配列要素を含む配列変数であることを示す配列変数文字を検索して配列変数が特定され、
特定された配列変数における配列要素ごとに、配列変数の名称である配列変数名と、配列要素の番号である要素番号と、配列変数文字とを結合した文字列を変数名として定義され、
変数名が定義された定義済変数を含む変数をシングルプログラムから抽出して、変数にアクセスする複数の処理の依存関係を解析し、依存関係が保たれた状態で複数の処理が各コアに割り当てられており、
マルチコアマイコンは、各コアが割り当てられた処理を実行する点にある。
In addition, further features that achieve the above objectives are
A multi-core microcomputer (21) having a plurality of cores (21c, 21d), and a parallel program (21a1) parallelized for a multi-core microcomputer from a plurality of processes in a single program for a single-core microcomputer having one core. It is an in-vehicle device equipped with
Parallel programs
An array variable is identified by searching the array variable character indicating that it is an array variable containing multiple array elements from a single program.
For each array element in the specified array variable, a character string that combines the array variable name that is the name of the array variable, the element number that is the number of the array element, and the array variable character is defined as the variable name.
A variable containing a defined variable with a variable name defined is extracted from a single program, the dependency of multiple processes that access the variable is analyzed, and multiple processes are assigned to each core while the dependency is maintained. Has been
The multi-core microcomputer is in that each core executes the assigned process.
このように、本開示は、上記の並列化方法で説明したように、同期処理や依存関係を保つための空きが必要以上に多くなることが抑制され、適切に生成された並列プログラムを備えている。そして、本開示は、このような並列プログラムをマルチコアマイコンの各コアが実行する。このため、本開示は、同期処理の分だけ処理負荷が増加したり、依存関係を保つための空きの分だけ処理効率が低下することを抑制でき、複数のコアで適切に処理を行なうことができる。 As described above, in the present disclosure, as described in the parallelization method described above, it is possible to suppress an unnecessarily large amount of space for maintaining synchronization processing and dependencies, and to provide an appropriately generated parallel program. There is. Then, in the present disclosure, each core of the multi-core microcomputer executes such a parallel program. Therefore, in the present disclosure, it is possible to suppress an increase in the processing load by the amount of synchronous processing and a decrease in processing efficiency by the amount of free space for maintaining the dependency, and it is possible to appropriately perform processing in a plurality of cores. can.
なお、特許請求の範囲、およびこの項に記載した括弧内の符号は、一つの態様として後述する実施形態に記載の具体的手段との対応関係を示すものであって、本開示の技術的範囲を限定するものではない。 The scope of claims and the reference numerals in parentheses described in this section indicate the correspondence with the specific means described in the embodiment described later as one embodiment, and the technical scope of the present disclosure. Is not limited to.
以下において、図面を参照しながら、本開示を実施するための複数の形態を説明する。各形態において、先行する形態で説明した事項に対応する部分には同一の参照符号を付して重複する説明を省略する場合がある。各形態において、構成の一部のみを説明している場合は、構成の他の部分については先行して説明した他の形態を参照し適用することができる。 Hereinafter, a plurality of modes for carrying out the present disclosure will be described with reference to the drawings. In each form, the same reference numerals may be given to the parts corresponding to the matters described in the preceding forms, and duplicate explanations may be omitted. In each form, when only a part of the configuration is described, the other parts of the configuration can be applied with reference to the other forms described above.
(第1実施形態)
図1〜図6を用いて、第1実施形態に関して説明する。本実施形態では、一つのコアを有するシングルコアマイコン用のシングルプログラムにおける並列可能な複数の処理を第1コア21cと第2コア21dを有するマルチコアマイコン用に並列化した並列プログラム21a1を生成するコンピュータ10を採用する。つまり、コンピュータ10は、コアが一つであるシングルコアマイコン用に記述された複数の処理を含むシングルプログラムから、コアが複数であるマルチコアマイコン用に並列化可能な処理を並列化した並列プログラム21a1を生成する。
(First Embodiment)
The first embodiment will be described with reference to FIGS. 1 to 6. In the present embodiment, a computer that generates a parallel program 21a1 in which a plurality of parallel processes in a single program for a single-core microcomputer having one core are parallelized for a multi-core microcomputer having a
なお、並列プログラム21a1を生成する際には、特開2015−1807号公報に記載されているように、シングルプログラムを解析して、複数の処理を第1コア21cと第2コア21dに割り振る(配置する)処理などを行う。この点に関しては、特開2015−1807号公報を参照して適用できる。
When the parallel program 21a1 is generated, as described in Japanese Patent Application Laid-Open No. 2015-1807, the single program is analyzed and a plurality of processes are allocated to the
図4に示すように、本実施形態では、複数の配列要素として第1要素V11〜第4要素V14を含む配列変数V1を有するシングルプログラムを採用する。例えばC言語の場合、配列変数V1は、Array[4]などと記述することができる。そして、Array[4]は、要素数が四であり、配列要素としてArray[0]、Array[1]、Array[2]、Array[3]を含んでいる。 As shown in FIG. 4, in the present embodiment, a single program having an array variable V1 including the first element V11 to the fourth element V14 as a plurality of array elements is adopted. For example, in the case of C language, the array variable V1 can be described as Array [4] or the like. The Array [4] has four elements, and includes Array [0], Array [1], Array [2], and Array [3] as array elements.
この場合、Array[4]における[は、配列変数であることを示す配列変数文字に相当する。Array[4]におけるArrayは、配列変数の名称である配列変数名に相当する。配列要素における0〜3のそれぞれは、配列要素の番号である要素番号に相当する。なお、Array[4]における4は、要素数と言える。また、要素番号は、添字と言い換えることもできる。なお、これらは、配列変数文字、配列変数名、要素番号の一例である。つまり、配列変数文字、配列変数名、要素番号は、これに限定されず、シングルプログラムの記述ルールに則したものであれば採用できる。 In this case, [in Array [4] corresponds to an array variable character indicating that it is an array variable. The Array in the Array [4] corresponds to the array variable name which is the name of the array variable. Each of 0 to 3 in the array element corresponds to the element number which is the number of the array element. In addition, 4 in Array [4] can be said to be the number of elements. The element number can also be paraphrased as a subscript. These are examples of array variable characters, array variable names, and element numbers. That is, the array variable character, the array variable name, and the element number are not limited to these, and can be adopted as long as they conform to the description rules of the single program.
また、図4に示すように、本実施形態では、複数の処理として、第1処理MT1〜第5処理MT5を採用する。第1処理MT1は、第1要素V11への書き込みを示す処理である。第2処理MT2は、第2要素V12への書き込みを示す処理である。第3処理MT3は、第3要素V13への書き込みを示す処理である。第4処理MT4は、第4要素V14への書き込みを示す処理である。第5処理MT5は、第1要素V11〜第4要素V14の全ての読み込みを示す処理である。よって、本実施形態では、第1処理MT1〜第4処理MT4の間には依存間隔がなく、第1処理MT1〜第4処理MT4のそれぞれと第5処理MT5との間のみ依存関係があるものとする。なお、処理は、処理ブロックやマクロタスクと言い換えることができる。 Further, as shown in FIG. 4, in the present embodiment, the first processing MT1 to the fifth processing MT5 are adopted as the plurality of processing. The first process MT1 is a process indicating writing to the first element V11. The second process MT2 is a process indicating writing to the second element V12. The third process MT3 is a process indicating writing to the third element V13. The fourth process MT4 is a process indicating writing to the fourth element V14. The fifth process MT5 is a process indicating reading all of the first element V11 to the fourth element V14. Therefore, in the present embodiment, there is no dependency interval between the first processing MT1 to the fourth processing MT4, and there is a dependency relationship only between each of the first processing MT1 to the fourth processing MT4 and the fifth processing MT5. And. The processing can be rephrased as a processing block or a macro task.
さらに、依存関係は、処理順とみなすことができる。つまり、第1処理MT1〜第4処理MT4のそれぞれの間では、どのような処理順であってもよい。しかしながら、第5処理MT5は、第1処理MT1〜第4処理MT4のそれぞれよりも処理順が遅い。 Furthermore, the dependency can be regarded as the processing order. That is, any processing order may be used between each of the first processing MT1 to the fourth processing MT4. However, the processing order of the fifth processing MT5 is slower than that of each of the first processing MT1 to the fourth processing MT4.
ここで、コンピュータ10と、車載装置20の構成に関して説明する。コンピュータ10は、並列化方法を実行する並列化ツールに相当する。また、コンピュータ10は、並列プログラム21a1を生成するため、プログラム生成ツールとも言える。図1に示すように、コンピュータ10は、ディスプレイ11、HDD12、CPU13、ROM14、RAM15、入力装置16、読取部17などを備えて構成されている。また、コンピュータ10は、記憶媒体18に記憶された記憶内容を読み取り可能に構成されている。記憶媒体18には、自動並列化コンパイラ1が記憶されている。コンピュータ10および記憶媒体18の構成は、特開2015−1807号公報に記載されたパーソナルコンピュータ100および記憶媒体180を参照して適用できる。
Here, the configuration of the
自動並列化コンパイラ1は、並列化方法に相当する。つまり、自動並列化コンパイラ1は、並列化手順、言い換えると並列化方法が記述されたプログラムである。コンピュータ10は、自動並列化コンパイラ1を実行することで、並列プログラム21a1を生成する。このため、自動並列化コンパイラ1は、プログラム生成方法とも言える。自動並列化コンパイラ1は、特開2015−1807号公報に記載されたものを参照して適用できる。特に、自動並列化コンパイラ1は、配列変数特定手順と、変数名定義手順とを含んでいる。配列変数特定手順と変数名定義手順に関しては、後程詳しく説明する。
The
なお、自動並列化コンパイラ1は、依存関係を保つための同期処理や空きの挿入手順などを含んでいてもよい。この同期処理は、例えば、第1処理MT1〜第4処理MT4が終了するのを待って第5処理MT5が実行されるようにするための処理である。本実施形態では、図5に示すように、同期処理の一例として、第1同期処理W1と第2同期処理W2が挿入される例を採用している。また、本実施形態では、図5、図6に示すように、依存関係を保つための空きの一例として、第2の空きE2と第6の空きE6が挿入される例を採用している。
The
コンピュータ10は、自動並列化コンパイラ1を実行することで、図5、図6に示すような、各コア21c、21dに対応した並列プログラム21a1を生成する。つまり、コンピュータ10は、第1処理MT1〜第5処理MT5などを第1コア21cや第2コア21dに配置、言い換えると割り当てられた並列プログラム21a1を生成する。
By executing the
図5に示す並列プログラム21a1では、第1処理MT1、第3処理MT3、第5処理MT5が第1コア21cに配置され、第2処理MT2、第4処理MT4が第2コア21dに配置されている。さらに、図5に示す並列プログラム21a1では、第1同期処理W1、第1の空きE1が第1コア21cに配置され、第2同期処理W2、第2の空きE2、第3の空きE3が第2コア21dに配置されている。
In the parallel program 21a1 shown in FIG. 5, the first processing MT1, the third processing MT3, and the fifth processing MT5 are arranged in the
一方、図6に示す並列プログラム21a1では、第1処理MT1〜第5処理MT5の全てが第1コア21cに配置されている。さらに、図6に示す並列プログラム21a1では、第4の空きE4が第1コア21cに配置され、第5の空きE5〜第7の空きE7が第2コア21dに配置されている。
On the other hand, in the parallel program 21a1 shown in FIG. 6, all of the first processed MT1 to the fifth processed MT5 are arranged in the
なお、本実施形態では、一例として、図5、図6に示す並列プログラム21a1を採用している。しかしながら、本開示は、これに限定されない。 In this embodiment, the parallel program 21a1 shown in FIGS. 5 and 6 is adopted as an example. However, the present disclosure is not limited to this.
車載装置20は、図2に示すように、マルチコアプロセッサ21、ROM21a、RAM21b、第1コア21c、第2コア21d、通信部22、センサ部23、入出力ポート24を備えて構成されている。車載装置20は、例えば、自動車に搭載されたエンジン制御装置やハイブリッド制御装置などに適用できる。ここでは、一例として、車載装置20をエンジン制御装置に適用した例を採用する。この場合、並列プログラム21a1は、エンジン制御などの自動車制御プログラムと言える。なお、マルチコアプロセッサ21は、マルチコアマイコンに相当する。また、コアは、プロセッサエレメントとも称することができる。
As shown in FIG. 2, the in-
RAM21b、通信部22、センサ部23、入出力ポート24は、特開2015−1807号公報に記載されたRAM420、通信部430、センサ部450、入出力ポート460を参照して適用できる。
The
ROM21aには、第1コア21cと第2コア21dが実行可能な並列プログラム21a1が含まれている。つまり、車載装置20は、シングルプログラムにおける複数の処理MT1〜MT5からマルチコアプロセッサ21用に並列化された並列プログラム21a1を備えていると言える。
The
マルチコアプロセッサ21は、各コア21c、21dに割り当てられた処理を各コア21c、21dが実行する。第1コア21cと第2コア21dは、並列プログラム21a1を実行することで、例えばエンジン制御などを行う。言い換えると、第1コア21cと第2コア21dは、並列プログラム21a1に従って制御ロジックを実行することで、エンジン制御などを行う。
In the
なお、本実施形態では、マルチコアプロセッサ21が車載装置20に搭載された例を採用している。しかしながら、本開示は、これに限定されず、マルチコアプロセッサ21が、車載装置20とは異なる機器、例えばパソコンなどに搭載されていてもよい。さらに、本実施形態では、二つのコア21c、21dを備えたマルチコアプロセッサ21を採用している。しかしながら、本開示は、三つ以上のコアを備えたマルチコアプロセッサ21であっても採用できる。
In this embodiment, an example in which the
次に、図3を用いて、コンピュータ10の処理動作に関して説明する。CPU13は、例えば入力装置16によって挿入処理の実行指示がなされた場合に、図3に示すフローチャートを実行する。CPU13は、自動並列化コンパイラ1を実行することで、シングルプログラムから並列プログラム21a1を生成する。CPU13は、特開2015−1807号公報に記載された手順に従って並列プログラム21a1を生成する際に、下記のステップS10〜S17を実行する。
Next, the processing operation of the
ステップS10では、抽出対象ファイルを選定する。CPU13は、シングルプログラムから抽出対象ファイル、すなわち処理を選定する。ステップS11では、アクセスする変数を検索する。CPU13は、ステップS10で選定した処理でアクセスする変数を検索する。
In step S10, the extraction target file is selected. The
ステップS12では、配列変数文字の有無を判定する。CPU13は、ステップS11の検索結果である変数に配列変数文字が含まれているか否かを判定する(配列変数特定部)。つまり、CPU13は、ステップS11の検索で得られた変数が配列変数であるか否かを判定する。CPU13は、変数に配列変数文字が含まれていると判定しなかった場合、その変数が配列変数ではないとみなしてステップS13へ進む。一方、CPU13は、変数に配列変数文字が含まれていると判定した場合、その変数が配列変数であるとみなしてステップS14へ進む。このように、CPU13は、シングルプログラムから、配列変数であることを示す配列変数文字を検索して、配列変数を特定する。
In step S12, it is determined whether or not there is an array variable character. The
本実施形態では、シングルプログラムの記述ルールに準拠した配列変数であることを示す文字を、配列変数文字として採用している。CPU13は、配列変数である事を判定する際に、シングルプログラムの記述ルールに則った、配列変数である事を示す文字があるか否かを判定する。C言語プログラムでの配列変数記述ルールでは、配列変数の場合、変数名の後に必ず[]が存在する。このため、CPU13は、[の有無で変数が配列変数であるか否かを判定することができる。
In the present embodiment, a character indicating that the array variable conforms to the description rule of the single program is adopted as the array variable character. When determining that it is an array variable, the
CPU13は、自動並列化コンパイラ1を実行することで配列変数を特定する。このため、自動並列化コンパイラ1は、配列変数特定手順を含んでいると言える。つまり、自動並列化コンパイラ1は、シングルプログラムから、複数の配列要素を含む配列変数であることを示す配列変数文字を検索して、配列変数を特定する配列変数特定手順を含んでいる。
The
ステップS13では、検索結果から変数名を抽出する。CPU13は、ステップS11で検索した変数から変数名を抽出する。
In step S13, the variable name is extracted from the search result. The
ステップS14では、配列変数名、要素番号、配列変数文字を結合した文字列を変数名として定義する(変数名定義部)。CPU13は、配列変数が特定された場合、配列変数における配列要素ごとに、配列変数名と、要素番号と、配列変数文字とを結合した文字列を変数名として定義する。CPU13は、例えば配列変数としてArray[4]が特定された場合、配列要素ごとに、Array[0]、Array[1]、Array[2]、Array[3]と変数名を定義する。これは、配列変数を一つの変数として扱うのではなく、各配列要素のそれぞれを一つの変数として扱って、並列プログラム21a1を生成するためである。ここで変数名が定義された変数は、定義済変数に相当する。
In step S14, a character string in which the array variable name, the element number, and the array variable characters are combined is defined as the variable name (variable name definition unit). When an array variable is specified, the
このように、CPU13は、配列変数の各要素へアクセスする場合、必ず要素番号が指定されるため、その要素番号を含めて変数名として定義する。CPU13は、シングルプログラムの記述ルールに則った文字を含めて変数名として定義する事で、シングルプログラム内での配列変数の要素毎の検索が容易になり、後程説明するステップS17の処理に要する時間を短くすることができる。つまり、CPU13は、依存関係の解析にかかる時間を短くすることができる。
In this way, when accessing each element of the array variable, the
CPU13は、自動並列化コンパイラ1を実行することで配列要素ごとに変数名を定義する。このため、自動並列化コンパイラ1は、変数名定義手順を含んでいると言える。つまり、自動並列化コンパイラ1は、配列変数が特定された場合、配列変数における配列要素ごとに、配列変数の名称である配列変数名と、配列要素の番号である要素番号と、配列変数文字とを結合した文字列を変数名として定義する変数名定義手順を含んでいる。
The
ステップS15では、全ての変数名を検索したか否かを判定する。CPU13は、ステップS10で選定した処理がアクセスする全ての変数名を検索したか否かを判定し、検索したと判定した場合はステップS16へ進み、検索したと判定しなかった場合はステップS11へ戻る。
In step S15, it is determined whether or not all the variable names have been searched. The
ステップS16では、全てのファイルから抽出したか否かを判定する。CPU13は、シングルプログラムの全てのファイルから処理を抽出したか否かを判定し、抽出したと判定した場合はステップS17へ進み、抽出したと判定しなかった場合はステップS10へ戻る。
In step S16, it is determined whether or not the files have been extracted from all the files. The
ステップS17では、並列プログラムを生成する(生成部)。CPU13は、ステップS14で変数名が定義された定義済変数を含む変数をシングルプログラムから抽出して、変数にアクセスする複数の処理の依存関係の解析、処理順序の抽出などを行い、複数の処理の依存関係が保たれた並列プログラムを生成する。つまり、CPU13は、ステップS14で変数名が定義された定義済変数と、ステップS13で変数名が抽出された変数とにアクセスする複数の処理の依存関係の解析などを行い、複数の処理の依存関係が保たれた並列プログラム21a1を生成する。つまり、CPU13は、複数の処理を第1コア21cと第2コア21dのいずれかに配置する。このステップS17は、特開2015−1807号公報を参照して適用できる。なお、ステップS13で変数名が抽出された変数は、シングルプログラムに含まれる配列変数ではない変数とみなすことができる。
In step S17, a parallel program is generated (generation unit). The
CPU13は、自動並列化コンパイラ1を実行することで並列プログラム21a1を生成する。このため、自動並列化コンパイラ1は、生成手順を含んでいると言える。つまり、自動並列化コンパイラ1は、定義済変数を含む変数をシングルプログラムから抽出して、変数にアクセスする複数の処理の依存関係の解析などを行い、複数の処理の依存関係が保たれた並列プログラム21a1を生成する生成手順を含んでいる。
The
このように、本実施形態では、コンピュータ10が、ステップS10〜S17を実行することで、図5や図6に示す並列プログラム21a1を生成する。しかしながら、本開示はこれに限定されない。作業者などが、特開2015−1807号公報に記載された並列化方法に加えて、ステップS10〜S17を行うことで、並列プログラム21a1を生成してもよい。
As described above, in the present embodiment, the
ここで、コンピュータ10と比較例の並列化ツールとを対比しつつ、本開示の効果を説明する。比較例の並列化ツールは、配列変数を一つの変数として扱う点がコンピュータ10と異なる。
Here, the effect of the present disclosure will be described while comparing the
比較例の並列化ツールでは、シングルプログラムから変数名を抽出および定義し、依存関係の解析などを行い、第1コア21cと第2コア21dに配置する。つまり、比較例の並列化ツールは、図3のステップS12、S14を行うことなく、ステップS10、S11、S13、S15〜S17を行うことになる。
In the parallelization tool of the comparative example, the variable name is extracted and defined from the single program, the dependency is analyzed, and the variable name is arranged in the
よって比較例の並列化ツールは、依存関係が無い配列要素間であっても依存関係が有るものとして扱うことになる。このため、比較例の並列化ツールは、図4に示す第1処理MT1〜第5処理MT5を並列化した場合、図12の第1パターンや第2パターンのような並列プログラムを作成することになる。 Therefore, the parallelization tool in the comparative example treats array elements that do not have a dependency as if they have a dependency. Therefore, the parallelization tool of the comparative example creates a parallel program such as the first pattern and the second pattern of FIG. 12 when the first processing MT1 to the fifth processing MT5 shown in FIG. 4 are parallelized. Become.
第1パターンは、第1処理MT1、第3処理MT3、第5処理MT5が第1コア21cに配置され、第2処理MT2、第4処理MT4が第2コア21dに配置されている。さらに、第1パターンは、四つの同期処理W10〜W13と依存関係を保つための二つの空きE10、E11が第1コア21cに配置され、四つの同期処理W14〜W17と依存関係を保つための三つの空きE12〜E14が第2コア21dに配置されている。
In the first pattern, the first processed MT1, the third processed MT3, and the fifth processed MT5 are arranged in the
第1パターンは、図5に示す並列プログラム21a1と比べると、同期処理と依存関係を保つための空きが多くなっている。このように、比較例の並列化ツールは、実際には無い依存関係を保つために、同期処理と空きが多くなる。 Compared with the parallel program 21a1 shown in FIG. 5, the first pattern has more space for maintaining the synchronization processing and the dependency. In this way, the parallelization tool of the comparative example has a lot of synchronization processing and free space in order to maintain the dependency that does not actually exist.
一方、第2パターンは、第1処理MT1〜第5処理MT5の全てが第1コア21cに配置されている。さらに、第2パターンは、一つの空きE15が第1コア21cに配置され、一つの空きE17と依存関係を保つための空きE16が第2コア21dに配置されている。
On the other hand, in the second pattern, all of the first processed MT1 to the fifth processed MT5 are arranged in the
第2パターンは、図6に示す並列プログラム21a1と比べると、依存関係を保つための空きが多く(長く)なっている。このように、比較例の並列化ツールは、実際には無い依存関係を保つために、空きが多くなる。 In the second pattern, there is more space (longer) for maintaining the dependency relationship than in the parallel program 21a1 shown in FIG. In this way, the parallelization tool of the comparative example has a lot of space in order to maintain the dependency that does not actually exist.
これに対して、コンピュータ10は、シングルプログラムから配列変数V1を特定する。そして、コンピュータ10は、この配列変数V1における配列要素V11〜V14ごとに、配列変数V1の名称である配列変数名と、配列要素の番号である要素番号と、配列変数文字とを結合した文字列を変数名として定義する。このため、コンピュータ10は、配列変数V1を一つの変数として扱うのではなく、配列変数V1に含まれる複数の配列要素V11〜V14のそれぞれを一つの変数として扱うことができる。つまり、コンピュータ10は、各配列要素V11〜V14を個別の変数として扱うことができる。
On the other hand, the
そして、コンピュータ10は、このように定義した定義済変数を含む変数をシングルプログラムから抽出する。また、コンピュータ10は、この変数にアクセスする複数の処理MT1〜MT5などの依存関係の解析などを行い、複数の処理MT1〜MT5の依存関係が保たれた並列プログラム21a1を生成する。ことのとき、コンピュータ10は、複数の配列要素V11〜V14のそれぞれを一つの変数として扱って依存関係の解析などを行うので、依存関係がないにもかかわらず、依存関係があるとすることを抑制できる。よって、コンピュータ10は、同期処理や依存関係を保つための空きが必要以上に多くなることを抑制でき、適切に並列プログラム21a1を生成できる。つまり、コンピュータ10は、上記のように比較例の並列化ツールよりも、同期処理や依存関係を保つための空きが少ない、並列プログラム21a1を生成できる。
Then, the
コンピュータ10は、自動並列化コンパイラ1を実行することで、同期処理や依存関係を保つための空きが必要以上に多くなることを抑制でき、適切に並列プログラム21a1を生成できる。よって、自動並列化コンパイラ1は、コンピュータ10と同様に、同期処理や依存関係を保つための空きが必要以上に多くなることを抑制でき、適切に並列プログラム21a1を生成できる。
By executing the
また、車載装置20におけるシングルプログラムでは、配列要素毎に依存関係がない場合が多数存在する。例えば、4気筒エンジンを駆動制御するためのシングルプログラムは、配列要素を四つ用意して、各配列要素を各気筒特有の制御用データとして使う。このような場合、コンピュータ10および自動並列化コンパイラ1は有効である。
Further, in the single program in the in-
さらに、車載装置20は、コンピュータ10で生成された並列プログラム21a1を備えている。つまり、車載装置20は、同期処理や依存関係を保つための空きが必要以上に多くなることが抑制され、適切に生成された並列プログラム21a1を備えている。そして、車載装置20は、このような並列プログラム21a1をマルチコアプロセッサ21の各コア21c、21dが実行する。このため、車載装置20は、同期処理の分だけ処理負荷が増加したり、依存関係を保つための空きの分だけ処理効率が低下することを抑制でき、複数のコア21c、21dで適切に処理を行なうことができる。
Further, the in-
以上、本開示の好ましい実施形態について説明した。しかしながら、本開示は、上記実施形態に何ら制限されることはなく、本開示の趣旨を逸脱しない範囲において、種々の変形が可能である。以下に、本開示のその他の形態として、第2実施形態〜第4実施形態に関して説明する。上記実施形態および第2実施形態〜第4実施形態は、それぞれ単独で実施することも可能であるが、適宜組み合わせて実施することも可能である。本開示は、実施形態において示された組み合わせに限定されることなく、種々の組み合わせによって実施可能である。 The preferred embodiments of the present disclosure have been described above. However, the present disclosure is not limited to the above-described embodiment, and various modifications can be made without departing from the spirit of the present disclosure. The second to fourth embodiments will be described below as other embodiments of the present disclosure. The above-described embodiment and the second to fourth embodiments can be carried out individually, or can be carried out in combination as appropriate. The present disclosure is not limited to the combinations shown in the embodiments, but can be implemented in various combinations.
(第2実施形態)
図7を用いて、第2実施形態に関して説明する。第2実施形態では、主に、上記実施形態と異なる部分に関して説明する。また、本変形例は、自動並列化コンパイラ1が、配列変数であることを示す文字を指定する文字指定手順を含んでいる点が上記実施形態と異なる。同様に、本変形例は、コンピュータ10が、配列変数であることを示す文字を指定する文字指定部を含んでいる点が上記実施形態と異なる。なお、本実施形態では、上記実施形態と同様の処理に同じステップ番号を付与しているため、上記実施形態を参照して適用できる。
(Second Embodiment)
The second embodiment will be described with reference to FIG. 7. In the second embodiment, mainly the parts different from the above-described embodiment will be described. Further, this modification is different from the above embodiment in that the
図7を用いて、コンピュータ10の処理動作に関して説明する。CPU13は、例えば入力装置16によって挿入処理の実行指示がなされた場合に、図7に示すフローチャートを実行する。CPU13は、自動並列化コンパイラ1を実行することで、シングルプログラムから並列プログラム21a1を生成する。CPU13は、特開2015−1807号公報に記載された手順に従って並列プログラム21a1を生成する際に、下記のステップS20、S10〜S17を実行する。また、CPU13は、ステップS10の前にステップS20を実行する。
The processing operation of the
ステップS20では、配列変数であることを示す文字を指定する(文字指定部)。CPU13は、例えばソフト設計者などが指定した、配列変数であることを示す文字を指定する。この文字は、シングルプログラムの記述ルールに則った文字でなく、ソフト設計者などが任意で指定した文字である。
In step S20, a character indicating that the variable is an array variable is specified (character designation unit). The
CPU13は、自動並列化コンパイラ1を実行することで配列変数であることを示す文字を指定する。このため、自動並列化コンパイラ1は、文字指定手順を含んでいると言える。つまり、自動並列化コンパイラ1は、配列変数であることを示す文字を指定する文字指定手順を含んでいる。
The
このため、CPU13は、ステップS12において、ステップS20で指定された文字を用いて、配列変数文字の有無を判定する。しかしながら、CPU13は、ステップS20で指定された文字に加えて、上記実施形態と同様に、シングルプログラムの記述ルールに準拠した配列変数であることを示す文字があるか否かを判定してもよい。
Therefore, in step S12, the
コンピュータ10および自動並列化コンパイラ1は、上記実施形態と同様の効果を奏することができる。さらに、コンピュータ10および自動並列化コンパイラ1は、配列変数であることを示す文字を指定できるため、使用するプログラム言語が変更になり、配列変数である事を示す文字が変わったとしても並列プログラム21a1を生成できる。よって、コンピュータ10および自動並列化コンパイラ1は、プログラム言語の変更によるソフト開発プロセスの改定およびツールの再購入の抑制や、バージョンアップの手間を削減することができる。これに伴って、コンピュータ10および自動並列化コンパイラ1は、コストの削減が期待できる。
The
車載装置20は、上記実施形態と同様に、コンピュータ10で生成された並列プログラム21a1を備えている。よって、車載装置20は、上記実施形態と同様の効果を奏することができる。
The in-
(第3実施形態)
図8、図9を用いて、第3実施形態に関して説明する。第3実施形態では、主に、上記実施形態と異なる部分に関して説明する。また、本変形例は、自動並列化コンパイラ1が、要素番号特定手順を含んでいる点が上記実施形態と異なる。同様に、本変形例は、コンピュータ10が、要素番号特定部を含んでいる点が上記実施形態と異なる。なお、本実施形態では、上記実施形態と同様の処理に同じステップ番号を付与しているため、上記実施形態を参照して適用できる。
(Third Embodiment)
The third embodiment will be described with reference to FIGS. 8 and 9. In the third embodiment, mainly the parts different from the above-described embodiment will be described. Further, this modification is different from the above embodiment in that the
図9に、一例として、C言語で記述されたシングルプログラムの一部(プログラムコード例)を示す。シングルプログラムは、例えばArray[0]〜Array[3]に0を代入したい場合、汎用性向上のためにArray[index]と記述される場合がある。このように、シングルプログラムは、配列変数文字の後、例えば配列要素番号に該当する箇所に、配列変数とは異なる別変数名が用いられることがある。この場合、配列変数名の抽出結果は、Array[index]となる。 FIG. 9 shows a part (program code example) of a single program written in C language as an example. A single program may be described as Array [index] in order to improve versatility, for example, when it is desired to substitute 0 for Array [0] to Array [3]. As described above, in the single program, a different variable name different from the array variable may be used after the array variable character, for example, in the place corresponding to the array element number. In this case, the extraction result of the array variable name is Array [index].
そこで、コンピュータ10(CPU13)は、ステップS12でYES判定した場合、ステップS30に進む。ステップS30では、配列変数文字の後に変数名が指定されているか否かを判定する(要素番号特定部)。つまり、CPU13は、ステップS12で特定された配列変数における配列変数文字の後に、配列変数とは異なる別変数名が用いられているか否かを判定する。そして、CPU13は、指定されていると判定した場合はステップS31へ進み、指定されていると判定しなかった場合はステップS14へ進む。
Therefore, if the computer 10 (CPU 13) determines YES in step S12, the computer 10 (CPU 13) proceeds to step S30. In step S30, it is determined whether or not the variable name is specified after the array variable character (element number specifying unit). That is, the
ステップS31では、CPU13は、配列変数文字の後の変数名を全ファイルに対して検索およびコード解析を行い、要素番号を特定する(要素番号特定部)。つまり、CPU13は、別変数名が取りうる値をシングルプログラムから解析して要素番号を特定する。図9の例では、要素番号として0、1、2、3を特定することになる。このため、CPU13は、ステップS31を経てステップS14へ進んだ場合、ステップS31で特定された要素番号を用いて変数名を定義する(変数名定義部)。
In step S31, the
CPU13は、自動並列化コンパイラ1を実行することで、上記のように要素番号を特定する。このため、自動並列化コンパイラ1は、要素番号特定手順を含んでいると言える。つまり、自動並列化コンパイラ1は、ステップS12で特定された配列変数における配列変数文字の後に別変数名が用いられていた場合、別変数名が取りうる値をシングルプログラムから解析して要素番号を特定する要素番号特定手順を含んでいる。
The
このため、コンピュータ10および自動並列化コンパイラ1は、配列変数文字の後に別変数名が記載されていた場合であっても、各配列要素を個別の変数として扱うことができる。よって、コンピュータ10および自動並列化コンパイラ1は、配列変数文字の後に別変数名が記載されていた場合であっても、第1実施形態と同様の効果を奏することができる。
Therefore, the
車載装置20は、第1実施形態と同様に、コンピュータ10で生成された並列プログラム21a1を備えている。よって、車載装置20は、第1実施形態と同様の効果を奏することができる。
The in-
なお、第3実施形態は、第2実施形態と組み合わせて実施することもできる。すなわち、コンピュータ10は、ステップS10の前にステップS20を実施してもよい。また、自動並列化コンパイラ1は、配列変数であることを示す文字を指定する文字指定手順を含んでいてもよい。
The third embodiment can also be implemented in combination with the second embodiment. That is, the
(第4実施形態)
図10、図11を用いて、第4実施形態に関して説明する。第4実施形態では、主に、上記実施形態と異なる部分に関して説明する。また、本変形例は、自動並列化コンパイラ1が、要素番号特定手順を含んでいる点が上記実施形態と異なる。同様に、本変形例は、コンピュータ10が、要素番号特定部を含んでいる点が上記実施形態と異なる。なお、本実施形態では、上記実施形態と同様の処理に同じステップ番号を付与しているため、上記実施形態を参照して適用できる。
(Fourth Embodiment)
The fourth embodiment will be described with reference to FIGS. 10 and 11. In the fourth embodiment, mainly the parts different from the above-described embodiment will be described. Further, this modification is different from the above embodiment in that the
図11に、一例として、C言語で記述されたシングルプログラムの一部(プログラムコード例)を示す。シングルプログラムは、Array[0]〜[3]に0を代入、またはArray[0]〜[2]に0を代入したい場合、汎用性向上やROM容量削減のために、図11のように記述される場合がある。このように、シングルプログラムは、配列変数文字の後、例えば配列要素番号に該当する箇所に、配列変数とは異なる別変数名が用いられることがある。この場合、配列変数名の抽出結果は、Array[data1]となる。なお、この例のFuncAでは、Array[0]〜[3]に0を代入する。一方、FuncBでは、Array[0]〜[2]に0を代入する。 FIG. 11 shows a part (program code example) of a single program written in C language as an example. A single program is described as shown in FIG. 11 in order to improve versatility and reduce ROM capacity when it is desired to substitute 0 for Array [0] to [3] or 0 for Array [0] to [2]. May be done. As described above, in the single program, a different variable name different from the array variable may be used after the array variable character, for example, in the place corresponding to the array element number. In this case, the extraction result of the array variable name is Array [data1]. In FuncaA of this example, 0 is substituted for Array [0] to [3]. On the other hand, in FuncB, 0 is substituted for Array [0] to [2].
このように、図11に示すプログラムコード例は、図9に示すプログラムコード例よりも複雑化していると言える。このため、上記第3実施形態では、要素番号を特定するためのコード解析に多くの時間を要する可能性がある。 As described above, it can be said that the program code example shown in FIG. 11 is more complicated than the program code example shown in FIG. Therefore, in the third embodiment, it may take a lot of time to analyze the code for specifying the element number.
そこで、コンピュータ10は、シングルプログラムにおける処理がアクセスする配列要素を含む要素情報リストを備えておく。要素情報リストは、FuncAの場合、Array[0]、Array[1]、Array[2]、Array[3]が記載されており、FuncBの場合、Array[0]、Array[1]、Array[2]が記載されている。
Therefore, the
そして、コンピュータ10(CPU13)は、ステップS12でYES判定した場合、ステップS40に進む。ステップS40では、ステップS30と同様に、配列変数文字の後に変数名が指定されているか否かを判定する(要素番号特定部)。 Then, if the computer 10 (CPU 13) determines YES in step S12, the computer 10 (CPU 13) proceeds to step S40. In step S40, as in step S30, it is determined whether or not the variable name is specified after the array variable character (element number specifying unit).
CPU13は、ステップS41において、配列変数の要素情報リストを検索し、要素番号を特定する(要素番号特定部)。つまり、CPU13は、別変数名でアクセスする配列要素を要素情報リストから検索し、要素番号を特定する。図11の例では、FuncAの場合、要素番号として0、1、2、3を特定することになり、FuncBの場合、要素番号として0、1、2を特定することになる。このため、CPU13は、ステップS41を経てステップS14へ進んだ場合、ステップS41で特定された要素番号を用いて変数名を定義する(変数名定義部)。
In step S41, the
CPU13は、自動並列化コンパイラ1を実行することで、上記のように要素番号を特定する。このため、自動並列化コンパイラ1は、要素番号特定手順を含んでいると言える。つまり、自動並列化コンパイラ1は、ステップS12で特定された配列変数における配列変数文字の後に別変数名が用いられていた場合、別変数名でアクセスする配列要素を要素情報リストから検索し、要素番号を特定する要素番号特定手順を含んでいる。
The
このため、コンピュータ10および自動並列化コンパイラ1は、第1実施形態および第3実施形態と同様の効果を奏することができる。さらに、コンピュータ10および自動並列化コンパイラ1は、要素情報リストを検索して要素番号を特定するため、第3実施形態よりも短時間で要素番号を特定できる。
Therefore, the
車載装置20は、第1実施形態と同様に、コンピュータ10で生成された並列プログラム21a1を備えている。よって、車載装置20は、第1実施形態と同様の効果を奏することができる。
The in-
なお、第4実施形態は、第2実施形態と組み合わせて実施することもできる。すなわち、コンピュータ10は、ステップS10の前にステップS20を実施してもよい。また、自動並列化コンパイラ1は、配列変数であることを示す文字を指定する文字指定手順を含んでいてもよい。
The fourth embodiment can also be implemented in combination with the second embodiment. That is, the
1…自動並列化コンパイラ、10…コンピュータ、11…ディスプレイ、12…HDD、13…CPU、14…ROM、15…RAM、16…入力装置、17…読取部、18…記憶媒体、20…車載装置、21…マルチコアプロセッサ、21a…ROM、21a1…並列プログラム、21b…RAM、21c…第1コア、21d…第2コア、22…通信部、23…センサ部、24…入出力ポート 1 ... Automatic parallelizing compiler, 10 ... Computer, 11 ... Display, 12 ... HDD, 13 ... CPU, 14 ... ROM, 15 ... RAM, 16 ... Input device, 17 ... Reader, 18 ... Storage medium, 20 ... In-vehicle device , 21 ... Multi-core processor, 21a ... ROM, 21a1 ... Parallel program, 21b ... RAM, 21c ... 1st core, 21d ... 2nd core, 22 ... Communication unit, 23 ... Sensor unit, 24 ... Input / output port
Claims (15)
前記シングルプログラムから、複数の配列要素を含む配列変数であることを示す配列変数文字を検索して、前記配列変数を特定する配列変数特定手順(S12)と、
前記配列変数が特定された場合、前記配列変数における前記配列要素ごとに、前記配列変数の名称である配列変数名と、前記配列要素の番号である要素番号と、前記配列変数文字とを結合した文字列を変数名として定義する変数名定義手順(S14)と、
前記変数名定義手順で前記変数名が定義された定義済変数を含む変数を前記シングルプログラムから抽出して、前記変数にアクセスする複数の前記処理の依存関係を解析し、複数の前記処理の依存関係が保たれた前記並列プログラムを生成する生成手順(S17)と、を備えている並列化方法。 A parallelization method for generating a parallel program in which the above processes that can be parallelized for a multi-core microcomputer having a plurality of cores are generated from a single program including a plurality of processes described for a single-core microcomputer having one core. And
The sequence variable identification procedure (S12) for identifying the array variable by searching for an array variable character indicating that the array variable contains a plurality of array elements from the single program, and
When the array variable is specified, the array variable name which is the name of the array variable, the element number which is the number of the array element, and the array variable character are combined for each of the array elements in the array variable. The variable name definition procedure (S14) for defining a character string as a variable name, and
A variable including a defined variable whose variable name is defined in the variable name definition procedure is extracted from the single program, the dependency of a plurality of the processes that access the variable is analyzed, and the dependency of the plurality of processes is analyzed. A parallelization method comprising a generation procedure (S17) for generating the parallel program in which the relationship is maintained.
前記配列変数文字は、前記文字指定手順で指定された前記配列変数であることを示す文字である請求項1に記載の並列化方法。 A character specification procedure (S20) for designating a character indicating that the array variable is provided is provided.
The parallelization method according to claim 1, wherein the array variable character is a character indicating that the array variable character is the array variable specified in the character designation procedure.
前記変数名定義手順は、前記要素番号特定手順で前記要素番号が特定された場合、特定された前記要素番号を用いて前記変数名を定義する請求項2又は3に記載の並列化方法。 When a different variable name different from the array variable is used after the array variable character in the array variable specified in the array variable identification procedure, the value that the other variable name can take is analyzed from the single program. The element number specifying procedure (S30, S31) for specifying the element number is provided.
The parallelization method according to claim 2 or 3, wherein the variable name definition procedure defines the variable name using the specified element number when the element number is specified by the element number identification procedure.
前記配列変数特定手順で特定された前記配列変数における前記配列変数文字の後に、前記配列変数とは異なる別変数名が用いられていた場合、前記別変数名でアクセスする前記配列要素を前記要素情報リストから検索し、前記要素番号を特定する要素番号特定手順(S40、S41)と、を備え、
前記変数名定義手順は、前記要素番号特定手順で前記要素番号が特定された場合、特定された前記要素番号を用いて前記変数名を定義する請求項2又は3に記載の並列化方法。 It includes an element information list including the array elements accessed by the process in the single program.
When a different variable name different from the array variable is used after the array variable character in the array variable specified in the array variable identification procedure, the element information of the array element accessed by the different variable name is used. The element number specifying procedure (S40, S41) for searching from the list and specifying the element number is provided.
The parallelization method according to claim 2 or 3, wherein the variable name definition procedure defines the variable name using the specified element number when the element number is specified by the element number identification procedure.
前記シングルプログラムから、複数の配列要素を含む配列変数であることを示す配列変数文字を検索して、前記配列変数を特定する配列変数特定部(S12)と、
前記配列変数が特定された場合、前記配列変数における前記配列要素ごとに、前記配列変数の名称である配列変数名と、前記配列要素の番号である要素番号と、前記配列変数文字とを結合した文字列を変数名として定義する変数名定義部(S14)と、
前記変数名定義部で前記変数名が定義された定義済変数を含む変数を前記シングルプログラムから抽出して、前記変数にアクセスする複数の前記処理の依存関係を解析し、複数の前記処理の依存関係が保たれた前記並列プログラムを生成する生成部(S17)と、を備えている並列化ツール。 A computer that generates a parallel program that parallelizes the above processes that can be parallelized for a multi-core microcomputer with multiple cores from a single program that includes multiple processes described for a single-core microcomputer with one core. A parallelization tool that includes
From the single program, an array variable specifying unit (S12) that searches for an array variable character indicating that the array variable contains a plurality of array elements and specifies the array variable, and
When the array variable is specified, the array variable name which is the name of the array variable, the element number which is the number of the array element, and the array variable character are combined for each of the array elements in the array variable. The variable name definition unit (S14) that defines a character string as a variable name, and
A variable including a defined variable in which the variable name is defined by the variable name definition unit is extracted from the single program, the dependency of a plurality of the processes that access the variable is analyzed, and the dependency of the plurality of processes is analyzed. A parallelization tool including a generation unit (S17) that generates the parallel program in which the relationship is maintained.
前記配列変数文字は、前記文字指定部で指定された前記配列変数であることを示す文字である請求項6に記載の並列化ツール。 A character designation unit (S20) for designating a character indicating that the array variable is provided is provided.
The parallelization tool according to claim 6, wherein the array variable character is a character indicating that the array variable character is designated by the character designation unit.
前記変数名定義部は、前記要素番号特定部で前記要素番号が特定された場合、特定された前記要素番号を用いて前記変数名を定義する請求項7又は8に記載の並列化ツール。 When another variable name different from the array variable is used after the array variable character in the array variable specified by the array variable identification unit, the value that the other variable name can take is analyzed from the single program. The element number specifying unit (S30, S31) for specifying the element number is provided.
The parallelization tool according to claim 7 or 8, wherein the variable name definition unit defines the variable name using the specified element number when the element number is specified by the element number identification unit.
前記配列変数特定部で特定された前記配列変数における前記配列変数文字の後に、前記配列変数とは異なる別変数名が用いられていた場合、前記別変数名でアクセスする前記配列要素を前記要素情報リストから検索して前記要素番号を特定する要素番号特定部(S40、S41)と、を備え、
前記変数名定義部は、前記要素番号特定部で前記要素番号が特定された場合、特定された前記要素番号を用いて前記変数名を定義する請求項7又は8に記載の並列化ツール。 It includes an element information list including the array elements accessed by the process in the single program.
When a different variable name different from the array variable is used after the array variable character in the array variable specified by the array variable specifying unit, the element information of the array element accessed by the different variable name is used. It is provided with an element number specifying unit (S40, S41) that searches from a list and specifies the element number.
The parallelization tool according to claim 7 or 8, wherein the variable name definition unit defines the variable name using the specified element number when the element number is specified by the element number identification unit.
前記並列プログラムは、
前記シングルプログラムから、複数の配列要素を含む配列変数であることを示す配列変数文字を検索して前記配列変数が特定され、
特定された前記配列変数における前記配列要素ごとに、前記配列変数の名称である配列変数名と、前記配列要素の番号である要素番号と、前記配列変数文字とを結合した文字列を変数名として定義され、
前記変数名が定義された定義済変数を含む変数を前記シングルプログラムから抽出して、前記変数にアクセスする複数の前記処理の依存関係を解析し、依存関係が保たれた状態で複数の前記処理が各コアに割り当てられており、
前記マルチコアマイコンは、各コアが割り当てられた前記処理を実行する車載装置。 A multi-core microcomputer (21) having a plurality of cores (21c, 21d) and a parallel program (21a1) parallelized for the multi-core microcomputer from a plurality of processes in a single program for the single-core microcomputer having one core. It is an in-vehicle device equipped with
The parallel program
The array variable is identified by searching the array variable character indicating that it is an array variable containing a plurality of array elements from the single program.
For each of the array elements in the specified array variable, a character string obtained by combining the array variable name which is the name of the array variable, the element number which is the number of the array element, and the array variable character is used as the variable name. Defined
A variable including a defined variable in which the variable name is defined is extracted from the single program, the dependency of a plurality of the processes that access the variable is analyzed, and the plurality of the processes are maintained in a state where the dependency is maintained. Is assigned to each core,
The multi-core microcomputer is an in-vehicle device that executes the process to which each core is assigned.
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2017172395A JP6933063B2 (en) | 2017-09-07 | 2017-09-07 | Parallelization method, parallelization tool, in-vehicle device |
| DE102018214521.0A DE102018214521A1 (en) | 2017-09-07 | 2018-08-28 | Parallelization method, parallelizing tool and vehicle device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2017172395A JP6933063B2 (en) | 2017-09-07 | 2017-09-07 | Parallelization method, parallelization tool, in-vehicle device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2019049771A JP2019049771A (en) | 2019-03-28 |
| JP6933063B2 true JP6933063B2 (en) | 2021-09-08 |
Family
ID=65364251
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2017172395A Active JP6933063B2 (en) | 2017-09-07 | 2017-09-07 | Parallelization method, parallelization tool, in-vehicle device |
Country Status (2)
| Country | Link |
|---|---|
| JP (1) | JP6933063B2 (en) |
| DE (1) | DE102018214521A1 (en) |
Family Cites Families (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH02132525A (en) * | 1988-11-14 | 1990-05-22 | Hitachi Ltd | How to compile |
| JP2621555B2 (en) * | 1990-03-12 | 1997-06-18 | 日本電気株式会社 | Vectorization processing method |
| JP3535808B2 (en) * | 1999-05-31 | 2004-06-07 | Necエレクトロニクス株式会社 | Pair-down multiplication method, pair-down multiplication device, and computer-readable recording medium |
| JP4746285B2 (en) * | 2004-06-30 | 2011-08-10 | シスメックス株式会社 | Hematology analyzer, analysis program, fractionation area setting method |
| JP6018022B2 (en) | 2013-06-14 | 2016-11-02 | 株式会社デンソー | Parallel compilation method, parallel compiler, parallel compilation device, and in-vehicle device |
| JP2017107448A (en) * | 2015-12-10 | 2017-06-15 | 株式会社デンソー | Parallelization method, parallelization tool, in-vehicle device |
-
2017
- 2017-09-07 JP JP2017172395A patent/JP6933063B2/en active Active
-
2018
- 2018-08-28 DE DE102018214521.0A patent/DE102018214521A1/en active Pending
Also Published As
| Publication number | Publication date |
|---|---|
| JP2019049771A (en) | 2019-03-28 |
| DE102018214521A1 (en) | 2019-03-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Liu et al. | A compiler framework for extracting superword level parallelism | |
| JP4957729B2 (en) | Program parallelization method, program parallelization apparatus and program | |
| US8266603B2 (en) | Technique for allocating register to variable for compiling | |
| JP3901180B2 (en) | Program parallelization apparatus and method, and program | |
| US20100229161A1 (en) | Compile method and compiler | |
| JP2001147819A (en) | Optimization device and recording medium | |
| US6334137B1 (en) | Method and system for controlling parallel execution of jobs | |
| US10296316B2 (en) | Parallelization method, parallelization tool, and in-vehicle apparatus | |
| US20150277876A1 (en) | Compiling device, compiling method, and storage medium storing compiler program | |
| US20100153937A1 (en) | System and method for parallel execution of a program | |
| US10540156B2 (en) | Parallelization method, parallelization tool, and in-vehicle device | |
| JP3901182B2 (en) | Program parallelization apparatus and method, and program | |
| US9081561B2 (en) | Method for improving execution performance of multiply-add instruction during compiling | |
| JP6427055B2 (en) | Parallelizing compilation method and parallelizing compiler | |
| JP6933063B2 (en) | Parallelization method, parallelization tool, in-vehicle device | |
| US12164892B2 (en) | Methods and devices for compiler function fusion | |
| JP6933001B2 (en) | Parallelization method, parallelization tool | |
| Chang et al. | A programming system for future proofing performance critical libraries | |
| JP6488738B2 (en) | Parallelizing compilation method and parallelizing compiler | |
| JP6558310B2 (en) | Parallelization method, parallelization tool | |
| US20210157638A1 (en) | Method and apparatus for functional unit assignment | |
| JP7095513B2 (en) | Multi-core microcomputers and in-vehicle devices | |
| JP7059776B2 (en) | Parallelization method, parallelization tool, and multi-core microcontroller | |
| US7676799B1 (en) | Address simplification by binary transformation | |
| US10379828B2 (en) | Parallelization method, parallelization tool, and in-vehicle device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20200806 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20210630 |
|
| 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: 20210720 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20210802 |
|
| R151 | Written notification of patent or utility model registration |
Ref document number: 6933063 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 |