JPH07219909A - Method for converting program - Google Patents

Method for converting program

Info

Publication number
JPH07219909A
JPH07219909A JP6011196A JP1119694A JPH07219909A JP H07219909 A JPH07219909 A JP H07219909A JP 6011196 A JP6011196 A JP 6011196A JP 1119694 A JP1119694 A JP 1119694A JP H07219909 A JPH07219909 A JP H07219909A
Authority
JP
Japan
Prior art keywords
array
program
procedure
parallel
area
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
JP6011196A
Other languages
Japanese (ja)
Inventor
Hiroshi Ota
寛 太田
Tetsuro Saito
鉄郎 斉藤
Yasuhiko Saito
靖彦 斎藤
Masahiro Uminaga
正博 海永
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 JP6011196A priority Critical patent/JPH07219909A/en
Publication of JPH07219909A publication Critical patent/JPH07219909A/en
Withdrawn legal-status Critical Current

Links

Abstract

PURPOSE:To evade the generation of an error due to mismatch between the array areas of plural procedures which is generated when the contents of a sequentially processing program are arrayed in parallel in each procedure. CONSTITUTION:An array to be referred to in each procedure is analyzed (101), the division size of the array is determined (102) and the area size of an array element to be referred in a procedure concerned except an area specified by the division size is specified (103). Whether the range of an array area secured for the initial execution sentence of each procedure and a succeeding execution sentence to be a slave procedure accessing sentence coincides with the array element reference area of the procedure itself or not is decided, and when both the areas are mismatched, a library function accessing sentence for rescuing the areas of the array so that the secured array area matches with the array element reference range of its own procedure is added.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、逐次処理計算機または
共有メモリ型並列計算機用に記述されたプログラムを、
分散メモリ型の並列計算機上で実行可能なプログラムに
変換する、並列化コンパイラや並列化トランスレータの
技術に関するものである。
The present invention relates to a program written for a serial processing computer or a shared memory type parallel computer,
The present invention relates to a technique of a parallelizing compiler or a parallelizing translator that converts a program that can be executed on a distributed memory type parallel computer.

【0002】[0002]

【従来の技術】複数のプロセッサから構成される並列計
算機のうち、各プロセッサごとに固有のメモリを備えて
いるものは、分散メモリ型並列計算機と呼ばれる。
2. Description of the Related Art Among parallel computers composed of a plurality of processors, one having a memory unique to each processor is called a distributed memory type parallel computer.

【0003】そして、このような分散メモリ型並列計算
機において、科学技術計算などに現われる大規模配列の
処理を実行するときは、通常、処理する配列の各要素を
各プロセッサのメモリに分割して割り付け、各プロセッ
サにおいて、割り付けられた各要素の処理を並列に実行
することにより、配列要素の並列処理を実現している。
In such a distributed memory parallel computer, when processing a large-scale array that appears in scientific and technological calculations, each element of the array to be processed is usually divided into memory of each processor and allocated. In each processor, parallel processing of array elements is realized by executing processing of each allocated element in parallel.

【0004】さて、このような分散メモリ型並列計算機
における配列要素の並列処理のための、配列の分割の方
式としては、従来、たとえば、図23に示すような方式
が知られている。
As a method of dividing an array for parallel processing of array elements in such a distributed memory type parallel computer, a method as shown in FIG. 23 is conventionally known.

【0005】図23中、小さいます目が1個の配列要素
を表し、その上に付けられている数字はその要素が割り
付けられるプロセッサの番号を表す。なお、ここでは、
配列は、1次元の配列、プロセッサの台数は4台として
示す。
In FIG. 23, the small squares represent one array element, and the number attached above it represents the processor number to which the element is assigned. In addition, here
The array is a one-dimensional array, and the number of processors is four.

【0006】さて、図23(a)は、巡回分割と呼ばれ
る方式を示しており、この方式によれば、配列の各要素
を1個ずつ順に異なるプロセッサに割り付ける。そし
て、最後のプロセッサまで達したら、また最初のプロセ
ッサから割り付ける。
FIG. 23 (a) shows a method called cyclic division. According to this method, each element of the array is sequentially allocated to different processors one by one. Then, when the last processor is reached, allocation is performed again from the first processor.

【0007】次に、図23(b)は、巡回ブロック分割
と呼ばれる方式を示しており、この方式によれば、いく
つかの配列要素をまとめて1ブロックとし、ブロックを
単位として巡回的に各プロセッサに割り付ける。図示し
た例では配列要素を2個ずつまとめて1個のブロックと
している。
Next, FIG. 23 (b) shows a method called cyclic block division. According to this method, several array elements are grouped into one block, and each block is cyclically divided into blocks. Assign to the processor. In the illustrated example, two array elements are grouped into one block.

【0008】最後に、図23(c)は、非巡回ブロック
分割と呼ばれる方式を示しており、この方式によれば、
配列全体を等分して各プロセッサに、それぞれ割り付け
る。
Finally, FIG. 23 (c) shows a method called acyclic block division. According to this method,
The entire array is equally divided and assigned to each processor.

【0009】なお、ここでは、1次元配列について示し
たが、配列が多次元の場合には、各次元についてこのよ
うな方式の組み合わせによって分割する方式も考えられ
る。
Although a one-dimensional array is shown here, when the array is multidimensional, a method of dividing each dimension by a combination of such methods is also conceivable.

【0010】ここで、逐次処理用言語で記述されたプロ
グラムに対して、配列の分割やプロセッサ間通信文の挿
入などを行って、並列計算機用のプログラムに変換する
言語プロセッサのことを、並列化コンパイラと呼んでい
る。
Here, a language processor for converting a program written in a serial processing language into a program for a parallel computer by dividing an array or inserting interprocessor communication statements into a program is parallelized. I call it a compiler.

【0011】そして、並列化コンパイラでは、前述した
ように、複数のプロセッサに配列要素の並列処理を行わ
せるために、配列を分割して並列プログラムを生成する
必要がある。
As described above, in the parallelizing compiler, it is necessary to divide the array and generate a parallel program in order to allow a plurality of processors to perform parallel processing of the array element.

【0012】このような配列を分割して並列プログラム
を生成する従来の技術としては、たとえば、Hiranandan
i, Kennedy, and Tseng, "Evaluation of Compiler Opt
imizations for Fortran D on MIMD Distributed-Memor
y Machines", Proc. of 1992Int'l Conf. on Supercomp
uting, pp.1-14, July 1992 記載の技術が知られてい
る。
A conventional technique for dividing such an array to generate a parallel program is, for example, Hiranandan.
i, Kennedy, and Tseng, "Evaluation of Compiler Opt
imizations for Fortran D on MIMD Distributed-Memor
y Machines ", Proc. of 1992Int'l Conf. on Supercomp
The technology described in uting, pp.1-14, July 1992 is known.

【0013】この技術によれば、Fortran言語で
記述された逐次処理用のプログラム中に、配列の分割パ
ターンを指定する指示文をユーザに挿入してもらい、そ
の指示文に従って配列を分割し並列プログラムを生成す
る。
According to this technique, a user inserts an instruction statement designating an array division pattern into a program for sequential processing written in the Fortran language, the array is divided according to the instruction statement, and the parallel program is executed. To generate.

【0014】この技術を、次のようなFortran言
語で記述されたプログラムを例にとり説明する。
This technique will be described by taking a program described in the following Fortran language as an example.

【0015】 ◇ REAL A(100), B(100)◇ DISTRIBUTE A(BLOCK), B(BLOCK)◇ DO J=2,99◇ A(J) = B(J-1)+...+B(J+1)◇ ENDDO◇ このプログラムでは、1行目で要素数100の実数型配
列AとBが宣言されている。2行目のDISTRIBU
TE文は前述した指示文であり、配列A,Bの分割パタ
ーンをを非巡回ブロック分割とすることを指示してい
る。また、3行目から5行目では、Jの値を、2から9
9まで、1ずつ増加させながら、 A(J) = B(J−1)+...+B(J+1) の計算を実行すべきことが指示されている。
◇ REAL A (100), B (100) ◇ DISTRIBUTE A (BLOCK), B (BLOCK) ◇ DO J = 2,99 ◇ A (J) = B (J-1) + ... + B (J + 1) ◇ ENDDO ◇ In this program, the real type arrays A and B with 100 elements are declared in the first line. Second line DISTRIBU
The TE sentence is the above-mentioned directive sentence, and indicates that the division pattern of the arrays A and B is a non-cyclic block division. In the 3rd to 5th lines, the value of J is changed from 2 to 9
Up to 9, increasing by 1 while A (J) = B (J-1) +. . . It is instructed that the calculation of + B (J + 1) should be performed.

【0016】さて、このようなプログラムを、その中に
挿入された指示文、 DISTRIBUTE A(BLOCK), B(BL
OCK) に従って並列化変換すると次のようになる。なお、ここ
では、プロセッサ数は4とする。
By the way, such a program has the directives inserted therein, DISTRIBUTE A (BLOCK), B (BL
The parallel conversion according to OCK) is as follows. Note that the number of processors is four here.

【0017】 ◇ REAL A(25), B(0:26)◇ {Bの境界要素を隣のプロセッサに転送。}◇ DO J=LB,UB◇ A(J) = B(J-1)+...+B(J+1)◇ ENDDO◇ このプログラムは全プロセッサに共通である。ただし、
プロセッサごとに異なる処理が必要な部分については、
プログラム内に、プロセッサ番号によって異なる処理を
行うよう指示文を格納するようにする。たとえば、変数
LB,UBはループ実行範囲の下限と上限を表すが、そ
れはプログラムの実行時には、プロセッサごとに異なる
値が代入される。この場合、元のプログラムのループの
実行範囲が2から99までなので、(LB,UB)の組
は、プロセッサ1では(2,25)、プロセッサ2,3
では(1,25)、プロセッサ4では(1,24)とな
る。
◇ REAL A (25), B (0:26) ◇ {Transfer the boundary element of B to the adjacent processor. } ◇ DO J = LB, UB ◇ A (J) = B (J-1) + ... + B (J + 1) ◇ ENDDO ◇ This program is common to all processors. However,
For parts that require different processing for each processor,
An instruction statement is stored in the program so that different processing is performed depending on the processor number. For example, the variables LB and UB represent the lower limit and the upper limit of the loop execution range, which are assigned different values for each processor when the program is executed. In this case, since the loop execution range of the original program is from 2 to 99, the set of (LB, UB) is (2, 25) in processor 1, and processor 2, 3
Becomes (1,25), and processor 4 becomes (1,24).

【0018】ここで注目すべき点は、配列Aの要素の範
囲は1から25までなのに対して、配列Bでは0から2
6までになっていることである。要素数100の配列を
4台のプロセッサに非巡回ブロック分割すれば、各プロ
セッサの要素数は、本来は配列Aのように25になる。
しかし、配列Bがループ内でB(J−1),B(J+
1)の形で参照されているため、プロセッサの境界付近
のBの要素は、隣り合う両方のプロセッサで必要にな
る。この様子を図24に示す。
It should be noted that the range of the elements of the array A is 1 to 25, while that of the array B is 0 to 2
It is up to 6. If an array with 100 elements is divided into four processors in a non-cyclic block, the number of elements of each processor is originally 25 as in array A.
However, the array B is B (J-1), B (J +
Since it is referred to in the form of 1), the element of B near the boundary of the processor is required by both adjacent processors. This state is shown in FIG.

【0019】図示するように、たとえば、B(25)と
いう要素は本来プロセッサ1に割り付けられるが、プロ
セッサ2においてA(26)の値を計算するためにB
(25)の値が必要になる。したがい、このような境界
の要素については、本来は隣のプロセッサに割り付けら
れるべき要素についても領域を確保して、ループの実行
の前に隣のプロセッサから値を転送してもらわなければ
ならない。このため、配列Bの型宣言中では、境界領域
の分だけ要素の範囲を拡張しているのである。
As shown in the figure, for example, the element B (25) is originally assigned to the processor 1, but B is used to calculate the value of A (26) in the processor 2.
The value of (25) is required. Therefore, for such a boundary element, it is necessary to secure an area for an element that should be originally allocated to the adjacent processor and have the value transferred from the adjacent processor before the execution of the loop. For this reason, in the type declaration of the array B, the range of elements is expanded by the boundary area.

【0020】[0020]

【発明が解決しようとする課題】ところで、プログラム
は、一般的にメインプログラムや、サブル−ティンとい
った手続を複数含んでいる。また、プログラムの並列化
変換は、各手続をそれそれ並列化変換した後に、これら
を結合することにより行われるのが一般的である。
By the way, a program generally includes a plurality of procedures such as a main program and a subroutine. Further, parallel conversion of a program is generally performed by parallelizing and converting each procedure and then combining them.

【0021】しかし、前述したHiranandaniらの技術に
よれば、このような複数の手続きから構成されるプログ
ラムを手続毎に並列化変換する場合に、次のような問題
が生じる。
However, according to the above-mentioned technique of Hiranandani et al., The following problems occur when parallelizing and converting a program composed of such a plurality of procedures for each procedure.

【0022】すなわち、確保される境界領域のサイズ
が、ある手続きと別の手続きとの間で異なったものとな
ってしまい、そのため、それらの手続きを結合すると領
域の不一致のために誤ったプログラムになってしまうと
いう問題が生じるのである。
That is, the size of the reserved boundary area differs between one procedure and another procedure. Therefore, if these procedures are combined, a wrong program will result due to area mismatch. The problem arises that

【0023】たとえば、前述した例の配列Bがある別の
手続きでも参照されている場合であって、その手続きの
中でB(J−1),B(J+1)のような形の参照がな
い場合には、その手続の並列化された後の配列Bの宣言
は、配列Aと同様にB(25)となる。これは前述のB
(0:26)という宣言とは一致しないので、このよう
な手続きを結合したプログラムは正しく動作しない。
For example, when the array B in the above-mentioned example is referred to by another procedure, there is no reference such as B (J-1) or B (J + 1) in the procedure. In this case, the declaration of the array B after the procedure is parallelized becomes B (25) like the array A. This is B mentioned above
Since it does not match the declaration (0:26), a program that combines such procedures will not operate correctly.

【0024】そこで本発明は、複数の手続きに分かれて
いるプログラムを、手続毎に、正しく動作する並列プロ
グラムに変換することを提供することを目的とする。
Therefore, an object of the present invention is to provide a conversion of a program divided into a plurality of procedures into a parallel program which operates correctly for each procedure.

