Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP2739836B2 - Optimal data distribution generation device and compilation processing device - Google Patents
[go: Go Back, main page]

JP2739836B2 - Optimal data distribution generation device and compilation processing device - Google Patents

Optimal data distribution generation device and compilation processing device

Info

Publication number
JP2739836B2
JP2739836B2 JP10502695A JP10502695A JP2739836B2 JP 2739836 B2 JP2739836 B2 JP 2739836B2 JP 10502695 A JP10502695 A JP 10502695A JP 10502695 A JP10502695 A JP 10502695A JP 2739836 B2 JP2739836 B2 JP 2739836B2
Authority
JP
Japan
Prior art keywords
array
elements
loop
program
distance
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
JP10502695A
Other languages
Japanese (ja)
Other versions
JPH08305670A (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 JP10502695A priority Critical patent/JP2739836B2/en
Publication of JPH08305670A publication Critical patent/JPH08305670A/en
Application granted granted Critical
Publication of JP2739836B2 publication Critical patent/JP2739836B2/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 an optimal data distribution for generating parameters for optimally distributing data in a computer system in which a plurality of systems each comprising a processor and a memory are connected via a connection network. The present invention relates to a generation device and a compilation processing device that converts a sequential program into a parallel program.

【0002】[0002]

【従来の技術】本発明が対象とする配列の領域分割およ
び分割された各々の領域のプロセッサとメモリで構成さ
れる装置が接続網を介して複数個接続されている並列計
算機システムの前記装置のメモリへの配置方法は、デー
タ並列言語であるHigh Performance
Fortran(High PerformanceF
ortran Forum: High Perfor
mance Fortran Language Sp
ecification、Version 1.0,M
ay 1993.)やFortran D(Fox他:
Fortran D Language Speci
fication,Tech.Report COMP
TR90079,Dept.of Computer
Science,Rice Univ.,1991)
で用いられている方法でなされると仮定する。以下、配
列の領域分割および分割された各々の領域のプロセッサ
とメモリで構成される装置が接続網を介して複数個接続
されている並列計算機システムの前記装置のメモリへの
配置方法を単に配列の分散方法と呼ぶ。
2. Description of the Related Art In a parallel computer system in which a plurality of devices each composed of a processor and a memory in each of the divided regions of the array to which the present invention is applied are connected via a connection network. The method of arranging in the memory is a data parallel language, High Performance.
Fortran (High Performance F
ortran Forum: High Perform
mance Fortran Language Sp
efficiency, Version 1.0, M
ay 1993. ) And Fortran D (Fox et al .:
Fortran D Language Speci
fication, Tech. Report COMP
TR90079, Dept. of Computer
Science, Rice Univ. , 1991)
Assume that this is done in the manner used in. Hereinafter, a method of arranging an array in a memory of a parallel computer system in which a plurality of devices each composed of a processor and a memory in each of the divided regions are connected via a connection network will be simply described as an array. This is called a distribution method.

【0003】図1にHPFにおける配列の分散方法を示
す。HPFでは、まず、配列(0101)の要素は他の
配列(0103)の要素に対応付けされる。以下、この
対応付けられた配列の要素間の関係を整列関係と呼び、
配列の要素を他の配列の要素に対応付けることを整列す
ると呼ぶ。複数の配列がある同一の配列に整列すること
で、整列される1つの配列を代表とする配列のグループ
が形成される。代表となる配列(0103)は他のいか
なる配列にも整列していないが、自分自身に整列してい
ると考えることができる。次に、代表となる配列の領域
分割および分割された各々の領域のプロセッサとメモリ
で構成される装置が接続網を介して複数個接続されてい
る並列計算機システムの前記装置のメモリへの配置方法
が定義され、前記代表配列以外の配列の要素は対応付け
られる前記代表の要素が割り付けられる前記装置のメモ
リへ割り付けられ、結果としてこの配列を代表とするグ
ループに属する全ての配列の分散が定義される。
FIG. 1 shows a method of distributing arrays in an HPF. In the HPF, first, an element of the array (0101) is associated with an element of another array (0103). Hereinafter, the relationship between the elements of the associated array is called an alignment relationship,
Associating an element of an array with an element of another array is called alignment. By aligning a plurality of sequences with one and the same sequence, a group of sequences representative of one sequence to be aligned is formed. The representative sequence (0103) is not aligned with any other sequence, but can be considered aligned with itself. Next, a method for arranging a plurality of devices each including a processor and a memory of each of the divided regions in a parallel computer system connected to a plurality of devices via a connection network in a memory of the devices is performed. Is defined, and the elements of the array other than the representative array are allocated to the memory of the device to which the corresponding representative element is allocated, and as a result, the distribution of all the arrays belonging to the group represented by this array is defined. You.

【0004】図2はHPFによる配列A、B、Cの分散
方法の記述例を示したものである。記述例では、AがB
へ、BがCへ整列しているが、結果的にはA、Bどちら
もCへ整列することになる。
FIG. 2 shows a description example of a method of distributing the arrays A, B, and C using the HPF. In the description example, A is B
, B is aligned with C, but as a result, both A and B are aligned with C.

【0005】図3に配列A(0301)、配列B(03
02)、配列C(0303)の整列関係を示す。図中配
列Aから配列Bへの矢印(0302)はAの各要素とB
の各要素との整列関係を表している。また、配列Bから
配列Cへの矢印(0304)はBの各要素とCの各要素
との整列関係を表している。図中l、u、およびsは、
AからみたCへの整列関係を表すパラメータ(030
6)で、それぞれ、lはAの最初の要素と対応付けられ
るCの要素番号、uはAの最後の要素と対応づけられる
Cの要素番号、sはAの要素に対応づけられるCの要素
間の距離である。
FIG. 3 shows an arrangement A (0301) and an arrangement B (03
02) shows the alignment relationship of sequence C (0303). In the figure, an arrow (0302) from array A to array B indicates each element of A and B
Represents the alignment relationship with each element. The arrow (0304) from the array B to the array C indicates the alignment relationship between each element of B and each element of C. In the figure, l, u, and s are
A parameter (030) representing the alignment relationship from A to C
6), 1 is the element number of C associated with the first element of A, u is the element number of C associated with the last element of A, and s is the element of C associated with the element of A Is the distance between them.

【0006】また、前記3つのパラメータを整列三組と
呼び、[l:u:s]と表現する。図3の例では、Aの
Cに対する整列三組は[4:16:2]、BのCに対す
る整列三組は[2:16:2]となる。ここで、配列C
は3つの配列A、B、Cで形成される配列グループの代
表であり、最終整列ターゲットと呼ぶ。したがって、配
列Cの領域分割および分割された各々の領域の前記並列
計算機システムの前記装置のメモリへの配置方法を定義
すると、同時に配列A、Bの分散が決定される。分散の
様子を図4に示す。また、この時、整列によって対応付
けられた配列の要素同士は必ず同一のプロセッサへ配置
される(0407)。
[0006] The above three parameters are referred to as an alignment triple and are represented as [l: u: s]. In the example of FIG. 3, the alignment triple for A with respect to C is [4: 16: 2] and the alignment triple for B with C is [2: 16: 2]. Where array C
Is representative of the sequence group formed by the three sequences A, B, C and is referred to as the final alignment target. Therefore, when the area division of the array C and the method of arranging the divided areas in the memory of the device of the parallel computer system are defined, the distribution of the arrays A and B is determined at the same time. The state of dispersion is shown in FIG. At this time, the elements of the array associated by the alignment are always allocated to the same processor (0407).

【0007】前記の方法で配列が分散されている場合
に、図6の例題プログラムを用いて、従来の技術を説明
する。例題プログラムでは図7に示すように配列B(0
701)が配列A(0702)に整列三組[1:15:
1]で整列している。また、配列Aは図8に示すように
領域分割され、分割された各々の領域が4台のプロセッ
サにそれぞれ配置され、配列Aの要素に対応づけられた
配列Bの要素も対応する配列Aの要素が配置されるプロ
セッサは配置される。結果として図8に示すように、配
列Aは1番目の要素から4番目の要素がプロセッサ1へ
配置され、5番目の要素から8番目の要素がプロセッサ
2へ配置され、9番目の要素から12番目の要素がプロ
セッサ3に配置され、13番目の要素から16番目の要
素がプロセッサ2に配置され、配列Bは1番目の要素か
ら4番目の要素がプロセッサ1へ配置され、5番目の要
素から8番目の要素がプロセッサ2へ配置され、9番目
の要素から12番目の要素がプロセッサ3に配置され、
13番目の要素から15番目の要素がプロセッサ2に配
置される。
A conventional technique will be described with reference to an example program shown in FIG. 6 when an array is dispersed by the above method. In the example program, as shown in FIG.
701) are aligned with sequence A (0702) [1:15:
1]. The array A is divided into regions as shown in FIG. 8, and the divided regions are respectively arranged in four processors, and the elements of the array B corresponding to the elements of the array A also correspond to the elements of the array A. The processor where the element is located is located. As a result, as shown in FIG. 8, array A has a first element to a fourth element arranged in processor 1, a fifth element to an eighth element arranged in processor 2, and a ninth element to 12th element. The th element is located in processor 3, the thirteenth to sixteenth elements are located in processor 2, array B has the first to fourth elements located in processor 1, the fifth element is located in processor 5, The eighth element is located in processor 2, the ninth to twelfth elements are located in processor 3,
The thirteenth element to the fifteenth element are arranged in the processor 2.

