JPH06214801A - Automatic parallelizing translation device and method - Google Patents

Automatic parallelizing translation device and method

Info

Publication number
JPH06214801A
JPH06214801A JP626293A JP626293A JPH06214801A JP H06214801 A JPH06214801 A JP H06214801A JP 626293 A JP626293 A JP 626293A JP 626293 A JP626293 A JP 626293A JP H06214801 A JPH06214801 A JP H06214801A
Authority
JP
Japan
Prior art keywords
loop
parallel
code
loops
parallelization
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
JP626293A
Other languages
Japanese (ja)
Inventor
Tatsuya Shindo
達也 進藤
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP626293A priority Critical patent/JPH06214801A/en
Publication of JPH06214801A publication Critical patent/JPH06214801A/en
Withdrawn legal-status Critical Current

Links

Landscapes

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

Abstract

(57)【要約】 【目的】 逐次型言語で記述された原コードを入力し、
並列計算機により並列実行の可能な並列DOループ及
び、並列実行の不可能な逐次DOループを原コードから
抽出し、抽出された並列DOループについて、DOルー
プ内の各項を並列実行させるDOループ内並列化コード
を作成することにより原コードを並列計算機用の目的コ
ードに変換する自動並列化翻訳装置及び方法に関し、処
理の手数を削減することにより、処理を高速化し、処理
時間を削減し、並列計算機の処理効率を高めることがで
きるので、並列計算機の有効利用を図ることを目的とす
る。 【構成】 抽出された前記DOループの間の依存関係の
検出を行い、前記DOループ内並列化コード及び検出さ
れた前記DOループ間の依存関係に基づいて、DOルー
プ間での並列実行を可能とするDOループ間並列化コー
ドを作成するように構成する。
(57) [Summary] [Purpose] Enter the original code written in the sequential language,
A parallel DO loop that can be executed in parallel by a parallel computer and a serial DO loop that cannot be executed in parallel are extracted from the original code, and the extracted parallel DO loop is configured to execute each term in the DO loop in parallel. The present invention relates to an automatic parallelizing translation apparatus and method for converting an original code into a target code for a parallel computer by creating a parallelized code, and by reducing the number of processing steps, speeding up the processing, reducing the processing time, and reducing the parallelism. Since the processing efficiency of the computer can be improved, the purpose is to effectively utilize the parallel computer. A dependency between the extracted DO loops is detected, and parallel execution between the DO loops is possible based on the parallelization code in the DO loop and the detected dependency between the DO loops. It is configured to create parallelized code between DO loops.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、自動並列化翻訳装置
(コンパイラ)及び方法に係り、特に、逐次型言語で記
述された原コードを入力し、並列計算機により並列実行
の可能な並列DOループ及び、並列実行の不可能な逐次
DOループを原コード(プログラム)から抽出し、抽出
された並列DOループについて、DOループ内で各項
(ステップ、イテレーション)を並列実行するようにD
Oループ内並列化コードを作成することにより原コード
を並列計算機用の目的コード(プログラム)に変換する
自動並列化翻訳装置及び方法に関する。現在、高速な計
算機(スーパーコンピュータ)を実現する方式として、
並列計算機が注目を浴びている。並列計算機をプログラ
ミングする手法の1つとして、Fortran等の従来
から広く使われている逐次型言語で処理を記述し、それ
を自動並列化コンパイラを用いて、並列計算機用のコー
ドに変換する方法が重要である。理由としては、並列処
理を直接記述する事の困難さ、並列処理を記述する標準
的なプログラミング言語が未だ存在しない事、過去にF
ortran等で書かれた資産を活かす事が挙げられ
る。本発明は、この自動並列化翻訳装置及び方法(自動
並列化コンパイラ)において、DOループを並列に実行
する為の技術に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an automatic parallelizing translation apparatus (compiler) and method, and in particular, a parallel DO loop capable of parallel execution by a parallel computer by inputting an original code described in a sequential language. Also, a serial DO loop that cannot be executed in parallel is extracted from the original code (program), and each term (step, iteration) is executed in parallel in the extracted DO loop D
The present invention relates to an automatic parallelizing translation apparatus and method for converting an original code into a target code (program) for a parallel computer by creating a parallelized code in an O loop. Currently, as a method to realize a high-speed computer (super computer),
Parallel computers are in the spotlight. As one of the methods of programming a parallel computer, there is a method of describing a process in a serial language that has been widely used from the past such as Fortran and converting it into a code for a parallel computer by using an automatic parallelizing compiler. is important. The reason is that it is difficult to directly describe parallel processing, that there is no standard programming language that describes parallel processing yet, and in the past F
Making use of assets written in ortran etc. can be mentioned. The present invention relates to a technique for executing DO loops in parallel in the automatic parallelizing translation device and method (automatic parallelizing compiler).

【0002】[0002]

【従来の技術】従来、図12に示すように、逐次型言語
で記述された原コードから、並列計算機により並列実行
の可能な並列DOループ及び、並列実行の不可能な逐次
DOループを抽出するDOループ抽出部1と、抽出され
た並列DOループについて、DOループ内の各項を並列
実行するようにDOループ内並列化コードを作成するD
Oループ内並列化コード作成部8とを有し、前記原コー
ドを並列計算機用の目的コードに変換する自動並列化翻
訳装置があった。科学技術計算系のプログラムは通常、
プログラム内のDOループに大半の処理時間が費やされ
ている事が知られている。従来の並列化では、前記DO
ループ抽出部1により、DOループの中から各イテレー
ション(項、ステップ)を並列実行できるもの(並列D
Oループ)を抽出し、DOループ並列化コード作成部8
により各項(イテレーション、ステップ)をプロセッサ
に割り付けて並列実行する目的コードを作成している。
2. Description of the Related Art Conventionally, as shown in FIG. 12, a parallel DO loop which can be executed in parallel by a parallel computer and a serial DO loop which cannot be executed in parallel are extracted from an original code written in a serial language. For the DO loop extraction unit 1 and the extracted parallel DO loop, create a DO loop parallelization code so that each term in the DO loop is executed in parallel D
There is an automatic parallelizing translation device that has an in-O-loop parallel code creating unit 8 and converts the original code into a target code for a parallel computer. Scientific computing programs are usually
It is known that most of the processing time is spent on the DO loop in the program. In the conventional parallelization, the DO
The loop extraction unit 1 can execute each iteration (term, step) in parallel from the DO loop (parallel D
O loop), and the DO loop parallelization code creation unit 8
Each item (iteration, step) is assigned to the processor by and the target code for parallel execution is created.

【0003】[0003]

【発明が解決しようとする課題】さて、以上説明したよ
うな従来例にあっては、並列DOループの各ステップを
プロセッサにマッピングし、並列実行させる方式では、
逐次DOループの部分の処理は常に逐次処理せざるをえ
ず、並列計算機の良さが活かされず時間がかかるという
問題点を有していた。また、最近では、1つのDOルー
プを1つのタスクと考え、タスクレベルでの並列化を行
う方法も提案されている。しかし、このタスクレベルの
処理では、せっかくそのDOループが並列DOループで
あったとしても、その事が活かされず、より高い並列性
を引き出せないという問題点を有していた。そこで、本
発明は、両方の良さを引き出せる並列実行方式を実現す
るために、複数のDOループが全て逐次DOループであ
り、かつタスクレベルでも、依存関係があり並列実行で
きない場合にも、何らかの並列化を行って、高速に処理
を行うことができるコードを得る自動並列化翻訳装置及
び方法を提供することを目的としてなされたものであ
る。
In the conventional example described above, in the method of mapping each step of the parallel DO loop to the processor and executing the parallel execution,
There has been a problem that the processing of the portion of the sequential DO loop has to be always performed sequentially, and the goodness of the parallel computer is not utilized and it takes time. In addition, recently, a method of considering one DO loop as one task and performing parallelization at the task level has been proposed. However, this task-level processing has a problem that even if the DO loop is a parallel DO loop, the fact is not utilized and higher parallelism cannot be obtained. Therefore, according to the present invention, in order to realize a parallel execution method that can bring out the advantages of both, even if a plurality of DO loops are all sequential DO loops and there is a dependency even at the task level and parallel execution is not possible, some parallel execution is performed. It is an object of the present invention to provide an automatic parallelizing translation device and method for performing code conversion to obtain a code that can be processed at high speed.

【0004】[0004]

