JPH03161837A - Multiple do loop operation acceleration source program forming system - Google Patents

Multiple do loop operation acceleration source program forming system

Info

Publication number
JPH03161837A
JPH03161837A JP30138189A JP30138189A JPH03161837A JP H03161837 A JPH03161837 A JP H03161837A JP 30138189 A JP30138189 A JP 30138189A JP 30138189 A JP30138189 A JP 30138189A JP H03161837 A JPH03161837 A JP H03161837A
Authority
JP
Japan
Prior art keywords
loop
control variable
array
source program
loops
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP30138189A
Other languages
Japanese (ja)
Inventor
Hiroshi Takahara
高原 浩志
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP30138189A priority Critical patent/JPH03161837A/en
Publication of JPH03161837A publication Critical patent/JPH03161837A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To accelerate operation by executing optimization so that the loop length of the innermost DO loop is maximized and the loop length of the inside DO loop is longer than that of an outside DO loop. CONSTITUTION:A loop length sorting part 5 sorts the loop lengths of respective DO loops from evaluation based upon a loop length evaluating part 4 and a control variable change range changing part 6 replaces the change range of control variable among respective DO loops so that the loop length of the inner most DO loop out of a multiple DO loop extracted from a multiple DO loop extracting part 1 is maximized and the loop lengths of the DO loops are gradu ally reduced in the outside direction. An array element changing part 7 changes the storage positions of array element values of an array having control variables as subscripts in the multiple DO loop, an array declaration changing part 8 changes the array declaration description of the array and a DO loop information output part 9 allocates an identification number to the multiple DO loop and outputs a DO loop information list and a changed source program forming part 10 forms and outputs a changed source program 13. Thus, opera tion can be accelerated.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は多重DOループ演算を含むヘクトル計算機向け
のFORTRANソースプログラムの生或方式に関し、
特に当該FORTRANソースプログラムに含まれる多
重DOループ演算を高速化するための多重DOループ演
算高速化ソースプログラム(多重DOループ演算の高速
化が達威されたFORTRANソースプログラム)生成
方式に関する。
[Detailed Description of the Invention] [Field of Industrial Application] The present invention relates to a method for generating a FORTRAN source program for a hector computer including multiple DO loop operations,
In particular, the present invention relates to a method for generating a source program for accelerating multiple DO loop operations (a FORTRAN source program in which the speed of multiple DO loop operations has been achieved) for speeding up multiple DO loop operations included in the FORTRAN source program.

〔従来の技術〕[Conventional technology]

FORTRANソースプログラムにより表現される演算
(例えば、有限差分法による数値シミュレーション)を
効率的に(高速に)実行するためには、FOl’?TR
ANソースプログラム中に頻繁に現れるDOループ演算
の高速化が必須である。
In order to efficiently (at high speed) execute operations expressed by a FORTRAN source program (for example, numerical simulation using the finite difference method), FOl'? T.R.
It is essential to speed up DO loop operations that frequently appear in AN source programs.

DOループ演算の高速化を達成するためには、多重DO
ループにおいて内側のDOループのループ長をそれより
も外側のDOループのループ長よりも大きくする最適化
を行うことが重要になる。
In order to speed up DO loop operations, multiple DO
It is important to perform optimization to make the loop length of the inner DO loop larger than the loop length of the outer DO loop.

従来、この種の最適化が行われたF O R i” R
 ANソースプログラム(多重DOループ演算高速化ソ
ースプログラム)は、上記最適化に適合するように多重
DOループ内のDOループが人為的に入れ替えられて生
成されていたくなお、コンパイラによる自動的な処理に
よっても」二記最適化は行われているが、適用の範囲が
ごく限られたものであり、オブジェクI・プログラムに
ついての最適化のみであってソースプログラム自体に関
する最適化は行われていない)。
Conventionally, this type of optimization was performed for F O R i”R
An AN source program (multiple DO loop calculation acceleration source program) is generated by artificially replacing the DO loops in the multiple DO loops to suit the optimization described above. (Although optimization has been carried out, the scope of its application is very limited, and it is only an optimization for object I programs and not for the source program itself).

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

上述した従来の技術では、多重DOループ演算高速化ソ
ースプログラムを生成するために、多重DOループ内の
DOループの入れ替えおよびそれに基づく配列要素の値
の格納位置の変更等を人為的に行う必要があるので、多
重DOループ演算を高速化するために人為的な煩雑な操
作を要し、プログラマ等の負担が大きくなる(このよう
なプログラム等の負担を避けるためには、多重DOルー
プ演算の高速化を断念しなければならない)という欠点
がある。
In the conventional technology described above, in order to generate a source program for accelerating multiple DO loop calculations, it is necessary to artificially replace DO loops in multiple DO loops and change the storage positions of array element values based on this. Therefore, in order to speed up multiple DO loop operations, complicated human operations are required, which increases the burden on programmers. The disadvantage is that it is necessary to give up on

