JPH07244647A - Method and device for parallelization for indirect reference loop, and method and device for parallel execution - Google Patents

Method and device for parallelization for indirect reference loop, and method and device for parallel execution

Info

Publication number
JPH07244647A
JPH07244647A JP6062045A JP6204594A JPH07244647A JP H07244647 A JPH07244647 A JP H07244647A JP 6062045 A JP6062045 A JP 6062045A JP 6204594 A JP6204594 A JP 6204594A JP H07244647 A JPH07244647 A JP H07244647A
Authority
JP
Japan
Prior art keywords
array
list
loop
processor
indirect reference
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.)
Withdrawn
Application number
JP6062045A
Other languages
Japanese (ja)
Inventor
Hiroshi Ota
寛 太田
Tetsuro Saito
鉄郎 斉藤
Masahiro Uminaga
正博 海永
Yasuhiko Saito
靖彦 斎藤
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.)
Hitachi Microcomputer System Ltd
Hitachi Ltd
Original Assignee
Hitachi Microcomputer System Ltd
Hitachi Ltd
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 Hitachi Microcomputer System Ltd, Hitachi Ltd filed Critical Hitachi Microcomputer System Ltd
Priority to JP6062045A priority Critical patent/JPH07244647A/en
Publication of JPH07244647A publication Critical patent/JPH07244647A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To enables the parallel execution and parallelization of general indirect reference loops and to enable parallel execution and parallelization, specially, when indirect reference is present on a left side by inserting a statement for deciding whether an array element referred to a loop including the indirect reference in present on its own processor or another processor in an indirect reference loop. CONSTITUTION:An initialization statement for a final iteration array last is interposed 121 right before an indirect loop. A statement for deciding whether the indirect reference is local reference or remote reference is interposed 122 before a substituted statement in a loop of a program. Then a statement for recording an iteration index in the final iteration array is inserted 123 into the part which is executed at the time of the local reference. Further, a statement for registering substitution information on the remote reference in a substitution list is inserted 124 into the part which is executed at the time of the remote reference. Statements for the postprocessing of the remote reference are added 125 and 126 after the loop.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、逐次処理計算機用に記
述された間接参照ループを含むプログラムを、分散メモ
リ型の並列計算機上で実行可能なプログラムに変換する
プログラム並列化方法及び装置と、間接参照ループの並
列実行方法及び装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a program parallelizing method and apparatus for converting a program including an indirect reference loop written for a serial processing computer into a program executable on a distributed memory type parallel computer. The present invention relates to a parallel execution method and apparatus for an indirect reference loop.

【0002】[0002]

【従来の技術】複数のプロセッサから構成される並列計
算機システムにおいて、各プロセッサごとに固有のメモ
リを備えているものを、分散メモリ型並列計算機と呼ん
でいる。科学技術計算などに現われる大規模配列の処理
を分散メモリ型並列計算機で実行するときは、配列の各
要素を各プロセッサのメモリに分割して割り付け、各要
素に対する処理を各プロセッサで並列に実行するという
方式が、通常用いられる。このような方式を実現するプ
ログラムを作成する一つの方法は、並列化コンパイラを
用いることである。
2. Description of the Related Art In a parallel computer system composed of a plurality of processors, one having a memory unique to each processor is called a distributed memory type parallel computer. When executing the processing of a large-scale array that appears in scientific and technical computing with a distributed memory parallel computer, divide each element of the array into the memory of each processor and allocate it, and execute the processing for each element in parallel with each processor. This method is usually used. One way to create a program that implements such a scheme is to use a parallelizing compiler.

【0003】並列化コンパイラは、逐次処理用言語で記
述されたプログラムを並列計算機用プログラムに変換す
る言語プロセッサである。分散メモリ型並列計算機用の
並列化コンパイラは、配列要素や、ループの繰り返し
(以後、ループの繰り返し単位をイタレーションと呼
ぶ。例えば、i=2のイタレーションという。)を各プ
ロセッサへ分割して割り当て、必要ならばデータ転送文
や同期文を挿入して、各プロセッサ用のプログラムを生
成する。あるイタレーションで参照される配列要素が自
プロセッサに割り当てられている場合に、その配列要素
参照を「local参照」と呼び、また、他プロセッサ
に割り当てられている場合に「remote参照」と呼
ぶ。remote参照については、プロセッサ間通信に
よって配列要素の値を転送する必要がある。そこで考慮
しなければならないのは、分散メモリ型並列計算機では
プロセッサ間通信の起動に非常に時間が掛かることであ
る。通常、CPU演算の数百ステップ以上の起動時間を
必要とする。したがって、個々のremote参照毎に
通信を行っていたのでは、起動オーバーヘッドのために
性能が非常に低下してしまう。そのため、分散メモリ型
並列計算機では、複数の配列要素をまとめて転送して通
信回数を低減する工夫が、非常に重要である。
A parallelizing compiler is a language processor that converts a program written in a serial processing language into a parallel computer program. A parallelizing compiler for a distributed memory parallel computer divides array elements and loop iterations (hereinafter, the loop iteration unit is called iteration. For example, i = 2 iteration) into each processor. Allocate, insert data transfer statements and synchronization statements if necessary, and generate a program for each processor. When an array element referred to by a certain iteration is assigned to its own processor, the array element reference is called "local reference", and when it is assigned to another processor, it is called "remote reference". For remote reference, it is necessary to transfer the array element value by interprocessor communication. Therefore, it must be taken into consideration that in a distributed memory parallel computer, it takes a very long time to start interprocessor communication. Normally, a start-up time of several hundred steps or more of CPU calculation is required. Therefore, if communication is performed for each individual remote reference, the performance will be greatly reduced due to the startup overhead. Therefore, in a distributed memory parallel computer, it is very important to devise a method of transferring a plurality of array elements collectively and reducing the number of communications.

【0004】配列要素参照がa[i+1]のように単純
な線形添字を持つならば、remote参照される配列
要素の範囲をコンパイル時に決定でき、配列要素をまと
めて転送する文を比較的容易に生成できる。しかし、添
字がもっと複雑な場合には転送文の生成はより難しくな
る。特に問題となるのは以下に述べる間接参照の場合で
ある。間接参照とは添字が配列要素になっている配列要
素参照、例えばa[p[i]]のような参照である。間
接参照を含むループのことを間接参照ループと呼ぶ。間
接参照ループは、有限要素法などで生じる粗行列の計算
やピボット交換付きガウス消去法などの現実の問題に頻
繁に現われる。間接参照ループの特徴は、添字の値が実
行時まで不明なため、remote参照される要素をコ
ンパイル時にまとめてデータ転送文を生成することが不
可能なことである。そのため、間接参照ループは添字が
線形であるようなループに比べて並列化が困難である。
間接参照ループの並列化方法に関する従来技術としては
Koelbel and Mehrotra, ”C
ompiling Global Name−Spac
e Parallel Loops for Dist
ributedExecution”, IEEE T
rans. on Paralleland Dist
ributed Systems, Vol.2, N
o.4, pp.440−451, 1991年 があ
る。そこでは、間接参照ループを、次のような並列実行
方法に基づくループに並列化した。その並列実行方法と
は、remote参照される配列要素の位置情報を含む
リストを作成する「inspectorループ」を、プ
ログラムの最初で予め実行しておくものであった。添字
配列の値が全プログラムを通じて不変ならば、insp
ectorループは全プログラムを通じて1回だけ実行
すればよいことになる。後は、間接参照ループの度にそ
のリストに基づいてremote参照される要素をまと
めて転送することができる。また別の従来技術として
は、窪田、三吉、大野、森、中島、富田、”分散メモリ
型並列計算機の自動並列化コンパイラ−Inspect
or/Executorアルゴリズムの高速化−”,
並列処理シンポジウムJSPP’93, pp.47−
54 がある。そこでは、前述の従来技術に基づいて、
添字配列が置換になっているなどの特殊な場合にins
pectorループを高速化する方法が提案されてい
る。
If the array element reference has a simple linear subscript such as a [i + 1], the range of the array element referred to by remote can be determined at compile time, and the statement for transferring the array elements collectively can be relatively easily performed. Can be generated. However, if the subscript is more complicated, the transfer sentence generation becomes more difficult. A particular problem is the case of indirect reference described below. An indirect reference is an array element reference whose subscript is an array element, such as a [p [i]]. A loop including an indirect reference is called an indirect reference loop. The indirect reference loop frequently appears in actual problems such as the calculation of a coarse matrix generated by the finite element method and the Gaussian elimination method with pivot exchange. The feature of the indirect reference loop is that it is impossible to generate a data transfer statement by compiling the elements referred to by remote at the time of compilation because the value of the subscript is unknown until the time of execution. Therefore, the indirect reference loop is more difficult to parallelize than the loop having a linear subscript.
The prior art relating to the parallelization method of the indirect reference loop includes Koelbel and Mehtra, "C.
ompinging Global Name-Spac
e Parallel Loops for Dist
ribbedExecution ”, IEEE T
rans. on Parallel Land Dist
ribbed Systems, Vol. 2, N
o. 4, pp. 440-451, 1991. There, the indirect reference loop was parallelized into a loop based on the following parallel execution method. The parallel execution method is to execute an "inspector loop" that creates a list including position information of array elements referred to by remote at the beginning of the program. If the value of the subscript array is invariant throughout the program, insp
The actor loop only needs to be executed once throughout the entire program. After that, the elements referred to by remote can be collectively transferred based on the list in each indirect reference loop. As another conventional technique, Kubota, Miyoshi, Ohno, Mori, Nakajima, Tomita, "Automatic parallelizing compiler for distributed memory parallel computer-Inspect
or / Executor algorithm speedup- ",
Parallel Processing Symposium JSPP'93, pp. 47-
There is 54. There, based on the above-mentioned conventional technology,
Ins in special cases such as subscript array substitution
A method for speeding up the vector loop has been proposed.

【0005】[0005]

【発明が解決しようとする課題】従来の方法では、並列
化対象としている間接参照ループに特殊な条件があっ
た。すなわち、添字配列の値がプログラムを通じて不変
であることや、添字配列の値が置換になっていることな
どの制限があった。また、上記の従来技術には、並列化
された間接参照ループの形は示されていたが、間接参照
ループをそのような形に変換するための並列化手順は、
明確に述べられていなかった。さらに、従来の方法で
は、間接参照が代入文の左辺にある場合に生じる問題に
対処していなかった。すなわち、 for(i=0; i<N; i++) a[p[i]]=b[i]; のようなループ(ここで、上記文はC言語によるもので
あり、i++はiを順次増加することを意味する。ま
た、式の右辺は既知の値であり、左辺は、いわば未知の
値であり、右辺の既知の値によって決まる。)では、異
なるiに対してp[i]が同じ値を取ったときに、異な
るイタレーションが配列aの同一の要素を書き換える。
それらのうち、最後のイタレーションによって書かれた
値のみがループ終了後の値として残る。例えば、a[p
[2]]=b[2]でp[2]=12であり、a[p
[6]]=b[6]でp[6]=12であったとする
と、a[12]の値としてはb[6]が残る。このルー
プを並列実行する場合は、ループ終了後の各配列要素が
並列実行ではない逐次実行のときと同じ値を持つように
しなければならないが、従来の方法は、その問題に対処
していなかった。本発明の目的は、一般的な間接参照ル
ープの並列実行および並列化を可能とすることにある。
特に、間接参照が左辺にある場合の並列実行および並列
化を可能とすることにある。
In the conventional method, the indirect reference loop to be parallelized has a special condition. In other words, there are restrictions such as the value of the subscript array being invariable throughout the program and the value of the subscript array being replaced. Further, in the above-mentioned conventional technology, the form of the parallelized indirect reference loop was shown, but the parallelization procedure for converting the indirect reference loop into such a form is
It was not stated clearly. Furthermore, the conventional method does not address the problem that occurs when the indirect reference is on the left side of the assignment statement. That is, a loop such as for (i = 0; i <N; i ++) a [p [i]] = b [i]; (where the above sentence is in C language, and i ++ sequentially i In addition, the right side of the equation is a known value, the left side is a so-called unknown value, which is determined by the known value of the right side.) For different i, p [i] is When it takes the same value, different iterations rewrite the same element of array a.
Among them, only the value written by the last iteration remains as the value after the loop ends. For example, a [p
[2]] = b [2], p [2] = 12, and a [p
If [6]] = b [6] and p [6] = 12, b [6] remains as the value of a [12]. When this loop is executed in parallel, each array element after the end of the loop must have the same value as in serial execution that is not parallel execution, but the conventional method did not address that problem. . An object of the present invention is to enable parallel execution and parallelization of a general indirect reference loop.
In particular, it is to enable parallel execution and parallelization when an indirect reference is on the left side.

【0006】[0006]