【課題を解決するための手段】以上の技術的課題を解決
するため、第一の発明は、図1及び請求項1に示すよう
に、逐次型言語で記述された原コードから、並列計算機
により並列実行の可能な並列DOループ及び、並列実行
の不可能な逐次DOループを抽出するDOループ抽出部
10と、抽出された並列DOループについて、DOルー
プ内の各項を並列実行させるDOループ内並列化コード
を作成するDOループ内並列化コード作成部80とを有
し、前記原コードを並列計算機用の目的コードに変換す
る自動並列化翻訳装置において、抽出されたDOループ
の間の依存関係の検出を行うDOループ間依存関係検出
部20と、前記DOループ内並列化コード及び検出され
たDOループ間の依存関係に基づいて、動的にDOルー
プ間での並列実行を可能とするDOループ間動的並列化
コードを作成するDOループ間動的並列化コード作成部
30とを有するものである。
In order to solve the above technical problems, the first invention is, as shown in FIG. 1 and claim 1, a parallel computer from an original code written in a sequential language. A DO loop extraction unit 10 that extracts a parallel DO loop that can be executed in parallel and a sequential DO loop that cannot be executed in parallel, and a DO loop that causes each term in the DO loop to be executed in parallel for the extracted parallel DO loop. In the automatic parallelizing translation device that has a DO parallel code creating unit 80 for creating parallelized code, and converts the original code into a target code for a parallel computer, the dependency relationship between the extracted DO loops Inter-DO-loop dependency relationship detection unit 20 for detecting the DO loop, and the parallel execution between the DO loops dynamically based on the inter-DO-loop parallelization code and the detected dependency relationship between the DO loops. Possible to those having a DO loop between dynamic parallelized code creation unit 30 to create a dynamic parallelized code between DO loops.

【0005】第二の発明は、図2及び請求項2に示すよ
うに、逐次型言語で記述された原コードを入力し(S
1)、並列計算機により並列実行の可能な並列DOルー
プ及び、並列実行の不可能な逐次DOループを原コード
から抽出し、抽出された並列DOループについて、DO
ループ内の各項を並列実行させるDOループ内並列化コ
ードを作成する(S2)ことにより原コードを並列計算
機用の目的コードに変換する自動並列化翻訳方法におい
て、抽出された前記DOループの間の依存関係の検出を
行い(S3)、前記DOループ内並列化コード及び検出
された前記DOループ間の依存関係に基づいて、動的に
DOループ間での並列実行を可能とするDOループ間動
的並列化コードを作成する(S4)ことである。
In the second invention, as shown in FIG. 2 and claim 2, the original code described in the sequential language is input (S
1), a parallel DO loop that can be executed in parallel by a parallel computer and a serial DO loop that cannot be executed in parallel are extracted from the original code, and the extracted parallel DO loop is DO
In an automatic parallelizing translation method for converting an original code into a target code for a parallel computer by creating a DO loop parallelizing code for executing each term in the loop in parallel (S2), between the extracted DO loops Between the DO loops that enable parallel execution dynamically between the DO loops based on the detected dependency between the parallelized code in the DO loops and the detected DO loops (S3). This is to create a dynamic parallelization code (S4).

【0006】第三の発明は、図3及び請求項3に示すよ
うに、逐次型言語で記述された原コードから、並列計算
機により並列実行の可能な並列DOループ及び、並列実
行の不可能な逐次DOループを抽出するDOループ抽出
部10と,抽出された並列DOループについて、DOル
ープ内の各項を並列実行させるDOループ内並列化コー
ドを作成するDOループ内並列化コード作成部80とを
有し、前記原コードを並列計算機用の目的コードに変換
する自動並列化翻訳装置において、抽出されたDOルー
プの間の依存関係の検出を行うDOループ間依存関係検
出部20と、処理が割り付けられるプロセッサを予め指
定する指定情報を出力する指定情報出力部40と、前記
DOループ内並列化コード、検出されたDOループ間の
依存関係、及び前記指定情報に基づいて、静的にDOル
ープ間での並列実行を可能とするDOループ間静的並列
化コードを作成するDOループ間静的並列化コード作成
部31とを有するものである。
A third invention is, as shown in FIG. 3 and claim 3, a parallel DO loop capable of parallel execution by a parallel computer and an impossibility of parallel execution from an original code written in a sequential language. A DO loop extraction unit 10 that extracts a sequential DO loop, and a DO loop parallelization code creation unit 80 that creates a DO loop parallelization code that causes each term in the DO loop to be executed in parallel for the extracted parallel DO loop. In the automatic parallelizing translation device for converting the original code into the target code for the parallel computer, the inter-DO loop dependency relationship detection unit 20 for detecting the dependency relationship between the extracted DO loops, and the processing are A designation information output unit 40 that outputs designation information that designates a processor to be allocated in advance, the DO loop parallelization code, the dependency relationship between the detected DO loops, and Based on the designation information and has static and DO loop between static parallelized code creating unit 31 that creates a static parallelized code between DO loop that enables parallel execution between a DO loop.

【0007】第四の発明は、図4及び請求項4に示すよ
うに、逐次型言語で記述された原コードを入力し(S
1)、並列計算機により並列実行の可能な並列DOルー
プ及び、並列処理の不可能な逐次DOループを原コード
から抽出し、抽出された並列DOループについて、DO
ループ内で並列実行させるDOループ内並列化コードを
作成する(S2)ことにより原コードを並列計算機用の
目的コードに変換する自動並列化翻訳方法において、抽
出された前記DOループの間の依存関係の検出を行い
(S3)、前記DOループ内並列化コード、検出された
DOループ間の依存関係、及び処理が割り付けられるべ
きプロセッサを予め指定する指定情報に基づいて、静的
にDOループ間での並列実行を行わせるDOループ間静
的並列化コードを作成する(S14)ことである。
In a fourth invention, as shown in FIG. 4 and claim 4, an original code described in a sequential language is input (S
1), a parallel DO loop that can be executed in parallel by a parallel computer and a sequential DO loop that cannot be processed in parallel are extracted from the original code, and the extracted parallel DO loop is DO.
In the automatic parallelizing translation method for converting an original code into a target code for a parallel computer by creating an intra-DO loop parallelizing code to be executed in parallel within the loop (S2), the dependency between the extracted DO loops Is detected (S3), the DO loop parallelization code, the detected dependency between the DO loops, and the designation information that pre-designates the processor to which the process is to be assigned are statically set between the DO loops. This is to create a static parallelization code between DO loops for executing the parallel execution of (S14).

【0008】[0008]

【作用】続いて、本発明の処理動作について説明する。
ステップS1で、自動並列化翻訳を行う対象となる逐次
型言語で記述された原コードを前記DOループ抽出部1
0に入力する。ここで、「自動並列化翻訳」とは、逐次
型言語で記述された原コード(原プログラム)を並列計
算機用の目的コード(目的プログラム)に変換すること
をいう。また、「逐次型言語」とは例えば、FORTR
AN等の従来から広く使われている言語であって、予め
指定された命令の系列に従って、計算機を逐次自動的に
制御する言語をいう。ステップS2で、前記DOループ
抽出部10は並列DOループと逐次DOループを前記原
コードから抽出する。ここで、「並列DOループ」と
は、並列計算機により各項(ステップ、イテレーショ
ン)が並列実行可能なDOループであり、「逐次DOル
ープ」とは、並列計算機により各項が不規則的な依存関
係をもつこと等により、並列実行不可能なDOループを
いう。並列DOループの抽出はDOループ内の各項間の
データ依存関係を調べることにより、各項が独立な場合
には、並列実行が可能であり、並列DOループであるこ
とになる。例えば、各項(i=1,2,…,n)が各々 A(i)とA(i−1) のように表される場合である。また、並列実行可能でな
い場合とは、例えば、各項(i=1,2,…,n)が各
々 A(i)とA(n+1−i) のように表される場合である。並列DOループが抽出さ
れた場合には、前記DOループ内並列化コード作成部8
0は、並列DOループ内の各項を並列実行するようにD
Oループ内並列化コードを作成する。
Next, the processing operation of the present invention will be described.
In step S1, the original code written in the sequential language that is the target of automatic parallel translation is written into the DO loop extracting unit 1.
Enter 0. Here, "automatic parallelization translation" refers to conversion of an original code (original program) written in a sequential language into an object code (object program) for a parallel computer. Further, the "serial language" is, for example, FORTR.
It is a language that has been widely used from the past, such as AN, and that automatically controls a computer sequentially according to a series of instructions designated in advance. In step S2, the DO loop extraction unit 10 extracts a parallel DO loop and a sequential DO loop from the original code. Here, the "parallel DO loop" is a DO loop in which each item (step, iteration) can be executed in parallel by a parallel computer, and the "sequential DO loop" is an irregular dependency of each item by the parallel computer. It means a DO loop that cannot be executed in parallel because of having a relationship. The extraction of the parallel DO loop is a parallel DO loop, in which parallel execution is possible when the terms are independent by examining the data dependency between the terms in the DO loop. For example, there is a case where each term (i = 1, 2, ..., N) is represented as A (i) and A (i−1), respectively. The case where parallel execution is not possible is a case where, for example, each term (i = 1, 2, ..., N) is represented as A (i) and A (n + 1-i), respectively. When a parallel DO loop is extracted, the DO loop parallelization code creating unit 8
0 is D to execute each term in the parallel DO loop in parallel.
Create parallel code in O-loop.