本発明の目的は、上述の点に鑑み、多重DOループ演算
高速化ソースプログラムを生或するための上記最適化を
自動的に行うことができ、DOループの入れ替え等の煩
雑な操作を人為的に行うことを必要とせずに多重DOル
ープ演算の高速化が可能になる(ヘクトル計算機の効率
的な稼働を実現できる)多重DOループ演算高速化ソー
スプロダラム生成方式を提供することにある。
In view of the above-mentioned points, an object of the present invention is to be able to automatically perform the above-mentioned optimization for generating a source program for accelerating multiple DO loop calculations, and to eliminate complicated operations such as replacing DO loops manually. An object of the present invention is to provide a source program generation method for accelerating multiple DO loop operations, which enables high speed multiple DO loop operations (achieving efficient operation of a hector computer).

〔課題を解決するための手段〕[Means to solve the problem]

本発明の多重DOループ演算高速化ソースプログラム生
成方式は、最内DOループ内に含まれる配列の第1添字
の変数名が当該最内DOループの制御変数名と一致し各
DOループの制御変数の変化範囲を示す初期値.終値お
よび増分値が定数によって表現されている多重DOルー
プを含むFORTRANソースプログラムの生成におい
て、変更前ソースプログラム内の多重DOループを抽出
する多重DOループ抽出部と、この多重DOルーブ抽出
部により抽出された多重DOループ内の各DOループの
制御変数を抽出しその制御変数の変化範囲を検出するD
Oループ制御変数抽出部と、前記多重DOループ抽出部
により抽出された多重DOループ内から前記DOループ
制御変数抽出部により抽出された制御変数に依存する配
列を抽出する制御変数依存配列抽出部と、前記DOルー
ブ制御変数抽出部により抽出された各DOループの制御
変数の変化範囲に基づき各DOループのループ長を算出
するループ長評価部と、このループ長評価部による評価
に基づき各DOループのループ長をソートするルーブ長
ソート部と、このループ長ソーl・部によるソートの結
果に基づき前記多重DOループ抽出部により抽出された
多重DOループについて最内DOループのループ長が最
大になリ外側のDOループほどループ長が減少するよう
に制御変数の変化範囲を各DOルー1間で入れ替える制
御変数変化範囲変更部と、この制御変数変化範囲変更部
により制御変数の変化範囲が入れ替えられた多重DOル
ープについて制御変数を添字として有する配列の配列要
素の値の格納位置を当該入れ替えに対応させて変更する
配列要素変更部と、この配列要素変更部により配列要素
の値の格納位置が変更された配列の配列宣言記述を変更
する配列宣言変更部と、前記多重DOループ抽出部によ
り抽出された多重DOループに識別番号を付与した上で
DOループ情報リストを出力するDOループ情報出力部
と、前記制御変数変化範囲変更部,前記配列要素変更部
および前記配列宣言変更部により変更された内容に基づ
き多重DOループ演算高速化ソースプログラムである変
更後ソースプログラムを生成し出力する変更後ソースプ
ログラム生底部とを有する。
In the multiple DO loop calculation speed-up source program generation method of the present invention, the variable name of the first subscript of the array included in the innermost DO loop matches the control variable name of the innermost DO loop, and the control variable of each DO loop is Initial value indicating the range of change. In the generation of a FORTRAN source program including multiple DO loops whose final value and increment value are expressed by constants, a multiple DO loop extraction unit extracts multiple DO loops in the source program before change, and extraction by this multiple DO loop extraction unit is performed. D
an O-loop control variable extraction section; a control variable dependent array extraction section that extracts an array dependent on the control variables extracted by the DO loop control variable extraction section from within the multiple DO loops extracted by the multiple DO loop extraction section; , a loop length evaluation section that calculates the loop length of each DO loop based on the change range of the control variable of each DO loop extracted by the DO loop control variable extraction section; and a loop length sorting unit that sorts the loop lengths of the loop length sorting unit, and a loop length of the innermost DO loop of the multiple DO loops extracted by the multiple DO loop extraction unit based on the sorting result by the loop length sorting unit. A control variable change range changing unit swaps the change range of the control variable between each DO loop 1 so that the loop length decreases as the outer DO loop becomes closer. An array element changing unit that changes the storage position of the value of an array element of an array having a control variable as a subscript for the multiple DO loop according to the permutation, and the storage position of the value of the array element is changed by the array element changing unit. an array declaration change unit that changes the array declaration description of the extracted array; and a DO loop information output unit that assigns an identification number to the multiple DO loop extracted by the multiple DO loop extraction unit and outputs a DO loop information list. , a modified source program that generates and outputs a modified source program that is a multiple DO loop calculation acceleration source program based on the contents modified by the control variable change range changing unit, the array element changing unit, and the array declaration changing unit; It has a raw bottom.