【0008】従来の技術では、以下の手順で必要となる
プロセッサ間のデータ転送を検出していた。まず、割り
当てられた配列の要素を更新するループの繰り返しを割
り当てる方法によって各々のプロセッサが実行するルー
プの繰り返しを実行する。前記例題プログラムでは、ル
ープの中で配列Aが更新されるため、各プロセッサには
割り当てられた配列Aの要素を更新する繰り返しが割り
当てられる。つまり、ループの1番目の繰り返しから3
番目の繰り返しがプロセッサ1に割り当てられ、4番目
の繰り返しから7番目の繰り返しがプロセッサ2に割り
当てられ、8番目から11番目の繰り返しがプロセッサ
3に割り当てられ、12番目から15番目の繰り返しが
プロセッサ4に割り当てられ、割り当てられた繰り返し
がそれぞれのプロセッサで実行される。
In the prior art, the necessary data transfer between processors is detected in the following procedure. First, each processor executes a loop iteration executed by a method of assigning a loop iteration for updating an element of an allocated array. In the above example program, since the array A is updated in a loop, each processor is assigned a repetition for updating the assigned element of the array A. That is, 3 from the first iteration of the loop
The fourth iteration is assigned to processor 1, the fourth through seventh iterations are assigned to processor 2, the eighth through eleventh iterations are assigned to processor 3, and the twelfth through fifteenth iterations are assigned to processor 4. , And the assigned iteration is executed on each processor.

【0009】次に、ループ中でアクセスされる配列のア
クセスされる要素を各プロセッサごとに求める。前記の
例題プログラムでは、プロセッサ1がアクセスする配列
Bの要素は1番目の要素から3番目の要素、プロセッサ
2がアクセスする要素は4番目の要素から7番目の要
素、プロセッサ3がアクセスする要素は8番目の要素か
ら11番目の要素、プロセッサ4がアクセスする要素は
12番目の要素から15番目の要素である。
Next, the accessed element of the array accessed in the loop is determined for each processor. In the above example program, the elements of array B accessed by processor 1 are the first to third elements, the elements accessed by processor 2 are the fourth to seventh elements, and the elements accessed by processor 3 are The eighth element to the eleventh element, and the elements accessed by the processor 4 are the twelfth element to the fifteenth element.

【0010】次に、各プロセッサがアクセスする要素と
各プロセッサに配置された要素を比較し、アクセスする
要素の中で他のプロセッサに配置された要素を検出す
る。
Next, the element accessed by each processor is compared with the element allocated to each processor, and among the elements accessed, the element allocated to another processor is detected.

【0011】例題プログラムでは、プロセッサ2では配
列Bの4番目の要素をアクセスするが、配列Bの4番目
の要素はプロセッサ1に配置されており、プロセッサ3
では配列Bの8番目の要素をアクセスするが、配列Bの
8番目の要素はプロセッサ2に配置されており、プロセ
ッサ4では配列Bの12番目の要素をアクセスするが、
配列Bの12番目の要素はプロセッサ3に配置されてい
るため、配列Bの4番目の要素、8番目の要素、12番
目の要素が検出される。
In the example program, processor 4 accesses the fourth element of array B, but the fourth element of array B is located in processor 1 and processor 3
Accesses the eighth element of array B, the eighth element of array B is located in processor 2, and processor 4 accesses the twelfth element of array B,
Since the twelfth element of array B is located in processor 3, the fourth, eighth, and twelfth elements of array B are detected.

【0012】次に、検出された要素を配置されたプロセ
ッサからアクセスするプロセッサへ移動するために、プ
ロセッサ1からプロセッサ2へ配列Bの4番目の要素を
移動し、プロセッサ2からプロセッサ3へ配列Bの8番
目の要素を移動し、プロセッサ3からプロセッサ4へ配
列Bの12番目の要素を移動するためのコードを生成す
る。
Next, in order to move the detected element from the arranged processor to the processor to be accessed, the fourth element of the array B is moved from the processor 1 to the processor 2, and the array B is moved from the processor 2 to the processor 3. Is generated, and a code for moving the twelfth element of array B from processor 3 to processor 4 is generated.

【0013】以上のように、従来のコンパイル処理装置
では、配列の各要素が配置されるプロセッサが既知の場
合にのみ、必要となるプロセッサ間のデータ転送を検出
することができた。
As described above, in the conventional compile processing apparatus, a necessary data transfer between processors can be detected only when the processor in which each element of the array is arranged is known.

【0014】[0014]

【発明が解決しようとする課題】従来のコンパイル処理
装置では、必要となるデータ転送を検出するための解析
方法が複雑であり、かつ、配列の領域分割の方法がコン
パイル時に不明の場合には対処することができないとい
う問題があった。
In the conventional compile processing apparatus, the analysis method for detecting the required data transfer is complicated, and the method for dividing the array into regions is unknown at the time of compilation. There was a problem that you can not.

【0015】[0015]

【課題を解決するための手段】本発明の最適データ分散
生成装置は、複数の繰り返しからなるループを少なくと
も1個含むプログラム中に宣言された第1の配列が領域
分割され、分割された各々の領域をプロセッサとメモリ
で構成されるシステムが接続網を介して複数個接続され
ている並列計算機システムの前記メモリへ配置するため
に、前記ループに対応するイタレーション空間の要素の
下限から上限まで一定間隔で第1の配列に対応付け、前
記イタレーション空間の要素と前記イタレーション空間
の要素に対応するループの繰り返しでアクセスされる第
2の配列の要素を対応づけて最適にデータを分散するた
めのパラメータを生成する最適データ分散生成装置にお
いて、前記イタレーション空間の要素に対応付けられた
前記第1の配列の要素間距離と前記イタレーション空間
に対応するループの中でアクセスされる前記第2の配列
の要素間の距離から前記第2の配列の要素に対応付けら
れる前記第1の配列の要素間の距離を生成する第1の手
段と、前記イタレーション空間の1番目の要素に対応付
けられた前記第1の配列の要素と前記イタレーション空
間に対応するループの中でループの最初の繰り返しでア
クセスされる前記第2の配列の要素番号と前記第1の配
列の領域の下限と前記第1の手段で生成された前記第2
の配列の要素に対応付けられる前記第1の配列の要素間
の距離から前記第2の配列の最初の要素に対応付けられ
る前記第1の配列の要素番号を生成する第2の手段と、
前記第1の手段で生成された前記第2の配列の要素に対
応付けられる前記第1の配列の要素間の距離と前記第2
の手段で生成された前記第2の配列の最初の要素に対応
付けられる前記第1の配列の要素番号と第1の配列の領
域の下限と第1の配列の領域の上限から前記第2の配列
の最後の要素に対応付けられる前記第1の配列の要素番
号を生成する第3の手段から構成され、前記第2の配列
の要素に対応付けられる前記第1の配列の要素間の距離
と、前記第2の配列の最初の要素に対応付けられる前記
第1の配列の要素番号と、前記第2の配列の最後の要素
に対応付けられる前記第1の配列の要素番号を前記パラ
メータとすることを特徴とする。
According to the present invention, there is provided an optimal data distribution generating apparatus, wherein a first array declared in a program including at least one loop composed of a plurality of repetitions is divided into regions, and each of the divided individual regions is divided into regions. In order to allocate an area to the memory of a parallel computer system in which a plurality of systems each including a processor and a memory are connected via a connection network, a constant is set from a lower limit to an upper limit of an element of an iteration space corresponding to the loop. For associating the elements of the iteration space with the elements of the second array accessed by repeating the loop corresponding to the elements of the iteration space, and distributing the data optimally, In the optimal data distribution generation device that generates the parameters of the first array, The distance between the elements of the first array associated with the elements of the second array based on the prime distance and the distance between the elements of the second array accessed in a loop corresponding to the iteration space First means for generating a first array of elements of the first space of the iteration space associated with the first element of the iteration space and a loop corresponding to the first iteration of the iteration space. The element number of the second array, the lower limit of the area of the first array, and the second number generated by the first means.
Second means for generating an element number of the first array associated with a first element of the second array from a distance between elements of the first array associated with elements of the array;
The distance between the elements of the first array associated with the elements of the second array generated by the first means and the second
From the element number of the first array, the lower limit of the area of the first array, and the upper limit of the area of the first array, which are associated with the first element of the second array generated by the means of A third means for generating an element number of the first array associated with the last element of the array, the distance between the elements of the first array associated with the elements of the second array; The element number of the first array associated with the first element of the second array and the element number of the first array associated with the last element of the second array are the parameters. It is characterized by the following.