【0009】ステップS3で、前記DOループ間依存関
係検出部20は抽出されたDOループの間の依存関係の
検出を行う。一般的に、DOループ間で依存関係がない
場合には、当該DOループ間では処理を独立に行うこと
ができて、並列実行が可能ということになる。ステップ
S4で、前記DOループ間動的並列化コード作成部30
は前記DOループ間依存関係検出部20により検出され
た依存関係、及びDOループ内並列化コード作成部80
により作成されたDOループ内並列化コードに基づい
て、動的にDOループ間での並列実行を可能とするDO
ループ間動的並列化コードを作成する。ここで、「動
的」とは「動的スケジューリング」を意味し、コンパイ
ル時には、並列計算機のプロセッサ台数に依存しないプ
ログラム(コード)を生成する。実行時に処理を空いて
いるプロセッサに割り付ける(スケジューリング)ため
のコードを挿入する。長所は負荷分散が容易である。短
所は実行時にプロセッサ割り付けのオーバーヘッドが生
じる。一方、「静的」とは「静的スケジューリング」を
意味し、コンパイル時に、並列実行すべきプログラムを
プロセッサに割り付けてしまうやり方。長所は実行時に
プロセッサ割り付け(スケジューリング)のオーバーヘ
ッドがない。短所は負荷分散が難しい。例えば、請求項
5及び請求項6に示すように、各逐次DOループと並列
DOループとの間に依存関係がないことが検出された場
合には、実行時には逐次DOループを優先的に並列計算
機のプロセッサに割り付け、残りのプロセッサで並列D
Oループを実行させるようにDOループ間並列化コード
又はDOループ間静的並列化コードを作成する。
In step S3, the inter-DO-loop dependency relationship detecting section 20 detects the inter-DO loop dependency relationship. Generally, when there is no dependency between DO loops, it means that processing can be performed independently between the DO loops and parallel execution is possible. In step S4, the dynamic parallelization code creation unit 30 between the DO loops.
Is the dependency relationship detected by the inter-DO loop dependency relationship detection section 20 and the DO loop parallelization code creation section 80.
DO that enables parallel execution dynamically between DO loops based on the parallelized code in the DO loop created by
Create dynamic parallelization code between loops. Here, “dynamic” means “dynamic scheduling”, and a program (code) that does not depend on the number of processors of a parallel computer is generated at the time of compilation. Inserts the code for allocating (scheduling) processing to a free processor at runtime. The advantage is that load distribution is easy. The disadvantage is the overhead of processor allocation at runtime. On the other hand, "static" means "static scheduling", which is a method of allocating programs to be executed in parallel to processors at the time of compilation. The advantage is that there is no processor allocation (scheduling) overhead at runtime. The disadvantage is that load distribution is difficult. For example, as described in claims 5 and 6, when it is detected that there is no dependency between each serial DO loop and the parallel DO loop, the serial DO loop is preferentially used in the parallel computer at the time of execution. Assigned to other processors, and parallel D
The inter-DO loop parallelization code or the inter-DO loop static parallelization code is created to execute the O loop.

【0010】さらに、請求項7及び請求項8には、前記
DOループ間依存関係検出部20により、データ依存関
係にある2つのDOループ間で、そのデータ依存が2つ
のループの各項の項番号(添字)について常に等距離で
あることが検出された場合には、前記DOループ動的並
列化コード作成部30又はDOループ静的並列化コード
作成部31は各項の実行についてはパイプラインを実行
させるようなDOループ間動的並列化コード又はDOル
ープ間静的並列化コードを作成する。ここで、「等距
離」とは“Distansce vector”で表現可能であることを
示す。例えば、2つのDOループの各項が各々A(i)
と、A(i−1)とで表される場合がこれにあたる。そ
れに対し、2つのDOループの各項が各々A(i)と、
A(100−i)と表される場合は、等距離でない場合
の例である。請求項9には、階層型メモリを持った並列
計算機上で複数のDOループをパイプライン実行させる
際には、DOループ間の通信が階層を越えないように同
じクラスターに割り付けるようにDOループ間動的並列
化コード又はDOループ間動的並列化コードを作成す
る。ここで、「階層型メモリ」とは、システム上である
プロセッサに注目した場合に、そのプロセッサから種々
の距離に接続されている複数のメモリ装置をいい、その
距離に応じて階層が設定されている。例えば、プロセッ
サから最も近い距離にあるのがキャッシュメモリであ
り、その次が当該クラスターの主記憶装置、さらに、ネ
ットワークを介して接続された他のクラスターの主記憶
装置……というような階層に各メモリが配置されてい
る。階層型のメモリを持った並列計算機で、DOループ
間のパイプライン実行をさせる場合、それらのDOルー
プ間の通信が階層をまたがないように、同じクラスター
に割り付ける。これにより、高速なパイプライン実行が
可能になる。また、そのクラスター内のキャッシュ・コ
ヒーレンシーを保つプロトコルが、キャッシュからキャ
ッシュへ直接コピーするものである場合には、メモリを
介在せず直接キャッシュ間でデータがパイプライン転送
されるため、その効果は一層大きい。本発明により、従
来の並列化コンパイラにより、より高い並列性を得るこ
とができる。また、DOループ間のパイプライン実行を
行う際に、そのデータを高速に転送させることができ
る。以上により、高速な演算の実行が並列計算機上で可
能になる。
Further, in claim 7 and claim 8, the DO loop inter-dependency relation detecting section 20 causes the data dependency between two DO loops having data dependency to be the term of each of the two loops. When it is detected that the numbers (subscripts) are always equidistant, the DO loop dynamic parallelization code creating unit 30 or the DO loop static parallelization code creating unit 31 pipelines the execution of each item. A dynamic parallelization code between DO loops or a static parallelization code between DO loops for executing Here, “equal distance” means that it can be expressed by “Distansce vector”. For example, each term of the two DO loops is A (i)
, And A (i-1). On the other hand, each term of the two DO loops is A (i),
The case represented by A (100-i) is an example when the distances are not equidistant. According to claim 9, when a plurality of DO loops are pipeline-executed on a parallel computer having a hierarchical memory, the DO loops are allocated to the same cluster so that the communication between the DO loops does not cross the hierarchy. Create dynamic parallelization code or dynamic parallelization code between DO loops. Here, "hierarchical memory" refers to a plurality of memory devices connected to various distances from the processor when attention is paid to the processor on the system, and a hierarchy is set according to the distance. There is. For example, the cache memory is closest to the processor, the next is the main memory of the cluster, and the main memory of another cluster connected via the network. The memory is located. When a pipeline execution between DO loops is performed by a parallel computer having a hierarchical memory, the DO clusters are allocated to the same cluster so that the communication between the DO loops does not cross the hierarchy. This enables high-speed pipeline execution. In addition, when the protocol for maintaining cache coherency within the cluster is to copy directly from cache to cache, the effect is further enhanced because data is pipeline transferred between caches directly without intervening memory. large. According to the present invention, higher parallelism can be obtained by the conventional parallelizing compiler. Further, when pipeline execution between DO loops is performed, the data can be transferred at high speed. As described above, high-speed calculation can be executed on a parallel computer.

【0011】[0011]