〔作用〕[Effect]

本発明の多重DOループ演算高速化ソースプログラム生
成方式では、多重DOループ抽出部が変更前ソースプロ
グラム内の多重DOループを抽出し、DOルーブ制御変
数抽出部が多重DOループ抽出部により抽出された多重
DOループ内の各DOループの制御変数を抽出しその制
御変数の変化範囲を検出し、制御変数依存配列抽出部が
多重DOループ抽出部により抽出された多重DOループ
内からDOループ制御変数抽出部により抽出された制御
変数に依存する配列を抽出し、ループ長評価部がDOル
ープ制御変数抽出部により抽出された各DOループの制
御変数の変化範囲に基づき各DOループのループ長を算
出し、ループ長ソーI・部がループ長評価部による評価
に基づき各DOループのループ長をソートし、制御変数
変化範囲変更部がループ長ソート部によるソートの結果
に基づき多重DOループ抽出部により抽出された多重D
Oループについて最内DOループのループ長が最大にな
り外側のDOループほどループ長が減少するように制御
変数の変化範囲を各DOループ間で入れ替え、配列要素
変更部が制御変数変化範囲変更部により制御変数の変化
範囲が入れ替えられた多重DOループについて制御変数
を添字として有する配列の配列要素の値の格納位置を当
該入れ替えに対応させて変更し、配列宣言変更部が配列
要素変更部により配列要素の値の格納位置が変更された
配列の配列宣言記述を変更し、DOループ情報出力部が
多重DOループ抽出部により抽出された多重DOループ
に識別番号を付与した上でDOルーブ情報リストを出力
し、変更後ソースプログラム生或部が制御変数変化範囲
変更部,配列要素変更部および配列宣言変更部により変
更された内容に基づき多重DOループ演算高速化ソース
プログラムである変更後ソースプログラムを生成し出力
する。
In the multiple DO loop calculation speed-up source program generation method of the present invention, the multiple DO loop extraction section extracts multiple DO loops in the source program before change, and the DO loop control variable extraction section is extracted by the multiple DO loop extraction section. The control variable of each DO loop in the multiple DO loop is extracted, the change range of the control variable is detected, and the control variable dependent array extraction unit extracts the DO loop control variable from the multiple DO loop extracted by the multiple DO loop extraction unit. The loop length evaluation section calculates the loop length of each DO loop based on the change range of the control variable of each DO loop extracted by the DO loop control variable extraction section. , the loop length sorting section sorts the loop lengths of each DO loop based on the evaluation by the loop length evaluation section, and the control variable change range changing section extracts the loop lengths using the multiple DO loop extraction section based on the results of sorting by the loop length sorting section. multiplex D
Regarding the O-loop, the change range of the control variable is swapped between each DO loop so that the loop length of the innermost DO loop is maximum and the loop length decreases for the outer DO loops, and the array element change section changes the control variable change range change section. For a multiple DO loop in which the range of change of a control variable has been swapped, the storage position of the array element value of the array that has the control variable as a subscript is changed in accordance with the swap, and the array declaration changing section uses the array element changing section to change the storage position of the array element value of the array. The array declaration description of the array whose element value storage position has been changed is changed, and the DO loop information output section assigns an identification number to the multiple DO loop extracted by the multiple DO loop extraction section and generates the DO loop information list. Output and generate a modified source program based on the contents changed by the control variable change range changing section, array element changing section, and array declaration changing section, which is a source program for accelerating multiple DO loop calculations. and output.

〔実施例〕〔Example〕

次に、本発明について図面を参照して説明する。 Next, the present invention will be explained with reference to the drawings.

