JPH08221276A - Compiler - Google Patents

Compiler

Info

Publication number
JPH08221276A
JPH08221276A JP2818195A JP2818195A JPH08221276A JP H08221276 A JPH08221276 A JP H08221276A JP 2818195 A JP2818195 A JP 2818195A JP 2818195 A JP2818195 A JP 2818195A JP H08221276 A JPH08221276 A JP H08221276A
Authority
JP
Japan
Prior art keywords
loop
range
subscript
array
value
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
JP2818195A
Other languages
Japanese (ja)
Inventor
Kiyoshi Negishi
清 根岸
Kazuhiro Aida
一弘 会田
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 Ltd
Original Assignee
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 Ltd filed Critical Hitachi Ltd
Priority to JP2818195A priority Critical patent/JPH08221276A/en
Publication of JPH08221276A publication Critical patent/JPH08221276A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE: To speedily execute the DO loop of the array data distributed to plural processors. CONSTITUTION: The large-scale DO loop for the division command for parallel execution and the arrangement is defined in a source program 21. A syntax analysis part 11 inputs a source program and converts it into an intermediate language 22 after syntax and meaning analysis. An intermediate part 12 inputs the language 22 and divides the arrangement according to the division command of the source program 21. The relation within the range of the subscript before and after division is analyzed and converts it into an intermediate word 23 which changes the range of the DO control variable into the range of the divided local arrangement. A code generation part 13 generates an objective program 30 by inputting the intermediate word 23. Thus, the subscript in the DO loop of the objective program is surely within the range of the subscript of the distributed arrangement, resulting in requiring no discrimination of the range of subscript in the DO loop.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、高級言語のソースプロ
グラムを機械語の目的プログラム(オブジェクト)に変
換するコンパイラに関し、特に分散記憶向け並列計算機
において、複数のプロセッサに分散された配列データに
関するDOループの実行を効率的に実行させるためのオ
ブジェクトを生成するコンパイラに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a compiler for converting a high-level language source program into a machine language object program (object), and in particular to a DO for array data distributed to a plurality of processors in a parallel computer for distributed storage. The present invention relates to a compiler that generates objects for efficiently executing the execution of loops.

【0002】[0002]

【従来の技術】従来のコンパイラでは、並列実行向けの
指示を含むDOループ定義文の高級言語ソースプログラ
ムを、分散記憶計算機のプロセッサ向けの目的プログラ
ム(オブジェクト、目的コードともいう)に変換する場
合、DOループのループ回数は変更せず、プロセッサが
ループ内で自分のプロセッサ番号を比較するコードを出
力していた。図8に具体例を示す。
2. Description of the Related Art In a conventional compiler, when a high-level language source program of a DO loop definition statement containing instructions for parallel execution is converted into a target program (also called object or target code) for a processor of a distributed storage computer, The number of loops in the DO loop was not changed, and the processor output a code that compares its processor number in the loop. FIG. 8 shows a specific example.