【実施例】本発明の実施例を図5に基づいて説明する。
同図に示すように、本実施例は、逐次型言語で記述され
た原コードが格納された原コードファイル5と、当該原
コードを並列計算機用の目的コードに変換する自動並列
化翻訳装置(コンパイラ)7と、自動並列化翻訳装置7
により原コードから変換された目的コードを格納する目
的コードファイル6と、処理が割り付けられるべきプロ
セッサを予め指定する指定情報を格納する指定情報格納
部4とを有する。さらに、前記自動並列化翻訳装置7
は、同図に示すように、並列計算機により並列実行の可
能な並列DOループ及び、並列実行の不可能な逐次DO
ループを抽出するDOループ抽出部1と、抽出された並
列DOループについて、DOループ内の各項を並列実行
させるDOループ内並列化コードを作成するDOループ
内並列化コード作成部8と、抽出されたDOループの間
の依存関係の検出を行うDOループ間依存関係検出部2
と、前記DOループ内並列化コード及び検出されたDO
ループ間の依存関係または前記指定情報に基づいて、D
Oループ間での並列実行を可能とするDOループ間並列
化コードを作成するDOループ間並列化コード作成部3
とを有するものである。当該DOループ間並列化コード
作成部3は、同図に示すように、前記DOループ間依存
関係検出部2により、各逐次DOループと並列DOルー
プとの間の依存関係がないことが検出された場合には、
実行時には逐次DOループを優先的に割り付け、残りの
プロセッサで並列DOループを実行させるようなDOル
ープ間動的並列化コード又はDOループ間静的並列化コ
ード作成の指示を行う独立並列DOループ作成指示部3
aと、前記DOループ間依存関係検出部2により、デー
タ依存関係にある2つのDOループ間で、そのデータ依
存が2つのループの各イテレーション(項)の添字(項
番号)について常に等距離であることが検出された場合
には、各項の実行についてはパイプラインを実行させる
DOループ間動的並列化コード又はDOループ間静的並
列化コードの作成の指示を行う等距離逐次DOループ割
付指示部3bと、データ依存関係にある2つのDOルー
プ間で、そのデータ依存が2つのループの各項の項番号
について常に等距離であることが検出された場合には、
各項の処理についてはパイプライン処理を実行させるよ
うなDOループ間動的並列化コード又はDOループ間静
的並列化コードを作成する指示を行う等距離DOループ
割付指示部3cと、階層型のメモリを持った並列計算機
上で複数のDOループをパイプライン実行させる際に
は、DOループ間の通信が階層を越えないように同じク
ラスターに割り付けるようにDOループ間動的並列化コ
ード又はDOループ間静的並列化コードの作成を指示す
る階層型メモリ割付指示部3dと、前記独立並列DOル
ープ割付指示部3a、等距離逐次DOループ割付指示部
3b、等距離DOループ割付指示部3c及び階層型メモ
リ割付指示部3dからの割り付けの指示があった場合に
は、前記DOループ内並列化コード及び検出されたDO
ループ間の依存関係または前記指定情報格納部4から読
みだされた指定情報に基づいて、目的コードの作成を行
う目的コード作成部3eとを有するものである。
EXAMPLE An example of the present invention will be described with reference to FIG.
As shown in the figure, in this embodiment, an original code file 5 in which an original code described in a sequential language is stored, and an automatic parallelizing translation device for converting the original code into a target code for a parallel computer ( Compiler) 7 and automatic parallelizing translation device 7
It has a target code file 6 for storing a target code converted from the original code and a designation information storage unit 4 for storing designation information for designating a processor to which a process is to be assigned in advance. Further, the automatic parallelizing translation device 7
Is a parallel DO loop that can be executed in parallel by a parallel computer and a serial DO that cannot be executed in parallel, as shown in FIG.
A DO loop extraction unit 1 that extracts a loop, a DO loop internal parallelization code creation unit 8 that creates a DO loop internal parallelization code that causes each term in the DO loop to be executed in parallel for the extracted parallel DO loop, and an extraction Inter-DO-loop dependency relationship detection unit 2 that detects the dependency relationship between the generated DO loops
And the parallelized code in the DO loop and the detected DO
D based on the dependency between loops or the specified information
DO loop inter-parallelization code creation unit 3 that creates DO loop inter-parallelization code that enables parallel execution between O loops
And have. In the DO loop parallelization code creating unit 3, the DO loop interdependency detecting unit 2 detects that there is no dependency between each sequential DO loop and the parallel DO loop, as shown in FIG. If
Independent parallel DO loop creation that gives instructions to create dynamic parallelization code between DO loops or static parallelization code between DO loops so that parallel DO loops are executed preferentially at the time of execution and parallel DO loops are executed by the remaining processors Indicator 3
a and the DO loop interdependency detection unit 2, the two DO loops having the data dependency are always equidistant with respect to the subscript (term number) of each iteration (term) of the two loops. When it is detected, equidistant sequential DO loop allocation for instructing the creation of a dynamic parallelization code between DO loops or a static parallelization code between DO loops for executing the pipeline for execution of each term When it is detected that the data dependency is always equidistant between the instruction unit 3b and the two DO loops having the data dependency, the term numbers of the terms of the two loops are detected.
Regarding the processing of each term, an equidistant DO loop allocation instructing section 3c for instructing the creation of a dynamic parallelization code between DO loops or a static parallelization code between DO loops for executing pipeline processing, and a hierarchical type When a plurality of DO loops are pipeline-executed on a parallel computer having a memory, dynamic parallelization code between DO loops or DO loops is assigned so that communication between DO loops is assigned to the same cluster so as not to cross the hierarchy. Hierarchical memory allocation instructing section 3d for instructing the creation of inter-stationary static parallelization code, the independent parallel DO loop allocation instructing section 3a, equidistant sequential DO loop allocation instructing section 3b, equidistant DO loop allocation instructing section 3c and hierarchy. When there is an allocation instruction from the type memory allocation instruction unit 3d, the DO loop parallelization code and the detected DO are detected.
The target code creating section 3e creates an object code on the basis of the dependency between the loops or the specified information read from the specified information storage section 4.

【0012】また、図8には、前記自動並列化コンパイ
ラ(翻訳装置)により変換された目的コードにより並列
実行の行われる本実施例に係る並列計算機のシステム構
成図を示す。同図に示すように、本システムでは、階層
型のメモリであるキャッシュ・メモリ1511b〜1524
b及び主記憶装置131 、132 をもつ並列計算機であ
り、大きくは2つのクラスター111 、112 がネット
ワーク12により接続されたシステムである。各クラス
ター111 、112 には、プロセッサ1511a〜1524
a及びキャッシュ・メモリ1511b〜1524bの複数の
組1511〜1524と、すべてのプロセッサ1511a〜1
24aからのアクセス可能な共通の主記憶装置131
132とを有する。また、各主記憶装置131 、132
には、実行時の各プロセッサの使用状況を示すスケジュ
ーラ141 、142 と、前記目的コードを格納する格納
部161 、162 とを有する。
Further, FIG. 8 shows a system configuration diagram of a parallel computer according to the present embodiment in which parallel execution is performed by the object code converted by the automatic parallelizing compiler (translating device). As shown in the figure, in this system, the cache memories 15 11 b to 15 24 , which are hierarchical memories, are used.
b is a parallel computer having a main memory device 13 1 and 13 2 , and is a system in which two clusters 11 1 and 11 2 are connected by a network 12. Each of the clusters 11 1 and 11 2 has processors 15 11 a to 15 24.
a plurality of pairs 15 11-15 24 a and the cache memory 15 11 b~15 24 b, all of the processors 16 11 a to 1
A common main memory 13 1 accessible from 5 24 a,
13 2 and. In addition, each of the main storage devices 13 1 and 13 2
It has schedulers 14 1 and 14 2 that indicate the usage status of each processor at the time of execution, and storage units 16 1 and 16 2 that store the target code.