【0016】また、本発明の最適データ分散生成装置
は、前記プログラム中に含まれるループの中でアクセス
される第2の配列の要素に対応付けられる前記第1の配
列の要素間の距離と前記第2の配列の最初の要素に対応
付けられる前記第1の配列の要素番号と前記第2の配列
の最後の要素に対応付けられる前記第1の配列の要素番
号と前記パラメータと第2の配列がループ中で参照され
るか更新されるかを表すアクセス属性から前記システム
間でのデータ転送パターンを生成する手段を備え、前記
第2の配列の要素に対応付けられる第3の配列の要素間
の距離と前記第2の配列の最初の要素に対応付けられる
第3の配列の要素番号と前記第2の配列の最後の要素に
対応付けられる第3の配列の要素番号を前記パラメータ
とすることを特徴とする。
Further, according to the present invention, there is provided an optimum data distribution generating apparatus, wherein the distance between the elements of the first array associated with the elements of the second array accessed in a loop included in the program, and An element number of the first array associated with a first element of the second array, an element number of the first array associated with a last element of the second array, the parameter, and a second array Means for generating a data transfer pattern between the systems from an access attribute indicating whether or not is referred to or updated in a loop, between the elements of the third array corresponding to the elements of the second array The distance of the first element of the second array, the element number of the third array associated with the first element of the second array, and the element number of the third array associated with the last element of the second array are used as the parameters. Features That.

【0017】本発明のコンパイル処理装置は、複数の繰
り返しからなるループを少なくとも1個含むプログラム
中に宣言された第1の配列が領域分割され、分割された
各々の領域をプロセッサとメモリで構成されるシステム
が接続網を介して複数個接続されている並列計算機シス
テムの前記メモリへ配置する場合に、前記プログラムを
入力として前記装置間でデータの転送を行なうためのコ
ードを自動的に生成するコンパイル処理装置において、
入力されたプログラムの構文解析および字句解析を行な
い、前記プログラムを変換してコンパイラ内で処理され
る内部データを生成する手段と、前記内部データからプ
ログラム中のループ中にアクセスされる配列のアクセス
範囲と配列へのアクセスが参照であるか更新であるかを
表すアクセス属性を検出して前記内部データに付加する
手段と、前記内部データからプログラム中に含まれるル
ープに対応するイタレーション空間の要素を下限から上
限まで一定間隔で第1の配列と対応づけるループ分散手
段と、前記イタレーション空間に対応するループの中で
アクセスされる第2の配列の要素に対応付けられる前記
第1の配列の要素間の距離と前記第2の配列の最初の要
素に対応付けられる前記第1の配列の要素番号と前記第
2の配列の最後の要素に対応付けられる前記第1の配列
の要素番号と、前記イタレーション空間の要素と前記イ
タレーション空間の要素に対応するループの繰り返しで
アクセスされる第2の配列の要素を対応づけて最適にデ
ータを分散するためのパラメータと第2の配列がループ
中で参照されるか更新されるかを表すアクセス属性から
前記システム間でのデータ転送パターンを生成する手段
と、前記内部データからソースプログラムを生成する手
段から構成され、前記第2の配列の要素に対応付けられ
る前記第1の配列の要素間の距離と、前記第2の配列の
最初の要素に対応付けられる前記第1の配列の要素番号
と、前記第2の配列の最後の要素に対応付けられる前記
第1の配列の要素番号を前記パラメータとし、逐次プロ
グラムを並列プログラムに変換することを特徴とする。
According to the compile processing apparatus of the present invention, a first array declared in a program including at least one loop composed of a plurality of repetitions is divided into regions, and each divided region is constituted by a processor and a memory. Compiling automatically for transferring data between the devices by using the program as input when the system is arranged in the memory of a parallel computer system in which a plurality of systems are connected via a connection network. In the processing device,
Means for performing syntax analysis and lexical analysis of an input program, converting the program to generate internal data to be processed in a compiler, and an access range of an array accessed in a loop in the program from the internal data Means for detecting an access attribute indicating whether access to the array is a reference or an update and adding the access attribute to the internal data; and, from the internal data, an element of an iteration space corresponding to a loop included in a program. Loop dispersing means for associating the first array with a constant interval from a lower limit to an upper limit, and elements of the first array associated with elements of a second array accessed in a loop corresponding to the iteration space The distance between the element number of the first array corresponding to the first element of the second array and the last element number of the second array Optimally associating the element numbers of the first array associated with the primes with the elements of the iteration space and the elements of the second array accessed by repeating the loop corresponding to the elements of the iteration space Means for generating a data transfer pattern between the systems from a parameter for distributing data and an access attribute indicating whether a second array is referred to or updated in a loop; A distance between the elements of the first array corresponding to the elements of the second array, and an element of the first array corresponding to the first element of the second array. A sequential program is converted to a parallel program using a number and an element number of the first array associated with the last element of the second array as the parameter. And wherein the door.

【0018】[0018]

【実施例】本発明について、図5〜図17を参照して本
発明の実施例について説明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described with reference to FIGS.

【0019】本発明では、従来の技術とは異なり、プロ
グラム中のループの実行において、各プロセッサが実行
するループの繰り返しをHPFにおける配列の分散方法
と同じ方法で決定する。つまり、イタレーション空間の
要素の下限から上限まで一定間隔で配列に対応付け、配
列と同様にイタレーション空間と配列との整列関係を配
列と同様に整列三組で表す。
In the present invention, unlike the prior art, in executing a loop in a program, the repetition of the loop executed by each processor is determined by the same method as the array distribution method in the HPF. That is, the elements are associated with the array at regular intervals from the lower limit to the upper limit of the elements of the iteration space, and the alignment relationship between the iteration space and the array is represented by three sets of alignments similarly to the array.

【0020】ここで、整列三組l_loop、u_lo
op、およびs_loopとすると、これらはそれぞ
れ、l_loop:イタレーション空間の1番目の要素
に対応付けられた最終整列ターゲットの配列の要素、u
_loop:イタレーション空間の最後の要素に対応付
けられた最終整列ターゲットの配列の要素、s_loo
p:イタレーション空間の要素に対応付けられた最終整
列ターゲットの配列の要素間の距離を表す。
Here, three sets of aligned l_loop, u_lo
where op and s_loop are respectively l_loop: the element of the array of the final alignment target associated with the first element of the iteration space, u
_Loop: element of the array of the final alignment target associated with the last element of the iteration space, s_loop
p: represents the distance between elements of the array of the final alignment target associated with the elements of the iteration space.

【0021】また、本発明では、ループ中でアクセスさ
れる配列の範囲が与えられているとする。これを配列の
アクセス範囲と呼び、laccess、uaccess、saccess
表し、それぞれ、アクセスされる配列の要素の下限、ア
クセスされる配列の要素の上限、アクセスされる配列要
素間の距離である。
In the present invention, it is assumed that the range of the array accessed in the loop is given. This is called an array access range and is represented by l access , u access , and s access, which are the lower limit of the elements of the array to be accessed, the upper limit of the elements of the array to be accessed, and the distance between the array elements to be accessed, respectively. .

【0022】以上のループの整列三組、アクセス範囲、
最終ターゲットとなる配列の宣言された領域の下限、上
限を用いることによって、以下のように、ループの繰り
返しを実行するプロセッサと、その繰り返しでアクセス
される配列の要素が割り付けられるプロセッサが、同一
のプロセッサとなるような配列の整列三組を求めること
ができる。
The above three sets of loop alignment, access range,
By using the lower and upper bounds of the declared area of the final target array, the processor that executes the loop iteration and the processor to which the elements of the array accessed by the iteration are allocated are the same as follows. It is possible to obtain three sets of aligned arrays to be used as a processor.

【0023】まず、配列Aの整列三組を用いると、A
(i)が対応付けられる最終整列ターゲットの要素は以
下の式で求めることができる。
First, when three sets of aligned sequences A are used, A
The element of the final alignment target to which (i) is associated can be obtained by the following equation.

【0024】F(i)=(i−LBOUND)×s+l
{i|LBOUND≦i≦UBOUND} ここで、LBOUND、UBOUNDはそれぞれ最終整
列ターゲットとなる配列の宣言された下限と上限であ
る。また、求める整列三組を{l_opt.:u_op
t.:s_opt.}とすると、以下の式が成立する。
F (i) = (i-LBOUND) × s + 1
{I | LBOUND ≦ i ≦ UBOUND} where LBOUND and UBOUND are the declared lower and upper bounds of the sequence to be the final alignment target, respectively. Also, the set of three alignments to be determined is {l_opt. : U_op
t. : S_opt. If}, the following equation is established.