【0003】図8(1)は高級言語FORTRAN(H
igh Performance Fortran)ソースプログラムの一例
で、並列実行向けの分割指示と、その配列データに対す
るDOループを示している。この例では、配列Aを4つ
のプロセッサに25要素ずつ連続に分割する。このプロ
グラムは、従来のコンパイラでは、図8(2)のように
変換される。即ち、DOループの初期値(1)、終値
(100)は変換せず、該ループ内で自分のプロセッサ
番号を比較するIF文のコードが出力される。
FIG. 8 (1) shows a high-level language FORTRAN (H
An example of a source program is a division instruction for parallel execution and a DO loop for the array data. In this example, the array A is continuously divided into four processors with 25 elements each. This program is converted by the conventional compiler as shown in FIG. That is, the initial value (1) and the final value (100) of the DO loop are not converted, and the IF statement code for comparing the processor number of itself is output in the loop.

【0004】複数のプロセッサ(本例では4台)に分散
された配列データに関するDOループの実行は、各プロ
セッサIPが、DOループの内部において配列の添字が
自プロセッサの持つ局所配列の添字の範囲内であるか否
かを判定することにより、DOループの繰返しを実行す
るか否かを決定することになる。図9は、図8の例につ
いて、4台のプロセッサ0〜3に分散記憶された局所配
列の添字の範囲と大域添字の関係を示したものである。
When executing a DO loop for array data distributed to a plurality of processors (four units in this example), each processor IP has an array index within the DO loop within the range of the local array index of its own processor. It is determined whether or not the iteration of the DO loop is executed by determining whether or not. FIG. 9 shows the relationship between the subscript range and the global subscript of the local array distributed and stored in the four processors 0 to 3 for the example of FIG.

【0005】[0005]

【発明が解決しようとする課題】上記従来技術では、複
数のプロセッサに分散された配列型データを含むDOル
ープの実行に際して、該プロセッサにおいてDOループ
の繰返しを実行するか否かの判定をDOループ本体で毎
回行う必要があるため、DOループの効率のよい実行が
行えないという問題があった。
In the above-mentioned prior art, when executing a DO loop containing array type data distributed to a plurality of processors, the DO loop is judged in the processor whether or not to repeat the DO loop. Since it has to be performed every time in the main body, there is a problem that the DO loop cannot be efficiently executed.

【0006】本発明の目的は、コンパイルの過程で、D
Oループ内に存在する、分散された配列データの添字を
各プロセッサのDO制御変数で置き換えることにより、
ループ内での現在の繰返しを実行するか否かの判定をせ
ず、DOループの効率のよい実行を行えるようにするこ
とにある。
The object of the present invention is to use the D
By replacing the subscript of the distributed array data existing in the O loop with the DO control variable of each processor,
It is to enable efficient execution of the DO loop without determining whether or not to execute the current iteration in the loop.

【0007】[0007]

【課題を解決するための手段】本発明のコンパイラは、
並列実行向けの分割指示と配列に対する大域のDOルー
プを定義した高級言語のソースプログラムを入力して、
該ソースプログラムで定義された並列実行の分割指示に
従って、指定された配列を分割する手段と、分割前の配
列に対する添字の範囲と分割後の局所配列に対する添字
の範囲の関係を解析し、DOループ制御変数の初期値、
終値を局所配列の添字の範囲内とするDOループオブジ
ェクトを生成する手段を有する。
The compiler of the present invention is
Input a high-level language source program that defines a global DO loop for partition instructions and arrays for parallel execution,
According to a parallel execution division instruction defined by the source program, means for dividing the designated array, analyzing the relationship between the subscript range for the array before the division and the subscript range for the local array after the division, and the DO loop The initial value of the control variable,
It has means for generating a DO loop object whose final value is within the range of the subscript of the local array.

【0008】また、本発明のコンパイラは初期値、終値
が不明な場合には、初期値、終値に対して局所配列の添
字の範囲を計算するオブジェクトと、前記範囲を繰り返
すDOループオブジェクトを生成する手段を有する。
Further, the compiler of the present invention, when the initial value and the final value are unknown, generates an object for calculating the range of the subscript of the local array with respect to the initial value and the final value, and a DO loop object for repeating the range. Have means.

【0009】[0009]

【作用】コンパイラは並列向けの指示文に従って配列型
データを分割する。DOループ内に存在する分割された
配列型データに対してその添字の範囲が参照されるため
のDO制御変数の値の集合を計算し、その結果に従って
DOループの制御変数の初期値、終値を求め、DO文を
生成する。この生成されたDOループ内の配列の添字
は、自プロセッサの持つ、分散された配列の添字の範囲
内であることが保証されるため、DOループ内における
添字範囲の判定は不要となり、DOループの効率の良い
実行を行うことが出来る。
Function: The compiler divides the array type data according to the parallel directive. The set of values of the DO control variable for referencing the range of the subscript is calculated for the divided array type data existing in the DO loop, and the initial value and the final value of the control variable of the DO loop are calculated according to the result. Ask and generate a DO sentence. Since it is guaranteed that the subscripts of the array in the generated DO loop are within the subscript range of the distributed array of the own processor, it is not necessary to determine the subscript range in the DO loop, and the DO loop Can be executed efficiently.

【0010】[0010]

【実施例】以下、本発明の一実施例を図面を参照しつつ
説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described below with reference to the drawings.

【0011】図1に、本発明の一実施例のコンパイラ全
体の構成図を示す。図において、コンパイラ(ここでは
FORTRANコンパイラ)10は構文解析部11、中
間部12及びコード生成部13に大別される。構文解析
部11は、FORTRANソースプログラム21を入力
し、構文・意味解析して中間言語22に変換する。中間
部12はデータ分割や添字解析を含み、中間言語22を
入力して、DOループの制御変数の範囲を変更した中間
言語23に変換する。コード生成部13は、中間言語2
3を入力して、目的プログラム30を生成する。本発明
は中間部12に係る。
FIG. 1 is a block diagram of the entire compiler according to an embodiment of the present invention. In the figure, a compiler (here, FORTRAN compiler) 10 is roughly divided into a syntax analysis unit 11, an intermediate unit 12, and a code generation unit 13. The syntactic analysis unit 11 inputs the FORTRAN source program 21, syntactically and semantically analyzes it, and converts it into an intermediate language 22. The intermediate section 12 includes data division and subscript analysis, inputs the intermediate language 22, and converts it into the intermediate language 23 in which the range of the control variable of the DO loop is changed. The code generator 13 uses the intermediate language 2
3 is input to generate the target program 30. The present invention relates to the middle section 12.

【0012】図2は、中間部12における本発明の一実
施例によるDOループの分割処理フローを示す図であ
る。中間部12において、まず、FORTRANソース
プログラム(High Performance Fortran)で定義さ
れた並列実行向けの分割指示に従って、指定された配列
を分割し、配列データ分割テーブルを作成する(ステッ
プ110)。配列データ分割テーブルについては後述す
る。次に、プログラム中のDOループに対して分割され
た配列を含んだループであるか否かを判定する(ステッ
プ120)。当該ループが分割された配列を含む場合
は、次に、DOループの初期値、終値が定数で表されて
いるか否かを判定する(ステップ130)。当該ループ
の初期値、終値が定数で表されている場合は、ステップ
110で作成した配列データ分割テーブルを参照して、
分割された配列の添字の範囲と当該ループのDO制御変
数の値の集合を計算し(ステップ140)、初期値、終
値を局所配列の添字の範囲に置き換えたDOループオブ
ジェクトを生成する(ステップ150)。また、ステッ
プ130で当該ループの初期値、終値が定数で表されて
いない場合は、初期値、終値に対して局所配列の添字の
範囲を計算するオブジェクトと、その範囲を繰り返すD
Oループオブジェクトを生成する(ステップ160)。
一方、ステップ120で当該ループが分割された配列を
含まない場合は、当該DOループを分割しない。
FIG. 2 is a diagram showing a division processing flow of the DO loop in the intermediate section 12 according to an embodiment of the present invention. In the intermediate section 12, first, the specified array is divided according to the division instruction for parallel execution defined by the FORTRAN source program (High Performance Fortran), and the arrangement data division table is created (step 110). The array data division table will be described later. Next, it is determined whether or not the DO loop in the program is a loop including a divided array (step 120). If the loop includes a divided array, it is next determined whether the initial value and the final value of the DO loop are represented by constants (step 130). If the initial value and the final value of the loop are represented by constants, refer to the array data division table created in step 110,
The set of the subscript range of the divided array and the value of the DO control variable of the loop is calculated (step 140), and the DO loop object in which the initial value and the final value are replaced with the subscript range of the local array is generated (step 150). ). If the initial value and the final value of the loop are not represented by constants in step 130, an object that calculates the range of the subscript of the local array with respect to the initial value and the final value, and D that repeats the range.
An O-loop object is generated (step 160).
On the other hand, if the loop does not include the array that was divided in step 120, the DO loop is not divided.