【0013】続いて、本実施例に係る動作について説明
する。図6に示すように、ステップSJ1で、自動並列
化翻訳の対象となる逐次型言語で記述された原コードを
前記原コードファイル5から読み出し、自動並列化翻訳
装置(コンパイラ)7に入力する。すると、ステップS
J2で、前記DOループ抽出部1はDOループを抽出す
る。ステップSJ3でDOループがない場合には終了
し、DOループの抽出があった場合にはステップSJ4
に進み、並列DOループか否かの判断を行う。並列DO
ループか否かの判断はDOループ内の各項のデータ依存
関係を調べることにより、各項が独立な場合には、並列
DOループであると判断される。ステップSJ4で、並
列DOループであると判断された場合には、ステップS
J5に進み、前記DOループ内並列化コード作成部8は
DOループ内の各イテレーション(項)を複数のプロセ
ッサで並列実行可能なように、DOループ内での並列化
コードを作成する。ステップSJ6で、前記DOループ
間並列化コード作成部3の等距離逐次DOループ割付指
示部3bはデータ依存関係のあるうちで添字(項番号)
が等距離の逐次DOループの検索を行う。ステップSJ
7で、添字が等距離の逐次DOループがあった場合に
は、ステップS15で、前記目的コード作成部3eは指
示に従って、パイプライン処理が行われるような目的コ
ードを作成する。
Next, the operation according to this embodiment will be described. As shown in FIG. 6, in step SJ1, the original code written in the sequential language that is the target of the automatic parallelizing translation is read from the original code file 5 and input to the automatic parallelizing translation device (compiler) 7. Then, step S
At J2, the DO loop extraction unit 1 extracts a DO loop. If there is no DO loop in step SJ3, the process ends, and if a DO loop is extracted, step SJ4.
Then, it is judged whether or not the parallel DO loop. Parallel DO
Whether or not it is a loop is determined by checking the data dependence of each term in the DO loop, and when each term is independent, it is determined to be a parallel DO loop. When it is determined in step SJ4 that the DO loop is the parallel DO loop, step SJ
Proceeding to J5, the DO loop parallelization code creating unit 8 creates a parallelization code in the DO loop so that each iteration (term) in the DO loop can be executed in parallel by a plurality of processors. In step SJ6, the equidistant sequential DO loop allocation instructing section 3b of the inter-DO loop parallelization code creating section 3 has a subscript (term number) while there is a data dependency relationship.
Searches for an equidistant sequential DO loop. Step SJ
If there is a sequential DO loop whose subscripts are equidistant in step 7, the object code creating unit 3e creates an object code for pipeline processing according to the instruction in step S15.

【0014】一方、ステップSJ4で、抽出されたDO
ループが逐次DOループであると判断された場合には、
ステップSJ8に進み、前記DOループ間依存関係検出
部2は当該逐次DOループとデータ依存関係のない並列
DOループを検索する。ステップSJ9で、データ依存
関係のない並列DOループがあった場合には、ステップ
SJ10に進み、前記独立並列DOループ割付指示部3
aは、逐次DOループを優先的に並列計算機のプロセッ
サに割り付け、残りのプロセッサに対して、並列DOル
ープを割り付けることになる。ステップSJ9で、依存
関係のない並列DOループが存在しない場合には、ステ
ップSJ11に進み、前記等距離逐次DOループ割付指
示部3bは添字(項)が等距離の逐次DOループの検索
を行い、ステップSJ12でそのような逐次DOループ
があったと判断された場合には、ステップSJ15に進
み、前記目的コード作成部3eに対し、パイプライン処
理の実行が行われるように割付け等の指示を行う。
On the other hand, the DO extracted in step SJ4
If it is determined that the loop is a sequential DO loop,
In step SJ8, the inter-DO-loop dependency relationship detecting unit 2 searches for a parallel DO loop having no data dependency relationship with the sequential DO loop. If there is a parallel DO loop having no data dependency in step SJ9, the process proceeds to step SJ10, and the independent parallel DO loop allocation instructing section 3 is executed.
In a, the sequential DO loop is preferentially allocated to the processors of the parallel computer, and the parallel DO loops are allocated to the remaining processors. In step SJ9, if there is no parallel DO loop having no dependency, the process proceeds to step SJ11, and the equidistant sequential DO loop allocation instructing section 3b searches for a sequential DO loop whose subscripts (terms) are equidistant, If it is determined in step SJ12 that there is such a sequential DO loop, the process proceeds to step SJ15 to instruct the target code creating unit 3e to perform an allocation process so that the pipeline process is executed.

【0015】一方、ステップSJ12で、添字が等距離
の逐次DOループが存在しない場合には、ステップSJ
13に進み、前記等距離DOループ割付指示部3cは添
字が等距離の並列DOループを検索し、当該並列DOル
ープがあった場合には、ステップSJ15で、前記目的
コード作成部3eに対し、パイプライン処理の実行がな
されるように指示を行う。但し、ステップSJ15で、
並列計算機が階層型のメモリをもつ場合には、DOルー
プ間でパイプライン実行を実現させる場合には、パイプ
ラインで実行させる双方のDOループの間の通信が階層
をまたがないように、同じクラスター(図8の符号11
1 、112 )に割り付けるようにする。これにより、高
速なパイプライン実行が可能になる。また、そのクラス
ター内のキャッシュ・コヒーレンシを保つ(当該クラス
ター内の任意のプロセッサが数値データ等を設定した場
合には、他のプロセッサの各キャッシュ・メモリ内にも
同様の数値データ等が設定されること)プロトコルが、
キャッシュ・メモリからキャッシュ・メモリへ直接コピ
ーするものである場合には、パイプラインで通信される
データ量がキャッシュ・メモリに入りきる大きさであれ
ば、共有メモリを介在せず直接キャッシュ・メモリ間で
データがパイプライン転送されるため、その効果は一層
大きい。尚、以上の説明で、動的スケジューリングの場
合には、実行状況に応じて使用可能なプロセッサの台数
により割り付けが行われるような目的コードが作成され
るが、静的スケジューリングの場合には、前記指定情報
格納部4からの情報に基づいてプロセッサの割り付けの
ための目的コードが作成される。
On the other hand, if it is determined in step SJ12 that there is no sequential DO loop whose subscripts are equidistant, step SJ12.
13, the equidistant DO loop allocation instructing section 3c searches for a parallel DO loop whose subscripts are equidistant, and if there is such a parallel DO loop, then in step SJ15, to the target code creating section 3e, Instruct the execution of pipeline processing. However, in step SJ15,
When the parallel computer has a hierarchical memory, when pipeline execution is realized between the DO loops, the same communication is performed so that communication between both DO loops executed by the pipeline does not cross the hierarchy. Cluster (11 in FIG. 8)
1 and 11 2 ). This enables high-speed pipeline execution. Also, cache coherency within the cluster is maintained (when any processor in the cluster sets numerical data etc., similar numerical data etc. is also set in each cache memory of other processors). Protocol)
In the case of copying directly from cache memory to cache memory, if the amount of data communicated in the pipeline is large enough to fit in cache memory, there is no need to use shared memory directly between cache memories. Since the data is pipeline transferred, the effect is even greater. In the above description, in the case of dynamic scheduling, the object code is created so that allocation is performed according to the number of available processors according to the execution status. An object code for processor allocation is created based on the information from the designated information storage unit 4.

【0016】図7には、当該自動並列化翻訳装置(コン
パイラ)7により原コードを目的コードに変換した場合
の具体例を示す。同図(a)には、原コードのDOルー
プを示す。この例では、前記指定情報として、例えば、
プロセッサが4台の場合、各プロセッサの番号(0,
1,2,3)は変数Pに設定されているとする。ここで
プロセスとはプロセッサに割り付けられる処理の単位を
いう。同図(b)には、当該原コードを予め指定した指
定情報に基づいて、前記DOループ間並列化コード作成
部3により、目的コードであるDOループ間静的並列化
コードを作成した例を示す。この例では、4つのプロセ
ッサが同時に以下の処理を行うことになる。しかし、各
プロセッサ内でのPの値は違うので、プロセッサφでは
DO I=1,256 を意味し、プロセッサ1では、
DO I=257,512……というふうに実行される
ことになる。一方、同図(c)には、、動的スケジュー
リングの場合の目的コードであるDOループ間動的並列
化コードを示す。同図で、Iは全てのプロセッサから共
通にアクセスできるグローバルな変数iは各プロセッサ
内だけのプライベートな変数であり、各プロセッサは、
1から256までの数の中から順に1つずつ値を取り出
して、自分のローカルな変数iに入れて、その処理を行
う2つ以上のプロセッサが同じ値を取り出さないよう
に、例えば、前記スケジューラに設けられたキューをア
クセスする場合には、当該プロセッサのみのアクセスが
可能であって、他のプロセッサからのアクセスを禁止し
て重複した実行を防止するために、“LOCK”を行
い、キューからの読出しが終了した段階で、“LOC
K”を解除することになる。
FIG. 7 shows a concrete example in which the original code is converted into the target code by the automatic parallelizing translation device (compiler) 7. A DO loop of the original code is shown in FIG. In this example, as the designation information, for example,
If there are four processors, the number of each processor (0,
1, 2, 3) are set to the variable P. Here, the process means a unit of processing assigned to the processor. FIG. 2B shows an example in which the DO loop parallelization code creation unit 3 creates a DO loop static parallelization code, which is a target code, on the basis of designation information for designating the original code in advance. Show. In this example, four processors will simultaneously perform the following processes. However, since the value of P in each processor is different, DO I = 1,256 is meant for processor φ, and for processor 1,
DO I = 257, 512 ... And so on. On the other hand, FIG. 7C shows a DO parallel dynamic parallelization code which is an object code in the case of dynamic scheduling. In the figure, I is a global variable commonly accessible from all processors, i is a private variable only in each processor, and each processor is
In order to prevent two or more processors performing the processing from fetching the values one by one from the numbers 1 to 256 and putting them in their local variable i, for example, the scheduler When accessing the queue provided in the above, only the processor concerned can access it, and in order to prevent access from other processors and prevent duplicate execution, “LOCK” is performed and When the reading of the
K ”will be released.