【0025】[0025]

【課題を解決するための手段】前記目的達成のために、
本発明は、たとえば、配列を参照して処理を行う変換対
象プログラムを、分散メモリ型並列計算機の複数のプロ
セッサによって並列に実行される並列プログラムであっ
て、前記配列の部分の領域を確保し、領域を確保した配
列の部分を参照して処理を行う並列プログラムに変換す
るプログラム変換方法であって、変換対象プログラムを
構成する複数の手続きの、それぞれについて、少なくと
も、当該手続を変換した並列プログラム中で参照する配
列のうちの他の手続と共有される配列に関して、当該配
列の大きさと、配列の参照の仕方を解析するステップ
と、前記解析結果に基づいて、当該手続を変換した並列
プログラム中で参照する配列の部分の範囲を決定するス
テップと、当該手続を変換した並列プログラムを実行す
るプロセッサの実行の対象が、前記変換対象プログラム
に含まれる他の手続を変換した並列プログラムより、当
該手続を変換した並列プログラムに切り替わった後に最
初に実行される実行文として、当該実行文の実行開始時
に領域が確保されている前記配列の部分の範囲と当該手
続を変換した並列プログラムが参照する配列の部分の範
囲とが一致しているかを、前記決定した配列の部分の範
囲より判定し、一致していない場合には、前記配列の部
分の領域を当該手続を変換した並列プログラムが参照す
る配列の部分の範囲に合致するように確保し直し、確保
し直した領域に当該手続を変換した並列プログラムを実
行するプロセッサが参照する配列の部分を取り込む処理
の実行を指定する実行文を当該手続を変換した並列プロ
グラム中に記述するステップとを有することを特徴とす
るプログラム変換方法を提供する。
[Means for Solving the Problems] To achieve the above object,
The present invention is, for example, a parallel program executed by a plurality of processors of a distributed memory parallel computer for a conversion target program that performs processing by referring to an array, and secures an area of the array portion, A program conversion method for converting a parallel program for performing processing by referring to a portion of an array that secures an area, wherein at least for each of a plurality of procedures constituting a conversion target program, a parallel program obtained by converting the procedure In the parallel program that converts the procedure based on the analysis result of the size of the array and how to refer to the array with respect to the array shared with other procedures in the array referred to in 1. Determining the range of the portion of the array to be referenced, and executing the processor that executes the parallel program that is the conversion of the procedure An area is secured at the start of execution of the execution statement as an execution statement that is executed first after the target is switched from the parallel program that has converted the other procedure included in the conversion target program to the parallel program that has converted the procedure. If the range of the part of the sequence that has been performed and the range of the part of the sequence referred to by the parallel program that has converted the procedure match are determined from the range of the determined part of the sequence, and they do not match Reallocates the area of the array so that it matches the range of the array referenced by the parallel program that has converted the procedure, and executes the parallel program that has converted the procedure in the area that has been allocated again. And a step of writing an execution statement that specifies the execution of the process of fetching the part of the array referenced by the processor in the parallel program obtained by converting the procedure. It provides a program conversion method characterized by.

【0026】[0026]

【作用】前述した本発明に係るプログラム変換方法によ
れば、手続を変換した並列プログラムを実行するプロセ
ッサの実行の対象が、前記変換対象プログラムに含まれ
る他の手続を変換した並列プログラムより、当該手続を
変換した並列プログラムに切り替わった後に最初に実行
される実行文として追加された実行文によって、当該実
行文の実行開始時に領域が確保されている前記配列の部
分の範囲と当該手続を変換した並列プログラムが参照す
る配列の部分の範囲とが一致しているかが、前記決定し
た配列の部分の範囲に基づいて判定され、一致していな
い場合には、前記配列の部分の領域が当該手続を変換し
た並列プログラムが参照する配列の部分の範囲に合致す
るように確保し直され、確保し直された領域に当該手続
を変換した並列プログラムを実行するプロセッサが参照
する配列の部分が取り込まれる。
According to the above-described program conversion method of the present invention, the target of execution of the processor that executes the parallel program with the converted procedure is more than the parallel program with converted other procedures included in the conversion target program. The procedure is converted by the execution statement added as the first execution statement after switching the procedure to the converted parallel program, and the range of the array part where the area is secured at the start of execution of the execution statement and the procedure. Whether or not the range of the sequence part referred to by the parallel program matches is determined based on the determined range of the sequence part. If they do not match, the region of the sequence part executes the procedure. The parallel program is re-allocated so that it matches the range of the array part that the converted parallel program refers to, and the parallel program that converted the procedure to the re-allocated area Sequence portion of a processor that executes a gram refers is captured.

【0027】したがい、一つのプログラムを構成する手
続を変換した並列プログラム毎に、同じ配列に対して異
なる範囲の領域が確保されていたとしても、この場合に
は、この配列を参照する処理に先立ち、領域の再確保が
行われ、その領域に、並列プログラムを実行するプロセ
ッサが参照する配列の部分が取り込まれるので、プログ
ラムは正しく動作することができる。
Therefore, even if areas of different ranges are secured for the same array for each parallel program obtained by converting the procedure forming one program, in this case, prior to the process of referring to this array. , The area is reallocated, and the area of the array referenced by the processor executing the parallel program is fetched in the area, so that the program can operate correctly.

【0028】[0028]

【実施例】以下、本発明の実施例について説明する。EXAMPLES Examples of the present invention will be described below.

【0029】初めに、本実施例において、並列化変換し
た並列プログラムを実行する分散メモリ型並列計算機に
ついて、あらかじめ説明する。
First, in the present embodiment, a distributed memory type parallel computer that executes a parallel program that has been parallelized and converted will be described in advance.

【0030】図1に、この分散メモリ型並列計算機の構
成を示す。
FIG. 1 shows the configuration of this distributed memory type parallel computer.

【0031】図示するように、分散メモリ型並列計算機
は、複数のプロセッサ201から20n、これらを結合
する相互結合ネットワーク22、各プロセッサに付随す
るローカルメモリ211から21n、外部記憶装置22
1から22nから構成される。各ローカルメモリ上のデ
ータは、それが付随するプロセッサからは直接参照でき
るが、他のプロセッサからは直接参照することはできな
い。あるプロセッサに付随するローカルメモリ上のデー
タを他のプロセッサから参照するためには、相互結合ネ
ットワーク22を通じて、そのデータの転送を受けなけ
ればならない。
As shown in the figure, the distributed memory type parallel computer includes a plurality of processors 201 to 20n, an interconnection network 22 connecting them, local memories 211 to 21n attached to each processor, and an external storage device 22.
It is composed of 1 to 22n. 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 to refer to the data on the local memory associated with a certain processor from another processor, the data must be transferred through the interconnection network 22.

【0032】また、各プロセッサには、1から始まるプ
ロセッサ番号が付けられているものとする。すなわち、
プロセッサ201は1番、プロセッサ202は2番、・
・・のように番号付けられているものとする。並列プロ
グラムは、たとえば、外部記憶装置22nに格納されて
おり、必要に応じて、プロセッサ20nより各プロセッ
サに転送され実行される。
It is assumed that each processor is assigned a processor number starting from 1. That is,
Processor 201 is number 1, processor 202 is number 2, ...
・ ・ ・ Shall be numbered. The parallel program is stored in, for example, the external storage device 22n, and is transferred from the processor 20n to each processor and executed as necessary.

【0033】本実施例では、一例として、このような分
散メモリ型並列計算機で実行される並列プログラムに、
図2、図3に示した2つの逐次処理用のプログラムを並
列化変換する場合を例にとり説明する。
In this embodiment, as an example, a parallel program executed by such a distributed memory parallel computer is
A case where the two serial processing programs shown in FIGS. 2 and 3 are converted into parallel programs will be described as an example.

【0034】図2に示したプログラム300と、図3に
示したプログラム301は、それぞれ、上位手続きと下
位手続きの関係にある。
The program 300 shown in FIG. 2 and the program 301 shown in FIG. 3 have a relationship between a high-order procedure and a low-order procedure, respectively.

【0035】すなわち、図2の上位手続きプログラム3
00内の文、◇ CALL SUB(A,B)◇ によって、図3の下位手続きプログラム301が呼び出
される。また、手続き呼び出しの引数となっているデー
タA,Bは、各プログラム300および301内の宣言
文、◇ REAL A(100), B(100)◇ によって、100個の要素を持つ1次元の配列データで
あることが宣言されている。
That is, the upper procedure program 3 of FIG.
The statement in 00, ◇ CALL SUB (A, B) ◇, calls the lower procedure program 301 in FIG. The data A and B, which are the arguments of the procedure call, are a one-dimensional array having 100 elements according to the declaration statements in each of the programs 300 and 301, ◇ REAL A (100), B (100) ◇. It is declared to be data.

【0036】ここで、本実施例では、上位手続きプログ
ラム300と下位手続きプログラム301は、異なるフ
ァイルに格納されているものとする。そして、本実施例
では、並列化変換を、手続きごとに別々に行う。すなわ
ち、各手続きを独立に変換した後、これらを結合して並
列計算機で実際に実行される実行モジュールを作成す
る。ただし、両方のプログラム300および301が同
じファイル内に格納されている場合にも、本実施例は、
同様に適用可能である。
In this embodiment, it is assumed that the upper procedure program 300 and the lower procedure program 301 are stored in different files. Then, in the present embodiment, the parallelization conversion is separately performed for each procedure. That is, after converting each procedure independently, these are combined to create an execution module that is actually executed by a parallel computer. However, even if both programs 300 and 301 are stored in the same file, this embodiment
It is applicable as well.

【0037】以下、本発明に係るプログラム変換方法の
第1の実施例について説明する。
The first embodiment of the program conversion method according to the present invention will be described below.

【0038】図4に、本第1実施例に係るプログラム並
列変換の手順を示す。
FIG. 4 shows the procedure of program parallel conversion according to the first embodiment.

【0039】図示するように、本手順では、まず、ステ
ップ100で、変換前のプログラム300(図2参照)
または301(図3参照)を読み込む。そして、ステッ
プ101でプログラム内のループにおける配列データの
参照パターンを解析して、参照パターン表に登録する。
As shown in the figure, in this procedure, first, in step 100, the program 300 before conversion (see FIG. 2).
Alternatively, 301 (see FIG. 3) is read. Then, in step 101, the reference pattern of the array data in the loop in the program is analyzed and registered in the reference pattern table.

【0040】参照パタ−ン表には、図5に示すように、
プログラムのループ内で参照される配列要素の添字式の
パターンが登録される。参照パターン表は、ループ番号
フィールド4000、配列名フィールド4001、添字
式フィールド4002の各フィールドから構成される。
In the reference pattern table, as shown in FIG.
The subscript pattern of the array element referenced in the program loop is registered. The reference pattern table is composed of a loop number field 4000, an array name field 4001, and a subscript expression field 4002.

【0041】図5(a)は、上位手続きプログラム30
0に対する参照パターン表400を、図5(b)は、下
位手続きプログラム301に対する参照パターン表40
1を示している。ステップ101によて、図5(a)の
参照パターン表400には、図2のプログラム300の
ループ10に現れる配列要素A(I),B(I)、およ
び、ループ20に現れる配列要素A(I),B(I)が
登録され、また、図5(b)の参照パターン表401に
は、図3のプログラム301のループ30に現れる配列
要素A(I),B(I−1),B(I+1)が登録され
る。
FIG. 5A shows the upper procedure program 30.
0 is a reference pattern table 400, and FIG. 5B is a reference pattern table 40 for the lower procedure program 301.
1 is shown. According to step 101, in the reference pattern table 400 of FIG. 5A, the array elements A (I) and B (I) appearing in the loop 10 of the program 300 of FIG. 2 and the array element A appearing in the loop 20 of FIG. (I) and B (I) are registered, and array elements A (I) and B (I-1) appearing in the loop 30 of the program 301 of FIG. 3 are registered in the reference pattern table 401 of FIG. 5B. , B (I + 1) are registered.

【0042】次に、ステップ102では、参照パターン
表400または401に基づいて、配列の分割パターン
を決定する。
Next, in step 102, the array division pattern is determined based on the reference pattern table 400 or 401.

【0043】そして、ステップ103で、参照パターン
表400または401に基づいて、配列の分割の境界領
域のサイズを決定する。そして、決定した分割パターン
や境界領域サイズを、配列分割表に登録する。
Then, in step 103, the size of the boundary region of the array division is determined based on the reference pattern table 400 or 401. Then, the determined division pattern and boundary area size are registered in the array division table.

【0044】配列分割表は、図6に示すように、配列名
フィールド4100、分割ブロックサイズフィールド4
101、境界サイズフィールド4102の各フィールド
から構成される。図6(a)は、上位手続きプログラム
300に対する配列分割表410を、図6(b)は、下
位手続きプログラム301に対する配列分割表411を
示している。
The array division table is, as shown in FIG. 6, an array name field 4100 and a divided block size field 4.
101 and boundary size field 4102. FIG. 6A shows an array division table 410 for the upper procedure program 300, and FIG. 6B shows an array division table 411 for the lower procedure program 301.

【0045】ここで、分割パターンは、1次元配列の場
合、分割ブロックサイズによって表現できる。すなわ
ち、分割ブロックサイズは、巡回分割ならば1であり、
非巡回ブロック分割ならば(配列要素数)/(プロセッ
サ台数)を整数に切り上げた値であり、巡回ブロック分
割ならばその中間の値である。多次元配列の場合にはさ
らに、分割する次元などの情報が必要となる。本実施例
では、説明の便宜上、プログラム300、301に現れ
る配列A、Bは1次元配列であり、分割パターンは非巡
回ブロック分割であり、(配列要素数)/(プロセッサ
台数)を整数に切り上げた値でブロックサイズを表現す
るものとする。そして、配列分割表への分割パターンの
登録として、分割ブロックサイズフィールド4101に
手続き内で参照される配列の分割ブロックサイズを登録
を行うこととする。
Here, in the case of a one-dimensional array, the division pattern can be expressed by the division block size. That is, the divided block size is 1 for cyclic division,
In the case of non-cyclic block division, it is a value obtained by rounding up (number of array elements) / (number of processors) to an integer, and in the case of cyclic block division, it is an intermediate value. In the case of a multidimensional array, information such as the dimension to be divided is further required. In this embodiment, for convenience of explanation, the arrays A and B appearing in the programs 300 and 301 are one-dimensional arrays, the division pattern is non-cyclic block division, and (the number of array elements) / (the number of processors) is rounded up to an integer. The block size is expressed by the value. Then, as the registration of the division pattern in the array division table, the division block size of the array referred to in the procedure is registered in the division block size field 4101.