【0013】以下に処理の具体例を示す。図3はFOR
TRANソースプログラムの一例である。ここで、図3
(1)のFORTRANソースプログラムAは、高級言
語(High Performance Fortran)で定義された並列
実行向けの分割指示と、その配列データに対するDOル
ープの例である。この例は、図8の例と同じであり、配
列Aを4つのプロセッサに25要素ずつ連続に分割す
る。図3(2)のFORTRANソースプログラムB
も、High Performance Fortranで定義された並列実
行向けの分割指示と、その配列データに対するDOルー
プの例であるが、この例では、配列Aを4つのプロセッ
サに循環的に分割する。図3(3)のFORTRANソ
ースプログラムCは、High Performance Fortranで
定義された並列実行向けの分割指示と、その配列データ
に対するDOループの初期値、終値がコンパイル時に不
明な場合の例である。この例では配列Aを4つのプロセ
ッサに25要素づつ連続に分割する。また、DOループ
の初期値、終値は実行時に動的に決まる。
A specific example of the processing will be shown below. Figure 3 is FOR
It is an example of a TRAN source program. Here, FIG.
The FORTRAN source program A of (1) is an example of a division instruction for parallel execution defined in a high-level language (High Performance Fortran) and a DO loop for the array data. This example is the same as the example of FIG. 8, and the array A is continuously divided into four processors by 25 elements. FORTRAN source program B in FIG. 3 (2)
Also, this is an example of a division instruction for parallel execution defined by High Performance Fortran and a DO loop for the array data, but in this example, the array A is cyclically divided into four processors. The FORTRAN source program C of FIG. 3C is an example in which the division instruction for parallel execution defined in High Performance Fortran, and the initial value and the final value of the DO loop for the array data are unknown at compile time. In this example, the array A is continuously divided into four processors with 25 elements each. Further, the initial value and the final value of the DO loop are dynamically determined at the time of execution.