【0025】lloop=F(laccess)=(laccess−L
BOUND)×s_opt.+l_opt. uloop=F(uaccess)=(uaccess−LBOUND)
×s_opt.+l_opt. sloop=saccess×s_opt. したがって、先述の式より、ループの繰り返しを実行す
るプロセッサと、その繰り返しでアクセスされる配列の
要素が割り付けられるプロセッサが、同一のプロセッサ
となるような配列の整列三組は以下の式によって求める
ことができる。
L loop = F (l access ) = (l access -L
BOUND) × s_opt. + L_opt. u loop = F (u access ) = (u access -LBOUND)
× s_opt. + L_opt. s loop = s access × s_opt. Therefore, from the above equation, the array alignment triples in which the processor that executes the loop iteration and the processor to which the elements of the array accessed in the iteration are allocated are the same processor should be obtained by the following equation. Can be.

【0026】 s_opt.=sloop/saccess (1) l_opt=lloop−(laccess−LBOUND)×s_opt. (2) u_opt=(UBOUND−LBOUND)×s_opt.+l_opt (3) 図5に式(1)−(3)を用いた本発明の最適データ分
散生成装置の第1の実施例を示す。本装置は、前記イタ
レーション空間の要素に対応付けられた最終整列ターゲ
ットである第1の配列の要素間の距離s_loop(0
504)と、前記イタレーション空間に対応するループ
の中でアクセスされる第2の配列の要素間の距離s_a
ccess(0505)から(1)式により第2の配列
の要素に対応付けられる前記第1の配列の要素間の距離
s_opt.(0510)を生成する手段(0501)
と、前記イタレーション空間の1番目の要素に対応付け
られた前記第1の配列の要素l_loop(0506)
と、前記イタレーション空間に対応するループの中でル
ープの最初の繰り返しでアクセスされる前記第2の配列
の要素番号l_access(0507)と、前記第1
の配列の領域の下限LBOUND(0508)と、前記
第2の配列の要素に対応付けられる前記第1の配列の要
素間の距離s_opt.(0510)から(2)式によ
り前記第2の配列の最初の要素に対応付けられる前記第
1の配列の要素番号l_opt.(0511)を生成す
る手段(0502)と、前記第2の配列の要素に対応付
けられる前記第1の配列の要素間の距離s_opt.
(0510)と、前記第2の配列の最初の要素に対応付
けられる前記第1の配列の要素番号l_opt.(05
11)と、第1の配列の領域の下限LBOUND(05
08)と、第1の配列の領域の上限UBOUND(05
09)から(3)式により前記第2の配列の最後の要素
に対応付けられる前記第1の配列の要素番号u_op
t.(0512)を生成する手段(0503)から構成
される。
S_opt. = S loop / s access (1 ) l_opt = l loop - (l access -LBOUND) × s_opt. (2) u_opt = (UBOUND−LBOUND) × s_opt. + L_opt (3) FIG. 5 shows a first embodiment of the optimum data distribution generating apparatus of the present invention using the equations (1) to (3). The apparatus includes a distance s_loop (0) between the elements of the first array, which is the final alignment target associated with the elements of the iteration space.
504) and the distance s_a between the elements of the second array accessed in the loop corresponding to the iteration space
access (0505) to the distance s_opt. between the elements of the first array associated with the elements of the second array according to equation (1). Means for generating (0510) (0501)
And an element l_loop (0506) of the first array associated with a first element of the iteration space
And an element number l_access (0507) of the second array accessed in the first iteration of the loop in the loop corresponding to the iteration space;
And the distance s_opt. Between the lower limit LBOUND (0508) of the region of the array of the first array and the element of the first array corresponding to the element of the second array. (0510) to element number l_opt. Of the first array associated with the first element of the second array according to equation (2). (0511) and a distance s_opt. Between the elements of the first array associated with the elements of the second array.
(0510) and the element number l_opt. Of the first array associated with the first element of the second array. (05
11) and the lower limit LBOUND (05
08) and the upper limit UBOUND (05
09) to element number u_op of the first array associated with the last element of the second array according to equations (3).
t. (0512).

【0027】s_opt.(0510),l_opt.
(0511),u_opt(0512)で定められる配
列の分散ではループの繰り返しを実行するプロセッサ
と、その繰り返しでアクセスされる配列の要素が割り付
けられるプロセッサが、同一のプロセッサとなる。
S_opt. (0510), l_opt.
In the distribution of the array defined by (0511) and u_opt (0512), the processor that executes the loop iteration and the processor to which the elements of the array accessed by the iteration are allocated are the same processor.

【0028】図6に例題プログラムを示す。また、図7
に例題プログラムにおける配列A(0702)と配列B
(0701)の整列関係を示す。図に示すように配列B
が配列Aに整列三組[1:15:1]で整列している。
図8に配列AおよびBの分散の様子を示す。配列Aの分
散が定義され、これによってAおよびBの分散が定義さ
れている。また、整列によって対応づけられた要素は同
一のプロセッサへ割り当てられる(0804)。
FIG. 6 shows an example program. FIG.
The sequence A (0702) and the sequence B in the example program
(0701) shows the alignment relationship. Array B as shown
Are aligned with sequence A in three sets of alignments [1: 15: 1].
FIG. 8 shows how the arrays A and B are dispersed. The variance of array A is defined, which defines the variance of A and B. The elements associated by the alignment are assigned to the same processor (0804).

【0029】図6の例題プログラムでは、ループの繰り
返しは初期値が2、終値が15、増分値が1であり、イ
タレーション空間のサイズは15である。この例では図
9に示す様にイタレーション空間(0901)が配列A
(0702)に整列しているとする。この時イタレーシ
ョン空間の配列Aに対する整列三組は[2:16:1]
である。また、ループ中での配列Bのアクセス範囲は
[1:15:1]であり、配列Aのアクセス範囲は
[2:16:1]である。したがって、式(1)−
(3)より、ループの繰り返しを実行するプロセッサ
と、その繰り返しでアクセスされる配列Bの要素が割り
付けられるプロセッサが、同一のプロセッサとなるよう
な配列Bの整列三組は[2:16:1]である。同様
に、配列Aの整列三組は[1:16:1]である。配列
Bはここで求められた整列三組によってAに整列してい
れば、Aがいかなる方法で領域分割されていようとも、
あるいは配列Aの領域分割の方法が不明の場合でも、ル
ープの繰り返しを実行するプロセッサと、その繰り返し
でアクセスされる配列Bの要素は同一のプロセッサに割
り当てられることが保証される。
In the example program shown in FIG. 6, the initial value is 2, the final value is 15, the increment value is 1, and the size of the iteration space is 15 in the loop iteration. In this example, the iteration space (0901) is array A as shown in FIG.
(0702). At this time, three sets of alignments for the sequence A in the iteration space are [2: 16: 1].
It is. The access range of array B in the loop is [1: 15: 1], and the access range of array A is [2: 16: 1]. Therefore, equation (1)-
According to (3), the alignment triple set of array B such that the processor executing loop iteration and the processor to which elements of array B accessed in the iteration are allocated to the same processor is [2: 16: 1 ]. Similarly, the triad of sequence A is [1: 16: 1]. If sequence B is aligned with A by the alignment triad determined here, no matter how A is divided into regions,
Alternatively, even when the method of dividing the area of the array A is unknown, it is guaranteed that the processor executing the loop iteration and the elements of the array B accessed by the iteration are allocated to the same processor.

【0030】図10に本発明の第2の最適データ分散生
成装置を示す。(1006)は前記第2の配列の要素に
対応付けられる最終整列ターゲットである第1の配列の
要素間の距離と前記第2の配列の最初の要素に対応付け
られる前記第1の配列の要素番号と前記第2の配列の最
後の要素に対応付けられる前記第1の配列の要素番号と
最適にデータを分散するためのパラメータと第2の配列
がループ中で参照されるか更新されるかを表すアクセス
属性からプロセッサ間でのデータ転送パターンを生成す
る。(1007)は図5で示した装置と等価であり、入
力(1003)が図5に示した入力(0504)〜(0
509)に相当する。また、(1007)の出力(10
04)が図5に示した出力(0510)〜(0512)
に相当する。入力(1002)は第2の配列の要素に対
応付けられる最終整列ターゲットである第1の配列の要
素間の距離と前記第2の配列の最初の要素に対応付けら
れる前記第1の配列の要素番号と前記第2の配列の最後
の要素に対応付けられる前記第1の配列の要素番号であ
り入力(1008)は配列がループ中で参照されるか更
新されるかを表すアクセス属性である。
FIG. 10 shows a second optimum data distribution generating apparatus according to the present invention. (1006) is the distance between the elements of the first array that is the final alignment target associated with the elements of the second array and the elements of the first array that are associated with the first element of the second array The number and the element number of the first array associated with the last element of the second array, the parameter for optimally distributing data, and whether the second array is referenced or updated in a loop A data transfer pattern between the processors is generated from the access attribute that indicates the data. (1007) is equivalent to the device shown in FIG. 5, and the input (1003) is the input (0504) to (0) shown in FIG.
509). Also, the output of (1007) (10
04) are the outputs (0510) to (0512) shown in FIG.
Is equivalent to The input (1002) is the distance between the elements of the first array that is the final alignment target associated with the elements of the second array and the elements of the first array that are associated with the first element of the second array The input (1008) is a number and an element number of the first array corresponding to the last element of the second array, and the input (1008) is an access attribute indicating whether the array is referenced or updated in a loop.