【0046】一方、境界サイズの決定は、プログラム内
で参照されている配列の各々について、図7に示す手順
を行うことによって行う。
On the other hand, the boundary size is determined by performing the procedure shown in FIG. 7 for each of the arrays referred to in the program.

【0047】すなわち、まず、ステップ1030で、参
照パターン表400または401を検索して、対象とし
ている配列についてその添字式の形が「I+定数」であ
るような参照を抽出する。ここでIは、ループの制御変
数を表す。
That is, first, in step 1030, the reference pattern table 400 or 401 is searched to extract a reference whose subscript expression is "I + constant" for the target array. Here, I represents the control variable of the loop.

【0048】次に、ステップ1031で、そのような参
照の中で、「定数」の絶対値が最大のものを選択する。
そして、ステップ1032で、その最大のものの絶対値
をその配列の境界サイズとして決定し、配列分割表40
0または401の、その配列についての境界サイズフィ
ールド4102に登録する。
Next, in step 1031, of such references, the one with the largest absolute value of "constant" is selected.
Then, in step 1032, the absolute value of the largest one is determined as the boundary size of the array, and the array partition table 40
Register 0 or 401 in the boundary size field 4102 for that array.

【0049】たとえば、図5(a)の上位手続きの参照
パターン表400で、配列Aの参照は2個あるが、その
添字式はいずれも「I」である。これは「I+0」と見
なせるので、前記の定数の値は0となる。0の絶対値は
0であるから、上位手続きにおける配列Aの境界サイズ
は0と決定し、その値を、図6(a)の上位手続きの配
列分割表410の境界サイズフィールド4102に登録
する。また、たとえば図6(b)の下位手続きの参照パ
ターン表401で、配列Bの参照の添字式は「I−1」
と「I+1」であり、それぞれ、上記の定数値は−1と
1となる。そして、これらの絶対値は、共に1であるか
ら、下位手続きにおける配列Bの境界サイズは1と決定
し、この値を図6(b)の下位手続きの配列分割表41
1の境界サイズフィールド4102に登録する。
For example, in the reference pattern table 400 of the higher-level procedure of FIG. 5A, the array A has two references, but the subscript expressions are all "I". Since this can be regarded as "I + 0", the value of the constant is 0. Since the absolute value of 0 is 0, the boundary size of the array A in the upper procedure is determined to be 0, and the value is registered in the boundary size field 4102 of the array division table 410 of the upper procedure in FIG. 6A. Further, for example, in the reference pattern table 401 of the lower procedure in FIG. 6B, the reference subscript expression of the array B is "I-1".
And “I + 1”, and the above constant values are −1 and 1, respectively. Since both of these absolute values are 1, the boundary size of the array B in the lower procedure is determined to be 1, and this value is set to the array division table 41 of the lower procedure in FIG. 6B.
It is registered in the boundary size field 4102 of 1.

【0050】このようにして、配列分割表への登録が済
んだら、次に、図4ステップ104において、プログラ
ムを走査して下位手続き呼び出し文を検出する。そし
て、下位手続き呼び出し文が検出された場合にはステッ
プ105に進み、プログラム中に下位手続き呼び出し文
がない場合はステップ109に進む。
After the registration in the array partition table is completed in this way, next, in step 104 in FIG. 4, the program is scanned to detect the lower procedure call statement. Then, if a lower procedure call statement is detected, the procedure proceeds to step 105, and if there is no lower procedure call statement in the program, the procedure proceeds to step 109.

【0051】図2に示した上位手続きプログラム300
では下位手続き呼び出し文があるのでステップ105に
進み、下位手続きプログラム301では下位手続き呼び
出し文がないのでステップ109に進むことになる。
Upper procedure program 300 shown in FIG.
Then, since there is a lower procedure call statement, the procedure proceeds to step 105. Since there is no lower procedure call statement in the lower procedure program 301, the procedure proceeds to step 109.

【0052】さて、ステップ105では、検出された下
位手続き呼び出しの実引数の中に配列データがあるかど
うかを判定する。そして、もしあればステップ106に
進み、なければステップ109に進む。
Now, in step 105, it is determined whether or not there is array data in the actual argument of the detected lower procedure call. If so, the process proceeds to step 106, and if not, the process proceeds to step 109.

【0053】ステップ106では、下位手続き呼び出し
の実引数となっている配列データに対して、その配列の
分割ブロックサイズを格納する変数および境界サイズを
格納する変数を生成して、その変数の宣言文をプログラ
ムに挿入する。ブロックサイズ変数名は、配列名に_B
LOCKという文字列を付け加えたものとし、境界サイ
ズ変数名は、配列名に_MARGINという文字列を付
け加えたものとする。なお、これらの変数の型は整数型
とする。また、元の配列の宣言文に、その配列の領域が
再確保の対象になることを表すキーワードを挿入する。
In step 106, a variable for storing the divided block size of the array and a variable for storing the boundary size are generated for the array data which is the actual argument of the lower procedure call, and the declaration statement of the variable is generated. Is inserted into the program. The block size variable name is _B in the array name
It is assumed that the character string LOCK is added, and the boundary size variable name is the array name to which the character string _MARGIN is added. The types of these variables are integer types. In addition, a keyword indicating that the area of the array is to be reallocated is inserted in the declaration statement of the original array.

【0054】たとえば、図6の上位手続きプログラム3
00では、配列A,Bが下位手続き呼び出し文◇ CALL SUB(A,B)◇ の実引数になっているので、ステップ105からステッ
プ106に進み、変数A_BLOCK, A_MARG
IN, B_BLOCK, B_MARGINを生成し
て、これらの変数の宣言文◇ INTEGER A_BLOCK, A_MARGIN, B_BLOCK, B_MARGIN◇ をプログラムに挿入する。また、配列A, Bの宣言文
に、領域再確保の対象であることを表すキーワード’A
LLOCATABLE::’を挿入する。
For example, the upper procedure program 3 in FIG.
In 00, the arrays A and B are the actual arguments of the subprocedure call statement ◇ CALL SUB (A, B) ◇, so the process proceeds from step 105 to step 106, and variables A_BLOCK and A_MRG are used.
Generate IN, B_BLOCK, B_MARGIN and insert the declaration statements ◇ INTEGER A_BLOCK, A_MARGIN, B_BLOCK, B_MARGIN ◇ of these variables into the program. In addition, in the declaration statements of arrays A and B, the keyword'A indicating that the area is to be reallocated is displayed.
Insert LLOCATABLE :: '.

【0055】ここで、図8に、図2に示した上位手続き
プログラム300の、並列変換した並列化上位手続きプ
ログラム310を示しておく、ここまで説明した手順に
よって、配列A,Bの宣言文には、◇ REAL, ALLOCATABLE :: A(25), B(25)◇ のようにキーワードが挿入され、その後に、新たに生成
した変数の宣言文◇ INTEGER A_BLOCK, A_MARGIN, B_BLOCK, B_MARGIN◇ が挿入される。なお、宣言文中の各配列の大きさは、前
述したHiranandaniらの技術と同様にして決
定することができる。ただし、本第1実施例では、配列
分割表より直接定めることもできる。
Here, FIG. 8 shows the parallelized parallelized higher-order procedure program 310 of the higher-order procedure program 300 shown in FIG. 2. The declaration statements of the arrays A and B are made by the procedure described so far. Is inserted with a keyword such as ◇ REAL, ALLOCATABLE :: A (25), B (25) ◇, and after that, the newly created variable declaration statement ◇ INTEGER A_BLOCK, A_MARGIN, B_BLOCK, B_MARGIN ◇ is inserted. It Note that the size of each array in the declaration can be determined in the same manner as the technique of Hiranandani et al. However, in the first embodiment, it can be directly determined from the array partition table.

【0056】さて、ステップ106の後、次に、ステッ
プ107で、生成したブロックサイズ変数と境界サイズ
変数を、下位手続き呼び出しの実引数として追加する。
追加する位置は、それぞれ対応する配列引数の直後とす
る。
Now, after step 106, next, in step 107, the generated block size variable and boundary size variable are added as actual arguments of the lower procedure call.
The position to add is immediately after the corresponding array argument.

【0057】図2の上位手続きプログラム300では、
上記の下位手続き呼び出し文◇ CALL SUB(A,B)◇ に対してこの処理が行われ、これにより、この下位手続
き呼び出し文は、図8の変換後上位手続きプログラム3
10内に示すように、◇ CALL SUB(A, A_BLOCK, A_MARGIN, B, B_BLOCK, B_MARGI
N)◇ と変換される。
In the upper procedure program 300 of FIG.
This process is performed on the above-mentioned lower procedure call statement ◇ CALL SUB (A, B) ◇, so that this lower procedure call statement is converted to the higher procedure program 3 in FIG.
As shown in 10, CALL SUB (A, A_BLOCK, A_MARGIN, B, B_BLOCK, B_MARGI
N) Converted to ◇.

【0058】次に、ステップ108では、図6に示した
配列分割表を参照して、境界サイズ変数の値を調べて配
列領域を再確保する文を、下位手続き呼び出しの直後に
挿入する。具体的には、CHECK_MARGINとい
うライブラリ関数の呼び出しを挿入する。CHECK_
MARGINは5個の引数を取り、第1引数は配列の先
頭アドレス、第2引数はその配列に対するブロックサイ
ズ変数、第3引数は上位手続き内でのブロックサイズを
表す整数、第4引数はその配列に対する境界サイズ変
数、第5引数は上位手続き内での境界サイズを表す整数
である。
Next, at step 108, a statement for checking the value of the boundary size variable and reallocating the array area with reference to the array partition table shown in FIG. 6 is inserted immediately after the lower procedure call. Specifically, the call of the library function CHECK_MARKIN is inserted. CHECK_
MARGIN takes five arguments, the first argument is the start address of the array, the second argument is the block size variable for that array, the third argument is an integer representing the block size in the higher-level procedure, and the fourth argument is the array. The boundary size variable for, the fifth argument is an integer that represents the boundary size within the higher order procedure.

【0059】図2の上位手続きプログラム300に対し
ては、図8の変換後上位手続きプログラム310内に示
すように、上記の下位手続き呼び出し文◇ CALL SUB(A, A_BLOCK, A_ MARGIN, B, B_BLOCK, B_MARGIN)◇ の直後に◇ CALL CHECK_MARGIN(A, A_BLOCK, 25, A_MARGIN, 0)◇ CALL CHECK_MARGIN(B, B_BLOCK, 25, B_MARGIN, 0)◇ という文が挿入される。
For the high-order procedure program 300 of FIG. 2, as shown in the converted high-order procedure program 310 of FIG. 8, the above-mentioned low-order procedure call statement ◇ CALL SUB (A, A_BLOCK, A_ MARGIN, B, B_BLOCK , B_MARGIN) ◇ immediately after ◇ CALL CHECK_MARGIN (A, A_BLOCK, 25, A_MARGIN, 0) ◇ CALL CHECK_MARGIN (B, B_BLOCK, 25, B_MARGIN, 0) ◇ is inserted.

【0060】ライブラリ関数CHECK_MARGIN
の機能の詳細は後で述べるが、ここでは、その概要を説
明しておく。図8の変換後上位手続きプログラム310
では、CHECK_MARGINの呼び出しは下位手続
き呼び出しの直後なので、下位手続プログラムの実行直
後である。したがい、ブロックサイズ変数や境界サイズ
変数には、下位手続き内でのブロックサイズや境界サイ
ズの値が格納されている。CHECK_MARGIN
は、それらの値と、第3、第5引数として与えられた上
位手続き内でのブロックサイズや境界サイズとを比較す
る。
Library function CHECK_MARKIN
Although the details of the function of will be described later, the outline thereof will be described here. Converted upper-level procedure program 310 of FIG.
Then, since the call of CHECK_MARKIN is immediately after the call of the lower procedure, it is immediately after the execution of the lower procedure program. Therefore, the block size variable and the boundary size variable store the values of the block size and the boundary size in the lower procedure. CHECK_MARKIN
Compares those values with the block size and boundary size in the upper procedure given as the third and fifth arguments.

【0061】もしそれらが一致していなければ、CHE
CK_MARGINは、配列領域の再確保や配列要素の
並べ変えを行って、上位手続き内でのブロックサイズや
境界サイズに合わせる。これによって、ブロックサイズ
や境界サイズが下位手続き内でどうなっていようとも、
実行が下位手続から戻ってきた直後に、上位手続き内で
の値に合わせることができ、プログラムの正しい動作が
保証される。
If they do not match, CHE
CK_MARGIN reallocates the array area and rearranges the array elements to match the block size and boundary size in the higher-level procedure. By doing this, no matter what the block size or boundary size is in the subprocedure,
Immediately after execution returns from the subprocedure, the value in the superprocedure can be matched to ensure correct operation of the program.

【0062】次に、ステップ109では、自手続きがメ
インプログラムすなわち最上位手続きかどうかを判定す
る。もしメインプログラムならばステップ113に進
み、そうでなければステップ110に進む。上位手続き
プログラム300がメインプログラムであるとすれば、
それを変換している場合はステップ113に進むことに
なる。また、下位手続きプログラム301はメインプロ
グラムではないので、それを変換している場合はステッ
プ110に進むことになる。
Next, in step 109, it is judged whether or not the own procedure is the main program, that is, the highest-level procedure. If it is the main program, the process proceeds to step 113, and if not, the process proceeds to step 110. If the higher-level procedure program 300 is the main program,
If it has been converted, the process proceeds to step 113. Further, since the lower procedure program 301 is not the main program, if it is being converted, the process proceeds to step 110.

【0063】次に、ステップ110では、自手続きの仮
引数の中に配列データがあるかどうかを判定する。もし
あればステップ111に進み、なければステップ113
に進む。ステップ111で自手続きの仮引数となってい
る配列データに対して、ステップ106と同様に、その
配列の分割ブロックサイズを格納する変数および境界サ
イズを格納する変数を生成して、その変数の宣言文をプ
ログラムに挿入する。また、元の配列の宣言文に、その
配列の領域が再確保の対象になることを表すキーワード
を挿入する。
Next, at step 110, it is judged whether or not there is array data in the dummy argument of the self procedure. If so, go to step 111, otherwise go to step 113
Proceed to. In step 111, for the array data that is the dummy argument of the procedure itself, similarly to step 106, a variable that stores the divided block size of the array and a variable that stores the boundary size are generated, and the variable is declared. Insert a statement into your program. In addition, a keyword indicating that the area of the array is to be reallocated is inserted in the declaration statement of the original array.