【0014】図4に、図3(1)のFORTRANソー
スプログラムA中の配列Aに対して連続的に分割された
配列データ分割テーブルを示す。図において、プロセッ
サ番号411は分割された配列を保持するプロセッサの
番号(本例では0〜3)、大域添字値412は分割前の
配列に対する添字の値(本例では1〜100)、局所添
字値413は、プロセッサ番号411対応の分割後の局
所配列に対する添字の値(本例では1〜25)である。
大域添字値412から局所添字値413への変換は、プ
ロセッサ番号をip、大域添字値をgx、局所添字値を
lxとすると、 lx=gx−ip×25 (1) で計算できる。
FIG. 4 shows an array data division table in which the array A in the FORTRAN source program A of FIG. 3A is continuously divided. In the figure, the processor number 411 is the number of the processor holding the divided array (0-3 in this example), the global subscript value 412 is the subscript value (1-100 in this example) for the array before division, and the local subscript. The value 413 is a subscript value (1 to 25 in this example) for the divided local array corresponding to the processor number 411.
The conversion from the global subscript value 412 to the local subscript value 413 can be calculated by lx = gx−ip × 25 (1) where ip is the processor number, gx is the global subscript value, and 1x is the local subscript value.

【0015】図5に、図3(2)のFORTRANソー
スプログラムB中の配列Aに対して循環的に分割された
配列データ分割テーブルを示す。図において、プロセッ
サ番号511は分割された配列を保持するプロセッサの
番号(本例では0〜3)、大域添字値512は分割前の
配列に対する添字の値(本例では1〜100で、プロセ
ッサ間で循環的に割当てる)、局所添字値513は、プ
ロセッサ番号511対応の分割後の局所配列に対する添
字の値(本例では1〜25)である。大域添字値512
から局所添字値513への変換は、プロセッサ数を4、
大域添字値をgx、局所添字値をlxとすると、 lx={(gx−1) div 4}+1 (2) で計算できる。また、大域添字値512の配列要素を保
持するプロセッサ番号511は、プロセッサ数を4、大
域添字値をgx、プロセッサ番号をipとすると、 ip=(gx−1) mod 4 (3) で計算できる。この計算によって作成された配列データ
分割テーブルを参照することにより、循環的に分割され
た配列をプロセッサごとに連続な添字を持つ配列として
扱うことが出来る。
FIG. 5 shows an array data division table in which the array A in the FORTRAN source program B of FIG. 3B is cyclically divided. In the figure, the processor number 511 is the number of the processor holding the divided array (0-3 in this example), and the global subscript value 512 is the subscript value for the array before division (1-100 in this example, between processors). The local subscript value 513 is a subscript value (1 to 25 in this example) for the divided local array corresponding to the processor number 511. Global subscript value 512
To the local subscript value 513, the number of processors is 4,
When the global subscript value is gx and the local subscript value is lx, it can be calculated by lx = {(gx-1) div 4} +1 (2). Further, the processor number 511 holding the array element of the global subscript value 512 can be calculated by ip = (gx-1) mod 4 (3) where the number of processors is 4, the global subscript value is gx, and the processor number is ip. . By referring to the array data division table created by this calculation, the cyclically divided array can be treated as an array having continuous subscripts for each processor.

