JP3317816B2 - Data transfer processing allocation method in the compiler - Google Patents

Data transfer processing allocation method in the compiler

Info

Publication number
JP3317816B2
JP3317816B2 JP15717095A JP15717095A JP3317816B2 JP 3317816 B2 JP3317816 B2 JP 3317816B2 JP 15717095 A JP15717095 A JP 15717095A JP 15717095 A JP15717095 A JP 15717095A JP 3317816 B2 JP3317816 B2 JP 3317816B2
Authority
JP
Japan
Prior art keywords
processor
array
loop
distributed
data transfer
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.)
Expired - Fee Related
Application number
JP15717095A
Other languages
Japanese (ja)
Other versions
JPH08328873A (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.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP15717095A priority Critical patent/JP3317816B2/en
Publication of JPH08328873A publication Critical patent/JPH08328873A/en
Application granted granted Critical
Publication of JP3317816B2 publication Critical patent/JP3317816B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Multi Processors (AREA)
  • Devices For Executing Special Programs (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は、データ分散記述言語で
記述されたソースプログラムを入力してメモリ分散型マ
ルチプロセッサシステム向けの目的プログラムを生成す
るコンパイラに関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a compiler for inputting a source program described in a data distributed description language and generating a target program for a memory distributed multiprocessor system.

【0002】[0002]

【従来の技術】プログラム中のループのうち、繰り返し
処理の間でデータ依存関係の無いループは、各繰り返し
処理を独立に実行できるため、複数のプロセッサに分散
させて並列に実行させることができる。この場合、各プ
ロセッサがメモリを共有するメモリ共有型マルチプロセ
ッサシステムで実行すると、例えば特開平4−2969
62号公報に記述されるように各プロセッサ間でデータ
転送を必要としないが、各プロセッサは同一の共有メモ
リをアクセスするために、プロセッサの台数が増えれば
増えるほどメモリ競合が頻繁に発生し、並列化の効率が
低下する。そこで、メモリ競合による問題を解消し並列
化の程度を高める為に、各々がローカルメモリを有する
プロセッサを複数台ネットワーク等で結合したメモリ分
散型マルチプロセッサシステムが利用される。
2. Description of the Related Art Among loops in a program, a loop having no data dependency between repetition processes can execute each repetition process independently, and thus can be distributed to a plurality of processors and executed in parallel. In this case, when each processor is executed by a shared memory type multiprocessor system in which a memory is shared, for example, Japanese Patent Laid-Open No. 4-2969 is disclosed.
No data transfer is required between processors as described in Japanese Patent Publication No. 62-62, but since each processor accesses the same shared memory, memory contention frequently occurs as the number of processors increases, The efficiency of parallelization decreases. Therefore, in order to solve the problem due to memory contention and increase the degree of parallelization, a memory distributed multiprocessor system in which a plurality of processors each having a local memory are connected by a network or the like is used.

【0003】しかしながら、メモリ分散型マルチプロセ
ッサシステムの場合には、ループ中の配列を各プロセッ
サのローカルメモリに分散させるので、配列の分散状態
とループの分散状態とによっては、繰り返し処理の間で
データ依存関係の無いループであってもプロセッサ間で
データ転送を必要とする場合がある。即ち、メモリ分散
型マルチプロセッサシステムにおけるループ処理の並列
化では、プログラムが参照,更新する配列を例えばデー
タ分散記述言語による指示行で指定された通りに各プロ
セッサのローカルメモリに分散させ、他方、プログラム
中に含まれる各々のループを例えばそれに対して指示行
で指定された通りに分割して各プロセッサに割り当て
る。従って、配列の分散方法,ループの分割方法によっ
ては、各プロセッサが受け持つループの繰り返し処理に
おいてアクセスが必要となる配列要素がそのプロセッサ
のローカルメモリに分散されていない状況が発生する。
However, in the case of a memory distributed type multiprocessor system, the array in the loop is distributed to the local memory of each processor. Even in a loop having no dependency, data transfer may be required between processors. That is, in parallelization of loop processing in a memory-distributed multiprocessor system, an array to be referenced or updated by a program is distributed to a local memory of each processor as specified by an instruction line in, for example, a data distribution description language. Each of the loops contained therein is divided and assigned to each processor, for example, as specified in the instruction line. Therefore, depending on the method of distributing the array and the method of dividing the loop, a situation arises in which the array elements that need to be accessed in the loop repetition processing assigned to each processor are not distributed to the local memory of the processor.

【0004】そこで、データ分散記述言語で記述された
ソースプログラムを入力してメモリ分散型マルチプロセ
ッサシステム向けの目的プログラムを生成する従来のコ
ンパイラにおいては、各配列の分散方法およびループの
分割方法を決定した後、各プロセッサが受け持つループ
の繰り返し処理においてアクセスされる配列要素がその
プロセッサに分散されていない場合、前記ループ処理の
区間において配列の分散状態がそのループの分散状態と
合致するように一時的に変更するために、ループの前後
に配列要素をプロセッサ間で転送するデータ転送処理を
挿入するようにしていた。
Therefore, in a conventional compiler which inputs a source program described in a data distribution description language and generates a target program for a memory distributed multiprocessor system, a distribution method of each array and a division method of a loop are determined. After that, if the array elements accessed in the repetitive processing of the loop handled by each processor are not distributed to the processors, the distributed state of the array is temporarily changed so that the distributed state of the array matches the distributed state of the loop in the section of the loop processing. Therefore, a data transfer process for transferring array elements between processors was inserted before and after the loop.

【0005】例えば、図5に示すような配列要素A
(1)〜A(12)からなる配列A,配列要素B(1)
〜B(12)からなる配列B,配列要素C(1)〜C
(12)からなる配列Cを宣言したプログラムを、メモ
リ分散型マルチプロセッサシステムの4台のプロセッサ
P(1),P(2),P(3),P(4)で並列実行さ
せるために、配列A,B,Cをその先頭要素から順に3
要素ずつ各プロセッサP(1)〜P(4)に分散させた
場合を考える。この場合、そのプログラム中に存在する
例えば、 DO 20 J=1,12 A(J)=B(J)+C(J) 20 CONTINUE の如きDOループを、 プロセッサP(1); DO 20 J=1,3 A(J)=B(J)+C(J) 20 CONTINE プロセッサP(2); DO 20 J=4,6 A(J)=B(J)+C(J) 20 CONTINE プロセッサP(3); DO 20 J=7,9 A(J)=B(J)+C(J) 20 CONTINE プロセッサP(4); DO 20 J=10,12 A(J)=B(J)+C(J) 20 CONTINE のように各プロセッサに分散する場合、配列の分散とル
ープの分散とが一致するために、そのループ処理区間に
おいて配列の分散状態を変更する必要はない。
For example, an array element A as shown in FIG.
Array A consisting of (1) to A (12), array element B (1)
B, array elements C (1) to C (1) to B (12)
In order to execute a program declaring an array C consisting of (12) in parallel on four processors P (1), P (2), P (3), and P (4) of a memory distributed multiprocessor system, Arrays A, B, and C are sequentially assigned 3
Consider a case in which elements are distributed to the processors P (1) to P (4) one by one. In this case, a DO loop such as DO 20 J = 1,12 A (J) = B (J) + C (J) 20 CONTINUE existing in the program is processed by the processor P (1); DO 20 J = 1 , 3 A (J) = B (J) + C (J) 20 CONTINE processor P (2); DO 20 J = 4,6 A (J) = B (J) + C (J) 20 CONTINE processor P (3) DO 20 J = 7,9 A (J) = B (J) + C (J) 20 CONTINE Processor P (4); DO 20 J = 10,12 A (J) = B (J) + C (J) 20 When distributed to each processor as in CONTINE, it is not necessary to change the distributed state of the array in the loop processing section because the distribution of the array matches the distribution of the loop.

【0006】しかしながら、その同じプログラム中の例
えば、 DO 30 J=2,12 A(J)=B(J−1) B(J−1)=C(J) 30 CONTINE のようなDOループを、 プロセッサP(1); DO 30 J=2,3 A(J)=B(J−1) B(J−1)=C(J) 30 CONTINE プロセッサP(2); DO 30 J=4,6 A(J)=B(J−1) B(J−1)=C(J) 30 CONTINE プロセッサP(3); DO 30 J=7,9 A(J)=B(J−1) B(J−1)=C(J) 30 CONTINE プロセッサP(4); DO 30 J=10,12 A(J)=B(J−1) B(J−1)=C(J) 30 CONTINE のように各プロセッサに分散させる場合、プロセッサP
(2)がDO制御変数J=4のときにアクセスする配列
要素B(3)が自プロセッサに分散されておらず、プロ
セッサP(3)がDO制御変数J=7のときにアクセス
する配列要素B(6)が自プロセッサに分散されておら
ず、プロセッサP(4)がDO制御変数J=10のとき
にアクセスする配列要素B(9)が自プロセッサに分散
されておらない為、配列の分散とループの分散とが不一
致となる。
However, a DO loop such as DO 30 J = 2,12 A (J) = B (J-1) B (J-1) = C (J) 30 CONTINE in the same program, Processor P (1); DO 30 J = 2,3 A (J) = B (J-1) B (J-1) = C (J) 30 CONTINE Processor P (2); DO 30 J = 4,6 A (J) = B (J-1) B (J-1) = C (J) 30 CONTINE Processor P (3); DO 30 J = 7,9 A (J) = B (J-1) B ( J-1) = C (J) 30 CONTINE Processor P (4); DO 30 J = 10,12 A (J) = B (J-1) B (J-1) = C (J) 30 CONTINE Processor P, the processor P
Array element B (3) accessed when (2) is DO control variable J = 4 is not distributed to its own processor, and array element B (3) accessed when processor P (3) is DO control variable J = 7 B (6) is not distributed to its own processor, and array element B (9) accessed by processor P (4) when DO control variable J = 10 is not distributed to its own processor. The variance does not match the variance of the loop.

【0007】そこで、このようなDOループ30につい
ては、そのループの処理区間の直前に、プロセッサP
(1)からプロセッサP(2)に対して配列要素B
(3)を転送し、プロセッサP(2)からプロセッサP
(3)に対して配列要素B(6)を転送し、プロセッサ
P(3)からプロセッサP(4)に対して配列要素B
(9)を転送するデータ転送処理を挿入し、そのループ
の処理区間の直後に、プロセッサP(2)からプロセッ
サP(1)に対して配列要素B(3)を転送し、プロセ
ッサP(3)からプロセッサP(2)に対して配列要素
B(6)を転送し、プロセッサP(4)からプロセッサ
P(3)に対して配列要素B(9)を転送するデータ転
送処理を挿入していた。
Therefore, in such a DO loop 30, immediately before the processing section of the loop, the processor P
Array element B from (1) to processor P (2)
(3) is transferred from the processor P (2) to the processor P
The array element B (6) is transferred to (3), and the array element B (6) is transferred from processor P (3) to processor P (4).
Data transfer processing for transferring (9) is inserted, and immediately after the processing section of the loop, the array element B (3) is transferred from the processor P (2) to the processor P (1), and the processor P (3) is transferred. ) From the processor P (2) to the processor P (2), and a data transfer process for transferring the array element B (9) from the processor P (4) to the processor P (3). Was.

【0008】なお、配列A,B,Cの分散状態をDOル
ープ30に合致するように予め分散させた場合にはDO
ループ30の処理区間における配列分散状態の変更は必
要なくなるが、その反面、DOループ20の処理区間で
の配列分散状態の変更が必要となる。
If the distribution states of the arrays A, B, and C are dispersed in advance so as to match the DO loop 30, DO
Although it is not necessary to change the array distribution state in the processing section of the loop 30, it is necessary to change the array distribution state in the processing section of the DO loop 20.

【0009】[0009]

【発明が解決しようとする課題】このように従来におい
ては、ループの分散状態と一致しない当該ループ中の配
列要素については、必ずそのループの前後にデータ転送
処理が行われる。このデータ転送処理は実際のループ処
理には直接関係しない並列化のために生じるオーバヘッ
ドである。並列化においては、このオーバヘッドを如何
にして削減し並列化効率を上げるかが1つの課題であ
る。
As described above, in the related art, for an array element in a loop that does not match the distribution state of the loop, data transfer processing is always performed before and after the loop. This data transfer processing is an overhead caused by parallelization not directly related to the actual loop processing. In parallelization, one problem is how to reduce the overhead and increase the parallelization efficiency.

【0010】例えば前記と同じプログラム中に、 DO 10 J=2,12 A(J)=B(J−1)+C(J) 10 CONTINE のようなDOループ10があり、このDOループ10
を、 プロセッサP(1); DO 10 J=2,3 A(J)=B(J−1)+C(J) 10 CONTINE プロセッサP(2); DO 10 J=4,6 A(J)=B(J−1)+C(J) 10 CONTINE プロセッサP(3); DO 10 J=7,9 A(J)=B(J−1)+C(J) 10 CONTINE プロセッサP(4); DO 10 J=10,12 A(J)=B(J−1)+C(J) 10 CONTINE のように各プロセッサに分散させた場合、プロセッサP
(2)がDO制御変数J=4のときにアクセスする配列
要素B(3)が自プロセッサに分散されておらず、プロ
セッサP(3)がDO制御変数J=7のときにアクセス
する配列要素B(6)が自プロセッサに分散されておら
ず、プロセッサP(4)がDO制御変数J=10のとき
にアクセスする配列要素B(9)が自プロセッサに分散
されておらない為、配列の分散とループの分散とが不一
致となるため、従来は、前記DOループ30と同様に、
このようなDOループ10についても、そのループの処
理区間の直前に、プロセッサP(1)からプロセッサP
(2)に対して配列要素B(3)を転送し、プロセッサ
P(2)からプロセッサP(3)に対して配列要素B
(6)を転送し、プロセッサP(3)からプロセッサP
(4)に対して配列要素B(9)を転送するデータ転送
処理を挿入し、そのループの処理区間の直後に、プロセ
ッサP(2)からプロセッサP(1)に対して配列要素
B(3)を転送し、プロセッサP(3)からプロセッサ
P(2)に対して配列要素B(6)を転送し、プロセッ
サP(4)からプロセッサP(3)に対して配列要素B
(9)を転送するデータ転送処理を挿入する。
For example, in the same program as above, there is a DO loop 10 such as DO 10 J = 2,12 A (J) = B (J-1) + C (J) 10 CONTINE.
Processor P (1); DO 10 J = 2,3 A (J) = B (J−1) + C (J) 10 CONTINE processor P (2); DO 10 J = 4,6 A (J) = B (J-1) + C (J) 10 CONTINE processor P (3); DO10J = 7,9 A (J) = B (J-1) + C (J) 10 CONTINE processor P (4); DO10 J = 10,12 A (J) = B (J-1) + C (J) When distributed to each processor as in 10 CONTINE, the processor P
Array element B (3) accessed when (2) is DO control variable J = 4 is not distributed to its own processor, and array element B (3) accessed when processor P (3) is DO control variable J = 7 B (6) is not distributed to its own processor, and array element B (9) accessed by processor P (4) when DO control variable J = 10 is not distributed to its own processor. Since the variance and the variance of the loop do not match, conventionally, similarly to the DO loop 30,
Also for such a DO loop 10, immediately before the processing section of the loop, the processor P (1)
The array element B (3) is transferred to (2), and the array element B (3) is transferred from the processor P (2) to the processor P (3).
(6) is transferred from the processor P (3) to the processor P
Data transfer processing for transferring array element B (9) to (4) is inserted, and immediately after the processing section of the loop, processor P (2) transfers array element B (3) to processor P (1). ), The array element B (6) is transferred from the processor P (3) to the processor P (2), and the array element B (6) is transferred from the processor P (4) to the processor P (3).
A data transfer process for transferring (9) is inserted.