【0064】たとえば、図3の下位手続きプログラム3
01では、仮引数の中に配列A,Bがあるので、ステッ
プ110からステップ111に進む。
For example, the lower procedure program 3 of FIG.
In 01, since there are arrays A and B in the dummy argument, the process proceeds from step 110 to step 111.

【0065】ここで、図9に、図3に示した下位手続き
プログラム301の、並列変換した並列化上位手続きプ
ログラム311を示しておく。図示するように、配列
A,Bの宣言文には、ステップ111によって、◇ REAL, ALLOCATABLE :: A(25), B(0:26)◇ のようにキーワードが挿入される。また、その後に、新
たに生成した変数の宣言文◇ INTEGER A_BLOCK, A_MARGIN, B_BLOCK, B_MARGIN◇ が挿入される。なお、前述したように宣言文中の各配列
の大きさは、前述したHiranandaniらの技術
と同様にして定めることもできるし、本第1実施例の場
合では、配列分割表より直接定めることもできる。
Here, FIG. 9 shows a parallelized high-order procedure program 311 obtained by performing parallel conversion of the low-order procedure program 301 shown in FIG. As shown in the figure, keywords such as ◇ REAL, ALLOCATABLE :: A (25), B (0:26) ◇ are inserted in the declaration statements of the arrays A and B in step 111. After that, the newly created variable declaration statements ◇ INTEGER A_BLOCK, A_MARGIN, B_BLOCK, B_MARGIN ◇ are inserted. Note that, as described above, the size of each array in the declaration statement can be determined in the same manner as the technology of Hiranandani et al. Described above, or in the case of the first embodiment, it can be directly determined from the array partition table. .

【0066】次に、ステップ111の後、ステップ11
2で、生成したブロックサイズ変数と境界サイズ変数
を、自手続き呼び出しの仮引数として追加する。追加す
る位置は、それぞれ対応する配列引数の直後とする。
Next, after step 111, step 11
In step 2, the generated block size variable and boundary size variable are added as dummy arguments of the self procedure call. The position to add is immediately after the corresponding array argument.

【0067】図3の下位手続きプログラム301に対し
ては、図9の変換後下位手続きプログラム311内に示
されるように、◇ SUBROUTINE SUB(A, B)◇が、 ◇ SUBROUTINE SUB(A, A_BLOCK, A_MARGIN, B, B_BLOCK, B
_MARGIN)◇と、変換されることになる。
For the lower procedure program 301 of FIG. 3, ◇ SUBROUTINE SUB (A, B) ◇, ◇ SUBROUTINE SUB (A, A_BLOCK, as shown in the converted lower procedure program 311 of FIG. A_MARGIN, B, B_BLOCK, B
_MARGIN) ◇ will be converted.

【0068】次に、ステップ113では、境界サイズ変
数の値を調べて配列領域を再確保する文を自手続きの先
頭に挿入する。具体的には、前述したCHECK_MA
RGINというライブラリ関数の呼び出しを挿入する。
Next, in step 113, a statement for checking the value of the boundary size variable and reallocating the array area is inserted at the beginning of the procedure itself. Specifically, the above-mentioned CHECK_MA
Insert a call to a library function called RGIN.

【0069】このステップ113によって、図2の上位
手続きプログラム300に対しては、図8の変換後上位
手続きプログラム310内に示すように、手続きの先頭
に◇ CALL CHECK_MARGIN(A, A_BLOCK, 25, A_MARGIN, 0)◇ CALL CHECK_MARGIN(B, B_BLOCK, 25, B_MARGIN, 0)◇ という文が挿入される。なお、後述するように、CHE
CK_MARGINは、配列領域がまだ確保されていな
い場合は、それを確保するという機能をも持っている。
これによって、上位手続き内で配列の初期領域が確保さ
れる。
By this step 113, for the upper procedure program 300 of FIG. 2, as shown in the post-conversion upper procedure program 310 of FIG. 8, ◇ CALL CHECK_MARGIN (A, A_BLOCK, 25, A_MARGIN , 0) ◇ CALL CHECK_MARGIN (B, B_BLOCK, 25, B_MARGIN, 0) ◇ is inserted. As will be described later, CHE
CK_MARGIN also has a function of reserving the array area if it is not already reserved.
As a result, the initial area of the array is secured in the upper procedure.

【0070】一方、ステップ113によって、図3の下
位手続きプログラム301に対しては、図9の変換後下
位手続きプログラム311内に示すように、手続きの先頭
に◇ CALL CHECK_MARGIN(A, A_BLOCK, 25, A_MARGIN, 0)◇ CALL CHECK_MARGIN(B, B_BLOCK, 25, B_MARGIN, 1)◇ という文が挿入される。下位手続きでは配列Bの境界サ
イズが1であるから、CHECK_MARGINの第5
引数は1となっている。
On the other hand, in step 113, for the lower procedure program 301 of FIG. 3, as shown in the post-conversion lower procedure program 311 of FIG. 9, ◇ CALL CHECK_MARGIN (A, A_BLOCK, 25, A_MARGIN, 0) ◇ CALL CHECK_MARGIN (B, B_BLOCK, 25, B_MARGIN, 1) ◇ is inserted. Since the boundary size of the array B is 1 in the subordinate procedure, the 5th value of CHECK_MARKIN is set.
The argument is 1.

【0071】これによって、前述したCHECK_MA
RGINの機能により、ブロックサイズや境界サイズが
上位手続き内でどうなっていようとも、下位手続きプロ
グラムが呼び出された直後に、下位手続き内での値に合
わせることができ、プログラムの正しい動作が保証され
る。
As a result, the above-mentioned CHECK_MA
The RGIN function ensures that the correct operation of the program is guaranteed, regardless of the block size or boundary size in the higher-level procedure, immediately after the lower-level procedure program is called, it can be adjusted to the value in the lower-level procedure. It

【0072】次に、ステップ114で、プログラム並列
化のための、その他の変換処理を実行する。この中に
は、境界領域の配列要素の値をプロセッサ間で交換する
ライブラリ関数の呼び出し文◇ CALL EXCHANGE_MARGIN(B, B_BLOCK,B_MARGIN)◇ の挿入や、ループのインデックス範囲の変更などが含ま
れる。境界領域の配列要素の値をプロセッサ間で交換す
るライブラリ関数EXCHANGE_MARGINの詳
細については後述する。
Next, at step 114, other conversion processing for program parallelization is executed. This includes insertion of a call statement ◇ CALL EXCHANGE_MARGIN (B, B_BLOCK, B_MARGIN) ◇ of a library function for exchanging array element values in the boundary area between processors, and change of loop index range. Details of the library function EXCHANGE_MARKING that exchanges the values of array elements in the boundary area between processors will be described later.

【0073】最後に、ステップ115では、変換後のプ
ログラム310または311を外部記憶に出力して、処
理を終了する。
Finally, in step 115, the converted program 310 or 311 is output to the external storage, and the process is terminated.

【0074】さて、前述したライブラリ関数CHECK
_MARGINとEXCHANGE_MARGINの機
能の詳細を説明する。
Now, the above-mentioned library function CHECK
The details of the functions of _MARKIN and EXCHANGE_MARKIN will be described.

【0075】前述したように作成した並列プログラムが
実際に並列計算機上で実行される際、これらの関数は、
プログラムより呼びだされると次のような処理を行う。
When the parallel program created as described above is actually executed on the parallel computer, these functions are
When called from the program, the following processing is performed.

【0076】まず、ライブラリ関数CHECK_MAR
GINについて説明する。
First, the library function CHECK_MAR
The GIN will be described.

【0077】図10に、ライブラリ関数CHECK_M
ARGINの行う処理の手順を示す。
FIG. 10 shows the library function CHECK_M.
The procedure of the process performed by ARGIN is shown.

【0078】図示するように、ライブラリ関数CHEC
K_MARGINは、呼びだされると、ステップ700
で、自身に渡された引数を調べて、配列の現在の先頭ア
ドレス、現在の分割ブロックサイズ、現在の境界サイズ
を得る。また、ステップ701で、同じく自身に渡され
た引数を調べて、配列の新しい分割ブロックサイズと境
界サイズ、すなわちCHECK_MARGINを呼び出
した手続きの中で必要としているブロックサイズと境界
サイズを得る。そして、ステップ702でその配列の領
域が既に確保されているかどうかを調べる。これは、配
列の現在のブロックサイズや境界サイズが0かどうかを
判定することによって行われる。配列領域が未確保と
は、プログラム実行時の初期にまだその配列が使用され
ておらず、したがって領域が全く確保されていないこと
である。もし未確保ならばステップ703に進み、配列
の宣言文に従い、配列の領域を確保してから、ステップ
708に進む。ステップ702において、もし配列の領
域が既に確保されていれば、ステップ704に進む。
As shown, the library function CHEC
When K_MARGIN is called, step 700
Then, the argument passed to itself is checked to obtain the current start address of the array, the current divided block size, and the current boundary size. Further, in step 701, the argument similarly passed to itself is checked to obtain the new divided block size and boundary size of the array, that is, the block size and boundary size required in the procedure that called CHECK_MARKIN. Then, in step 702, it is checked whether or not the area of the array is already secured. This is done by determining whether the current block size or border size of the array is zero. The non-allocation of the array area means that the array is not yet used at the early stage of program execution, and therefore the area is not reserved at all. If not secured, the process proceeds to step 703 to secure the array area according to the array declaration statement, and then proceeds to step 708. In step 702, if the array area is already reserved, the process proceeds to step 704.

【0079】ステップ704では、配列の現在のブロッ
クサイズと新ブロックサイズが等しく、かつ、現在の境
界サイズと新境界サイズが等しいかどうか判定する。も
し等しければ、そのまま処理を終了する。もしいずれか
一方でも等しくなければ、ステップ705に進み、新し
いブロックサイズに境界サイズを合わせたサイズの領域
を確保する。そしてステップ706で、新たに確保した
領域の、適当な位置に元の領域中の配列をコピーする。
次に、ステップ707で、前の領域を解放し、ステップ
708で、引数として渡された3つの変数、配列の先頭
アドレス、現在の分割ブロックサイズ、現在の境界サイ
ズ(*、*_BLOCK,*_MARGIN)を、それ
ぞれ、新しい値に更新する。
In step 704, it is determined whether the current block size and the new block size of the array are the same and the current boundary size and the new boundary size are the same. If they are equal to each other, the processing is finished as it is. If either of them is not equal, the process proceeds to step 705 to secure an area having a size that matches the boundary size with the new block size. Then, in step 706, the array in the original area is copied to an appropriate position in the newly secured area.
Next, in step 707, the previous area is released, and in step 708, the three variables passed as arguments, the start address of the array, the current divided block size, the current boundary size (*, * _BLOCK, * _MARGIN). ) Are each updated to a new value.

【0080】なお、ステップ704で、現在の境界サイ
ズと新境界サイズのみならず、配列の現在のブロックサ
イズと新ブロックサイズをも比較するのは、手続毎にそ
の手続で行う処理の応じた異なった配列の分割方式(図
23参照)が採用される場合があることを考慮したもの
である。全ての手続について、本第1実施例で示した2
つの手続(図2、3)のように、配列の分割方式が保証
されている場合は、現在の境界サイズと新境界サイズの
みを比較するようにしてもよい。
Note that in step 704, not only the current boundary size and the new boundary size but also the current block size and the new block size of the array are compared for each procedure depending on the processing performed by the procedure. This is because it takes into consideration that an array division method (see FIG. 23) may be adopted. Regarding all procedures, 2 shown in the first embodiment
When the array division method is guaranteed, as in one procedure (FIGS. 2 and 3), only the current boundary size and the new boundary size may be compared.

【0081】さて、このようにライブラリ関数CHEC
K_MARGINは、それを実行するプロセッサと、こ
れに付随するロ−カルメモリ上に、図11に示すような
配列領域再確保装置80を構成する。
Now, in this way, the library function CHEC
K_MARGIN constitutes an array area reallocating device 80 as shown in FIG. 11 on the processor for executing it and the local memory associated with it.

【0082】配列領域再確保装置8中の、配列領域未確
保判定部800は、図10のステップ702の処理を実
行する。サイズ比較部801は、図10のステップ70
4の処理を実行する。配列領域確保・解放部802は、
図10のステップ703,705,および707の処理
を実行する。変数更新部803は、図10のステップ7
08の処理を実行する。配列コピー部804は、図10
のステップ706の処理を実行する。このような構成に
よって、配列領域再確保装置80は、外部から与えられ
た、現先頭アドレス変数820、現ブロックサイズ変数
821、現境界サイズ変数822、新ブロックサイズ変
数823、新境界サイズ変数824を用いて、配列領域
再確保を実行する。これらの変数は、配列領域再確保装
置80に付随させた記憶領域に格納させておく。
The array area unsecured determination section 800 in the array area reallocation device 8 executes the processing of step 702 in FIG. The size comparison unit 801 uses step 70 in FIG.
Process 4 is executed. The array area securing / releasing unit 802
The processing of steps 703, 705, and 707 of FIG. 10 is executed. The variable updating unit 803 performs step 7 in FIG.
The processing of 08 is executed. The sequence copy unit 804 is shown in FIG.
The processing of step 706 is executed. With such a configuration, the array area reallocating device 80 uses the current start address variable 820, the current block size variable 821, the current boundary size variable 822, the new block size variable 823, and the new boundary size variable 824 which are given from the outside. To reallocate the array area. These variables are stored in the storage area associated with the array area reallocating device 80.

【0083】次に、ライブラリ関数EXCHANE_M
ARGINの行う処理を説明する。
Next, the library function EXCHANGE_M
The processing performed by ARGIN will be described.

【0084】図12に、ライブラリ関数EXCHANE
_MARGINの行う処理の手順を示す。
FIG. 12 shows the library function EXCHANGE.
The procedure of the process performed by _MARKIN is shown.

【0085】いま、説明の便宜上、図24に示すよう
に、並列計算機を構成する各プロセッサがプロセッサ番
号順に左から右に並び、いまライブラリ関数EXCHA
NE_MARGINの引数は配列Bを指定しており、こ
の配列Bの要素は要素番号順に左から右に並んでいるも
のとして説明する。
For convenience of explanation, as shown in FIG. 24, the processors constituting the parallel computer are arranged in the order of the processor numbers from left to right, and now the library function EXCHA is used.
It is assumed that the argument of NE_MARGIN specifies the array B, and the elements of the array B are arranged in the order of element numbers from left to right.