【0031】(1006)が生成するデータ転送パター
ンは、第2の配列の属性が参照であった場合は、第2の
配列の要素に対応付けられる最終整列ターゲットである
第1の配列の要素間の距離と前記第2の配列の最初の要
素に対応付けられる前記第1の配列の要素番号と前記第
2の配列の最後の要素に対応付けられる前記第1の配列
の要素番号で定められるプログラム中で宣言された配列
の分散方法から装置(1007)で生成される最適にデ
ータを分散するためのパラメータで定められる配列の分
散方法へ変更するパターンであり、第2の配列の属性が
更新であった場合は、(1007)で生成される最適に
データを分散するためのパラメータで定められる配列の
分散方法へ分散方法から第2の配列の属性が参照であっ
た場合は、第2の配列の要素に対応付けられる最終整列
ターゲットである第1の配列の要素間の距離と前記第2
の配列の最初の要素に対応付けられる前記第1の配列の
要素番号と前記第2の配列の最後の要素に対応付けられ
る前記第1の配列の要素番号で定められるプログラム中
で宣言された配列の分散方法へ変更するパターンであ
る。
If the attribute of the second array is a reference, the data transfer pattern generated by (1006) indicates that the element of the first array, which is the final alignment target associated with the element of the second array, A program defined by the distance of the first array and the element number of the first array associated with the first element of the second array and the element number of the first array associated with the last element of the second array This is a pattern for changing from the array distribution method declared in the above to the array distribution method determined by the parameter for optimally distributing data generated by the device (1007), and the attribute of the second array is updated. If the attribute of the second array is a reference from the distribution method to the array distribution method determined by the parameter for optimally distributing the data generated in (1007), Wherein a distance between elements of the first array is the final alignment targets associated with the elements of the column second
An array declared in a program defined by an element number of the first array corresponding to the first element of the array of the first array and an element number of the first array corresponding to the last element of the second array This is a pattern to change to the distribution method.

【0032】第1の実施例1で用いた例題プログラムで
は配列Bは、プログラム中の宣言で定められた分散方法
である整列三組は[1:15:1]、装置(1007)
で生成される最適にデータを分散するためのパラメータ
である整列三組は[2:16:1]、アクセス属性は参
照となるため、配列Bのデータ転送パターンは整列三組
[1:15:1]で定められる分散方法から整列三組
[2:16:1]で定められる分散方法の変更である。
このデータ転送パターンは最終整列ターゲットである配
列Aがいかなる方法で領域分割されていようと、また領
域分割の方法が不明の場合でも一意に求めることができ
る。
In the example program used in the first embodiment, the array B is a distribution method defined by a declaration in the program, the alignment triple set is [1: 15: 1], and the apparatus (1007)
Since the alignment triplet, which is a parameter for optimally distributing data generated by the above, is [2: 16: 1] and the access attribute is a reference, the data transfer pattern of array B is the alignment triplet [1:15: 1] is a change of the distribution method defined by the alignment triple [2: 16: 1] from the distribution method defined by [1].
This data transfer pattern can be uniquely obtained regardless of how the array A, which is the final alignment target, is divided into regions, or even if the method of dividing the region is unknown.

【0033】図11に本発明のコンパイル処理装置の実
施例を示す。
FIG. 11 shows an embodiment of the compiling apparatus of the present invention.

【0034】以下、コンパイル装置に入力される例題プ
ログラム(1101)として図6で示したプログラムを
用いて各装置の処理について詳しく説明する。
Hereinafter, the processing of each device will be described in detail using the program shown in FIG. 6 as an example program (1101) input to the compiling device.

【0035】装置(1103)は入力プログラムの構文
解析/字句解析を行ない、これを変換して、コンパイラ
内で処理される内部データ形式(1108)を生成す
る。構文解析/字句解析の詳細は参考文献「プログラミ
ング言語処理系」(佐々政孝、岩波講座ソフトウェア科
学)に記載されている。
The device (1103) performs syntax analysis / lexical analysis of the input program, converts the result, and generates an internal data format (1108) to be processed in the compiler. Details of syntax analysis / lexical analysis are described in the reference document “Programming Language Processing System” (Masataka Sasa, Iwanami Koza Software Science).

【0036】ここで生成される内部データ形式を図12
に示す。プログラム中のステートメントに対するテーブ
ル(1216)、ループに対するテーブル(121
8)、変数に対するテーブル(1201)が生成され
る。(1216)はステートメントの順番でリンクさ
れ、(1218)はループの先頭と最後尾のステートメ
ントに対するテーブルへのポインタを持つ。(120
1)は変数の名前と、変数が配列の場合にのみ各次元の
宣言範囲を示すテーブル(1202)へのポインタを持
つ。また、配列の分散情報を格納するためのテーブル
(1206),(1211)が変数ごとに生成され、変
数に対するテーブルからリンクされる。(1206),
(1211)はそれぞれ整列三組(1207),(12
12)および分割サイズ(1208),(1213)の
情報を持つ。また、最終整列ターゲットとなる配列の変
換テーブルへのポインタ(1309),(1314)を
持つ。配列A、配列B共に最終整列ターゲットは配列A
であるため、Aの変数に対するテーブルへのポインタを
持つ。
The internal data format generated here is shown in FIG.
Shown in Table for statements in the program (1216), table for loops (121
8), a table (1201) for variables is generated. (1216) is linked in statement order, and (1218) has pointers to the tables for the statements at the beginning and end of the loop. (120
1) has a variable name and a pointer to a table (1202) indicating the declaration range of each dimension only when the variable is an array. Also, tables (1206) and (1211) for storing the array shared information are generated for each variable, and linked from the table for the variable. (1206),
(1211) are three sets (1207) and (12
12) and division sizes (1208) and (1213). Further, it has pointers (1309) and (1314) to the conversion table of the array to be the final alignment target. The final alignment target for both sequence A and sequence B is sequence A
Therefore, it has a pointer to the table for the variable of A.

【0037】次に、装置(1104)は装置(110
3)で生成されたデータを入力とし、ループ内でアクセ
スされる配列のアクセス属性とアクセス範囲を求め、こ
れを入力されたデータに付加し、図13に示すデータを
出力する。図中の(* )と(f)はそれぞれ線が接続さ
れていることを表している。アクセス属性とはループ内
で配列のアクセスが参照か更新かを表すもので、配列が
ステートメントの左辺に出現するか、右辺に出現するか
によって決定される。
Next, the device (1104) is connected to the device (110).
With the data generated in 3) as input, an access attribute and an access range of an array accessed in the loop are obtained, added to the input data, and the data shown in FIG. 13 is output. ( * ) And (f) in the figure indicate that the lines are connected. The access attribute indicates whether the access of the array is reference or update in the loop, and is determined by whether the array appears on the left side or the right side of the statement.

【0038】図6の例題プログラムでは配列Aのアクセ
ス属性は更新(1304)、配列Bのアクセス属性は参
照(1308)である。また、配列Aのループ内での添
字式がi、ループの下限が2、上限が16であるので、
配列Aのアクセス範囲は[2:16:1](130
5)、同様に配列Bのアクセス範囲は[1:15:1]
(1309)となる。
In the example program of FIG. 6, the access attribute of array A is updated (1304), and the access attribute of array B is reference (1308). Also, since the subscript expression in the loop of array A is i, the lower limit of the loop is 2, and the upper limit is 16,
The access range of array A is [2: 16: 1] (130
5) Similarly, the access range of array B is [1: 15: 1]
(1309).

【0039】次に、装置(1105)は、装置(110
4)の出力データを入力とし、ループの各繰り返しのプ
ロセッサへの割り付け方法を第1の実施例を用いて、図
9に示した方法で決定した後、入力データに結果を付加
し、図14に示すデータを出力する。ループの繰り返し
の割り付け結果を表すテーブル(1402)は、ループ
に対応するテーブル(1218)からリンクされ(14
01)、最終整列ターゲットとなる変数テーブルへのポ
インタ(1405)、最終整列ターゲットに対する整列
三組(1403)、分割サイズ(1404)を持つ。
Next, the device (1105) is connected to the device (110).
Using the output data of 4) as input, the method of allocating each iteration of the loop to the processor is determined by the method shown in FIG. 9 using the first embodiment, and the result is added to the input data. The data shown in is output. The table (1402) representing the allocation result of the loop iteration is linked from the table (1218) corresponding to the loop (1414).
01), a pointer (1405) to a variable table serving as a final alignment target, an alignment triple (1403) for the final alignment target, and a division size (1404).