【課題を解決するための手段】逐次処理プログラムまた
は共有メモリ型並列計算機用プログラムを分散メモリ型
並列計算機プログラムに変換するプログラム並列化方法
において、配列の添字が配列になっている間接参照を含
むループに対して、参照されている配列要素が自プロセ
ッサにあるか他プロセッサにあるかを判定する文を、該
間接参照ループ内に挿入するステップと、参照されてい
る配列要素が他プロセッサにある場合に該配列要素につ
いての情報をリストに登録する文を、該間接参照ループ
内に挿入するステップと、該リストをプロセッサ間で交
換するリスト交換文を、該間接参照ループの後に挿入す
るステップと、該交換されたリストを用いて他プロセッ
サの配列要素の値を自プロセッサの配列要素に代入する
文を、該リスト交換文の後に挿入するステップとを含む
ようにしている。また、配列の添字が配列になっている
間接参照ループを分散メモリ型並列計算機で並列実行す
る方法において、参照されている配列要素が自プロセッ
サにあるか他プロセッサにあるかを該間接参照ループ内
で判定するステップと、自プロセッサにある場合に該配
列要素への代入をするステップと、他プロセッサにある
場合に該配列要素についての情報を該間接参照ループ内
でリストに登録するステップと、該間接参照ループ終了
後に該リストをプロセッサ間で交換するステップと、該
交換されたリストを用いて他プロセッサの配列要素の値
を自プロセッサの配列要素に代入するステップとを含む
ようにしている。また、逐次処理プログラムまたは共有
メモリ型並列計算機用プログラムを分散メモリ型並列計
算機プログラムに変換するプログラム並列化装置におい
て、配列の添字が配列になっている間接参照を含むルー
プに対して、参照されている配列要素が自プロセッサに
あるか他プロセッサにあるかを判定する文を、該間接参
照ループ内に挿入する手段と、参照されている配列要素
が他プロセッサにある場合に該配列要素についての情報
をリストに登録する文を、該間接参照ループ内に挿入す
る手段と、該リストをプロセッサ間で交換するリスト交
換文を、該間接参照ループの後に挿入する手段と、該交
換されたリストを用いて他プロセッサの配列要素の値を
自プロセッサの配列要素に代入する文を、該リスト交換
文の後に挿入する手段とを備えるようにしている。ま
た、配列の添字が配列になっている間接参照ループを分
散メモリ型並列計算機で並列実行する装置において、参
照されている配列要素が自プロセッサにあるか他プロセ
ッサにあるかを判定する手段と、自プロセッサにある場
合に該配列要素への代入をする手段と、他プロセッサに
ある場合に該配列要素についての情報をリストに登録す
る手段と、該リストをプロセッサ間で交換する手段と、
該交換されたリストを用いて他プロセッサの配列要素の
値を自プロセッサの配列要素に代入する手段とを備える
ようにしている。また、プログラム並列化方法におい
て、配列の添字が配列になっている間接参照が代入文の
右辺に現われるループに対して、参照されている配列要
素が自プロセッサにあるか他プロセッサにあるかを判定
する文を、該間接参照ループ内に挿入するステップと、
他プロセッサにある場合に該配列要素についての位置情
報を位置リストに登録する文を、該間接参照ループ内に
挿入するステップと、該位置リストをプロセッサ間で交
換する位置リスト交換文を、該間接参照ループの後に挿
入するステップと、該交換された位置リストを用いて、
他プロセッサから参照されている配列要素の値を含む値
リストを作成する文を、該位置リスト交換文の後に挿入
するステップと、該値リストをプロセッサ間で交換する
値リスト交換文を、該値リスト作成文の後に挿入するス
テップと、該交換された値リストを用いて他プロセッサ
の配列要素の値を自プロセッサの配列要素に代入する文
を、該値リスト交換文の後に挿入するステップとを含む
ようにしている。また、並列実行する方法において、参
照されている配列要素が自プロセッサにあるか他プロセ
ッサにあるかを、該間接参照ループ内で判定するステッ
プと、自プロセッサにある場合に該配列要素への代入を
するステップと、他プロセッサにある場合に該配列要素
についての位置情報を該間接参照ループ内で位置リスト
に登録するステップと、該間接参照ループ終了後に該位
置リストをプロセッサ間で交換するステップと、該交換
された位置リストを用いて、他プロセッサから参照され
ている配列要素の値を含む値リストを作成するステップ
と、該値リストをプロセッサ間で交換するステップと、
該交換された値リストを用いて他プロセッサの配列要素
の値を自プロセッサの配列要素に代入するステップとを
含むようにしている。また、プログラム並列化方法にお
いて、配列の添字が配列になっている間接参照が代入文
の左辺に現われるループに対して、間接参照されている
配列の要素を最後に書き換えたイタレーションのインデ
ックスを記録する最終イタレーション配列の宣言文をプ
ログラム内に挿入するステップと、該最終イタレーショ
ン配列の初期化文を該間接参照ループの前に挿入するス
テップと、参照されている配列要素が自プロセッサにあ
るか他プロセッサにあるかを判定する文を、該間接参照
ループ内に挿入するステップと、最終イタレーション配
列にイタレーションインデックスを記録する文を、該間
接参照ループ内に挿入するステップと、他プロセッサに
ある場合に該配列要素についての代入情報を代入リスト
に登録する文を、該間接参照ループ内に挿入するステッ
プと、該代入リストをプロセッサ間で交換する代入リス
ト交換文を、該間接参照ループの後に挿入するステップ
と、該交換された代入リストを用いて他プロセッサの配
列要素の値を自プロセッサの配列要素に代入する文を、
該代入リスト交換文の後に挿入するステップとを含むよ
うにしている。また、プログラム並列化方法において、
配列の添字が配列になっている間接参照が加算代入文の
左辺に現われるループに対して、参照されている配列要
素が自プロセッサにあるか他プロセッサにあるかを判定
する文を、該間接参照ループ内に挿入するステップと、
他プロセッサにある場合に該配列要素についての代入情
報を代入リストに登録する文を、該間接参照ループ内に
挿入するステップと、該代入リストをプロセッサ間で交
換する代入リスト交換文を、該間接参照ループの後に挿
入するステップと、該交換された代入リストを用いて他
プロセッサの配列要素の値を自プロセッサの配列要素に
加算代入する文を、該代入リスト交換文の後に挿入する
ステップとを含むようにしている。また、並列実行する
方法において、参照されている配列要素が自プロセッサ
にあるか他プロセッサにあるかを、該間接参照ループ内
で判定するステップと、自プロセッサにある場合に該配
列要素への加算代入をするステップと、他プロセッサに
ある場合に該配列要素についての代入情報を該間接参照
ループ内で代入リストに登録するステップと、該間接参
照ループ終了後に該代入リストをプロセッサ間で交換す
るステップと、該交換された代入リストを用いて他プロ
セッサの配列要素の値を自プロセッサの配列要素に加算
代入するステップとを含むようにしている。
In a program parallelization method for converting a serial processing program or a shared memory parallel computer program into a distributed memory parallel computer program, a loop including an indirect reference in which an array subscript is an array For inserting a statement that determines whether the referenced array element is in its own processor or another processor into the indirect reference loop, and if the referenced array element is in another processor Inserting a statement for registering information about the array element in a list in the indirect reference loop, and inserting a list exchange statement for exchanging the list between processors after the indirect reference loop. Using the exchanged list, a statement for substituting the array element value of another processor into the array element of the local processor is added to the list exchange statement. So that and inserting after the sentence. Further, in a method of executing an indirect reference loop whose array subscript is an array in parallel in a distributed memory type parallel computer, it is determined whether the referenced array element is in its own processor or another processor in the indirect reference loop. , A step of assigning to the array element when it is in its own processor, a step of registering information about the array element in a list in the indirect reference loop when it is in another processor, After the indirect reference loop ends, the steps of exchanging the list between the processors and the step of substituting the value of the array element of the other processor into the array element of the own processor by using the exchanged list are included. Further, in a program parallelizing device for converting a serial processing program or a shared memory parallel computer program into a distributed memory parallel computer program, a loop including an indirect reference in which an array subscript is an array is referred to. A means for inserting into the indirect reference loop a statement for determining whether the existing array element is in its own processor or in another processor, and information about the array element when the referenced array element is in another processor. Using a means for inserting a statement for registering a list in a list in the indirect reference loop, a means for inserting a list exchange statement for exchanging the list between processors after the indirect reference loop, and the exchanged list. And a statement for substituting the value of the array element of another processor into the array element of its own processor after the list exchange statement. It has to. Further, in a device that executes in parallel an indirect reference loop whose array subscript is an array in a distributed memory parallel computer, means for determining whether the referenced array element is in its own processor or another processor, Means for assigning to the array element when it is in its own processor, means for registering information about the array element in a list when it is in another processor, and means for exchanging the list between processors
Means for substituting the array element value of the other processor into the array element of the own processor using the exchanged list. Also, in the program parallelization method, it is determined whether the referenced array element is in its own processor or another processor for the loop in which the indirect reference whose array subscript is an array appears on the right side of the assignment statement. Inserting a statement in the indirect reference loop,
The step of inserting a statement for registering the position information about the array element in the position list in another processor into the indirect reference loop, and the position list exchange statement for exchanging the position list between the processors Using the step of inserting after the reference loop and the exchanged position list,
The step of inserting a statement that creates a value list containing the values of array elements referenced by another processor after the position list exchange statement, and the value list exchange statement that exchanges the value list between the processors A step of inserting after the value list exchange statement, a step of inserting after the value list exchange statement, and a step of substituting the value of the array element of another processor into the array element of the own processor using the exchanged value list. I am trying to include it. In the parallel execution method, a step of determining in the indirect reference loop whether the referenced array element is in its own processor or another processor, and assigning to the array element if it is in its own processor A step of registering position information about the array element in a position list in the indirect reference loop when the processor is in another processor, and a step of exchanging the position list between the processors after the end of the indirect reference loop. Creating a value list containing the values of array elements referenced by other processors using the exchanged position list; and exchanging the value list between processors.
The step of substituting the array element value of another processor into the array element of the own processor by using the exchanged value list. Also, in the program parallelization method, for the loop where an indirect reference in which the array subscript is an array appears on the left side of the assignment statement, record the iteration index at which the element of the indirectly referenced array was last rewritten. Inserting the declaration statement of the final iteration array into the program, inserting the initialization statement of the final iteration array before the indirect reference loop, and the array element being referenced is in the local processor. A statement for determining whether or not it is in another processor in the indirect reference loop; a statement for recording an iteration index in the final iteration array in the indirect reference loop; In the indirect reference loop, a statement to register the assignment information about the array element in the assignment list when A step of inserting an assignment list exchange statement for exchanging the assignment list between processors after the indirect reference loop, and a value of an array element of another processor using the exchanged assignment list. Statement to assign to the array element of
And a step of inserting after the substitution list exchange statement. Also, in the program parallelization method,
For a loop in which an indirect reference in which the array subscript is an array appears on the left side of the addition and assignment statement, a statement that determines whether the referenced array element is in the local processor or another processor is the indirect reference. Inserting inside the loop,
The step of inserting a statement for registering the assignment information about the array element in the assignment list into the indirect reference loop when the processor is in another processor and the assignment list exchange statement for exchanging the assignment list between the processors are And a step of inserting after the assignment list exchange statement, a step of inserting after the reference loop, and a statement for adding and assigning the value of the array element of another processor to the array element of the own processor using the exchanged assignment list. I am trying to include it. In the parallel execution method, a step of determining in the indirect reference loop whether the referenced array element is in its own processor or another processor, and addition to the array element if it is in its own processor A step of assigning, a step of registering assignment information about the array element in the assignment list in the indirect reference loop when it is in another processor, and a step of exchanging the assignment list between processors after completion of the indirect reference loop And a step of adding and substituting the array element value of the other processor to the array element of the own processor by using the exchanged substitution list.

【0007】[0007]

【作用】本発明の並列実行方法によれば、間接参照ルー
プの実行中にremote参照に関する情報のリストを
作成するので、添字配列がプログラム内で変化する場合
でも並列実行可能である。また、左辺に間接参照がある
場合でも、配列要素を書き換えたイタレーションのイン
デックスが記録されているので、最後のイタレーション
によって書き換えられた値のみを、ループ終了後に残す
ことができる。また、本発明の並列化方法によれば、上
記の並列実行方法を実現するプログラムが生成できる。
According to the parallel execution method of the present invention, since a list of information regarding remote references is created during execution of an indirect reference loop, parallel execution is possible even when the subscript array changes in the program. Even if there is an indirect reference on the left side, since the index of the iteration that rewrites the array element is recorded, only the value rewritten by the last iteration can be left after the loop ends. Further, according to the parallelization method of the present invention, a program that realizes the above parallel execution method can be generated.

【0008】[0008]

【実施例】以下、図面を用いて本発明の実施例を説明す
る。図1は、本発明の一実施例に係わるプログラム並列
化方法の手順を示すフローチャートである。図1を参照
してプログラム並列化について説明する前に、本発明に
より並列化されたプログラムが動作する並列計算機の構
成、および、その並列計算機上での本発明による間接参
照ループの並列実行方法について説明する。図2は本発
明の適用対象である分散メモリ型並列計算機の構成の一
例である。この並列計算機は、本発明のプログラム並列
化方法によって並列化されたプログラムを実行する。並
列計算機は複数のプロセッサ201から20n、各プロ
セッサに付随するローカルメモリ211から21n、そ
してそれらを結合する相互結合ネットワーク22から構
成される。各ローカルメモリ上のデータは、それが付随
するプロセッサからは直接参照できるが、他のプロセッ
サからは直接参照することはできない。あるプロセッサ
に付随するデータを他のプロセッサから参照するために
は、そのデータは相互結合ネットワーク22を通じて転
送されなければならない。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a flow chart showing the procedure of a program parallelization method according to an embodiment of the present invention. Before describing program parallelization with reference to FIG. 1, a configuration of a parallel computer on which a program parallelized by the present invention operates and a parallel execution method of an indirect reference loop by the present invention on the parallel computer will be described. explain. FIG. 2 shows an example of the configuration of a distributed memory type parallel computer to which the present invention is applied. This parallel computer executes a program parallelized by the program parallelization method of the present invention. The parallel computer is composed of a plurality of processors 201 to 20n, local memories 211 to 21n associated with each processor, and an interconnection network 22 connecting them. The data on each local memory can be directly referenced by the processor to which it is attached, but cannot be directly referenced by other processors. In order for data associated with one processor to be referenced by another processor, the data must be transferred through the interconnection network 22.

【0009】図3に間接参照ループの一例を示す。1行
目は実数型の10000個の要素から成る配列a,bの
宣言文、2行目は整数型の10000個の要素から成る
配列pの宣言文である。3行目から5行目までが間接参
照ループである。4行目の代入文の右辺の配列bの添字
が配列pになっている。このループを分散メモリ型並列
計算機で実行する場合、ループのイタレーションと配列
要素を分割して各プロセッサに割り当てる。例えば、 プロセッサ1: イタレーション0から99、配列a
[0]からa[99]、b[0]からb[99]、p
[0]からp[99] プロセッサ2: イタレーション100から199、配
列a[100]からa[199]、b[100]からb
[199]、p[100]からp[199] 以下同様 のように割り当てる。ここでイタレーションの番号は変
数iの値で表している。このように割り当てれば、ある
イタレーションiを実行するときに、配列要素参照a
[i]とp[i]は必ず自プロセッサに割り当てられて
いる。すなわちlocal参照である。しかし、配列要
素参照b[p[i]]については、自プロセッサに割り
当てられているとは限らない。すなわちremote参
照の可能性がある。b[p[i]]がlocal参照か
remote参照かはp[i]の値によって決まり、プ
ログラムの実行時まで確定しない。この状況を考慮しな
がら、この間接参照ループの並列実行方法について説明
する。なお、以下では、配列要素が割り当てられている
プロセッサを「所有者」と呼び、その要素を参照してい
るイタレーションが割り当てられているプロセッサを
「参照者」と呼ぶ(例えば、b[p[2]]=b[12
0]のとき、要素b[120]を参照しているi=2の
イタレーションが割り当てられているプロセッサはプロ
セッサ1であり、この場合のプロセッサ1は参照者であ
る。)。また、間接参照されている配列要素のインデッ
クス、すなわち、p[i]の値(例えば、先の例でp
[2]の値120)のことを「所有者インデックス」、
イタレーションのインデックスi(例えば、先の例でi
=2)のことを「参照者インデックス」と呼ぶ。
FIG. 3 shows an example of an indirect reference loop. The first line is a declaration statement of the arrays a and b of 10,000 elements of real number type, and the second line is the declaration statement of the array p of 10,000 elements of integer type. The third to fifth lines are indirect reference loops. The subscript of the array b on the right side of the assignment statement on the 4th line is the array p. When this loop is executed on a distributed memory parallel computer, the loop iterations and array elements are divided and assigned to each processor. For example, processor 1: iteration 0 to 99, array a
[0] to a [99], b [0] to b [99], p
[0] to p [99] Processor 2: Iterations 100 to 199, arrays a [100] to a [199], b [100] to b
[199], p [100] to p [199], and so on. Here, the iteration number is represented by the value of the variable i. With this allocation, when performing a certain iteration i, the array element reference a
[I] and p [i] are always assigned to the own processor. That is, a local reference. However, the array element reference b [p [i]] is not always assigned to the own processor. That is, there is a possibility of referring to remote. Whether b [p [i]] is a local reference or a remote reference is determined by the value of p [i] and is not fixed until the program is executed. Considering this situation, the parallel execution method of this indirect reference loop will be described. In the following, a processor to which an array element is assigned is called an "owner", and a processor to which an iteration that refers to the element is assigned is called a "referencer" (for example, b [p [ 2]] = b [12
0], the processor assigned the iteration of i = 2 referring to the element b [120] is the processor 1, and the processor 1 in this case is the referencer. ). Also, the index of the indirectly referenced array element, that is, the value of p [i] (for example, p
The value 120) of [2] is the "owner index",
The iteration index i (eg i in the previous example)
= 2) is called a "referencer index".