【0016】次に、図3(3)のFORTRANソース
プログラムCの例では、配列データに対するDOループ
の初期値、終値がコンパイラ時に不明なため、図4や図
5に示す配列データ分割テーブルを作成することができ
ない。この場合は、初期値、終値に対して局所配列の添
字の範囲を計算するオブジェクトと、その範囲を繰り返
すDOループオブジェクトを生成する(図2のステップ
160)。図3(3)の例の配列が連続的に分割された
場合では、初期値、終値に対する局所配列の添字の範囲
は、元のDOループの初期値をn、終値をmとすると、
n、mを大域添字値とした各プロセッサipの局所添字
値の範囲であるn−ip×25〜ip×25と、各プロ
セッサIPの実際の局所添字値の範囲である1〜25と
の重なる部分として計算でき、それぞれ、局所初期値を
ln、局所終値lmとすると、 ln=max{1,min(26,n−ip×25)} (4) lm=mix{25,max(0,m−ip×25)} (5) となる。ここで、max,mixはそれぞれ最大値、最
小値をとる関数である。また、配列が循環的に分割され
た場合では、初期値、終値に対する局所配列の添字の範
囲は、元のDOループの初期値をn、終値をmとする
と、n、mを大域添字値とした局所添字の範囲である
((n−1) div 4)+1((m−1) div4)+1
を各プロセッサipに±1に補正を行うことにより計算
できる。
Next, in the example of the FORTRAN source program C of FIG. 3C, since the initial value and the final value of the DO loop for the array data are unknown at the time of the compiler, the array data division table shown in FIG. 4 and FIG. 5 is created. Can not do it. In this case, an object that calculates the range of the subscript of the local array with respect to the initial value and the final value and a DO loop object that repeats the range are generated (step 160 in FIG. 2). When the array of the example of FIG. 3C is continuously divided, the range of the subscript of the local array with respect to the initial value and the final value is n, where the initial value of the original DO loop is m and the final value is m.
The range of the local subscript value of each processor ip, where n and m are the global subscript values, n-ip × 25 to ip × 25, and the range of the actual local subscript value of each processor IP, 1 to 25, overlap. If the local initial value is ln and the local final value is lm, then ln = max {1, min (26, n-ip × 25)} (4) lm = mix {25, max (0, m -Ip × 25)} (5) Here, max and mix are functions that take a maximum value and a minimum value, respectively. Further, when the array is cyclically divided, the range of the subscripts of the local array with respect to the initial value and the final value is n and m are the global subscript values, where n is the initial value of the original DO loop and m is the final value. Is the range of the local subscripts ((n-1) div 4) +1 ((m-1) div 4) +1
Can be calculated by correcting each processor ip by ± 1.