第1図は、本発明の多重DOループ演算高速化ソースプ
ログラム生成方式の一実施例の構或を示すブロック図で
ある。本実施例の多重DOループ演算高速化ソースプロ
グラム生成方式は、変更前ソースプログラム11を対象
に多重DOループを抽出する多重DOループ抽出部1 
(複数の多重DOループが存在すれば全ての多重DOル
ープが抽出される)と、多重DOループ抽出部1により
抽出された多重DOループ内の各DOループの制御変数
を抽出しその制御変数の変化範囲(初期値.終値および
増分値)を検出するDOループ制御変数抽出部2と、各
多重DOループ内においてDOループの制御変数を添字
として含む配列(制御変数に依存する配列)を抽出する
制御変数依存配列抽出部3と、多重DOループ内の各D
Oループの制御変数の変化範囲に基づき各DOループの
ループ長を算出するループ長評価部4と、ループ長評価
部4による評価に基づき各多重DOループ内の各DOル
ープのループ長を大きい順にソートするループ長ソート
部5と、ループ長ソート部5によるソートの結果に基づ
き各多重DOループについて最内DOループのループ長
が最大になり外側のDOループほどループ長が減少する
ように制御変数の変化範囲(初期値,終値および増分値
)を当該多重DOループ内の各DOルーブ間で入れ替え
る制m変数変化範囲変更部6と、制御変数変化範囲変更
部6により制御変数の変化範囲が各DOループ間で入れ
替えられた多重DOループについて入れ替え対象の制御
変数を添字として有する配列の配列要素の値の格納位置
を当該入れ替え(添字である制御変数に関する入れ替え
)に対応させて変更する配列要素変更部7と、制御変数
変化範囲変更部6および配列要素変更部7の変更を反映
し必要に応じて配列の大きさを再設定するためにDIM
ENSION文による配列宣言記述を変更する配列宣言
変更部8と、多重DOループ抽出部1により抽出された
各多重DOループに識別番号を付与した上でDOループ
情報リスト12をファイ1 l ルに出力するDOループ情報出力部9と、制御変数変化
範囲変更部6.配列要素変更部7および配列宣言変更部
8により変更された内容に基づき変更後ソースプログラ
ム13を生成しファイルに出力する変更後ソースプログ
ラム生成部10と、1つ以上の多重DOループ(内包す
る配列の第1添字の変数名が当該多重DOループ内の最
内DOループの制御変数名と一致し、制御変数の初期値
,終値および増分値が定数のみによって表現されている
多重DOループ)を含んでいるF O R TR AN
ソースプログラムである変更前ソースプログラム11 
(オリジナルソースプログラム)と、各多重DOループ
について当該多重DOループ内の各DOループの制il
l変数名,制御変数の変化範囲(初期値,終値および増
分値)およびループ長(ベクトル長)等を変更前ソース
プログラl111および変更後ソースプログラム13に
関して示すDOループ情報リスト12と、多重DOルー
プ演算高速化ソースプログラムである変更後ソースプロ
グラム13(新たなFORTRANソースプログラ12 ム)とを含んで構威されている。
FIG. 1 is a block diagram showing the structure of an embodiment of a source program generation method for accelerating multiple DO loop calculations according to the present invention. The multiple DO loop calculation speed-up source program generation method of this embodiment is based on a multiple DO loop extraction unit 1 that extracts multiple DO loops from a source program 11 before change.
(If a plurality of multiple DO loops exist, all multiple DO loops are extracted), and the multiple DO loop extraction unit 1 extracts the control variables of each DO loop in the extracted multiple DO loops. A DO loop control variable extraction unit 2 detects the change range (initial value, final value, and incremental value), and extracts an array (an array dependent on the control variable) that includes the DO loop control variable as a subscript in each multiple DO loop. Control variable dependent array extraction unit 3 and each D in the multiple DO loop
A loop length evaluation unit 4 calculates the loop length of each DO loop based on the change range of the control variable of the O-loop, and the loop length of each DO loop in each multiple DO loop is calculated in descending order based on the evaluation by the loop length evaluation unit 4. The loop length sorting section 5 performs sorting, and the control variable is set so that the loop length of the innermost DO loop becomes maximum for each multiple DO loop based on the sorting result by the loop length sorting section 5, and the loop length decreases toward the outer DO loop. The control variable change range change unit 6 switches the change range (initial value, final value, and incremental value) between each DO loop in the multiple DO loop, and the control variable change range change unit 6 changes the change range of the control variable into each DO loop. Array element change that changes the storage position of the value of an array element of an array that has the control variable to be swapped as a subscript for multiple DO loops swapped between DO loops in accordance with the swap (swap regarding the control variable that is the subscript) 7, the control variable change range changing unit 6, and the array element changing unit 7 to reflect the changes and reset the array size as necessary.
An identification number is assigned to each multiple DO loop extracted by the array declaration modification unit 8 that modifies the array declaration description using the ENSION statement and the multiple DO loop extraction unit 1, and the DO loop information list 12 is output to file 1. DO loop information output unit 9 and control variable change range changing unit 6. A modified source program generation section 10 generates a modified source program 13 based on the contents modified by the array element modification section 7 and the array declaration modification section 8 and outputs it to a file, and one or more multiple DO loops (containing array (including multiple DO loops) in which the variable name of the first subscript matches the control variable name of the innermost DO loop in the multiple DO loop, and the initial value, final value, and increment value of the control variable are expressed only by constants. FO R TR AN
Source program before change 11 which is a source program
(original source program) and the control of each DO loop within the multiple DO loop for each multiple DO loop.
A DO loop information list 12 showing variable names, change ranges (initial values, final values, and incremental values) of control variables, loop lengths (vector lengths), etc. regarding the source program before change 111 and the source program after change 13, and multiple DO loops. The modified source program 13 (new FORTRAN source program 12), which is a calculation speed-up source program, is included.

次に、このように構威された本実施例の多重DOルーブ
演算高速化ソースプログラム生成方式の動作について説
明する。なお、ここでは第2図に示すようなFORTR
ANソースプログラム(3重DOループを含むFORT
RANソースプログラム)が変更前ソースプログラムl
1である場合の動作について説明する。
Next, the operation of the multiple DO rube calculation high-speed source program generation system of this embodiment configured as described above will be explained. In addition, here, FORTR as shown in Figure 2 is used.
AN source program (FORT including triple DO loop)
RAN source program) is the source program before change
The operation when the value is 1 will be explained.