【0010】図5は、図2の並列計算機上での、図3の
間接参照ループの本発明による並列実行方法の手順を示
すフローチャートである。本手順は、並列計算機の各プ
ロセッサ201から20nが実行するものである。ま
ず、各プロセッサは、自身に割り当てられたイタレーシ
ョンの各々について、ステップ400からステップ40
3の処理を行う。全イタレーションについての処理が終
了した後で、ステップ404からステップ407の処理
を実行する。以下では各ステップの処理の詳細を述べ
る。ステップ400は自身に割り当てられたイタレーシ
ョンのうち、未処理のものがまだあるかどうかの判定で
ある。未処理のイタレーションがあればステップ401
に進み、以下、そのイタレーションについての処理を行
う。ステップ401で間接参照b[p[i]]がloc
al参照かremote参照かを判定する。ループの実
行時には添字配列p[i]の値は確定しているのでこの
判定が可能である。もしlocal参照ならばステップ
402に進み、remote参照ならばステップ403
に進む。ステップ402でlocal参照についての代
入を実行する。local参照されている配列要素は自
プロセッサ上にあるので、この代入に際してプロセッサ
間通信は必要ない。ステップ403ではremote参
照についての位置情報を位置リストに登録する。ここで
位置情報とは、要素b[p[i]]の所有者のプロセッ
サ番号(例えば、b[p[2]]=b[120]であれ
ば、所有者のプロセッサ番号は2である。)、所有者イ
ンデックスp[i]の値(例えば、p[2]=120な
ら値は120である。)、および参照者インデックスi
の値(例えば、b[p[2]]なら、この値は2であ
る。)である。位置リストの構造は図6を用いて後述す
る。ステップ400で未処理のイタレーションがもうな
ければステップ404に進み、以下、位置リストに基づ
いてremote参照の後処理をする。ステップ404
に進んだ時点では、各プロセッサの位置リストには、自
身が参照者であるようなremote参照についての位
置情報が登録されている。これを「参照者側位置リス
ト」と呼ぶ。ステップ404では、remote参照の
位置情報が参照者から所有者に渡るように、全プロセッ
サ間で位置リストを交換する。このとき参照者情報も渡
される。交換方法としては、例えば、Johnsson
and Ho, ”Optimum Broadca
sting and Personalized Co
mmunication in Hypercube
s”, IEEE Trans. on Comput
ers, Vol.38, No.9, pp.124
9−1268, 1989年 に述べられている全対全
通信などの方法を用いれば良い。この交換により、各プ
ロセッサは、自身が所有者であるようなremote参
照についての位置リストを持つようになる。これを「所
有者側位置リスト」と呼ぶ。ステップ405では、所有
者側位置リストに基づいて、自身が所有者となっている
remote参照の値を含む値リスト(これを「所有者
側値リスト」と呼ぶ)を作成する。値リストの構造は図
7を用いて後述する。ステップ406で、remote
参照の値が所有者から参照者に渡るように、値リストを
全プロセッサ間で交換する。この交換により、各プロセ
ッサは、自身が参照者であるようなremote参照に
ついての値リストを持つようになる。これを「参照者側
値リスト」と呼ぶ。ステップ407で、参照者側値リス
トに基づいて、自身が参照者であるremote参照に
ついて、b[p[i]]の値を左辺の配列要素a[i]
に代入する。以上の処理により、図3の間接参照ループ
の並列実行が完了した。
FIG. 5 is a flow chart showing the procedure of the parallel execution method according to the present invention of the indirect reference loop of FIG. 3 on the parallel computer of FIG. This procedure is executed by each of the processors 201 to 20n of the parallel computer. First, each processor performs steps 400 to 40 for each iteration assigned to itself.
Process 3 is performed. After the processing for all iterations is completed, the processing from step 404 to step 407 is executed. The details of the processing of each step will be described below. Step 400 is a determination as to whether or not there are still unprocessed iterations assigned to itself. Step 401 if there are unprocessed iterations
Then, the process for the iteration is performed. The indirect reference b [p [i]] is loc in step 401.
It is determined whether it is an al reference or a remote reference. This determination is possible because the value of the subscript array p [i] is fixed when the loop is executed. If it is a local reference, proceed to step 402, and if it is a remote reference, step 403.
Proceed to. In step 402, the substitution for the local reference is executed. Since the array element that is locally referenced is on its own processor, interprocessor communication is not necessary for this assignment. In step 403, the position information regarding the remote reference is registered in the position list. Here, the position information means that if the processor number of the owner of the element b [p [i]] (for example, b [p [2]] = b [120], the processor number of the owner is 2. ), The value of the owner index p [i] (for example, if p [2] = 120, the value is 120), and the referencer index i.
Value (for example, if b [p [2]], this value is 2). The structure of the position list will be described later with reference to FIG. If there is no unprocessed iteration in step 400, the process proceeds to step 404, and after that, post-processing of remote reference is performed based on the position list. Step 404
At the time of proceeding to, the position list of each processor has registered therein the position information regarding the remote reference such that the processor itself is the referrer. This is called a "referencer side position list". In step 404, location lists are exchanged between all processors so that location information for remote references passes from the referrer to the owner. At this time, referrer information is also passed. As an exchange method, for example, Johnsson
and Ho, "Optimum Broadca
sting and Personalized Co
mmunication in Hypercube
s ", IEEE Trans. on Comput
ers, Vol. 38, No. 9, pp. 124
A method such as all-to-all communication described in 9-1268, 1989 may be used. This exchange causes each processor to have a location list for remote references that it owns. This is called the "owner side position list". In step 405, based on the owner side position list, a value list including the value of the remote reference owned by itself (this is called an "owner side value list") is created. The structure of the value list will be described later with reference to FIG. In step 406, remote
Exchange lists of values among all processors so that the values of a reference pass from owner to referencer. This exchange causes each processor to have a list of values for remote references that it is a referrer to. This is called a "referencer side value list". In step 407, the value of b [p [i]] is set to the array element a [i] on the left side of the remote reference which is the referrer based on the referrer side value list.
To. Through the above processing, parallel execution of the indirect reference loop in FIG. 3 is completed.

【0011】次に、この並列実行方法で用いた位置リス
トや値リストの構造を説明する。図6は、参照者側位置
リストの構造を示す。所有者ごとにエントリを持つヘッ
ダ500と、その各エントリからポインタでつながるリ
スト本体501によって構成される。remote参照
の各々に対して、リスト本体501の1エントリが対応
する。リスト本体501は所有者インデックスと参照者
インデックスを表す2個のフィールド504および50
5から成る。ヘッダ500には、所有者のプロセッサ番
号を表すフィールド502と、リスト本体に登録されて
いる対の数(登録数)を示すフィールド503が含まれ
る。例えば、図6の位置リストの一番最初の項目(斜線
部分)は、プロセッサ4番の持つ配列要素b[66]の
値が、このプロセッサの配列要素a[5]に代入される
べきことを表している。なお、所有者側位置リストの構
造は、参照者側位置リストの構造とほとんど同じである
が、ヘッダ500内の所有者フィールド502が参照者
を表すフィールドに置き換わっている点だけが異なる。
Next, the structure of the position list and the value list used in this parallel execution method will be described. FIG. 6 shows the structure of the referrer side position list. It is composed of a header 500 having an entry for each owner and a list body 501 connected from each entry with a pointer. One entry in the list body 501 corresponds to each remote reference. The list body 501 has two fields 504 and 50 representing an owner index and a referrer index.
It consists of 5. The header 500 includes a field 502 indicating the processor number of the owner and a field 503 indicating the number of pairs (registration number) registered in the list body. For example, the first item (hatched portion) of the position list in FIG. 6 indicates that the value of the array element b [66] of the processor No. 4 should be assigned to the array element a [5] of this processor. It represents. The structure of the owner-side position list is almost the same as the structure of the referrer-side position list, except that the owner field 502 in the header 500 is replaced with a field representing the referencer.

【0012】図7は、所有者側値リストの構造を示す。
位置リストと同様に、ヘッダ510とリスト本体511
から構成される。ヘッダ510のエントリは参照者ごと
に設ける。また、リスト本体511の内容は、転送すべ
き配列要素の値である。値の順序は、位置リスト内のイ
ンデックスの順序と一致するようにする。例えば、図7
の値リストの網かけ部分は、値13.2が、プロセッサ
5番で参照されることを表している。13.2という値
が、参照者側のどの配列要素に代入されるかは、値リス
トが参照者側に送られたときに、参照者側の位置リスト
との順序対応によって分かる。なお、参照者側値リスト
の構造は、所有者者側値リストの構造とほとんど同じで
あるが、ヘッダ510内の参照者フィールド512が所
有者を表すフィールドに置き換わっている点だけが異な
る。以上で、本発明による間接参照ループの並列実行方
法の説明を終わる。
FIG. 7 shows the structure of the owner-side value list.
Similar to the position list, the header 510 and the list body 511
Composed of. The entry of the header 510 is provided for each referrer. The contents of the list body 511 are values of array elements to be transferred. The order of the values should match the order of the indexes in the position list. For example, in FIG.
The shaded portion of the value list of indicates that the value 13.2 is referred to by the processor 5. Which array element on the referrer side is assigned the value of 13.2 can be known by the order correspondence with the position list on the referrer side when the value list is sent to the referrer side. The structure of the referrer side value list is almost the same as the structure of the owner side value list, except that the referrer field 512 in the header 510 is replaced with a field representing the owner. This is the end of the description of the parallel execution method of the indirect reference loop according to the present invention.

【0013】次に、本発明による間接参照ループの並列
実行方法のための並列実行装置について説明する。図8
は、そのような並列実行装置の一例を表す。各プロセッ
サ20内に、演算部230、remote参照判定部2
31、位置情報登録部232、ネットワーク制御部23
3、値リスト作成部234、remote参照代入部2
35、参照者側位置リスト240、所有者側位置リスト
241、所有者側値リスト242、参照者側値リスト2
43を含む。各リスト240から243はローカルメモ
リ21内に置くこともできる。remote参照判定部
231は図5のステップ401の処理を行う。すなわ
ち、演算部230から間接参照の所有者インデックスp
[i]を受け取り、それがlocal参照かremot
e参照かを判定する。位置情報登録部232は、図5の
ステップ403の処理を行う。すなわち、remote
参照についての位置情報を参照者側位置リスト240に
登録する。ネットワーク制御部233は図5のステップ
404およびステップ406の処理を行う。すなわち、
相互結合ネットワーク22を通じて、位置リスト240
および241や値リスト242および243をプロセッ
サ間で交換する。値リスト作成部234は、図5のステ
ップ405の処理を行う。すなわち、所有者側位置リス
ト241に基づいて所有者側値リスト242を作成す
る。演算部230は通常の演算処理を行う。これには、
図5のステップ402におけるlocal参照の代入実
行を含む。remote参照代入部235は図5のステ
ップ407の処理を行う。すなわち、参照者側値リスト
243用いて、自身が参照者であるremote参照に
ついての代入を実行する。
Next, a parallel execution device for the parallel execution method of the indirect reference loop according to the present invention will be described. Figure 8
Represents an example of such a parallel execution device. In each processor 20, a calculation unit 230 and a remote reference determination unit 2
31, position information registration unit 232, network control unit 23
3, value list creation unit 234, remote reference assignment unit 2
35, reference side position list 240, owner side position list 241, owner side value list 242, reference side value list 2
Including 43. Each list 240 to 243 can be placed in the local memory 21. The remote reference determination unit 231 performs the process of step 401 in FIG. That is, the owner index p of the indirect reference from the calculation unit 230
[I] is received and it is a local reference or remote
e Determine whether it is a reference. The position information registration unit 232 performs the process of step 403 of FIG. That is, remote
The location information about the reference is registered in the referrer side location list 240. The network control unit 233 performs the processing of step 404 and step 406 of FIG. That is,
Through the interconnection network 22, the location list 240
And 241 and the value lists 242 and 243 are exchanged between the processors. The value list creation unit 234 performs the process of step 405 of FIG. That is, the owner-side value list 242 is created based on the owner-side position list 241. The arithmetic unit 230 performs normal arithmetic processing. This includes
Including substitution execution of local reference in step 402 of FIG. The remote reference assigning unit 235 performs the process of step 407 in FIG. That is, using the referrer side value list 243, substitution is performed for the remote reference, which is the referrer.

【0014】図1に戻って、本発明のプログラム並列化
方法の一実施例の詳細を説明する。本実施例の並列化方
法は、図3の形の間接参照ループを対象とする。すなわ
ち、次の条件を充たすループを対象とする。 (1)ループの中身は1個の代入文である。 (2)その代入文の両辺はそれぞれ1個の配列要素参照
である。両辺の配列は異なる。 (3)左辺の配列の添字はループイタレーションのイン
デックスiである。 (4)右辺の配列の添字は、別の配列である。すなわ
ち、右辺は間接参照である。 本並列化方法によって、図3の間接参照ループは図4に
示すような並列実行プログラム301に変換される。図
4のプログラムは図5に示した並列実行方法40を実現
するものである。
Returning to FIG. 1, details of one embodiment of the program parallelizing method of the present invention will be described. The parallelization method of this embodiment targets an indirect reference loop of the form shown in FIG. That is, the loop that satisfies the following conditions is targeted. (1) The content of the loop is one assignment statement. (2) Each side of the assignment statement is one array element reference. The arrangement on both sides is different. (3) The subscript of the array on the left side is the loop iteration index i. (4) The subscript of the array on the right side is another array. That is, the right side is an indirect reference. By this parallelization method, the indirect reference loop of FIG. 3 is converted into the parallel execution program 301 as shown in FIG. The program shown in FIG. 4 realizes the parallel execution method 40 shown in FIG.