【0017】図6に、変換された目的プログラムの例を
示す。なお、図3との対応が一見して分かるように、図
6ではFORTRANライクに記述してある。図6
(1)のFORTRANライクの目的プログラムAは、
図3(1)のFORTRANソースプログラムAに対し
て、図4の配列データ分割テーブルを参照して、図2の
ステップ140,150の処理が行なわれた結果を示し
たものである。この例では、DOループの初期値、終値
はプロセッサ数で分割された局所配列の添字の範囲内で
ある1から25の範囲に変換される。図6(2)のFO
RTRANライクの目的プログラムBは、図3(2)の
FORTRANソースプログラムBに対して、図5の配
列データ分割テーブルを参照して、同じく図2のステッ
プ140,150の処理が行なわれた結果を示したもの
である。この例では、循環的な分割指示が行なわれた配
列データに対して連続な局所添字に変換される。図6
(3)のFORTRANライクの目的プログラムCは、
図3(3)のFORTRANソースプログラムCに対し
て、図2のステップ160の処理が行なわれた結果を示
したものである。この例では、DOループの初期値、終
値が定数でないため、DO変数の値が局所配列の範囲内
になるように初期値と終値を計算した値を一時的変数に
置き、その範囲でループを繰り返す。
FIG. 6 shows an example of the converted target program. Note that, as can be seen at a glance, the correspondence with FIG. 3 is described as FORTRAN-like. Figure 6
The FORTRAN-like objective program A in (1) is
4 shows the result of the processing of steps 140 and 150 of FIG. 2 with reference to the array data division table of FIG. 4 for the FORTRAN source program A of FIG. 3 (1). In this example, the initial value and the final value of the DO loop are converted into the range of 1 to 25 which is within the range of the subscript of the local array divided by the number of processors. FO of FIG. 6 (2)
The RTRAN-like object program B refers to the FORTRAN source program B of FIG. 3 (2) by referring to the array data division table of FIG. 5 and also obtains the result of the processing of steps 140 and 150 of FIG. It is shown. In this example, the array data for which a cyclic division instruction has been performed is converted into a continuous local subscript. Figure 6
The FORTRAN-like objective program C in (3) is
4 shows the result of the processing of step 160 of FIG. 2 performed on the FORTRAN source program C of FIG. 3 (3). In this example, the initial value and the final value of the DO loop are not constants, so the values calculated for the initial value and the final value are placed in temporary variables so that the values of the DO variables are within the range of the local array, and the loop is executed in that range. repeat.

【0018】図7は、本発明による分散記憶向け並列計
算機の構成例として、図3(1)に示すソースプログラ
ムの指示により、配列データAの要素1〜100を4台
のプロセッサに25要素ずつ連続に分散してDOループ
を実行する構成を示したものである。図において、4台
のプロセッサ700〜730には、図3(1)のFOR
TRANソースプログラムAを変更した図6(1)に示
す目的プログラムAがロードされる。このプロセッサ7
00〜730の目的プログラムは同一構成である。記憶
装置740の配列データAの要素1〜100は、25要
素ずつ連続に分割されて、各々、プロセッサ700には
要素1〜25、プロセッサ410には要素26〜50、
プロセッサ720には要素51〜75、プロセッサ73
0には要素76〜100が分散格納される。この場合、
プロセッサ700〜730が、要素1〜100中のどの
要素群を格納すべきかは、先の式(1)で計算できる。
同様に、要素1〜100を、プロセッサ700〜730
に循環的に分散格納する場合は、先の式(2)で計算で
きる。なお、図4や図5に示したような配列データ分割
テーブルの大域添字値と局所添字値の対応をプロセッサ
に与えれば、計算を省略することができる。
FIG. 7 shows an example of the configuration of a parallel computer for distributed storage according to the present invention, in which the elements 1 to 100 of the array data A are provided to each of the four processors by 25 elements according to the instruction of the source program shown in FIG. It shows a configuration in which the DO loop is continuously distributed and executed. In the figure, the four processors 700 to 730 are connected to the FOR of FIG.
The target program A shown in FIG. 6A, which is a modification of the TRAN source program A, is loaded. This processor 7
The object programs of 00 to 730 have the same configuration. The elements 1 to 100 of the array data A of the storage device 740 are continuously divided into 25 elements, and the processor 700 includes elements 1 to 25, the processor 410 includes elements 26 to 50, and
The processor 720 includes elements 51 to 75 and a processor 73.
In 0, elements 76 to 100 are distributed and stored. in this case,
Which element group among the elements 1 to 100 should be stored by the processors 700 to 730 can be calculated by the above equation (1).
Similarly, elements 1-100 are replaced by processors 700-730.
In the case of cyclically distributed storage in, it can be calculated by the above equation (2). The calculation can be omitted if the processor is provided with the correspondence between the global subscript value and the local subscript value in the array data division table as shown in FIGS.