第2図に示すFORTRANソースプログラム(変更前
ソースプログラム11)内の3重DOループについては
、各DOループのループ長は最も外側のDOルーブより
順に120.50および20であり、最内DOルーブの
ループ長が最小であるから、ベクトル計算機の能力の有
効活用という点からは非効率的である。したがって、以
下に示すような手順で多重DOループ演算(この場合に
は3重DOループ演算)の高速化を実現できるFORT
RANソースプログラム(変更後ソースプログラム13
)の生或が行われる。
Regarding the triple DO loop in the FORTRAN source program (source program 11 before change) shown in FIG. 2, the loop length of each DO loop is 120.50 and 20 in order from the outermost DO loop, and Since the loop length of is the minimum, it is inefficient from the point of view of effective utilization of the vector computer's capacity. Therefore, the FORT that can speed up multiple DO loop operations (in this case, triple DO loop operations) can be achieved by following the steps shown below.
RAN source program (source program 13 after modification)
) will be produced.

まず、多重DOループ抽出部1により、変更前ソースプ
ログラム11全体から多重DOループの抽出が行われ、
40.50および6oの文番号を持つDOループからな
る3重DOループが抽出される。
First, the multiple DO loop extraction unit 1 extracts multiple DO loops from the entire pre-change source program 11,
A triple DO loop consisting of DO loops with statement numbers 40, 50 and 6o is extracted.

次に、DOループ制御変数抽出部2により、当該多重D
Oループ(3重DOループ)内の各DOループの制御変
数であるK,  JおよびIが抽出され、それらの制御
変数の変化範囲を規定するものとして制御変数の初期値
.終値および増分値がDOルーブ毎に検出される。
Next, the DO loop control variable extraction unit 2 extracts the multiple D
The control variables K, J, and I of each DO loop in the O loop (triple DO loop) are extracted, and the initial values of the control variables are used to define the range of change of these control variables. A closing value and an increment value are detected for each DO rube.

さらに、制御変数依存配列抽出部3により、当該多重D
Oループの範囲において、制御変数に依存した配列(こ
こでは、配列DF)が抽出される。
Furthermore, the control variable dependent array extraction unit 3 extracts the multiplex D
In the range of the O-loop, an array (here, array DF) that depends on the control variable is extracted.

制御変数の順序の変更は、以下に示すようにして実現さ
れる。
Changing the order of control variables is achieved as shown below.

まず、ループ長評価部4により、当該多重DOルーフ内
の各DOル−7” (4 0.  5 0および60の
文番号を持つDOループ)について、各DOループの制
御変数の初期値.終値および増分値に基づき、ループ長
(ベクトル長)が算出される。ここでは、各ループ長は
外側のDOループのループ長より順に120.50およ
び20であることが分かる。
First, the loop length evaluation unit 4 determines the initial value and final value of the control variable of each DO loop for each DO rule-7'' (DO loops with statement numbers of 40.50 and 60) in the multiple DO roof. and the increment value, the loop lengths (vector lengths) are calculated.Here, it can be seen that each loop length is 120.50 and 20 in order from the loop length of the outer DO loop.

次に、ループ長ソート部5により、当該多重DOループ
内の各DOループについて、ループ長の値が大きい順に
ソートされる。
Next, the loop length sorting unit 5 sorts the DO loops in the multiplex DO loop in descending order of loop length.

このソートの結果に基づき、制御変数変化範囲変更部6
により、最内DOループのループ長を最大とするべく制
御変数の変化範囲の変更がなされる。すなわち、最内D
Oループのループ長が120であり、外側のDOループ
ほどループ長が50および20と減少するように、制御
変数の終値を示すMlとMKとの入れ替えが行われる(
本例では、各制御変数の初期値および増分値は1のまま
である)。
Based on the result of this sorting, the control variable change range changing unit 6
As a result, the change range of the control variable is changed to maximize the loop length of the innermost DO loop. That is, the innermost D
The loop length of the O loop is 120, and Ml and MK, which indicate the final value of the control variable, are exchanged so that the loop length of the outer DO loop decreases to 50 and 20 (
In this example, the initial value and increment value of each control variable remain 1).

