JPH086816A - Sequencing device for parallel program - Google Patents

Sequencing device for parallel program

Info

Publication number
JPH086816A
JPH086816A JP6140349A JP14034994A JPH086816A JP H086816 A JPH086816 A JP H086816A JP 6140349 A JP6140349 A JP 6140349A JP 14034994 A JP14034994 A JP 14034994A JP H086816 A JPH086816 A JP H086816A
Authority
JP
Japan
Prior art keywords
program
data flow
analysis
parallel
parallel program
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.)
Pending
Application number
JP6140349A
Other languages
Japanese (ja)
Inventor
Yasuo Nagai
保夫 永井
Naoshi Uchihira
直志 内平
Shinichi Hoiden
真一 本位田
Akihiko Osuga
昭彦 大須賀
Toshibumi Seki
俊文 關
Keiichi Handa
恵一 半田
Satoshi Ito
聡 伊藤
Shinsuke Sawajima
信介 澤島
Yasuyuki Tawara
康之 田原
Hideaki Shiotani
英明 塩谷
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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP6140349A priority Critical patent/JPH086816A/en
Publication of JPH086816A publication Critical patent/JPH086816A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)
  • Debugging And Monitoring (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To sequence a parallel program by applying the optimization technology of a compiler to a static analysis of the parallel program. CONSTITUTION:The parallel program stored in a parallel program storage file 1 is read in through a read part 2 and supplied to a program analysis part 3, and a word and phrase analysis and a syntax analysis are taken to generate data flow graphs. Those are supplied to a basic arithmetic series rearrangement part 4 and optimized, and the basic arithmetic series rearrangement part 4 rearranges basic arithmetic series by using restraint sufficiency. Then a code generation part 5 generates a sequenced program meeting input specifications and stores it in a sequenced program storage file 6. The information obtained by the optimization is stored in an intermediate information storage part 7 and can be referred to when necessary.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、並行プログラムを逐次
プログラムに変換する逐次化装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a serializer for converting a parallel program into a serial program.

【0002】[0002]

【従来の技術】近年の半導体集積回路技術の進歩によ
り、複雑なプロセッサならびに大容量のメモリが小型か
つ低価格で実現できるようになり、多数のプロセッサか
らなる並列処理システムや分散処理システムが実用化さ
れてきている。
2. Description of the Related Art Recent advances in semiconductor integrated circuit technology have made it possible to realize complex processors and large-capacity memories at a small size and at a low price, and to put parallel processing systems and distributed processing systems consisting of a large number of processors into practical use. Has been done.

【0003】このようなハードウエアに対しては、専用
プログラム、すなわち並列プログラムや分散処理プログ
ラムなど( 以下「並行プログラム」という) を用いる必
要がある。したがって、このような並行プログラムを如
何に効率よく開発するかが、優れたアルゴリズムを検討
する場合と同様に重要な課題となっている。
For such hardware, it is necessary to use a dedicated program, that is, a parallel program or a distributed processing program (hereinafter referred to as "concurrent program"). Therefore, how to efficiently develop such a parallel program is as important as the case of examining an excellent algorithm.

【0004】ところで、プログラム開発において、プロ
グラム中のエラーを見つけて修正すること、すなわちデ
バッグと呼ばれる開発工程がプログラム開発の効率に大
きく影響を与える。
By the way, in program development, finding and correcting an error in a program, that is, a development process called debugging greatly affects the efficiency of program development.

【0005】並行プログラムの開発においては、逐次プ
ログラムの開発では遭遇することのない並行プログラム
特有の問題を考慮する必要がある。すなわち、並行プロ
グラム特有の問題とは、並行プログラムが必ずしも再現
性のある振る舞いをするとは限らないことである。たと
えば、同じ入力データを使用して実行させても、その実
行結果が異なっていることが考えられる。この結果の相
違は、2つのプログラム内部のプロセスが並列に処理を
進めることができる場合に発生する。たとえば、一方の
プロセスがどこかのメモリに書き込みを行っていると
き、他方のプロセスが同じメモリから読み出そうとして
いる場合、他方のプロセスの振る舞いは新しい値と古い
値とのどちらをそのプロセスが読み出すかにより異なっ
てくる。このため、「ある変数にある値を代入した後
は、他の値の代入が行われるまでは、その変数はその値
をもつ」という単一代入規則でさえ成立しなくなる。
In the development of a concurrent program, it is necessary to consider the problems peculiar to the concurrent program which are not encountered in the development of a serial program. That is, a problem peculiar to a concurrent program is that the concurrent program does not always behave in a reproducible manner. For example, even if the same input data is used for execution, the execution results may be different. This difference in results occurs when the processes inside the two programs can proceed in parallel. For example, if one process is writing to some memory and the other process is trying to read from the same memory, the behavior of the other process will be whether the new or old value It depends on whether you read it. For this reason, even the single assignment rule that "a variable has a value after it has been assigned a value until another value is assigned" does not hold.

【0006】このような競合によって生じる非決定性の
ために、並行プログラムを理解したり、記述したり、デ
バッグしたりする作業が逐次プログラムの場合より困難
になる。
The nondeterminism caused by such competition makes the tasks of understanding, describing, and debugging a concurrent program more difficult than it would be for a sequential program.

【0007】そこで、デバッグを伴った並行プログラム
の開発に際して、作成された並行プログラムのトポロジ
を保持したまま逐次化し、逐次化プログラムに良い非決
定性を導入しながらデバッグを行い、その後に並行性の
トポロジに基づいて並行性を復元させることによって、
設計者の把握できている良い非決定性だけが導入された
信頼性の高い並行プログラムを得ることが考えられる。
このように、いわゆるデフォルト逐次原理を導入した並
行プログラムの開発を実現するには、この原理導入に適
した逐次化装置の出現が望まれる。
Therefore, when developing a parallel program accompanied by debugging, the created parallel program is serialized while retaining its topology, and debugging is performed while introducing good nondeterminism into the serialized program, and then the parallelism topology is maintained. By restoring concurrency based on
It is conceivable to obtain a reliable concurrent program in which only the good non-determinism known to the designer is introduced.
As described above, in order to realize the development of the parallel program in which the so-called default sequential principle is introduced, the appearance of a serialization device suitable for the introduction of this principle is desired.

【0008】[0008]

【発明が解決しようとする課題】そこで本発明は、上述
したデフォルト逐次原理を導入した並行プログラムの開
発を実現するのに適した並行プログラムの逐次化装置を
提供することを目的としている。
SUMMARY OF THE INVENTION Therefore, an object of the present invention is to provide a parallel program serialization device suitable for realizing the development of a parallel program in which the above-described default serial principle is introduced.

【0009】[0009]

【課題を解決するための手段】上記目的を達成するため
に、本発明に係る逐次化装置は、並行プログラムを入力
として読み込み、字句解析ならびに構文解析を行なう手
段と、この手段での解析結果に基づき変数占有情報を求
めるデータフロー解析手段と、この手段で得られたデー
タフローグラフを時間制約グラフに変換する手段と、変
換された時間制約グラフに基づき制約充足を行う手段
と、制約充足の結果求められた基本演算を表すデータフ
ローグラフの順序関係から基本演算系列を並び換え、さ
らにグループ化する手段と、分類されたそれぞれのグル
ープが表すデータフローグラフの順序関係を保持する形
で逐次プログラムを生成する手段とを備えている。
In order to achieve the above object, the serialization device according to the present invention reads a parallel program as an input, performs a lexical analysis and a syntactic analysis, and an analysis result by this means. Data flow analysis means for obtaining variable occupancy information based on the above, means for converting the data flow graph obtained by this means into a time constraint graph, means for performing constraint satisfaction based on the converted time constraint graph, and result of constraint satisfaction A means for rearranging the basic operation sequence from the order relation of the data flow graph representing the obtained basic operation and further grouping it, and a sequential program in a form maintaining the order relation of the data flow graph represented by each classified group. And means for generating.

【0010】[0010]

【作用】本発明に係る逐次化装置では、コンパイラにお
ける最適化技術を並行プログラムの静的解析に適用する
ことで並行プログラムの逐次化を実現している。すなわ
ち、プログラムの解析手法のなかには、プログラムを実
行せずに、そのソースコードを解析して不具合部分を発
見したり、役に立つ情報を提供するプログラムの静的解
析手法がある。この方法では、構文的な誤りや、チェッ
クに役に立つ情報をコンパイラ最適化手法により求め
る。静的解析で用いられる主要な手法は制御フロー解析
とデータフロー解析とである。
In the serialization device according to the present invention, the optimization technique in the compiler is applied to the static analysis of the parallel program to realize the serialization of the parallel program. That is, among the program analysis methods, there is a static analysis method of a program that analyzes the source code of the program to find a defective part or provides useful information without executing the program. In this method, a compiler optimization method is used to find syntactical errors and information useful for checking. The main methods used in static analysis are control flow analysis and data flow analysis.

【0011】本発明では、プログラムの静的解析技術の
中のデータフロー解析技術に着目し、これを並行プログ
ラムの解析に用いている。この解析結果を用いて個々の
並行処理文における基本演算系列の依存関係情報を満足
するように基本演算系列を並べ換えて逐次プログラムを
生成させるようにしている。
In the present invention, attention is paid to the data flow analysis technique in the static analysis technique of the program, and this is used for the analysis of the parallel program. Using this analysis result, the basic operation sequences are rearranged so as to satisfy the dependency information of the basic operation sequences in each parallel processing statement, and a sequential program is generated.

【0012】特に、本発明では、基本演算系列の依存関
係情報を満足させるために、この依存関係情報からデー
タフローグラフを求め、最終的に得られる時間制約条件
を満足させる手法として制約充足手法を導入している。
なお、基本演算系列とはそれ以上細分化できない基本命
令の系列であり、たとえば文x=y+zは、temp=y;
temp=temp+z;x=tempという基本命令の系列から構
成されることになる。また、基本演算系列の依存関係情
報とは、上記のような基本命令の系列における変数の定
義ならびに参照関係をあらわす。
Particularly, in the present invention, in order to satisfy the dependency relation information of the basic operation sequence, a constraint satisfaction method is obtained as a technique for obtaining a data flow graph from this dependency relation information and satisfying the finally obtained time constraint condition. Introduced.
The basic operation sequence is a sequence of basic instructions that cannot be further subdivided. For example, the sentence x = y + z is temp = y;
It is composed of a series of basic instructions of temp = temp + z; x = temp. The dependency relation information of the basic operation sequence represents the definition and reference relation of variables in the sequence of basic instructions as described above.

【0013】たとえば、下記のような並行プログラムが
本発明に係る逐次化装置に読み込まれたとする。この並
行プログラムは、幾つかの文を同時に実行させることを
許す並行文からなり、これらの文を並行に実行せよとい
う言語構造を持つとする。そのシンタックスは、parbeg
inとparendという区切りを用いて並行対象となる文を包
み込むものとする。
For example, assume that the following parallel program is read by the serialization device according to the present invention. This parallel program consists of parallel statements that allow several statements to be executed at the same time, and has the language structure of executing these statements in parallel. Its syntax is parbeg
Sentences that are parallel targets are wrapped using the delimiters in and parend.

【0014】 parbegin statement1; statement2; statement3; ……… ……… statementn; parend 今、statement1が基本演算系列s1< s2 <s3からなり、
statement2が基本演算系列s1< s2 からなるとする。こ
こで、2項関係<は時間的な順序関係を示し、s1< s2
ではs1がs2より時間的に前であることを表している。
Parbegin statement1; statement2; statement3; ………………… statementn; parend statement1 consists of basic operation sequence s1 <s2 <s3,
It is assumed that statement2 consists of basic operation sequence s1 <s2. Here, the binary relation <indicates a temporal order relation, and s1 <s2
Indicates that s1 is earlier than s2 in time.

【0015】statement1をV5 =V3 −V4 ;V8 =V
3 +V5 ;V14=V11&V8 とした場合、基本演算系列
s1 <s2<s3は、V5 =V3 −V4 <V8 =V3 +V5
<V14=V11&V8 となる。
Statement 1 is V5 = V3-V4; V8 = V
3 + V5; V14 = V11 & V8, basic operation sequence
For s1 <s2 <s3, V5 = V3−V4 <V8 = V3 + V5
<V14 = V11 & V8.

【0016】そして、以下のような並行文、 parbegin statement1; statement2; parend の逐次計算機上での実行では、基本演算系列における依
存関係情報を満足する形式で、次のように並び換えられ
た演算系列の実行を行う可能性が考えられる。
When executing the following parallel statements parbegin statement1; statement2; parend on a sequential computer, the operation sequences rearranged as follows in a format satisfying the dependency information in the basic operation sequence. Is possible.

【0017】 s1<s2<s3<s1<s2 s1<s2<s1<s3<s2 s1<s2<s1<s2<s3 s1<s1<s2<s3<s2 s1<s1<s2<s3<s2 s1<s1<s2<s2<s3 s1<s1<s2<s3<s2 s1<s1<s2<s2<s3 s1<s1<s2<s2<s3 s1<s2<s1<s2<s3 本発明に係る逐次化装置では、このような依存関係情報
を満足する基本演算系列集合からひとつを選択し、これ
を実行するプログラムを生成する。
S1 <s2 <s3 <s1 <s2 s1 <s2 <s1 <s3 <s2 s1 <s2 <s1 <s2 <s3 s1 <s1 <s2 <s3 <s2 s1 <s1 <s2 <s3 <s2 s1 < s1 <s2 <s2 <s3 s1 <s1 <s2 <s3 <s2 s1 <s1 <s2 <s2 <s3 s1 <s1 <s2 <s2 <s3 s1 <s2 <s1 <s2 <s3 serializer according to the present invention Then, one is selected from the basic operation series set that satisfies such dependency relationship information, and a program for executing this is generated.

【0018】生成されたプログラムは、逐次化実行を行
うように依存関係情報を満足する演算系列が並び代えら
れているが、実際には、このプログラムの逐次化条件を
取り除いて、並行化実行することができるので、非決定
性を容易に導入できると考えられる。すなわち、並行化
実行時には、これらのグループ化された基本系列をその
ままグループ毎に並行システムの各プロセッサ上で並行
実行させることが容易だからである。
In the generated program, the operation sequences satisfying the dependency relationship information are rearranged so as to perform the serialization execution. In reality, the serialization condition of the program is removed and the parallelization execution is performed. Therefore, it is considered that nondeterminism can be easily introduced. That is, at the time of parallel execution, it is easy to execute these grouped basic sequences as they are in parallel on each processor of the parallel system.

【0019】[0019]

【実施例】以下、図面を参照しながら実施例を説明す
る。図1には本発明の一実施例に係る並行プログラムの
逐次化装置の概略構成が示されている。
Embodiments will be described below with reference to the drawings. FIG. 1 shows a schematic configuration of a parallel program serialization device according to an embodiment of the present invention.

【0020】この逐次化装置では、並行プログラム記憶
ファイル1に記憶されている並行プログラムを読み取り
部2を介して読み込み、この読み込んだ並行プログラム
をプログラム解析部3に与える。プログラム解析部3で
は、与えられた並行プログラムの字句解析ならびに構文
解析を行ない、さらに構文解析結果を元にしてデータフ
ロー解析を行なってデータフローグラフを生成する。
In this serialization device, the parallel program stored in the parallel program storage file 1 is read via the reading unit 2 and the read parallel program is given to the program analysis unit 3. The program analysis unit 3 performs lexical analysis and syntactic analysis of the given parallel program, and further performs data flow analysis based on the syntactic analysis result to generate a data flow graph.

【0021】生成されたデータフローグラフは、基本演
算系列並び換え部4に与えられ、ここでプログラミング
言語コンパイラと同様にデータフローグラフの最適化が
行われる。さらに、基本演算系列並び換え部4は最適化
されたデータフローグラフに対して基本演算系列の並べ
換えを制約充足を用いて行う。
The generated data flow graph is given to the basic operation sequence rearranging unit 4, where the data flow graph is optimized in the same manner as the programming language compiler. Further, the basic operation sequence rearrangement unit 4 performs the rearrangement of the basic operation sequence on the optimized data flow graph by using constraint satisfaction.

【0022】そして、最終的に、コード生成部5によ
り、入力仕様を満足するような逐次化プログラムが生成
され、生成された逐次化プログラムは逐次化プログラム
記憶ファイル6に格納される。なお、それぞれの解析や
最適化で求められた情報は中間情報記憶部7に蓄積さ
れ、必要な場合に参照できるようになっている。
Finally, the code generation unit 5 generates a serialization program that satisfies the input specifications, and the generated serialization program is stored in the serialization program storage file 6. The information obtained by each analysis and optimization is stored in the intermediate information storage unit 7 and can be referred to when necessary.

【0023】次に、上記のように構成された逐次化装置
の動作を説明する。今、図2に示すような並行プログラ
ムがこの逐次化装置に読み込まれたとする。この並行プ
ログラムは幾つかの文を同時に実行させることを許す並
行文からなり、これらの文を並列に実行せよという言語
構造を持つ。そのシンタックスは、parbeginとparendと
いう区切りを用いて並行対象となる文を包み込むものと
する。
Next, the operation of the serialization device configured as described above will be described. Now, it is assumed that a parallel program as shown in FIG. 2 is read into this serialization device. This parallel program consists of parallel statements that allow several statements to be executed at the same time, and has the language structure of executing these statements in parallel. Its syntax is to enclose the sentence that is the target of concurrency, using the delimiters parbegin and parend.

【0024】このような並行プログラムが読み込まれる
と、プログラム解析部3は図3に示される処理を行う。 (ステップ11)まず、入力として与えられた並行プロ
グラムに対して構文解析を行い、図4に示されるような
解析木を生成する。図4には並行プログラム中の文A=
B*C+D/Eが構文解析された結果生成される解析木
が示されている。これは、まず番号41で示されるB*
Cの演算を行い、次に番号42で示されるD/Eの演算
を行った後で両者を足し算した結果を変数Aに入れるこ
とをあらわしている。すなわち、構文解析により、それ
ぞれの文が言語文法のどの規則に対応するかを解析し、
図5に示すような中間表現である4つ組を生成する。
When such a parallel program is read, the program analysis section 3 performs the processing shown in FIG. (Step 11) First, the parallel program given as an input is syntactically analyzed to generate a parse tree as shown in FIG. The statement A = in the parallel program is shown in FIG.
A parse tree generated as a result of parsing B * C + D / E is shown. This is B * indicated by number 41
The calculation of C is performed, then the calculation of D / E indicated by numeral 42 is performed, and the result of addition of the two is put into the variable A. In other words, the syntactic analysis analyzes which rule of the language grammar each sentence corresponds to,
A quadruplet, which is an intermediate representation as shown in FIG. 5, is generated.

【0025】図5中の番号51で示される2つの4つ組
は、文V3 =V1 +V2 を構文解析した結果をあらわし
ている。図5中の番号52で示される4つ組中の、/+
は加算演算子を、(V1 0)は初めて現れた変数V1
を、T0017は変数V1 とV2 の加算結果を入れた変数を
それぞれあらわしている。また、番号53で示される
(V3 18 )は、変数V3 がT0018において再定義され
たことを表している。そして、共通部分式を削除し、変
数の使用状態ならびに定義状態から図6に示すように演
算子の順位を決定する。
Two quadruplets indicated by reference numeral 51 in FIG. 5 represent the result of parsing the sentence V3 = V1 + V2. / + In the set of four shown by the number 52 in FIG.
Is the addition operator, and (V10) is the variable V1 that appears for the first time.
T0017 represents a variable containing the addition result of the variables V1 and V2, respectively. Further, (V3 18) indicated by the number 53 indicates that the variable V3 is redefined in T0018. Then, the common subexpression is deleted, and the order of the operators is determined from the use state and the definition state of the variable as shown in FIG.

【0026】図6中の番号60で示される((( /+ 0)
( V1 0)( V2 0) T0017))中の、番号61で示さ
れる( /+ 0)は、T0017=V1 +V2 、すなわち変数
V1とV2 の加算結果をT0017に入れる操作、つまり加
算演算子の順位がレベル 0に設定されたことを示してい
る。同様に、番号62で示される((( /− 1)( V318)
(V4 0) T0019))中の、番号63で示される( /−
1)は、変数V3 とV4 の減算操作がレベル1に設定さ
れたことを示している。
It is indicated by the number 60 in FIG. 6 ((((/ + 0)
(/ + 0) indicated by the number 61 in (V1 0) (V2 0) T0017)) is T0017 = V1 + V2, that is, the operation of putting the addition result of the variables V1 and V2 into T0017, that is, the addition operator. Indicates that the ranking has been set to level 0. Similarly, it is shown by the number 62 (((/ -1) (V318)
(V-40) T0019)), indicated by number 63 (/-
1) indicates that the subtraction operation of the variables V3 and V4 is set to level 1.

【0027】(ステップ12)次に、ステップ11で設
定された各演算子のレベルに基づき、データフロー解析
を行い、図7に示すように、それぞれの文の演算の並列
性や変数の占有情報を求める。この図では番号71で示
す縦軸方向が時間概念を、番号72で示すdefが定義
を、番号73で示すref が参照をそれぞれあらわす。
(Step 12) Next, data flow analysis is performed based on the level of each operator set in Step 11, and as shown in FIG. 7, parallelism of operation of each statement and occupancy information of variables. Ask for. In this figure, the vertical axis direction indicated by the numeral 71 indicates the concept of time, def indicated by the numeral 72 indicates the definition, and ref indicated by the numeral 73 indicates the reference.

【0028】変数の占有情報とは、ある時点のある変数
に対して定義された値がその後値を変えないで使用でき
る、つまり変数が生きている区間74,75,76をあ
らわす。この情報は、再び並行化に戻すときのコンパイ
ラにおいて効率的にレジスタを割り付けるために利用さ
れる。変数Xの占有情報と変数Yの占有情報とに共通部
分があれば、XとYに同じレジスタを割り当てることが
できる。すなわち、同図において、変数が生きている区
間74と75の共通部分が77で示す区間であり、区間
78が非共通部分である。したがって、区間77におい
てXとYに同じレジスタを割り当てることができるよう
になる。
The occupancy information of a variable represents a value defined for a certain variable at a certain time point, which can be used without changing the value thereafter, that is, a section 74, 75, 76 in which the variable is alive. This information is used to allocate registers efficiently in the compiler when returning to parallelization again. If the occupation information of the variable X and the occupation information of the variable Y have a common part, the same register can be assigned to X and Y. That is, in the figure, the common portion of the sections 74 and 75 in which the variables are alive is the section indicated by 77, and the section 78 is the non-common portion. Therefore, the same register can be assigned to X and Y in the interval 77.

【0029】プログラム中のそれぞれの文について行な
われたデータフロー解析から求められた変数の占有情報
ならびに演算情報を用いて全ての文間のデータフロー解
析を行ない、変数間の依存関係に関する情報を求め、最
終的に図8に示すようなデータフロー情報86,87を
生成する.図8中のlevel 81〜85は離散的な時間を
示し、点線88,89は時間軸をそれぞれ示し、上から
下への時間の経過を表す。
The data flow analysis between all the statements is performed using the occupation information of the variables and the operation information obtained from the data flow analysis performed for each statement in the program to obtain the information regarding the dependency relation between the variables. Finally, the data flow information 86, 87 as shown in FIG. 8 is generated. Levels 81 to 85 in FIG. 8 represent discrete times, dotted lines 88 and 89 represent time axes, respectively, and represent the passage of time from top to bottom.

【0030】(ステップ13)データフロー情報に基づ
いてデータフローグラフを生成する。なお、基本演算に
関するデータフローグラフは、各レベルにおいてなるべ
く均等な個数になるように並べるようにする。さらに、
変数の競合が起こる場合は、本実施例では競合する基本
演算に関するデータフローグラフをランダムに選択し、
上記の均等個数に関する条件を満足するように並び換え
る。
(Step 13) A data flow graph is generated based on the data flow information. It should be noted that the data flow graphs related to basic operations are arranged so that the number of data flow graphs at each level is as uniform as possible. further,
In the case where a conflict of variables occurs, in the present embodiment, a data flow graph regarding basic operations that conflict is randomly selected,
The rearrangement is performed so as to satisfy the above condition regarding the uniform number.

【0031】(ステップ14)基本演算系列の並び換え
を行う。この並び換えでは、図9に示すように、資源競
合に関する予期せぬ結果を生ずる( 資源競合) 問題を解
決するために、生成されたデータフローグラフから次の
ような時間に関する制約グラフを生成し(ステップ14-
1)、このグラフを用いて定式化された制約充足問題を
解く(ステップ14-2,14-3)ことにより、基本演算系列
を並べ換える。
(Step 14) The basic operation sequence is rearranged. In this rearrangement, as shown in FIG. 9, in order to solve the problem (resource competition) that causes an unexpected result regarding resource competition, the following time constraint graph is generated from the generated data flow graph. (Step 14-
1) The basic operation sequence is rearranged by solving the constraint satisfaction problem formulated using this graph (steps 14-2 and 14-3).

【0032】時間制約グラフG(V,E)は、次のよう
な4つ組(op,α1,α2,α3)を表現するために用いられ
る。たとえば、文V3 =V1 +V2 の4つ組表現(+,
V1 ,V2 ,V3 )をデータフローグラフ化した図が図
10(a) で、番号10-1で示す変数V1 と番号10-2で示す
変数V2 の値が定められた後、番号10-3で示す変数V3
の値が番号10-4で示す演算+ により求められることをあ
らわしている。変数のみに注目すると、V1 とV2 の値
を決定した後、V3 が求められることになる。これは時
間による順序関係<を用いると(V1 ,V2 )<V3 に
よりあらわすことができる。
The time constraint graph G (V, E) is used to represent the following quadruplet (op, α1, α2, α3). For example, the quartet representation of the sentence V3 = V1 + V2 (+,
The data flow graph of V1, V2, V3) is shown in FIG. 10 (a). After the values of the variable V1 indicated by the number 10-1 and the variable V2 indicated by the number 10-2 are determined, the number 10-3 is determined. Variable V3
It indicates that the value of is obtained by the operation + shown in the number 10-4. Focusing only on the variables, V3 will be determined after determining the values of V1 and V2. This can be expressed by (V1, V2) <V3 using the order relation <with time.

【0033】本例では、変数V1 ,V2 ,V3 の順序関
係、つまり2項関係V1 <V3 ならびにV2 <V3 を図
10(b) のようにあらわす。つまり、各ノード10-5,10
-7,10-8が変数を、矢印10-6,10-9が2つの変数間の順
序関係をあらわす。ここでは、図10(b) のような表現
を時間制約グラフと呼ぶことにする。データフロー解析
により生成されたデータフローグラフは、図11に示す
ような時間制約グラフに変換される。
In this example, the order relation of the variables V1, V2 and V3, that is, the binary relation V1 <V3 and V2 <V3 is shown as shown in FIG. 10 (b). That is, each node 10-5, 10
-7 and 10-8 represent variables, and arrows 10-6 and 10-9 represent order relation between two variables. Here, the expression as shown in FIG. 10B will be called a time constraint graph. The data flow graph generated by the data flow analysis is converted into a time constraint graph as shown in FIG.

【0034】データフローグラフの並び換え、すなわち
基本演算系列の並び換えは時間制約グラフを満足するよ
うな制約充足問題を解くことになる。制約充足問題と
は、変数の有限集合および各変数に対してとりうる値を
離散値の有限集合として与えた場合に、全ての制約を満
足するように各変数に対して値を求める問題である。制
約とは適用対象の構成要素およびその属性間で成立する
関係を宣言的に記述したものである。なお、制約充足問
題では、探索の効率化を目的としたバックトラック探索
アルゴリズムの性能を改善する手法が提案されている。
ここで、バックトラック探索とは、探索の途中で行き止
まりに突き当たってしまったとき、探索の後戻りを行っ
て他の探索候補を選択し、探索の再実行を行う探索手法
である。
The rearrangement of the data flow graph, that is, the rearrangement of the basic operation sequence solves the constraint satisfaction problem satisfying the time constraint graph. The constraint satisfaction problem is a problem that, when a finite set of variables and possible values for each variable are given as a finite set of discrete values, values are obtained for each variable so as to satisfy all the constraints. . A constraint is a declarative description of the relationship established between the constituent elements and their attributes. In the constraint satisfaction problem, a method for improving the performance of the backtrack search algorithm has been proposed for the purpose of improving search efficiency.
Here, the backtrack search is a search method in which, when a dead end is encountered in the middle of the search, the search is returned to select another search candidate and the search is re-executed.

【0035】一方、時間制約充足問題では、次のような
制約充足問題として定式化する。 変数:X={X1 ,…,Xn }変数は、時間制約グラフ
の各点を表す。 値 :各変数Xn は離散値の有限集合Dn から値を選択
する。値は時間制約グラフの各点に割り当てるべき離散
時間の集合を表す。
On the other hand, the time constraint satisfaction problem is formulated as the following constraint satisfaction problem. Variable: X = {X1, ..., Xn} The variable represents each point in the time constraint graph. Value: Each variable Xn selects a value from a finite set Dn of discrete values. The value represents a set of discrete times to be assigned to each point in the time constraint graph.

【0036】[0036]

【数1】 [Equation 1]

【0037】たとえば、図10(a) の例は、図10(b)
の制約グラフに変換される。ここでの制約は変数V1 と
V3 間の順序関係10-6と変数V2 とV3 間の順序関係10
-9とからなる2つの2項関係を表すことになる。制約充
足では、制約を満足するように変数に対して値を割り当
てる。この値は離散時間をあらわし、大きい数ほど時間
の経過が大きいことを示す。
For example, the example of FIG. 10 (a) is the same as that of FIG. 10 (b).
Is converted to the constraint graph of. The constraints here are the order relation 10-6 between variables V1 and V3 and the order relation 10 between variables V2 and V3.
It represents two binary relations consisting of -9 and. In constraint satisfaction, values are assigned to variables so that the constraints are satisfied. This value represents discrete time, and the larger the number, the greater the elapsed time.

【0038】ここでは、制約充足解法として、図12に
ステップ21〜26で示される制約付き探索法を用いて
いる。制約付き探索法は、バックトラックに基づいた探
索では無駄なバックトラックの頻発による効率の悪さか
ら無駄な探索枝を刈り込むため、先読み法ならびに前方
チェック法を組み込んだものである。
Here, as the constraint satisfaction solution method, the constrained search method shown in steps 21 to 26 in FIG. 12 is used. The constrained search method incorporates a look-ahead method and a forward check method in order to prun wasteful search branches due to inefficiency due to frequent backtracking in backtrack-based searches.

【0039】先読み法(ステップ23)では、割り当て
済みの値に基づき、将来割り当てるべき変数間に割り当
て可能な値の組が残っているかをチェックする。また、
前方チェック法(ステップ24)では、過去および現在
の変数の候補を基準として、未来に変数に割り当てる候
補となる値の中で無効なものを削除する。
In the look-ahead method (step 23), it is checked whether or not there is a set of assignable values among variables to be assigned in the future based on the assigned values. Also,
In the forward check method (step 24), invalid values are deleted from the candidate values to be assigned to variables in the future with reference to past and present variable candidates.

【0040】時間制約充足では、変数に値が割り当てら
れると、この変数から時間順序関係“→”が満足される
ように、もう一方の変数に対しても値が割り当てられ
る。さらに、ある変数に値が割り当てられた時、制約伝
播により全ての共有変数の値の割り当てが起こり、制約
グラフ全体での変数の値が求められる。その場合、前方
チェック法を用いて過去および現在の変数の候補を基準
として、未来に変数に割り当てる候補となる値の中で無
効なものを削除し、探索空間を狭めていく。
In the time constraint satisfaction, when a value is assigned to a variable, a value is also assigned to the other variable so that the time order relation “→” is satisfied from this variable. Furthermore, when a value is assigned to a variable, constraint propagation causes assignment of the values of all shared variables, and the value of the variable in the entire constraint graph is obtained. In that case, the forward check method is used to delete the invalid values among the candidate values to be assigned to the variables in the future by using the past and present variable candidates as a reference, and narrow the search space.

【0041】図13では、基本演算系列を並び換えるた
めに、時間制約を満足するように番号13-4で示される変
数V1 の番号13-1で示される離散時間集合[1,2,
3,4,5]から変数V15の離散時間集合[1,2,
3,4,5]までのどれか1つの要素を割り当てていく
過程をあらわしている。この場合、番号13-15 で示され
るt1 ,番号13-16 で示されるt2 は、離散時間集合13
-1の中の1と2にそれぞれ対応する。たとえば、番号13
-4で示される変数V1 ならびに番号13-6で示される変数
V3 に番号13-7で示される離散時間1を割り当てると、
V1 とV3 間の番号13-8で示される2項制約ならびにV
2 とV3 間の番号13-2で示される2項制約を満足するよ
うに、変数V3 の値の集合から1 が取り除かれ、番号13
-9で示される離散時間集合[2,3,4,5]となる。
変数V3 の値は点線13-10 で示されるように共有されて
いるので、変数V3 と変数V5 の番号13-11 で示される
制約ならびに変数V3 と変数V8 の番号13-12 で示され
る制約に対して、変数V3 の値を番号13-5と番号13-14
とで示される離散時間集合[2,3,4,5]として充
足を行なう。
In FIG. 13, in order to rearrange the basic operation sequence, the discrete time set [1, 2, ...
3, 4, 5] to the discrete time set [1, 2,
[3,4,5]] shows the process of allocating any one element. In this case, t1 represented by the number 13-15 and t2 represented by the number 13-16 are the discrete time set 13
Corresponds to 1 and 2 in -1. For example, the number 13
-4 is assigned to the variable V1 and the variable V3 indicated by the number 13-6 to the discrete time 1 indicated by the number 13-7,
The binomial constraint indicated by the number 13-8 between V1 and V3 and V
1 is removed from the set of values of the variable V3 so that the binomial constraint represented by the number 13-2 between 2 and V3 is satisfied, and the number 13
It becomes a discrete time set [2, 3, 4, 5] indicated by -9.
Since the value of the variable V3 is shared as shown by the dotted line 13-10, the constraint shown by the number 13-11 of the variable V3 and the variable V5 and the constraint shown by the number 13-12 of the variable V3 and the variable V8 are shown. On the other hand, the value of the variable V3 is numbered 13-5 and numbered 13-14.
Satisfaction is performed as a discrete time set [2, 3, 4, 5] indicated by.

【0042】このように、変数共有による制約伝播なら
びに,過去および現在の変数の候補を基準として、未来
に変数に割り当てる候補となる値の中で無効なものを削
除し、探索空間を狭めることにより、最終的に各変数に
対して離散値を割り当てる。
As described above, constraint propagation by variable sharing and invalid values among candidate values to be assigned to variables in the future are deleted based on past and present variable candidates to narrow the search space. , Finally assigning discrete values to each variable.

【0043】コード生成部5では、上記のような時間制
約充足の結果として求められた、それぞれの基本演算を
表すデータフローグラフの順序関係に基づき、基本演算
系列の並び換えを行う。つまり、変数の依存関係が存在
するデータフローグラフをグループ化する。したがっ
て、最終的に基本演算系列は、図14に示されるように
4つのグループに分類される。
The code generator 5 rearranges the basic operation sequence based on the order relation of the data flow graphs representing the respective basic operations, which is obtained as a result of the time constraint satisfaction described above. In other words, data flow graphs in which variable dependencies exist are grouped. Therefore, the basic operation sequence is finally classified into four groups as shown in FIG.

【0044】さらに、それぞれのグループにおけるデー
タフローグラフの順序関係を保持する形で図15のよう
な逐次化プログラムを生成する。逐次化されたプログラ
ムは、図示しない非決定性導入装置により番号14-1で示
されるグループ1、番号14-2で示されるグループ2、番
号14-3で示されるグループ3ならびに番号14-4で示され
るグループ4が並行に実行可能であることを明示するこ
とにより、非決定性を導入できる。この結果、並行化ス
テップにおいて、それぞれのグループでのデータフロー
グラフの順序関係を保持する形で図16に示すような並
列化プログラムを生成できる。なお、図16において、
番号16-2で示すparbegin……parend部における16-3,16-
1,16-4が並列実行される部分、番号16-1で示されるbegi
n ……end 部の内容が逐次実行される部分である。
Further, a serialization program as shown in FIG. 15 is generated so as to maintain the order relation of the data flow graph in each group. The serialized program is shown by a group 1 shown by the number 14-1, a group 2 shown by the number 14-2, a group 3 shown by the number 14-3 and a number 14-4 by a non-deterministic introduction device (not shown). Non-determinism can be introduced by explicitly stating that group 4 to be executed can be executed in parallel. As a result, in the parallelization step, it is possible to generate a parallelization program as shown in FIG. 16 while maintaining the order relation of the data flow graph in each group. In addition, in FIG.
16-3,16- in the parbegin …… parend part indicated by number 16-2
The part where 1,16-4 is executed in parallel, begi indicated by number 16-1
n: The part of the end part is executed sequentially.

【0045】[0045]

【発明の効果】以上説明したように、本発明によれば、
競合による非決定性のために生ずる並行プログラムの非
再現性を回避するために、プログラム解析によりデータ
フロー情報を求め、この求められた情報を保持するよう
に逐次化された並行プログラムを生成することが可能と
なる。さらに、ユーザの指定した演算順序などの制約条
件も考慮して逐次化することが可能となる。また、この
ような逐次化装置を用いることにより、生成された逐次
化プログラムには無害な非決定性が保持されているの
で、データフロー情報を用いて並列動作可能なプログラ
ムを容易に生成することが可能となる。
As described above, according to the present invention,
In order to avoid non-reproducibility of a concurrent program caused by nondeterminism due to competition, it is possible to obtain data flow information by program analysis and generate a serialized parallel program that holds this required information. It will be possible. Furthermore, it becomes possible to perform serialization in consideration of a constraint condition such as a calculation order specified by the user. Further, by using such a serialization device, harmless nondeterminism is retained in the generated serialization program, and thus it is possible to easily generate a program that can operate in parallel using data flow information. It will be possible.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明の一実施例に係る逐次化装置の構成図FIG. 1 is a configuration diagram of a serialization device according to an embodiment of the present invention.

【図2】並行プログラムの一例を示す図FIG. 2 is a diagram showing an example of a parallel program.

【図3】同装置におけるプログラム解析部の処理フロー
を示す図
FIG. 3 is a diagram showing a processing flow of a program analysis unit in the device.

【図4】解析木を示す図FIG. 4 is a diagram showing a parse tree.

【図5】構文解析により生成された4つ組を表す図FIG. 5 is a diagram showing a quartet generated by parsing.

【図6】優先順位が決定された演算子を表す図FIG. 6 is a diagram showing operators whose priorities are determined.

【図7】変数の占有情報を示す図FIG. 7 is a diagram showing variable occupation information.

【図8】データフロー解析で求めらたデータフロー情報
を示す図
FIG. 8 is a diagram showing data flow information obtained by data flow analysis.

【図9】基本演算系列の並べ換え部の処理フローを示す
FIG. 9 is a diagram showing a processing flow of a rearrangement unit for a basic operation sequence.

【図10】データフローグラフの時間制約グラフへの変
換を説明するための図
FIG. 10 is a diagram for explaining conversion of a data flow graph into a time constraint graph.

【図11】データフロー解析により生成されたデータフ
ロー情報から生成された時間制約グラフ情報を説明する
ための図
FIG. 11 is a diagram for explaining time constraint graph information generated from data flow information generated by data flow analysis.

【図12】制約充足手続の処理フローを示す図FIG. 12 is a diagram showing a processing flow of a constraint satisfaction procedure.

【図13】時間制約充足により得られた結果を示す図FIG. 13 is a diagram showing a result obtained by satisfying a time constraint.

【図14】時間制約充足により得られた基本演算系列の
データフロー情報から決定されたグループ化情報を示す
FIG. 14 is a diagram showing grouping information determined from data flow information of a basic operation sequence obtained by satisfying a time constraint.

【図15】生成された逐次化プログラムの一例を示す図FIG. 15 is a diagram showing an example of a generated serialization program.

【図16】逐次化されたプログラムに非決定性が導入さ
れて生成された並行プログラムを示す図
FIG. 16 is a diagram showing a concurrent program generated by introducing nondeterminism into a serialized program.

【符号の説明】[Explanation of symbols]

1…並行プログラム記憶ファイル 2…並行プログ
ラム読み取り部 3…プログラム解析部 4…基本演算系
列の並べ換え部 5…コード生成部 6…逐次化プロ
グラム記憶ファイル 7…中間情報記憶部
1 ... Parallel program storage file 2 ... Parallel program reading unit 3 ... Program analysis unit 4 ... Basic operation sequence rearrangement unit 5 ... Code generation unit 6 ... Serialization program storage file 7 ... Intermediate information storage unit

───────────────────────────────────────────────────── フロントページの続き (72)発明者 大須賀 昭彦 神奈川県川崎市幸区柳町70番地 株式会社 東芝柳町工場内 (72)発明者 關 俊文 神奈川県川崎市幸区柳町70番地 株式会社 東芝柳町工場内 (72)発明者 半田 恵一 神奈川県川崎市幸区柳町70番地 株式会社 東芝柳町工場内 (72)発明者 伊藤 聡 神奈川県川崎市幸区柳町70番地 株式会社 東芝柳町工場内 (72)発明者 澤島 信介 神奈川県川崎市幸区小向東芝町1番地 株 式会社東芝研究開発センター内 (72)発明者 田原 康之 神奈川県川崎市幸区柳町70番地 株式会社 東芝柳町工場内 (72)発明者 塩谷 英明 神奈川県川崎市幸区小向東芝町1番地 株 式会社東芝研究開発センター内 ─────────────────────────────────────────────────── ─── Continuation of the front page (72) Inventor Akihiko Osuka 70 Yanagicho, Saiwai-ku, Kawasaki-shi, Kanagawa Toshiba Yanagimachi Co., Ltd. (72) Inventor Toshifumi Kaban 70, Yanagicho, Sachi-ku, Kawasaki-shi, Kanagawa Toshiba Yanagimachi, Ltd. (72) Inventor Keiichi Handa 70 Yanagi-cho, Sachi-ku, Kawasaki-shi, Kanagawa Prefecture, Yanagimachi Plant, Toshiba Corporation (72) Inventor Satoshi Ito 70, Yanagi-cho, Sachi-ku, Kawasaki City, Kanagawa Prefecture, Yanagicho, Toshiba Corporation (72) Inventor Shinsuke Sawashima 1 Komukai Toshiba-cho, Sachi-ku, Kawasaki-shi, Kanagawa (72) Inventor Yasuyuki Tahara 70, Yanagi-cho, Sachi-ku, Kawasaki-shi, Kanagawa (72) Inventor Hideaki Shiotani No. 1 Komukai Toshiba-cho, Saiwai-ku, Kawasaki-shi, Kanagawa Stock Company Toshiba Research and Development Center

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】並行プログラムを入力として読み込み、字
句解析ならびに構文解析を行なう手段と、上記の解析結
果に基づき変数占有情報を求めるデータフロー解析手段
と、データフロー解析結果から得られたデータフローグ
ラフを時間制約グラフに変換する手段と、変換された時
間制約グラフに基づき制約充足を行なう手段と、制約充
足の結果求められた基本演算を表すデータフローグラフ
の順序関係から基本演算系列を並び換えさらにグループ
化する手段と、分類されたそれぞれのグループが表すデ
ータフローグラフの順序関係を保持する形で逐次プログ
ラムを生成する手段とを具備してなることを特徴とする
並行プログラムの逐次化装置。
1. A means for performing lexical analysis and syntax analysis by reading a parallel program as an input, a data flow analyzing means for obtaining variable occupation information based on the above analysis result, and a data flow graph obtained from the data flow analysis result. To a time constraint graph, means for performing constraint satisfaction based on the converted time constraint graph, and rearrangement of the basic operation sequence from the order relation of the data flow graph representing the basic operation obtained as a result of the constraint satisfaction. An apparatus for serializing a parallel program, comprising: means for grouping; and means for generating a sequential program in such a manner as to maintain the order relation of the data flow graphs represented by the respective classified groups.
【請求項2】前記制約充足を行なう手段は、先読み法お
よび前方チェック法を組み合わせた制約付き探索法を採
用していることを特徴とする請求項1に記載の並行プロ
グラムの逐次化装置。
2. The parallel program serialization apparatus according to claim 1, wherein the means for satisfying the constraint employs a constrained search method that combines a look-ahead method and a forward check method.
JP6140349A 1994-06-22 1994-06-22 Sequencing device for parallel program Pending JPH086816A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6140349A JPH086816A (en) 1994-06-22 1994-06-22 Sequencing device for parallel program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6140349A JPH086816A (en) 1994-06-22 1994-06-22 Sequencing device for parallel program

Publications (1)

Publication Number Publication Date
JPH086816A true JPH086816A (en) 1996-01-12

Family

ID=15266768

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6140349A Pending JPH086816A (en) 1994-06-22 1994-06-22 Sequencing device for parallel program

Country Status (1)

Country Link
JP (1) JPH086816A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100559564B1 (en) * 1999-07-15 2006-03-10 현대자동차주식회사 Oil seal for vehicle
JP2019215867A (en) * 2018-06-11 2019-12-19 タタ・コンサルタンシー・サーヴィシズ・リミテッド Method and system for verifying properties of source code

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100559564B1 (en) * 1999-07-15 2006-03-10 현대자동차주식회사 Oil seal for vehicle
JP2019215867A (en) * 2018-06-11 2019-12-19 タタ・コンサルタンシー・サーヴィシズ・リミテッド Method and system for verifying properties of source code

Similar Documents

Publication Publication Date Title
JP4042604B2 (en) Program parallelization apparatus, program parallelization method, and program parallelization program
JP4962564B2 (en) Parallelization program generation method, parallelization program generation apparatus, and parallelization program generation program
Agerwala Microprogram optimization: A survey
US6877150B1 (en) Method of transforming software language constructs to functional hardware equivalents
Duarte et al. Parallel variable neighbourhood search strategies for the cutwidth minimization problem
JPH04225431A (en) Method for compiling computer instruction for increasing instruction-cache efficiency
Bhasker et al. An optimizer for hardware synthesis
JPH05250499A (en) Data flow computer
Pai T et al. A systematic literature review of lexical analyzer implementation techniques in compiler design
KR20240090423A (en) System and method for auto-parallelization of processing codes for multi-processor systems with optimized latency
Anantharaman et al. A hardware accelerator for speech recognition algorithms
JPH086816A (en) Sequencing device for parallel program
Midkiff Automatic generation of synchronization instructions for parallel processors
Fukuhara et al. Automated kernel fusion for GPU based on code motion
Zhao et al. AutoGraph: Optimizing DNN computation graph for parallel GPU kernel execution
Abe et al. Model checking stencil computations written in a partitioned global address space language
Royuela Alcázar High-level compiler analysis for OpenMP
Lange et al. Data-independences of parallel random access machines
JPH03135630A (en) Instruction scheduling system
CN114675831B (en) Compiling system and method for programming language
JP2017224288A (en) Parallelizing method, parallelizing tool and on-vehicle device
JP5315703B2 (en) Parallelization program generation method, parallelization program generation program, and parallelization program generation apparatus
Zheng Automatic Compiler-based Optimizations for Deep Neural Networks
Gebrewahid et al. Actor fission transformations for executing dataflow programs on manycores
van Gemund On the analysis of Pamela models,"