【0019】図6(1)に示したように、プロセッサ7
00〜730にロードされた目的プログラムのDOルー
プ内の配列の添字は、プロセッサ700〜730に分散
格納された局所配列Aの添字の範囲内であることを保証
している。この結果、プロセッサ700〜730では、
DOループ内における添字範囲の判定を行うことなく、
各々、自プロセッサに分散格納された配列データに対す
るDOループの実行を効率よく行うことができる。
As shown in FIG. 6A, the processor 7
The subscripts of the arrays in the DO loop of the target program loaded in 00 to 730 are guaranteed to be within the subscripts of the local array A distributed and stored in the processors 700 to 730. As a result, in the processors 700 to 730,
Without judging the subscript range in the DO loop,
Each of them can efficiently execute the DO loop for the array data distributedly stored in its own processor.

【0020】以上、実施例では、高級言語ソースプログ
ラムとしてFORTRAN(HighPerformance Fortr
an)を例に説明したが、本発明は、これに限定されない
ことは言うまでもない(例えば、COBOL、C言語で
もよい)。
As described above, in the embodiment, the FORTRAN (High Performance Fortr) is used as the high-level language source program.
However, it is needless to say that the present invention is not limited to this (for example, COBOL or C language may be used).

【0021】[0021]

【発明の効果】本発明によれば、並列実行向けの分割指
示と配列に対する大域のDOループを定義した高級言語
のソースプログラムを並列計算機の各プロセッサ向けの
目的プログラム(オブジェクト、目的コード)に変換す
るコンパイラにおいて、DOループの制御変数の値をプ
ロセッサの持つ局所配列の添字の範囲に変更したオブジ
ェクトを生成するため、プロセッサでは、分散された配
列型データのアクセスを行うDOループの実行をDOル
ープ内の判定なしに行うことができ、高速実行が可能に
なる。
According to the present invention, a high-level language source program that defines a global DO loop for partition instructions and arrays for parallel execution is converted into a target program (object, target code) for each processor of a parallel computer. In the compiler to generate the object in which the value of the control variable of the DO loop is changed to the range of the subscript of the local array of the processor, the processor executes the DO loop for accessing the distributed array type data. It can be performed without any judgment, and high-speed execution becomes possible.

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

【図1】本発明の一実施例にかかるコンパイラの全体の
構成図を示す。
FIG. 1 shows an overall configuration diagram of a compiler according to an embodiment of the present invention.

【図2】本発明の一実施例によるDOループ分割処理の
フローチャートを示す。
FIG. 2 shows a flowchart of a DO loop division process according to an embodiment of the present invention.

【図3】FORTRANソースプログラムの一例を示
す。
FIG. 3 shows an example of a FORTRAN source program.

【図4】図3(1)の例に対する配列データ分割テーブ
ルを示す。
FIG. 4 shows an array data division table for the example of FIG.

【図5】図3(2)の例に対する配列データ分割テーブ
ルを示す。
FIG. 5 shows an array data division table for the example of FIG. 3 (2).

【図6】図3(1)、(2)、(3)のFORTRAN
ソースプログラムに対する本発明による目的プログラム
を示す。
FIG. 6 is the FORTRAN of FIGS. 3 (1), (2), and (3).
3 shows an object program according to the invention for a source program.

【図7】本発明による分散記憶向け並列計算機の構成例
を示す。
FIG. 7 shows a configuration example of a parallel computer for distributed storage according to the present invention.

【図8】FORTRANソースプログラムの一例を示
す。
FIG. 8 shows an example of a FORTRAN source program.

【図9】従来技術による分散記憶向け並列計算機の構成
例を示す。
FIG. 9 shows a configuration example of a parallel computer for distributed storage according to a conventional technique.

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