【0015】以下、図4のプログラムを参照しながら、
図1の並列化方法の詳細を説明する。ステップ100
で、ループ内の代入文の前に、間接参照がlocal参
照かremote参照判定する文を挿入する。図4では
4行目に相当する。ここでowner(p[i])は、
インデックスの値p[i]から所有者プロセッサ番号を
求めるライブラリ関数である。また、_selfは自プ
ロセッサ番号を表す変数である。6行目のelseも本
ステップで挿入する。ステップ101で、remote
参照についての位置情報を位置リストに登録する文を、
elseの後、すなわちremote参照の場合に実行
される部分に挿入する。図4の7行目にあるput_l
ocinfo()というライブラリ手続き(図5のステ
ップ403の処理に対応する)の呼び出しが、その登録
文である。手続きの引数は、登録する情報、すなわち、
所有者プロセッサ番号owner(p[i])、所有者
インデックスp[i]、参照者インデックスiである。
ステップ102からステップ105で、ループの後にr
emote参照の後処理を行う文を挿入する。後処理
は、ライブラリ手続き呼び出しの形をとる。ステップ1
02では、位置リストを交換する文、すなわち、ライブ
ラリ手続きexchange_loclist()(図
5のステップ404の処理に対応する)の呼び出しを挿
入する。ステップ103では、値リストを作成する文、
すなわち、ライブラリ手続きmake_vallist
(b)(図5のステップ405の処理に対応する)の呼
び出しを挿入する。引数として、間接参照されている配
列bを与えている。ステップ104では、値リストを交
換する文、すなわち、ライブラリ手続きexchang
e_vallist()(図5のステップ406の処理
に対応する) の呼び出しを挿入する。ステップ10
5では、参照者側でremote参照に対する代入を実
行する文、すなわち、ライブラリ手続きremote_
assign(a)(図5のステップ407の処理に対
応する)の呼び出しを挿入する。引数として、代入先の
配列aを与えている。これらのライブラリ手続き呼び出
しは、図4の並列化後プログラムでは9行目から12行
目に挿入されている。なお、図7の3行目のep1,e
p2は、各プロセッサに割り当てられたイタレーション
の範囲を表す変数であり、プロセッサごとに異なる値が
設定される。また、各プロセッサに割り当てられる配列
の範囲は、実際にはep1からep2までであるが、図
4では簡単のため、1,2行目の宣言文における配列の
サイズは10000のままにしてある。
Below, referring to the program of FIG.
Details of the parallelization method of FIG. 1 will be described. Step 100
Then, before the assignment statement in the loop, a statement that determines whether the indirect reference is a local reference or a remote reference is inserted. This corresponds to the fourth line in FIG. Where owner (p [i]) is
This is a library function for obtaining the owner processor number from the index value p [i]. Further, _self is a variable indicating the own processor number. The else in line 6 is also inserted in this step. In step 101, remote
A statement to register the location information about the reference in the location list,
It is inserted after the else, that is, in the part executed in the case of a remote reference. Put_l on line 7 of FIG.
The call of the library procedure called ocinfo () (corresponding to the processing of step 403 in FIG. 5) is the registration statement. The procedure argument is the information to be registered, that is,
The owner processor number owner (p [i]), the owner index p [i], and the referencer index i.
In step 102 to step 105, after the loop, r
Insert a statement to perform post-processing for referring to emote. Post-processing takes the form of library procedure calls. Step 1
In 02, a statement for exchanging the position list, that is, a call of the library procedure exchange_loclist () (corresponding to the processing of step 404 in FIG. 5) is inserted. In step 103, the statement that creates the list of values,
That is, the library procedure make_vallist
(B) Insert a call (corresponding to the processing of step 405 in FIG. 5). An array b that is indirectly referenced is given as an argument. In step 104, the statement for exchanging the value list, that is, the library procedure exchang
Insert a call to e_vallist () (corresponding to the processing of step 406 in FIG. 5). Step 10
In 5, the statement in which the assigner executes the substitution for the remote reference, that is, the library procedure remote_
The call of assign (a) (corresponding to the processing of step 407 in FIG. 5) is inserted. The array a to be assigned is given as an argument. These library procedure calls are inserted from the 9th line to the 12th line in the post-parallelization program of FIG. In addition, ep1, e in the third line of FIG.
p2 is a variable representing the range of iterations assigned to each processor, and a different value is set for each processor. Further, the range of the array assigned to each processor is actually from ep1 to ep2, but in FIG. 4, the size of the array in the declaration statement on the first and second lines is left as 10,000 for simplification.

【0016】以上で、本発明による間接参照ループの並
列化方法の説明を終わる。なお、本実施例および以後の
実施例では、並列化後プログラムをソースプログラムの
形式で示すが、本発明は並列化後プログラムがオブジェ
クトプログラム形式である場合でも同様に適用できる。
また、本実施例および以後の実施例では、並列化前プロ
グラムの例として図3のような逐次処理プログラムを用
いるが、並列化前プログラムが共有メモリ型並列計算機
用プログラムである場合でも、本発明は同様に適用でき
る。また、本実施例および以後の実施例では、1次元配
列および1重ループの場合を例として述べたが、多次元
配列や多重ループの場合でも同様に並列化できる。
This concludes the description of the method for parallelizing an indirect reference loop according to the present invention. In the present embodiment and the following embodiments, the post-parallelization program is shown in the form of the source program, but the present invention can be similarly applied even when the post-parallelization program is in the object program form.
Further, in the present embodiment and the subsequent embodiments, the serial processing program as shown in FIG. 3 is used as an example of the pre-parallelization program, but even when the pre-parallelization program is a shared memory type parallel computer program, the present invention Are applicable as well. Further, in the present embodiment and the following embodiments, the case of the one-dimensional array and the single loop has been described as an example, but the multi-dimensional array and the multiple loop can be similarly parallelized.

【0017】次に本発明の別の実施例として、代入文の
左辺に間接参照があるループの並列実行方法および並列
化方法について説明する。図9に左辺に間接参照がある
ループの一例を示す。ループ内の代入文の左辺の配列a
の添字が配列pになっている。このループでは、異なる
iに対してp[i]が同じ値を取ったときに、異なるイ
タレーションが配列aの同一の要素を書き換える。それ
らのうち、最後のイタレーションによって書かれた値の
みがループ終了後の値として残る。例えば、a[p
[2]]=b[2]でp[2]=12であり、a[p
[6]]=b[6]でp[6]=12であったとする
と、a[12]の値としてはb[6]が残る。このルー
プを並列実行する場合は、ループ終了後の各配列要素が
逐次実行のときと同じ値を持つようにしなければならな
い。本発明の並列実行方法では、上記の問題を解決する
ために、左辺配列aと同じサイズの整数配列を新たに設
ける。この配列を「最終イタレーション配列」と呼ぶ。
最終イタレーション配列の各要素は、左辺配列aと同様
に各プロセッサに割り当てる。各要素は、配列aの対応
する要素を最後に書き換えたイタレーションのインデッ
クス(上記の例では6になる)を保持する。
Next, as another embodiment of the present invention, a parallel execution method and a parallelization method of a loop having an indirect reference on the left side of an assignment statement will be described. FIG. 9 shows an example of a loop having an indirect reference on the left side. Array a on the left side of the assignment statement in the loop
Has a subscript of array p. In this loop, when p [i] takes the same value for different i, different iterations rewrite the same element of array a. Among them, only the value written by the last iteration remains as the value after the loop ends. For example, a [p
[2]] = b [2], p [2] = 12, and a [p
If [6]] = b [6] and p [6] = 12, b [6] remains as the value of a [12]. When executing this loop in parallel, each array element after the end of the loop must have the same value as in serial execution. In the parallel execution method of the present invention, in order to solve the above problem, an integer array having the same size as the left side array a is newly provided. This array is called the "final iteration array".
Each element of the final iteration array is assigned to each processor similarly to the left side array a. Each element holds the index of the iteration in which the corresponding element of the array a was last rewritten (6 in the above example).

【0018】図11は、図9の間接参照ループの本発明
による並列実行方法の手順を示すフロートチャートであ
る。ステップ420で、最終イタレーション配列の各要
素に初期値を設定する。初期値は、イタレーションイン
デックスの最小値より1少ない値とする。図9のループ
の場合は初期値として−1を設定する。ステップ421
は自身に割り当てられたイタレーションのうち、未処理
のものがまだあるかどうかの判定である。未処理のイタ
レーションがあればステップ422に進み、以下、その
イタレーションについての処理を行う。ステップ422
で間接参照a[p[i]]がlocal参照かremo
te参照かを判定する。もしlocal参照ならばステ
ップ423に進み、remote参照ならばステップ4
25に進む。ステップ423でlocal参照について
の代入を実行する。代入を実行したイタレーションにつ
いては、ステップ424でそのインデックスiを最終イ
タレーション配列に記録する。ステップ425ではre
mote参照についての代入情報を「代入リスト」に登
録する。ここで登録する代入情報とは、要素a[p
[i]]の所有者のプロセッサ番号、所有者インデック
スp[i]の値、参照者インデックスiの値、および右
辺配列要素b[i]の値である。
FIG. 11 is a float chart showing the procedure of the parallel execution method of the present invention for the indirect reference loop of FIG. At step 420, an initial value is set for each element of the final iteration array. The initial value is one less than the minimum value of the iteration index. In the case of the loop of FIG. 9, -1 is set as the initial value. Step 421
Is a judgment as to whether or not there are still unprocessed iterations assigned to itself. If there is an unprocessed iteration, the process proceeds to step 422, and the process for that iteration is performed. Step 422
And indirect reference a [p [i]] is a local reference or remo
It is determined whether it is a te reference. If it is a local reference, proceed to step 423, and if it is a remote reference, step 4
Go to 25. In step 423, the substitution for the local reference is executed. For the iteration for which substitution has been performed, the index i is recorded in the final iteration array in step 424. In step 425, re
The substitution information about the mote reference is registered in the "substitution list". The substitution information registered here is the element a [p
[I]] is the processor number of the owner, the value of the owner index p [i], the value of the referencer index i, and the value of the right side array element b [i].

【0019】ここで代入リストの構造を説明する。図1
2に代入リストの構造を示す。位置リストなどと同様
に、所有者ごとにエントリを持つヘッダ520と、その
各エントリからポインタでつながるリスト本体521に
よって構成される。リスト本体521は3個のフィール
ド524,525,および526から成り、各フィール
ドは、右辺の配列要素b[i]の値、所有者インデック
スp[i]、参照者インデックスiを表す。例えば、図
12の代入リストの一番最初の項目(斜線部分)は、プ
ロセッサ4番の持つ配列要素a[35]に対して、イタ
レーション3番によって26.5という値が代入される
べきことを表している。
Here, the structure of the substitution list will be described. Figure 1
2 shows the structure of the substitution list. Similar to the position list, the header 520 has an entry for each owner, and a list body 521 connected from each entry with a pointer. The list body 521 includes three fields 524, 525, and 526, and each field represents the value of the array element b [i] on the right side, the owner index p [i], and the referencer index i. For example, the first item (hatched part) of the substitution list in FIG. 12 is that the value of 26.5 should be substituted by the iteration number 3 for the array element a [35] of the processor number 4. Is represented.

【0020】図11に戻って、ステップ421で未処理
のイタレーションがもうなければステップ426に進
み、以下、代入リストに基づいてremote参照の後
処理をする。ステップ426では、全プロセッサ間で代
入リストを交換する。この交換により、各プロセッサ
は、自身が所有者であるようなremote参照につい
ての代入リストを持つようになる。代入リストのリスト
本体521の各エントリについて、ステップ427から
ステップ430の処理を行う。ステップ427は、リス
ト本体521に未処理のエントリがあるかどうかの判定
である。未処理のエントリがなければ並列実行は終了で
ある。未処理のエントリがあればステップ428に進
み、以下、そのエントリについての処理を行う。ステッ
プ428では、エントリ内の参照者インデックス526
と、エントリ内の所有者インデックス525に対応する
最終イタレーション配列の要素値と、を比較する。例え
ば、エントリ内の参照者インデックスがi=2であり、
所有者インデックスがp[2]=12であり、最終イタ
レーション配列lastにおいてlast[12]=6
であったとしたとき、2と6を比較する。もし前者が後
者以下ならば、代入リストのエントリは、最終イタレー
ション配列に記録されているイタレーションより前のイ
タレーションによる代入を表している。したがって、こ
の代入は実行してはならず、ステップ427にもどって
次のエントリの処理を行う。例えば、エントリ内の参照
者インデックスがi=2であり、所有者インデックスが
p[2]=12であり、最終イタレーション配列las
tにおいてlast[12]=6であったとしたとき、
2(前者)<6(後者)なので、代入は実行しない。も
し前者が後者より大きければ、ステップ429に進む。
ステップ429ではremote参照による代入を実行
する。例えば、エントリ内の参照者インデックスがi=
6であり、所有者インデックスがp[6]=12であ
り、最終イタレーション配列lastにおいてlast
[12]=2であったとしたとき、6(前者)>2(後
者)なので、代入を実行する。すなわち、代入リストエ
ントリの値フィールド524の内容を、所有者インデッ
クス525に対応する左辺配列aの要素に代入する。ま
たステップ430で、所有者インデックス525に対応
する最終イタレーション配列の要素に、参照者インデッ
クス526を代入する。
Returning to FIG. 11, if there are no unprocessed iterations in step 421, the process proceeds to step 426, and thereafter, post-processing of remote reference is performed based on the substitution list. In step 426, the substitution lists are exchanged among all the processors. This exchange causes each processor to have an assignment list for remote references that it owns. The processing from step 427 to step 430 is performed for each entry in the list body 521 of the substitution list. Step 427 is a determination as to whether or not there is an unprocessed entry in the list body 521. If there is no unprocessed entry, the parallel execution ends. If there is an unprocessed entry, the process proceeds to step 428, and the process for that entry is performed. At step 428, referrer index 526 in the entry.
And the element value of the final iteration array corresponding to the owner index 525 in the entry. For example, if the referrer index in the entry is i = 2,
The owner index is p [2] = 12, and last [12] = 6 in the final iteration array last.
Then, 2 and 6 are compared. If the former is less than or equal to the latter, the entry in the substitution list represents substitution by an iteration before the iteration recorded in the final iteration array. Therefore, this substitution should not be executed, and the process returns to step 427 to process the next entry. For example, the reference index in the entry is i = 2, the owner index is p [2] = 12, and the final iteration array las
When last [12] = 6 at t,
Since 2 (the former) <6 (the latter), the substitution is not executed. If the former is larger than the latter, proceed to step 429.
In step 429, substitution by remote reference is executed. For example, if the referrer index in the entry is i =
6, the owner index is p [6] = 12, and last is in the last iteration array last.
If [12] = 2, then 6 (the former)> 2 (the latter), so the substitution is executed. That is, the content of the value field 524 of the assignment list entry is assigned to the element of the left side array a corresponding to the owner index 525. In step 430, the referencer index 526 is assigned to the element of the final iteration array corresponding to the owner index 525.