【0011】しかしながら、このようなDOループ10
については、配列要素B(3),B(6),B(9)は
繰り返し処理において参照だけが行われるものであり、
そのループの繰り返しの前後で値は変化しないので、ル
ープ直後のデータ転送処理は不要である。しかし、従来
はそのようなことを検出してデータ転送処理の挿入位置
を制御することができず、前記のDOループ30と同様
にループの前後にデータ転送処理が挿入されていた。
However, such a DO loop 10
, Array elements B (3), B (6), and B (9) are only referred to in the iterative processing.
Since the value does not change before and after the repetition of the loop, the data transfer processing immediately after the loop is unnecessary. However, conventionally, the insertion position of the data transfer process cannot be controlled by detecting such a situation, and the data transfer process is inserted before and after the loop as in the case of the DO loop 30 described above.

【0012】そこで本発明の目的は、ループの繰り返し
処理においてアクセスされる配列要素のアクセス方法を
調査し、その調査結果に応じてデータ転送処理を挿入す
る位置を決定することにより、ループの並列化において
発生するデータ転送を削減しオーバヘッドを減らすこと
でデータ分散プログラムの実行性能を上げることにあ
る。
It is therefore an object of the present invention to investigate a method of accessing an array element accessed in a loop repetition process and determine a position where a data transfer process is to be inserted in accordance with the result of the search, thereby making the loop parallel. An object of the present invention is to improve the execution performance of a data distribution program by reducing data transfer and overhead.