10 コンパイラ 11 構文解析部 12 中間部 13 コード生成部 21 FORTRANソースプログラム 22 中間言語 23 中間言語 30 目的プログラム 10 compiler 11 syntax analysis unit 12 intermediate unit 13 code generation unit 21 FORTRAN source program 22 intermediate language 23 intermediate language 30 object program

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 並列実行向けの分割指示と配列に対する
大域のDOループを定義した高級言語のソースプログラ
ムを、並列計算機の各プロセッサ向けの目的プログラム
に変換するコンパイラであって、 前記ソースプログラムで定義された並列実行の分割指示
に従って、指定された配列を分割する手段と、 分割前の配列に対する添字の範囲と分割後の局所配列に
対する添字の範囲の関係を解析し、DOループ制御変数
の初期値、終値を局所配列の添字の範囲内とするDOル
ープオブジェクトを生成する手段と、を有することを特
徴とするコンパイラ。
1. A compiler for converting a high-level language source program that defines a global DO loop for partition instructions and arrays for parallel execution into a target program for each processor of a parallel computer, the compiler being defined by the source program. Means for splitting the specified array according to the split instruction for parallel execution, and analyzing the relationship between the range of subscripts for the array before splitting and the range of subscripts for the local array after splitting, and the initial value of the DO loop control variable , A means for generating a DO loop object whose closing price is within the range of the subscript of the local array, and a compiler.
【請求項2】 請求項1記載のコンパイラにおいて、D
Oループの初期値、終値が不明な場合には、初期値、終
値に対して局所配列の添字の範囲を計算するオブジェク
トと、前記範囲を繰り返すDOループオブジェクトを生
成する手段を有することを特徴とするコンパイラ。
2. The compiler according to claim 1, wherein D
When the initial value and the final value of the O loop are unknown, it has an object for calculating the range of the subscript of the local array with respect to the initial value and the final value, and means for generating a DO loop object that repeats the range. The compiler to do.
JP2818195A 1995-02-16 1995-02-16 Compiler Pending JPH08221276A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2818195A JPH08221276A (en) 1995-02-16 1995-02-16 Compiler

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2818195A JPH08221276A (en) 1995-02-16 1995-02-16 Compiler

Publications (1)

Publication Number Publication Date
JPH08221276A true JPH08221276A (en) 1996-08-30

Family

ID=12241551

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2818195A Pending JPH08221276A (en) 1995-02-16 1995-02-16 Compiler

Country Status (1)

Country Link
JP (1) JPH08221276A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006024088A (en) * 2004-07-09 2006-01-26 Fujitsu Ltd Translator program, method for converting program, and translator apparatus
KR101349631B1 (en) * 2011-12-07 2014-01-09 한국과학기술연구원 Method For Transforming Intermediate Language, System And Computer-Readable Recording Medium with Program Therefor

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006024088A (en) * 2004-07-09 2006-01-26 Fujitsu Ltd Translator program, method for converting program, and translator apparatus
KR101349631B1 (en) * 2011-12-07 2014-01-09 한국과학기술연구원 Method For Transforming Intermediate Language, System And Computer-Readable Recording Medium with Program Therefor

Similar Documents

Publication Publication Date Title
US4833606A (en) Compiling method for vectorizing multiple do-loops in source program
US5151991A (en) Parallelization compile method and system
JP2921190B2 (en) Parallel execution method
JP5516596B2 (en) Method and apparatus for design space search in high level synthesis
JPH07110800A (en) Optimized parallel compiling device and optimized parallel compiling method
JPH08221276A (en) Compiler
Lee et al. Global optimization for mapping parallel image processing tasks on distributed memory machines
Cosnard et al. Low memory cost dynamic scheduling of large coarse grain task graphs
JPH04307624A (en) Loop optimization system
JPH09160784A (en) Paralleled compiling system
JP2748582B2 (en) Compile processing unit
JP2956591B2 (en) Method and apparatus for parallelizing a loop having a conditional jump out of the loop
JPH0512033A (en) Parallel compiling system
JPH10326193A (en) Compile method for optimizing inline expansion function
JPH07234794A (en) Creating method for object program in multiprocessor system
McFarlin et al. Library function selection in compiling Octave
Lomüller et al. Scilab on a hybrid platform
Wichmann An experimental parallelizing systolic compiler for regular programs
CN118297099A (en) Model optimization method, model optimization device and computer storage medium
JPH04343140A (en) Parallelized processing system
JPS62169272A (en) Unrolling processing system for vector arithmetic string loop
JPH06290159A (en) Process assigning method for parallel computers
JP2564904B2 (en) Program optimization processing method
JP2001175617A (en) Compiler parallelizing method
JPH04286031A (en) Parallel execution processing method for loop of program