【0086】まず、ライブラリ関数EXCHANE_M
ARGINを実行するプロセッサは、まず、ステップ7
21で、自身が、左端のプロセッサであるかを判定し、
そうであればステップ723に進む。
First, the library function EXCHANGE_M
The processor that executes ARGIN starts with step 7
At 21, it determines if it is the leftmost processor,
If so, proceed to step 723.

【0087】一方、そうでなければ、ステップ722
で、配列Bの先頭より第3引数B_MARGIN個の進
んだ位置よりB_MARGIN個のデータを左隣のプロ
セッサに転送し、ステップ723に進む。ここで、配列
Bの先頭は、第1引数によって指定される。
On the other hand, if not, step 722.
Then, B_MARKIN data is transferred to the left adjacent processor from the position where the third argument B_MARKIN is advanced from the beginning of the array B, and the process proceeds to step 723. Here, the beginning of the array B is designated by the first argument.

【0088】ステップ723では、自身が右端のプロセ
ッサであるかを判定し、そうであればステップ726に
進む。一方、そうでなければ、ステップ724で、右隣
のプロセッサから転送されたデータを、配列Bの領域の
先頭より第3引数B_MARGIN個と第2引数B_B
LOCK個のデータ分進んだ位置より格納する。そし
て、ステップ725で、配列Bの先頭より第2引数B_
BLOCK個のデータ分進んだ位置よりB_MARGI
N個のデータを右隣のプロセッサに転送し、ステップ7
26に進む。
In step 723, it is determined whether or not the processor itself is the rightmost processor, and if so, the process proceeds to step 726. On the other hand, if not, in step 724, the data transferred from the processor on the right is transferred from the beginning of the area of the array B to the third argument B_MARKIN and the second argument B_B.
Store from the position advanced by LOCK data. Then, in step 725, the second argument B_
B_MARKI from the position advanced by BLOCK data
Transfer N data to the processor on the right, step 7
Proceed to 26.

【0089】ステップ726では、再度、自身が、左端
のプロセッサであるかを判定し、そうであれば処理を終
了し、そうでなければステップ727に進み、左隣のプ
ロセッサから転送されたデータを、配列Bの領域の先頭
の位置より格納する。
In step 726, it is again judged whether or not it is the leftmost processor, and if so, the processing is terminated, and if not so, the processing proceeds to step 727, in which the data transferred from the processor on the left is transferred. , Array B is stored from the beginning of the area.

【0090】さて、以上説明してきたプログラム変換の
手順は、図13に示すような並列プログラム生成システ
ムにおいて実行することができる。
The program conversion procedure described above can be executed in a parallel program generation system as shown in FIG.

【0091】図示するように、並列プログラム生成シス
テム9は、並列化コンパイラ5、リンケージエディタ9
1、および並列処理用ライブラリ92から構成される。
並列処理用ライブラリ92は、配列領域を再確保する関
数(CHECK_MARGIN)920や、関数EXC
HANGEを含む。ユーザが作成した変換前プログラム
30は、並列化コンパイラに5よって変換され、変換後
プログラム31として出力される。リンケージエディタ
91は、複数の変換後プログラム31や並列処理用ライ
ブラリ92を結合して、実行可能プログラム35を生成
する。この実行可能プログラム35が、並列計算機の各
プロセッサ201から20nで実行可能な並列プログラ
ムとなる。
As shown in the figure, the parallel program generation system 9 includes a parallelizing compiler 5 and a linkage editor 9.
1 and a parallel processing library 92.
The parallel processing library 92 includes a function (CHECK_MARKING) 920 for reallocating an array area and a function EXC.
Includes HANGE. The pre-conversion program 30 created by the user is converted by the parallelizing compiler 5 and output as the post-conversion program 31. The linkage editor 91 combines the plurality of converted programs 31 and the parallel processing library 92 to generate the executable program 35. The executable program 35 is a parallel program that can be executed by the processors 201 to 20n of the parallel computer.

【0092】そして、前記並列化コンパイラ5は、図1
4に示すように、構文解析部50、参照パターン解析部
51、分割パターン・境界サイズ決定部52、変換部5
3、コード生成部54、参照パターン表40、配列分割
表41から構成される。
Then, the parallelizing compiler 5 is configured as shown in FIG.
4, the syntax analysis unit 50, the reference pattern analysis unit 51, the division pattern / boundary size determination unit 52, and the conversion unit 5
3, a code generation unit 54, a reference pattern table 40, and an array division table 41.

【0093】変換部53には、手続き呼び出し検出部5
30、分割パターン用・境界サイズ用変数生成部53
1、配列領域再確保文挿入部533が含まれる。構文解
析部50は、図4のステップ100の処理を行う。すな
わち、変換前プログラム30を読み込んで、中間語60
を生成する。中間語60は、コンパイラ内部でのプログ
ラムの表現であり、その形式は従来のコンパイラと同様
のものを用いることができる。参照パターン解析部51
は、図4のステップ101の処理を行う。すなわち、配
列参照パターンを解析して参照パターン表40に登録す
る。分割パターン・境界サイズ決定部52は、図4のス
テップ102およびステップ103の処理を行う。すな
わち、参照パターン表に基づいて配列の分割ブロックサ
イズと境界サイズを決定し配列分割表41に登録する。
The conversion unit 53 includes a procedure call detection unit 5
30, division pattern / boundary size variable generation unit 53
1. An array area re-secured sentence insertion unit 533 is included. The syntax analysis unit 50 performs the process of step 100 of FIG. That is, the pre-conversion program 30 is read and the intermediate language 60 is read.
To generate. The intermediate language 60 is an expression of a program inside the compiler, and its format can be the same as that of a conventional compiler. Reference pattern analysis unit 51
Performs the process of step 101 in FIG. That is, the array reference pattern is analyzed and registered in the reference pattern table 40. The division pattern / boundary size determination unit 52 performs the processes of step 102 and step 103 of FIG. That is, the divided block size and the boundary size of the array are determined based on the reference pattern table and registered in the array divided table 41.

【0094】手続き呼び出し検出部530は、図4のス
テップ104,105,109および110の処理を行
う。すなわち、下位手続き呼び出しを検出したり、自手
続きがメインプログラムかどうかを判定したり、引数に
配列データがあるかどうかを調べたりする。分割パター
ン用・境界サイズ用変数生成部531は、図4のステッ
プ107,108,111および112の処理を行う。
すなわち、分割ブロックサイズ用変数および境界サイズ
用変数を生成して、その変数の宣言文を中間語60に挿
入し、またその変数を引数として中間語60に追加す
る。配列領域再確保文挿入部532は、図4のステップ
108および113の処理を行う。すなわち、配列領域
を再確保する文を中間語60に挿入する。図4のステッ
プ114の処理は、変換部53のその他の部分で行われ
る。コード生成部54では、中間語60を読み込んで変
換後プログラム31を生成する。
The procedure call detector 530 performs the processing of steps 104, 105, 109 and 110 in FIG. That is, it detects a sub-procedure call, determines whether or not the procedure itself is the main program, and checks whether or not there is array data in the argument. The division pattern / boundary size variable generation unit 531 performs the processes of steps 107, 108, 111 and 112 of FIG.
That is, a variable for divided block size and a variable for boundary size are generated, the declaration sentence of the variable is inserted into the intermediate word 60, and the variable is added to the intermediate word 60 as an argument. The array area reassurance sentence insertion unit 532 performs the processing of steps 108 and 113 of FIG. That is, a sentence for reallocating the array area is inserted into the intermediate word 60. The process of step 114 in FIG. 4 is performed by the other part of the conversion unit 53. The code generator 54 reads the intermediate word 60 and generates the converted program 31.

【0095】なお、実際には、このような並列プログラ
ム生成システムや並列化コンパイラは、対応するプログ
ラムによって計算機上に実現される。
Actually, such a parallel program generation system and a parallelizing compiler are realized on a computer by a corresponding program.

【0096】以上、本発明の第1の実施例について説明
した。
The first embodiment of the present invention has been described above.

【0097】以下、本発明の第2の実施例について説明
する。
The second embodiment of the present invention will be described below.

【0098】本第2実施例は、前記第1実施例において
境界サイズの最小値を予め決めておくようにしたもので
ある。
In the second embodiment, the minimum value of the boundary size in the first embodiment is predetermined.

【0099】いま、境界サイズの最小値を1とした場合
を例にとり本第2実施例を説明する。
Now, the second embodiment will be described by taking the case where the minimum boundary size is 1 as an example.

【0100】本第2実施例では、前述した手順に代え
て、図15に示す手順によって、境界サイズを決定す
る。
In the second embodiment, the boundary size is determined by the procedure shown in FIG. 15 instead of the procedure described above.

【0101】なお、この手順は、プログラム内で参照さ
れている配列の各々について行われる。
Note that this procedure is performed for each of the sequences referenced in the program.

【0102】さて、本第2実施例では、まず、ステップ
1030およびステップ1031において、前記第1実
施例と同様に、参照パターン表400または401(図
5参照)を検索して、対象としている配列についてその
添字式の形が「I+定数」であるような参照を抽出し、
そのような参照の中で、「定数」の絶対値が最大のもの
を選択する。
In the second embodiment, first, in step 1030 and step 1031, as in the first embodiment, the reference pattern table 400 or 401 (see FIG. 5) is searched and the target array is searched. For a reference whose subscript form is "I + constant",
Among such references, the one with the largest absolute value of "constant" is selected.

【0103】そして、ステップ1035で、その最大の
絶対値と予め決められた境界サイズの最小値1とを比較
する。もし絶対値が1以上ならばステップ1036に進
み、絶対値が1未満ならば、すなわち0ならばステップ
1037に進む。
Then, in step 1035, the maximum absolute value is compared with the minimum value 1 of the predetermined boundary size. If the absolute value is 1 or more, the process proceeds to step 1036, and if the absolute value is less than 1, that is, 0, the process proceeds to step 1037.

【0104】ステップ1036では、その最大の絶対値
をその配列の境界サイズとして決定し、配列分割表内の
その配列に対する境界サイズフィールド4102に登録
する。
At step 1036, the maximum absolute value is determined as the boundary size of the array and registered in the boundary size field 4102 for the array in the array partition table.

【0105】一方、ステップ1037では予め決められ
た最小値1を境界サイズとし、その配列に対する境界サ
イズフィールド4102に登録する。
On the other hand, in step 1037, the predetermined minimum value 1 is set as the boundary size and registered in the boundary size field 4102 for the array.

【0106】たとえば図2に示した上位手続きの参照パ
ターン表400で、配列Aについて絶対値を求めれば0
となるが、これは1未満なので、境界サイズを0でなく
1とする。
For example, in the reference pattern table 400 of the higher order procedure shown in FIG.
However, since this is less than 1, the boundary size is set to 1 instead of 0.

【0107】同様にして上位手続きプログラム内の配列
Bや、下位手続きプログラム内の配列Aについても、境
界サイズは1となる。
Similarly, the array B in the upper procedure program and the array A in the lower procedure program have a boundary size of one.

【0108】以下、このようにして求めた境界サイズを
用いて、前記第1実施例と同様にプログラムの変換を行
うと、変換後の上位手続きおよび下位手続きプログラム
は、それぞれ、図16および図17に示すように、分割
後の配列のサイズがいずれも(0:26)となってお
り、また、ライブラリ関数CHECK_MARGINの
第5引数(境界サイズ)がいずれも1となる。
Thereafter, when the program is converted using the boundary size thus obtained in the same manner as in the first embodiment, the converted high-order procedure and low-order procedure programs are shown in FIGS. 16 and 17, respectively. As shown in, the size of the array after division is (0:26), and the fifth argument (boundary size) of the library function CHECK_MARGIN is 1.

【0109】このため、図16の変換後上位手続きプロ
グラム312と図17の変換後下位手続きプログラム3
13を結合した場合に、いずれの手続きにおいても、配
列A,Bに対してサイズ1の境界領域が確保されている
ので、ライブラリ関数CHECK_MARGINの中で
実際に領域の再確保が起こることはない。また、異なる
手続きにおいて、ある配列に対して異なるサイズの境界
領域が確保される必要がある場合でも、前記第1実施例
と同様に領域の再確保が行われるので、動作に支障がで
ることはない。
Therefore, the post-conversion upper procedure program 312 of FIG. 16 and the post-conversion lower procedure program 3 of FIG.
When 13 is combined, since the boundary area of size 1 is secured for the arrays A and B in any of the procedures, the reallocation of the area does not actually occur in the library function CHECK_MARKIN. Further, even when it is necessary to secure a boundary area having a different size for a certain array in a different procedure, the area is re-allocated as in the first embodiment, and thus the operation is not disturbed. Absent.

【0110】このように、本第2実施例によれば、配列
の参照パターンによらずに、予め境界領域を設けておく
ことにより、プログラム実行中に配列領域の再確保が起
こる確率を小さくすることができる。これは、実用的プ
ログラムでは、必要な境界サイズは1,2などの小さな
整数であることが多いためである。したがって、本第2
実施例によれば、適当に境界サイズの最小値を定めるこ
とにより、配列再確保のオーバーヘッドを少なくし、処
理性能の向上を図ることが望める。
As described above, according to the second embodiment, the boundary area is provided in advance irrespective of the array reference pattern, thereby reducing the probability that the array area is re-secured during program execution. be able to. This is because in practical programs, the required boundary size is often a small integer such as 1 or 2. Therefore, this second book
According to the embodiment, it is possible to reduce the overhead of re-securing the array and improve the processing performance by appropriately setting the minimum value of the boundary size.

【0111】以下、本発明の第3の実施例について説明
する。
The third embodiment of the present invention will be described below.

【0112】本第3実施例では、境界サイズも指定でき
るように指示文の仕様を拡張し、あらかじめ、ユーザに
よって変換元のプログラム中で境界サイズを指示しても
らう。
In the third embodiment, the specification of the directive is expanded so that the boundary size can also be specified, and the user specifies the boundary size in the conversion source program in advance.

【0113】図18および図19は、それぞれ、ユーザ
による指示文が挿入された変換前上位手続きプログラム
304、および、下位手続きプログラム305の例を示
している。
FIG. 18 and FIG. 19 show examples of the pre-conversion high-order procedure program 304 and the low-order procedure program 305, respectively, in which the instruction text by the user is inserted.