【0021】次に図13を参照して、左辺に間接参照が
あるループに対する、本発明のプログラム並列化方法の
一実施例の詳細を説明する。本実施例の並列化方法は、
図9の形の間接参照ループを対象とする。すなわち、次
の条件を充たすループを対象とする。 (1)ループの中身は1個の代入文である。 (2)その代入文の両辺はそれぞれ1個の配列要素参照
である。両辺の配列は異なる。 (3)右辺の配列の添字はループイタレーションのイン
デックスiである。 (4)左辺の配列の添字は、別の配列である。すなわ
ち、左辺は間接参照である。 本並列化方法によって、図9の間接参照ループは図10
に示すような並列実行プログラム311に変換される。
図10のプログラムは図に示した並列実行方法を実現す
るものである。以下、図10のプログラム311を参照
しながら、図13の並列化方法の詳細を説明する。ステ
ップ120で、最終イタレーション配列lastの宣言
文を挿入する。図10では3行目がその宣言文である。
また、ステップ121で、間接参照ループの直前に最終
イタレーション配列lastの初期化文を挿入する。図
10では4行目のライブラリ手続きinitializ
e()(図11のステップ420の処理に対応する)の
呼び出しが、その初期化文である。手続きの引数は、初
期化される配列lastと初期値−1である。ステップ
122でプログラムのループ内の代入文の前に、間接参
照がlocal参照かremote参照かを判定する文
を挿入する。図10では6行目に相当する。9行目のe
lseも本ステップで挿入する。ステップ123で、イ
タレーションインデックスを最終イタレーション配列に
記録する文を、elseの前、すなわちlocal参照
の場合に実行される部分に挿入する。図の8行目がその
文である。ステップ124で、remote参照につい
ての代入情報を代入リストに登録する文を、elseの
後、すなわちremote参照の場合に実行される部分
に挿入する。図10の10行目にあるput_asgn
info()というライブラリ手続き(図11のステッ
プ425の処理に対応する)の呼び出しが、その登録文
である。手続きの引数は、登録する情報、すなわち、所
有者プロセッサ番号owner(p[i])、所有者イ
ンデックスp[i]、参照者インデックスi、および右
辺配列要素b[i]である。ステップ125からステッ
プ126で、ループの後にremote参照の後処理を
行う文を挿入する。ステップ125では、代入リストを
交換する文、すなわち、ライブラリ手続きexchan
ge_asgnlist()(図11のステップ426
の処理に対応する)の呼び出しを挿入する。図10では
12行目に挿入されている。ステップ126では、所有
者側でremote参照の代入を実行する文、すなわ
ち、ライブラリ手続きremote_assign_1
(a)の呼び出しを挿入する。引数として、代入先の配
列aを与えている。図10では13行目に挿入されてい
る。このライブラリは、図11のステップ427からス
テップ430の処理を実行する。すなわち、代入リスト
の各エントリにつき、参照者インデックスと最終イタレ
ーション配列の要素値を比較して、前者が後者より大き
い場合にのみ代入を実行する。また、代入を実行したと
きには最終イタレーション配列にインデックスを記録す
る。以上で、本発明による左辺間接参照ループの並列化
方法の説明を終わる。
Next, referring to FIG. 13, details of an embodiment of the program parallelizing method of the present invention for a loop having an indirect reference on the left side will be described. The parallelization method of this embodiment is
The indirect reference loop of the form shown in FIG. 9 is targeted. That is, the loop that satisfies the following conditions is targeted. (1) The content of the loop is one assignment statement. (2) Each side of the assignment statement is one array element reference. The arrangement on both sides is different. (3) The subscript of the array on the right side is the loop iteration index i. (4) The subscript of the array on the left side is another array. That is, the left side is an indirect reference. With this parallelization method, the indirect reference loop of FIG.
Is converted into a parallel execution program 311 as shown in FIG.
The program of FIG. 10 realizes the parallel execution method shown in the figure. Hereinafter, the details of the parallelization method in FIG. 13 will be described with reference to the program 311 in FIG. In step 120, the declaration statement of the final iteration array last is inserted. In FIG. 10, the third line is the declaration statement.
In step 121, the initialization statement of the final iteration array last is inserted immediately before the indirect reference loop. In FIG. 10, the library procedure initialize on the fourth line
The call of e () (corresponding to the processing of step 420 in FIG. 11) is the initialization statement. The arguments of the procedure are the array last to be initialized and the initial value -1. In step 122, a statement that determines whether the indirect reference is a local reference or a remote reference is inserted before the assignment statement in the loop of the program. In FIG. 10, it corresponds to the sixth line. E on the 9th line
lse is also inserted in this step. In step 123, the statement that records the iteration index in the final iteration array is inserted before the else, that is, in the portion executed in the case of the local reference. The 8th line of the figure is the sentence. In step 124, a statement for registering the substitution information about the remote reference in the substitution list is inserted after the else, that is, in the portion executed in the case of the remote reference. Put_asgn in line 10 of FIG.
The call of the library procedure called info () (corresponding to the processing of step 425 in FIG. 11) is the registration statement. The procedure argument is the information to be registered, that is, the owner processor number owner (p [i]), the owner index p [i], the referencer index i, and the right side array element b [i]. In steps 125 to 126, a statement for post-processing the remote reference is inserted after the loop. In step 125, a statement for exchanging the substitution list, that is, the library procedure exchan
ge_asgnlist () (step 426 of FIG. 11)
(Corresponding to the processing of)) is inserted. In FIG. 10, it is inserted in the 12th line. In step 126, the owner side executes a statement to execute the remote reference assignment, that is, the library procedure remote_assign_1.
Insert the call of (a). The array a to be assigned is given as an argument. In FIG. 10, it is inserted in the 13th line. This library executes the processing from step 427 to step 430 in FIG. That is, for each entry in the substitution list, the reference index and the element value of the final iteration array are compared, and substitution is executed only when the former is larger than the latter. When the substitution is executed, the index is recorded in the final iteration array. This is the end of the description of the method of parallelizing the left indirect reference loop according to the present invention.