【0017】以下、図9〜図11に基づいて実行時のプ
ロセッサの割り付け例を示す。この各例では、原コード
は、DOループ1の各項はA(i)からなるDOループ
(Loop)であり、 DO i=1,16 A(i) DOループ2の各項はB(i)からなるDOループであ
り、 DO i=1,16 B(i) で表され、A(i)とB(i)は互いにデータの依存関
係はないものとする。また、説明の簡単のため、DOル
ープ1とDOループ2とでの各ステップの処理時間は等
しいものとし、各項(ステップ、イテレーション)の項
(ステップ)数は16とする。また、p0〜p3は割り
付けられるべき並列計算機を形成する各プロセッサを示
す。
An example of processor allocation at the time of execution will be described below with reference to FIGS. In each of these examples, in the original code, each term of the DO loop 1 is a DO loop (Loop) including A (i), and DO i = 1,16 A (i) Each term of the DO loop 2 is B (i). ), Which is represented by DO i = 1,16 B (i), and A (i) and B (i) have no data dependency relationship with each other. Further, for simplicity of explanation, it is assumed that the processing time of each step in the DO loop 1 and the DO loop 2 is equal, and the number of items (steps) of each item (step, iteration) is 16. Further, p0 to p3 indicate each processor forming a parallel computer to be allocated.

【0018】図9の(a)は従来例に係る場合であっ
て、並列DOループであるDOループ1を各プロセッサ
に分割して並列実行させた後、逐次DOループであるD
Oループ2を1台のプロセッサによって実行させた様子
を示す。この場合には必要とするステップ数は20とな
る。同図(b)には、並列DOループであるDOループ
1と逐次DOループであるDOループ2を並列に実行さ
せた様子を示している。逐次DOループ2を1台のプロ
セッサに割り付け、並列DOループ1を残りの3台のプ
ロセッサに分散させて並列実行させている。全体の処理
の為に必要なステップ数(項数)は16となり高速化さ
れている。
FIG. 9A shows a case of a conventional example, in which a DO loop 1 which is a parallel DO loop is divided into respective processors and executed in parallel, and thereafter a D loop which is a sequential DO loop is executed.
A state where the O loop 2 is executed by one processor is shown. In this case, 20 steps are required. FIG. 2B shows a state in which the DO loop 1 that is a parallel DO loop and the DO loop 2 that is a sequential DO loop are executed in parallel. The sequential DO loop 2 is allocated to one processor, and the parallel DO loop 1 is distributed to the remaining three processors and executed in parallel. The number of steps (number of terms) required for the entire processing is 16, which is faster.

【0019】図10の場合にはDOループ1及びDOル
ープ2をどちらも逐次DOループとし、DOループ1か
らDOループ2へは、それぞれの添字を比較した場合、
距離0のデータ依存関係がある場合を示す。この場合、
2つのループのパイプライン実行が可能になる。図10
(a)では、従来例に相当する場合であって、DOルー
プ1を実行した後に、DOループ2を実行させた様子を
示している。この場合処理に必要なステップ数は32と
なる。図10(b)はDOループ1とDOループ2とを
パイプライン実行させたようすを示す。この場合、処理
に必要なステップ数は17となり高速化されている。
In the case of FIG. 10, both the DO loop 1 and the DO loop 2 are sequential DO loops. From the DO loop 1 to the DO loop 2, when the respective subscripts are compared,
The case where there is a data dependency of the distance 0 is shown. in this case,
It allows pipelined execution of two loops. Figure 10
In (a), which corresponds to the conventional example, the DO loop 1 is executed and then the DO loop 2 is executed. In this case, the number of steps required for processing is 32. FIG. 10B shows a state where the DO loop 1 and the DO loop 2 are pipeline-executed. In this case, the number of steps required for processing is 17, which is faster.

【0020】図11(b)の場合は、DOループ1が逐
次DOループであり、DOループ2を並列DOループと
し、DOループ1からDOループ2へのデータ依存関係
が存在する場合には、従来例では、図11(b)のよう
になり、ステップ数は20となる。DOループ2の並列
実行は行わずに、図10の場合と同じようにパイプライ
ン実行させる(図10(b))ことによりステップ数は
17と高速化される。以上説明したように、本実施例に
あっては、DOループを出来るかぎり並列処理を行うよ
うにしている。したがって、その処理のステップ数を削
減することができるので、処理を高速化することができ
る。また、図8に示すように、階層型のメモリをもった
並列型計算機の場合には、前述したように、DOループ
間のパイプライン実行を実現する際に、パイプラインで
実行させる双方のDOループを同じクラスター内に割り
付けることで、データの通信がネットワークを介在する
ことなく実現でき、高速な実行が可能となる。パイプラ
インで通信されるデータ量がキャッシュ・メモリに入り
きる大きさであれば、共有メモリを介在することもな
く、キャッシュ・メモリから相手側のキャッシュ・メモ
リに直接転送され、さらに高速な実行が可能となる。さ
らに、本実施例では、静的スケジューリングの場合だけ
でなく、動的スケジューリングの場合について、原コー
ドを目的コードに変換するようにしている。したがっ
て、各々の場合の長所を場合に応じて選択することがで
きるので、便利である。即ち、静的スケジューリングは
実行時にプロセッサの割付けを行う必要がないので、そ
の処理(オーバヘッド)分の時間が省略できて、処理が
高速になる。また、動的スケジューリングは、コンパイ
ルされたプログラム(目的コード)はどんなプロセッサ
台数構成の並列計算機上でも動作することができ便利で
ある。
In the case of FIG. 11B, the DO loop 1 is a sequential DO loop, the DO loop 2 is a parallel DO loop, and when there is a data dependency from the DO loop 1 to the DO loop 2, In the conventional example, the result is as shown in FIG. 11B, and the number of steps is 20. The number of steps is increased to 17 by executing pipeline execution as in the case of FIG. 10 (FIG. 10B) without performing parallel execution of the DO loop 2. As described above, in this embodiment, the DO loop is processed in parallel as much as possible. Therefore, the number of steps of the processing can be reduced, and the processing can be speeded up. Further, as shown in FIG. 8, in the case of a parallel computer having a hierarchical memory, as described above, when the pipeline execution between the DO loops is realized, both DOs executed in the pipeline are executed. By allocating loops in the same cluster, data communication can be realized without intervening network and high-speed execution becomes possible. If the amount of data communicated in the pipeline is large enough to fit in the cache memory, it can be transferred directly from the cache memory to the other party's cache memory without intervening shared memory, and faster execution is possible. It will be possible. Furthermore, in this embodiment, the original code is converted into the target code not only in the case of static scheduling but also in the case of dynamic scheduling. Therefore, the advantage of each case can be selected according to the case, which is convenient. That is, in static scheduling, it is not necessary to allocate processors at the time of execution, so the time for the processing (overhead) can be omitted, and the processing becomes faster. In addition, the dynamic scheduling is convenient because the compiled program (target code) can operate on a parallel computer with any number of processors.

【0021】[0021]

【発明の効果】以上説明したように、本発明にあって
は、並列計算機でDOループの実行を行う際には、単に
各並列DOループ内の各項の間だけでなく、各DOルー
プ間でも、可能な限り各プロセッサにより並列実行させ
るように原コードを目的コードに変換している。したが
って、処理の手数を削減することにより、処理を高速化
し、処理時間を削減し、並列計算機の処理効率を高める
ことができるので、並列計算機の有効利用を図ることが
できる。また、第一及び第二の発明の場合には動的スケ
ジューリングの場合についての並列化を行っているの
で、翻訳されたプログラムはどんなプロセッサ台数の構
成の並列計算機上でも動作する。さらに、第三及び第四
の発明の場合には、静的スケジューリングの場合につい
ての並列化を行っているので、実行時にプロセッサ割付
けを行う必要がなく、その分処理が高速化されることに
なる。
As described above, according to the present invention, when executing a DO loop in a parallel computer, not only between the respective terms in each parallel DO loop but also between the respective DO loops. However, the original code is converted into the target code so that each processor can execute them in parallel as much as possible. Therefore, by reducing the number of processing steps, the processing can be speeded up, the processing time can be reduced, and the processing efficiency of the parallel computer can be improved, so that the parallel computer can be effectively used. Further, in the cases of the first and second inventions, since the parallelization in the case of the dynamic scheduling is performed, the translated program can be operated on the parallel computer having any number of processors. Further, in the case of the third and fourth inventions, since the parallelization in the case of static scheduling is performed, it is not necessary to perform processor allocation at the time of execution, and the processing speed is increased accordingly. .

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