【0040】次に、装置(1106)は装置(110
5)の出力データ(1110)を入力とし、必要となる
プロセッサ間のデータ転送のためのコードを生成するた
めに、入力したデータを変形する。装置(1106)の
構成を図15に示す。図中の入力(1501)が装置
(1105)の出力にあたる。
Next, the device (1106) is connected to the device (110).
The output data (1110) of 5) is input, and the input data is transformed in order to generate a required code for data transfer between processors. FIG. 15 shows the configuration of the device (1106). The input (1501) in the figure corresponds to the output of the device (1105).

【0041】装置(1106)は、図10で示したデー
タ転送パターンを検出する装置(1503)と、データ
転送を行なうためのコードを生成する装置(1505)
からなる。装置(1503)の入力(1501)は図1
0における入力(1001)〜(1003)に対応す
る。装置(1505)では、装置(1503)で検出し
たデータ転送パターンと配列のアクセス属性から、生成
するデータ転送を行なうためのコードとコードを挿入す
るプログラム中の位置を決定する。コードを挿入する位
置はアクセス属性が参照の場合はループの直前、アクセ
ス属性が更新の場合はループの直後である。さらに、生
成するコードのステートメントに対応したテーブルを生
成し、決定した位置に挿入する。図16にデータ転送た
めのコードを挿入するために変形された内部データの例
を示す。テーブル(1601)はデータ転送を行なうた
めに挿入されるステートメントに対応するテーブル群で
ある。
The device (1106) includes a device (1503) for detecting the data transfer pattern shown in FIG. 10, and a device (1505) for generating a code for performing data transfer.
Consists of The input (1501) of the device (1503) is shown in FIG.
0 corresponds to the inputs (1001) to (1003). The device (1505) determines a code for performing data transfer to be generated and a position in the program where the code is to be inserted, from the data transfer pattern and the access attribute of the array detected by the device (1503). The code is inserted immediately before the loop when the access attribute is a reference, and immediately after the loop when the access attribute is an update. Further, a table corresponding to the statement of the code to be generated is generated and inserted into the determined position. FIG. 16 shows an example of internal data modified to insert a code for data transfer. A table (1601) is a group of tables corresponding to statements inserted to perform data transfer.

【0042】装置(1107)は、変形されたコンパイ
ラの内部データである。装置(1106)の出力データ
(1111)を入力とし、これを変換して、並列化した
並列プログラム(1102)を出力する装置である。装
置(1107)の出力例を図17に示す。ループの直前
のコール文が挿入されたデータ転送を行なうためのコー
ドにあたる。この場合は、このコール文によって呼び出
されるサブルーチンcomm_pattern1は、通
常計算機システムごとに提供される低レベルのプロセッ
サ間通信のためのライブラリによって構築されている。
つまり、このサブルーチンの中でプロセッサ間のデータ
転送が行なわれる。また、この場合には、低レベルのプ
ロセッサ間通信のためのライブラリを直接呼び出すコー
ル文を生成してもよい。
The device (1107) is the modified internal data of the compiler. This is a device that receives output data (1111) of the device (1106) as input, converts it, and outputs a parallel program (1102) that has been parallelized. FIG. 17 shows an output example of the device (1107). This is the code for performing data transfer with the call statement immediately before the loop inserted. In this case, the subroutine comm_pattern1 called by this call statement is constructed by a library for low-level interprocessor communication that is usually provided for each computer system.
That is, data transfer between processors is performed in this subroutine. In this case, a call statement that directly calls a library for low-level interprocessor communication may be generated.

【0043】[0043]

【発明の効果】以上説明したとおり、本発明によれば、
プロセッサとメモリを備えた装置が接続網で接続されて
いる計算機システムにおいて、コンパイル処理装置が逐
次プログラムを並列プログラムに変換する際に、配列の
分散方法がコンパイル時に不明の場合でも、配列の分散
がコンパイル時に既知の場合と同じ方法でデータ転送の
解析を行なうことが可能となり、また、解析方法も容易
となる。
As described above, according to the present invention,
In a computer system in which devices having a processor and a memory are connected by a connection network, when a compile processing device converts a sequential program into a parallel program, even if the array distribution method is unknown at compile time, the array distribution is not Analysis of data transfer can be performed in the same way as is known at the time of compiling, and the analysis method is also facilitated.

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

【図1】HPF言語における配列の分散方法を示す図。FIG. 1 is a diagram showing an array distribution method in the HPF language.

【図2】HPF言語における配列の分散方法の記述を説
明するために用いる例題プログラムを示す図。
FIG. 2 is a diagram showing an example program used to explain a description of an array distribution method in the HPF language.

【図3】HPF言語における配列の分散方法における配
列の整列方法を示す図。
FIG. 3 is a diagram showing a method of arranging arrays in an array distribution method in the HPF language.

【図4】HPF言語における配列の分散方法における配
列の分割方法を示す図。
FIG. 4 is a diagram showing an array division method in an array distribution method in the HPF language.

【図5】本発明の第1の最適データ分散生成装置の一実
施例を示す図。
FIG. 5 is a diagram showing an embodiment of a first optimum data distribution generation device of the present invention.

【図6】本発明を説明するために用いる例題プログラム
を示す図。
FIG. 6 is a diagram showing an example program used to explain the present invention.

【図7】図6の例題プログラムにおける配列の分散方法
を示す図。
FIG. 7 is a diagram showing a method of distributing arrays in the example program of FIG. 6;

【図8】図6の例題プログラムにおける配列の分散方法
を示す図。
FIG. 8 is a diagram showing a method of distributing arrays in the example program of FIG. 6;

【図9】イタレーション空間を示す図。FIG. 9 is a diagram showing an iteration space.

【図10】本発明の第2の最適データ分散生成の一実施
例を示す図。
FIG. 10 is a diagram showing an embodiment of the second optimal data distribution generation of the present invention.

【図11】本発明のコンパイル処理装置の一実施例を示
す図。
FIG. 11 is a diagram showing an embodiment of a compile processing device of the present invention.

【図12】図11のコンパイル処理装置の各装置の入出
力を示す図。
12 is a diagram showing input / output of each device of the compile processing device of FIG. 11;

【図13】図11のコンパイル処理装置の各装置の入出
力を示す図。
FIG. 13 is a diagram showing input and output of each device of the compile processing device of FIG. 11;

【図14】図11のコンパイル処理装置の各装置の入出
力を示す図。
FIG. 14 is a diagram showing input and output of each device of the compile processing device of FIG. 11;

【図15】図11の装置1106の構成を示す図。FIG. 15 is a diagram showing a configuration of an apparatus 1106 in FIG. 11;

【図16】図11のコンパイル処理装置の各装置の入出
力を示す図。
FIG. 16 is a diagram showing input and output of each device of the compile processing device of FIG. 11;

【図17】図11のコンパイル処理装置によって生成さ
れたプログラムを示す図。
FIG. 17 is a diagram showing a program generated by the compile processing device of FIG. 11;

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