【0013】[0013]

【課題を解決するための手段】本発明の第1のコンパイ
ラにおけるデータ転送処理割り付け方法は、データ分散
記述言語で記述されたソースプログラム中で宣言された
配列を分散メモリ型マルチプロセッサシステムを構成す
る複数のプロセッサのローカルメモリに分散させると共
に、ループの各繰り返し処理の間にデータ依存関係の無
いループについて、そのループを前記複数のプロセッサ
で並列実行可能な形式に変形するコンパイラにおいて、
前記ソースプログラム中の配列の分散に関する指示行に
従って前記配列を分散し、前記ループの各繰り返し処理
毎にその配列要素が分散されているプロセッサを調べ、
その繰り返し処理でアクセスされる配列要素が最も多く
分散されているプロセッサにその繰り返し処理を割り当
てるように前記ループを分散し、前記ループの繰り返し
処理においてアクセスする配列要素のうちその繰り返し
処理を実行するプロセッサに分散されていない配列要素
を検出してその配列要素の配列に対するアクセス方法を
調査し、その配列要素の配列に対するアクセス方法が参
照だけのときは、その配列要素の内容をそれが分散され
ているプロセッサからそれをアクセスするプロセッサに
転送するデータ転送処理を、そのループの直前に挿入
し、その配列要素の配列に対するアクセス方法が更新だ
けのときは、それをアクセスしたプロセッサからアクセ
ス後の配列要素の内容をその配列要素が分散されている
プロセッサに転送するデータ転送処理を、前記ループの
直後に挿入することを特徴とする。本発明の第2のコン
パイラにおけるデータ転送処理割り付け方法は、データ
分散記述言語で記述されたソースプログラム中で宣言さ
れた配列を分散メモリ型マルチプロセッサシステムを構
成する複数のプロセッサのローカルメモリに分散させる
と共に、ループの各繰り返し処理の間にデータ依存関係
の無いループについて、そのループを前記複数のプロセ
ッサで並列実行可能な形式に変形するコンパイラにおい
て、前記ソースプログラム中の配列の分散に関する指示
行に従って前記配列を分散し、前記ループの各繰り返し
処理毎にその配列要素が分散されているプロセッサを調
べ、その繰り返し処理でアクセスされる配列要素が最も
多く分散されているプロセッサにその繰り返し処理を割
り当てるように前記ループを分散し、前記ループの繰り
返し処理においてアクセスする配列要素のうちその繰り
返し処理を実行するプロセッサに分散されていない配列
要素を検出してその配列要素の配列に対するアクセス方
法を調査し、その配列要素の配列に対するアクセス方法
が参照だけのときは、その配列要素の内容をそれが分散
されているプロセッサからそれをアクセスするプロセッ
サに転送するデータ転送処理を、そのループの直前に挿
入し、その配列要素の配列に対するアクセス方法が更新
だけのときは、それをアクセスしたプロセッサからアク
セス後の配列要素の内容をその配列要素が分散されてい
るプロセッサに転送するデータ転送処理を、前記ループ
の直後に挿入し、その配列要素の配列に対するアクセス
方法が前記以外の場合には、その配列要素の内容をそれ
が分散されているプロセッサからそれをアクセスするプ
ロセッサに転送するデータ転送処理を、そのループの直
前に挿入すると共に、それをアクセスしたプロセッサか
らアクセス後の配列要素の内容をその配列要素が分散さ
れているプロセッサに転送するデータ転送処理を、前記
ループの直後に挿入することを特徴とする。
According to a first aspect of the present invention, there is provided a method for allocating data transfer processing in a compiler, wherein an array declared in a source program described in a data distributed description language constitutes a distributed memory type multiprocessor system. A compiler that distributes the loop to a local memory of a plurality of processors and has no data dependency between each iteration of the loop, and transforms the loop into a form that can be executed in parallel by the plurality of processors.
In the instruction line regarding the distribution of the array in the source program
Therefore, the array is distributed, and each iteration of the loop is performed.
Check the processor where the array element is distributed for each
Most of the array elements accessed in that iteration
Assign the repetitive processing to distributed processors
Disperse the loop so that
Detects array elements that are not distributed to the processor that executes the iterative processing among array elements to be accessed in processing and investigates the access method to the array of the array elements. In some cases, a data transfer process that transfers the contents of the array element from the processor in which it is distributed to the processor that accesses it is inserted immediately before the loop, and the access method for the array of array elements is only update. In some cases, a data transfer process for transferring the contents of the accessed array element from the processor accessing the element to the processor in which the array element is distributed is inserted immediately after the loop. In the data transfer processing allocation method in the second compiler according to the present invention, an array declared in a source program described in a data distribution description language is distributed to local memories of a plurality of processors constituting a distributed memory multiprocessor system. with a loop for no data dependence between each iteration loop, the compiler for deforming the loop in parallel executable form by the plurality of processors, instructions about the distribution of the sequences in the source program
Disperse the array according to the rows, each iteration of the loop
For each process, adjust the processor in which the array elements are distributed.
In addition, the array elements accessed in the
Assign the repetitive processing to many distributed processors.
Disperse the loop so that
Detects array elements that are not distributed to the processor that executes the iterative processing among the array elements to be accessed in the return processing, investigates the access method to the array of the array elements, and refers only to the access method to the array of the array elements. In the case of, insert a data transfer process that transfers the contents of the array element from the processor in which it is distributed to the processor that accesses it, immediately before the loop, and the access method for the array of array elements is updated only. In the case of, a data transfer process for transferring the contents of the accessed array element from the processor that accessed it to the processor in which the array element is distributed is inserted immediately after the loop, and the access to the array of the array element is performed. Otherwise, the contents of the array element are distributed A data transfer process for transferring the data from the processor to the processor accessing the data is inserted immediately before the loop, and the content of the accessed array element is transferred from the processor accessing the data to the processor where the array element is distributed. A data transfer process is inserted immediately after the loop.