【図1】第一の発明の原理ブロック図FIG. 1 is a block diagram of the principle of the first invention.

【図2】第二の発明の原理流れ図FIG. 2 is a flowchart of the principle of the second invention.

【図3】第三の発明の原理ブロック図FIG. 3 is a block diagram showing the principle of the third invention.

【図4】第四の発明の原理ブロック図FIG. 4 is a block diagram of the principle of the fourth invention.

【図5】実施例に係るブロック図FIG. 5 is a block diagram according to an embodiment.

【図6】実施例に係る流れ図FIG. 6 is a flowchart according to an embodiment.

【図7】実施例に係るDOループのコードの変換例を示
す図
FIG. 7 is a diagram showing an example of converting a DO loop code according to the embodiment.

【図8】実施例に係る並列計算機のシステム構成を示す
FIG. 8 is a diagram showing a system configuration of a parallel computer according to the embodiment.

【図9】従来例及び実施例に係る実行時の割付け例を示
す図(1)
FIG. 9 is a diagram (1) showing an allocation example at the time of execution according to the conventional example and the example.

【図10】従来例及び実施例に係る実行時の割付け例を
示す図(2)
FIG. 10 is a diagram (2) showing an allocation example at the time of execution according to the conventional example and the example.

【図11】従来例及び実施例に係る実行時の割付け例を
示す図(3)
FIG. 11 is a diagram (3) showing an allocation example at the time of execution according to the conventional example and the example.

【図12】従来例に係るブロック図FIG. 12 is a block diagram according to a conventional example.

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

10,1 DOループ抽出部 20,2 DOループ間依存関係検出部 30 DOループ間動的並列化コード作成部 31 DOループ間静的並列化コード作成部 40(4) 指定情報出力部(指定情報格納部) 80,8 DOループ内並列化コード作成部 10, 1 DO loop extraction unit 20, 2 DO loop interdependency detection unit 30 DO loop dynamic parallelization code creation unit 31 DO loop static parallelization code creation unit 40 (4) Designated information output unit (designated information Storage unit) 80,8 DO loop in-parallel code creation unit

Claims (10)

【特許請求の範囲】[Claims] 【請求項1】 逐次型言語で記述された原コードから、
並列計算機により並列実行の可能な並列DOループ及
び、並列実行の不可能な逐次DOループを抽出するDO
ループ抽出部(10)と、抽出された並列DOループに
ついて、DOループ内の各項を並列実行させるDOルー
プ内並列化コードを作成するDOループ内並列化コード
作成部(80)とを有し、前記原コードを並列計算機用
の目的コードに変換する自動並列化翻訳装置において、 抽出されたDOループの間の依存関係の検出を行うDO
ループ間依存関係検出部(20)と、 前記DOループ内並列化コード及び検出されたDOルー
プ間の依存関係に基づいて、動的にDOループ間での並
列実行を可能とするDOループ間動的並列化コードを作
成するDOループ間動的並列化コード作成部(30)と
を有することを特徴とする自動並列化翻訳装置。
1. From an original code written in a sequential language,
A parallel DO loop that can be executed in parallel by a parallel computer and a DO that extracts a serial DO loop that cannot be executed in parallel
A loop extraction unit (10) and an intra-DO loop parallelization code creation unit (80) that creates a DO loop intra-parallelization code that causes each term in the DO loop to be executed in parallel for the extracted parallel DO loop. In an automatic parallelizing translation device for converting the original code into a target code for a parallel computer, DO for detecting a dependency between the extracted DO loops
An inter-loop dependency relationship detection unit (20), and a DO loop inter-movement dynamically enabling parallel execution between the DO loops based on the inter-DO loop parallelization code and the detected inter-DO loop dependency relationship. An automatic parallelizing translation device, comprising: a DO parallel inter-DO loop dynamic parallelizing code creating unit (30) that creates a static parallelizing code.
【請求項2】 逐次型言語で記述された原コードを入力
し(S1)、並列計算機により並列実行の可能な並列D
Oループ及び、並列実行の不可能な逐次DOループを原
コードから抽出し、抽出された並列DOループについ
て、DOループ内の各項を並列実行させるDOループ内
並列化コードを作成する(S2)ことにより原コードを
並列計算機用の目的コードに変換する自動並列化翻訳方
法において、 抽出された前記DOループの間の依存関係の検出を行い
(S3)、 前記DOループ内並列化コード及び検出された前記DO
ループ間の依存関係に基づいて、動的にDOループ間で
の並列実行を可能とするDOループ間動的並列化コード
を作成する(S4)ことを特徴とする自動並列化翻訳方
法。
2. A parallel D capable of inputting an original code described in a sequential language (S1) and executing parallel execution by a parallel computer.
An O loop and a serial DO loop that cannot be executed in parallel are extracted from the original code, and a DO loop parallelization code for executing each term in the DO loop in parallel is created for the extracted parallel DO loop (S2). In this way, in the automatic parallelizing translation method for converting the original code into the target code for the parallel computer, the dependency between the extracted DO loops is detected (S3), and the parallelized code in the DO loop and the detected parallel code are detected. Said DO
An automatic parallelization translation method, characterized in that a dynamic parallelization code between DO loops that dynamically enables parallel execution between DO loops is created (S4) based on the dependency between the loops.
【請求項3】 逐次型言語で記述された原コードから、
並列計算機により並列実行の可能な並列DOループ及
び、並列実行の不可能な逐次DOループを抽出するDO
ループ抽出部(10)と,抽出された並列DOループに
ついて、DOループ内の各項を並列実行させるDOルー
プ内並列化コードを作成するDOループ内並列化コード
作成部(80)とを有し、前記原コードを並列計算機用
の目的コードに変換する自動並列化翻訳装置において、 抽出されたDOループの間の依存関係の検出を行うDO
ループ間依存関係検出部(20)と、 処理が割り付けられるプロセッサを予め指定する指定情
報を出力する指定情報出力部(40)と、 前記DOループ内並列化コード、検出されたDOループ
間の依存関係、及び前記指定情報に基づいて、静的にD
Oループ間での並列実行を可能とするDOループ間静的
並列化コードを作成するDOループ間静的並列化コード
作成部(31)とを有することを特徴とする自動並列化
翻訳装置。
3. From an original code written in a sequential language,
A parallel DO loop that can be executed in parallel by a parallel computer and a DO that extracts a serial DO loop that cannot be executed in parallel
A loop extraction unit (10) and a DO loop internal parallelization code creation unit (80) that creates a DO loop internal parallelization code that causes each term in the DO loop to be executed in parallel for the extracted parallel DO loop. In an automatic parallelizing translation device for converting the original code into a target code for a parallel computer, DO for detecting a dependency between the extracted DO loops
Inter-loop dependency relationship detection unit (20), specified information output unit (40) that outputs specified information that specifies in advance the processor to which the process is allocated, the DO loop parallelization code, and the detected DO loop dependence Statically based on the relationship and the specified information
An automatic parallelizing translation apparatus, comprising: a DO loop static parallelizing code creating unit (31) for creating a DO loop static parallelizing code that enables parallel execution between O loops.
【請求項4】 逐次型言語で記述された原コードを入力
し(S1)、並列計算機により並列実行の可能な並列D
Oループ及び、並列処理の不可能な逐次DOループを原
コードから抽出し、抽出された並列DOループについ
て、DOループ内で並列実行させるDOループ内並列化
コードを作成する(S2)ことにより原コードを並列計
算機用の目的コードに変換する自動並列化翻訳方法にお
いて、 抽出された前記DOループの間の依存関係の検出を行い
(S3)、 前記DOループ内並列化コード、検出されたDOループ
間の依存関係、及び処理が割り付けられるべきプロセッ
サを予め指定する指定情報に基づいて、静的にDOルー
プ間での並列実行を行わせるDOループ間静的並列化コ
ードを作成する(S14)ことを特徴とする自動並列化
翻訳方法。
4. A parallel D capable of inputting an original code described in a sequential language (S1) and performing parallel execution by a parallel computer.
By extracting an O loop and a sequential DO loop that cannot be processed in parallel from the original code, and creating an intra-DO loop parallelized code that causes the extracted parallel DO loop to execute in parallel in the DO loop (S2). In an automatic parallelizing translation method for converting a code into a target code for a parallel computer, a dependency between the extracted DO loops is detected (S3), the intra-DO loop parallelizing code, and the detected DO loops are detected. To create a static parallelization code between DO loops that statically executes parallel execution between the DO loops based on the inter-dependency relationship and the designation information that pre-designates the processor to which the process should be allocated (S14). Automatic parallelized translation method characterized by.
【請求項5】 前記DOループ間依存関係検出部(2
0)により、各逐次DOループと並列DOループとの間
に依存関係がないことが検出された場合には、実行時に
は逐次DOループを優先的にプロセッサに割り付け、残
りのプロセッサで並列DOループを実行させるDOルー
プ間動的並列化コード又はDOループ間静的並列化コー
ドを作成するDOループ動的並列化コード作成部(3
0)又はDOループ静的並列化コード作成部(31)を
有することを特徴とする請求項1又は請求項3記載の自
動並列化翻訳装置。
5. The inter-DO loop dependency relationship detection unit (2)
When 0) detects that there is no dependency between each sequential DO loop and parallel DO loop, the sequential DO loop is preferentially assigned to the processor at the time of execution, and the parallel DO loop is assigned to the remaining processors. DO loop dynamic parallelization code creation unit (3) that creates the DO loop dynamic parallelization code to be executed or the DO loop static parallelization code
0) or a DO loop static parallelization code generation unit (31), The automatic parallelization translation device according to claim 1 or 3.
【請求項6】 各逐次DOループと並列DOループとの
間に依存関係がないことが検出された場合には、実行時
には逐次DOループを優先的にプロセッサに割り付け、
残りのプロセッサで並列DOループを実行させるDOル
ープ間動的並列化コード又はDOループ間静的並列化コ
ードを作成することを特徴とする請求項2又は4記載の
自動並列化翻訳方法。
6. When it is detected that there is no dependency between each serial DO loop and the parallel DO loop, the serial DO loop is preferentially allocated to the processor at the time of execution,
5. The automatic parallelizing translation method according to claim 2, wherein a dynamic parallelizing code between DO loops or a static parallelizing code between DO loops that causes the remaining processors to execute parallel DO loops is created.
【請求項7】 前記DOループ間依存関係検出部(2
0)により、データ依存関係にある2つのDOループ間
で、そのデータ依存が2つのループの各項の項番号につ
いて常に等距離であることが検出された場合には、前記
DOループ動的並列化コード作成部(30)又はDOル
ープ静的並列化コード作成部(31)は各項の実行につ
いてはパイプラインを実行させるDOループ間動的並列
化コード又はDOループ間静的並列化コードを作成する
ことを特徴とする請求項1又は請求項3記載の自動並列
化翻訳装置。
7. The inter-DO loop dependency relationship detection unit (2)
0) detects that the data dependence is always equidistant between the two DO loops having the data dependence, the DO loop dynamic parallelism. The execution code creation unit (30) or the DO loop static parallelization code creation unit (31) executes the DO loop dynamic parallelization code or the DO loop static parallelization code that causes the pipeline to execute for the execution of each term. The automatic parallelizing translation device according to claim 1 or 3, which is created.
【請求項8】 データ依存関係にある2つのDOループ
間で、そのデータ依存が2つのループの各項の項番号に
ついて常に等距離であることが検出された場合には、各
項の処理についてはパイプライン処理を実行させるDO
ループ間動的並列化コード又はDOループ間静的並列化
コードを作成することを特徴とする請求項2又は請求項
4記載の自動並列化翻訳方法。
8. When processing is performed between two DO loops having a data dependency relationship, it is detected that the data dependency is always equidistant with respect to the item numbers of the respective terms of the two loops. Is a DO that executes pipeline processing
The automatic parallelization translation method according to claim 2 or 4, wherein a dynamic parallelization code between loops or a static parallelization code between DO loops is created.
【請求項9】 階層型のメモリを持った並列計算機上で
複数のDOループをパイプライン実行させる際には、D
Oループ間の通信が階層を越えないように同じクラスタ
ーに割り付けるようにDOループ間動的並列化コード又
はDOループ間静的並列化コードを作成すること特徴と
する請求項7の自動並列化翻訳装置。
9. When a plurality of DO loops are pipeline-executed on a parallel computer having a hierarchical memory, D
8. The automatic parallelization translation according to claim 7, wherein the DO loop dynamic parallelization code or the DO loop static parallelization code is created such that the communication between the O loops is assigned to the same cluster so as not to cross the hierarchy. apparatus.
【請求項10】 階層型のメモリを持った並列計算機上
で複数のDOループをパイプライン実行させる際には、
DOループ間の通信が階層を越えないように同じクラス
ターに割り付けるようにDOループ間動的並列化コード
又はDOループ間動的並列化コードを作成すること特徴
とする請求項8記載の自動並列化翻訳方法。
10. When a plurality of DO loops are pipeline-executed on a parallel computer having a hierarchical memory,
9. The automatic parallelization according to claim 8, wherein the DO parallel dynamic parallelization code or the DO loop dynamic parallelization code is created so as to be assigned to the same cluster so that the communication between the DO loops does not cross the hierarchy. How to translate.
JP626293A 1993-01-18 1993-01-18 Automatic parallelizing translation device and method Withdrawn JPH06214801A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP626293A JPH06214801A (en) 1993-01-18 1993-01-18 Automatic parallelizing translation device and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP626293A JPH06214801A (en) 1993-01-18 1993-01-18 Automatic parallelizing translation device and method

