JPH03172958A - Synchronous processing method, system and method for parallel processing, and parallel program generator - Google Patents

Synchronous processing method, system and method for parallel processing, and parallel program generator

Info

Publication number
JPH03172958A
JPH03172958A JP31274689A JP31274689A JPH03172958A JP H03172958 A JPH03172958 A JP H03172958A JP 31274689 A JP31274689 A JP 31274689A JP 31274689 A JP31274689 A JP 31274689A JP H03172958 A JPH03172958 A JP H03172958A
Authority
JP
Japan
Prior art keywords
processor
processing
program
processors
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP31274689A
Other languages
Japanese (ja)
Inventor
Yuji Onishi
裕二 大西
Keisuke Toyama
圭介 十山
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP31274689A priority Critical patent/JPH03172958A/en
Publication of JPH03172958A publication Critical patent/JPH03172958A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To efficiently execute a program by waiting for the other processors to synchronize each processor with them in accordance with arrival of the processing of this processor at a prescribed waiting position and selecting an execution restart position after waiting by each processor in accordance with the processing result of this processor. CONSTITUTION:Each of processors 1 to 4 waits for the other processors and is synchronized with them based on first information indicating whether processings of respective processors 1 to 4 arrive at a prescribed waiting position or not. Meanwhile, each of processors 1 to 4 selects an execution restart position after waiting based on second information corresponding to processing results in processors 1 to 4. That is, processors 1 to 4 are synchronized with one another, and they are branched to different processings in accordance with processing results. Therefore, this system can cope with not only the for type loop but also the while type loop. Thus, information is efficiently written and referred.

Description