【0114】上位手続きプログラム304および下位手
続きプログラム305内には指示文◇ DISTRIBUTE A(BLOCK:MARGIN(0)), B(BLOCK:MARGIN(1))
◇ がユーザによって挿入されている。指示文内のMARG
IN(m)という指定(mは整数)は、境界サイズをm
とすることを指示する。したがって、この指示文は、配
列Aの分割パターンは非巡回ブロック分割であり境界サ
イズは0、また、配列Bの分割パターンは非巡回ブロッ
ク分割であり境界サイズは1ということを指示する。も
ちろん、ユーザの責任で、これらの指示は各手続き間で
一致していなければならない。
Directives in the high-order procedure program 304 and the low-order procedure program 305 DISTRIBUTE A (BLOCK: MARGIN (0)), B (BLOCK: MARGIN (1))
◇ has been inserted by the user. MARG in the directive
The specification of IN (m) (m is an integer) sets the boundary size to m.
And instruct you to. Therefore, this directive indicates that the division pattern of the array A is a non-cyclic block division and the boundary size is 0, and the division pattern of the array B is a non-cyclic block division and the boundary size is 1. Of course, it is the responsibility of the user to ensure that these instructions are consistent between procedures.

【0115】さて、本第3実施例では、このようなプロ
グラムを、図20に示す手順に従って、並列化変換す
る。
In the third embodiment, such a program is parallelized and converted according to the procedure shown in FIG.

【0116】すなわち、まず、ステップ120で、変換
前のプログラム304または305を読み込む。次に、
ステップ121およびステップ122でプログラム内の
指示文を解析して、その指示にしたがって配列の分割ブ
ロックサイズや境界サイズを決定し、前記第1実施例で
示した配列分割表に登録する。
That is, first, in step 120, the program 304 or 305 before conversion is read. next,
In steps 121 and 122, the directives in the program are analyzed, and the divided block size and boundary size of the array are determined according to the instructions and registered in the array partition table shown in the first embodiment.

【0117】そして、ステップ123で、プログラム並
列化のためのその他の変換処理を実行する。ステップ1
23の処理は、図4のステップ114の処理と同じであ
り、配列のサイズの変更、境界領域の配列要素の値をプ
ロセッサ間で交換する文の挿入、ループのインデックス
範囲の変更などを行う。
Then, in step 123, other conversion processing for program parallelization is executed. Step 1
The processing of 23 is the same as the processing of step 114 of FIG. 4, and changes the size of the array, inserts a statement for exchanging the values of array elements in the boundary area between processors, and changes the loop index range.

【0118】最後に、ステップ124で、変換後のプロ
グラムを外部記憶に出力して、処理を終了する。
Finally, in step 124, the converted program is output to the external storage, and the processing ends.

【0119】このように、本第3実施例では、手続き間
での境界サイズの一致はユーザが責任を負うので、境界
サイズ変数を生成したり、配列領域再確保文を挿入した
りするステップは必要ない。
As described above, in the third embodiment, since the user is responsible for matching the boundary size between procedures, the steps of generating the boundary size variable and inserting the array area reallocating statement are not performed. unnecessary.

【0120】図21に、このような手順によって、図1
8の上位手続きプログラム304を変換した変換後上位
手続きプログラム314を示す。また、図22は、図1
9の下位手続きプログラム305を変換した変換後下位
手続きプログラム315を示す。いずれの手続きにおい
ても、配列A,Bの宣言文は、◇ REAL A(25), B(0:26)◇ となっている。また、前記第1、第2実施例による変換
後プログラム310および311(図8、図9参照)と
違って、境界サイズ変数の宣言や配列領域再確保文は現
われていない。分割後の配列の宣言が手続き間で一致し
ているので、配列領域の再確保が必要ないからである。
FIG. 21 shows the procedure of FIG.
8 shows a post-conversion high-order procedure program 314 obtained by converting the high-order procedure program 304 of FIG. In addition, FIG.
9 shows a converted lower procedure program 315 obtained by converting the lower procedure program 305 of FIG. In both procedures, the declaration statements of arrays A and B are ◇ REAL A (25), B (0:26) ◇. Further, unlike the post-conversion programs 310 and 311 (see FIGS. 8 and 9) according to the first and second embodiments, the declaration of the boundary size variable and the array area reallocating statement do not appear. This is because the array declarations after division match between procedures, so there is no need to reallocate array areas.

【0121】以上、本発明に係る各実施例を説明した。The respective embodiments according to the present invention have been described above.

【0122】なお、以上の実施例では、FORTRAN
によって記述したプログラムを例にとり説明したが、こ
の他の言語、たとえば、いわゆるC言語や、PASCA
L等の言語で記述されたプログラムについても同様に適
用することがきる。また、変換後プログラムをソースプ
ログラムの形式で示したが、変換後プログラムとして直
接オブジェクトプログラムの形式で出力するようにして
もよい。また、以上の実施例では、変換前プログラムの
例として逐次処理プログラムを用いたが、変換前プログ
ラムが共有メモリ型並列計算機用プログラムである場合
でも、同様に適用できる。また、以上の実施例では、1
次元配列を例にとり説明したが、2次元以上の配列につ
いても同様に適用できる。また、配列が手続き呼び出し
の引数という形で手続き間で共有される場合について説
明したが、その他の形、例えば外部変数などの形で共有
される場合にも、同様に適用できる。また、以上の実施
例では、非巡回ブロック分割法によって配列を分割する
場合について示したが、この他、巡回ブロック分割や巡
回ブロックにより配列の分割を行う場合についても同様
に適用することができる。
In the above embodiment, FORTRAN is used.
The program described in the above was taken as an example, but other languages such as the so-called C language and PASCA are also available.
The same can be applied to a program written in a language such as L. Although the converted program is shown in the source program format, it may be directly output in the object program format as the converted program. Further, in the above embodiments, the serial processing program is used as an example of the pre-conversion program, but the same can be applied even when the pre-conversion program is a shared memory type parallel computer program. Further, in the above embodiment, 1
Although the description has been given by taking the dimensional array as an example, the same can be applied to an array having two or more dimensions. Further, the case where the array is shared between the procedures in the form of the argument of the procedure call has been described, but the same can be applied to the case where the array is shared in other forms such as an external variable. Further, in the above embodiments, the case where the array is divided by the non-cyclic block division method has been shown, but in addition to this, the same can be applied to the case where the array is divided by the cyclic block division or the cyclic block.

【0123】以上のように、本発明の各実施例によれ
ば、複数のファイルに分かれている逐次処理計算機用プ
ログラムを、分散メモリ型の並列計算機上で実行可能な
プログラムに変換するときに、配列分割の境界サイズを
自動的に決定して、かつ、各ファイルを別々に変換でき
る。また、境界サイズの最小値を予め設定しておくこと
により、配列領域の再確保の発生確率が小さくなり、実
行効率の良いプログラムが生成できる。
As described above, according to each embodiment of the present invention, when a program for a serial processing computer divided into a plurality of files is converted into a program executable on a distributed memory type parallel computer, The boundary size of array division can be automatically determined, and each file can be converted separately. Further, by setting the minimum value of the boundary size in advance, the probability of occurrence of reallocation of the array area is reduced, and a program with good execution efficiency can be generated.

【0124】[0124]

【発明の効果】以上のように、本発明によれば、複数の
手続きに分かれている逐次処理用のプログラムを、手続
毎に並列化しても、正しく、動作する並列プログラムに
変換することができる。
As described above, according to the present invention, a program for serial processing divided into a plurality of procedures can be converted into a parallel program that operates correctly even if it is parallelized for each procedure. .

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

【図1】並列プログラムを実行する分散メモリ型並列計
算機の構成を示すブロック図である。
FIG. 1 is a block diagram showing a configuration of a distributed memory type parallel computer that executes a parallel program.

【図2】逐次処理用プログラムの一例を示す説明図であ
る。
FIG. 2 is an explanatory diagram showing an example of a sequential processing program.

【図3】逐次処理用プログラムの一例を示す説明図であ
る。
FIG. 3 is an explanatory diagram showing an example of a sequential processing program.

【図4】本発明の第1実施例に係るプログラム変換の手
順を示すフロ−チャ−トである。
FIG. 4 is a flowchart showing a program conversion procedure according to the first embodiment of the present invention.

【図5】本発明の第1実施例で用いる参照パタ−ン表を
示す図表である。
FIG. 5 is a table showing a reference pattern table used in the first embodiment of the present invention.

【図6】本発明の第1実施例で用いる配列分割表を示す
図表である。
FIG. 6 is a diagram showing an array partition table used in the first embodiment of the present invention.

【図7】本発明の第1実施例に係る境界サイズの決定手
順を示すフロ−チャ−トである。
FIG. 7 is a flowchart showing a procedure for determining a boundary size according to the first embodiment of the present invention.

【図8】本発明の第1実施例において変換された並列プ
ログラムの一例を示す図である。
FIG. 8 is a diagram showing an example of a parallel program converted in the first embodiment of the present invention.

【図9】本発明の第1実施例において変換された並列プ
ログラムの一例を示す図である。
FIG. 9 is a diagram showing an example of a parallel program converted in the first embodiment of the present invention.

【図10】本発明の第1実施例で用いた配列領域再確保
関数の動作を示すフロ−チャ−トである。
FIG. 10 is a flowchart showing the operation of the array area reserving function used in the first embodiment of the present invention.

【図11】本発明の第1実施例で用いた配列領域再確保
関数が実現する配列領域再確保装置の構成を示すブロッ
ク図である。
FIG. 11 is a block diagram showing a configuration of an array area reallocating device realized by an array area reallocating function used in the first embodiment of the present invention.

【図12】本発明の第1実施例で用いた境界データを交
換する関数のの動作を示すフロ−チャ−トである。
FIG. 12 is a flow chart showing the operation of a function for exchanging boundary data used in the first embodiment of the present invention.

【図13】本発明の第1実施例に係る並列プログラム生
成システムの構成を示すブロック図である。
FIG. 13 is a block diagram showing the configuration of a parallel program generation system according to the first example of the present invention.

【図14】本発明の第1実施例に係る並列化コンパイラ
の構成を示すブロック図である。
FIG. 14 is a block diagram showing a configuration of a parallelizing compiler according to the first exemplary embodiment of the present invention.

【図15】本発明の題意2実施例に係る境界サイズの決
定手順を示すフロ−チャ−トである。
FIG. 15 is a flowchart showing a procedure for determining a boundary size according to the second embodiment of the present invention.

【図16】本発明の第2実施例において変換された並列
プログラムの一例を示す図である。
FIG. 16 is a diagram showing an example of a parallel program converted in the second embodiment of the present invention.

【図17】本発明の第2実施例において変換された並列
プログラムの一例を示す図である。
FIG. 17 is a diagram showing an example of a parallel program converted in the second embodiment of the present invention.

【図18】本発明の第3実施例において変換する逐次処
理用プログラムの一例を示す説明図である。
FIG. 18 is an explanatory diagram showing an example of a sequential processing program converted in the third embodiment of the present invention.

【図19】本発明の第3実施例において変換する逐次処
理用プログラムの一例を示す説明図である。
FIG. 19 is an explanatory diagram showing an example of a sequential processing program converted in the third embodiment of the present invention.

【図20】本発明の第3実施例に係るプログラム変換の
手順を示すフロ−チャ−トである。
FIG. 20 is a flowchart showing the procedure of program conversion according to the third embodiment of the present invention.

【図21】本発明の第3実施例において変換された並列
プログラムの一例を示す図である。
FIG. 21 is a diagram showing an example of a parallel program converted in the third embodiment of the present invention.

【図22】本発明の第3実施例において変換された並列
プログラムの一例を示す図である。
FIG. 22 is a diagram showing an example of a parallel program converted in the third embodiment of the present invention.

【図23】配列の分割法を示す図である。FIG. 23 is a diagram showing an array division method.

【図24】配列の分割境界要素の割り付けを示す図であ
る。
FIG. 24 is a diagram showing allocation of division boundary elements of an array.

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

5…並列化コンパイラ 9…並列プログラム生成システム 30…変換前プログラム 31…変換後プログラム 40…参照パターン表 41…配列分割表 201〜20n…プロセッサ 211〜21n…ローカルメモリ 5 ... Parallelizing compiler 9 ... Parallel program generation system 30 ... Pre-conversion program 31 ... Post-conversion program 40 ... Reference pattern table 41 ... Array division table 201-20n ... Processors 211-21n ... Local memory

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

Claims (11)