この入れ替えに対応して、配列要素変更部7により、当
該多重DOループの範囲内において制御変数1,  J
およびKに依存する配列DFの配列要素の値の格納位置
を変更するために、rDF (IJ  K) 一DSQ
RT (DBLE (3*I+2*15 J+K))Jの右辺について変数(配列DFの添字)■
と変数Kとの入れ替えが行われる。
In response to this exchange, the array element change unit 7 changes the control variables 1, J within the scope of the multiple DO loop.
In order to change the storage position of the value of the array element of the array DF that depends on K and rDF (IJ K) - DSQ
RT (DBLE (3*I+2*15 J+K)) Variable for the right side of J (subscript of array DF)■
and variable K are exchanged.

変数Iと変数Kとの入れ替えにともなって配列DFの配
列宣言記述の変更の必要が発生ずるので、配列宣言変更
部8により、配列DFの配列宣言記述(rDIMENs
ION DF (20. 50120)J)の変更が行
われる。
Since it is necessary to change the array declaration description of array DF due to the exchange of variable I and variable K, the array declaration modification unit 8 changes the array declaration description (rDIMENS) of array DF.
ION DF (20.50120)J) changes are made.

以上のような変更を示す情報をプログラマ等に提供する
ために、DOループ情報出力部9により、各多重DOル
ープに関する情報(ここでは、当該3重DOループに関
する情報のみ)に自動的に多重DOループ識別番号が付
与された上でDOループ情報リスト12がファイルに出
力される。
In order to provide information indicating the above-mentioned changes to the programmer, etc., the DO loop information output unit 9 automatically adds information regarding each multiple DO loop (here, only information regarding the triple DO loop) to the multiple DO loop. The DO loop information list 12 is output to a file after being given a loop identification number.

