Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP6933063B2 - Parallelization method, parallelization tool, in-vehicle device - Google Patents
[go: Go Back, main page]

JP6933063B2 - Parallelization method, parallelization tool, in-vehicle device - Google Patents

Parallelization method, parallelization tool, in-vehicle device Download PDF

Info

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
Application number
JP2017172395A
Other languages
Japanese (ja)
Other versions
JP2019049771A (en
Inventor
貴之 永井
貴之 永井
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Denso Corp
Original Assignee
Denso Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Denso Corp filed Critical Denso Corp
Priority to JP2017172395A priority Critical patent/JP6933063B2/en
Priority to DE102018214521.0A priority patent/DE102018214521A1/en
Publication of JP2019049771A publication Critical patent/JP2019049771A/en
Application granted granted Critical
Publication of JP6933063B2 publication Critical patent/JP6933063B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/45Exploiting coarse grain parallelism in compilation, i.e. parallelism between groups of instructions
    • G06F8/456Parallelism 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 Patent Document 1 as an example of a parallelization method for generating a parallel program from a single program.

特開2015−1807号公報Japanese Unexamined Patent Publication No. 2015-1807

ところで、シングルコアマイコンは、シングルプログラムを実行することで、配列変数にアクセスすることもありうる。つまり、シングルプログラムには、配列変数が含まれていることがある。上記並列化コンパイル方法では、このようなシングルプログラムから並列プログラムを生成する場合、配列変数の全要素をまとめて一つの変数として扱い、依存関係の解析、処理順序の抽出、各コアへの配置を行うことになる。 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.

第1実施形態におけるコンピュータの概略構成を示すブロック図である。It is a block diagram which shows the schematic structure of the computer in 1st Embodiment. 第1実施形態における車載装置の概略構成を示すブロック図である。It is a block diagram which shows the schematic structure of the vehicle-mounted device in 1st Embodiment. 第1実施形態におけるコンピュータの処理を示すフローチャートである。It is a flowchart which shows the processing of the computer in 1st Embodiment. 第1実施形態における各処理と配列変数との関係を示すイメージ図である。It is an image diagram which shows the relationship between each process and an array variable in 1st Embodiment. 第1実施形態における並列化後の各処理と各コアとの一例を示すイメージ図である。It is an image diagram which shows an example of each process and each core after parallelization in 1st Embodiment. 第1実施形態における並列化後の各処理と各コアとの他の例を示すイメージ図である。It is an image diagram which shows another example of each process and each core after parallelization in 1st Embodiment. 第2実施形態におけるコンピュータの処理を示すフローチャートである。It is a flowchart which shows the processing of the computer in 2nd Embodiment. 第3実施形態におけるコンピュータの処理を示すフローチャートである。It is a flowchart which shows the processing of the computer in 3rd Embodiment. 第3実施形態におけるC言語で記述されたプログラムコード例である。This is an example of a program code written in C language in the third embodiment. 第4実施形態におけるコンピュータの処理を示すフローチャートである。It is a flowchart which shows the processing of the computer in 4th Embodiment. 第4実施形態におけるC言語で記述されたプログラムコード例である。This is an example of a program code written in C language in the fourth embodiment. 比較例における並列化後の各処理と各コアとの一例を示すイメージ図である。It is an image diagram which shows an example of each process after parallelization and each core in a comparative example.

以下において、図面を参照しながら、本開示を実施するための複数の形態を説明する。各形態において、先行する形態で説明した事項に対応する部分には同一の参照符号を付して重複する説明を省略する場合がある。各形態において、構成の一部のみを説明している場合は、構成の他の部分については先行して説明した他の形態を参照し適用することができる。 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 first core 21c and a second core 21d. 10 is adopted. That is, the computer 10 is a parallel program 21a1 that parallelizes processes that can be parallelized for a multi-core microcomputer having a plurality of cores from a single program including a plurality of processes described for a single-core microcomputer having one core. To generate.

なお、並列プログラム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 first core 21c and the second core 21d ( Perform processing (arrangement). This point can be applied with reference to Japanese Patent Application Laid-Open No. 2015-1807.

図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 computer 10 and the in-vehicle device 20 will be described. The computer 10 corresponds to a parallelization tool that executes the parallelization method. Further, since the computer 10 generates the parallel program 21a1, it can be said to be a program generation tool. As shown in FIG. 1, the computer 10 includes a display 11, an HDD 12, a CPU 13, a ROM 14, a RAM 15, an input device 16, a reading unit 17, and the like. Further, the computer 10 is configured to be able to read the stored contents stored in the storage medium 18. The automatic parallelizing compiler 1 is stored in the storage medium 18. The configurations of the computer 10 and the storage medium 18 can be applied with reference to the personal computer 100 and the storage medium 180 described in Japanese Patent Application Laid-Open No. 2015-1807.

自動並列化コンパイラ1は、並列化方法に相当する。つまり、自動並列化コンパイラ1は、並列化手順、言い換えると並列化方法が記述されたプログラムである。コンピュータ10は、自動並列化コンパイラ1を実行することで、並列プログラム21a1を生成する。このため、自動並列化コンパイラ1は、プログラム生成方法とも言える。自動並列化コンパイラ1は、特開2015−1807号公報に記載されたものを参照して適用できる。特に、自動並列化コンパイラ1は、配列変数特定手順と、変数名定義手順とを含んでいる。配列変数特定手順と変数名定義手順に関しては、後程詳しく説明する。 The automatic parallelization compiler 1 corresponds to the parallelization method. That is, the automatic parallelization compiler 1 is a program in which a parallelization procedure, in other words, a parallelization method is described. The computer 10 generates the parallel program 21a1 by executing the automatic parallelization compiler 1. Therefore, the automatic parallelizing compiler 1 can be said to be a program generation method. The automatic parallelizing compiler 1 can be applied by referring to those described in Japanese Patent Application Laid-Open No. 2015-1807. In particular, the automatic parallelizing compiler 1 includes an array variable identification procedure and a variable name definition procedure. The procedure for specifying the array variable and the procedure for defining the variable name will be described in detail later.

なお、自動並列化コンパイラ1は、依存関係を保つための同期処理や空きの挿入手順などを含んでいてもよい。この同期処理は、例えば、第1処理MT1〜第4処理MT4が終了するのを待って第5処理MT5が実行されるようにするための処理である。本実施形態では、図5に示すように、同期処理の一例として、第1同期処理W1と第2同期処理W2が挿入される例を採用している。また、本実施形態では、図5、図6に示すように、依存関係を保つための空きの一例として、第2の空きE2と第6の空きE6が挿入される例を採用している。 The automatic parallelizing compiler 1 may include a synchronization process for maintaining the dependency, a free space insertion procedure, and the like. This synchronous processing is, for example, a processing for waiting for the completion of the first processing MT1 to the fourth processing MT4 and executing the fifth processing MT5. In the present embodiment, as shown in FIG. 5, as an example of the synchronization process, an example in which the first synchronization process W1 and the second synchronization process W2 are inserted is adopted. Further, in the present embodiment, as shown in FIGS. 5 and 6, as an example of the vacancy for maintaining the dependency relationship, an example in which the second vacant E2 and the sixth vacant E6 are inserted is adopted.

コンピュータ10は、自動並列化コンパイラ1を実行することで、図5、図6に示すような、各コア21c、21dに対応した並列プログラム21a1を生成する。つまり、コンピュータ10は、第1処理MT1〜第5処理MT5などを第1コア21cや第2コア21dに配置、言い換えると割り当てられた並列プログラム21a1を生成する。 By executing the automatic parallelization compiler 1, the computer 10 generates a parallel program 21a1 corresponding to the cores 21c and 21d as shown in FIGS. 5 and 6. That is, the computer 10 arranges the first processing MT1 to the fifth processing MT5 and the like in the first core 21c and the second core 21d, in other words, generates the assigned parallel program 21a1.

図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 first core 21c, and the second processing MT2 and the fourth processing MT4 are arranged in the second core 21d. There is. Further, in the parallel program 21a1 shown in FIG. 5, the first synchronous processing W1 and the first empty E1 are arranged in the first core 21c, and the second synchronous processing W2, the second empty E2, and the third empty E3 are second. It is arranged in 2 cores 21d.

一方、図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 first core 21c. Further, in the parallel program 21a1 shown in FIG. 6, the fourth empty E4 is arranged in the first core 21c, and the fifth empty E5 to the seventh empty E7 are arranged in the second core 21d.

なお、本実施形態では、一例として、図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-vehicle device 20 includes a multi-core processor 21, a ROM 21a, a RAM 21b, a first core 21c, a second core 21d, a communication unit 22, a sensor unit 23, and an input / output port 24. The in-vehicle device 20 can be applied to, for example, an engine control device or a hybrid control device mounted on an automobile. Here, as an example, an example in which the in-vehicle device 20 is applied to the engine control device is adopted. In this case, the parallel program 21a1 can be said to be an automobile control program such as engine control. The multi-core processor 21 corresponds to a multi-core microcomputer. The core can also be referred to as a processor element.

RAM21b、通信部22、センサ部23、入出力ポート24は、特開2015−1807号公報に記載されたRAM420、通信部430、センサ部450、入出力ポート460を参照して適用できる。 The RAM 21b, the communication unit 22, the sensor unit 23, and the input / output port 24 can be applied with reference to the RAM 420, the communication unit 430, the sensor unit 450, and the input / output port 460 described in Japanese Patent Application Laid-Open No. 2015-1807.

ROM21aには、第1コア21cと第2コア21dが実行可能な並列プログラム21a1が含まれている。つまり、車載装置20は、シングルプログラムにおける複数の処理MT1〜MT5からマルチコアプロセッサ21用に並列化された並列プログラム21a1を備えていると言える。 The ROM 21a includes a parallel program 21a1 capable of executing the first core 21c and the second core 21d. That is, it can be said that the in-vehicle device 20 includes a parallel program 21a1 parallelized for the multi-core processor 21 from a plurality of processes MT1 to MT5 in a single program.

マルチコアプロセッサ21は、各コア21c、21dに割り当てられた処理を各コア21c、21dが実行する。第1コア21cと第2コア21dは、並列プログラム21a1を実行することで、例えばエンジン制御などを行う。言い換えると、第1コア21cと第2コア21dは、並列プログラム21a1に従って制御ロジックを実行することで、エンジン制御などを行う。 In the multi-core processor 21, the cores 21c and 21d execute the processes assigned to the cores 21c and 21d. The first core 21c and the second core 21d perform, for example, engine control by executing the parallel program 21a1. In other words, the first core 21c and the second core 21d perform engine control and the like by executing control logic according to the parallel program 21a1.

なお、本実施形態では、マルチコアプロセッサ21が車載装置20に搭載された例を採用している。しかしながら、本開示は、これに限定されず、マルチコアプロセッサ21が、車載装置20とは異なる機器、例えばパソコンなどに搭載されていてもよい。さらに、本実施形態では、二つのコア21c、21dを備えたマルチコアプロセッサ21を採用している。しかしながら、本開示は、三つ以上のコアを備えたマルチコアプロセッサ21であっても採用できる。 In this embodiment, an example in which the multi-core processor 21 is mounted on the in-vehicle device 20 is adopted. However, the present disclosure is not limited to this, and the multi-core processor 21 may be mounted on a device different from the in-vehicle device 20, for example, a personal computer. Further, in the present embodiment, a multi-core processor 21 having two cores 21c and 21d is adopted. However, the present disclosure can also be adopted in a multi-core processor 21 having three or more cores.

次に、図3を用いて、コンピュータ10の処理動作に関して説明する。CPU13は、例えば入力装置16によって挿入処理の実行指示がなされた場合に、図3に示すフローチャートを実行する。CPU13は、自動並列化コンパイラ1を実行することで、シングルプログラムから並列プログラム21a1を生成する。CPU13は、特開2015−1807号公報に記載された手順に従って並列プログラム21a1を生成する際に、下記のステップS10〜S17を実行する。 Next, the processing operation of the computer 10 will be described with reference to FIG. The CPU 13 executes the flowchart shown in FIG. 3 when, for example, the input device 16 gives an instruction to execute the insertion process. The CPU 13 generates the parallel program 21a1 from the single program by executing the automatic parallelization compiler 1. The CPU 13 executes the following steps S10 to S17 when generating the parallel program 21a1 according to the procedure described in Japanese Patent Application Laid-Open No. 2015-1807.

ステップS10では、抽出対象ファイルを選定する。CPU13は、シングルプログラムから抽出対象ファイル、すなわち処理を選定する。ステップS11では、アクセスする変数を検索する。CPU13は、ステップS10で選定した処理でアクセスする変数を検索する。 In step S10, the extraction target file is selected. The CPU 13 selects an extraction target file, that is, a process from a single program. In step S11, the variable to be accessed is searched. The CPU 13 searches for variables to be accessed in the process selected in step S10.

ステップ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 CPU 13 determines whether or not the variable that is the search result in step S11 contains an array variable character (array variable specifying unit). That is, the CPU 13 determines whether or not the variable obtained by the search in step S11 is an array variable. If the CPU 13 does not determine that the variable contains the array variable character, the CPU 13 determines that the variable is not an array variable and proceeds to step S13. On the other hand, when the CPU 13 determines that the variable contains the array variable character, the CPU 13 considers the variable to be an array variable and proceeds to step S14. In this way, the CPU 13 searches the single program for the array variable character indicating that it is an array variable, and identifies the array variable.

本実施形態では、シングルプログラムの記述ルールに準拠した配列変数であることを示す文字を、配列変数文字として採用している。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 CPU 13 determines whether or not there is a character indicating that it is an array variable according to the description rule of the single program. In the array variable description rule in the C language program, in the case of an array variable, [] always exists after the variable name. Therefore, the CPU 13 can determine whether or not the variable is an array variable depending on the presence or absence of [.

CPU13は、自動並列化コンパイラ1を実行することで配列変数を特定する。このため、自動並列化コンパイラ1は、配列変数特定手順を含んでいると言える。つまり、自動並列化コンパイラ1は、シングルプログラムから、複数の配列要素を含む配列変数であることを示す配列変数文字を検索して、配列変数を特定する配列変数特定手順を含んでいる。 The CPU 13 specifies an array variable by executing the automatic parallelizing compiler 1. Therefore, it can be said that the automatic parallelization compiler 1 includes an array variable identification procedure. That is, the automatic parallelizing compiler 1 includes an array variable identification procedure for identifying an array variable by searching for an array variable character indicating that the array variable includes a plurality of array elements from a single program.

ステップS13では、検索結果から変数名を抽出する。CPU13は、ステップS11で検索した変数から変数名を抽出する。 In step S13, the variable name is extracted from the search result. The CPU 13 extracts the variable name from the variable searched in step S11.

ステップ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 CPU 13 defines a character string obtained by combining an array variable name, an element number, and an array variable character as a variable name for each array element in the array variable. When, for example, Array [4] is specified as an array variable, the CPU 13 defines variable names such as Array [0], Array [1], Array [2], and Array [3] for each array element. This is because the parallel program 21a1 is generated by treating each of the array elements as one variable, instead of treating the array variable as one variable. The variable for which the variable name is defined here corresponds to the defined variable.

このように、CPU13は、配列変数の各要素へアクセスする場合、必ず要素番号が指定されるため、その要素番号を含めて変数名として定義する。CPU13は、シングルプログラムの記述ルールに則った文字を含めて変数名として定義する事で、シングルプログラム内での配列変数の要素毎の検索が容易になり、後程説明するステップS17の処理に要する時間を短くすることができる。つまり、CPU13は、依存関係の解析にかかる時間を短くすることができる。 In this way, when accessing each element of the array variable, the CPU 13 always specifies the element number, and therefore the CPU 13 defines the variable name including the element number. By defining the CPU 13 as a variable name including characters according to the description rules of the single program, it becomes easy to search for each element of the array variable in the single program, and the time required for the process of step S17 described later. Can be shortened. That is, the CPU 13 can shorten the time required for the dependency analysis.

CPU13は、自動並列化コンパイラ1を実行することで配列要素ごとに変数名を定義する。このため、自動並列化コンパイラ1は、変数名定義手順を含んでいると言える。つまり、自動並列化コンパイラ1は、配列変数が特定された場合、配列変数における配列要素ごとに、配列変数の名称である配列変数名と、配列要素の番号である要素番号と、配列変数文字とを結合した文字列を変数名として定義する変数名定義手順を含んでいる。 The CPU 13 defines a variable name for each array element by executing the automatic parallelization compiler 1. Therefore, it can be said that the automatic parallelization compiler 1 includes a variable name definition procedure. That is, when an array variable is specified, the automatic parallelization compiler 1 uses an array variable name, which is the name of the array variable, an element number, which is the number of the array element, and an array variable character, for each array element in the array variable. Includes a variable name definition procedure that defines a variable name that is a combination of.

ステップS15では、全ての変数名を検索したか否かを判定する。CPU13は、ステップS10で選定した処理がアクセスする全ての変数名を検索したか否かを判定し、検索したと判定した場合はステップS16へ進み、検索したと判定しなかった場合はステップS11へ戻る。 In step S15, it is determined whether or not all the variable names have been searched. The CPU 13 determines whether or not all the variable names accessed by the process selected in step S10 have been searched, proceeds to step S16 if it is determined to have searched, and proceeds to step S11 if it does not determine that the search has been performed. return.

ステップS16では、全てのファイルから抽出したか否かを判定する。CPU13は、シングルプログラムの全てのファイルから処理を抽出したか否かを判定し、抽出したと判定した場合はステップS17へ進み、抽出したと判定しなかった場合はステップS10へ戻る。 In step S16, it is determined whether or not the files have been extracted from all the files. The CPU 13 determines whether or not the process has been extracted from all the files of the single program, and if it is determined that the process has been extracted, the process proceeds to step S17, and if it is not determined that the process has been extracted, the process returns to step S10.

ステップ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 CPU 13 extracts variables including the defined variables whose variable names are defined in step S14 from a single program, analyzes the dependencies of a plurality of processes for accessing the variables, extracts the processing order, and performs a plurality of processes. Generate a parallel program that maintains the dependency of. That is, the CPU 13 analyzes the dependency of a plurality of processes for accessing the defined variable whose variable name is defined in step S14 and the variable whose variable name is extracted in step S13, and determines the dependency of the plurality of processes. The parallel program 21a1 in which the relationship is maintained is generated. That is, the CPU 13 arranges a plurality of processes in either the first core 21c or the second core 21d. This step S17 can be applied with reference to Japanese Patent Application Laid-Open No. 2015-1807. The variable whose variable name is extracted in step S13 can be regarded as a variable that is not an array variable included in the single program.

CPU13は、自動並列化コンパイラ1を実行することで並列プログラム21a1を生成する。このため、自動並列化コンパイラ1は、生成手順を含んでいると言える。つまり、自動並列化コンパイラ1は、定義済変数を含む変数をシングルプログラムから抽出して、変数にアクセスする複数の処理の依存関係の解析などを行い、複数の処理の依存関係が保たれた並列プログラム21a1を生成する生成手順を含んでいる。 The CPU 13 generates the parallel program 21a1 by executing the automatic parallelization compiler 1. Therefore, it can be said that the automatic parallelization compiler 1 includes a generation procedure. That is, the automatic parallelization compiler 1 extracts variables including defined variables from a single program, analyzes the dependencies of a plurality of processes that access the variables, and performs parallel processing in which the dependencies of the plurality of processes are maintained. It includes a generation procedure for generating the program 21a1.

このように、本実施形態では、コンピュータ10が、ステップS10〜S17を実行することで、図5や図6に示す並列プログラム21a1を生成する。しかしながら、本開示はこれに限定されない。作業者などが、特開2015−1807号公報に記載された並列化方法に加えて、ステップS10〜S17を行うことで、並列プログラム21a1を生成してもよい。 As described above, in the present embodiment, the computer 10 generates the parallel program 21a1 shown in FIGS. 5 and 6 by executing steps S10 to S17. However, the present disclosure is not limited to this. An operator or the like may generate the parallel program 21a1 by performing steps S10 to S17 in addition to the parallelization method described in Japanese Patent Application Laid-Open No. 2015-1807.

ここで、コンピュータ10と比較例の並列化ツールとを対比しつつ、本開示の効果を説明する。比較例の並列化ツールは、配列変数を一つの変数として扱う点がコンピュータ10と異なる。 Here, the effect of the present disclosure will be described while comparing the computer 10 with the parallelization tool of the comparative example. The parallelization tool of the comparative example differs from the computer 10 in that it treats an array variable as one variable.

比較例の並列化ツールでは、シングルプログラムから変数名を抽出および定義し、依存関係の解析などを行い、第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 first core 21c and the second core 21d. That is, the parallelization tool of the comparative example performs steps S10, S11, S13, and S15 to S17 without performing steps S12 and S14 of FIG.

よって比較例の並列化ツールは、依存関係が無い配列要素間であっても依存関係が有るものとして扱うことになる。このため、比較例の並列化ツールは、図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 first core 21c, and the second processed MT2 and the fourth processed MT4 are arranged in the second core 21d. Further, in the first pattern, two free E10s and E11s for maintaining a dependency relationship with the four synchronization processes W10 to W13 are arranged in the first core 21c, and the dependency relationship is maintained with the four synchronization processes W14 to W17. Three empty E12 to E14 are arranged in the second core 21d.

第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 first core 21c. Further, in the second pattern, one free E15 is arranged in the first core 21c, and a free E16 for maintaining a dependency relationship with the one free E17 is arranged in the second core 21d.

第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 computer 10 identifies the array variable V1 from the single program. Then, the computer 10 combines the array variable name, which is the name of the array variable V1, the element number, which is the number of the array element, and the array variable character for each of the array elements V11 to V14 in the array variable V1. Is defined as a variable name. Therefore, the computer 10 does not treat the array variable V1 as one variable, but can treat each of the plurality of array elements V11 to V14 included in the array variable V1 as one variable. That is, the computer 10 can handle each of the array elements V11 to V14 as individual variables.

そして、コンピュータ10は、このように定義した定義済変数を含む変数をシングルプログラムから抽出する。また、コンピュータ10は、この変数にアクセスする複数の処理MT1〜MT5などの依存関係の解析などを行い、複数の処理MT1〜MT5の依存関係が保たれた並列プログラム21a1を生成する。ことのとき、コンピュータ10は、複数の配列要素V11〜V14のそれぞれを一つの変数として扱って依存関係の解析などを行うので、依存関係がないにもかかわらず、依存関係があるとすることを抑制できる。よって、コンピュータ10は、同期処理や依存関係を保つための空きが必要以上に多くなることを抑制でき、適切に並列プログラム21a1を生成できる。つまり、コンピュータ10は、上記のように比較例の並列化ツールよりも、同期処理や依存関係を保つための空きが少ない、並列プログラム21a1を生成できる。 Then, the computer 10 extracts the variable including the defined variable defined in this way from the single program. Further, the computer 10 analyzes the dependencies of the plurality of processes MT1 to MT5 that access this variable, and generates a parallel program 21a1 in which the dependencies of the plurality of processes MT1 to MT5 are maintained. At this time, the computer 10 treats each of the plurality of array elements V11 to V14 as one variable and analyzes the dependency, so that it is assumed that there is a dependency even though there is no dependency. Can be suppressed. Therefore, the computer 10 can suppress the synchronization processing and the free space for maintaining the dependency from becoming unnecessarily large, and can appropriately generate the parallel program 21a1. That is, the computer 10 can generate the parallel program 21a1 which has less space for maintaining the synchronization processing and the dependency than the parallelization tool of the comparative example as described above.

コンピュータ10は、自動並列化コンパイラ1を実行することで、同期処理や依存関係を保つための空きが必要以上に多くなることを抑制でき、適切に並列プログラム21a1を生成できる。よって、自動並列化コンパイラ1は、コンピュータ10と同様に、同期処理や依存関係を保つための空きが必要以上に多くなることを抑制でき、適切に並列プログラム21a1を生成できる。 By executing the automatic parallelization compiler 1, the computer 10 can suppress an unnecessarily large amount of space for maintaining synchronization processing and dependencies, and can appropriately generate a parallel program 21a1. Therefore, like the computer 10, the automatic parallelizing compiler 1 can suppress an unnecessarily large amount of space for maintaining synchronization processing and dependencies, and can appropriately generate a parallel program 21a1.

また、車載装置20におけるシングルプログラムでは、配列要素毎に依存関係がない場合が多数存在する。例えば、4気筒エンジンを駆動制御するためのシングルプログラムは、配列要素を四つ用意して、各配列要素を各気筒特有の制御用データとして使う。このような場合、コンピュータ10および自動並列化コンパイラ1は有効である。 Further, in the single program in the in-vehicle device 20, there are many cases where there is no dependency relationship for each array element. For example, in a single program for driving and controlling a 4-cylinder engine, four array elements are prepared and each array element is used as control data peculiar to each cylinder. In such a case, the computer 10 and the automatic parallelizing compiler 1 are effective.

さらに、車載装置20は、コンピュータ10で生成された並列プログラム21a1を備えている。つまり、車載装置20は、同期処理や依存関係を保つための空きが必要以上に多くなることが抑制され、適切に生成された並列プログラム21a1を備えている。そして、車載装置20は、このような並列プログラム21a1をマルチコアプロセッサ21の各コア21c、21dが実行する。このため、車載装置20は、同期処理の分だけ処理負荷が増加したり、依存関係を保つための空きの分だけ処理効率が低下することを抑制でき、複数のコア21c、21dで適切に処理を行なうことができる。 Further, the in-vehicle device 20 includes a parallel program 21a1 generated by the computer 10. That is, the in-vehicle device 20 includes a parallel program 21a1 that is appropriately generated while suppressing an unnecessarily large amount of space for synchronizing processing and maintaining the dependency relationship. Then, in the in-vehicle device 20, such parallel programs 21a1 are executed by the cores 21c and 21d of the multi-core processor 21. Therefore, the in-vehicle device 20 can prevent the processing load from increasing by the amount of synchronous processing and the processing efficiency from decreasing by the amount of space for maintaining the dependency, and can be appropriately processed by the plurality of cores 21c and 21d. Can be done.

以上、本開示の好ましい実施形態について説明した。しかしながら、本開示は、上記実施形態に何ら制限されることはなく、本開示の趣旨を逸脱しない範囲において、種々の変形が可能である。以下に、本開示のその他の形態として、第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 automatic parallelizing compiler 1 includes a character designation procedure for designating a character indicating that it is an array variable. Similarly, this modification is different from the above embodiment in that the computer 10 includes a character designation unit for designating a character indicating that it is an array variable. In this embodiment, since the same step number is assigned to the same process as in the above embodiment, it can be applied with reference to the above embodiment.

図7を用いて、コンピュータ10の処理動作に関して説明する。CPU13は、例えば入力装置16によって挿入処理の実行指示がなされた場合に、図7に示すフローチャートを実行する。CPU13は、自動並列化コンパイラ1を実行することで、シングルプログラムから並列プログラム21a1を生成する。CPU13は、特開2015−1807号公報に記載された手順に従って並列プログラム21a1を生成する際に、下記のステップS20、S10〜S17を実行する。また、CPU13は、ステップS10の前にステップS20を実行する。 The processing operation of the computer 10 will be described with reference to FIG. 7. The CPU 13 executes the flowchart shown in FIG. 7, for example, when the input device 16 gives an instruction to execute the insertion process. The CPU 13 generates the parallel program 21a1 from the single program by executing the automatic parallelization compiler 1. The CPU 13 executes the following steps S20 and S10 to S17 when generating the parallel program 21a1 according to the procedure described in Japanese Patent Application Laid-Open No. 2015-1807. Further, the CPU 13 executes step S20 before step S10.

ステップS20では、配列変数であることを示す文字を指定する(文字指定部)。CPU13は、例えばソフト設計者などが指定した、配列変数であることを示す文字を指定する。この文字は、シングルプログラムの記述ルールに則った文字でなく、ソフト設計者などが任意で指定した文字である。 In step S20, a character indicating that the variable is an array variable is specified (character designation unit). The CPU 13 specifies a character indicating that it is an array variable, for example, specified by a software designer or the like. This character is not a character that conforms to the description rules of a single program, but is a character arbitrarily specified by a software designer or the like.

CPU13は、自動並列化コンパイラ1を実行することで配列変数であることを示す文字を指定する。このため、自動並列化コンパイラ1は、文字指定手順を含んでいると言える。つまり、自動並列化コンパイラ1は、配列変数であることを示す文字を指定する文字指定手順を含んでいる。 The CPU 13 specifies a character indicating that it is an array variable by executing the automatic parallelizing compiler 1. Therefore, it can be said that the automatic parallelizing compiler 1 includes a character specification procedure. That is, the automatic parallelizing compiler 1 includes a character specification procedure for designating a character indicating that it is an array variable.

このため、CPU13は、ステップS12において、ステップS20で指定された文字を用いて、配列変数文字の有無を判定する。しかしながら、CPU13は、ステップS20で指定された文字に加えて、上記実施形態と同様に、シングルプログラムの記述ルールに準拠した配列変数であることを示す文字があるか否かを判定してもよい。 Therefore, in step S12, the CPU 13 determines the presence / absence of the array variable character by using the character specified in step S20. However, the CPU 13 may determine whether or not there is a character indicating that the array variable conforms to the description rule of the single program in addition to the character specified in step S20, as in the above embodiment. ..

コンピュータ10および自動並列化コンパイラ1は、上記実施形態と同様の効果を奏することができる。さらに、コンピュータ10および自動並列化コンパイラ1は、配列変数であることを示す文字を指定できるため、使用するプログラム言語が変更になり、配列変数である事を示す文字が変わったとしても並列プログラム21a1を生成できる。よって、コンピュータ10および自動並列化コンパイラ1は、プログラム言語の変更によるソフト開発プロセスの改定およびツールの再購入の抑制や、バージョンアップの手間を削減することができる。これに伴って、コンピュータ10および自動並列化コンパイラ1は、コストの削減が期待できる。 The computer 10 and the automatic parallelizing compiler 1 can achieve the same effects as those in the above embodiment. Further, since the computer 10 and the automatic parallelizing compiler 1 can specify characters indicating that they are array variables, the programming language used is changed, and even if the characters indicating that they are array variables are changed, the parallel program 21a1 Can be generated. Therefore, the computer 10 and the automatic parallelizing compiler 1 can reduce the trouble of revising the software development process by changing the programming language, suppressing the repurchase of tools, and upgrading the version. Along with this, the computer 10 and the automatic parallelizing compiler 1 can be expected to reduce costs.

車載装置20は、上記実施形態と同様に、コンピュータ10で生成された並列プログラム21a1を備えている。よって、車載装置20は、上記実施形態と同様の効果を奏することができる。 The in-vehicle device 20 includes a parallel program 21a1 generated by the computer 10 as in the above embodiment. Therefore, the in-vehicle device 20 can exert the same effect as that of the above embodiment.

(第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 automatic parallelizing compiler 1 includes an element number specifying procedure. Similarly, this modification is different from the above embodiment in that the computer 10 includes an element number specifying unit. In this embodiment, since the same step number is assigned to the same process as in the above embodiment, it can be applied with reference to the above embodiment.

図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 CPU 13 determines whether or not a different variable name different from the array variable is used after the array variable character in the array variable specified in step S12. Then, if it is determined that the CPU 13 is designated, the process proceeds to step S31, and if it is not determined that the designation is not specified, the CPU 13 proceeds to step S14.

ステップS31では、CPU13は、配列変数文字の後の変数名を全ファイルに対して検索およびコード解析を行い、要素番号を特定する(要素番号特定部)。つまり、CPU13は、別変数名が取りうる値をシングルプログラムから解析して要素番号を特定する。図9の例では、要素番号として0、1、2、3を特定することになる。このため、CPU13は、ステップS31を経てステップS14へ進んだ場合、ステップS31で特定された要素番号を用いて変数名を定義する(変数名定義部)。 In step S31, the CPU 13 searches all files for the variable name after the array variable character and performs code analysis to specify the element number (element number specifying unit). That is, the CPU 13 analyzes the value that can be taken by another variable name from the single program and specifies the element number. In the example of FIG. 9, 0, 1, 2, and 3 are specified as element numbers. Therefore, when the CPU 13 proceeds to step S14 through step S31, the CPU 13 defines a variable name using the element number specified in step S31 (variable name definition unit).

CPU13は、自動並列化コンパイラ1を実行することで、上記のように要素番号を特定する。このため、自動並列化コンパイラ1は、要素番号特定手順を含んでいると言える。つまり、自動並列化コンパイラ1は、ステップS12で特定された配列変数における配列変数文字の後に別変数名が用いられていた場合、別変数名が取りうる値をシングルプログラムから解析して要素番号を特定する要素番号特定手順を含んでいる。 The CPU 13 specifies the element number as described above by executing the automatic parallelizing compiler 1. Therefore, it can be said that the automatic parallelizing compiler 1 includes an element number specifying procedure. That is, when another variable name is used after the array variable character in the array variable specified in step S12, the automatic parallelizing compiler 1 analyzes the value that the other variable name can take from a single program and obtains the element number. Includes the element number identification procedure to be identified.

このため、コンピュータ10および自動並列化コンパイラ1は、配列変数文字の後に別変数名が記載されていた場合であっても、各配列要素を個別の変数として扱うことができる。よって、コンピュータ10および自動並列化コンパイラ1は、配列変数文字の後に別変数名が記載されていた場合であっても、第1実施形態と同様の効果を奏することができる。 Therefore, the computer 10 and the automatic parallelizing compiler 1 can treat each array element as an individual variable even when another variable name is described after the array variable character. Therefore, the computer 10 and the automatic parallelizing compiler 1 can obtain the same effect as that of the first embodiment even when another variable name is described after the array variable character.

車載装置20は、第1実施形態と同様に、コンピュータ10で生成された並列プログラム21a1を備えている。よって、車載装置20は、第1実施形態と同様の効果を奏することができる。 The in-vehicle device 20 includes a parallel program 21a1 generated by the computer 10 as in the first embodiment. Therefore, the in-vehicle device 20 can achieve the same effect as that of the first embodiment.

なお、第3実施形態は、第2実施形態と組み合わせて実施することもできる。すなわち、コンピュータ10は、ステップS10の前にステップS20を実施してもよい。また、自動並列化コンパイラ1は、配列変数であることを示す文字を指定する文字指定手順を含んでいてもよい。 The third embodiment can also be implemented in combination with the second embodiment. That is, the computer 10 may perform step S20 before step S10. Further, the automatic parallelizing compiler 1 may include a character specification procedure for designating a character indicating that it is an array variable.

(第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 automatic parallelizing compiler 1 includes an element number specifying procedure. Similarly, this modification is different from the above embodiment in that the computer 10 includes an element number specifying unit. In this embodiment, since the same step number is assigned to the same process as in the above embodiment, it can be applied with reference to the above embodiment.

図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 computer 10 includes an element information list including array elements accessed by the processing in the single program. In the case of FuncA, the element information list includes Array [0], Array [1], Array [2], and Array [3], and in the case of FuncB, Array [0], Array [1], and Array [3]. 2] is described.

そして、コンピュータ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 CPU 13 searches the element information list of the array variable and specifies the element number (element number specifying unit). That is, the CPU 13 searches the element information list for the array element to be accessed with another variable name, and specifies the element number. In the example of FIG. 11, in the case of FuncaA, 0, 1, 2, and 3 are specified as element numbers, and in the case of FuncaB, 0, 1, and 2 are specified as element numbers. Therefore, when the CPU 13 proceeds to step S14 through step S41, the CPU 13 defines a variable name using the element number specified in step S41 (variable name definition unit).

CPU13は、自動並列化コンパイラ1を実行することで、上記のように要素番号を特定する。このため、自動並列化コンパイラ1は、要素番号特定手順を含んでいると言える。つまり、自動並列化コンパイラ1は、ステップS12で特定された配列変数における配列変数文字の後に別変数名が用いられていた場合、別変数名でアクセスする配列要素を要素情報リストから検索し、要素番号を特定する要素番号特定手順を含んでいる。 The CPU 13 specifies the element number as described above by executing the automatic parallelizing compiler 1. Therefore, it can be said that the automatic parallelizing compiler 1 includes an element number specifying procedure. That is, when another variable name is used after the array variable character in the array variable specified in step S12, the automatic parallelizing compiler 1 searches the element information list for the array element to be accessed by the different variable name, and the element. Includes an element numbering procedure to identify the number.

このため、コンピュータ10および自動並列化コンパイラ1は、第1実施形態および第3実施形態と同様の効果を奏することができる。さらに、コンピュータ10および自動並列化コンパイラ1は、要素情報リストを検索して要素番号を特定するため、第3実施形態よりも短時間で要素番号を特定できる。 Therefore, the computer 10 and the automatic parallelizing compiler 1 can achieve the same effects as those of the first embodiment and the third embodiment. Further, since the computer 10 and the automatic parallelizing compiler 1 search the element information list to specify the element number, the element number can be specified in a shorter time than in the third embodiment.

車載装置20は、第1実施形態と同様に、コンピュータ10で生成された並列プログラム21a1を備えている。よって、車載装置20は、第1実施形態と同様の効果を奏することができる。 The in-vehicle device 20 includes a parallel program 21a1 generated by the computer 10 as in the first embodiment. Therefore, the in-vehicle device 20 can achieve the same effect as that of the first embodiment.

なお、第4実施形態は、第2実施形態と組み合わせて実施することもできる。すなわち、コンピュータ10は、ステップS10の前にステップS20を実施してもよい。また、自動並列化コンパイラ1は、配列変数であることを示す文字を指定する文字指定手順を含んでいてもよい。 The fourth embodiment can also be implemented in combination with the second embodiment. That is, the computer 10 may perform step S20 before step S10. Further, the automatic parallelizing compiler 1 may include a character specification procedure for designating a character indicating that it is an array variable.

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に記載の並列化方法。 The parallelization method according to claim 1, wherein the array variable character is a character indicating that the array variable conforms to the description rule of the single program. 前記配列変数であることを示す文字を指定する文字指定手順(S20)を備え、
前記配列変数文字は、前記文字指定手順で指定された前記配列変数であることを示す文字である請求項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.
前記配列変数特定手順で特定された前記配列変数における前記配列変数文字の後に、前記配列変数とは異なる別変数名が用いられていた場合、前記別変数名が取りうる値を前記シングルプログラムから解析して前記要素番号を特定する要素番号特定手順(S30、S31)を備え、
前記変数名定義手順は、前記要素番号特定手順で前記要素番号が特定された場合、特定された前記要素番号を用いて前記変数名を定義する請求項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に記載の並列化ツール。 The parallelization tool according to claim 6, wherein the array variable character is a character indicating that the array variable conforms to the description rule of the single program. 前記配列変数であることを示す文字を指定する文字指定部(S20)を備え、
前記配列変数文字は、前記文字指定部で指定された前記配列変数であることを示す文字である請求項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.
前記配列変数特定部で特定された前記配列変数における前記配列変数文字の後に、前記配列変数とは異なる別変数名が用いられていた場合、前記別変数名が取りうる値を前記シングルプログラムから解析して前記要素番号を特定する要素番号特定部(S30、S31)を備え、
前記変数名定義部は、前記要素番号特定部で前記要素番号が特定された場合、特定された前記要素番号を用いて前記変数名を定義する請求項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.
複数のコア(21c、21d)を有するマルチコアマイコン(21)と、前記コアが一つであるシングルコアマイコン用のシングルプログラムにおける複数の処理から前記マルチコアマイコン用に並列化された並列プログラム(21a1)と、を備えた車載装置であって、
前記並列プログラムは、
前記シングルプログラムから、複数の配列要素を含む配列変数であることを示す配列変数文字を検索して前記配列変数が特定され、
特定された前記配列変数における前記配列要素ごとに、前記配列変数の名称である配列変数名と、前記配列要素の番号である要素番号と、前記配列変数文字とを結合した文字列を変数名として定義され、
前記変数名が定義された定義済変数を含む変数を前記シングルプログラムから抽出して、前記変数にアクセスする複数の前記処理の依存関係を解析し、依存関係が保たれた状態で複数の前記処理が各コアに割り当てられており、
前記マルチコアマイコンは、各コアが割り当てられた前記処理を実行する車載装置。
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.
前記配列変数文字は、前記シングルプログラムの記述ルールに準拠した前記配列変数であることを示す文字である請求項11に記載の車載装置。 The vehicle-mounted device according to claim 11, wherein the array variable character is a character indicating that the array variable conforms to the description rule of the single program. 前記配列変数文字は、指定された前記配列変数であることを示す文字である請求項11に記載の車載装置。 The vehicle-mounted device according to claim 11, wherein the array variable character is a character indicating that the array variable is a designated character. 前記並列プログラムは、特定された前記配列変数における前記配列変数文字の後に、前記配列変数とは異なる別変数名が用いられていた場合に、前記別変数名が取りうる値を前記シングルプログラムから解析して前記要素番号が特定され、特定された前記要素番号を用いて前記変数名を定義されている請求項12又は13に記載の車載装置。 The parallel program analyzes the value that can be taken by the different variable name from the single program when a different variable name different from the sequence variable is used after the sequence variable character in the specified array variable. The vehicle-mounted device according to claim 12 or 13, wherein the element number is specified and the variable name is defined using the specified element number. 前記並列プログラムは、特定された前記配列変数における前記配列変数文字の後に、前記配列変数とは異なる別変数名が用いられていた場合に、前記シングルプログラムにおける前記処理がアクセスする前記配列要素を含む要素情報リストから、前記別変数名でアクセスする前記配列要素を検索して前記要素番号が特定され、特定された前記要素番号を用いて前記変数名が定義されている請求項12又は13に記載の車載装置。 The parallel program includes the array element 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 identified array variable. The element information list is described in claim 12 or 13, wherein the element number is specified by searching for the array element accessed by the different variable name, and the variable name is defined using the specified element number. In-vehicle device.
JP2017172395A 2017-09-07 2017-09-07 Parallelization method, parallelization tool, in-vehicle device Active JP6933063B2 (en)

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)

* Cited by examiner, † Cited by third party
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

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