【0014】[0014]

【実施例】次に本発明の実施例について図面を参照して
詳細に説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Next, embodiments of the present invention will be described in detail with reference to the drawings.

【0015】図1は本発明を適用したコンパイラの一例
を示すブロック図である。この例のコンパイラ1は、プ
ロセッサ毎にデータや処理の分散を指定できるようなデ
ータ分散記述言語によって記述されたソースプログラム
2を入力して、メモリ分散型マルチプロセッサシステム
向けの目的プログラム3を生成するもので、ソースプロ
グラム2を入力して構文解析を行い、中間テキスト4を
生成する解析部11と、中間テキスト4を入力して処理
の並列化を行い、並列化中間テキスト5を生成する並列
化部12と、並列化中間テキスト5から目的プログラム
3を生成する生成部13とから構成されている。本発明
の特徴はコンパイラ1における並列化部12にあるた
め、以下、並列化部12について詳述する。
FIG. 1 is a block diagram showing an example of a compiler to which the present invention is applied. The compiler 1 of this example receives a source program 2 described in a data distribution description language that can specify the distribution of data and processing for each processor, and generates a target program 3 for a memory distributed multiprocessor system. A parsing unit 11 that inputs the source program 2 and performs a syntax analysis to generate an intermediate text 4, and a parallelization that inputs the intermediate text 4 and performs parallel processing and generates a parallelized intermediate text 5 It comprises a unit 12 and a generating unit 13 for generating the target program 3 from the parallelized intermediate text 5. Since the features of the present invention reside in the parallelization unit 12 in the compiler 1, the parallelization unit 12 will be described in detail below.

【0016】並列化部12は、図1に示すように、配列
分散手段121と、ループ分散手段122と、分散比較
手段123と、アクセス解析手段124と、データ転送
処理生成手段125と、ループ変形手段126とから構
成されている。
As shown in FIG. 1, the parallelizing unit 12 includes an array distributing unit 121, a loop distributing unit 122, a distribution comparing unit 123, an access analyzing unit 124, a data transfer processing generating unit 125, And means 126.

【0017】配列分散手段121は、ソースプログラム
2において宣言された各配列のどの要素を、当該プログ
ラムを並列実行させる複数プロセッサのどのプロセッサ
に分散させるかを決定する。分散の決定は、ソースプロ
グラム2中に配列の分散方法を指定する指示行がある場
合にはそれに従い、そのような指示行がなければ予め定
められた規定値に従う。生成された目的プログラム3の
実行時には、ここで決定された分散状態に従って、当該
プログラムを並列実行させる複数プロセッサのローカル
メモリに配列の要素が割り付けられる。
The array distributing means 121 determines which element of each array declared in the source program 2 is distributed to which of a plurality of processors that execute the program in parallel. The distribution is determined according to the instruction line that specifies the array distribution method in the source program 2 if the instruction line is specified, and according to a predetermined value if there is no such instruction line. When the generated target program 3 is executed, the elements of the array are allocated to local memories of a plurality of processors that execute the program in parallel according to the distribution state determined here.

【0018】例えば、図2に示すように、各々がローカ
ルメモリとCPUとデータ転送装置を有する4台のプロ
セッサP(1)〜P(4)がネットワーク、例えば伝送
路を介して結合されたメモリ分散型マルチプロセッサシ
ステムにおいて、4台のプロセッサP(1)〜P(4)
に対して、図3に示すような要素A(1)〜A(12)
で構成される配列Aを等分に分散させる場合、プロセッ
サP(1)〜P(4)のローカルメモリに、図3の符号
M1〜M4に示すような配列A全体を格納する記憶域が
確保され、プロセッサP(1)の記憶域M1の1番目か
ら3番目のエントリに配列要素A(1)〜A(3)がロ
ードされ、プロセッサP(2)の記憶域M2の4番目か
ら6番目のエントリに配列要素A(4)〜A(6)がロ
ードされ、プロセッサP(3)の記憶域M3の7番目か
ら9番目のエントリに配列要素A(7)〜A(9)がロ
ードされ、プロセッサP(4)の記憶域M4の10番目
から12番目のエントリに配列要素A(10)〜A(1
2)がロードされる。なお、配列A全体を格納する記憶
域の代わりに、分散分の配列要素とプロセッサ間でデー
タ転送される配列要素との合計に最小限必要な記憶域を
確保する方法もある。
For example, as shown in FIG. 2, a memory in which four processors P (1) to P (4) each having a local memory, a CPU and a data transfer device are connected via a network, for example, a transmission line. In a distributed multiprocessor system, four processors P (1) to P (4)
In contrast, elements A (1) to A (12) as shown in FIG.
In the case of distributing the array A composed of the following evenly, a storage area for storing the entire array A as shown by reference numerals M1 to M4 in FIG. 3 is secured in the local memories of the processors P (1) to P (4). Then, array elements A (1) to A (3) are loaded into the first to third entries of the storage area M1 of the processor P (1), and the fourth to sixth elements of the storage area M2 of the processor P (2) are loaded. Are loaded with array elements A (4) to A (6), and array elements A (7) to A (9) are loaded into the seventh to ninth entries of the storage area M3 of the processor P (3). The array elements A (10) to A (1) are stored in the tenth to twelfth entries of the storage area M4 of the processor P (4).
2) is loaded. Note that, instead of the storage area for storing the entire array A, there is also a method of securing a minimum storage area required for the sum of the array elements for the distributed portion and the array elements for data transfer between the processors.

【0019】上記の配列分散手段121で決定された配
列の分散状態を前提として、ソースプログラム2に記述
された個々のループ毎に、ループ分散手段122,分散
比較手段123,アクセス解析手段124,データ転送
処理生成手段125およびループ変形手段126で、以
下のような処理を実行する。なお、現在注目しているル
ープを現ループと呼ぶ。
On the premise of the distribution state of the array determined by the above-described array distribution unit 121, a loop distribution unit 122, a distribution comparison unit 123, an access analysis unit 124, a data The transfer processing generating means 125 and the loop deforming means 126 execute the following processing. The current loop is called the current loop.

【0020】ループ分散手段122は、ソースプログラ
ム2に記述された現ループが、繰り返し処理の間でデー
タ依存関係の無い並列化可能なループの場合に、そのル
ープのどの繰り返し部分を、当該プログラムを並列実行
させる複数プロセッサのどのプロセッサに分散させるか
を決定する。分散の決定は、ソースプログラム2中に現
ループの分散方法を指定する指示行がある場合にはそれ
に従い、そのような指示行がない場合には、現ループ中
に含まれる全ての配列について配列分散手段121で決
定された分散状態に基づいて決定する。
When the current loop described in the source program 2 is a parallelizable loop having no data dependency between the iterative processes, the loop distributing means 122 Decide which of a plurality of processors to be executed in parallel is distributed. The distribution is determined according to the instruction line specifying the distribution method of the current loop in the source program 2 if there is no such instruction line, and if there is no such instruction line, the array is set for all the arrays included in the current loop. The determination is made based on the distribution state determined by the distribution unit 121.

【0021】次に分散比較手段123は、当該プログラ
ムを並列実行させる各プロセッサ毎に、そのプロセッサ
に分散させるものとしてループ分散手段122で決定さ
れた現ループの繰り返し部分においてアクセスされる配
列要素のうち、配列分散手段121でそのプロセッサに
分散するものとして決定されていない配列要素(以下、
このような配列要素を未割り付け配列要素と呼ぶ)を全
て検出する。
Next, the distribution comparing means 123 determines, for each processor which executes the program in parallel, the array elements accessed in the repetition part of the current loop determined by the loop distributing means 122 to be distributed to the processors. , Array elements that have not been determined to be distributed to the processor by the array
All such array elements are referred to as unallocated array elements).