第4図は、このようにして出力されたDOループ情報リ
スト12の一例を示す図である。このDOルーブ情報リ
スト12には、変更前ソースプログラム11 (オリジ
ナルソースプログラム)から抽出された3重DOループ
について、多重DOループ識別番号,当該多重DOルー
プ中の各DOループの文番号,制御変数名,制御変数の
変化範囲16 (初期値,終値および増分値)およびループ長(ヘクト
ル長)が、本実施例によるソースプログラム変更の前後
(変更前ソースプログラム11および変更後ソースプロ
グラム13の両方〉について示されている。
FIG. 4 is a diagram showing an example of the DO loop information list 12 output in this manner. This DO loop information list 12 includes the multiple DO loop identification number, the statement number of each DO loop in the multiple DO loop, and the control variable for the triple DO loop extracted from the source program 11 before change (original source program). The change range 16 (initial value, final value, and increment value) of the control variable and the loop length (hector length) are different before and after the source program change according to this embodiment (both the source program 11 before the change and the source program 13 after the change). is shown.

さらに、変更後ソースプログラム生成部10により、以
上のようにして変更された内容を反映して第3図に示す
ような変更後ソースプログラム13 (多重DOループ
演算高速化ソースプログラム)が生成され、ファイルに
出力されて保存される。
Furthermore, the modified source program generation unit 10 generates a modified source program 13 (multiple DO loop calculation speed-up source program) as shown in FIG. 3, reflecting the contents modified as described above. Output and save to file.

第5図は、あるベクトル計算機において、上述のように
して生或された変更後ソースプログラム13(第3図参
照)の実行に要する時間(CPU時間〉等と変更前ソー
スプログラム11 (第2図参照)の実行に要する時間
等との比較を示す図である。
FIG. 5 shows the time (CPU time) required to execute the modified source program 13 (see FIG. 3) generated as described above and the unmodified source program 11 (see FIG. 2) in a certain vector computer. FIG.

この図に示すように、最内DOループのループ長を20
から120に変更して多重DOループ(3重DOループ
)の高速化を図ることにより、Cpu時間は0.023
秒から0.008秒(約3分の1)に減少し、ベクトル
計算機におけるベクトル演算の高速化(効率化〉にとっ
て、本実施例(ひいては、本発明)が非常に有効である
ことが分かる。
As shown in this figure, the loop length of the innermost DO loop is 20
By changing from to 120 to speed up the multiple DO loop (triple DO loop), the CPU time was reduced to 0.023
2 to 0.008 seconds (approximately one-third), and it can be seen that this embodiment (and thus the present invention) is very effective in increasing the speed (improving efficiency) of vector operations in vector computers.

なお、配列要素変更部7における配列要素の値の格納位
置の変更における内部処理の制約等に起因して、本発明
は3重までの多重DOループを含むFORTRANソー
スプログラムに適合する。
Note that due to constraints on internal processing in changing the storage position of array element values in the array element changing section 7, the present invention is suitable for FORTRAN source programs including up to three multiple DO loops.

〔発明の効果〕〔Effect of the invention〕

以上説明したように本発明は、多重DOループにおける
最内DOループのループ長が最大になり内側のDOルー
プのループ長が外側のDOループのループ長よりも大き
くなるような最適化を自動的に行うことにより、DOル
ープの入れ替え等の煩雑な操作を人為的に行うことを必
要とせずに、多重DOループ演算の高速化が可能になる
〈ベクトル計算機の効率的な稼働を実現できる)という
効果がある。
As explained above, the present invention automatically optimizes the loop length of the innermost DO loop in multiple DO loops so that the loop length of the inner DO loop becomes larger than the loop length of the outer DO loop. By doing so, it is possible to speed up multiple DO loop calculations without having to manually perform complicated operations such as replacing DO loops (achieving efficient operation of vector computers). effective.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明の一実施例の構或を示すプロック図、 第2図は第1図中の変更前ソースプログラムの一例を示
す図、 第3図は第1図中の変更後ソースプログラムの一例を示
す図、 第4図は第1図中のDOルーブ情報リストの一例を示す
図、 第5図はあるベクトル計算機において第2図に示す変更
前ソースプログラムの実行に要するCPU時間と第3図
に示す変更後ソースプログラムの実行に要するCPU時
間との比較等を示す図である。 図において、 1・・・多重DOループ抽出部、 2・・・DOループ制御変数抽出部、 3・・・制御変数依存配列抽出部、 4・・・ループ長評価部、 5・・・ループ長ソート部、 6・・・制御変数変化範囲変更部、 7・・・配列要素変更部、 8 ・ ・ 9 ・ ・ 1 0 ・ 1 1 ・ 1 2 ・ 1 3 ・ ・配列宣言変更部、 ・DOルーブ情報出力部、 ・変更後ソースプログラム生成部、 ・変更前ソースプログラム、 ・DOループ情報リスト、 ・変更後ソースプログラムである。
FIG. 1 is a block diagram showing the configuration of an embodiment of the present invention, FIG. 2 is a diagram showing an example of the source program before the change in FIG. 1, and FIG. 3 is the source program after the change in FIG. 1. FIG. 4 is a diagram showing an example of the DO rube information list in FIG. FIG. 3 is a diagram showing a comparison with the CPU time required to execute the modified source program shown in FIG. 3; In the figure, 1...Multiple DO loop extraction unit, 2...DO loop control variable extraction unit, 3...Control variable dependent array extraction unit, 4...Loop length evaluation unit, 5...Loop length Sorting section, 6... Control variable change range changing section, 7... Array element changing section, 8 ・ 9 ・ 1 0 ・ 1 1 ・ 1 2 ・ 1 3 ・ ・Array declaration changing section, ・DO lube Information output unit; - source program generation unit after change; - source program before change; - DO loop information list; - source program after change.

Claims (1)

【特許請求の範囲】 最内DOループ内に含まれる配列の第1添字の変数名が
当該最内DOループの制御変数名と一致し各DOループ
の制御変数の変化範囲を示す初期値、終値および増分値
が定数によって表現されている多重DOループを含むF
ORTRANソースプログラムの生成において、 変更前ソースプログラム内の多重DOループを抽出する
多重DOループ抽出部と、 この多重DOループ抽出部により抽出された多重DOル
ープ内の各DOループの制御変数を抽出しその制御変数
の変化範囲を検出するDOループ制御変数抽出部と、 前記多重DOループ抽出部により抽出された多重DOル
ープ内から前記DOループ制御変数抽出部により抽出さ
れた制御変数に依存する配列を抽出する制御変数依存配
列抽出部と、 前記DOループ制御変数抽出部により抽出された各DO
ループの制御変数の変化範囲に基づき各DOループのル
ープ長を算出するループ長評価部と、 このループ長評価部による評価に基づき各DOループの
ループ長をソートするループ長ソート部と、 このループ長ソート部によるソートの結果に基づき前記
多重DOループ抽出部により抽出された多重DOループ
について最内DOループのループ長が最大になり外側の
DOループほどループ長が減少するように制御変数の変
化範囲を各DOループ間で入れ替える制御変数変化範囲
変更部と、この制御変数変化範囲変更部により制御変数
の変化範囲が入れ替えられた多重DOループについて制
御変数を添字として有する配列の配列要素の値の格納位
置を当該入れ替えに対応させて変更する配列要素変更部
と、 この配列要素変更部により配列要素の値の格納位置が変
更された配列の配列宣言記述を変更する配列宣言変更部
と、 前記多重DOループ抽出部により抽出された多重DOル
ープに識別番号を付与した上でDOループ情報リストを
出力するDOループ情報出力部と、前記制御変数変化範
囲変更部、前記配列要素変更部および前記配列宣言変更
部により変更された内容に基づき多重DOループ演算高
速化ソースプログラムである変更後ソースプログラムを
生成し出力する変更後ソースプログラム生成部と を有することを特徴とする多重DOループ演算高速化ソ
ースプログラム生成方式。
[Claims] An initial value and a final value in which the variable name of the first subscript of the array included in the innermost DO loop matches the control variable name of the innermost DO loop and indicate the change range of the control variable of each DO loop. and F containing multiple DO loops whose increment values are represented by constants
In generating an ORTRAN source program, there is a multiple DO loop extractor that extracts multiple DO loops in the source program before modification, and a control variable for each DO loop in the multiple DO loops extracted by this multiple DO loop extractor. a DO loop control variable extraction unit that detects a change range of the control variable; and an array that depends on the control variables extracted by the DO loop control variable extraction unit from within the multiple DO loops extracted by the multiple DO loop extraction unit. a control variable dependent array extraction unit to extract, and each DO extracted by the DO loop control variable extraction unit;
a loop length evaluation section that calculates the loop length of each DO loop based on the range of change of the control variable of the loop; a loop length sorting section that sorts the loop length of each DO loop based on the evaluation by the loop length evaluation section; For the multiple DO loops extracted by the multiple DO loop extraction unit based on the results of sorting by the length sort unit, the control variables are changed so that the loop length of the innermost DO loop is maximized and the loop length decreases as the outer DO loops become closer. A control variable change range changing unit that exchanges the range between each DO loop, and a control variable change range changing unit that changes the value of an array element of an array having a control variable as a subscript for multiple DO loops in which the change range of a control variable is changed by this control variable change range changing unit. an array element changing unit that changes the storage position in accordance with the exchange; an array declaration changing unit that changes the array declaration description of the array whose storage position of the array element value has been changed by the array element changing unit; a DO loop information output unit that assigns an identification number to the multiple DO loops extracted by the DO loop extraction unit and outputs a DO loop information list; the control variable change range change unit; the array element change unit; and the array declaration. A source program for accelerating multiple DO loop calculations, comprising: a modified source program generation unit that generates and outputs a modified source program that is a source program for accelerating multiple DO loop calculations based on the content changed by the modification unit. Generation method.
JP30138189A 1989-11-20 1989-11-20 Multiple do loop operation acceleration source program forming system Pending JPH03161837A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP30138189A JPH03161837A (en) 1989-11-20 1989-11-20 Multiple do loop operation acceleration source program forming system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP30138189A JPH03161837A (en) 1989-11-20 1989-11-20 Multiple do loop operation acceleration source program forming system

Publications (1)

Publication Number Publication Date
JPH03161837A true JPH03161837A (en) 1991-07-11

Family

ID=17896189

Family Applications (1)

Application Number Title Priority Date Filing Date
JP30138189A Pending JPH03161837A (en) 1989-11-20 1989-11-20 Multiple do loop operation acceleration source program forming system

Country Status (1)

Country Link
JP (1) JPH03161837A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5606698A (en) * 1993-04-26 1997-02-25 Cadence Design Systems, Inc. Method for deriving optimal code schedule sequences from synchronous dataflow graphs

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5606698A (en) * 1993-04-26 1997-02-25 Cadence Design Systems, Inc. Method for deriving optimal code schedule sequences from synchronous dataflow graphs

Similar Documents

Publication Publication Date Title
Shanbhag et al. Efficient top-k query processing on massively parallel hardware
US4833606A (en) Compiling method for vectorizing multiple do-loops in source program
Bonorden et al. The Paderborn University BSP (PUB) library-design, implementation and performance
JP2500079B2 (en) Program optimization method and compiler system
Callahan Optimal parallel all-nearest-neighbors using the well-separated pair decomposition
Kruskal et al. A complexity theory of efficient parallel algorithms
Breyer et al. Performance-portable distributed k-nearest neighbors using locality-sensitive hashing and sycl
JPH03161837A (en) Multiple do loop operation acceleration source program forming system
CN111580969A (en) A-star searching method based on multiple GPUs
Sturlesi et al. Future of global optimization in optical design
Goodrich et al. Sorting on a parallel pointer machine with applications to set expression evaluation
Rho et al. Compilation of a functional language for the multithreaded architecture: Davrid
Williams A multiprocessing system for the direct execution of LISP
EP0256881A2 (en) An automated method for creating a configuration database
Klusik et al. Controlling parallelism and data distribution in Eden.
Ionescu Optimizing Parallel Bitonic Sort
JPH07334366A (en) Method and device for optimizing graph reduction mechanism
Bubak et al. Parallel object-oriented library of genetic algorithms
WO1997007452A1 (en) Programmable compiler
JP6555259B2 (en) Information processing apparatus, data storage method, and program
JPH04112337A (en) Acceleration system for calculation of fortran multiple do loop
JPH0644270B2 (en) Vector processor control processing method
Amaral et al. Performance measurements of a concurrent production system architecture without global synchronization
Anneberg et al. Petri net approach to software development under pipeline and parallel processing architectures
JP2735255B2 (en) Hatching treatment method