【0022】次に本発明のまた別の実施例として、加算
代入文(意味は後述)の左辺に間接参照がある場合の並
列実行方法および並列化方法について説明する。本実施
例が対象とするループは次の条件を充たすものである。 (1)ループの中身は1個の加算代入文である。 (2)その代入文の両辺はそれぞれ1個の配列要素参照
である。両辺の配列は異なる。 (3)右辺の配列の添字はループイタレーションのイン
デックスiである。 (4)左辺の配列の添字は、別の配列である。すなわ
ち、左辺は間接参照である。 図14に本実施例が対象とするループの一例を示す。4
行目が加算代入文である。それに含まれる加算代入演算
子’+=”は、左辺の要素に右辺の要素を足し込むこと
を表している。すなわち、a[p[i]]=a[p
[i]]+b[i]と同等である。このループのように
配列要素に値を次々に足し込んでいく処理は、数値計算
プログラムで頻繁に現われる。したがってこのループの
並列実行は、現実に非常に重要である。
Next, as another embodiment of the present invention, a parallel execution method and a parallelization method in the case where there is an indirect reference on the left side of an addition assignment statement (the meaning of which will be described later) will be described. The loop targeted by this embodiment satisfies the following conditions. (1) The content of the loop is one addition assignment statement. (2) Each side of the assignment statement is one array element reference. The arrangement on both sides is different. (3) The subscript of the array on the right side is the loop iteration index i. (4) The subscript of the array on the left side is another array. That is, the left side is an indirect reference. FIG. 14 shows an example of a loop targeted by this embodiment. Four
The line is an addition assignment statement. The addition assignment operator '+ =' included in it indicates that the element on the right side is added to the element on the left side, that is, a [p [i]] = a [p.
It is equivalent to [i] + b [i]. The process of adding values to array elements one after another like this loop frequently appears in a numerical calculation program. Therefore parallel execution of this loop is very important in reality.

【0023】この形のループを並列実行する場合、加算
の交換結合法則が利用できるので、各イタレーションの
実行順序は任意で良い。そのため、前の実施例と違っ
て、最終イタレーション配列が必要ない。また、代入リ
ストの本体の参照者インデックスも必要ない。同様のこ
とは、代入演算子に含まれる演算が乗算などの場合にも
成り立つ。このループの並列実行方法は、基本的には図
11に示したものと同じであるが、上記の理由により、
多くのステップが省略できる。省略できるのは、ステッ
プ420の最終イタレーション配列の初期化、ステップ
424およびステップ430の最終イタレーション配列
へのインデックスの記録、ステップ428のインデック
スの大小判定である。このループの並列化方法も、基本
的に図13に示したものと同じであるが、いくつかのス
テップが省略できる。省略できるのは、ステップ120
の最終イタレーション配列の宣言文の挿入、ステップ1
21の最終イタレーション配列の初期化文の挿入、ステ
ップ123のインデックス記録文の挿入である。
When this type of loop is executed in parallel, the exchange coupling law of addition can be used, so the order of execution of each iteration may be arbitrary. Therefore, unlike the previous embodiment, no final iteration sequence is needed. Also, the referrer index of the body of the substitution list is not necessary. The same holds true when the operation included in the assignment operator is multiplication or the like. The parallel execution method of this loop is basically the same as that shown in FIG. 11, but for the above reason,
Many steps can be omitted. What can be omitted is initialization of the final iteration array in step 420, recording of indexes in the final iteration array in steps 424 and 430, and determination of the size of the index in step 428. The method for parallelizing the loop is basically the same as that shown in FIG. 13, but some steps can be omitted. Step 120 can be omitted.
Insert final iteration array declaration statement, step 1
The initialization statement of the final iteration array 21 is inserted, and the index recording statement of step 123 is inserted.

【0024】図15は、本並列化方法によって、図14
の間接参照ループを並列化した並列実行プログラムであ
る。前実施例の図10のプログラムと比較して、最終イ
タレーション配列に関する文がなくなっている。また、
7行目の代入リストへの登録ライブラリput_asg
ninfo_2(図11のステップ425の処理に対応
する)の引数に、参照者インデックスiが含まれていな
い。9行目のexchange_asnglist_2
は参照者インデックスを含まない代入リストを、プロセ
ッサ間で交換するライブラリ手続き(図11のステップ
426の処理に対応する)である。10行目のremo
te_assign_2は、所有者側でremote代
入を実行するライブラリ手続き(図11のステップ42
7,429の処理に対応する)であるが、図10のre
mote_assign_1と違って、図11のステッ
プ428のインデックス比較やステップ430のインデ
ックス記録は含まない。
FIG. 15 shows the result of the parallelization method of FIG.
It is a parallel execution program in which the indirect reference loop of is parallelized. Compared to the program of FIG. 10 of the previous embodiment, the sentence regarding the final iteration array is eliminated. Also,
Registration library put_asg to the substitution list on the 7th line
The referencer index i is not included in the argument of ninfo_2 (corresponding to the processing of step 425 in FIG. 11). Exchange_asnglist_2 on line 9
Is a library procedure (corresponding to the processing of step 426 in FIG. 11) for exchanging an assignment list not including a referrer index between processors. 10th line remo
te_assign_2 is a library procedure for executing remote substitution on the owner side (step 42 in FIG. 11).
(Corresponding to the processing of 7,429), but re in FIG.
Unlike the mote_assign_1, the index comparison in step 428 and the index recording in step 430 in FIG. 11 are not included.

【0025】次に本発明のまた別の実施例として、複数
の文や複数の間接参照を含むループの並列化方法を説明
する。本並列化方法では、そのようなループを、これま
で述べてきた1個の間接参照を含むループの組み合わせ
に変換してから、並列化するものである。本実施例の並
列化方法は、次の条件を充たすループを対象とする。 (1)ループ内に代入文または加算代入文のみを含む。
文が複数個あってもよい。 (2)ループ内に間接参照が1個以上ある。 (3)ループ外への制御の飛び出しやループ内への制御
の飛び込みがない。 (4)各代入文の右辺は配列要素かスカラ変数から構成
される式である。 (5)間接参照の添字配列は、ループ内で定義されな
い。 (6)代入文の左辺に現われる間接参照配列が、ループ
内のそれ以外の個所で参照されていない。 この条件を充たすループを以下では、「一般間接参照ル
ープ」と呼ぶ。また、これまでの実施例で対象としてい
たループを「基本間接参照ループ」と呼ぶ。本実施例で
は簡単のために、ループのインデックスは0から始まり
1ずつ増えるものとするが、そうでない場合でも同様の
方法が適用できる。図16に本並列化方法の対象となる
ループの一例を示す。
Next, as another embodiment of the present invention, a method for parallelizing a loop including a plurality of statements and a plurality of indirect references will be described. In this parallelization method, such a loop is converted into a combination of loops including one indirect reference described above, and then parallelized. The parallelization method of the present embodiment targets a loop that satisfies the following conditions. (1) Only an assignment statement or addition assignment statement is included in the loop.
There may be multiple sentences. (2) There is at least one indirect reference in the loop. (3) No control jumps out of the loop or jumps in the loop. (4) The right side of each assignment statement is an expression composed of array elements or scalar variables. (5) An indirect reference subscript array is not defined in the loop. (6) The indirect reference array appearing on the left side of the assignment statement is not referenced anywhere else in the loop. Hereinafter, a loop satisfying this condition will be referred to as a "general indirect reference loop". Further, the loop targeted in the above embodiments is called a "basic indirect reference loop". In the present embodiment, the loop index starts from 0 and increases by 1 for simplification, but the same method can be applied to other cases. FIG. 16 shows an example of a loop which is the target of this parallelization method.

【0026】図18は、本実施例の並列化方法の手順を
表す。図18のステップ140からステップ145まで
によって、図16の一般間接参照ループ330は図17
に示すような基本間接参照ループの組み合わせ331に
分解される。
FIG. 18 shows the procedure of the parallelization method of this embodiment. As a result of the steps 140 to 145 of FIG. 18, the general indirect reference loop 330 of FIG.
Is decomposed into a combination 331 of basic indirect reference loops.

【0027】以下、図16,17のプログラム330,
331を参照しながら、図18の並列化方法の詳細を説
明する。ループ内の各間接参照について、ステップ14
0からステップ145の処理を行う。ステップ140
は、元のループ内に間接参照があるかどうかの判定であ
る。間接参照がなければ元のループは既に分解されたの
でステップ146に進む。間接参照があればステップ1
41に進み、以下、その間接参照についての処理を行
う。ステップ141で間接参照の値を保持するための一
時配列を生成する。一時配列のサイズはループのイタレ
ーションの数とし、型は間接参照配列の型とする。この
一時配列を以下では_tmp[]と書く。ステップ14
2で間接参照が右辺にあるか左辺にあるかを判定する。
右辺ならばステップ143に進み、左辺ならばステップ
144に進む。ステップ143で、元のループの前に次
の基本間接参照ループを挿入する。 for(i=...) _tmp[i]=間接参照; ここでiはループの制御変数を表す。例えば、図16の
2行目の間接参照b[q[i]]に対して、図17の
1,2行目のループを挿入し、図16の3行目の間接参
照e[t[i]]に対して、図の3,4行目の基本間接
参照ループを挿入する。ステップ144で、元のループ
の後に次の基本間接参照ループを挿入する。 for(i) 間接参照=_tmp[i]; 元の代入文に加算代入演算子’+=’が用いられていれ
ば、挿入した基本間接参照ループの代入文にも’+=’
を用いる。例えば、図16の2行目の間接参照a[p
[i]]に対して、図17の9,10行目のループを挿
入し、図16の3行目の間接参照d[s[i]]に対し
て、図17の11,12行目の基本間接参照ループを挿
入する。ステップ145で、元のループ内の間接参照
を、一時配列の参照_tmp[i]で置き換える。もし
も間接参照が左辺にあるならば、それに対する代入演算
子が何であっても、’=’に置き換える。このステップ
145により、図16の元のループは、図17の5行目
から8行目のように変換される。ステップ145までの
変換により、元のループ内から間接参照は消去され、代
わりにステップ143,145で間接参照ループが生成
された。生成されたループは以前の実施例で対象とした
基本間接参照ループであり、前述の方法で並列化でき
る。ステップ146では、生成された基本間接参照ルー
プの各々に対して、前述の方法に従って並列化を行う。
以上で、複数の間接参照を含むループの並列化が終了し
た。
Hereinafter, the program 330 of FIGS.
The details of the parallelization method in FIG. 18 will be described with reference to FIG. Step 14 for each indirect reference in the loop
The processing from 0 to step 145 is performed. Step 140
Is a determination of whether there is an indirect reference in the original loop. If there is no indirect reference, the original loop has already been decomposed, so the process proceeds to step 146. Step 1 if there is an indirect reference
In step 41, the process for the indirect reference is performed. In step 141, a temporary array for holding the indirect reference value is generated. The size of the temporary array is the number of loop iterations, and the type is the type of the indirect reference array. Hereinafter, this temporary array will be referred to as _tmp []. Step 14
In step 2, it is determined whether the indirect reference is on the right side or the left side.
If it is the right side, the process proceeds to step 143, and if it is the left side, the process proceeds to step 144. In step 143, the next basic dereference loop is inserted before the original loop. for (i = ...) _ tmp [i] = indirect reference; where i represents a control variable of the loop. For example, the loop of the first and second lines of FIG. 17 is inserted into the indirect reference b [q [i]] of the second line of FIG. 16, and the indirect reference e [t [i of the third line of FIG. 16 is inserted. ]]], The basic indirect reference loop of the 3rd and 4th lines of the figure is inserted. In step 144, insert the next basic dereference loop after the original loop. for (i) indirect reference = _tmp [i]; If the addition assignment operator '+ =' is used in the original assignment statement, '+ =' is also included in the assignment statement of the inserted basic indirect reference loop.
To use. For example, indirect reference a [p in the second line of FIG.
The loop of the 9th and 10th lines of FIG. 17 is inserted into [i], and the 11th and 12th lines of FIG. 17 are inserted into the indirect reference d [s [i]] of the 3rd line of FIG. Insert the basic dereference loop of. In step 145, the indirect reference in the original loop is replaced with the temporary array reference _tmp [i]. If the indirection is on the left, replace it with '=', whatever the assignment operator for it. By this step 145, the original loop of FIG. 16 is transformed as in the fifth to eighth lines of FIG. By the conversion up to step 145, the indirect reference is deleted from the original loop, and instead, the indirect reference loop is generated in steps 143 and 145. The generated loop is the basic indirect reference loop targeted in the previous embodiment and can be parallelized in the manner described above. In step 146, parallelization is performed on each of the generated basic indirect reference loops according to the method described above.
With the above, parallelization of a loop including a plurality of indirect references is completed.

【0028】図19に本発明の並列化方法を実行する並
列化コンパイラ6の構成を示す。並列化コンパイラ6
は、構文解析部60、一般間接参照ループ分解部61、
基本間接参照ループ並列化部62、通常ループ並列化部
63、コード生成部64を含む。一般間接参照ループ分
解部61には、一時配列生成部610、基本間接参照ル
ープ生成部611、間接参照置換部612が含まれる。
基本間接参照ループ並列化部62には、remote/
local判定文挿入部620、情報登録文挿入部62
1、リスト交換文挿入部622、remote代入実行
文挿入部623、値リスト作成文挿入部624、最終イ
タレーション配列生成部625が含まれる。構文解析部
60は、並列化前プログラム30を読み込んで、中間語
70を生成する。中間語70はコンパイラ内部でのプロ
グラムの表現であり、その形式は通常のコンパイラの場
合と特に変わらないので、ここでは詳細には述べない。
FIG. 19 shows the configuration of the parallelizing compiler 6 that executes the parallelizing method of the present invention. Parallelizing compiler 6
Is a syntactic analysis unit 60, a general indirect reference loop decomposition unit 61,
The basic indirect reference loop parallelization unit 62, the normal loop parallelization unit 63, and the code generation unit 64 are included. The general indirect reference loop decomposition unit 61 includes a temporary array generation unit 610, a basic indirect reference loop generation unit 611, and an indirect reference replacement unit 612.
The basic indirect reference loop parallelization unit 62 includes remote /
Local determination sentence insertion unit 620, information registration sentence insertion unit 62
1, a list exchange statement insertion unit 622, a remote assignment execution statement insertion unit 623, a value list creation statement insertion unit 624, and a final iteration array generation unit 625. The syntax analysis unit 60 reads the pre-parallelization program 30 and generates an intermediate word 70. The intermediate language 70 is the expression of the program inside the compiler, and its format is not particularly different from that of the case of a normal compiler, so it will not be described in detail here.

【0029】一般間接参照ループ分解部61は、図18
のステップ140からステップ145までの処理を行
う。すなわち、一般間接参照ループを基本間接参照ルー
プの組み合わせに分解する。その中で、一時配列生成部
610は図18のステップ141の処理を行う。すなわ
ち、元のループ内の間接参照に対して、一時配列を生成
する。また、基本間接参照ループ生成部611は、図1
8のステップ143およびステップ144の処理を行
う、すなわち、間接参照が右辺か左辺かに応じて、元の
ループの前または後に基本間接参照ループを生成する。
間接参照置換部612は図18のステップ145の処理
を行う。すなわち、元のループ内の間接参照を、一時配
列生成部610が生成した一時配列の参照に置換する。
The general indirect reference loop decomposition unit 61 is shown in FIG.
The processing from step 140 to step 145 is performed. That is, the general indirect reference loop is decomposed into a combination of basic indirect reference loops. Among them, the temporary array generation unit 610 performs the process of step 141 of FIG. That is, a temporary array is generated for the indirect reference in the original loop. In addition, the basic indirect reference loop generation unit 611 is
8. Steps 143 and 144 are performed, that is, a basic indirect reference loop is generated before or after the original loop depending on whether the indirect reference is the right side or the left side.
The indirect reference replacement unit 612 performs the process of step 145 of FIG. That is, the indirect reference in the original loop is replaced with the reference of the temporary array generated by the temporary array generation unit 610.

【0030】基本間接参照ループ並列化部62は、図1
8のステップ146の処理を行う。すなわち、基本間接
参照ループの種類に応じて、図1および図13に示した
並列化を行う。その中で、remote/local判
定文挿入部620は、図1のステップ100および図1
3のステップ122の処理を行う。すなわち、間接参照
がremote参照かlocal参照か判定する文をル
ープ内に挿入する。また、情報登録文挿入部621は図
1のステップ101および図13のステップ124の処
理を行う。すなわち、位置リストや代入リストに情報を
登録する文をループ内に挿入する。リスト交換文挿入部
622は図1のステップ102および図13のステップ
125の処理を行う。すなわち、位置リストや代入リス
トをプロセッサ間で交換する文をプログラムに挿入す
る。remote代入実行文挿入部623は図1のステ
ップ105および図13のステップ126の処理を行
う。すなわち、交換したリストを用いてremote参
照についての代入を実行する文を挿入する。値リスト作
成文挿入部624は図1のステップ103の処理を行
う。すなわち、右辺間接参照ループに対して、値リスト
を作成する文を位置リスト交換文の後に挿入する。最終
イタレーション配列生成部625は図13のステップ1
20とステップ121の処理を行う。すなわち、左辺間
接参照ループに対して、最終イタレーション配列の宣言
文や初期化文を挿入する。通常ループ並列化部63は間
接参照ループでないループの並列化を行う。またコード
生成部64は中間語70を読み込んで並列化後プログラ
ム31を生成する。これらの処理の内容は従来の並列化
コンパイラの場合と特に変わらないので、ここでは詳細
は述べない。
The basic indirect reference loop parallelization unit 62 is shown in FIG.
The process of step 146 of 8 is performed. That is, the parallelization shown in FIGS. 1 and 13 is performed according to the type of the basic indirect reference loop. Among them, the remote / local determination sentence insertion unit 620 uses the step 100 of FIG.
The process of step 122 of 3 is performed. That is, a statement that determines whether the indirect reference is a remote reference or a local reference is inserted into the loop. Further, the information registration statement insertion unit 621 performs the processing of step 101 of FIG. 1 and step 124 of FIG. That is, a statement that registers information in the position list or the substitution list is inserted in the loop. The list exchange statement insertion unit 622 performs the processing of step 102 of FIG. 1 and step 125 of FIG. That is, a statement for exchanging the position list and the substitution list between the processors is inserted into the program. The remote assignment execution statement inserter 623 performs the processing of step 105 of FIG. 1 and step 126 of FIG. That is, using the exchanged list, a statement for performing substitution for a remote reference is inserted. The value list creation sentence inserting unit 624 performs the process of step 103 of FIG. That is, the statement that creates the value list is inserted after the position list exchange statement in the right side indirect reference loop. The final iteration array generation unit 625 uses step 1 of FIG.
20 and the processing of step 121 are performed. That is, the declaration statement and the initialization statement of the final iteration array are inserted into the indirect reference loop on the left side. The normal loop parallelization unit 63 parallelizes a loop that is not an indirect reference loop. Further, the code generator 64 reads the intermediate word 70 and generates the post-parallelization program 31. Since the contents of these processes are not particularly different from the case of the conventional parallelizing compiler, the details will not be described here.

【0031】[0031]

【発明の効果】本発明によれば、一般的な間接参照ルー
プのプログラムを分散メモリ型並列計算機用に並列化す
ることができる。また、間接参照が左辺にある場合の間
接参照ループのプログラムを分散メモリ型並列計算機用
に並列化することができる。また、分散メモリ型並列計
算機において、一般的な間接参照ループを並列実行する
ことができる。また、分散メモリ型並列計算機におい
て、間接参照が左辺にある場合の間接参照ループを並列
実行することができる。
According to the present invention, a general indirect reference loop program can be parallelized for a distributed memory parallel computer. Further, the program of the indirect reference loop when the indirect reference is on the left side can be parallelized for the distributed memory parallel computer. Further, in a distributed memory type parallel computer, a general indirect reference loop can be executed in parallel. Further, in the distributed memory type parallel computer, the indirect reference loop when the indirect reference is on the left side can be executed in parallel.

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

【図1】本発明による間接参照ループの並列化方法の一
実施例のフローチャートを示す図である。
FIG. 1 is a diagram showing a flowchart of an embodiment of a method for parallelizing an indirect reference loop according to the present invention.

【図2】本発明の並列化方法によって並列化されたプロ
グラムを実行する分散メモリ型並列計算機の構成例を示
す図である。
FIG. 2 is a diagram showing a configuration example of a distributed memory parallel computer that executes a program parallelized by the parallelization method of the present invention.

【図3】並列化前の右辺間接参照ループの例を示す図で
ある。
FIG. 3 is a diagram illustrating an example of a right-side indirect reference loop before parallelization.

【図4】図3の間接参照ループに対して、図1の並列化
方法を適用した結果の間接参照ループを示す図である。
4 is a diagram showing an indirect reference loop as a result of applying the parallelization method of FIG. 1 to the indirect reference loop of FIG.

【図5】本発明による右辺間接参照ループの並列実行方
法の一実施例のフローチャートを示す図である。
FIG. 5 is a diagram showing a flowchart of an embodiment of a parallel execution method of a right side indirect reference loop according to the present invention.

【図6】図5の並列実行方法で使用する位置リストの構
造を示す図である。
6 is a diagram showing a structure of a position list used in the parallel execution method of FIG.

【図7】図5の並列実行方法で使用する値リストの構造
を示す図である。
7 is a diagram showing the structure of a value list used in the parallel execution method of FIG.

【図8】図5の並列実行方法を実現する装置の構成例を
示す図である。
8 is a diagram showing a configuration example of an apparatus that realizes the parallel execution method of FIG.

【図9】並列化前の左辺間接参照ループの例を示す図で
ある。
FIG. 9 is a diagram illustrating an example of a left-side indirect reference loop before parallelization.

【図10】図9の左辺間接参照ループに対して、本発明
の並列化方法を適用した結果のプログラムを示す図であ
る。
10 is a diagram showing a program resulting from applying the parallelization method of the present invention to the indirect reference loop on the left side of FIG.

【図11】本発明による左辺間接参照ループの並列実行
方法の一実施例のフローチャートを示す図である。
FIG. 11 is a diagram showing a flowchart of an embodiment of a parallel execution method of a left side indirect reference loop according to the present invention.

【図12】図11の並列実行方法で使用する代入リスト
の構造図を示す図である。
12 is a diagram showing a structure diagram of an assignment list used in the parallel execution method of FIG.

【図13】本発明による左辺間接参照ループの並列化方
法の一実施例のフローチャートを示す図である。
FIG. 13 is a diagram showing a flowchart of an embodiment of a method for parallelizing a left side indirect reference loop according to the present invention.

【図14】並列化前の加算代入間接参照ループの例を示
す図である。
FIG. 14 is a diagram illustrating an example of an addition / substitution indirect reference loop before parallelization.

【図15】図14の加算代入間接参照ループに対して、
本発明の並列化方法を適用した結果のプログラムを示す
図である。
15 is a diagram showing an addition / substitution indirect reference loop of FIG.
It is a figure which shows the program as a result of applying the parallelization method of this invention.

【図16】一般間接参照ループの例を示す図である。FIG. 16 is a diagram showing an example of a general indirect reference loop.

【図17】図16の一般間接参照ループに対して本発明
の方法を適用して、基本間接参照ループの組み合わせに
分解した結果のプログラムを示す図である。
17 is a diagram showing a program as a result of applying the method of the present invention to the general indirect reference loop of FIG. 16 and decomposing it into a combination of basic indirect reference loops.

【図18】本発明による一般間接参照ループの並列化方
法の一実施例のフローチャートを示す図である。
FIG. 18 is a diagram showing a flowchart of an embodiment of a method for parallelizing a general indirect reference loop according to the present invention.

【図19】本発明の間接参照ループ並列化方法を実行す
る並列化コンパイラの例を示す図である。
FIG. 19 is a diagram showing an example of a parallelizing compiler that executes the indirect reference loop parallelizing method of the present invention.

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

22 相互結合ネットワーク 20、201〜20n プロセッサ 21、211〜21n ローカルメモリ 230 演算部 231 remote参照判定部 232 位置情報登録部 233 ネットワーク制御部 234 値リスト作成部 235 remote参照代入部 240 参照者側位置リスト 241 所有者側位置リスト 242 所有者側値リスト 243 参照者側値リスト 500、510、520 ヘッダ 501、511、521 リスト本体 22 Mutual connection network 20, 201 to 20n Processor 21, 211 to 21n Local memory 230 Calculation unit 231 remote reference determination unit 232 Location information registration unit 233 Network control unit 234 Value list creation unit 235 remote reference substitution unit 240 Reference side position list 241 Owner side position list 242 Owner side value list 243 Referencer side value list 500, 510, 520 Header 501, 511, 521 List body

───────────────────────────────────────────────────── フロントページの続き (72)発明者 海永 正博 神奈川県川崎市麻生区王禅寺1099番地 株 式会社日立製作所システム開発研究所内 (72)発明者 斎藤 靖彦 神奈川県川崎市麻生区王禅寺1099番地 株 式会社日立製作所システム開発研究所内 ─────────────────────────────────────────────────── ─── Continuation of front page (72) Masahiro Kainaga, Inventor Masahiro Kainaga 1099, Ozenji, Aso-ku, Kawasaki, Kanagawa, Ltd.Inside Hitachi, Ltd. Systems Development Laboratory (72) Inventor, Yasuhiko Saito, 1099, Ozenji, Aso-ku, Kawasaki, Kanagawa Ceremony company Hitachi Systems Development Laboratory

Claims (20)

【特許請求の範囲】[Claims] 【請求項1】 逐次処理プログラムまたは共有メモリ型
並列計算機用プログラムを分散メモリ型並列計算機プロ
グラムに変換するプログラム並列化方法において、 配列の添字が配列になっている間接参照を含むループに
対して、参照されている配列要素が自プロセッサにある
か他プロセッサにあるかを判定する文を、該間接参照ル
ープ内に挿入するステップと、 参照されている配列要素が他プロセッサにある場合に該
配列要素についての情報をリストに登録する文を、該間
接参照ループ内に挿入するステップと、該リストをプロ
セッサ間で交換するリスト交換文を、該間接参照ループ
の後に挿入するステップと、 該交換されたリストを用いて他プロセッサの配列要素の
値を自プロセッサの配列要素に代入する文を、該リスト
交換文の後に挿入するステップとを含むことを特徴とす
るプログラム並列化方法。
1. A program parallelization method for converting a serial processing program or a shared memory parallel computer program into a distributed memory parallel computer program, wherein a loop including an indirect reference whose array subscript is an array, Inserting a statement in the indirect reference loop to determine whether the referenced array element is in its own processor or another processor, and if the referenced array element is in another processor, the array element Inserting a statement for registering information on the list in the indirect reference loop, inserting a list exchange statement for exchanging the list between processors after the indirect reference loop, and the exchanged statement. Insert a statement that uses the list to assign the value of the array element of another processor to the array element of the local processor after the list exchange statement And a program parallelizing method.
【請求項2】 配列の添字が配列になっている間接参照
ループを分散メモリ型並列計算機で並列実行する方法に
おいて、 参照されている配列要素が自プロセッサにあるか他プロ
セッサにあるかを該間接参照ループ内で判定するステッ
プと、 自プロセッサにある場合に該配列要素への代入をするス
テップと、 他プロセッサにある場合に該配列要素についての情報を
該間接参照ループ内でリストに登録するステップと、 該間接参照ループ終了後に該リストをプロセッサ間で交
換するステップと、 該交換されたリストを用いて他プロセッサの配列要素の
値を自プロセッサの配列要素に代入するステップとを含
むことを特徴とする間接参照ループの並列実行方法。
2. A method for executing an indirect reference loop in which array subscripts are arrays in parallel in a distributed memory parallel computer, in which whether the referenced array element is in its own processor or another processor is indirect. A step of making a decision in a reference loop; a step of assigning to the array element when it is in its own processor; a step of registering information about the array element in a list when it is in another processor in the indirect reference loop And a step of exchanging the list between processors after the end of the indirect reference loop, and a step of substituting an array element value of another processor into an array element of the own processor using the exchanged list. Parallel execution method of indirect reference loop.
【請求項3】 逐次処理プログラムまたは共有メモリ型
並列計算機用プログラムを分散メモリ型並列計算機プロ
グラムに変換するプログラム並列化装置において、 配列の添字が配列になっている間接参照を含むループに
対して、参照されている配列要素が自プロセッサにある
か他プロセッサにあるかを判定する文を、該間接参照ル
ープ内に挿入する手段と、 参照されている配列要素が他プロセッサにある場合に該
配列要素についての情報をリストに登録する文を、該間
接参照ループ内に挿入する手段と、 該リストをプロセッサ間で交換するリスト交換文を、該
間接参照ループの後に挿入する手段と、 該交換されたリストを用いて他プロセッサの配列要素の
値を自プロセッサの配列要素に代入する文を、該リスト
交換文の後に挿入する手段とを備えることを特徴とする
プログラム並列化装置。
3. A program parallelizing apparatus for converting a serial processing program or a shared memory type parallel computer program into a distributed memory type parallel computer program, for a loop including an indirect reference whose array subscript is an array, Means for inserting into the indirect reference loop a statement that determines whether the referenced array element is in its own processor or another processor; and if the referenced array element is in another processor, the array element Means for inserting a statement for registering information on the list in the indirect reference loop, and means for inserting a list exchange statement for exchanging the list between processors after the indirect reference loop, and And a means for inserting a statement that substitutes the value of the array element of another processor into the array element of the own processor using the list, after the list exchange statement. Program parallelizing apparatus, characterized in that it comprises.
【請求項4】 配列の添字が配列になっている間接参照
ループを分散メモリ型並列計算機で並列実行する装置に
おいて、 参照されている配列要素が自プロセッサにあるか他プロ
セッサにあるかを判定する手段と、 自プロセッサにある場合に該配列要素への代入をする手
段と、 他プロセッサにある場合に該配列要素についての情報を
リストに登録する手段と、 該リストをプロセッサ間で交換する手段と、 該交換されたリストを用いて他プロセッサの配列要素の
値を自プロセッサの配列要素に代入する手段とを備える
ことを特徴とする間接参照ループの並列実行装置。
4. An apparatus for executing parallel execution of an indirect reference loop whose array subscript is an array in a distributed memory parallel computer, determines whether the referenced array element is in its own processor or another processor. Means, means for substituting to the array element when it is in its own processor, means for registering information about the array element in a list when it is in another processor, and means for exchanging the list between processors And a means for substituting the array element value of the other processor into the array element of the own processor by using the exchanged list.
【請求項5】 逐次処理プログラムまたは共有メモリ型
並列計算機用プログラムを分散メモリ型並列計算機プロ
グラムに変換するプログラム並列化方法において、 配列の添字が配列になっている間接参照を複数個含むル
ープに対して、該ループを分解して各々が1個の間接参
照を含む複数のループの組み合わせに変換するステップ
と、該分解されたループの各々を請求項1の並列化方法
にしたがって並列化するステップとを含むことを特徴と
するプログラム並列化方法。
5. A program parallelization method for converting a serial processing program or a shared memory parallel computer program into a distributed memory parallel computer program, for a loop including a plurality of indirect references in which array subscripts are arrays. And decomposing the loop to convert a combination of a plurality of loops each including one indirect reference, and parallelizing each of the decomposed loops according to the parallelization method of claim 1. A program parallelization method including:
【請求項6】 請求項5記載のプログラム並列化方法に
おいて、 間接参照ループを分解して各々が1個の間接参照を含む
複数のループの組み合わせに変換するステップは、間接
参照の各々に対して、一時配列を生成するステップと、
該間接参照ループ内の該間接参照を該一時配列の参照に
置換するステップと、該間接参照と該一時配列要素を両
辺に持つ代入文を含む新たなループを、該間接参照ルー
プの前または後に生成するステップとを含むことを特徴
とするプログラム並列化方法。
6. The program parallelization method according to claim 5, wherein the step of decomposing an indirect reference loop and converting it into a combination of a plurality of loops each including one indirect reference is performed for each indirect reference. , Generating a temporary array,
A step of replacing the indirect reference in the indirect reference loop with a reference of the temporary array; and a new loop including an assignment statement having the indirect reference and the temporary array element on both sides, before or after the indirect reference loop. And a step of generating the program.
【請求項7】 逐次処理プログラムまたは共有メモリ型
並列計算機用プログラムを分散メモリ型並列計算機プロ
グラムに変換するプログラム並列化方法において、 配列の添字が配列になっている間接参照が代入文の右辺
に現われるループに対して、参照されている配列要素が
自プロセッサにあるか他プロセッサにあるかを判定する
文を、該間接参照ループ内に挿入するステップと、 他プロセッサにある場合に該配列要素についての位置情
報を位置リストに登録する文を、該間接参照ループ内に
挿入するステップと、 該位置リストをプロセッサ間で交換する位置リスト交換
文を、該間接参照ループの後に挿入するステップと、 該交換された位置リストを用いて、他プロセッサから参
照されている配列要素の値を含む値リストを作成する文
を、該位置リスト交換文の後に挿入するステップと、 該値リストをプロセッサ間で交換する値リスト交換文
を、該値リスト作成文の後に挿入するステップと、 該交換された値リストを用いて他プロセッサの配列要素
の値を自プロセッサの配列要素に代入する文を、該値リ
スト交換文の後に挿入するステップとを含むことを特徴
とするプログラム並列化方法。
7. In a program parallelization method for converting a serial processing program or a shared memory parallel computer program into a distributed memory parallel computer program, an indirect reference in which an array subscript is an array appears on the right side of an assignment statement. For the loop, insert a statement in the indirect reference loop to determine whether the referenced array element is in its own processor or in another processor; Inserting a statement for registering position information in a position list into the indirect reference loop; inserting a position list exchange statement for exchanging the position list between processors after the indirect reference loop; Using the created position list, a statement to create a value list containing the values of the array elements referenced by other processors, Inserting after the position list exchange statement, inserting a value list exchange statement for exchanging the value list between processors after the value list creation statement, and using the exchanged value list for another processor And a statement for substituting the value of the array element into the array element of its own processor, after the value list exchange statement.
【請求項8】 請求項7記載のプログラム並列化方法に
おいて、 位置リストに登録する位置情報は、参照されている配列
要素を所有するプロセッサのプロセッサ番号、該配列要
素のインデックス、該配列要素を参照しているループイ
タレーションのインデックスを含むことを特徴とするプ
ログラム並列化方法。
8. The program parallelization method according to claim 7, wherein the position information registered in the position list refers to the processor number of the processor that owns the array element being referenced, the index of the array element, and the array element. A method for parallelizing a program, which includes an index of a loop iteration being performed.
【請求項9】 配列の添字が配列になっている間接参照
が代入文の右辺に現われるループを分散メモリ型並列計
算機で並列実行する方法において、 参照されている配列要素が自プロセッサにあるか他プロ
セッサにあるかを、該間接参照ループ内で判定するステ
ップと、 自プロセッサにある場合に該配列要素への代入をするス
テップと、 他プロセッサにある場合に該配列要素についての位置情
報を該間接参照ループ内で位置リストに登録するステッ
プと、 該間接参照ループ終了後に該位置リストをプロセッサ間
で交換するステップと、 該交換された位置リストを用いて、他プロセッサから参
照されている配列要素の値を含む値リストを作成するス
テップと、 該値リストをプロセッサ間で交換するステップと、 該交換された値リストを用いて他プロセッサの配列要素
の値を自プロセッサの配列要素に代入するステップとを
含むことを特徴とする、間接参照ループの並列実行方
法。
9. In a method of executing in parallel a loop in which an indirect reference in which an array subscript is an array appears on the right side of an assignment statement in a distributed memory parallel computer, whether the referenced array element is in its own processor or not In the indirect reference loop, it is determined whether it is in a processor, when it is in its own processor, it is assigned to the array element, and when it is in another processor, the position information about the array element is indirect. Registering in a position list in a reference loop, exchanging the position list between processors after the indirect reference loop, and using the exchanged position list, an array element referenced by another processor Creating a list of values containing values, exchanging the list of values between processors, and using the exchanged list of values Characterized in that it comprises a step of substituting the value of the array element processor array element of its own processor, parallel execution method of indirect reference loop.
【請求項10】 請求項9記載の間接参照ループの並列
実行方法において、 位置リストに登録する位置情報は、参照されている配列
要素を所有するプロセッサのプロセッサ番号、該配列要
素のインデックス、該配列要素を参照しているループイ
タレーションのインデックスを含むことを特徴とする間
接参照ループの並列実行方法。
10. The parallel execution method of an indirect reference loop according to claim 9, wherein the position information registered in the position list is the processor number of the processor owning the referenced array element, the index of the array element, and the array. A parallel execution method of an indirect reference loop, characterized by including an index of a loop iteration referencing an element.
【請求項11】 逐次処理プログラムまたは共有メモリ
型並列計算機用プログラムを分散メモリ型並列計算機プ
ログラムに変換するプログラム並列化方法において、 配列の添字が配列になっている間接参照が代入文の左辺
に現われるループに対して、間接参照されている配列の
要素を最後に書き換えたイタレーションのインデックス
を記録する最終イタレーション配列の宣言文をプログラ
ム内に挿入するステップと、 該最終イタレーション配列の初期化文を該間接参照ルー
プの前に挿入するステップと、参照されている配列要素
が自プロセッサにあるか他プロセッサにあるかを判定す
る文を、該間接参照ループ内に挿入するステップと、 最終イタレーション配列にイタレーションインデックス
を記録する文を、該間接参照ループ内に挿入するステッ
プと、 他プロセッサにある場合に該配列要素についての代入情
報を代入リストに登録する文を、該間接参照ループ内に
挿入するステップと、 該代入リストをプロセッサ間で交換する代入リスト交換
文を、該間接参照ループの後に挿入するステップと、 該交換された代入リストを用いて他プロセッサの配列要
素の値を自プロセッサの配列要素に代入する文を、該代
入リスト交換文の後に挿入するステップとを含むことを
特徴とするプログラム並列化方法。
11. In a program parallelization method for converting a serial processing program or a shared memory parallel computer program into a distributed memory parallel computer program, an indirect reference in which an array subscript is an array appears on the left side of an assignment statement. For the loop, insert a declaration statement of the final iteration array that records the index of the iteration in which the elements of the dereferenced array are last rewritten, and an initialization statement for the final iteration array. Is inserted before the indirect reference loop, a statement for determining whether the referenced array element is in its own processor or another processor is inserted in the indirect reference loop, and a final iteration is performed. Insert the statement that records the iteration index into the array in the indirect reference loop. A step of inserting, in the indirect reference loop, a statement for registering the assignment information about the array element in the assignment list when it is in another processor; and an assignment list exchange statement for exchanging the assignment list between the processors. A step of inserting after the substitution list exchange statement, a step of inserting after the indirection reference loop, and a statement for assigning the array element value of another processor to the array element of the own processor using the exchanged substitution list And a program parallelizing method including:
【請求項12】 請求項11記載のプログラム並列化方
法において、 代入リストに登録する代入情報は、参照されている配列
要素を所有するプロセッサのプロセッサ番号、該配列要
素のインデックス、該配列要素を参照しているループイ
タレーションのインデックス、および該配列要素に代入
すべき値を含むことを特徴とするプログラム並列化方
法。
12. The program parallelization method according to claim 11, wherein the assignment information registered in the assignment list refers to a processor number of a processor that owns the array element being referred to, an index of the array element, and the array element. A method for parallelizing a program, which includes an index of a loop iteration being performed and a value to be assigned to the array element.
【請求項13】 配列の添字が配列になっている間接参
照が代入文の左辺に現われるループを分散メモリ型並列
計算機で並列実行する方法において、 配列要素を最後に書き換えたイタレーションのインデッ
クスを記録する最終イタレーション配列を初期化するス
テップと、 参照されている配列要素が自プロセッサにあるか他プロ
セッサにあるかを、該間接参照ループ内で判定するステ
ップと、 自プロセッサにある場合に該配列要素への代入を実行
し、該最終イタレーション配列にイタレーションインデ
ックスを記録するステップと、 他プロセッサにある場合に該配列要素についての代入情
報を、該間接参照ループ内で代入リストに登録するステ
ップと、 該間接参照ループ終了後に該代入リストをプロセッサ間
で交換するステップと、 該交換された代入リストを用いて他プロセッサの配列要
素の値を自プロセッサの配列要素に代入するステップと
を含むことを特徴とする間接参照ループの並列実行方
法。
13. A method of executing in parallel a loop in which an indirect reference in which an array subscript is an array appears on the left side of an assignment statement in a distributed memory parallel computer, records the index of the iteration that rewrites the array element last. Initializing the final iteration array, determining in the indirect reference loop whether the referenced array element is in its own processor or another processor, and if it is in its own processor, the array A step of executing assignment to an element and recording an iteration index in the final iteration array; and a step of registering assignment information about the array element in another indirect reference loop in the assignment list in the indirect reference loop Exchanging the assignment list between processors after the indirect reference loop ends, and the exchanging step. And a step of substituting the array element value of another processor into the array element of the own processor using the assigned assignment list.
【請求項14】 請求項13記載の間接参照ループの並
列実行方法において、 代入リストに登録する代入情報は、参照されている配列
要素を所有するプロセッサのプロセッサ番号、該配列要
素のインデックス、該配列要素を参照しているループイ
タレーションのインデックス、および該配列要素に代入
すべき値を含むことを特徴とする、間接参照ループの並
列実行方法。
14. The parallel execution method for an indirect reference loop according to claim 13, wherein the assignment information registered in the assignment list includes a processor number of a processor which owns the array element being referred to, an index of the array element, and the array. A parallel execution method of an indirect reference loop, characterized by including an index of loop iteration referring to an element and a value to be assigned to the array element.
【請求項15】 請求項13記載の間接参照ループの並
列実行方法において、 交換された代入リストを用いて他プロセッサの配列要素
の値を自プロセッサの配列要素に代入するステップは、
最終イタレーション配列に格納されているインデックス
と代入リスト内のループイタレーションインデックスを
比較するステップと、前者が後者よりも小さいときに、
代入を実行し、かつ、後者を最終イタレーション配列に
格納するステップを含むことを特徴とする間接参照ルー
プの並列実行方法。
15. The parallel execution method of an indirect reference loop according to claim 13, wherein the step of substituting the array element value of another processor with the array element of the other processor by using the exchanged substitution list,
The step of comparing the index stored in the final iteration array with the loop iteration index in the assignment list, and when the former is less than the latter,
A parallel execution method of an indirect reference loop, which comprises the step of executing substitution and storing the latter in a final iteration array.
【請求項16】 配列の添字が配列になっている間接参
照が代入文の左辺に現われるループを分散メモリ型並列
計算機で並列実行する方法において、間接参照されてい
る配列の要素を最後に書き換えたイタレーションのイン
デックスを記録する配列を設けたことを特徴とする間接
参照ループの並列実行方法。
16. An element of an indirectly referenced array is rewritten last in a method of executing in parallel a loop in which an indirect reference in which an array subscript is an array appears on the left side of an assignment statement in a distributed memory parallel computer. A parallel execution method of an indirect reference loop, characterized in that an array for recording an iteration index is provided.
【請求項17】 逐次処理プログラムまたは共有メモリ
型並列計算機用プログラムを分散メモリ型並列計算機プ
ログラムに変換するプログラム並列化方法において、 配列の添字が配列になっている間接参照が加算代入文の
左辺に現われるループに対して、参照されている配列要
素が自プロセッサにあるか他プロセッサにあるかを判定
する文を、該間接参照ループ内に挿入するステップと、 他プロセッサにある場合に該配列要素についての代入情
報を代入リストに登録する文を、該間接参照ループ内に
挿入するステップと、 該代入リストをプロセッサ間で交換する代入リスト交換
文を、該間接参照ループの後に挿入するステップと、 該交換された代入リストを用いて他プロセッサの配列要
素の値を自プロセッサの配列要素に加算代入する文を、
該代入リスト交換文の後に挿入するステップとを含むこ
とを特徴とするプログラム並列化方法。
17. In a program parallelization method for converting a serial processing program or a shared memory parallel computer program into a distributed memory parallel computer program, an indirect reference whose array subscript is an array is on the left side of the addition assignment statement. For the loop that appears, insert a statement in the indirect reference loop that determines whether the referenced array element is in its own processor or in another processor, and if it is in another processor, Inserting a statement for registering the assignment information of the assignment list in the assignment list into the indirect reference loop, and inserting an assignment list exchange statement for exchanging the assignment list between processors after the indirect reference loop, Using the exchanged assignment list, add and assign the value of the array element of another processor to the array element of the local processor.
And a step of inserting after the substitution list exchange statement.
【請求項18】 請求項17記載のプログラム並列化方
法において、 代入リストに登録する代入情報は、参照されている配列
要素を所有するプロセッサのプロセッサ番号、該配列要
素のインデックス、および該配列要素に代入すべき値を
含むことを特徴とするプログラム並列化方法。
18. The program parallelization method according to claim 17, wherein the assignment information registered in the assignment list includes a processor number of a processor which owns the referenced array element, an index of the array element, and an array element. A program parallelization method including a value to be substituted.
【請求項19】 配列の添字が配列になっている間接参
照が加算代入文の左辺に現われるループを分散メモリ型
並列計算機で並列実行する方法において、 参照されている配列要素が自プロセッサにあるか他プロ
セッサにあるかを、該間接参照ループ内で判定するステ
ップと、 自プロセッサにある場合に該配列要素への加算代入をす
るステップと、 他プロセッサにある場合に該配列要素についての代入情
報を該間接参照ループ内で代入リストに登録するステッ
プと、 該間接参照ループ終了後に該代入リストをプロセッサ間
で交換するステップと、 該交換された代入リストを用いて他プロセッサの配列要
素の値を自プロセッサの配列要素に加算代入するステッ
プとを含むことを特徴とする間接参照ループの並列実行
方法。
19. In a method for executing in parallel a loop in which an indirect reference in which an array subscript is an array appears on the left side of an addition assignment statement in a distributed memory parallel computer, is the referenced array element in the own processor? Determining in the indirect reference loop whether it is in another processor, adding and assigning to the array element when it is in its own processor, and assigning information about the array element when it is in another processor Registering in the assignment list in the indirect reference loop, exchanging the assignment list between processors after the indirect reference loop, and using the exchanged assignment list to set the values of array elements of other processors. A parallel execution method of an indirect reference loop, comprising the step of adding and substituting to array elements of a processor.
【請求項20】 請求項19記載の間接参照ループの並
列実行方法において、 代入リストに登録する代入情報は、参照されている配列
要素を所有するプロセッサのプロセッサ番号、該配列要
素のインデックス、および該配列要素に代入すべき値を
含むことを特徴とする間接参照ループの並列実行方法。
20. The parallel execution method for an indirect reference loop according to claim 19, wherein the assignment information registered in the assignment list includes a processor number of a processor owning the referenced array element, an index of the array element, and an index of the array element. A parallel execution method of an indirect reference loop characterized by including values to be assigned to array elements.
JP6062045A 1994-03-07 1994-03-07 Method and device for parallelization for indirect reference loop, and method and device for parallel execution Withdrawn JPH07244647A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6062045A JPH07244647A (en) 1994-03-07 1994-03-07 Method and device for parallelization for indirect reference loop, and method and device for parallel execution

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6062045A JPH07244647A (en) 1994-03-07 1994-03-07 Method and device for parallelization for indirect reference loop, and method and device for parallel execution

Publications (1)

Publication Number Publication Date
JPH07244647A true JPH07244647A (en) 1995-09-19

Family

ID=13188807

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6062045A Withdrawn JPH07244647A (en) 1994-03-07 1994-03-07 Method and device for parallelization for indirect reference loop, and method and device for parallel execution

Country Status (1)

Country Link
JP (1) JPH07244647A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7076777B2 (en) 2002-08-07 2006-07-11 International Business Machines Corporation Run-time parallelization of loops in computer programs with static irregular memory access patterns
US8028280B2 (en) 1999-12-01 2011-09-27 International Business Machines Corporation Compiler optimisation of source code by determination and utilization of the equivalence of algebraic expressions in the source code
US8028281B2 (en) 2003-12-15 2011-09-27 International Business Machines Corporation Run-Time parallelization of loops in computer programs using bit vectors
US8176108B2 (en) 2000-06-20 2012-05-08 International Business Machines Corporation Method, apparatus and computer program product for network design and analysis
JPWO2021161978A1 (en) * 2020-02-10 2021-08-19

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8028280B2 (en) 1999-12-01 2011-09-27 International Business Machines Corporation Compiler optimisation of source code by determination and utilization of the equivalence of algebraic expressions in the source code
US8176108B2 (en) 2000-06-20 2012-05-08 International Business Machines Corporation Method, apparatus and computer program product for network design and analysis
US7076777B2 (en) 2002-08-07 2006-07-11 International Business Machines Corporation Run-time parallelization of loops in computer programs with static irregular memory access patterns
US8028281B2 (en) 2003-12-15 2011-09-27 International Business Machines Corporation Run-Time parallelization of loops in computer programs using bit vectors
JPWO2021161978A1 (en) * 2020-02-10 2021-08-19
WO2021161978A1 (en) * 2020-02-10 2021-08-19 日本電気株式会社 Recording medium, instruction generating method, and instruction generating device

Similar Documents

Publication Publication Date Title
EP0735468B1 (en) Method and apparatus for an optimizing compiler
JP2634144B2 (en) Program parallel execution method and parallel execution compiler
US6530079B1 (en) Method for optimizing locks in computer programs
JPH06266683A (en) Parallel processor
US7254809B2 (en) Compilation of unified parallel C-language programs
JP2669603B2 (en) Code generation method in compiler and compiler
WO2024021192A1 (en) Graph optimization method and apparatus for neural network calculation
JP2010198629A (en) Program code conversion method
Tu Automatic array privatization and demand-driven symbolic analysis
JP3047998B2 (en) Processor allocation method and apparatus in parallel computer
US20020166115A1 (en) System and method for computer program compilation using scalar register promotion and static single assignment representation
Agrawal et al. Interprocedural compilation of irregular applications for distributed memory machines
WO2024065867A1 (en) Memory optimization method and apparatus used for neural network compilation
Metcalf The seven ages of fortran
Gaudiot et al. The Sisal project: real world functional programming
Gupta et al. Static analysis to reduce synchronization costs in data-parallel programs
Darabi et al. A verification technique for deterministic parallel programs
JPH07244647A (en) Method and device for parallelization for indirect reference loop, and method and device for parallel execution
JP2002297399A (en) METHOD FOR GIVING ϕ FUNCTION FOR PERFORMING STATIC SINGLE SUBSTITUTION
JP3266097B2 (en) Automatic reentrant method and system for non-reentrant program
Witterauf et al. Polyhedral fragments: an efficient representation for symbolically generating code for processor arrays
WO2011090032A1 (en) Parallel processing program generation method, parallel processing program generation program, and parallel processing program generation apparatus
US11762641B2 (en) Allocating variables to computer memory
JP3551352B2 (en) Loop splitting method
JP3608993B2 (en) Compiler device and recording medium recording compiler program

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20010508