【0022】次にアクセス解析手段124は、分散比較
手段123で検出された未割り付け配列要素に関する現
ループでのアクセス方法を調べ、以下の3通りに区分す
る。 1)未割り付け配列要素に対して参照だけが行われてい
る。 2)未割り付け配列要素に対して更新だけが行われてい
る。 3)前記1)および2)以外。即ち未割り付け配列要素
に対して参照および更新が行われている。
Next, the access analysis means 124 examines the access method in the current loop regarding the unallocated array element detected by the distribution comparison means 123, and classifies it into the following three types. 1) Only reference is made to an unallocated array element. 2) Only the update is performed on the unallocated array elements. 3) Other than the above 1) and 2). That is, reference and update are performed on the unallocated array elements.

【0023】次にデータ転送処理生成手段125は、分
散比較手段123で検出された未割り付け配列要素と、
その配列要素についてアクセス解析手段124で調査さ
れたアクセス方法とに基づいて、データ転送処理の記述
を生成し、現ループに以下のように追加する。 A)アクセス方法が前記1)の未割り付け配列要素につ
いては、その配列要素が分散されているプロセッサか
ら、その配列要素の内容を、その未割り付け配列要素の
存在したプロセッサに転送するデータ転送処理の記述
を、現ループの直前に挿入する。 B)アクセス方法が前記2)の未割り付け配列要素につ
いては、その未割り付け配列要素の存在したプロセッサ
から、更新後の未割り付け配列要素の内容を、その配列
要素が分散されているプロセッサに転送するデータ転送
処理の記述を、現ループの直後に挿入する。 C)アクセス方法が前記3)の未割り付け配列要素につ
いては、その配列要素が分散されているプロセッサか
ら、その配列要素の内容を、その未割り付け配列要素の
存在したプロセッサに転送するデータ転送処理の記述
を、現ループの直前に挿入し、且つ、その未割り付け配
列要素の存在したプロセッサから、更新後の未割り付け
配列要素の内容を、その配列要素が分散されているプロ
セッサに転送するデータ転送処理の記述を、現ループの
直後に挿入する。
Next, the data transfer processing generating means 125 calculates the unallocated array element detected by the distribution comparing means 123,
Based on the access method investigated by the access analysis means 124 for the array element, a description of the data transfer processing is generated and added to the current loop as follows. A) For the unallocated array element whose access method is 1), the data transfer processing for transferring the contents of the array element from the processor in which the array element is distributed to the processor in which the unallocated array element exists is described. Insert the description just before the current loop. B) For the unallocated array element whose access method is 2), the content of the updated unallocated array element is transferred from the processor in which the unallocated array element exists to the processor in which the array element is distributed. The description of the data transfer process is inserted immediately after the current loop. C) For the unallocated array element whose access method is 3), the data transfer processing for transferring the contents of the array element from the processor in which the array element is distributed to the processor in which the unallocated array element exists. Data transfer processing for inserting a description immediately before the current loop and transferring the contents of the updated unallocated array element from the processor in which the unallocated array element was present to the processor in which the array element is distributed. Is inserted immediately after the current loop.

【0024】次にループ変形手段126は、現ループの
各繰り返し処理がループ分散手段122で決定されたプ
ロセッサ上で処理されるよう現ループのループ制御文等
を変形する。そして、ソースプログラム2に未だ注目し
ていないループが残っていれば、ループ分散手段122
に制御を戻し、残っていなければ処理を終了する。
Next, the loop transforming means 126 transforms the loop control statement and the like of the current loop so that each repetitive processing of the current loop is processed on the processor determined by the loop distributing means 122. Then, if a loop that has not yet been noticed remains in the source program 2, the loop distribution unit 122
And the process is terminated if there is no remaining one.

【0025】以下、具体例に沿って本実施例の動作を説
明する。なお、例としては、図4に示すようなデータ分
散記述言語HPF(High Performance
FORTRAN)で記述されたソースプログラム2を
コンパイルする場合を取り上げる。なお、図4のソース
プログラム2において、3行目の「!HPF$ PRO
CESSORS P(4)」は当該プログラムを並列実
行させるプロセッサの台数を指定したHPF指示行であ
り、4行目の「!HPF$ DISTRIBUTE
(BLOCK(3))ONTO P :: A,B,
C」は配列A〜Cの分散方法を指定するHPF指示行で
ある。
The operation of this embodiment will be described below with reference to a specific example. As an example, a data distributed description language HPF (High Performance) as shown in FIG.
The case where the source program 2 described in FORTRAN) is compiled will be described. In the source program 2 of FIG. 4, "! HPF @ PRO"
“CESSORS P (4)” is an HPF instruction line that specifies the number of processors that execute the program in parallel, and “! HPF @ DISTRIBUTE” on the fourth line.
(BLOCK (3)) ONTO P :: A, B,
“C” is an HPF instruction line that specifies the distribution method of the arrays A to C.

【0026】図4のようなソースプログラム2が入力さ
れると、コンパイラ1の解析部11はその構文解析を行
って中間テキスト4を生成し、並列化部12がその中間
テキスト4を入力して、以下のような処理を実行する。
When the source program 2 as shown in FIG. 4 is input, the analysis unit 11 of the compiler 1 analyzes the syntax to generate an intermediate text 4, and the parallelization unit 12 inputs the intermediate text 4 and The following processing is executed.

【0027】先ず、配列分散手段121は、プログラム
で宣言された配列A〜Cに関して、その分散方法を指定
する指示行が存在するため、その指示行の内容に従っ
て、配列A,B,Cをその先頭要素から3要素ずつ順番
に、4台のプロセッサ(P(1),P(2),P
(3),P(4)とする)に割り当てる。図5はこのと
きの配列A,B,Cの各プロセッサP(1),P
(2),P(3),P(4)への分散状況を示してい
る。
First, the array dispersing means 121 divides the arrays A, B, and C according to the contents of the instruction lines because there are instruction lines for specifying the distribution method for the arrays A to C declared in the program. Four processors (P (1), P (2), P
(3), P (4)). FIG. 5 shows each processor P (1), P of the arrays A, B, C at this time.
(2), the distribution status to P (3) and P (4) is shown.

【0028】次にループ分散手段122は、ソースプロ
グラム2に記述された1つのループに注目し、そのルー
プが繰り返し処理においてデータ依存関係が無ければ並
列化の対象とし、そのループの分散を決定する。今、図
4に示される配列のアクセスを含む、 DO 10 J=2,12 A(J)=B(J−1)+C(J) 10 CONTINUE なるDOループ10に注目したとすると、ループの繰り
返し処理においてデータ依存関係が無いため並列化可能
と判断する。また、そのループに対する分散指示の指示
行が無いため、そのループ中の配列A,B,Cについて
の図5に示した分散状態に基づいて、そのループのどの
繰り返し処理をどのプロセッサに割り当てるかを決定す
る。
Next, the loop distributing means 122 pays attention to one loop described in the source program 2, and if the loop has no data dependency in the repetitive processing, sets it as a target of parallelization and determines the distribution of the loop. . Now, if attention is paid to the DO loop 10 including DO 10 J = 2, 12 A (J) = B (J−1) + C (J) 10 CONTINUE including the access of the array shown in FIG. Since there is no data dependency in the processing, it is determined that parallelization is possible. Further, since there is no instruction line of the distribution instruction for the loop, based on the distribution state shown in FIG. 5 for the arrays A, B, and C in the loop, it is determined which repetitive processing of the loop is to be allocated to which processor. decide.