【発明の詳細な説明】 [産業上の利用分野コ 本発明は、同期処理方法および並列処理システムおよび
並列処理方法および並列化プログラム生成装置に関し、
さらに詳しくは、複数のプロセッサで並列に処理を行う
際に各プロセッサ間で同期をとりながら処理を進めるた
めの同期処理方法および並列処理システムおよび並列処
理方法および並列化プログラム生成装置に関する。
[Detailed Description of the Invention] [Industrial Application Field] The present invention relates to a synchronous processing method, a parallel processing system, a parallel processing method, and a parallelized program generation device,
More specifically, the present invention relates to a synchronous processing method, a parallel processing system, a parallel processing method, and a parallel program generation device for proceeding with processing while synchronizing each processor when processing is performed in parallel by a plurality of processors.

[従来の技術] プログラムの実効的な処理速度を向上することを目的と
して複数のプロセッサで並列に処理を進める並列処理シ
ステムがある。
[Prior Art] There is a parallel processing system in which processing is performed in parallel by a plurality of processors in order to improve the effective processing speed of a program.

並列処理システムでは、プログラムは複数に分割され、
分割された各プログラムが複数のプロセッサでそれぞれ
並列に実行される。このとき、分割された各プログラム
11りでデータの定義と参照の順序関係(データ依存関
係)がある場合に、正しい実行結果を得るためには、前
記順序関係を正しく保証する必要がある。つまり、デー
タを定義した後で参照するか参照した後で定義するかに
よって実行結果が異なるため、データの定義と参照の順
序関係が、分割される前のプログラムと同じになるよう
に保証して、各プロセッサで分割された各プログラムを
実行しなければならない。
In a parallel processing system, a program is divided into multiple parts,
Each divided program is executed in parallel by multiple processors. At this time, if there is an order relationship (data dependency relationship) between data definitions and references in each of the divided programs 11, it is necessary to ensure the order relationship is correct in order to obtain correct execution results. In other words, the execution results differ depending on whether the data is defined and then referenced, or referenced and then defined. , each processor must execute each divided program.

このため、データ依存関係があるプログラムを担当する
プロセッサ間では、データの定義と参照の順序関係が正
しくなるように同期をとりつつ、担当するプログラムを
実行している。
For this reason, processors in charge of programs that have data dependencies execute the programs while synchronizing so that the order of data definition and reference is correct.

上記同期のための従来技術としては、例えば、バリア同
期と呼ばれる同期処理方法が知られている。
As a conventional technique for the above synchronization, for example, a synchronization processing method called barrier synchronization is known.

このバリア同期は、分割されたプログラムの全てにバリ
アとしである地点を設定し、各プロセッサはこのバリア
まで処理が進むと次の処理に移らずに他のプロセッサの
処理がバリアまで進むのを待ち合せ、全てのプロセッサ
の処理がバリアまで進んでから次の処理に移ることによ
り同期をとるものである。
This barrier synchronization sets a certain point as a barrier for all divided programs, and when each processor reaches this barrier, it waits for the processing of other processors to progress to the barrier without moving on to the next process. , synchronization is achieved by allowing the processing of all processors to proceed to the barrier before moving on to the next processing.

このバリア同期の一般的説明は、例えば「並列処理マシ
ン 富田眞治外 オーム社」や、  rlEEESof
tware  January、1988  P、34
−42Jに記載されている。また、具体的実現方法につ
いては、例えばINEEE TRANSACTIONS
 ON COMPUTERS AUGUST。
General explanations of this barrier synchronization include, for example, "Parallel Processing Machine by Shinji Tomita Ohmsha" and rlEEEESof
tware January, 1988 P, 34
-42J. For specific implementation methods, see INEEE TRANSACTIONS, for example.
ON COMPUTERS AUGUST.

1988  P、991−1004Jに記載されている
1988 P, 991-1004J.

[発明が解決しようとする課題] 上記rIEEE TRANSACTIONS ON C
OMPUTERS  AU−GUST、 1988  
P、991−1004Jに記載されているバリア同期の
具体的実現方法の対象は、繰り返し処理であって、繰り
返しを制御する変数の刻みが定数であり、且つ、コンパ
イルする時点で繰り返し回数が確定しているものである
。これはC言語におけるfor文に対応するため、以下
では、これをfor型ループと呼ぶ。
[Problem to be solved by the invention] The above rIEEE TRANSACTIONS ON C
OMPUTERS AU-GUST, 1988
The target of the concrete implementation method of barrier synchronization described in P, 991-1004J is repetitive processing, where the increment of the variable that controls the repetition is constant, and the number of repetitions is determined at the time of compilation. It is something that Since this corresponds to the for statement in the C language, this will be referred to as a for-type loop below.

一般に、並列処理の対象となるものは、プログラム実行
時間の大部分が費やされる繰り返し処理であるため、f
or型ループに対して適用可能な上記従来技術は有用で
ある。
Generally, the target of parallel processing is repetitive processing that consumes most of the program execution time, so f
The above-described conventional techniques applicable to or-type loops are useful.

しかし、繰り返しを制御する変数の刻みが定数でない、
又は、繰り返し回数がコンパイルする時点で確定してい
ない繰り返し処理もある。これはC言語におけるwhi
le文に対応するため、以下では、これをwhile型
ループと呼ぶ。上記従来技術は、このようなwhile
型ループに対しては適用できないという問題があった。
However, if the increment of the variable that controls repetition is not constant,
Alternatively, there may be repetitive processing in which the number of repetitions is not determined at the time of compilation. This is wh in C language
In order to correspond to the le statement, this is hereinafter referred to as a while type loop. The above conventional technology is
The problem is that it cannot be applied to type loops.

そこで、本発明の目的は、for型ループだけでな(、
while型ループに対しても適用可能な同期処理方法
を提供することにある。また、その同期処理方法を実行
する並列処理システムを提供することにある。また、そ
の同期処理方法を利用した並列処理方法を提供すること
にある。また、その同期処理方法を実行するプログラム
を生成する並列化プログラム生成装置を提供することに
ある。
Therefore, the purpose of the present invention is not only for loops (,
The object of the present invention is to provide a synchronization processing method that can be applied to a while type loop as well. Another object of the present invention is to provide a parallel processing system that executes the synchronous processing method. Another object of the present invention is to provide a parallel processing method using the synchronous processing method. Another object of the present invention is to provide a parallelization program generation device that generates a program that executes the synchronous processing method.

[課題を解決、するための手段] 第1の観点では、本発明は、複数のプロセッサによる並
列処理の進行を調和させるためにプロセッサを相互に待
合せさせる同期処理方法において、各プロセッサの処理
が所定の待合せ場所に達したか否かという第1の情報と
、各プロセッサでの処理結果に対応した第2の情報とを
プロセッサ単位にプロセッサ外部で保持し、前記第1の
情報に基づいて各プロセッサは他プロセッサと待合せて
同期をとると共に、前記第2の情報に基づいて各プロセ
ッサは待合せ後の実行再開場所を選択することを特徴と
する同期処理方法を提供する。
[Means for Solving and Accomplishing the Problems] In a first aspect, the present invention provides a synchronization processing method for queuing processors with each other in order to harmonize the progress of parallel processing by a plurality of processors. First information indicating whether or not the meeting place has been reached, and second information corresponding to the processing result of each processor are stored outside the processor for each processor, and each processor provides a synchronization processing method characterized in that each processor waits and synchronizes with other processors, and each processor selects a place to resume execution after waiting based on the second information.

第2の観点では、本発明は、複数のプロセッサと、それ
らプロセッサの各々に割り当てられ対応するプロセッサ
により設定される同期検出用ビットを有する第1のレジ
スタ手段と、前記プロセッサの各々に割り当てられ対応
するプロセッサにより設定される再開場所指定用ビット
を有する第2のレジスタ手段と、前記第1のレジスタ手
段の同期検出用ビットの状態から同期を判定して各プロ
セッサに待合せ又は実行再開を指令する同期判定手段と
、前記第2のレジスタ手段の再開場所指定用ビットの状
態に基づいて各プロセッサに実行再開場所を指定する実
行再開場所指定手段とを具備してなることを特徴とする
並列処理システムを提供する。なお、第1のレジスタ手
段と第2のレジスタ手段とは、物理的には一つのレジス
タであってもよい。
In a second aspect, the present invention includes a plurality of processors, first register means having a synchronization detection bit assigned to each of the processors and set by the corresponding processor; a second register means having a restart location designating bit set by the processor that executes the process; and a synchronization system that determines synchronization from the state of a synchronization detection bit of the first register means and instructs each processor to wait or resume execution. A parallel processing system comprising: a determining means; and an execution restart location specifying means for specifying an execution restart location for each processor based on the state of a resume location designation bit of the second register means. provide. Note that the first register means and the second register means may be physically one register.

第3の観点では、本発明は、複数のプロセッサで並行し
て処理を実行する並列処理方法において、各プロセッサ
の処理が所定の待合せ場所に到達したことを表わす第1
の情報をプロセッサ外部に出力するステップと、各プロ
セッサの処理結果に対応した第2の情報をプロセッサ外
部に出力するステップと、他のプロセッサから出力され
た前記第1の情報に基づいて処理の待合せ又は実行再開
を行なうステップと、他のプロセッサから出力された前
記第2の情報に基づいて実行再開場所を選択するステッ
プと、を有することを特徴とする並列処理方法を提供す
る。
In a third aspect, the present invention provides a parallel processing method in which a plurality of processors execute processing in parallel.
outputting information to the outside of the processor, outputting second information corresponding to the processing results of each processor to the outside of the processor, and queuing processing based on the first information output from other processors. Alternatively, there is provided a parallel processing method characterized by comprising the steps of restarting execution, and selecting a place to restart execution based on the second information output from another processor.

第4の観点では、本発明は、逐次処理用プログラムから
並列処理用プログラムを生成する並列化プログラム生成
装置において、プログラムの所定の待合せ場所に処理が
到達したことを表わす第1の情報をプロセッサ外部に出
力するステップを並列処理用プログラム中に付加する手
段と、プログラム中の処理結果に対応した第2の情報を
プロセッサ外部に出力するステップを並列処理用プログ
ラム中に付加する手段と、他のプロセッサから出力され
た前記第1の情報に基づいて処理の待合せ又は実行再開
を行なうステップを並列処理用プログラム中に付加する
手段と、他のプロセッサから出力された前記第2の情報
に基づいて実行再開場所を選択するステップを並列処理
用プログラム中に付加する手段と、を具備したことを特
徴とする並列化プログラム生成装置を提供する。なお、
この並列化プログラム生成装置は、コンパイラの形態で
あってもよい。
In a fourth aspect, the present invention provides a parallelization program generation device that generates a parallel processing program from a sequential processing program, in which first information indicating that a process has reached a predetermined waiting location of the program is transmitted to the outside of the processor. means for adding a step to the parallel processing program to output second information to the outside of the processor, means for adding a step to the parallel processing program to output second information corresponding to the processing result in the program to the outside of the processor; means for adding a step to the parallel processing program for queuing processing or resuming execution based on the first information output from another processor; and resuming execution based on the second information output from another processor. A parallel program generation device is provided, comprising: means for adding a step for selecting a location into a parallel processing program. In addition,
This parallelization program generation device may be in the form of a compiler.

[作用〕 第1の観点による本発明の同期処理方法では、各プロセ
ッサの処理が所定の待合せ場所に達したか否かという第
1の情報に基づいて各プロセッサは他プロセッサと待合
せて同期をとる。一方、各プロセッサでの処理結果に対
応した第2の情報に基づいて各プロセッサは待合せ後の
実行再開場所を選択する。すなわち、各プロセッサを同
期させると共に、処理結果に応じて異なる処理に分岐さ
せられるようになる。そこで、for型ループだけでな
(、while型ループにも対応可能となる。また、第
1の情報と第2の情報をプロセッサ外部に保持している
から、情報の書き込みと参照を効率よく行なえるように
なる。
[Operation] In the synchronous processing method of the present invention according to the first aspect, each processor waits and synchronizes with other processors based on the first information indicating whether the processing of each processor has reached a predetermined meeting place. . On the other hand, each processor selects a place to resume execution after waiting based on second information corresponding to the processing result of each processor. In other words, each processor can be synchronized and branched into different processes depending on the processing results. Therefore, it becomes possible to handle not only for type loops but also (and while type loops. Also, since the first information and second information are held outside the processor, writing and referencing of information can be performed efficiently. Become so.

第2の観点による本発明の同期処理方法では、各プロセ
ッサは、処理が所定の待合せ場所に達したか否かにより
第1のレジスタ手段の割り当てられた同期検出用ビット
を設定する。そして、同期判定手段は、第1のレジスタ
手段の同期検出用ビットの状態から同期を判定して各プ
ロセッサに待合せ又は実行再開を指令する。一方、各プ
ロセッサは、処理結果に応じて第2のレジスタ手段の割
り当てられた再開場所指定用ビットを設定する。
In the synchronous processing method of the present invention according to the second aspect, each processor sets the allocated synchronous detection bit of the first register means depending on whether the processing has reached a predetermined meeting place. The synchronization determining means determines synchronization from the state of the synchronization detection bit of the first register means and instructs each processor to wait or resume execution. On the other hand, each processor sets the assigned restart location designation bit of the second register means according to the processing result.

そして、実行再開場所指定手段は、第2のレジスタ手段
の再開場所指定用ビットの状態に基づいて各プロセッサ
に実行再開場所を指定する。これにより、各プロセッサ
が同期させられると共に、処理結果に応じて異なる処理
に分岐させられるようになる。そこで、for型ループ
だけでな(、Whi le型小ループも対応可能となる
The execution restart location designation means designates the execution restart location for each processor based on the state of the restart location designation bit of the second register means. This allows each processor to be synchronized and to branch to different processes depending on the processing results. Therefore, not only for-type loops (and while-type small loops can also be supported).

第3の観点による本発明の並列処理方法では、プロセッ
サは、所定の待合せ場所に処理が到達したことを表わす
第1の情報と、処理結果に対応した第2の情報とをプロ
セッサ外部に出力する。そして、他のプロセッサから出
力された前記第1の情報に基づくタイミングで、また、
他のプロセッサから出力された前記第2の情報に基づく
実行再開場所から、処理を再開する。そこで、他のプロ
セッサと同期できるようになると共に、処理結果に応じ
て異なる処理に分岐できるようになるから、for型ル
ープだけでな(、while型ループにも対応可能とな
る。
In the parallel processing method of the present invention according to the third aspect, the processor outputs first information indicating that the processing has reached a predetermined meeting place and second information corresponding to the processing result to the outside of the processor. . Then, at a timing based on the first information output from another processor,
Processing is restarted from the execution restart location based on the second information output from the other processor. Therefore, since it becomes possible to synchronize with other processors and to branch to different processes depending on the processing result, it becomes possible to support not only for-type loops but also while-type loops.

第4の観点による本発明の並列化プログラム生成装置で
は、逐次処理用プログラムから並列処理用プログラムを
生成する際に、所定の待合せ場所に処理が到達したこと
を表わす第1の情報をプロセッサ外部に出力するステッ
プと、処理結果に対応した第2の情報をプロセッサ外部
に出力するステップと、他のプロセッサから出力された
前記第1の情報に基づいて処理の待合わせ又は実行再開
を行なうステップと、他のプロセッサから出力された前
記第2の情報に基づいて実行再開場所を選択するステッ
プとを並列処理用プログラム中に付加する。そこで、生
成された並列処理用プログラムは、for型ループだけ
でな(、while型ループにも対応可能のものとなる
In the parallelization program generation device of the present invention according to the fourth aspect, when generating a parallel processing program from a sequential processing program, the first information indicating that the processing has arrived at a predetermined waiting place is transmitted to the outside of the processor. a step of outputting second information corresponding to the processing result to the outside of the processor; and a step of waiting or resuming execution of the process based on the first information output from another processor; A step of selecting an execution restart location based on the second information output from another processor is added to the parallel processing program. Therefore, the generated parallel processing program can handle not only for-type loops, but also while-type loops.

[実施例] 以下、図に示す実施例により本発明をさらに詳細に説明
する。なお、これにより本発明が限定されるものではな
い。
[Example] Hereinafter, the present invention will be explained in more detail with reference to Examples shown in the drawings. Note that the present invention is not limited thereby.

第1図は本発明の同期処理方法を実施する並列処理シス
テム100のブロック図である。
FIG. 1 is a block diagram of a parallel processing system 100 implementing the synchronous processing method of the present invention.

この並列処理システム100は、4台のプロセッサ1,
2,3.4と、共有の主記憶装置10と、各プロセッサ
1〜4が待合せ処理中か待合せ処理以外の処理の実行中
かを表すビットAl、A2゜A3.A4を保持するレジ
スタA101と、各プロセッサ1〜4の待合せ処理終了
後のプログラム実行再開場所を指定するためのビットB
l、132゜B3.B4を保持するレジスタB102と
、レジスタA101の各ビットA1〜A4を判定して各
プロセッサ1〜4に実行再開指示109を出すレジスタ
A判定回路103と、レジスタB102の各ビット81
〜B4を判定して各プロセッサ1〜4に実行再開場所を
指定するプロセッサ制御信号105a、105b、10
6a、106b、107a、107b、108a、10
8bを出すレジスタB判定回路104とを具備してなっ
ている。
This parallel processing system 100 includes four processors 1,
2, 3.4, the shared main storage device 10, and bits Al, A2, A3, which indicate whether each of the processors 1 to 4 is executing a queuing process or a process other than the queuing process. A register A101 that holds A4, and a bit B that specifies the location where program execution will resume after the end of the waiting process for each processor 1 to 4.
l, 132°B3. A register B102 that holds B4, a register A determination circuit 103 that determines each bit A1 to A4 of the register A101 and issues an execution restart instruction 109 to each processor 1 to 4, and each bit 81 of the register B102.
- Processor control signals 105a, 105b, 10 that determine B4 and specify the execution restart location for each processor 1-4
6a, 106b, 107a, 107b, 108a, 10
8b.

レジスタA判定回路103は、レジスタAl01の全ビ
ットA1〜A4の論理積をとり、結果を実行再開指示1
09として各プロセッサ1〜4に出力する。
The register A determination circuit 103 takes the AND of all bits A1 to A4 of the register Al01, and uses the result to issue an execution restart instruction 1.
09 to each processor 1 to 4.

レジスタB判定回路104は、レジスタB102のビッ
トB1〜B4をコード化し、プロセッサ制御信号105
a〜108bとして各プロセッサ1〜4に出力する。レ
ジスタB102のビットB1〜B4の値とプロセッサ制
御信号105a〜108bの関係を第2図に示す。なお
、第2図中の*はO’、’1’ のどちらでもよいこと
を表している。
Register B determination circuit 104 encodes bits B1 to B4 of register B 102 and outputs a processor control signal 105.
It is output to each processor 1-4 as a-108b. FIG. 2 shows the relationship between the values of bits B1 to B4 of register B102 and processor control signals 105a to 108b. Note that * in FIG. 2 indicates that either O' or '1' may be used.

第3図に、上記並列処理システム100で処理するwh
ile型ループのプログラム例を示す。
FIG. 3 shows wh processed by the parallel processing system 100.
An example of a program for an ile type loop is shown below.

このプログラム400は、iに1°を代入し、配列の要
素a [i]が“0°でない場合は何らかの処理をして
から配列の要素a [i]に0°を代入し、iをインク
リメントし、配列の要素a [i]が0°のものに出会
うと処理を終了することを行なうプログラムである。
This program 400 assigns 1° to i, and if array element a[i] is not 0°, performs some processing, then assigns 0° to array element a[i], and increments i. This is a program that terminates the process when element a [i] of the array is found to be 0°.

プログラム400は、各プロセッサ1〜4で並列実行す
るために、プログラム401,402゜403.404
に分割される。なお、プログラム403.404の内容
の図示は省略するが、プログラム401,402の内容
と同様のものである。
The program 400 includes programs 401, 402, 403, 404 for parallel execution on each of the processors 1 to 4.
divided into Although illustration of the contents of the programs 403 and 404 is omitted, they are similar to the contents of the programs 401 and 402.

分割したプログラム401〜404中には、処理の同期
を制御するため、以下の文が付加される。
The following statements are added to the divided programs 401 to 404 in order to control the synchronization of processing.

clearレジ゛スタA [xl・・・レジスタAl0
Iのピッ)Axをクリアする。
clear register A [xl... register Al0
I's beep) Clear Ax.

clearレジ′スタB [xl・・・レジスタB10
2のピッ)Bxをクリアする。
clear register' register B [xl... register B10
2nd pick) Clear Bx.

setレジスタ A [xl・・・レジスタAl0Iの
ピッ)Axをセットする。
set register A [xl... register Al0I pin) Set Ax.

setレジスタ B [xl・・・レジスタB102の
ビットBxをセットする。
set register B [xl...Sets bit Bx of register B102.

待合せ処理・・・同期のための待合せである。後にいく
つかの具体例を示して説明する。
Waiting process: Waiting for synchronization. This will be explained later by showing some specific examples.

プログラム401,402,403,404は、並列化
変換機能を持つコンパイラによって自動的またはプログ
ラマとの対話により必要な情報を収集し、プログラム4
00から生成される。
Programs 401, 402, 403, and 404 collect necessary information automatically or through interaction with the programmer by a compiler with a parallelization conversion function.
Generated from 00.

コンパイラは、同期処理のためのレジスタA101、 
 レジスタB102のビットをクリアする文を生成し、
プログラム400の変換を開始する。
The compiler has a register A101 for synchronization processing,
Generate a statement to clear the bit of register B102,
Start converting the program 400.

ループを制御する変数iは、各プロセッサ1〜4で一時
的に使用されるため、レジスタregjに割り付けられ
、初期化される。初期値は、プロセッサ1ではプログラ
ム400と同じ値で、以降のプロセッサ2〜4ではプロ
グラム400の変数iの増分だけ増え、プロセッサ2で
は2.プロセッサ3では3.プロセッサ4では4である
Since the variable i that controls the loop is temporarily used by each processor 1 to 4, it is allocated to the register regj and initialized. The initial value is the same value as the program 400 for the processor 1, increases by the increment of the variable i of the program 400 for the subsequent processors 2 to 4, and increases by 2. 3 for processor 3. For processor 4, it is 4.

ループ本体の変換では、先頭から、レジスタA101の
ビットをセットする文と、待合せ処理の文と1プロセッ
サ制御化号105a〜108bが“00°のときの実効
再開場所を示すラベル゛addr Oo と、レジスタ
A101のビットをクリアする文とを生成する。そして
、プログラム400のループ本体の命令列を配置する。
In converting the main body of the loop, starting from the beginning, there is a statement that sets the bit of register A101, a statement for waiting processing, and a label "addr Oo" indicating the effective restart location when processor control codes 105a to 108b are "00°". A statement that clears the bit of register A101 is generated.Then, the instruction string of the loop body of the program 400 is arranged.

但し、プログラム400の変数iの更新命令はレジスタ
regjの更新命令に変換され、レジスタreg−jの
増分は(プロセッサ数×プログラム400の変数iの増
分)、つまり、4に変換される。
However, an instruction to update variable i in program 400 is converted to an instruction to update register regj, and the increment in register reg-j is converted to (number of processors x increment in variable i in program 400), that is, 4.

この後、レジスタB102.  レジスタAl0Iのビ
ットをセットする文と、待合せ処理の文とが生成される
After this, register B102. A statement for setting the bit of register Al0I and a statement for queuing processing are generated.

次いで、プロセッサ制御信号105a〜108bが01
°のときの実行再開場所を示すラベル’addr 1’
 と、プログラム400のループ本体の命令列から変数
iの更新命令を除いた命令と、全ての処理の終了ラベル
゛exit’への分岐命令とを生成する。
Then, processor control signals 105a-108b become 01
Label 'addr 1' indicating where to resume execution when °
Then, an instruction obtained by removing the update instruction for variable i from the instruction sequence of the loop body of the program 400, and a branch instruction to the end label "exit" of all processing are generated.

さらに、プロセッサ制御信号105a〜108bが11
°のときの実行再開場所を示すラベル’addr 3°
 と、レジスタregjをプログラム400の変数iに
持ち込む命令を生成する。
Further, the processor control signals 105a to 108b are 11
Label 'addr indicating where to resume execution when ° 3°
Then, an instruction to bring register regj into variable i of the program 400 is generated.

最後に、プロセッサ制御信号105a〜108bが10
’ のときの実行再開場所を示すラベル’addr 2
° と、全ての処理の終了ラベル°exit’とを生成
して、変換を終了する。
Finally, the processor control signals 105a-108b are 10
Label indicating where to resume execution when ' addr 2
° and the end label °exit' for all processes are generated, and the conversion is ended.

次に、並列処理システム100の作動を説明する。なお
、データとして第4図に示す配列a [i]が与えられ
ているものとする。
Next, the operation of the parallel processing system 100 will be explained. It is assumed that the array a[i] shown in FIG. 4 is given as data.

プロセッサ1は、プログラム401により、レジスタA
101の第1ビツトA1と レジスタB102の第1ビ
ツトB1をクリアする。プロセッサ2.3.4でも、同
様にして、両レジスタ101.102の第2ビットA2
.B2と、第3ピツ)A3.B3と、第4ビットA4.
B4をクリアする。
Processor 1 uses register A by program 401.
The first bit A1 of register B101 and the first bit B1 of register B102 are cleared. Similarly, in processor 2.3.4, the second bit A2 of both registers 101 and 102 is
.. B2 and 3rd pit) A3. B3 and the fourth bit A4.
Clear B4.

次に、各プロセッサ1〜4のレジスタregjを初期化
する。初期値はプロセッサ1が°1”、プロセッサ2.
3.4はそれぞれ2°  °3゜°4°である。
Next, register regj of each processor 1 to 4 is initialized. The initial values are 1" for processor 1, 1" for processor 2, and 1" for processor 2.
3.4 are 2°, 3°, and 4°, respectively.

次に、whileの条件判定で、プロセッサ1で配列の
要素a [1]、  プロセッサ2で配列の要素a [
2]、プロセッサ3で配列の要素a [3]、プロセッ
サ4で配列の要素a[4]をそれぞれ判定する。
Next, in the while condition judgment, processor 1 selects array element a[1], processor 2 selects array element a[1], and processor 2 selects array element a[1].
2], the processor 3 determines array element a[3], and the processor 4 determines array element a[4].

第4図に示すように、配列の各要素a[1]〜a[4]
の内容は°0°でないため、ループ本体の実行を行なう
As shown in Figure 4, each element a[1] to a[4] of the array
Since the content of is not 0°, the main body of the loop is executed.

ループ本体の処理では、プロセッサ1はレジスタAl0
Iの第1ビツトA1、プロセッサ2.3゜4はそれぞれ
第2ビットA2.第3ビツトA3゜4ビツトA4をセッ
トする。
In the processing of the loop body, processor 1 stores register Al0.
The first bit A1 of the processor 2.3.4 is the second bit A2. Set the third bit A3 and the fourth bit A4.

そして、各プロセッサ1〜4は、それぞれ待合せ処理に
入る。
Then, each of the processors 1 to 4 enters a waiting process.

待合せ処理は、プロセッサの割込み機能を使用するもの
で、第5図にそのフローチ°ヤードを示す。
The queuing process uses the interrupt function of the processor, and its flowchart is shown in FIG.

まず、無限ループで割込みが入るまで待機する(501
)。
First, wait until an interrupt occurs in an infinite loop (501
).

待機中にレジスタA判定回路103から実行再開指示1
09が出力されたことにより各プロセッサ1〜4で割込
みが発生すると、割込み処理ルーチンが起動され、ステ
ップ502へ移行する。
Execution restart instruction 1 from register A determination circuit 103 during standby
When an interrupt occurs in each of the processors 1 to 4 due to the output of 09, the interrupt processing routine is started and the process moves to step 502.

ステップ502では、プロセッサ制御信号105a〜1
08bを判定し、値が’oo’ ならaddr Ooへ
、値が°01“ならaddr 1°へ、値が°10゛な
らaddr 2°へ、値が°11°なら’addr 3
°ヘジヤンプして、実行を再開する。
In step 502, processor control signals 105a-1
08b, if the value is 'oo' go to addr Oo, if the value is '01' go to addr 1°, if the value is '10' go to addr 2°, if the value is '11' go to 'addr 3'
°Hedge jump and resume execution.

さて、レジスタA判定回路103では、レジスタAl0
Iの第1ビツトA1〜第4ビツトA4がセットされたこ
とにより、各プロセッサ1〜4に実行再開指示109を
出す。
Now, in the register A determination circuit 103, the register Al0
Since the first bit A1 to the fourth bit A4 of I are set, an execution restart instruction 109 is issued to each processor 1 to 4.

このように、レジスタA101の全ピットへ1〜A4が
セットされてから各プロセッサ1〜4に実行再開指示1
09が出されるため、プロセッサ1〜4の同期をとるこ
とができるわけである(バリア同期)。
In this way, after 1 to A4 are set in all the pits of the register A101, each processor 1 to 4 is instructed to resume execution 1.
Since 09 is issued, processors 1 to 4 can be synchronized (barrier synchronization).

レジスタB判定回路104では、レジスタB102の第
1ビツトB1〜第4ビツトB4を、第2図のテーブルに
したがってコード化し、プロセッサ制御信号105a〜
108bを出力する。この時点では全ビット81〜B4
が°0°であるため、全てのプロセッサ1〜4に、実行
再開場所を示すプロセッサ制御信号105a〜108b
として°00°を出力する。
The register B determination circuit 104 encodes the first bit B1 to the fourth bit B4 of the register B 102 according to the table shown in FIG.
Outputs 108b. At this point, all bits 81 to B4
is 0°, processor control signals 105a to 108b are sent to all processors 1 to 4 to indicate where to resume execution.
outputs °00° as

実行再開場所を示すプロセッサ制御信号105a〜10
8bと、実行再開指示109が各プロセッサ1〜4に入
力されると、上述の待合せ処理から抜は出して、それぞ
れのプロセッサ制御信号105aと105b、106a
と106b、107aと107b、108aと108b
で指示された場所から実行を再開する。この時点では、
ラベル’addr Ooから実行を再開することになる
Processor control signals 105a-10 indicating where to resume execution
8b and an execution restart instruction 109 are input to each processor 1 to 4, the above-mentioned waiting process is skipped and the respective processor control signals 105a, 105b, and 106a are input.
and 106b, 107a and 107b, 108a and 108b
Resumes execution from the point indicated by . At this point,
Execution will resume from label 'addr Oo.

プロセッサ1では、’addr Ooから実行を再開す
ると、レジスタA101の第1ビツトA1をクリアして
から、プログラム400におけるループ本体の処理を実
行する。そして、配列の要素a[reg−jEに°0°
を代入する。さらに、レジスタreg−jに(プロセッ
サ数×プログラム400の変数iの増分)である°4°
を加算した後、whileの条件判定に戻る。
When the processor 1 resumes execution from 'addr Oo, it clears the first bit A1 of the register A101 and then executes the processing of the loop body in the program 400. Then, array element a[reg-jE has °0°
Substitute. Furthermore, the register reg-j has (number of processors x increment of variable i of program 400) °4°
After adding , the process returns to the while condition determination.

プロセッサ2.3. 4における°addr Ooから
の実行の再開も同様である。
Processor 2.3. The same is true for restarting execution from °addr Oo in step 4.

2回目のループ処理で、各プロセッサ1〜4は、配列の
要素a[5]〜a[8]を判定するが、第4図に示すよ
うに、やはり配列の各要素a[5〕〜a [8]の内容
は°0°でないため、1回目のループ処理と同様の動作
となる。
In the second loop processing, each of the processors 1 to 4 determines the elements a[5] to a[8] of the array, but as shown in FIG. Since the content of [8] is not 0°, the operation is similar to the first loop process.

以下、第4図に示す配列a [i]の内容にしたがって
各プロセッサ1〜4はループ処理を行う。
Thereafter, each of the processors 1 to 4 performs loop processing according to the contents of the array a[i] shown in FIG.

2500回目のループになると、プロセッサ1では、w
hileの条件判定で配列の要素a[9997]の内容
が°0°でないため、ループ本体の実行に入り、レジス
タAl0Iの第1ビツトAlをセットし、待合せ処理を
行う。
At the 2500th loop, processor 1 executes w
Since the content of element a[9997] of the array is not 0° in the hile condition determination, execution of the main body of the loop is started, the first bit Al of register Al0I is set, and the waiting process is performed.

ところが、プロセッサ2.3では、配列の要素a [9
998]、  a [9999]の内容が°0°である
ため、ループ本体の処理に入らず、レジスタB102と
レジスタAl0Iの第2.第3ビツトをセットし、待合
せ処理に入る。
However, in processor 2.3, array element a [9
998], a Since the content of [9999] is °0°, the process does not enter the main body of the loop, and the second . The third bit is set and the waiting process begins.

プロセッサ4では、配列の要素a [100001の内
容が0゛でないため、ループ本体の実行に入り、レジス
タAl0Iの第4ビツトA4をセットし、待合せ処理を
行う。
Since the contents of array element a [100001 are not 0, processor 4 enters execution of the main body of the loop, sets the fourth bit A4 of register Al0I, and performs a waiting process.

レジスタA判定回路103は、レジスタAl01の全ビ
ットA1〜A4がセットされた時点で、各プロセッサ1
〜4に実行再開指示109を出す。
The register A determination circuit 103 determines whether each processor 1
-4, an execution restart instruction 109 is issued.

レジスタB判定回路104は、レジスタBIO2の各ビ
ット81〜84め値を第3図のテーブルにしたがってコ
ード化するが、この時点では、(Bl、B2.B3.B
4)= (0,1,1,O)だから、プロセッサ1には
01“、プロセッサ2には11°、プロセッサ3.4に
は10“という内容のプロセッサail ti+信号を
出力する。
The register B determination circuit 104 codes the values of each bit 81 to 84 of the register BIO2 according to the table shown in FIG.
4) = (0, 1, 1, O), so the processor ail ti+ signal with the contents of 01" is output to the processor 1, 11° to the processor 2, and 10" to the processor 3.4.

プロセッサ1は、プロセッサ制御信号105 a。Processor 1 receives processor control signal 105a.

105bとして°01′が入力されることになるから、
’addr 1’から実行を再開し、プロセッサ400
のループ本体の命令を実行してから、全ての処理の終了
ラベル°exit’ に分岐し、処理を終わる。
Since °01' will be input as 105b,
Resuming execution from 'addr 1', processor 400
After executing the instructions in the main body of the loop, the program branches to the end label 'exit' of all processes, and ends the process.

プロセッサ2は、プロセッサ制御信号106 a。The processor 2 receives the processor control signal 106a.

106bとして°11°が入力されることになるから、
’addr 3°から実行を再開し、レジスタregj
をプログラム400の変数jに対応する主記憶装置10
の領域内に格納し、処理を終わる。
Since °11° will be input as 106b,
'addr Resume execution from 3° and register regj
The main memory 10 corresponding to the variable j of the program 400
The data is stored within the area and processing ends.

プロセッサ3,4は、プロセッサ制御信号107aと1
07b、108aと108bとして10′が入力される
ことになるから、’addr 2’ から実行を再開し
、処理を終わる。
Processors 3 and 4 receive processor control signals 107a and 1
Since 10' will be input as 07b, 108a and 108b, execution will be restarted from 'addr 2' and the process will end.

実行結果は、配列の要素a[lコルa [9999]が
°0となり、配列の要素a [10000コは1000
0’となる。変数iは、’9998’ となる。
The execution result is that array element a [l col a [9999] is °0, array element a [10000 is 1000
It becomes 0'. The variable i becomes '9998'.

次に、待合せ処理の他の例を第6図〜第10を参照して
説明する。
Next, another example of the waiting process will be described with reference to FIGS. 6 to 10.

他の例の第1は、特殊な命令を作るというものである。The first other example is to create a special command.

命令フォーマットを第6図に、命令の処理フローチャー
トを第7図に示す゛。
The instruction format is shown in FIG. 6, and the instruction processing flowchart is shown in FIG. 7.

第6図に示すように、命令600は、オペレーション6
01と、実行再開場所のaddr O,addr 1゜
addr2.addr3(602,603,604,6
05)から構成されている。この命令600が実行され
たプロセッサは、実行再開指示109が入力されるまで
待機する。
As shown in FIG. 6, instructions 600 include operation 6
01, addr O, addr 1° addr2. addr3(602,603,604,6
05). The processor that has executed this instruction 600 waits until an execution restart instruction 109 is input.

第7図に示すように、実行再開指示109が入力される
と(701)、プロセッサ制御信号105a〜108b
を判定して分岐しく702)、実行再開場所のアドレス
をPC(プログラムカウンタ)に転送し、このアドレス
より実行を再開する。
As shown in FIG. 7, when the execution restart instruction 109 is input (701), the processor control signals 105a to 108b
702), the address of the execution restart location is transferred to the PC (program counter), and execution is resumed from this address.

他の例の第2は、上記の例と同様に特殊な命令を作ると
いうものであるが、実行再開場所の指定方法が異なって
いる。命令フォーマットを第8図に、処理フローチャー
トを第9図に示す。
The second example is to create a special instruction similar to the above example, but the method of specifying the execution restart location is different. The instruction format is shown in FIG. 8, and the processing flowchart is shown in FIG. 9.

第8図に示すように、命令800は、オペレーション8
01と、オフセット群(802,803゜804、 8
05)  からなる。 オフセット0. オフセットl
、 オフセット2. オフセット3は、実行再開場所の
addr  O,addr  l。
As shown in FIG. 8, instructions 800 include operation 8
01 and the offset group (802, 803°804, 8
05). Offset 0. offset l
, offset 2. Offset 3 is addr O, addr l at the execution restart location.

addr 2. addr 3までのオフセットである
。この命令が実行されたプロセッサは、実行再開指示1
09が入力されるまで待機する。
addr 2. This is the offset up to addr 3. The processor on which this instruction was executed is instructed to resume execution
Wait until 09 is input.

第9図に示すように、実行再開指示109が入力される
と(901)、プロセッサ制御信号105a〜108b
を判定して分岐しく902)、実行再開場所までのオフ
セットをPC(プログラムカウンタ)に加算し、得られ
たアドレスより実行を再開する。
As shown in FIG. 9, when the execution restart instruction 109 is input (901), the processor control signals 105a to 108b
902), the offset to the execution restart location is added to the PC (program counter), and execution is resumed from the obtained address.

他の例の第3は、ソフトウェアによる方式であり、第1
0図にフローチャートを示す。
The third example is a software method;
A flowchart is shown in Figure 0.

まず、実行再開指示109が人力されるまで待機する。First, the system waits until the execution restart instruction 109 is manually issued.

実行再開指示109が入力されると(1001)、プロ
セッサ制御信号105a〜108bを判定して分岐しく
1002)、実行再開場所のアドレスにジャンプして、
実行を再開する。
When the execution restart instruction 109 is input (1001), the processor control signals 105a to 108b are judged and branched (1002), and the process jumps to the address of the execution restart location.
Resume execution.

次に、第11図に、上記並列処理システム10Oで処理
するforffiループのプログラム例を示。
Next, FIG. 11 shows a program example of a forffi loop processed by the parallel processing system 10O.

す。vinegar.

このプログラム1100は、 a[4コ= b [2コ、   b[4]=a[1コ。This program 1100 is a [4 pieces = b [2 pieces, b [4] = a [1 piece.

a  [5]=  b [3コ、  b [5コ=  
a  [2]。
a [5] = b [3 pieces, b [5 pieces =
a [2].

a[6コ=  b [4]、   b  [6]=  
a [3]。
a [6 pieces = b [4], b [6] =
a [3].

a  [1000]=  b [998]、   b 
[1000]=  a [997コa[1001コ= 
 b [999]   b [1001コ=  a [
998]を行なうプログラムである。
a [1000] = b [998], b
[1000] = a [997 pieces a [1001 pieces =
b [999] b [1001 pieces = a [
998].

j=にのときのb[kコニ a [k−3]と、j=に
+2のときのa [k+2]−b [k]の間でデータ
依存関係があるため、a [k+2]= b [k]の
実行はb[kコニ a [k−3コの実行の後に行われ
なければならない。従って、j=にのループ処理と、j
=に+2のループ処理は、並列に実行できない。そこで
、j=にのループ処理の2つの命令と、j=に+1のル
ープ処理の2つの命令を並列に実行する。
Since there is a data dependency relationship between b [k coni a [k-3] when j = and a [k + 2] - b [k] when j = +2, a [k + 2] = b The execution of [k] must occur after the execution of b[k a [k-3]. Therefore, the loop processing for j= and j
=+2 loop processing cannot be executed in parallel. Therefore, two instructions for loop processing at j= and two instructions for loop processing at +1 for j= are executed in parallel.

前記のように、j=にのループ処理と、j=に+1のル
ープ処理を並列に実行することにより、各プロセッサ1
〜4に分割されたプログラムでは、プログラム1100
における内側ループは不要となる。
As described above, by executing the loop processing for j= and the loop processing for +1 for j= in parallel, each processor 1
~ In a program divided into 4, program 1100
The inner loop in is no longer needed.

各プロセッサ1〜4のプログラム1101〜1104は
、先に説明した実施例の場合と同様にコンパイラにより
生成される。
Programs 1101 to 1104 for each processor 1 to 4 are generated by a compiler in the same way as in the previously described embodiment.

各プロセッサ1〜4におけるプログラム1101〜11
04の実行は次のようになる。
Programs 1101 to 11 in each processor 1 to 4
The execution of 04 is as follows.

まず、プロセッサ1,2,3.4は、それぞれレジスタ
A101およびレジスタB102の第1ビツトA1およ
びBl、第2ビツトA2およびB2、第3ビツトA3お
よびB3.第4ビツトA4およびB4をクリアする。
First, processors 1, 2, 3.4 input the first bits A1 and B1, the second bits A2 and B2, the third bits A3 and B3 . Clear the fourth bit A4 and B4.

次に、プロセッサ1,2,3.4は、ループに入り、そ
れぞれレジスタA101の第1ビツトΔ1、第2ビット
A2.第3ビットA3.第4ビツトA4をセットし、待
合せ処理に入る。
Next, processors 1, 2, 3.4 enter a loop and write the first bit Δ1, second bit A2 . . . of register A101, respectively. Third bit A3. The fourth bit A4 is set and the waiting process begins.

While型ループの実施例でも述べたように、レジス
タA判定回路103は、レジスタA101の全ビットA
1〜A4がセットされると、各プロセッサ1〜4に実行
再開指示109を出す。
As mentioned in the embodiment of the while-type loop, the register A determination circuit 103 checks all bits A of the register A101.
When 1 to A4 are set, an execution restart instruction 109 is issued to each processor 1 to 4.

レジスタB判定回路104は、レジスタBIO2の各ビ
ットB1〜B4を判定し、プロセッサ制御信号105a
〜108bを出力する。すなわち、1回目のループ処理
では、レジスタB102の各ビットB1〜B4は全て°
O゛であるため、全てのプロセッサ1〜4にaddr 
O’ からの実行再開を指示する。
The register B determination circuit 104 determines each bit B1 to B4 of the register BIO2 and outputs the processor control signal 105a.
~108b is output. That is, in the first loop processing, each bit B1 to B4 of register B102 are all set to °.
O゛, so addr to all processors 1 to 4
Instructs to resume execution from O'.

プロセッサ1,2,3.4は、’addr O’ から
実行を再開し、それぞれレジスタAl0Iの第1ビット
AI、  第2ビットA2.  第3ビツトA3゜第4
ビツトA4をクリアする。
Processors 1, 2, 3.4 resume execution from 'addr O' and read the first bit AI, second bit A2 . 3rd bit A3゜4th
Clear bit A4.

そして、プロセッサ1はa [4]= b [2]、プ
ロセッサ2はa [4]= b [11、プロセッサ3
はa[5]=b[3]、プロセッサ4はa [5]=b
 [2]を実行し、2回目のループ処理に入る。
Then, processor 1 has a [4] = b [2], processor 2 has a [4] = b [11, processor 3
is a[5]=b[3], processor 4 is a[5]=b
Execute [2] and enter the second loop process.

2回目のループでは、1回目のループ処理と同様に、プ
ロセッサ1はa [6]= b [4]、プロセッサ2
はb [6]−a [3]、プロセッサ3はa [7]
= b [5]、プロセッサ4はb [7]= a [
4]を実行する。
In the second loop, similarly to the first loop processing, processor 1 calculates a [6] = b [4], processor 2
is b [6] - a [3], processor 3 is a [7]
= b [5], processor 4 has b [7] = a [
4].

以下、同様にして処理が進められ、プログラム1101
.1102のループの制御変数jが1002、プログラ
ム1103.1104のループの制御変数jが1003
になると、プロセッサ1゜2.3.4は、ループを終了
し、それぞれレジスタB102およびレジスタA101
の第1ビツトB1およびAl、第2ビツトB2およびA
2.第3ビツトB3およびA3.第4ビツトB4および
A4をセットし、待合せ処理に入る。
Thereafter, the processing proceeds in the same manner, and the program 1101
.. The control variable j of the loop of 1102 is 1002, and the control variable j of the loop of programs 1103 and 1104 is 1003.
, processor 1゜2.3.4 ends the loop and writes register B102 and register A101, respectively.
The first bit B1 and Al, the second bit B2 and A
2. Third bit B3 and A3. The fourth bit B4 and A4 are set and the waiting process begins.

レジスタA判定回路103は、レジスタAl01の全ビ
ットA1〜A4がセットされたことにより、各プロセッ
サ1〜4に実行再開指示109を出す。
The register A determination circuit 103 issues an execution restart instruction 109 to each of the processors 1 to 4 when all bits A1 to A4 of the register Al01 are set.

レジスタB判定回路104は、レジスタBIO2の各ビ
ットB1〜B4の値を第2図のテーブルにしたがってコ
ード化するが、(Bl、B2.B3、B4)= (1,
1,1,1)だから、プロセッサ1には°11°、プロ
セッサ2. 3.4には°10゛というプロセッサ制御
信号105a〜108bを出力する。
The register B determination circuit 104 codes the values of each bit B1 to B4 of the register BIO2 according to the table in FIG. 2, and (Bl, B2.B3, B4) = (1,
1,1,1), so processor 1 has a degree of 11 degrees, processor 2... 3.4, processor control signals 105a to 108b of 10° are output.

プロセッサ1は、実行再開場所として°11゜が指定さ
れたことにより addr 3’ から実行を再開し、
処理を終了する。また、プロセッサ2,3゜4は、実行
再開場所として°10°が指定されたことにより ad
dr 2°から実行を再開し、処理を終了する。
Processor 1 resumes execution from addr 3' because °11° is specified as the execution restart location,
Finish the process. In addition, processors 2 and 3゜4 ad
Execution is restarted from dr 2° and the process is ended.

以上のように、本発明の並列処理システム100によっ
て、While型ループでも、for型ループでも、並
列実行することが出来るようになる。
As described above, the parallel processing system 100 of the present invention enables parallel execution of both while-type loops and for-type loops.

[発明の効果] 本発明によれば、for型ループだけでなく。[Effect of the invention] According to the invention, not only for-type loops.

while型ループに対しても、複数のプロセッサ間で
同期をとりながら並列に処理を行うことが出来るように
なる。したがって、プログラムの並列実行による処理速
度を従来以上に向上することができる効果がある。
Even for a while type loop, it becomes possible to perform parallel processing while synchronizing a plurality of processors. Therefore, there is an effect that the processing speed due to parallel execution of programs can be improved more than before.

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

第1図は本発明の一実施例の並列処理システムのブロッ
ク図、第2図は第1図に示すレジスタB判定回路の入力
と出力の関係を示す図表、第3図はwhile型ループ
を含むプログラムとそれを並列化したプログラムの説明
図、第4図は配列データの例示図、第5図は待合せ処理
の一例のフロー図、第6図は待合せ命令の一例のフォー
マット図、第7図は待合せ処理の他の一例のフロー図、
第8図は待合せ命令の他の一例のフォーマット図、第9
図は待合せ処理のさらに他の一例のフロー図、第10図
は待合せ処理のさらにまた他の一例のフロー図、第11
図はf o ru小ループ含むプログラムとそれを並列
化したプログラムの説明図である。 (符号の説明) 100・・・並列処理システム 101・・・レジスタA 102−・・レジスタB 103・・・レジスタA判定回路 104・・・レジスタB判定回路 105a、105b・・・プロセッサ1へのプロセッサ
制御信号 106a、106b・・・プロセッサ2へのプロセッサ
制御信号 107a、107b・・・プロセッサ3へのプロセッサ
制御信号 108a、108b・・・プロセッサ4へのプロセッサ
制御信号 109・・・実行再開指示。
Fig. 1 is a block diagram of a parallel processing system according to an embodiment of the present invention, Fig. 2 is a diagram showing the relationship between the input and output of the register B judgment circuit shown in Fig. 1, and Fig. 3 includes a while type loop. An explanatory diagram of a program and a parallelized program, FIG. 4 is an example of array data, FIG. 5 is a flow diagram of an example of a queuing process, FIG. 6 is a format diagram of an example of a queuing command, and FIG. A flow diagram of another example of the waiting process,
FIG. 8 is a format diagram of another example of a waiting instruction, and FIG.
FIG. 10 is a flowchart of yet another example of the meeting process, FIG. 10 is a flowchart of still another example of the meeting process, and FIG.
The figure is an explanatory diagram of a program including a f o ru small loop and a program that parallelizes the program. (Explanation of symbols) 100...Parallel processing system 101...Register A 102-...Register B 103...Register A judgment circuit 104...Register B judgment circuit 105a, 105b...To processor 1 Processor control signals 106a, 106b...Processor control signals 107a, 107b...Processor control signals 108a, 108b...Processor control signals 109 to processor 4...Instruction to resume execution.

Claims (1)

【特許請求の範囲】 1、複数のプロセッサによる並列処理の進行を調和させ
るためにプロセッサを相互に待合せさせる同期処理方法
において、 各プロセッサの処理が所定の待合せ場所に 達したか否かという第1の情報と、各プロセッサでの処
理結果に対応した第2の情報とをプロセッサ単位にプロ
セッサ外部で保持し、前記第1の情報に基づいて各プロ
セッサは他プロセッサと待合せて同期をとると共に、前
記第2の情報に基づいて各プロセッサは待合せ後の実行
再開場所を選択することを特徴とする同期処理方法。 2、複数のプロセッサと、それらプロセッサの各々に割
り当てられ対応するプロセッサにより設定される同期検
出用ビットを有する第1のレジスタ手段と、前記プロセ
ッサの各々に割り当てられ対応するプロセッサにより設
定される再開場所指定用ビットを有する第2のレジスタ
手段と、前記第1のレジスタ手段の同期検出用ビットの
状態から同期を判定して各プロセッサに待合せ又は実行
再開を指令する同期判定手段と、前記第2のレジスタ手
段の再開場所指定用ビットの状態に基づいて各プロセッ
サに実行再開場所を指定する実行再開場所指定手段とを
具備してなることを特徴とする並列処理システム。 3、複数のプロセッサで並行して処理を実行する並列処
理方法において、 各プロセッサの処理が所定の待合せ場所に 到達したことを表わす第1の情報をプロセッサ外部に出
力するステップと、 各プロセッサの処理結果に対応した第2の 情報をプロセッサ外部に出力するステップと、他のプロ
セッサから出力された前記第1の 情報に基づいて処理の待合せ又は実行再開を行なうステ
ップと、 他のプロセッサから出力された前記第2の 情報に基づいて実行再開場所を選択するステップと、 を有することを特徴とする並列処理方法。 4、逐次処理用プログラムから並列処理用プログラムを
生成する並列化プログラム生成装置において、 プログラムの所定の待合せ場所に処理が到 達したことを表わす第1の情報をプロセッサ外部に出力
するステップを並列処理用プログラム中に付加する手段
と、 プログラム中の処理結果に対応した第2の 情報をプロセッサ外部に出力するステップを並列処理用
プログラム中に付加する手段と、他のプロセッサから出
力された前記第1の 情報に基づいて処理の待合せ又は実行再開を行なうステ
ップを並列処理用プログラム中に付加する手段と、 他のプロセッサから出力された前記第2の 情報に基づいて実行再開場所を選択するステップを並列
処理用プログラム中に付加する手段と、 を具備したことを特徴とする並列化プログラム生成装置
[Claims] 1. In a synchronization processing method in which processors are made to wait with each other in order to harmonize the progress of parallel processing by a plurality of processors, the first step is to determine whether the processing of each processor has reached a predetermined waiting place. information and second information corresponding to the processing results of each processor are held outside the processor for each processor, and each processor waits and synchronizes with other processors based on the first information, and A synchronous processing method characterized in that each processor selects a place to resume execution after queuing based on the second information. 2. A plurality of processors, first register means having a synchronization detection bit assigned to each of the processors and set by the corresponding processor, and a restart location assigned to each of the processors and set by the corresponding processor. a second register means having a designation bit; a synchronization determination means for determining synchronization from the state of the synchronization detection bit of the first register means and instructing each processor to wait or resume execution; 1. A parallel processing system comprising: execution restart location designating means for designating a restart location for each processor based on the state of a restart location designation bit of the register means. 3. In a parallel processing method in which processing is executed in parallel by a plurality of processors, the step of outputting first information indicating that the processing of each processor has reached a predetermined meeting place to the outside of the processor; outputting second information corresponding to the result to the outside of the processor; waiting or resuming processing based on the first information output from another processor; A parallel processing method, comprising: selecting a location to resume execution based on the second information. 4. In a parallelization program generation device that generates a program for parallel processing from a program for sequential processing, the step of outputting first information indicating that the processing has reached a predetermined waiting place of the program to the outside of the processor is performed for parallel processing. means for adding to the program a step for outputting second information corresponding to a processing result in the program to the outside of the processor; A means for adding a step for queuing processing or resuming execution based on information into a parallel processing program, and a step for selecting a place for resuming execution based on the second information output from another processor for parallel processing. 1. A parallelization program generation device characterized by comprising: a means for adding information into a program for use in the program;
JP31274689A 1989-11-30 1989-11-30 Synchronous processing method, system and method for parallel processing, and parallel program generator Pending JPH03172958A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP31274689A JPH03172958A (en) 1989-11-30 1989-11-30 Synchronous processing method, system and method for parallel processing, and parallel program generator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP31274689A JPH03172958A (en) 1989-11-30 1989-11-30 Synchronous processing method, system and method for parallel processing, and parallel program generator

Publications (1)

Publication Number Publication Date
JPH03172958A true JPH03172958A (en) 1991-07-26

Family

ID=18032922

Family Applications (1)

Application Number Title Priority Date Filing Date
JP31274689A Pending JPH03172958A (en) 1989-11-30 1989-11-30 Synchronous processing method, system and method for parallel processing, and parallel program generator

Country Status (1)

Country Link
JP (1) JPH03172958A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016042232A (en) * 2014-08-14 2016-03-31 富士通株式会社 Arithmetic processing device, and method for controlling arithmetic processing device
JP2016157339A (en) * 2015-02-25 2016-09-01 富士通株式会社 Compiler program, computer program and compiler unit

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016042232A (en) * 2014-08-14 2016-03-31 富士通株式会社 Arithmetic processing device, and method for controlling arithmetic processing device
JP2016157339A (en) * 2015-02-25 2016-09-01 富士通株式会社 Compiler program, computer program and compiler unit

Similar Documents

Publication Publication Date Title
JP2947356B2 (en) Parallel processing system and parallel processor synchronization method
JP3032031B2 (en) Loop optimization method and apparatus
JP3663710B2 (en) Program generation method and processor interrupt control method
JPH05158687A (en) Method and unit for program control
JPH0721021A (en) Information processor
JPH03172958A (en) Synchronous processing method, system and method for parallel processing, and parallel program generator
JPH03126133A (en) Compiler processing method
JP2002268877A (en) Clock control method and information processor using the same
JPH09237186A (en) Loop controller and processor
JP2001255912A (en) Method for executing motion program
JP2552738B2 (en) Data processing device
JP3114884B2 (en) Fuzzy inference processing compilation system
JP2758624B2 (en) Speed control method of micro program
JPH01199233A (en) Conditional branch control system for pipeline processing
JP2659410B2 (en) Execution suspension method of data flow computer
JPS61216039A (en) System for generating and controlling program
JPH0254368A (en) Translation control system for mechanical translation
JPH023831A (en) Language processing system for plural source programs
JPH0573607A (en) Vector instruction generation processing method
JPH02165339A (en) Compile device
JP2001075816A (en) Device and method for converting program, device for preparing program, and program recording medium
JPS62182843A (en) Fast compiling/linking system
JPS60146328A (en) Microprogram control computer
JPS60215247A (en) Arithmetic processor
JPH0158528B2 (en)