0101 配列 0102 配列の整列 0103 代表配列 0104 配列の分散 0105 プロセッサ 0301 配列A 0302 配列Aと配列Bの整列関係 0303 配列B 0304 配列Bと配列Cの整列関係 0306 配列Aと配列Cの整列関係を表すパラメータ 0401 配列Cの分割方法 0402 配列A,B,Cのプロセッサ上への分割およ
び配置方法 0501 本整列三組の増分値を計算する装置 0502 整列三組の下限を計算する装置 0503 整列三組の上限を計算する装置 0504 イタレーション空間の配列に対する整列三組
の増分値 0505 配列のアクセス範囲の増分値 0506 イタレーション空間の配列に対する整列三組
の初期値 0507 配列のアクセス範囲の下限 0508 配列の宣言の下限 0509 配列のアクセス範囲の上限 0510 生成された整列三組の増分値 0511 生成された整列三組の下限 0512 生成された整列三組の上限 0701 配列B 0702 配列A 0801 配列A,Bの分割サイズ 0901 イタレーション空間 0902 ループの繰り返しのプロセッサの割り付け 1002 宣言された配列の整列三組 1007 図5の装置 1003 図5の装置の入力 1004 図5の装置の出力 1006 データ転送パターンを検出する装置 1005 データ転送パターン 1008 配列が更新されるか参照されるかを表すアク
セス属性 1101 図11に示すコンパイル処理装置の入力プロ
グラム 1102 コンパイル処理装置によって、変換された並
列プログラム 1103 入力プログラムをコンパイル内部で処理され
る内部データ形式に変換する装置 1104 ループ内でアクセスされる配列のアクセス属
性とアクセス範囲を求める装置 1105 ループの繰り返しの割り付け方法を決定する
装置 1106 データ転送を行なうためのコードを生成する
装置 1107 コンパイル内部で処理される内部データ形式
をソースプログラムに変換し、並列プログラムを生成す
る装置 1103〜1111 コンパイル処理装置の各部品の入
出力 1201 配列Aの変数テーブル 1202 配列Aの宣言された領域の範囲 1203 配列Bの変換テーブル 1204 配列Bの宣言された領域の範囲 1205 複数の変数テーブルをリンクするポインタ 1206 配列Aの分散情報を格納するテーブル 1207 配列Aの整列三組 1208 配列Aの分割サイズ 1209 配列Aの最終整列ターゲットである変数テー
ブルへのポインタ 1210 配列Aの変数テーブルから分散情報を格納す
るテーブルへのポインタ 1211 配列Bの分散情報を格納するテーブル 1212 配列Bの整列三組 1213 配列Bの分割サイズ 1214 配列Bの最終整列ターゲットである変数テー
ブルへのポインタ 1215 配列Bの変数テーブルから配列Bの分散情報
を格納するテーブルへのポインタ 1216 入力プログラムのステートメントに対応する
テーブル 1217 ステートメントテーブルをステートメントの
出現順にリンクするポインタ 1218 ループに対応したテーブル 1219 ループの先頭ステートメントに対応したテー
ブルへのポインタ 1220 ループの最後尾に対応したステートメントに
対応したテーブルへのポインタ 1301 ループのテーブルからループ内に出現する配
列のアクセス情報を格納するテーブルへのポインタ 1302 配列Aのアクセス情報を格納するポインタ 1303 配列Aのアクセス情報を格納するテーブルか
ら配列Aの変数テーブルへのポインタ 1304 配列Aのアクセス属性 1305 配列Aのアクセス範囲 1306 配列Bのアクセス情報を格納するポインタ 1307 配列Bのアクセス情報を格納するテーブルか
ら配列Bの変換テーブルへのポインタ 1308 配列Bのアクセス属性 1309 配列Bのアクセス範囲 1401 ループのテーブルからイタレーション空間の
分散情報を格納するテーブルへのポインタ 1402 イタレーション空間の分散情報を格納するテ
ーブル 1403 イタレーション空間の整列三組 1404 イタレーション空間の分割サイズ 1405 イタレーション空間の分散情報を格納するテ
ーブルから最終整列ターゲットの変数テーブルへのポイ
ンタ 1501 図14と等価なデータ 1502 1001〜1003と等価なデータ 1503 図10の装置 1504 1005と等価なデータ 1505 データ転送コードの生成する装置 1506 1111と等価なデータ 1601 図15の装置によって生成されたデータ転送
を行なうためのコード
0101 Array 0102 Array alignment 0103 Representative array 0104 Array distribution 0105 Processor 0301 Array A 0302 Alignment relationship between array A and array B 0303 Array B 0304 Alignment relationship between array B and array C 0306 Represents alignment relationship between array A and array C Parameter 0401 Method of dividing array C 0402 Method of dividing and arranging arrays A, B, and C on a processor 0501 Apparatus for calculating increment value of three sets of alignments 0502 Apparatus for calculating lower limit of three sets of alignments 0503 Device for calculating the upper limit 0504 The increment value of the alignment triple for the array in the iteration space 0505 The increment value of the access range of the array 0506 The initial value of the alignment triple for the array of the iteration space 0507 The lower limit of the access range of the array 0508 Declaration of the array 0509 Array access Upper limit of range 0510 Increment value of generated alignment triplet 0511 Lower limit of generated alignment triplet 0512 Upper limit of generated alignment triplet 0701 Array B 0702 Array A 0801 Partition size of arrays A and B 0901 Iteration space 0902 Processor allocation of loop iterations 1002 Alignment triad of declared array 1007 Device of FIG. 5 1003 Input of device of FIG. 5 1004 Device output of FIG. 5 1006 Device for detecting data transfer pattern 1005 Data transfer pattern 1008 Array is An access attribute 1101 indicating whether to be updated or referred to 1101 An input program 1102 of the compile processing device shown in FIG. 11 1102 Converted parallel program 1103 by the compile processing device into an internal data format processed inside the compile 1104 Apparatus for determining the access attribute and access range of an array accessed in a loop 1105 Apparatus for determining a loop repetition allocation method 1106 Apparatus for generating a code for performing data transfer 1107 Internal processing inside a compile A device that converts a data format into a source program and generates a parallel program 1103 to 1111 Input / output of each component of the compile processing device 1201 Variable table of array A 1202 Range of declared area of array A 1203 Conversion table of array B 1204 Range of declared area of array B 1205 Pointer for linking a plurality of variable tables 1206 Table for storing distributed information of array A 1207 Alignment triplet of array A 1208 Partition size of array A 1209 Final alignment target of array A 1210 Pointer to a table that stores shared information from the variable table of array A 1211 Table that stores shared information of array B 1212 Alignment triples of array B 1213 Partition size of array B 1214 last of array B Pointer to a variable table that is an alignment target 1215 Pointer to a table that stores distributed information of array B from a variable table of array B 1216 A table corresponding to the statement of the input program 1217 A pointer that links the statement table in the order of appearance of the statement 1218 loop 1219 Pointer to the table corresponding to the first statement of the loop 1220 Pointer to the table corresponding to the statement corresponding to the last statement of the loop 1301 Text of the loop Pointer to a table that stores the access information of the array that appears in the loop from the table 1302 Pointer that stores the access information of the array A 1303 Pointer from the table that stores the access information of the array A to the variable table of the array A 1304 Array A Access attribute 1305 Access range of array A 1306 Pointer storing access information of array B 1307 Pointer from table storing access information of array B to conversion table of array B 1308 Access attribute of array B 1309 Access range of array B 1401 Pointer to a table for storing the distributed information of the iteration space from the table of the loop 1402 Table for storing the distributed information of the iteration space 1403 Three sets of alignment of the iteration space 1404 Minutes of the iteration space Size 1405 Pointer to variable table of final alignment target from table storing distribution information of iteration space 1501 Data equivalent to FIG. 14 1502 Data equivalent to 1001 to 1003 1503 Data equivalent to device 1504 1005 in FIG. Device for Generating Transfer Code 1506 Data Equivalent to 1111 1601 Code for Performing Data Transfer Generated by Device of FIG.

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】複数の繰り返しからなるループを少なくと
も1個含むプログラム中に宣言された第1の配列が領域
分割され、分割された各々の領域をプロセッサとメモリ
で構成されるシステムが接続網を介して複数個接続され
ている並列計算機システムの前記メモリへ配置するため
に、前記ループに対応するイタレーション空間の要素の
下限から上限まで一定間隔で第1の配列に対応付け、前
記イタレーション空間の要素と前記イタレーション空間
の要素に対応するループの繰り返しでアクセスされる第
2の配列の要素を対応づけて最適にデータを分散するた
めのパラメータを生成する最適データ分散生成装置にお
いて、 前記イタレーション空間の要素に対応付けられた前記第
1の配列の要素間距離と前記イタレーション空間に対応
するループの中でアクセスされる前記第2の配列の要素
間の距離から前記第2の配列の要素に対応付けられる前
記第1の配列の要素間の距離を生成する第1の手段と、 前記イタレーション空間の1番目の要素に対応付けられ
た前記第1の配列の要素と前記イタレーション空間に対
応するループの中でループの最初の繰り返しでアクセス
される前記第2の配列の要素番号と前記第1の配列の領
域の下限と前記第1の手段で生成された前記第2の配列
の要素に対応付けられる前記第1の配列の要素間の距離
から前記第2の配列の最初の要素に対応付けられる前記
第1の配列の要素番号を生成する第2の手段と、 前記第1の手段で生成された前記第2の配列の要素に対
応付けられる前記第1の配列の要素間の距離と前記第2
の手段で生成された前記第2の配列の最初の要素に対応
付けられる前記第1の配列の要素番号と第1の配列の領
域の下限と第1の配列の領域の上限から前記第2の配列
の最後の要素に対応付けられる前記第1の配列の要素番
号を生成する第3の手段から構成され、 前記第2の配列の要素に対応付けられる前記第1の配列
の要素間の距離と、前記第2の配列の最初の要素に対応
付けられる前記第1の配列の要素番号と、前記第2の配
列の最後の要素に対応付けられる前記第1の配列の要素
番号を前記パラメータとすることを特徴とする最適デー
タ分散生成装置。
A first array declared in a program including at least one loop consisting of a plurality of repetitions is divided into regions, and a system in which each divided region is constituted by a processor and a memory forms a connection network. A plurality of parallel computer systems connected to each other via the memory in correspondence with the first array at regular intervals from the lower limit to the upper limit of the elements of the iteration space corresponding to the loop; And an element of the second array accessed by repeating a loop corresponding to an element of the iteration space to generate a parameter for optimally distributing data. A loop corresponding to the inter-element distance of the first array associated with an element of the iteration space and the iteration space First means for generating a distance between elements of the first array associated with elements of the second array from a distance between elements of the second array accessed in The element of the first array associated with the first element of the space and the element number of the second array accessed in the first iteration of the loop in the loop corresponding to the iteration space; The first element of the second array corresponds to the lower limit of the area of the first array and the distance between the elements of the first array associated with the elements of the second array generated by the first means. Second means for generating an element number of the first array to be attached; and a distance between elements of the first array corresponding to the elements of the second array generated by the first means. The second
From the element number of the first array, the lower limit of the area of the first array, and the upper limit of the area of the first array, which are associated with the first element of the second array generated by the means of A third means for generating an element number of the first array associated with the last element of the array; and a distance between the elements of the first array associated with the elements of the second array. The element number of the first array associated with the first element of the second array and the element number of the first array associated with the last element of the second array are the parameters. An optimal data distribution generation device, characterized in that:
【請求項2】前記プログラム中に含まれるループの中で
アクセスされる第2の配列の要素に対応付けられる前記
第1の配列の要素間の距離と前記第2の配列の最初の要
素に対応付けられる前記第1の配列の要素番号と前記第
2の配列の最後の要素に対応付けられる前記第1の配列
の要素番号と前記パラメータと第2の配列がループ中で
参照されるか更新されるかを表すアクセス属性から前記
システム間でのデータ転送パターンを生成する手段を備
え、 前記第2の配列の要素に対応付けられる第3の配列の要
素間の距離と前記第2の配列の最初の要素に対応付けら
れる第3の配列の要素番号と前記第2の配列の最後の要
素に対応付けられる第3の配列の要素番号を前記パラメ
ータとすることを特徴とする請求項1に記載の最適デー
タ分散生成装置。
2. A distance between elements of the first array associated with elements of a second array accessed in a loop included in the program and a first element of the second array. The element number of the first array, the element number of the first array, the parameter, and the second array corresponding to the last element of the second array are referenced or updated in a loop. Means for generating a data transfer pattern between the systems from an access attribute indicating whether or not the distance between the elements of the third array corresponding to the elements of the second array and the first of the second array The element number of the third array associated with the element of the third array and the element number of the third array associated with the last element of the second array are used as the parameters. Optimal data distribution generator Place.
【請求項3】複数の繰り返しからなるループを少なくと
も1個含むプログラム中に宣言された第1の配列が領域
分割され、分割された各々の領域をプロセッサとメモリ
で構成されるシステムが接続網を介して複数個接続され
ている並列計算機システムの前記メモリへ配置する場合
に、 前記プログラムを入力として前記装置間でデータの転送
を行なうためのコードを自動的に生成するコンパイル処
理装置において、 入力されたプログラムの構文解析および字句解析を行な
い、前記プログラムを変換してコンパイラ内で処理され
る内部データを生成する手段と、 前記内部データからプログラム中のループ中にアクセス
される配列のアクセス範囲と配列へのアクセスが参照で
あるか更新であるかを表すアクセス属性を検出して前記
内部データに付加する手段と、 前記内部データからプログラム中に含まれるループに対
応するイタレーション空間の要素を下限から上限まで一
定間隔で第1の配列と対応づけるループ分散手段と、 前記イタレーション空間に対応するループの中でアクセ
スされる第2の配列の要素に対応付けられる前記第1の
配列の要素間の距離と前記第2の配列の最初の要素に対
応付けられる前記第1の配列の要素番号と前記第2の配
列の最後の要素に対応付けられる前記第1の配列の要素
番号と、前記イタレーション空間の要素と前記イタレー
ション空間の要素に対応するループの繰り返しでアクセ
スされる第2の配列の要素を対応づけて最適にデータを
分散するためのパラメータと第2の配列がループ中で参
照されるか更新されるかを表すアクセス属性から前記シ
ステム間でのデータ転送パターンを生成する手段と、前
記内部データからソースプログラムを生成する手段から
構成され、前記第2の配列の要素に対応付けられる前記
第1の配列の要素間の距離と、前記第2の配列の最初の
要素に対応付けられる前記第1の配列の要素番号と、前
記第2の配列の最後の要素に対応付けられる前記第1の
配列の要素番号を前記パラメータとし、逐次プログラム
を並列プログラムに変換することを特徴とするコンパイ
ル処理装置。
3. A system in which a first array declared in a program including at least one loop consisting of a plurality of repetitions is divided into regions, and a system in which each divided region is constituted by a processor and a memory forms a connection network. When arranging in the memory of the parallel computer system which is connected to a plurality of devices via a computer, the compile processing device automatically generates a code for transferring data between the devices by using the program as an input. Means for performing syntax analysis and lexical analysis of the program, converting the program to generate internal data to be processed in a compiler, and an access range and an array of an array accessed from the internal data in a loop in the program An access attribute that indicates whether access to the device is a reference or an update is detected and added to the internal data. Loop dispersing means for associating an element of an iteration space corresponding to a loop included in a program from the internal data with a first array at fixed intervals from a lower limit to an upper limit; and a loop corresponding to the iteration space The distance between the elements of the first array associated with the elements of the second array accessed in and the element number of the first array associated with the first element of the second array; An element number of the first array corresponding to the last element of the second array, and an element of the iteration space and a second array accessed by repeating a loop corresponding to the element of the iteration space The system is determined from parameters for optimally distributing data by associating elements and access attributes indicating whether the second array is referenced or updated in a loop. Means for generating a data transfer pattern between programs, and means for generating a source program from the internal data, wherein a distance between elements of the first array corresponding to elements of the second array; The element number of the first array associated with the first element of the second array and the element number of the first array associated with the last element of the second array are used as the parameters. A compilation processing device for converting a program into a parallel program.
JP10502695A 1995-04-28 1995-04-28 Optimal data distribution generation device and compilation processing device Expired - Fee Related JP2739836B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10502695A JP2739836B2 (en) 1995-04-28 1995-04-28 Optimal data distribution generation device and compilation processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10502695A JP2739836B2 (en) 1995-04-28 1995-04-28 Optimal data distribution generation device and compilation processing device