【0029】この決定においては、プロセッサ間の配列
要素のデータ転送を極力避けるために、各繰り返し処理
毎に、その繰り返し処理でアクセスされる配列要素とそ
の配列要素が分散されているプロセッサとを調べ、その
繰り返し処理でアクセスされる配列要素が最も多く分散
されているプロセッサ(換言すれば未割り付け配列要素
が最も少ないプロセッサ)に、その繰り返し処理を割り
当てるようにする。
In this determination, in order to avoid data transfer of array elements between processors as much as possible, at each repetition processing, the array elements accessed in the repetition processing and the processors in which the array elements are distributed are examined. The repetition processing is assigned to the processor in which the array elements accessed in the repetition processing are distributed most (in other words, the processor having the least unallocated array elements).

【0030】例えば上記のDOループ10についてDO
制御変数Jの値毎、つまり各繰り返し処理毎に、その繰
り返し処理でアクセスされる配列要素とその配列要素が
分散されているプロセッサとの関係を調べると、図6の
(A)に示すようになるため、各繰り返し処理の割り当
て先プロセッサは図6の(B)に示すものとなる。即
ち、DO制御変数Jが2である1巡目の繰り返し処理を
考えると、アクセスされる配列要素はA(2),B
(1),C(2)であり、これらの配列要素は全てプロ
セッサP(1)に分散されているので、一巡目の繰り返
し処理はプロセッサP(1)に割り当てられる。同様に
DO制御変数Jが3である2巡目の繰り返し処理もプロ
セッサP(1)に割り当てられる。DO制御変数Jが4
である3巡目の繰り返し処理では、アクセスされる3つ
の配列要素のうち、1つの配列要素B(3)がプロセッ
サP(1)に、残り2つの配列要素A(4),C(4)
がプロセッサP(2)に分散されているため、プロセッ
サP(2)に割り当てられる。以下同様に、DO制御変
数Jが5,6である4,5巡目の繰り返し処理がプロセ
ッサP(2)に、DO制御変数Jが7,8,9である
6,7,8巡目の繰り返し処理がプロセッサP(3)
に、DO制御変数Jが10,11,12である9,1
0,11巡目の繰り返し処理がプロセッサP(4)に、
それぞれ割り当てられる。
For example, for the above DO loop 10, DO
For each value of the control variable J, that is, for each iterative process, the relationship between the array element accessed in the iterative process and the processor in which the array element is distributed is examined. As shown in FIG. Therefore, the processor to which each repetition process is assigned is as shown in FIG. That is, considering the first iteration of the DO control variable J of 2, the array elements to be accessed are A (2), B
(1) and C (2), and since these array elements are all distributed to the processor P (1), the first round of repetitive processing is assigned to the processor P (1). Similarly, the second repetition process in which the DO control variable J is 3 is also assigned to the processor P (1). DO control variable J is 4
In the third iteration of the processing, among the three array elements to be accessed, one array element B (3) is assigned to the processor P (1) and the remaining two array elements A (4) and C (4)
Are distributed to the processor P (2), and are thus assigned to the processor P (2). Similarly, the repetition processing of the fourth and fifth rounds in which the DO control variable J is 5 and 6 is performed on the processor P (2), and the sixth, seventh and eighth rounds in which the DO control variable J is 7, 8, and 9 are performed. Iterative processing is processor P (3)
, Where the DO control variable J is 10, 11, 12
The repetition processing of the 0th and 11th rounds is performed by the processor P (4).
Assigned respectively.

【0031】次に分散比較手段123は、各プロセッサ
P(1)〜P(4)毎に、そのプロセッサに割り当てら
れたループの繰り返し部分においてアクセスする配列要
素のうち、配列分散手段121でそのプロセッサに分散
されていない配列要素(未割り付け配列要素)を全て検
出する。例えば、上述したループ10では、DO制御変
数Jが4である3巡目の繰り返し処理を割り当てられた
プロセッサP(2)がアクセスする配列要素B(3)は
そのプロセッサP(2)に分散されておらず、DO制御
変数Jが7である6巡目の繰り返し処理を割り当てられ
たプロセッサP(3)がアクセスする配列要素B(6)
はそのプロセッサP(3)に分散されておらず、DO制
御変数Jが10である9巡目の繰り返し処理を割り当て
られたプロセッサP(4)がアクセスする配列要素B
(9)はそのプロセッサP(4)に分散されていないた
め、図6の(C)に示す配列Bの3つの配列要素B
(3),B(6),B(9)が未割り付け配列要素とし
て検出される。
Next, for each of the processors P (1) to P (4), the distribution comparing means 123 selects, for each processor P (1) to P (4), All array elements that are not distributed to the array (unallocated array elements) are detected. For example, in the above-described loop 10, the array element B (3) accessed by the processor P (2) to which the third iteration of the DO control variable J is 4 is distributed to the processor P (2). Array element B (6) accessed by processor P (3) to which the sixth iteration of DO control variable J of 7 has been assigned
Is not distributed to the processor P (3), and the array element B accessed by the processor P (4) to which the ninth iteration processing in which the DO control variable J is 10 is assigned
Since (9) is not distributed to the processor P (4), three array elements B of the array B shown in FIG.
(3), B (6), and B (9) are detected as unallocated array elements.

【0032】次にアクセス解析手段124は、分散比較
手段123で検出された未割り付け配列要素に関して、
そのループ中でのアクセスの内容を解析し、前述した
1),2),3)の3つのケースに分類する。前述のD
Oループ10について検出された未割り付け配列要素B
(3),B(6),B(9)については、参照だけが行
われているので、前記1)のケースと判断される。
Next, the access analyzing means 124 calculates the unallocated array element detected by the distribution comparing means 123
The contents of the access in the loop are analyzed and classified into the three cases 1), 2) and 3) described above. D above
Unallocated array element B detected for O loop 10
As for (3), B (6), and B (9), only the reference is performed, so the case of the above 1) is determined.

【0033】次にデータ転送処理生成手段125は、分
散比較手段123で検出された未割り付け配列要素と、
それについてアクセス解析手段124で調査されたアク
セス方法とに基づき、前述のA)〜C)に示す方法で、
データ転送処理の記述をループに追加する。従って、前
記DOループ10の未割り付け配列要素B(3),B
(6),B(9)については、そのアクセス方法が前記
1)のケースに該当するので、前記A)の方法が適用さ
れ、DOループ10の直前にデータ転送処理の記述が挿
入される。このとき挿入されるデータ転送処理の記述
は、プロセッサP(1)上の配列要素B(3)の内容を
プロセッサP(2)に転送する記述と、プロセッサP
(2)上の配列要素B(6)の内容をプロセッサP
(3)に転送する記述と、プロセッサP(3)上の配列
要素B(9)の内容をプロセッサP(4)に転送する記
述とを含む。
Next, the data transfer processing generating means 125 calculates the unallocated array element detected by the distribution comparing means 123,
Based on the access method investigated by the access analysis means 124, the method shown in the above A) to C) is used.
Add a description of the data transfer process to the loop. Therefore, the unallocated array elements B (3), B
For (6) and B (9), since the access method corresponds to the case of the above 1), the method of the above A) is applied, and a description of the data transfer process is inserted immediately before the DO loop 10. The description of the data transfer process inserted at this time includes a description for transferring the contents of the array element B (3) on the processor P (1) to the processor P (2) and a description for the processor P (2).
(2) The contents of the array element B (6) above are
The description includes a description to be transferred to (3) and a description to transfer the contents of array element B (9) on processor P (3) to processor P (4).