Publications (1)

Publication Number Publication Date
JPH06214801A true JPH06214801A (en) 1994-08-05

Family

ID=11633549

Family Applications (1)

Application Number Title Priority Date Filing Date
JP626293A Withdrawn JPH06214801A (en) 1993-01-18 1993-01-18 Automatic parallelizing translation device and method

Country Status (1)

Country Link
JP (1) JPH06214801A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011118752A (en) * 2009-12-04 2011-06-16 Toshiba Corp Compiler
CN118860369A (en) * 2024-08-29 2024-10-29 北京清程极智科技有限公司 Code parallelization method, device, computer equipment, readable storage medium and program product

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011118752A (en) * 2009-12-04 2011-06-16 Toshiba Corp Compiler
CN118860369A (en) * 2024-08-29 2024-10-29 北京清程极智科技有限公司 Code parallelization method, device, computer equipment, readable storage medium and program product

Similar Documents

Publication Publication Date Title
TWI525540B (en) Mapping processing logic having data-parallel threads across processors
CN111090464B (en) A data stream processing method and related equipment
Bauer et al. Singe: Leveraging warp specialization for high performance on gpus
US8296743B2 (en) Compiler and runtime for heterogeneous multiprocessor systems
KR101559090B1 (en) Automatic kernel migration for heterogeneous cores
US8417919B2 (en) Assigning different serialization identifier to operations on different data set for execution in respective processor in multi-processor system
US8528001B2 (en) Controlling and dynamically varying automatic parallelization
Huynh et al. Scalable framework for mapping streaming applications onto multi-GPU systems
US20120331278A1 (en) Branch removal by data shuffling
JP2019049843A (en) Execution node selection program, execution node selection method and information processing apparatus
Zhang et al. Optimizing the Barnes-Hut algorithm in UPC
Noaje et al. Source-to-source code translator: OpenMP C to CUDA
US20030126589A1 (en) Providing parallel computing reduction operations
Meenderinck et al. A case for hardware task management support for the StarSs programming model
JPH06214801A (en) Automatic parallelizing translation device and method
He et al. ARACHNE: Optimizing distributed parallel applications with reduced inter-process communication
Kaouane et al. SysCellC: Systemc on cell
US20250370768A1 (en) A computer-implemented method and a computer-readable medium
US20260119144A1 (en) Techniques for compiler lowering of task-based programs to asynchronous accelerators
Cole et al. Efficient resource oblivious algorithms for multicores
Wang et al. micMR: An efficient MapReduce framework for CPU–MIC heterogeneous architecture
Hu et al. Adjust ELF format for multi-core architecture
Liang et al. Automatically migrating sequential applications to heterogeneous system architecture
Patil Auto Conversion of Serial C Code into Cuda-C-Code for Faster Execution Utilizing GPU
Xiaowen Research on Multi-Core PC Parallel Computation Based on OpenMP

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: 20000404