【特許請求の範囲】[Claims] 【請求項1】配列を参照して処理を行う変換対象プログ
ラムを、分散メモリ型並列計算機の複数のプロセッサに
よって並列に実行される並列プログラムであって、前記
配列の部分である部分配列領域を確保し、領域を確保し
た部分配列を参照して処理を行う並列プログラムに変換
するプログラム変換方法であって、 変換対象プログラムを構成する複数の手続きの、それぞ
れについて、 少なくとも、当該手続を変換した並列プログラム中で参
照する配列のうちの他の手続と共有される配列に関し、 当該配列の大きさと、配列の参照の仕方を解析するステ
ップと、 前記解析結果に基づいて、当該手続を変換した並列プロ
グラム中で参照する配列の部分の範囲を決定するステッ
プと、 当該手続を変換した並列プログラムを実行するプロセッ
サの実行の対象が、前記変換対象プログラムに含まれる
他の手続を変換した並列プログラムより、当該手続を変
換した並列プログラムに切り替わった後に最初に実行さ
れる実行文として、当該実行文の実行開始時に領域が確
保されている前記配列の部分の範囲と当該手続を変換し
た並列プログラムが参照する配列の部分の範囲とが一致
しているかを、前記決定した配列の部分の範囲に基づい
て判定し、一致していない場合には、前記配列の部分の
領域を当該手続を変換した並列プログラムが参照する配
列の部分の範囲に合致するように確保し直し、確保し直
した領域に当該手続を変換した並列プログラムを実行す
るプロセッサが参照する配列の部分を取り込む処理の実
行を指定する実行文を当該手続を変換した並列プログラ
ム中に記述するステップとを有することを特徴とするプ
ログラム変換方法。
1. A parallel program executed by a plurality of processors of a distributed memory parallel computer to execute a conversion target program for processing by referring to an array, and a partial array area which is a part of the array is secured. And a program conversion method for converting a parallel program that performs processing by referring to a partial array that secures an area, and for each of a plurality of procedures that make up the conversion target program, at least a parallel program that converts the procedure. A step of analyzing the size of the array and a method of referring to the array, which is shared with other procedures in the array referred to in the parallel program in which the procedure is converted based on the analysis result. And the step of determining the range of the array part referred to in An area at the start of execution of the execution statement as an execution statement that is executed first after the target of the line is changed from the parallel program obtained by converting the other procedure included in the conversion target program to the parallel program obtained by conversion of the procedure. Is determined on the basis of the determined range of the sequence part, whether the range of the sequence part secured is equal to the range of the sequence part referred to by the parallel program that has converted the procedure. If not, reallocate the area of the array so that it matches the range of the array referenced by the parallel program that converted the procedure, and convert the procedure to the reacquired area. A step of writing an executable statement that specifies the execution of the process of fetching the part of the array referenced by the processor that executes the program, in the parallel program obtained by converting the procedure. A program conversion method comprising:
【請求項2】請求項1記載のプログラム変換方法であっ
て、 前記配列の部分の範囲を決定するステップは、並列プロ
グラムを並列に実行する各プロセッサに前記配列を、所
定の規則に従い分割して割り当てるパタ−ンによって割
り当てた配列の部分を超えて、並列プログラムを並列に
実行する各プロセッサが参照する配列の部分の大きさで
ある境界サイズを決定するステップであって、 前記当該実行文の実行開始時に領域が確保されている前
記配列の部分の範囲と自手続内で参照する配列の部分の
範囲とが一致しているかの判定は、少なくとも、前記当
該実行文の実行開始時に領域が確保されている前記配列
の部分の範囲に対応する境界サイズと、先のステップで
決定した前記配列の境界サイズが一致しない場合に、不
一致と判定する判定であることを特徴とするプログラム
変換方法。
2. The program conversion method according to claim 1, wherein the step of determining the range of the part of the array is performed by dividing the array into processors that execute a parallel program in parallel according to a predetermined rule. A step of determining a boundary size, which is a size of an array portion referred to by each processor that executes a parallel program in parallel, beyond the portion of the array allocated by the pattern to be allocated, and executing the execution statement. To determine whether the range of the array part whose area is secured at the start and the range of the array part referenced in the self procedure match, at least the area is secured at the start of execution of the executable statement. If the boundary size corresponding to the range of the array portion and the boundary size of the array determined in the previous step do not match, it is determined that they do not match. Program conversion method characterized in that there.
【請求項3】請求項1記載のプログラム変換方法であっ
て、 前記配列の部分の範囲を決定するステップは、並列プロ
グラムを並列に実行する各プロセッサに前記配列を、指
定された規則に従い分割して割り当てるパタ−ンを特定
する分割配置パタ−ンと、前記パタ−ンに従って割り当
てた配列の部分を超えて、並列プログラムを並列に実行
する各プロセッサが参照する配列の部分の大きさである
境界サイズを決定するステップであって、 前記当該実行文の実行開始時に領域が確保されている前
記配列の部分の範囲と自手続内で参照する配列の部分の
範囲とが一致しているかの判定は、前記当該実行文の実
行開始時に領域が確保されている前記配列の部分の範囲
に対応する分割配置パタ−ンと境界サイズと、先のステ
ップで決定した前記配列の分割配置パタ−ンと境界サイ
ズが一致するか否かを判定する判定であることを特徴と
するプログラム変換方法。
3. The program conversion method according to claim 1, wherein the step of determining the range of the portion of the array divides the array into processors that execute a parallel program in parallel according to a specified rule. And a boundary that is the size of the array portion referred to by each processor executing the parallel program in parallel, beyond the array portion allocated according to the pattern. In the step of determining the size, it is determined whether the range of the array portion in which the area is secured at the start of execution of the execution statement and the range of the array portion referred to in the self procedure match. , The divided arrangement pattern and boundary size corresponding to the range of the portion of the array where the area is secured at the start of execution of the executable statement, and the array determined in the previous step Split arrangement pattern - emissions and program conversion method, wherein the boundary size is determined to determine whether they match or not.
【請求項4】配列を参照して処理を行う変換対象プログ
ラムを、分散メモリ型並列計算機の複数のプロセッサに
よって並列に実行される並列プログラムであって、前記
配列の部分の領域を確保し、領域を確保した配列の部分
を参照して処理を行う並列プログラムに変換するプログ
ラム変換方法であって、 変換対象プログラムを構成する複数の手続きの、それぞ
れについて、 少なくとも、当該手続を変換した並列プログラム中で参
照する配列のうちの他の手続と共有される配列に関し
て、当該手続中で参照される配列の大きさと、配列の参
照の仕方を解析し、当該手続に含まれる各配列につい
て、当該手続を変換した並列プログラムを並列に実行す
る各プロセッサに当該配列を分割して割り当てるパタ−
ンを特定する分割配置パタ−ンと、前記パタ−ンに従っ
て割り当てた当該配列の部分を超えて、並列プログラム
を並列に実行する各プロセッサが参照する配列の部分の
大きさである境界サイズを決定するステップと、 他の手続きと共有される配列の分割配置パターンと境界
サイズとを格納する変数を生成する宣言文を当該手続を
変換した並列プログラム中に記述するステップと、 当該手続を変換した並列プログラムを実行するプロセッ
サの実行の対象が、前記変換対象プログラムに含まれる
他の手続を変換した並列プログラムより、当該手続を変
換した並列プログラムに切り替わった後に最初に実行さ
れる実行文として、当該実行文の実行開始時の変数の値
と、当該配列について決定した配列の分割配置パターン
と境界サイズとを比較し、一致していない場合には、当
該手続を変換した並列プログラム中で参照する配列の領
域を当該配列について先のステップで決定した配列の分
割配置パターンと境界サイズに基づいて確保し直し、確
保し直した領域に当該手続を変換した並列プログラムを
実行するプロセッサが参照する配列の部分を取り込み、
前記変数の値を、前記先のステップで決定した配列の分
割配置パターンと境界サイズを示す値に変更する処理の
実行を指定する実行文を並列プログラム中に記述するス
テップとを有することを特徴とするプログラム変換方
法。
4. A parallel program, which is a parallel program executed by a plurality of processors of a distributed memory type parallel computer, for a conversion target program which performs processing by referring to an array, and secures an area of a portion of the array, Is a program conversion method for converting into a parallel program that performs processing by referring to the secured array part, and for each of a plurality of procedures that make up the conversion target program, at least in the parallel program that converts the procedure. Regarding the array that is shared with other procedures in the referenced array, the size of the array referenced in the procedure and the way of referring to the array are analyzed, and the procedure is converted for each array included in the procedure. Pattern that divides and allocates the array to each processor that executes the executed parallel program in parallel.
The boundary size, which is the size of the array portion referred to by each processor that executes the parallel program in parallel, is determined beyond the divided arrangement pattern that identifies the pattern and the portion of the array that is assigned according to the pattern. And a declarative statement that creates a variable that stores the partition allocation pattern of the array shared with other procedures and the boundary size, and the step of writing in the parallel program that converted the procedure, and the parallel method that converted the procedure. The execution target of the processor that executes the program is the execution statement that is first executed after switching from the parallel program obtained by converting the other procedure included in the conversion target program to the parallel program obtained by converting the procedure. Compare the value of the variable at the start of execution of the statement, the divided arrangement pattern of the array determined for the array and the boundary size, If not, reallocate and reallocate the area of the array referenced in the parallel program converted from the procedure based on the divided layout pattern and boundary size of the array determined in the previous step for the array. Take in the part of the array referenced by the processor that executes the parallel program that converted the procedure into the area,
A step of writing an execution statement in a parallel program that specifies execution of a process of changing the value of the variable to a value indicating the divided arrangement pattern and boundary size of the array determined in the previous step. How to convert the program.
【請求項5】配列を参照して処理を行う変換対象プログ
ラムを、分散メモリ型並列計算機の複数のプロセッサに
よって並列に実行される並列プログラムであって、前記
配列の部分の領域を確保し、領域を確保した配列の部分
を参照して処理を行う並列プログラムに変換するプログ
ラム変換方法であって、 変換対象プログラムを構成する複数の手続きの、それぞ
れについて、 少なくとも、当該手続を変換した並列プログラム中で参
照する配列のうちの他の手続と共有される配列に関し
て、当該手続中で参照される配列の大きさと、配列の参
照の仕方を解析し、当該手続に含まれる各配列につい
て、当該手続を変換した並列プログラムを並列に実行す
る各プロセッサに当該配列を分割して割り当てるパタ−
ンを特定する分割配置パタ−ンと、前記パタ−ンに従っ
て割り当てた当該配列の部分を超えて、並列プログラム
を並列に実行する各プロセッサが参照する配列の部分の
大きさである境界サイズを決定するステップと、 他の手続きを呼び出す実行文の実引数となっている配列
の分割配置パターンと境界サイズとを格納する変数を生
成する宣言文を当該手続を変換した並列プログラム中に
記述するステップと、 当該分割配置パターンと境界サイズとを格納する変数を
実引数として追加した前記他の手続きを呼び出す実行文
を当該手続を変換した並列プログラム中に記述するステ
ップと、 当該前記他の手続きを呼び出す実行文の次に実行される
実行文として、前記実引数となっている配列の分割配置
パターンと境界サイズとを格納する変数の値と、当該配
列について決定した配列の分割配置パターンと境界サイ
ズとを比較し、一致していない場合には、当該手続を変
換した並列プログラム中で参照する配列の領域を当該配
列について先のステップで決定した配列の分割配置パタ
ーンと境界サイズに基づいて確保し直し、確保し直した
領域に当該手続を変換した並列プログラムを実行するプ
ロセッサが参照する配列の部分を取り込み、前記変数の
値を、前記先のステップで決定した配列の分割配置パタ
ーンと境界サイズを示す値に変更する処理の実行を指定
する実行文を並列プログラム中に記述するステップと、 プログラム文の仮引数となっている配列の分割配置パタ
ーンと境界サイズとを格納する変数を生成する宣言文を
当該手続を変換した並列プログラム中に記述するステッ
プと、 プログラム文の仮引数となっている配列の分割配置パタ
ーンと境界サイズとを格納する変数を仮引数として追加
したプログラム文を当該手続を変換した並列プログラム
中に記述するステップと、 プログラム文の仮引数となっている配列が存在する場合
には、当該手続きを変換した並列プログラムの最初の実
行文として、前記仮引数となっている配列の分割配置パ
ターンと境界サイズとを格納する変数の値と、当該配列
について先のステップで決定した配列の分割配置パター
ンと境界サイズとを比較し、一致していない場合には、
当該手続を変換した並列プログラム中で参照する配列の
領域を当該配列について決定した配列の分割配置パター
ンと境界サイズに基づいて確保し直し、確保し直した領
域に当該手続を変換した並列プログラムを実行するプロ
セッサが参照する配列の部分を取り込み、前記仮引数と
なっている配列の前記変数の値を、前記先のステップで
決定した配列の分割配置パターンと境界サイズを示す値
に変更する処理の実行を指定する実行文を並列プログラ
ム中に記述するステップとを有することを特徴とするプ
ログラム変換方法。
5. A parallel program for executing a conversion target program for processing by referring to an array by a plurality of processors of a distributed memory parallel computer, wherein an area of the array is secured and Is a program conversion method for converting into a parallel program that performs processing by referring to the secured array part, and for each of a plurality of procedures that make up the conversion target program, at least in the parallel program that converts the procedure. Regarding the array that is shared with other procedures in the referenced array, the size of the array referenced in the procedure and the way of referring to the array are analyzed, and the procedure is converted for each array included in the procedure. Pattern that divides and allocates the array to each processor that executes the executed parallel program in parallel.
The boundary size, which is the size of the array portion referred to by each processor that executes the parallel program in parallel, is determined beyond the divided arrangement pattern that identifies the pattern and the portion of the array that is assigned according to the pattern. And a step of writing a declarative statement that generates a variable that stores the partition arrangement pattern of the array that is the actual argument of the execution statement that calls another procedure and the boundary size in the parallel program that has converted the procedure. , A step of writing an execution statement for calling the other procedure in which a variable storing the divided arrangement pattern and the boundary size is added as an actual argument in a parallel program converted from the procedure, and an execution for calling the other procedure As the execution statement to be executed next to the statement, the value of the variable that stores the divided arrangement pattern and the boundary size of the array that is the actual argument, and The divided arrangement pattern of the sequence determined for the sequence and the boundary size are compared, and if they do not match, the region of the sequence referred to in the parallel program converted from the procedure is determined for the sequence in the previous step. Reallocate based on the divided allocation pattern and boundary size of the array, take in the part of the array referenced by the processor that executes the parallel program that has converted the procedure in the reallocated area, and set the value of the variable to A step to describe an execution statement that specifies the execution of processing to change to a value that indicates the size and boundary size of the array determined in step in the parallel program, and the allocation pattern of the array that is the dummy argument of the program statement And a demarcation statement that creates a variable that stores the boundary size in the parallel program converted from the procedure. A step of writing a program statement in which a variable for storing the divided arrangement pattern of the array that is the dummy argument of the program statement and the boundary size is added as a dummy argument in the parallel program converted from the procedure, and the dummy argument of the program statement If there is an array that is, as the first executable statement of the parallel program that has converted the procedure, the value of the variable that stores the divided arrangement pattern and the boundary size of the array that is the dummy argument, Compare the divided layout pattern of the array determined in the previous step with the boundary size for the array, and if they do not match,
Reallocate the area of the array to be referenced in the parallel program converted from the procedure based on the divided layout pattern and boundary size of the array determined for the array, and execute the parallel program that converted the procedure to the reserved area The process of changing the value of the variable of the array that is the dummy argument into a value indicating the divided arrangement pattern and boundary size of the array determined in the previous step And a step of describing an executable statement designating the above in a parallel program.
【請求項6】請求項2、3、4または5記載のプログラ
ム変換方法であって、 前記確保し直した領域への当該手続を変換した並列プロ
グラムを実行するプロセッサが参照する配列の部分の取
り込みは、 前記確保し直した領域に元の領域の対応する配列の部分
を複写し、前記確保し直した領域に複写する配列の部分
のうちの、他のプロセッサが前記パタ−ンに従って割り
当てられ配列の部分を超えて参照する前記境界サイズ分
の部分を他のプロセッサに転送し、前記パタ−ンに従っ
て割り当てられた配列の部分を超えて自プロセッサで参
照する前記境界サイズ分の配列の部分の転送を、他のプ
ロセッサより受け、前記確保し直した領域に格納するこ
とにより行われることを特徴とするプログラム変換方
法。
6. The program conversion method according to claim 2, 3, 4, or 5, wherein a part of an array referred to by a processor executing the parallel program, which has converted the procedure, is fetched into the reallocated area. Is a sequence in which a portion of the corresponding array of the original area is copied to the reallocated area and another processor of the portion of the array to be copied to the reallocated area is allocated according to the pattern. Is transferred to the other processor, and the portion of the array corresponding to the boundary size is referred to by the own processor beyond the portion of the array allocated according to the pattern. Is received from another processor and stored in the reallocated area, and the program conversion method is performed.
【請求項7】請求項2、3、4、5または6記載のプロ
グラム変換方法であって、 前記境界サイズを決定するステップは、前記パタ−ンに
従って割り当てた配列の部分を超えて、並列プログラム
を並列に実行する各プロセッサが参照する配列の部分の
大きさが、予め定めた所定値より小さな場合に、当該大
きさに代えて前記所定値を境界サイズとすることを特徴
とするプログラム変換方法。
7. The program conversion method according to claim 2, wherein the step of determining the boundary size exceeds the portion of the array allocated according to the pattern, and the parallel program is executed. When the size of the portion of the array referred to by each processor executing in parallel is smaller than a predetermined value set in advance, the predetermined value is used as a boundary size instead of the size, and the program conversion method is characterized. .
【請求項8】配列を参照して処理を行う変換対象プログ
ラムを、分散メモリ型並列計算機の複数のプロセッサに
よって並列に実行される並列プログラムであって、前記
配列の部分の領域を確保し、領域を確保した配列の部分
を参照して処理を行う並列プログラムに変換するプログ
ラム変換方法であって、 変換対象プログラムを構成する複数の手続きの、それぞ
れについて、 少なくとも、当該手続を変換した並列プログラム中で参
照する配列のうちの他の手続と共有される配列につい
て、 当該手続中で参照される配列の大きさを解析し、当該手
続に含まれる各配列について、当該手続を変換した並列
プログラムを並列に実行する各プロセッサに当該配列を
所定の規則に従い分割して割り当てるパタ−ンを特定す
る分割配置パタ−ンを決定するステップと、 決定した分割配置パタ−ンと、変換対象プログラム中に
記述された当該配列についての境界サイズの指定に応じ
て、前記配列の部分よりなる配列を生成する宣言文とし
て、前記分割配置パタ−ンに従って割り当てた当該配列
の部分の大きさと、当該部分を超えて、並列プログラム
を並列に実行する各プロセッサが参照する配列の部分の
大きさを合わせた大きさの配列を生成する宣言文を並列
プログラム中に記述するステップとを有することを特徴
とするプログラム変換方法。
8. A parallel program for executing a conversion target program, which executes processing by referring to an array, by a plurality of processors of a distributed memory parallel computer, and secures an area of a part of the array, Is a program conversion method for converting into a parallel program that performs processing by referring to the secured array part, and for each of a plurality of procedures that make up the conversion target program, at least in the parallel program that converts the procedure. For arrays that are shared with other procedures in the referenced array, the size of the array referenced in the procedure is analyzed, and for each array included in the procedure, the parallel program that converted the procedure is parallelized. The divided arrangement pattern that specifies the pattern to be divided and assigned to each processor to be executed according to a predetermined rule is determined. The divided placement pattern is used as a declarative statement to generate an array consisting of the step, the determined divided placement pattern, and the boundary size of the array described in the conversion target program. -A declaration statement that creates an array of a size that matches the size of the part of the array allocated according to the command and the size of the part of the array referenced by each processor that executes the parallel program in parallel beyond the part And a step of describing in a parallel program.
【請求項9】複数のプログラムを実行するプロセッサ上
で実行される各プロセスが、他のプロセスムと共有する
配列の領域を確保し直す配列領域の再確保方法であっ
て、 各プロセスについて、プロセスを実行するプロセッサの
実行の対象が、他のプロセスより、当該プログラムに切
り替わった直後に、その時点で領域が確保されている前
記共有されている配列の範囲と、当該プロセスが参照す
る配列の範囲とが一致しているかを、領域が確保されて
いる前記配列の範囲を表す変数と、プロセスを記述した
プログラム中に記述されたプロセスが参照する配列の範
囲とより判定し、一致していない場合には、前記配列の
領域をプロセスが参照する配列の部分の範囲に合致する
ように確保し直し、確保し直した領域にプロセスが参照
する配列の部分を元の領域より複写し、前記変数をプロ
グラム中に記述されたプロセスが参照する配列の範囲を
表す値に更新することを特徴とする配列領域の再確保方
法。
9. A method for reallocating an array area, wherein each process executed on a processor executing a plurality of programs reallocates an array area shared with another process, wherein: The range of the shared array in which the area is secured at that time and the range of the array referenced by the process immediately after the execution target of the processor that executes If and do not match, it is determined by the variable that represents the range of the array where the area is secured and the range of the array referenced by the process described in the program that describes the process. Is to secure the area of the array so that it matches the range of the portion of the array referenced by the process, and the portion of the array referenced by the process in the reallocated area. Is copied from the original area, and the variable is updated to a value representing the range of the array referenced by the process described in the program.
【請求項10】配列を参照して処理を行う変換対象プロ
グラムを、分散メモリ型並列計算機の複数のプロセッサ
によって並列に実行される並列プログラムであって、前
記配列の部分の領域を確保し、領域を確保した配列の部
分を参照して処理を行う並列プログラムに変換する並列
化コンパイラシステムであって、 変換対象プログラムを構成する複数の手続きの、それぞ
れについて、 少なくとも、当該手続を変換した並列プログラム中で参
照する配列のうちの他の手続と共有される配列に関し
て、当該配列の大きさと、配列の参照の仕方を解析し、
前記解析結果に基づいて、当該手続を変換した並列プロ
グラム中で参照する配列の部分の範囲を決定する解析手
段と、 当該手続を変換した並列プログラムを実行するプロセッ
サの実行の対象が、前記変換対象プログラムに含まれる
他の手続を変換した並列プログラムより、当該手続を変
換した並列プログラムに切り替わった後に最初に実行さ
れる実行文として、当該実行文の実行開始時に領域が確
保されている前記配列の部分の範囲と当該手続を変換し
た並列プログラムが参照する配列の部分の範囲とが一致
しているかを、前記決定した配列の部分の範囲より判定
し、一致していない場合には、前記配列の部分の領域を
当該手続を変換した並列プログラムが参照する配列の部
分の範囲に合致するように確保し直し、確保し直した領
域に当該手続を変換した並列プログラムを実行するプロ
セッサが参照する配列の部分を元の領域より複写する処
理の実行を指定する実行文を当該手続を変換した並列プ
ログラム中に記述する変換手段とを有することを特徴と
する並列化コンパイラシステム。
10. A parallel program executed by a plurality of processors of a distributed memory type parallel computer to execute a conversion target program which performs processing by referring to an array, and secures an area of a portion of the array, Is a parallelizing compiler system for converting into a parallel program for processing by referring to the secured array part, and for each of a plurality of procedures constituting the conversion target program, at least in the parallel program in which the procedure is converted. Regarding the sequence that is shared with other procedures among the sequences referred to in, analyze the size of the sequence and how to refer to the sequence,
Based on the analysis result, the analysis means for determining the range of the array portion referred to in the parallel program converted from the procedure, and the execution target of the processor executing the parallel program converted to the procedure are the conversion targets. From the parallel program in which other procedures included in the program are converted, as an executable statement that is executed first after switching to the parallel program in which the relevant procedure is converted, the area of which the area is secured at the start of execution of the executable statement Whether the range of the part and the range of the part of the array referred to by the parallel program that has converted the procedure match is determined from the range of the part of the determined sequence. Reallocate the area of the part so that it matches the range of the part of the array referenced by the parallel program that converted the procedure, and place the area And a conversion unit that describes an execution statement that specifies execution of a process of copying a portion of an array referred to by a processor that executes a parallel program that has been converted from the original area in the parallel program that has converted the procedure. Characterizing parallelizing compiler system.
【請求項11】配列を参照して処理を行う変換対象プロ
グラムより、分散メモリ型並列計算機の複数のプロセッ
サによって並列に実行される並列プログラムであって、
前記配列の部分の領域を確保し、領域を確保した配列の
部分を参照して処理を行う並列プログラムを生成する並
列プログラム生成システムであって、 ライブラリと、リンケ−ジ手段と、並列化コンパイラと
を有し、 前記並列化コンパイラは、変換対象プログラムを構成す
る複数の手続きの、それぞれについて、 少なくとも、当該手続を変換した並列プログラム中で参
照する配列のうちの他の手続と共有される配列に関し
て、当該配列の大きさと、配列の参照の仕方を解析し、
前記解析結果に基づいて、当該手続を変換した並列プロ
グラム中で参照する配列の部分の範囲を決定する解析手
段と、 当該手続を変換した並列プログラムを実行するプロセッ
サの実行の対象が、前記変換対象プログラムに含まれる
他の手続を変換した並列プログラムより、当該手続を変
換した並列プログラムに切り替わった後に最初に実行さ
れる実行文として、当該実行文の実行開始時に領域が確
保されている前記配列の部分の範囲と当該手続を変換し
た並列プログラムが参照する配列の部分の範囲とが一致
しているかを、前記決定した配列の部分の範囲より判定
し、一致していない場合には、前記配列の部分の領域を
当該手続を変換した並列プログラムが参照する配列の部
分の範囲に合致するように確保し直し、確保し直した領
域に当該手続を変換した並列プログラムを実行するプロ
セッサが参照する配列の部分を元の領域より複写する処
理を実行するライブラリ関数の呼び出しを指定する実行
文を当該手続を変換した並列プログラム中に記述する変
換手段とを有し、 前記ライブラリは、前記ライブラリ関数を実行するプロ
グラムを格納し、 前記リンケ−ジエディタは、変換対象プログラムを構成
する複数の手続きを前記並列化コンパイラが変換した複
数の並列プログラムと、当該複数の並列プログラム中で
呼び出されているライブラリ関数に対応する前記ライブ
ラリ中のプログラムをリンクする手段を有することを特
徴とする並列プログラム生成システム。
11. A parallel program which is executed in parallel by a plurality of processors of a distributed memory parallel computer from a conversion target program which performs processing by referring to an array,
What is claimed is: 1. A parallel program generation system, which secures an area of a portion of an array, and generates a parallel program for performing processing by referring to a portion of an array that has secured the area, comprising a library, a linkage unit, and a parallelizing compiler. The parallelizing compiler has, for each of a plurality of procedures constituting the conversion target program, at least with respect to an array shared with another procedure of the arrays referred to in the parallel program that has converted the procedure. , Analyze the size of the array and how to refer to the array,
Based on the analysis result, the analysis means for determining the range of the array portion referred to in the parallel program converted from the procedure, and the execution target of the processor executing the parallel program converted to the procedure are the conversion targets. From the parallel program in which other procedures included in the program are converted, as an executable statement that is executed first after switching to the parallel program in which the relevant procedure is converted, the area of which the area is secured at the start of execution of the executable statement Whether the range of the part and the range of the part of the array referred to by the parallel program that has converted the procedure match is determined from the range of the part of the determined sequence. Reallocate the area of the part so that it matches the range of the part of the array referenced by the parallel program that converted the procedure, and place the area A conversion unit that describes an execution statement that specifies a call of a library function that executes a process of copying a portion of an array referenced by a processor that executes a parallel program that has been converted from the original area, in the parallel program that has converted the procedure. And the library stores a program for executing the library function, the linkage editor includes a plurality of parallel programs obtained by the parallelizing compiler converting a plurality of procedures constituting a conversion target program, A parallel program generation system comprising means for linking a program in the library corresponding to a library function called in a plurality of parallel programs.
JP6011196A 1994-02-02 1994-02-02 Method for converting program Withdrawn JPH07219909A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6011196A JPH07219909A (en) 1994-02-02 1994-02-02 Method for converting program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6011196A JPH07219909A (en) 1994-02-02 1994-02-02 Method for converting program