【0034】次にループ変形手段126は、ループの各
繰り返し処理がループ分散手段122で決定されたプロ
セッサ上で処理されるようにループを変形する。例えば
前記のDOループ10の場合、DO制御変数Jに与えら
れる開始と終了の値をstart( )及びend(
)の関数で求めるように変形する。なお、関数sta
rt( )及び関数end( )はコンパイラ2が目的
プログラム3中に生成する関数であり、プロセッサP
(1)から呼び出されたときは2および3を、プロセッ
サP(2)から呼び出されたときは4および6を、プロ
セッサP(3)から呼び出されたときは7および9を、
プロセッサP(4)から呼び出されたときは10および
12を返却する。
Next, the loop transformation means 126 transforms the loop so that each iteration of the loop is processed on the processor determined by the loop distribution means 122. For example, in the case of the DO loop 10, the start and end values given to the DO control variable J are defined as start () and end (
). Note that the function sta
rt () and function end () are functions generated by the compiler 2 in the target program 3, and the processor P
2 and 3 when called from (1), 4 and 6 when called from processor P (2), 7 and 9 when called from processor P (3),
When called from the processor P (4), 10 and 12 are returned.

【0035】従って、前述したDOループ10の場合に
は、結局、図7に示すようなループに変形される。な
お、図7において、1行目のデータ転送処理の記述は、
プロセッサP(1)上の配列要素B(3)の内容をプロ
セッサP(2)に転送する記述を、2行目のデータ転送
処理の記述は、プロセッサP(2)上の配列要素B
(6)の内容をプロセッサP(3)に転送する記述を、
3行目のデータ転送処理の記述は、プロセッサP(3)
上の配列要素B(9)の内容をプロセッサP(4)に転
送する記述をそれぞれ示し、各々該当するプロセッサの
みで実行される。
Accordingly, in the case of the above-described DO loop 10, the loop is eventually transformed into a loop as shown in FIG. In FIG. 7, the description of the data transfer process on the first line is
The description for transferring the contents of the array element B (3) on the processor P (1) to the processor P (2) is described in the description of the data transfer processing on the second line.
The description for transferring the content of (6) to the processor P (3) is as follows:
The description of the data transfer processing in the third line is described in the processor P (3).
The description for transferring the contents of the above array element B (9) to the processor P (4) is shown, and is executed only by the corresponding processor.

【0036】ループ変形手段126は、現ループについ
ての変形を終えると、プログラム中にまだ並列化してい
ないループが残っていれば、ループ分散手段122に制
御を戻し、残っていなければ処理を終了する。
When the modification of the current loop is completed, the loop transformation means 126 returns the control to the loop distribution means 122 if there is a loop which has not been parallelized yet in the program, and terminates the processing if there is no remaining loop. .

【0037】以上のような並列化部12の処理後、生成
部13が並列化中間テキスト5から目的プログラム3を
生成する。
After the processing by the parallelizing unit 12 as described above, the generating unit 13 generates the target program 3 from the parallelized intermediate text 5.

【0038】[0038]

【発明の効果】以上説明したように、本発明は、ループ
の繰り返し処理においてアクセスする配列要素のうちそ
の繰り返し処理を実行するプロセッサに分散されていな
い配列要素を検出した場合、更にその配列要素のアクセ
ス方法を調査し、それが参照のみの場合にはループの直
前にだけデータ転送処理を挿入し、それが更新のみの場
合にはループの直後にだけデータ転送処理を挿入するよ
うにしたので、何れの場合にも一律にループの前後にデ
ータ転送処理が挿入されていた従来技術に比べてデータ
転送処理の回数を削除することができ、データ分散プロ
グラムの並列化におけるオーバヘッドを低減することが
できる。
As described above, according to the present invention, when an array element which is not distributed among processors which execute the iterative processing among array elements to be accessed in a loop iterative processing is detected, the array element After investigating the access method, if it is a reference only, insert a data transfer process just before the loop, and if it is only an update, insert a data transfer process only immediately after the loop, In any case, the number of times of data transfer processing can be reduced compared to the related art in which data transfer processing is uniformly inserted before and after a loop, and overhead in parallelizing a data distribution program can be reduced. .

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

【図1】本発明を適用したコンパイラの一実施例を示す
ブロック図である。
FIG. 1 is a block diagram showing an embodiment of a compiler to which the present invention is applied.

【図2】配列を各プロセッサのローカルメモリに割り付
ける方法の一例の説明図である。
FIG. 2 is an explanatory diagram of an example of a method of allocating an array to a local memory of each processor.

【図3】メモリ分散型マルチプロセッサシステムの一例
を示すブロック図である。
FIG. 3 is a block diagram illustrating an example of a memory distributed multiprocessor system.

【図4】データ分散記述言語で記述されたソースプログ
ラムの一例を示す図である。
FIG. 4 is a diagram showing an example of a source program described in a data distribution description language.

【図5】配列の分散例を示す図である。FIG. 5 is a diagram illustrating an example of arrangement of arrays;

【図6】ループの繰り返し処理を複数のプロセッサに分
散させた例と、ループの繰り返し処理においてアクセス
する配列要素のうちその繰り返し処理を実行するプロセ
ッサに分散されていない配列要素の例とを示す図であ
る。
FIG. 6 is a diagram illustrating an example in which loop iteration processing is distributed to a plurality of processors, and an example of array elements that are not distributed among processors that execute the iteration processing among array elements accessed in loop iteration processing. It is.

【図7】並列化後のループの例を示す図である。FIG. 7 is a diagram illustrating an example of a loop after parallelization.

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

1…コンパイラ 11…解析部 12…並列化部 121…配列分散手段 122…ループ分散手段 123…分散比較手段 124…アクセス解析手段 125…データ転送処理生成手段 126…ループ変形手段 13…生成部 2…ソースプログラム 3…目的プログラム 4…中間テキスト 5…並列化中間テキスト DESCRIPTION OF SYMBOLS 1 ... Compiler 11 ... Analysis part 12 ... Parallelization part 121 ... Array distribution means 122 ... Loop distribution means 123 ... Distribution comparison means 124 ... Access analysis means 125 ... Data transfer processing generation means 126 ... Loop transformation means 13 ... Generation part 2 ... Source program 3 ... Objective program 4 ... Intermediate text 5 ... Parallelized intermediate text