Publications (2)

Publication Number Publication Date
JPH08305670A JPH08305670A (en) 1996-11-22
JP2739836B2 true JP2739836B2 (en) 1998-04-15

Family

ID=14396535

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10502695A Expired - Fee Related JP2739836B2 (en) 1995-04-28 1995-04-28 Optimal data distribution generation device and compilation processing device

Country Status (1)

Country Link
JP (1) JP2739836B2 (en)

Also Published As

Publication number Publication date
JPH08305670A (en) 1996-11-22

Similar Documents

Publication Publication Date Title
US5551039A (en) Compiling a source code vector instruction by generating a subgrid loop for iteratively processing array elements by plural processing elements
Stichnoth et al. Generating communication for array statements: Design, implementation, and evaluation
Foster et al. FORTRAN M-A Language for Modular Parallel Programming
Zima et al. SUPERB: A tool for semi-automatic MIMD/SIMD parallelization
US6681388B1 (en) Method and compiler for rearranging array data into sub-arrays of consecutively-addressed elements for distribution processing
US6199093B1 (en) Processor allocating method/apparatus in multiprocessor system, and medium for storing processor allocating program
Prylli et al. Fast runtime block cyclic data redistribution on multiprocessors
JPH08185325A (en) Code generation method in compiler and compiler
Kuehn et al. Extensions to the C Programming Language for SIMD/MIMD Parallelism.
Cox et al. Evaluating the performance of software distributed shared memory as a target for parallelizing compilers
US5515535A (en) System and method for parallel variable optimization
Philippsen et al. Modula-2* and its compilation
US5561801A (en) System and method for multilevel promotion
Benkner Vienna Fortran 90 and its compilation
Philippsen et al. Compiling for massively parallel machines
JP2739836B2 (en) Optimal data distribution generation device and compilation processing device
Harris et al. Compiling High Performance Fortran for distributed-memory systems
Mullin et al. A Reduction semantics for array expressions: the PSI compiler
Arenaz et al. The technological roadmap of parallware and its alignment with the openpower ecosystem
JP3233467B2 (en) Program conversion method and apparatus
Ungerer et al. An object-oriented interface for parallel programming of loosely-coupled multiprocessor systems
Ramanujam et al. Automatic data mapping and program transformations
Leggett et al. CAPLib—a ‘thin layer’message passing library to support computational mechanics codes on distributed memory parallel systems
JP3304445B2 (en) Program generation processing device
Du n Intentional Approach to Parallel Programming

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 19971224

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080123

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090123

Year of fee payment: 11

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100123

Year of fee payment: 12

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110123

Year of fee payment: 13

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110123

Year of fee payment: 13

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120123

Year of fee payment: 14

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130123

Year of fee payment: 15

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130123

Year of fee payment: 15

LAPS Cancellation because of no payment of annual fees