Publications (1)

Publication Number Publication Date
JPH07219909A true JPH07219909A (en) 1995-08-18

Family

ID=11771301

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6011196A Withdrawn JPH07219909A (en) 1994-02-02 1994-02-02 Method for converting program

Country Status (1)

Country Link
JP (1) JPH07219909A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101248318B1 (en) * 2008-06-06 2013-03-27 애플 인크. Multi-dimensional thread grouping for multiple processors

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101248318B1 (en) * 2008-06-06 2013-03-27 애플 인크. Multi-dimensional thread grouping for multiple processors

Similar Documents

Publication Publication Date Title
US7143388B1 (en) Method of transforming software language constructs to functional hardware equivalents
US5551039A (en) Compiling a source code vector instruction by generating a subgrid loop for iteratively processing array elements by plural processing elements
Kennedy et al. Automatic data layout for distributed-memory machines
US5339429A (en) Parallel processing system and compiling method used therefor
JPH06266683A (en) Parallel processor
JP2669603B2 (en) Code generation method in compiler and compiler
JP2000231545A (en) Method for generating particle program
KR20110097716A (en) Register allocation with simd architecture using write masks
JPH0744508A (en) Program division method
US20200320368A1 (en) Graph Conversion Method
Kelly et al. Minimizing communication while preserving parallelism
Metcalf The seven ages of fortran
US5781777A (en) Optimization method for computation partitioning oriented to a distributed memory
US10802806B1 (en) Generating vectorized control flow using reconverging control flow graphs
Knobe et al. Massively parallel data optimization
JPH07319710A (en) Compiling processing method
Numrich F^{--}: A Parallel Extension to Cray Fortran
JPH07219909A (en) Method for converting program
JPH07244647A (en) Method and device for parallelization for indirect reference loop, and method and device for parallel execution
JP3233467B2 (en) Program conversion method and apparatus
JP3191263B2 (en) Optimal object selection execution processor
Ortiz et al. An array language for data parallelism: Definition, compilation, and applications
Lossing et al. Automatic code generation of distributed parallel tasks
JP3551352B2 (en) Loop splitting method
Thomas et al. Microprocessor Synthesis (SUGAR)

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20010403