───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 平7−114516(JP,A) 「並列処理シンポジウム JSPP’ 95論文集」(1995−5−15)P.361− 368 「情報処理」Vol.34,No.9 (1993−9)P.1179−1185 「並列処理シンポジウム JSPP’ 94」(1994−5)P.156−158 (58)調査した分野(Int.Cl.7,DB名) G06F 9/45 ────────────────────────────────────────────────── ─── Continuation of the front page (56) References JP-A-7-1114516 (JP, A) "Parallel Processing Symposium JSPP'95 Transactions" (1995-5-15) 361-368 "Information Processing" Vol. 34, no. 9 (1993-9) p. 1179-1185 "Parallel Processing Symposium JSPP'94" (1994-5) 156-158 (58) Field surveyed (Int. Cl. 7 , DB name) G06F 9/45

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 データ分散記述言語で記述されたソース
プログラム中で宣言された配列を分散メモリ型マルチプ
ロセッサシステムを構成する複数のプロセッサのローカ
ルメモリに分散させると共に、ループの各繰り返し処理
の間にデータ依存関係の無いループについて、そのルー
プを前記複数のプロセッサで並列実行可能な形式に変形
するコンパイラにおいて、前記ソースプログラム中の配列の分散に関する指示行に
従って前記配列を分散し、 前記ループの各繰り返し処理毎にその配列要素が分散さ
れているプロセッサを調べ、その繰り返し処理でアクセ
スされる配列要素が最も多く分散されているプロセッサ
にその繰り返し処理を割り当てるように前記ループを分
散し、 前記ループの繰り返し処理において アクセスする配列要
素のうちその繰り返し処理を実行するプロセッサに分散
されていない配列要素を検出してその配列要素の配列に
対するアクセス方法を調査し、 その配列要素の配列に対するアクセス方法が参照だけの
ときは、その配列要素の内容をそれが分散されているプ
ロセッサからそれをアクセスするプロセッサに転送する
データ転送処理を、そのループの直前に挿入し、 その配列要素の配列に対するアクセス方法が更新だけの
ときは、それをアクセスしたプロセッサからアクセス後
の配列要素の内容をその配列要素が分散されているプロ
セッサに転送するデータ転送処理を、前記ループの直後
に挿入することを特徴とするコンパイラにおけるデータ
転送処理割り付け方法。
1. A source described in a data distribution description language
Arrays declared in the program can be
Localizers of multiple processors that make up a processor system
And iterative processing of each loop
Loops that have no data dependencies between them
To a form that can be executed in parallel by the multiple processors
CompilerIn the instruction line regarding the distribution of the array in the source program
Therefore, dispersing the array, The array elements are distributed for each iteration of the loop.
Check the processor that is
Processor with the most distributed array elements
The loop is divided so that
Scattered In the loop iteration process Array required to access
Distributed to processors that execute the repetition of the element
Undetected array element and add it to the array
Investigate the access method for the
When the contents of an array element are
Transfer from the processor to the accessing processor
Insert the data transfer process just before the loop, and the access method to the array
Sometimes, after access from the processor that accessed it
The contents of the array element
Data transfer processing to be transferred to the processor immediately after the loop
Characterized by being inserted intoData in the compiler
Transfer processing allocation method.
【請求項2】 データ分散記述言語で記述されたソース
プログラム中で宣言された配列を分散メモリ型マルチプ
ロセッサシステムを構成する複数のプロセッサのローカ
ルメモリに分散させると共に、ループの各繰り返し処理
の間にデータ依存関係の無いループについて、そのルー
プを前記複数のプロセッサで並列実行可能な形式に変形
するコンパイラにおいて、前記ソースプログラム中の配列の分散に関する指示行に
従って前記配列を分散し、 前記ループの各繰り返し処理毎にその配列要素が分散さ
れているプロセッサを 調べ、その繰り返し処理でアクセ
スされる配列要素が最も多く分散されているプロセッサ
にその繰り返し処理を割り当てるように前記ループを分
散し、 前記ループの繰り返し処理において アクセスする配列要
素のうちその繰り返し処理を実行するプロセッサに分散
されていない配列要素を検出してその配列要素の配列に
対するアクセス方法を調査し、 その配列要素の配列に対するアクセス方法が参照だけの
ときは、その配列要素の内容をそれが分散されているプ
ロセッサからそれをアクセスするプロセッサに転送する
データ転送処理を、そのループの直前に挿入し、 その配列要素の配列に対するアクセス方法が更新だけの
ときは、それをアクセスしたプロセッサからアクセス後
の配列要素の内容をその配列要素が分散されているプロ
セッサに転送するデータ転送処理を、前記ループの直後
に挿入し、 その配列要素の配列に対するアクセス方法が前記以外の
場合には、その配列要素の内容をそれが分散されている
プロセッサからそれをアクセスするプロセッサに転送す
るデータ転送処理を、そのループの直前に挿入すると共
に、それをアクセスしたプロセッサからアクセス後の配
列要素の内容をその配列要素が分散されているプロセッ
サに転送するデータ転送処理を、前記ループの直後に挿
入することを特徴とするコンパイラにおけるデータ転送
処理割り付け方法。
2. A source described in a data distribution description language.
Arrays declared in the program can be
Localizers of multiple processors that make up a processor system
And iterative processing of each loop
Loops that have no data dependencies between them
To a form that can be executed in parallel by the multiple processors
CompilerIn the instruction line regarding the distribution of the array in the source program
Therefore, dispersing the array, The array elements are distributed for each iteration of the loop.
Processor Search, and access
Processor with the most distributed array elements
The loop is divided so that
Scattered In the loop iteration process Array required to access
Distributed to processors that execute the repetition of the element
Undetected array element and add it to the array
Investigate the access method for the
When the contents of an array element are
Transfer from the processor to the accessing processor
Insert the data transfer process just before the loop, and the access method to the array
Sometimes, after access from the processor that accessed it
The contents of the array element
Data transfer processing to be transferred to the processor immediately after the loop
And the access method to the array of array elements is other than the above.
If the contents of that array element it is scattered
Transfer it from the processor to the accessing processor
Inserting a data transfer process immediately before the loop
Distribution from the processor that accessed it.
The contents of a column element are
Insert the data transfer process to be transferred to the
Characterized byData transfer in the compiler
Processing allocation method.
JP15717095A 1995-05-31 1995-05-31 Data transfer processing allocation method in the compiler Expired - Fee Related JP3317816B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP15717095A JP3317816B2 (en) 1995-05-31 1995-05-31 Data transfer processing allocation method in the compiler

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP15717095A JP3317816B2 (en) 1995-05-31 1995-05-31 Data transfer processing allocation method in the compiler

Publications (2)

Publication Number Publication Date
JPH08328873A JPH08328873A (en) 1996-12-13
JP3317816B2 true JP3317816B2 (en) 2002-08-26

Family

ID=15643726

Family Applications (1)

Application Number Title Priority Date Filing Date
JP15717095A Expired - Fee Related JP3317816B2 (en) 1995-05-31 1995-05-31 Data transfer processing allocation method in the compiler

Country Status (1)

Country Link
JP (1) JP3317816B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5811194B2 (en) * 2012-01-30 2015-11-11 富士通株式会社 Control device, analysis device, analysis method, and analysis program

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07114516A (en) * 1993-07-06 1995-05-02 Hitachi Ltd Program parallelizing method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
「並列処理シンポジウム JSPP’94」(1994−5)P.156−158
「並列処理シンポジウム JSPP’95論文集」(1995−5−15)P.361−368
「情報処理」Vol.34,No.9(1993−9)P.1179−1185

Also Published As

Publication number Publication date
JPH08328873A (en) 1996-12-13

Similar Documents

Publication Publication Date Title
US6681388B1 (en) Method and compiler for rearranging array data into sub-arrays of consecutively-addressed elements for distribution processing
US5548761A (en) Compiler for target machine independent optimization of data movement, ownership transfer and device control
US5146594A (en) Method of producing object program based on interprocedural dataflow analysis of a source program
US5471622A (en) Run-time system having nodes for identifying parallel tasks in a logic program and searching for available nodes to execute the parallel tasks
US5768596A (en) System and method to efficiently represent aliases and indirect memory operations in static single assignment form during compilation
RH Jr Parallel symbolic computing
DE69627807T2 (en) Data processor for simultaneous data loading and execution of a multiply-add operation
US5586325A (en) Method for the dynamic allocation of array sizes in a multiprocessor system
US5367684A (en) Register allocation using an improved register candidate usage matrix
Berson et al. URSA: A Unified ReSource Allocator for Registers and Functional Units in VLIW Architectures.
US20010003187A1 (en) Task parallel processing method
Hurson et al. Parallelization of doall and doacross loops—a survey
US5396627A (en) Method of producing object program based on interprocedural dataflow analysis of a source program
JPH04330527A (en) Optimization method for compiler
US5781777A (en) Optimization method for computation partitioning oriented to a distributed memory
Goldberg et al. Alfalfa: distributed graph reduction on a hypercube multiprocessor
Das et al. Index array flattening through program transformation
Danelutto et al. Data stream processing via code annotations
JP3317816B2 (en) Data transfer processing allocation method in the compiler
Goldberg Buckwheat: graph reduction on a shared-memory multiprocessor
Roh et al. Generation and quantitative evaluation of dataflow clusters
Goldberg et al. Implementing functional programs on a hypercube multiprocessor
US5671431A (en) Method for processing user program on a parallel computer system by inserting a tag during compiling
US20200409746A1 (en) Information processing apparatus and recording medium
JP2677713B2 (en) A Method of Processor Allocation for Multiprocessor Implementation of Constraint Satisfaction Search

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 19991207

LAPS Cancellation because of no payment of annual fees