JPH0660047A - Multiprocessor processor - Google Patents

Multiprocessor processor

Info

Publication number
JPH0660047A
JPH0660047A JP4209207A JP20920792A JPH0660047A JP H0660047 A JPH0660047 A JP H0660047A JP 4209207 A JP4209207 A JP 4209207A JP 20920792 A JP20920792 A JP 20920792A JP H0660047 A JPH0660047 A JP H0660047A
Authority
JP
Japan
Prior art keywords
processing
variable
block
shared
ipp
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
JP4209207A
Other languages
Japanese (ja)
Inventor
Fumio Nagasaka
文夫 長坂
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.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP4209207A priority Critical patent/JPH0660047A/en
Publication of JPH0660047A publication Critical patent/JPH0660047A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To decrease the frequency of communication at the time of variables access and increase the processing speed of a parallel description language processing system by arranging a copy of common variables which are only read and referred to in the local memory of a processor where parallel execution units are executed. CONSTITUTION:The multiprocessor parallel processor consists of a parallel description language compiler 6 which generates intermediate language descriptions and an intermediate language interpreters 15; a copy of common variables is previously arranged in the local memory area as to an intermediate language interpreter 15 which only reads and refers to the common variables among plural intermediate language interpreters 15 accessing the common variables and referred to. For intermediate language interpreters 15 which rewrites the common variables, on the other hand, an intermediate language interpreter 15 which holds the copy of the values of the common variables is detected simultaneously with the rewriting of an aimed common variable and a communication for rewriting even the copy of the common variables is made.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、ソースコード中のある
処理手続きを複数のプロセッサに分散することで処理単
位の並列実行を行ない、処理速度を向上させる技術に関
する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a technique for distributing a processing procedure in a source code to a plurality of processors to execute processing units in parallel and improving processing speed.

【0002】また、機械語命令の異なる複数のマイクロ
プロセッサを通信手段により結合した疎結合のマルチプ
ロセッサシステムにおいて、仮想機械語を設定し、該仮
想機械語のインタープリタと、該仮想機械語の命令によ
るオブジェクトコードを生成するコンパイラを用いて目
的プログラム開発を行なう方法に関する。
Further, in a loosely coupled multiprocessor system in which a plurality of microprocessors having different machine language instructions are coupled by communication means, a virtual machine language is set, and an interpreter for the virtual machine language and instructions for the virtual machine language are used. The present invention relates to a method for developing a target program using a compiler that generates object code.

【0003】[0003]

【従来の技術】ローカルエリアネットワークに接続され
た複数台のパーソナルコンピュータ、ワークステーショ
ンを利用して目的プログラムの分散処理を行なうため
に、従来広く用いられた手段はプロセス間通信であっ
た。
2. Description of the Related Art Conventionally, a means widely used for distributed processing of a target program using a plurality of personal computers and workstations connected to a local area network has been interprocess communication.

【0004】この方法では、実行単位間での処理パラメ
ータの受け渡しに際しても、個々に通信手段を明示的に
呼び出し、実行する形式のソースプログラムが使用され
るか、あるいはプロセス間の通信をより機能集約したリ
モート・プロシージャ・コールと呼ばれる手段が用いら
れた。
In this method, even when the processing parameters are passed between the execution units, the source program in the form of explicitly calling and executing the communication means individually is used, or the communication between the processes is more integrated. A method called remote procedure call was used.

【0005】それに対し、並列記述を許す言語仕様を定
め(以下これを並列記述言語と書く)、これを使用して
目的プログラムを開発することで通信の機構を上位構造
から隠蔽してしまう方法が有る。並列記述言語の下で開
発されるプログラムにおいては、共有変数への代入文を
記述すれば、言語仕様の実現構造(コンパイラ処理系あ
るいはインタープリタ)が、変数の実体が配置されたコ
ンピュータとの通信を行ない、代入処理を実現する。こ
のため、プログラム開発者がプロセス間の通信を意識す
ることなく目的プログラムの開発を行なうことが可能で
あり、高い開発効率と保守容易性が期待できる。
On the other hand, there is a method of concealing the communication mechanism from the upper structure by defining a language specification that allows parallel description (hereinafter referred to as parallel description language) and using this to develop an object program. There is. In a program developed under a parallel description language, if an assignment statement to a shared variable is described, the realization structure (compiler processing system or interpreter) of the language specification communicates with the computer in which the variable entity is located. Performs the assignment process. Therefore, the program developer can develop the target program without being conscious of communication between processes, and high development efficiency and maintainability can be expected.

【0006】しかし、上記の従来方法では、異なる機械
語命令を有する複数種類のコンピュータを通信手段によ
って接続し、利用したい場合、コンパイラ処理系が実行
コードを生成する際に複数の機械語に対応しなければな
らないという不都合が有った。
However, in the above-mentioned conventional method, when a plurality of types of computers having different machine language instructions are connected by communication means and desired to be used, the compiler processing system handles a plurality of machine languages when generating an execution code. There was the inconvenience of having to.

【0007】そこで、この問題点を回避するため、仮想
機械語となる中間言語が導入された。この従来技術によ
ると、コンパイラが出力するのは特定のプロセッサの機
械語命令に依存しない中間言語であり、個々の中間言語
は中間言語インタープリタによって解釈され実行され
る。ネットワークに限らず、一般に通信手段によって複
数のプロセッサが接続され、分散処理を行なう目的の処
理系においては、上記と同様の事が言える。
Therefore, in order to avoid this problem, an intermediate language which is a virtual machine language has been introduced. According to this conventional technique, the compiler outputs an intermediate language that does not depend on a machine language instruction of a specific processor, and each intermediate language is interpreted and executed by an intermediate language interpreter. The same thing can be said not only in the network but also in a processing system in which a plurality of processors are connected by communication means in general and distributed processing is performed.

【0008】中間言語を導入した従来発明として、例え
ば特開昭63−31934号が有る。この発明は、CP
Uと外部メモリ間のアクセス頻度の減少を目的として為
されたものである。発明は、メモリデバイス上にマイク
ロプロセッサチップを実装し、従来メインプロセッサで
の処理を必要とした演算の一部をメモリデバイス側で処
理し、メインプロセッサの手続き呼び出し時の手順の軽
量化と、メモリアクセス頻度の減少を目的としている。
また、特開平2−132525号は、共有変数の参照、
代入の状況を分類し、各プロセッサのローカルメモリに
変数の実体、変数値の複写などを最適配置している。こ
の発明は逐次記述型の従来言語(例FORTRAN)のソース
プログラムから構文処理時に並列性のある記述を取り出
し、並列化する場合に適用される。
As a conventional invention in which an intermediate language is introduced, there is, for example, JP-A-63-31934. This invention is CP
The purpose is to reduce the access frequency between U and the external memory. According to the invention, a microprocessor chip is mounted on a memory device, and a part of the calculation which has conventionally required processing by the main processor is processed on the memory device side. The purpose is to reduce access frequency.
Further, Japanese Patent Laid-Open No. 132325/1990 refers to a shared variable,
The assignment situation is classified, and the substance of the variable and the copy of the variable value are optimally placed in the local memory of each processor. The present invention is applied to a case where a description having parallelism is taken out at the time of syntax processing from a source program of a sequential description type conventional language (for example, FORTRAN) and parallelized.

【0009】[0009]

【発明が解決しようとする課題】しかし、上記特開昭6
3−31934号の従来方法を用いた場合、共有変数へ
の代入、参照はいずれもプロセス間の通信を伴って行な
われるため、毎回ネットワークあるいは他の通信手段に
よって実施されるとした場合、共有変数アクセスの発生
頻度が高い目的プログラムでは、通信処理時間の増大に
よって実質的に処理単位を並列実行する効果が失われる
という問題点が有った。これは、明示的に通信手段を記
述した場合に比較して並列記述言語のプログラムでは、
変数への代入参照という操作ではより微細な単位(数バ
イトなど)でのアクセスも不用意に行なわれるためであ
る。
However, the above-mentioned Japanese Unexamined Patent Application Publication No.
When the conventional method of 3-31934 is used, since the assignment and reference to the shared variable are both performed with the communication between the processes, the shared variable is assumed to be executed every time by the network or other communication means. In the object program with a high access frequency, there is a problem that the effect of executing the processing units in parallel is substantially lost due to the increase in the communication processing time. This is compared to the case where communication means is explicitly described in the parallel description language program,
This is because the operation of referencing assignment to a variable involves careless access in a finer unit (several bytes, etc.).

【0010】また、特開平2−132525号の従来例
については、逐次処理言語の記述の上で並列性を抽出で
きる部分は、処理単位間で共有変数に同時にアクセスし
ない保証が得られる部分に過ぎない。故にこの方法を直
ちに並列記述言語で用いた場合は、動作保証が得られな
いという問題点が有った。
Further, in the conventional example disclosed in Japanese Patent Laid-Open No. Hei 2-132525, the part where parallelism can be extracted in the description of the serial processing language is only the part where the guarantee that the shared variables are not simultaneously accessed between the processing units can be obtained. Absent. Therefore, if this method is immediately used in a parallel description language, there is a problem that operation guarantee cannot be obtained.

【0011】本発明はこのような従来技術の問題点に着
目してなされたものであり、その目的とするところは、
中間言語記述を生成する並列記述言語コンパイラと、中
間言語インタープリタによって構成されるマルチプロセ
ッサ並列処理装置において、プロセス間通信の頻度を制
約し、かつ並列実行の動作保証を実現することで、高速
に並列処理を行なえるマルチプロセッサ処理装置を提供
することにある。
The present invention has been made by paying attention to the problems of the prior art as described above, and the purpose thereof is to:
In a multiprocessor parallel processing device that is composed of a parallel description language compiler that generates an intermediate language description and an intermediate language interpreter, the frequency of interprocess communication is restricted and the operation guarantee of parallel execution is realized to achieve high-speed parallel processing. It is to provide a multiprocessor processing device capable of performing processing.

【0012】[0012]

【課題を解決するための手段】この様な課題を解決する
ために本発明のマルチプロセッサ処理装置では、仮想さ
れた機械語(以下中間言語)により記述されたオブジェ
クトコードを生成するコンパイラ(a)と、このコンパ
イラの出力した中間言語を実行するインタープリタ
(b)を実装した複数個のプロセッサユニットが、共有
メモリまたは通信経路で接続されたマルチプロセッサ処
理装置であって、コンパイラについては、 a-1)ソースコード内で記述された処理手続きにおいて、
読み取り参照のみが行われる共有変数を検出する構文解
析処理と、 a-2)並列実行が行われる各処理手続き中で、読み取り参
照のみが行われる共有変数の情報を記録した表構造のデ
ータを、実行コードである中間言語記述からなるオブジ
ェクトファイルに付加する手段とを有し、インタープリ
タについては、 b-1)実行コードに付加された読み取り参照のみが行われ
る共有変数の情報を記録した表構造のデータを参照し、
処理単位の並列実行時に、この処理単位の配置されるプ
ロセッサのローカルメモリに前記共有変数の複写を配置
するデータ通信手段と、 b-2)並列実行される個々の処理単位について共有変数の
書き換えを行う場合、他プロセッサのローカルメモリに
配置された該共有変数の複写についても書き換える命令
語通信手段と、を有し読み取りの際は、ローカルメモリ
に置かれた共有変数の値を参照することを特徴とする。
In order to solve such a problem, in the multiprocessor processing apparatus of the present invention, a compiler (a) for generating an object code described by a virtual machine language (hereinafter, intermediate language) And a plurality of processor units that implement an interpreter (b) that executes the intermediate language output by this compiler are a shared memory or a multiprocessor processing device connected by a communication path. ) In the processing procedure described in the source code,
Parsing processing that detects shared variables that are only read-referenced, and a-2) Table-structured data that records information on shared variables that are only read-referenced in each processing procedure that is executed in parallel. The interpreter has a means for adding to an object file consisting of an intermediate language description that is an execution code. B-1) A table structure that records the information of shared variables that are read and added only to the execution code Refer to the data,
Data communication means for arranging a copy of the shared variable in the local memory of the processor in which the processing unit is arranged, and b-2) Rewriting the shared variable for each processing unit to be executed in parallel. In the case of performing, there is an instruction word communication means for rewriting the copy of the shared variable arranged in the local memory of another processor, and when reading, the value of the shared variable placed in the local memory is referred to. And

【0013】[0013]

【作用】並列実行時の読み取りの際は、ローカルメモリ
に置かれた共有変数の値を参照するため、都度通信手段
を介する必要がなくなり、共有変数アクセスに関するプ
ロセッサ間の通信頻度が減少して、処理系としての処理
速度が向上する。
When reading in parallel execution, since the value of the shared variable placed in the local memory is referenced, it is not necessary to go through the communication means each time, and the frequency of communication between processors regarding shared variable access is reduced, The processing speed of the processing system is improved.

【0014】[0014]

【実施例】実施例について以下の順に説明する。EXAMPLES Examples will be described in the following order.

【0015】1.構成の説明 1−1.動作環境の構成例の説明 1−2.対象ソフトウェアの説明 2.動作の概要 2−1.処理手順の概要 2−2.実行時動作の概要 3.各部動作の説明 3−1.コンパイラ動作と並列処理時の表構造参照 3−1ー1.従来のコンパイラ動作との共通点 3−1ー2.本実施例のコンパイラ6の動作の特徴 3−1ー3.本実施例の中間言語実行時の特徴 3−2.排他制御及びIPP間の通信 1.構成の説明 1−1.動作環境の構成例の説明 図1は、本発明の一実施例の構成図である。通信経路5
を介してパーソナルコンピュータ1、2、3らが接続さ
れている。ここで通信経路5は必ずしも単一の系である
必要は無い。通信経路5として典型的なものは、アドレ
ス管理機構を持つ双方向の通信形態である”ネットワー
ク”がある。
1. Description of configuration 1-1. Description of configuration example of operating environment 1-2. Explanation of target software 2. Outline of operation 2-1. Outline of processing procedure 2-2. Overview of runtime operation 3. Description of operation of each part 3-1. Refer to the table structure during compiler operation and parallel processing 3-1-1. Common points with conventional compiler operations 3-1-2. Features of operation of compiler 6 of this embodiment 3-1-3. Features of Execution of Intermediate Language of the Present Embodiment 3-2. Exclusive control and communication between IPPs 1. Description of configuration 1-1. Description of Configuration Example of Operating Environment FIG. 1 is a configuration diagram of an embodiment of the present invention. Communication path 5
The personal computers 1, 2, and 3 are connected via the. Here, the communication path 5 does not necessarily have to be a single system. As a typical communication path 5, there is a "network" which is a bidirectional communication mode having an address management mechanism.

【0016】図1では、コンピュータ1が要求発生側と
なり、目的プログラムの実行を開始し、この目的プログ
ラムの複数個の処理単位の内の一部が、コンピュータ2
あるいは3のプロセスにおいて実行される。ここでプロ
セスは、オペレーティングシステムにおけるプロセッサ
資源、メモリ資源割り当ての実行時の単位であり、プロ
セスの識別子及び実行管理、メモリ管理のための情報を
含むプロセスヘッダと、中断の際に現在のプロセッサの
レジスタの状態を保存するための領域と、オブジェクト
コード領域、スタック領域から構成される。
In FIG. 1, the computer 1 becomes the request generation side and starts execution of the object program, and a part of the plurality of processing units of this object program is part of the computer 2.
Alternatively, it is executed in the process of 3. Here, a process is a unit at the time of execution of allocation of processor resources and memory resources in the operating system, and includes a process header including process identifiers and execution management, information for memory management, and a register of the current processor at the time of suspension. It is composed of an area for saving the state of, an object code area, and a stack area.

【0017】処理対象である目的プログラムは、図中で
はソースプログラム4として示される。ソースプログラ
ム4は、並列記述言語によって記述され、記述中に並列
実行に関する記述を含むものである。並列記述言語とし
て、本実施例においては、言語Pascalに”cobegin”
と”coend”の2語のみを拡張した言語仕様を用いる。
仕様を限定するため、ここでは並列実行の対象となる処
理ブロックに、次の制約を加える。
The target program to be processed is shown as a source program 4 in the figure. The source program 4 is written in a parallel description language, and includes a description regarding parallel execution in the description. As a parallel description language, in this embodiment, "cobegin" is added to the language Pascal.
Use the language specification that extends only the two words, "and coend".
In order to limit the specifications, the following restrictions are added to the processing blocks that are the target of parallel execution.

【0018】(1)並列実行される処理手続きは、proc
edure,functionどちらも許される。但し引数は値渡し(c
all by value)だけが許される。
(1) The processing procedure executed in parallel is proc
Both edure and function are allowed. However, the argument is passed by value (c
only all by value) are allowed.

【0019】(2)プログラムのトップレベル(主プロ
グラムの階層)で宣言された変数は、共有変数と見なさ
れる。並列実行される処理手続き中でアクセスが許され
る変数は、局所変数と共有変数だけである。
(2) Variables declared at the top level of the program (hierarchy of the main program) are regarded as shared variables. Only local variables and shared variables are allowed to be accessed in parallel processing procedures.

【0020】以上の条件を満たさない処理手続きが、”
cobegin”と”coend”に囲まれた複合文(compound sta
tement)中に現われても、構文解析はエラーを返さな
い。並列実行が行われないだけで、通常のPascalの構文
規則に対し不適合でない限り、コード生成及び実行に不
都合は無い。
A processing procedure that does not satisfy the above conditions is "
A compound statement (compound sta surrounded by “cobegin” and “coend”)
parse does not return an error when it appears in There is no inconvenience in code generation and execution unless it is not conforming to the usual Pascal syntax rules, since only parallel execution is not performed.

【0021】ソースプログラム4は、コンピュータ1の
アプリケーションプログラムであるコンパイラ6でコン
パイル処理され、中間言語のインタープリタによって解
釈実行可能なオブジェクトコード14に変換される。中
間言語のインタープリタは、コンピュータ1、2、3そ
れぞれにおいて実行される独立のプロセスである。中間
言語のインタープリタとなるプロセスを以下ではIPP
と略す。
The source program 4 is compiled by a compiler 6, which is an application program of the computer 1, and converted into an object code 14 that can be interpreted and executed by an intermediate language interpreter. The intermediate language interpreter is an independent process executed in each of the computers 1, 2, and 3. In the following, the process that becomes an intermediate language interpreter is IPP.
Abbreviated.

【0022】IPP15、25、26、27は、個々の
コンピュータにおいて直接機械語生成する形式のコンパ
イラで開発され、実装されている。各IPPはどれも2
つの双方向通信手段を持つ構成であり、第1の通信手段
23が要求を受けつける目的に使用され、第2の通信手
段24が要求を発生する目的に使用される。すなわち、
IPPは中間言語による記述を通信手段23から取得
し、処理結果を通信手段23から要求側に返送するイン
タープリタである。この一方で、IPPは、自ら他のI
PPに接続し、通信手段24を用いて他のIPPへの要
求を発生する。この時、他のIPPに対する要求は中間
言語記述をもって行なわれる。他のIPPは、前述と同
様にこの中間言語記述を通信手段23で受信し、処理結
果を通信手段23によって要求側に返す。この様に、各
IPPは完全に等価な構成を有するシンメトリカルなも
ので、いわゆるクライアント・サーバ型の処理と異なっ
ている。
The IPPs 15, 25, 26 and 27 are developed and implemented by a compiler of a type that directly generates a machine language in each computer. Each IPP is 2
The first communication means 23 is used for the purpose of accepting the request, and the second communication means 24 is used for the purpose of issuing the request. That is,
The IPP is an interpreter that acquires the description in the intermediate language from the communication unit 23 and returns the processing result from the communication unit 23 to the request side. On the other hand, IPP itself
It connects to the PP and uses the communication means 24 to generate a request to another IPP. At this time, a request for another IPP is made with an intermediate language description. The other IPPs receive this intermediate language description by the communication means 23 and return the processing result to the request side by the communication means 23, as described above. As described above, each IPP is a symmetrical one having a completely equivalent configuration, and is different from the so-called client / server type processing.

【0023】高機能のオペレーティングシステムの中に
は、ネットワーク等のハードウェアを介してのプロセス
間の通信と、FIFO(先入れデータを先に取り出すことが
出来るように構成された順序付きメモリ)を用いた通信
を、等価な処理として実現できるものがある。このよう
なオペレーティングシステムの管理下では、IPP2
6、27の様に、プロセス間の通信をネットワーク経由
で行なうと共に、共有メモリ資源経由で行なっても良
い。この点では従来のプロセス間通信による多重プログ
ラミングの技術と異なるところは無い。
Some high-performance operating systems include communication between processes via hardware such as a network, and FIFO (ordered memory configured so that preemptive data can be fetched first). There are some which can realize the used communication as an equivalent process. Under the control of such an operating system, IPP2
As in 6 and 27, the communication between processes may be performed via the network and the shared memory resource. In this respect, there is no difference from the conventional technique of multiple programming by interprocess communication.

【0024】IPPは、中間言語の仕様に従って定めら
れた仮想機械語命令を実行するインタープリタであるた
め、IPPを利用する応用プログラムから見た時は、あ
る仕様の機械語命令が実装されたプロセッサが存在する
かの様に取り扱う事ができる。結果的に応用プログラム
に対し、”複数のプロセスが通信しあって実現する並列
動作環境”の上に作られた単一プロセッサ環境を使用す
るような錯覚を与えることができる。
The IPP is an interpreter that executes virtual machine language instructions defined according to the specifications of the intermediate language. Therefore, when viewed from an application program using the IPP, a processor in which machine language instructions of a certain specification are implemented is installed. It can be treated as if it exists. As a result, it is possible to give an application program the illusion of using a single processor environment built on a "parallel operating environment realized by communicating multiple processes".

【0025】1−2.対象ソフトウェアの説明 図3は、従来型の逐次処理言語においての、典型的な
「並列性を持つ記述」の例を示したものである。リスト
301において'procedure p'の'i'と'j'による2重ル
ープは、リスト302の様にjを固定して、3つの独立
した単純ループに分解できる。リスト302では明らか
に、3つのiに関する処理ループを、それぞれ別々のプ
ロセッサにおいて取り扱うことが可能である。特開平2
−132525号では、この様な並列化可能な記述部分
の並列化を行った後、配列a[i,1],a[i,2],a[i,3]等のよ
うに、独立してアクセス可能な変数を、それぞれのプロ
セッサのローカルメモリに配置し、処理速度の向上を図
っている。従来発明の取り扱った並列化は、このように
逐次処理言語に関するものであるため、2つ以上の処理
手続き(あるいはサブルーチン等)が共通の変数にアク
セスする場合であっても、一つの手続きの処理中に、変
数の値が他の処理手続きから変更されることが無いとい
う保証が有った。
1-2. Description of Target Software FIG. 3 shows an example of a typical “description having parallelism” in a conventional sequential processing language. The double loop consisting of'i 'and'j'of'procedurep'in list 301 can be decomposed into three independent simple loops by fixing j as in list 302. Clearly in the list 302, the processing loops for the three i's can be handled by different processors. JP-A-2
In No. 132525, after such parallelizable description parts are parallelized, they are independently processed like arrays a [i, 1], a [i, 2], a [i, 3]. Variables that can be accessed by allocating them are placed in the local memory of each processor to improve the processing speed. Since the parallelization handled by the conventional invention is related to the serial processing language as described above, even if two or more processing procedures (or subroutines) access a common variable, the processing of one procedure is performed. Among them, there was a guarantee that the value of the variable would not be changed by other processing procedures.

【0026】これに対し、本発明の取り扱う並列記述言
語においての、典型的な共有変数アクセスの例をリスト
303に示す。リスト303のプログラムは、言語Pasc
alに前述の並列処理のための述語を追加した仕様の言語
で記述されており、主プログラム304の中で、手続き
p1とp2が並列実行される。処理自体はある種の生産者・
消費者問題の変形であり、手続きp1とp2は変数AAを共有
変数としてアクセスする。手続きp2が処理305におい
て、一連の処理を行い、処理結果として局所変数result
に100より大きな値の代入が行われた場合、共有変数AA
に値1が代入される。一方手続きp1は、変数AAの値が0で
あるかぎり、処理306を継続する。
On the other hand, a list 303 shows a typical shared variable access example in the parallel description language handled by the present invention. The program in Listing 303 has the language Pasc
It is written in the language of the specification in which the above-mentioned predicate for parallel processing is added to al.
p1 and p2 are executed in parallel. The processing itself is a kind of producer
A variation of the consumer problem, procedures p1 and p2 access variable AA as a shared variable. In procedure 305, the procedure p2 performs a series of processes, and the result of the process is the local variable result.
If a value greater than 100 is assigned to the shared variable AA
The value 1 is assigned to. On the other hand, the procedure p1 continues the process 306 as long as the value of the variable AA is 0.

【0027】この種の問題は、アプリケーションプログ
ラムの多くで発生する問題である。例としては、図形と
文字をディスプレイに表示する処理を含むアプリケーシ
ョンにおいて、手続きp2が、文字データを読み取り、ア
ウトラインフォントの形状発生を行い、これと並行して
手続きp1が図形形状の画素発生を処理する場合等が挙げ
られる。アウトラインフォントの形状発生は比較的処理
時間を要する一方で1文字あたりの処理結果の画素デー
タは小さいため、100文字程度を連続して処理し、処
理が終了した時点で、共有変数AAの値を用いて処理終了
を他の並行処理される手続きに伝達できると好都合であ
る。手続きp1は、共有変数AAの値が0である限り、図形
画素発生を処理し、AA=1となった時点で、手続きp2の発
生した文字形状のデータを表示する処理を行う。
This type of problem is a problem that occurs in many application programs. As an example, in an application that includes processing for displaying graphics and characters on the display, procedure p2 reads character data and performs outline font shape generation, and in parallel with this procedure p1 processes graphics shape pixel generation. And the like. The outline font shape takes a relatively long processing time, but the pixel data of the processing result per character is small, so about 100 characters are processed continuously, and when the processing is completed, the value of the shared variable AA is changed. Conveniently it can be used to convey the end of processing to other concurrently processed procedures. The procedure p1 processes the generation of graphic pixels as long as the value of the shared variable AA is 0, and when AA = 1, performs the processing of displaying the character shape data generated by the procedure p2.

【0028】しかし、この様な並列処理問題では特開平
2−132525号の方法が使用できない。従来技術で
は、手続きp1において変数AAが読み取り参照しか行われ
ないため、p1が呼び出される時点での変数AAの値がp1を
実行するプロセッサのローカルメモリに複写され配置さ
れる。この結果変数AAの値は常に0であり、手続きp1に
おいては、処理306の永久ループを形成してしまう。
However, in such a parallel processing problem, the method disclosed in JP-A-2-132525 cannot be used. In the prior art, since the variable AA is only read-referenced in the procedure p1, the value of the variable AA at the time when p1 is called is copied and arranged in the local memory of the processor executing p1. As a result, the value of the variable AA is always 0, and the procedure p1 forms a permanent loop of the process 306.

【0029】本発明の実施例は次のような処理手順でこ
の問題点を解決した。
The embodiment of the present invention solves this problem by the following processing procedure.

【0030】2.動作の概要 2−1.処理手順の概要 以下に本発明の言語処理系の動作の概要を、図1の構成
図と図2の流れ図を用いて述べる。以下の説明におい
て、コンパイラ6が述語”cobegin”を解析し生成する
中間言語記述を説明のため”COBEGIN”と大文字で書き
表す。同様に”COEND”は述語”coend”の翻訳後に生成
される中間言語記述を表し、”NEWPROC”はコンパイラ
6が並列実行モードにおいて挿入する中間言語記述を表
す。また周知の様にPascal言語では、プログラム記述に
ブロック構造が許される。個々のブロックとなるのは関
数(function)あるいは手続き(procedure)であり、
これらは階層的に宣言できる。ここでは関数と手続きを
いずれも処理ブロックと書く。
2. Outline of operation 2-1. Outline of Processing Procedure An outline of the operation of the language processing system of the present invention will be described below with reference to the configuration diagram of FIG. 1 and the flowchart of FIG. In the following description, the intermediate language description generated by the compiler 6 by analyzing the predicate “cobegin” is written in capital letters “COBEGIN” for the purpose of explanation. Similarly, "COEND" represents an intermediate language description generated after translation of the predicate "coend", and "NEWPROC" represents an intermediate language description inserted by the compiler 6 in the parallel execution mode. As is well known, the Pascal language allows block structures in program descriptions. Each block is a function or procedure,
These can be declared hierarchically. Here, both functions and procedures are written as processing blocks.

【0031】処理は次の手順1から15の順で行なわれ
る。
The processing is performed in the order of the following procedures 1 to 15.

【0032】手順1: 目的プログラムの「コンパイ
ル、実行」の要求を受けつけたシステムは、ソースプロ
グラム4を中間言語により記述されたオブジェクトコー
ド14(以下OBJと略す)に変換するコンパイル処理
を開始する。コンパイル処理の行なう内容は、字句解析
処理7、構文解析処理8およびコード生成処理13であ
る。
Procedure 1: The system, which has received the request for "compilation and execution" of the target program, starts a compilation process for converting the source program 4 into an object code 14 (hereinafter abbreviated as OBJ) described in an intermediate language. The contents of the compile processing are the lexical analysis processing 7, the syntax analysis processing 8 and the code generation processing 13.

【0033】手順2: コンパイラ6内の構文解析処理
8は、ブロックへの引数および、ブロック内の局所変
数、ブロック内の局所手続き名、局所関数名などを記録
するブロック内名前表9を生成する。この名前表作成の
目的には、通常のコード生成に用いる事に加え、ブロッ
ク内で非局所的な変数への参照が有るかどうか検出する
事が含まれる。
Step 2: The parsing process 8 in the compiler 6 generates an in-block name table 9 recording the arguments to the block, local variables in the block, local procedure names in the block, local function names, etc. . The purpose of creating this name table is to detect whether there is a reference to a non-local variable in a block, in addition to using it for normal code generation.

【0034】手順3: 構文解析処理8は、ブロック内
の処理記述を次々に解析し、コード生成処理13を呼び
出し、中間言語の仕様に基づく記述の生成を行なう。こ
のとき、ソースプログラム4の記述の中で変数へのアク
セス(代入、参照のいずれか)が行なわれる場合、この
変数が局所変数かどうかを検査する。非局所変数の場合
は、ブロック構造の階層を順次、主プログラムレベルま
で遡り名前表を検査する。
Step 3: The syntax analysis process 8 analyzes the process descriptions in the blocks one after another and calls the code generation process 13 to generate a description based on the specifications of the intermediate language. At this time, when a variable is accessed (either substituted or referenced) in the description of the source program 4, it is checked whether this variable is a local variable. In the case of non-local variables, the name table is inspected by sequentially going up the block structure hierarchy to the main program level.

【0035】手順4: 構文解析処理8は、手順3でア
クセスが検出された共有変数(すなわち主プログラムレ
ベルの変数)が有れば、共有変数へのアクセスが代入か
参照かをブロック別共有変数アクセス表10に記録す
る。
Step 4: If there is a shared variable whose access is detected in step 3 (that is, a variable at the main program level), the syntactic analysis process 8 determines whether the access to the shared variable is assignment or reference and the shared variable for each block. Record in access table 10.

【0036】手順5: 構文解析処理8は、ブロックの
終了まで構文解析が進んだ時点でブロック別共有変数ア
クセス表10の内容を、共有変数アクセス表11に記録
する。また、不要となったブロック別共有変数アクセス
表10およびブロック内名前表9を廃棄する。さらに、
このブロックの処理開始位置、処理終了位置のそれぞれ
のオブジェクトコード上での相対番地と、ブロック名を
ブロック管理表12に登録する(S201)。
Step 5: The syntactic analysis process 8 records the contents of the block-by-block shared variable access table 10 in the shared variable access table 11 when the syntactic analysis proceeds to the end of the block. Further, the block-by-block shared variable access table 10 and the in-block name table 9 which have become unnecessary are discarded. further,
The relative address on the object code of each processing start position and processing end position of this block and the block name are registered in the block management table 12 (S201).

【0037】手順6: コンパイラ6は、構文解析処理
8が全てのソースプログラムの記述を解析し終わった
後、コード生成処理13によって生成済みの中間言語記
述と、共有変数アクセス表11の内容と、ブロック管理
表12の内容を連結し、OBJ14を出力する(S202)。
Step 6: The compiler 6, after the syntax analysis process 8 has finished analyzing all the source program descriptions, the intermediate language description generated by the code generation process 13 and the contents of the shared variable access table 11, The contents of the block management table 12 are linked and the OBJ 14 is output (S202).

【0038】手順7: システムは、コンパイラ6の処
理が終了した後、IPP15に要求を送り、実行段階の
処理を開始する。
Step 7: After the processing of the compiler 6 is completed, the system sends a request to the IPP 15 to start the processing of the execution stage.

【0039】手順8: IPP15は、通信手段23に
よってOBJ14を読み込む。このとき、IPP15
は、OBJ14の中に記録された共有変数アクセス表1
1およびブロック管理表12の内容を、IPP15の作
業用メモリ16に展開する(S203)。この処理の結果、前
述の表構造が、共有変数アクセス表30とブロック管理
表31としてIPP15側に保持される。IPP15は
続いて、並列実行開始の述語である”COBEGIN”を検出
するまで、逐次実行を行なう(S204)。
Step 8: The IPP 15 reads the OBJ 14 by the communication means 23. At this time, IPP15
Is the shared variable access table 1 recorded in the OBJ 14.
1 and the contents of the block management table 12 are expanded in the work memory 16 of the IPP 15 (S203). As a result of this processing, the above-mentioned table structure is held on the IPP 15 side as the shared variable access table 30 and the block management table 31. The IPP 15 subsequently executes sequential execution until it detects the parallel execution start predicate "COBEGIN" (S204).

【0040】手順9: IPP15は、OBJ14の読
み取り処理において、中間言語の述語”COBEGIN”を検
出した場合、述語”NEWPROC”が現れるまで個々の述語
を逐次実行せず、遅延実行のための一時記録領域20
(以下実行バッファと略す)に格納する(S205)。
Step 9: When the IPB 15 detects the predicate "COBEGIN" in the intermediate language in the reading process of the OBJ 14, the individual predicates are not sequentially executed until the predicate "NEWPROC" appears, and the temporary recording for delayed execution is performed. Area 20
(Hereinafter, abbreviated as execution buffer) (S205).

【0041】手順10: IPP15は、述語”NEWPRO
C”を検出した場合、通信手段24により、他のIPP
25等との接続を試みる(S206)。別のIPP25が存在
し、応答が有った場合、要求側であるIPP15は、O
BJ14の個々の述語を前出の”NEWPROC”から始め、
再び別の”NEWPROC”が検出されるまで逐次取り出し、
他のIPP25へ転送するための一時記録領域21(以
下転送バッファと略す)に格納する(S207)。述語中に
(組み込み手続きではない)手続きあるいは関数の呼び
出しが検出された場合、要求側IPP15は、手順11
と手順12を行なう。
Step 10: The IPP 15 uses the predicate "NEWPRO
When "C" is detected, another IPP is detected by the communication means 24.
Attempts to connect with 25 etc. (S206). If there is another IPP 25 and there is a response, the requesting IPP 15 sends O
Begin each BJ14 predicate with the above "NEWPROC",
Sequentially take out until another "NEWPROC" is detected,
The data is stored in a temporary recording area 21 (hereinafter referred to as a transfer buffer) for transfer to another IPP 25 (S207). When a call to a procedure or function (which is not a built-in procedure) is detected in the predicate, the requesting IPP 15 makes the procedure 11
And perform step 12.

【0042】手順11: IPP15は、手続きあるい
は関数の開始位置のオブジェクトコード上での相対番地
をキーとして、ブロック管理表31を検索する(S208)。
IPP15は、ブロック管理表31のレコードから、注
目するブロックについて、終了位置の相対番地とブロッ
ク番号の値を取り出す。IPP15は、このブロック全
体の述語を、転送バッファ21に格納する(S209)。
Step 11: The IPP 15 searches the block management table 31 with the relative address on the object code of the start position of the procedure or function as a key (S208).
The IPP 15 extracts the value of the relative address of the end position and the block number of the block of interest from the record of the block management table 31. The IPP 15 stores the predicate of this entire block in the transfer buffer 21 (S209).

【0043】手順12: 次にIPP15は、ブロック
番号から共有変数アクセス表30を検索し、注目のブロ
ック中で参照だけしか行なわれない共有変数について、
変数の参照番号、この変数を格納するのに必要なスペー
スのバイト数および、この変数の現在の値を変数評価の
ための一時記録領域22(以下変数バッファと略す)に
記録する(S210)。
Step 12: Next, the IPP 15 searches the shared variable access table 30 from the block number, and regarding the shared variable which is only referred to in the block of interest,
The reference number of the variable, the number of bytes of space required to store this variable, and the current value of this variable are recorded in a temporary recording area 22 (hereinafter abbreviated as variable buffer) for variable evaluation (S210).

【0044】手順13: 手順10から手順12までが
完了した後、IPP15は、変数バッファ22の内容
を、IPP25に転送する。次に転送バッファ21に格
納されている全てのオブジェクトを、IPP25に転送
する(S211)。IPP25は、実行環境(アクティベーシ
ョンレコード、以下ARと略す)の初期設定を行ない、
処理実行に入る。
Step 13: After the steps 10 to 12 are completed, the IPP 15 transfers the contents of the variable buffer 22 to the IPP 25. Next, all the objects stored in the transfer buffer 21 are transferred to the IPP 25 (S211). The IPP 25 initializes an execution environment (activation record, hereinafter abbreviated as AR),
Start processing.

【0045】手順14: IPP15は、OBJ14中
の述語”COEND”を検出するまで手順10以降を繰り返
す。述語”COEND”が検出された場合は、手順9で述語
を記録した実行バッファ20の内容を逐次実行(S212)す
る。
Step 14: The IPP 15 repeats Step 10 and subsequent steps until it detects the predicate "COEND" in the OBJ 14. When the predicate "COEND" is detected, the contents of the execution buffer 20 in which the predicate is recorded in step 9 are sequentially executed (S212).

【0046】手順15: IPP15は、実行バッファ
20終了まで述語の実行を行なった後、並列実行を要求
したIPP25(さらに別のIPPに要求した場合はそ
れらIPP)に対し、それぞれ状態要求のメッセージを
転送する(S213)。要求受付側の各IPPは、処理終了/
未終了の状態コードを応答として返す。処理終了である
ことを返したIPPに対して要求側IPP15は、AR
17の返送を求め、これを受信する(S214)。全てのIP
Pから、AR17が返送されるまで(S215)、要求側IP
P15は手順15を繰り返す。
Step 15: After executing the predicate until the end of the execution buffer 20, the IPP 15 sends a status request message to each of the IPPs 25 that requested parallel execution (or IPPs if another IPP was requested). Transfer (S213). Each IPP on the request receiving side finishes processing /
Returns an unfinished status code as a response. When the requesting IPP 15 returns the AR to the IPP that returned the processing end
17 is requested to be returned, and this is received (S214). All IP
Requester IP until P returns AR17 (S215)
P15 repeats the procedure 15.

【0047】以上の説明において、AR(アクティベー
ションレコード)は、中間言語インタープリタの実装時
に一般的に使用される仮想プロセッサの状態を管理する
ためのデータ構造である。本実施例においては、ARと
して以下の要素を持つデータ構造を用いた。
In the above description, the AR (activation record) is a data structure for managing the state of the virtual processor generally used when the intermediate language interpreter is installed. In this embodiment, a data structure having the following elements is used as AR.

【0048】・関数の返す値(呼び出しブロックが関数
の場合) ・処理の戻り番地 ・本処理ブロックを呼び出した上位ブロックの名前表最
終要素へのポインタ ・本処理ブロックが宣言された上位ブロックの名前表最
終要素へのポインタ ・ブロック内名前表へのポインタ 2−2.実行時動作の概要 図4は、単純化した本実施例の処理の動作の説明図であ
る。
Value returned by function (when calling block is a function) Return address of processing Pointer to last element of name table of upper block that called this processing block Name of upper block in which this processing block is declared Pointer to last element of table-Pointer to name table in block 2-2. Outline of Run-time Operation FIG. 4 is an explanatory diagram of the operation of the processing of this embodiment that is simplified.

【0049】IPP15では処理ブロック401が実行
され、これと並行してIPP25で処理ブロック402
が実行されている状態を示す。2つの処理ブロックは、
共有変数403をアクセスするが、IPP25には共有
変数403の複写404が配置される。また処理ブロッ
ク402は、この共有変数に対し読み取り参照だけしか
行わない。(これはリスト303の手続きp1の場合に相
当する。)読み取り参照時には、処理ブロック401、
402共にローカルメモリ上の共有変数値を参照する。
しかし、共有変数値の書き換えでは、書き換えを行う処
理ブロック401は、ローカルメモリの共有変数403
を書き換え、またIPP25のローカルメモリに有る共
有変数の複写404も書き換える。
The processing block 401 is executed in the IPP 15, and in parallel with this, the processing block 402 is executed in the IPP 25.
Indicates that the is being executed. The two processing blocks are
Although the shared variable 403 is accessed, a copy 404 of the shared variable 403 is arranged in the IPP 25. Also, processing block 402 only makes read references to this shared variable. (This corresponds to the case of procedure p1 in list 303.) At the time of reading reference, processing block 401,
Both 402 refer to the shared variable value on the local memory.
However, in rewriting the shared variable value, the processing block 401 that rewrites the shared variable value 403 in the local memory.
Of the shared variable in the local memory of the IPP 25.

【0050】この処理によって本実施例は、並列実行時
の変数値更新に保証を与えるものである。上記動作実現
のため、コンパイラ6はソースプログラム4を読み取
り、実行コード生成する際、その作業メモリ内にブロッ
ク管理表12および共有変数アクセス表11を作成す
る。この2つの表のデータ構造から、IPP群において
並列実行する際の共有変数情報が生成される。そのた
め、前記2つの表構造はオブジェクトコード14に記録
され、IPP(この例では15)に読み込まれる。IP
P15は、前記2つの表構造に基づき、ブロック管理表
31および、共有変数アクセス表30をIPP作業メモ
リ上に生成する。上述した様に処理ブロック402が、
ある注目した共有変数に対して、読み取り参照だけを行
なうブロックである場合、処理ブロック402が分散さ
れるIPP25の共有変数領域18には、IPP間の通
信によって、初期設定が行なわれる。初期設定の処理内
容は、注目の共有変数のサイズに相当するメモリ領域を
確保し、値をコピーする操作である。この共有変数の複
写されたアドレスは、後述する図14のデータ構造によ
り、参照番号141と、ポインタ142で一意に決定で
きる。従って、処理ブロック401が、共有変数の実体
403と共に、共有変数の複写である404の値を書き
換える場合は、通信によって書き換えるべき値と、書き
換える共有変数の参照番号141を指定すれば良い。こ
の処理で用いる通信のためのデータ構造は、図5を用い
て後述する。またその他の各部分の実現方法についても
次の節以降に述べる。
By this processing, the present embodiment guarantees updating of variable values during parallel execution. To realize the above operation, the compiler 6 reads the source program 4 and creates a block management table 12 and a shared variable access table 11 in its working memory when generating an execution code. Shared variable information for parallel execution in the IPP group is generated from the data structures of these two tables. Therefore, the two table structures are recorded in the object code 14 and read into the IPP (15 in this example). IP
The P15 generates the block management table 31 and the shared variable access table 30 on the IPP working memory based on the two table structures. As described above, processing block 402
In the case of a block that only performs read reference for a certain shared variable, the shared variable area 18 of the IPP 25 in which the processing block 402 is distributed is initialized by communication between IPPs. The processing contents of the initial setting are an operation of securing a memory area corresponding to the size of the shared variable of interest and copying the value. The copied address of this shared variable can be uniquely determined by the reference number 141 and the pointer 142 by the data structure of FIG. 14 described later. Therefore, when the processing block 401 rewrites the value of 404 which is a copy of the shared variable together with the shared variable entity 403, the value to be rewritten by communication and the reference number 141 of the shared variable to be rewritten may be specified. The data structure for communication used in this processing will be described later with reference to FIG. The method of realizing each of the other parts is also described in the following sections.

【0051】3.各部動作の説明 3−1.コンパイラ動作と並列処理時の表構造参照 図4を用いて概略を述べたIPP間の通信によって、並
列実行時の共有変数を更新する機構を実現できる。実際
にこの処理を行なうためには、 ・各処理ブロックが、どの共有変数にアクセスするかに
関する情報と、 ・注目する処理ブロックがどのプロセッサの局所メモリ
に配置されているかの情報が必要である。この情報は、
本実施例においてはコンパイラ6が共有変数アクセス表
11とブロック管理表12を生成する段階で作成され
る。既に述べた様に、表構造はOBJ14に記録され、
実行時にはIPP15にロードされて、IPP15のメ
モリ上の作業領域16に共有変数アクセス表30とブロ
ック管理表31として保持され参照される。
3. Description of operation of each part 3-1. Compiler operation and table structure reference at the time of parallel processing The mechanism for updating the shared variable at the time of parallel execution can be realized by the communication between the IPPs outlined using FIG. In order to actually perform this processing, information on which shared variable each processing block accesses, and information on which processor's local memory the target processing block is located are required. This information is
In this embodiment, the compiler 6 is created when the shared variable access table 11 and the block management table 12 are created. As already mentioned, the table structure is recorded in OBJ14,
At the time of execution, it is loaded into the IPP 15, and is held and referred to as the shared variable access table 30 and the block management table 31 in the work area 16 on the memory of the IPP 15.

【0052】ここでは、この表構造生成に関するコンパ
イラ6の動作と、実行時の表管理について説明する。
Here, the operation of the compiler 6 relating to this table structure generation and table management at the time of execution will be described.

【0053】3−1−1.従来のコンパイラ動作との共
通点 図6に、本実施例の中間言語記述の一部について説明す
る図を示す。項目601は16進数で表記された中間言
語の命令語(述語)であり、これに名称を与えたものが
項目602で示される。本実施例のコンパイラ6の動作
は、中間言語として並列実行に関する述語を生成する点
を除いて、従来の逐次処理言語のコンパイラと同じであ
る。コンパイラ6は、LL(1)形式の構文規則を持つ
言語記述に対し、周知の再帰的下降構文解析を行ない、
中間コード生成を行なう。
3-1-1. Common Points with Conventional Compiler Operation FIG. 6 is a diagram for explaining a part of the intermediate language description of the present embodiment. An item 601 is an intermediate language instruction word (predicate) expressed in hexadecimal notation, and a name given to it is indicated by an item 602. The operation of the compiler 6 of this embodiment is the same as that of a conventional serial processing language compiler, except that a predicate relating to parallel execution is generated as an intermediate language. The compiler 6 performs well-known recursive descending parsing on a language description having a syntax rule of LL (1) format,
Generate intermediate code.

【0054】図7のリスト701の示すプログラムにつ
いて、手続き702の部分に関するコンパイル結果をリ
スト704に示す。リスト703は、オブジェクトコー
ドの相対番地を示し、リスト705は、リスト704を
ディスアセンブルした形式で示したものである。
With respect to the program shown in the list 701 of FIG. 7, the compile result regarding the part of the procedure 702 is shown in the list 704. A list 703 shows the relative address of the object code, and a list 705 shows the list 704 in a disassembled form.

【0055】本実施例の扱う中間言語は、仮想プロセッ
サとして、アキュムレータ、レジスタ等の特定のプロッ
セッサの構成要素を仮定せず、スタックを演算のための
領域として使用する形式のもので、これも従来より広く
用いられている。後述の説明のため、まず図8を用い
て、スタックへのブロック内の変数の配置の方法を説明
する。
The intermediate language used in this embodiment does not assume a specific processor component such as an accumulator or a register as a virtual processor, and uses a stack as an area for arithmetic operation. More widely used. For the following description, first, a method of arranging variables in a block on a stack will be described with reference to FIG.

【0056】スタックは、各ブロックが実行時に呼び出
されると、804に図示する状態で消費される。図8で
は処理ブロック呼び出し直前のスタックポインタが矢印
806の位置を示していたとして、図中の上方向がアド
レスの小さな値となる様に表示している。スタックに
は、最初に前述したARの5つの要素が配置され、その
上に第1の局所変数805が格納され、全ての局所変数
が置かれた後、実行コードによる消費が行なわれる。ま
た各処理ブロックが引数を持つ場合は、引数はARに先
行してスタック804に配置されるため、その位置は矢
印806よりアドレスより小さい方向(図中では下方)
に配置される。
The stack is consumed in the state shown at 804 as each block is called at run time. In FIG. 8, the stack pointer immediately before the calling of the processing block indicates the position of the arrow 806, and the upward direction in the drawing is displayed such that the value of the address becomes smaller. First, the above-mentioned five elements of the AR are arranged on the stack, the first local variable 805 is stored thereon, and after all the local variables are arranged, the consumption by the execution code is performed. When each processing block has an argument, the argument is arranged on the stack 804 prior to the AR, so that the position is smaller than the address than the arrow 806 (downward in the figure).
Is located in.

【0057】ブロックレベル802は、主プログラムの
レベルが0であり、以下、構造が深くなるとレベルの値
は+1ずつ増加する。リスト701のプログラムを例に
とれば、変数xx、yyはいずれもブロックレベル=0での
変数である。またprocedurep3で宣言される変数a、b、c
はいずれもブロックレベル=1の変数である。リスト7
02の第5行は、procedure p3での最初の実行文である
が、矢印708以下の3行の様にコンパイルされる。す
なわち、各行は次の処理に相当する。
In the block level 802, the level of the main program is 0, and thereafter, as the structure becomes deeper, the level value increases by +1. Taking the program of the list 701 as an example, both variables xx and yy are variables at block level = 0. Also, variables a, b, and c declared in procedurep3
Are all variables at block level = 1. Listing 7
The fifth line of 02, which is the first executable statement in procedure p3, is compiled as the third line following arrow 708. That is, each row corresponds to the next processing.

【0058】第1行: ブロックレベル=1であるブロ
ックのスタック上の指標で5番目の位置のアドレスを評
価し、現在のスタックの最上段に格納する。
First line: The address of the fifth position is evaluated by the index on the stack of the block having the block level = 1, and stored at the top of the current stack.

【0059】第2行: 定数4をスタック最上段に格納
する。
Second line: Store the constant 4 at the top of the stack.

【0060】第3行: スタック最上段の値を、スタッ
クの上から2番目の段の示すアドレスに格納する。
Third line: The value at the top of the stack is stored in the address indicated by the second stage from the top of the stack.

【0061】上記の説明において、procedure p3の局所
変数宣言の中で、変数aは最初に現れる変数であるが、
前述のスタック804の使用状況にあわせ、スタック上
でのディスプレースメント803の値が5となる。
In the above explanation, the variable a is the first variable to appear in the local variable declaration of procedure p3.
The value of the displacement 803 on the stack becomes 5 according to the use status of the stack 804 described above.

【0062】3−1−2.本実施例のコンパイラ6の動
作の特徴 本実施例のコンパイラ6の動作の特徴は次の4つの点で
ある。
3-1-2. Features of the operation of the compiler 6 of this embodiment The features of the operation of the compiler 6 of this embodiment are the following four points.

【0063】(1)実行時に処理ブロックを、他のIP
Pに分散するための情報を生成する点。
(1) At the time of execution, the processing block is changed to another IP
A point that generates information for distribution in P.

【0064】(2)並列して実行される処理ブロック毎
に、読み取り参照専用の共有変数の複写を配置するため
の情報を生成する点。
(2) Generating information for arranging a copy of a read-only shared variable for each processing block executed in parallel.

【0065】(3)並列実行を分担する他のIPPとの
接続を行なうべき構文上の位置を指定する述語を生成す
る点。
(3) Generating a predicate that specifies a syntactical position at which a connection with another IPP sharing the parallel execution should be made.

【0066】(4)プロセッサに依存した機械語ではな
く、中間言語を出力し、中間言語オブジェクト中に、共
有変数に関する参照情報を保持した表データ構造と、並
列実行のための述語記述を挿入した形式のオブジェクト
ファイル出力を行なう点。
(4) An intermediate language is output instead of a processor-dependent machine language, and a table data structure holding reference information about shared variables and a predicate description for parallel execution are inserted into the intermediate language object. Point to output the object file of the format.

【0067】以上の内、(1)、(2)は本実施例の実
現に必ず必要となる条件であり、(3)は処理を容易と
するための条件である。(4)は、中間言語を生成する
点では従来の中間言語出力形式のコンパイラと同様であ
るが、共有変数を許す並列言語処理系を実現するための
手段を持つ点において従来のコンパイラと異なる。
Among the above, (1) and (2) are conditions necessary for realizing the present embodiment, and (3) is a condition for facilitating the processing. (4) is similar to a conventional intermediate language output format compiler in that an intermediate language is generated, but is different from the conventional compiler in that it has means for realizing a parallel language processing system that allows shared variables.

【0068】本実施例において(1)の条件を実現する
ため、コンパイラ6はブロック管理表12(またはその
複写である31)を生成する。以下に図11と図12を
用いて説明する。
In order to realize the condition (1) in this embodiment, the compiler 6 generates the block management table 12 (or its copy, 31). This will be described below with reference to FIGS. 11 and 12.

【0069】ブロック管理表12は、図11に示すデー
タ構造をとる。ブロック番号112は個々の処理ブロッ
クに一意にあたえられる番号であり、ブロックに関する
情報を検索する際に、キーとして使用される。ブロック
開始番地113およびブロック終了番地114は、それ
ぞれオブジェクトコード中の相対位置として記録され、
ブロックを他のIPPのローカルメモリに転送する際に
参照される。引数に消費するスタックの深さ115は、
他のIPPにブロックを転送する際、ブロックへの引数
としてスタックに配置された値を転送し、転送先IPP
のスタックを初期化する時点で、初期化に必要なバイト
数計算のため参照される。名前参照引数フラグ116
は、名前参照の引数を使用するブロックであるかどうか
を検出する目的のフラグである。前述のように並列実行
単位として認められるブロックは、値参照引数だけが許
されるという制限を設定したため、IPPは実行時にこ
のフラグを参照し、並列実行の可否を決定する。ブロッ
ク外部呼び出しポインタ117は、連結リスト118を
形成するデータ構造であり、注目するブロックが、他の
ブロックを呼び出す場合、呼び出しブロックに関するブ
ロック番号を保持するデータ構造である。ここではブロ
ック数は可変であるため、連結リスト型のデータ構造1
18を用いた。IPPは実行時に、あるブロックを他の
IPPに転送する場合、このブロックが呼び出す外部の
ブロックに関しても、オブジェクトコードを取り出し、
他のIPPに転送する。この時、連結リスト118が示
す各ブロックが転送の対象とされる。
The block management table 12 has a data structure shown in FIG. The block number 112 is a number uniquely assigned to each processing block, and is used as a key when searching for information regarding a block. The block start address 113 and the block end address 114 are recorded as relative positions in the object code,
It is referred to when the block is transferred to the local memory of another IPP. The stack depth 115 consumed as an argument is
When transferring a block to another IPP, the value placed on the stack is transferred as an argument to the block, and the transfer destination IPP
When the stack of is initialized, it is referred to for calculating the number of bytes required for initialization. Name reference argument flag 116
Is a flag for detecting whether or not the block uses a name reference argument. As described above, the block recognized as a parallel execution unit has a limit that only a value reference argument is allowed. Therefore, the IPP refers to this flag at the time of execution to determine whether parallel execution is possible. The block external call pointer 117 is a data structure that forms the linked list 118, and is a data structure that holds a block number related to a call block when the block of interest calls another block. Since the number of blocks is variable here, a linked list type data structure 1
18 was used. When an IPP transfers one block to another IPP at runtime, it also retrieves the object code for the external block it calls,
Transfer to another IPP. At this time, each block indicated by the linked list 118 is a transfer target.

【0070】これらデータ構造の各項目は、コンパイラ
6の構文解析処理8およびコード生成処理13が、処理
ブロック(手続きあるいは関数)を検出した際に、図1
2の流れ図に示す手順を行ない生成する。
Each item of these data structures is shown in FIG. 1 when the syntax analysis process 8 and the code generation process 13 of the compiler 6 detect a processing block (procedure or function).
The procedure shown in the flowchart of No. 2 is performed to generate.

【0071】ブロックのコード生成は最初に引数リスト
の解析を行なう(S121)。この時、引数に消費するスタッ
クの深さ115が記録され、名前参照引数の有無によっ
て、名前参照引数フラグ116が記録される。続いて局
所変数の解析が行なわれ(S122)、データ構造定義などの
宣言文の解析が行なわれる(S123)。但し、S122、S123の
処理手順は、宣言の登場順に従い、繰り返される。さら
に、関数、手続きいずれかの他の処理ブロックの宣言が
有る場合は、コード生成が再帰的に処理される。すなわ
ち、自分自身を再帰的に呼び出し(S124)処理を継続す
る。
In the block code generation, the argument list is first analyzed (S121). At this time, the stack depth 115 consumed in the argument is recorded, and the name reference argument flag 116 is recorded depending on the presence or absence of the name reference argument. Subsequently, the local variable is analyzed (S122), and the declaration statement such as the data structure definition is analyzed (S123). However, the processing procedure of S122 and S123 is repeated according to the appearance order of the declaration. Further, when there is a declaration of another processing block of either a function or a procedure, code generation is processed recursively. That is, the process recursively calls itself (S124) and the process is continued.

【0072】一連の宣言に関する処理は、ブロック本文
の開始で終了する。ブロック本文は予約語”begin”で
開始される。この予約語を検出すると、構文解析処理8
は、逐次コード生成処理13を呼び出し、各述語の生成
を処理する(S125)。このとき、ブロックの開始番地11
3が記録される。また、記述中に自ブロック外の関数、
手続きの呼び出しが有れば、そのつど外部呼び出しポイ
ンタ117および、連結リスト118が生成される。ブ
ロックの記述は予約語”end”によって終了するが、こ
の時ブロック終了番地114が記録される。
The processing relating to the series of declarations ends at the start of the block body. The block text starts with the reserved word "begin". When this reserved word is detected, the syntax analysis process 8
Calls the sequential code generation process 13 to process the generation of each predicate (S125). At this time, the start address 11 of the block
3 is recorded. Also, during description, the function outside the own block,
Whenever a procedure is called, the external call pointer 117 and the linked list 118 are generated. The block description ends with the reserved word "end", but at this time, the block end address 114 is recorded.

【0073】上記の(2)の条件は「読み取り参照だけ
の共有変数の検出」を行ない記録することで実現され
る。このために上記手順で処理ステップS125において、
主プログラムレベルで宣言された変数へのアクセスが、
ブロック別共有変数アクセス表10に記録される。以下
処理手順を図10を用いて説明する。
The above condition (2) is realized by performing and recording "detection of shared variable only for read reference". Therefore, in the processing step S125 according to the above procedure,
Access to variables declared at the main program level
It is recorded in the shared variable access table for each block 10. The processing procedure will be described below with reference to FIG.

【0074】変数に対するアクセスが有ると、構文解析
処理8は、ブロック内名前表9を検索する。これに該当
する変数名が無ければ、ブロックのレベルをー1し、よ
り上位のブロックのブロック内名前表9を検索する。ブ
ロックレベル=0となるブロック内名前表9において検
出した変数は、”主プログラムレベルで宣言された変
数”であり、本実施例における共有変数である。また、
この検索で検出できない変数名は、変数名未定義の構文
エラー処理を行なう。構文解析処理8は、共有変数につ
いて、主プログラムでの宣言順をそのまま参照番号10
2とし(これは名前表9での出現順と一致する)、ブロ
ック別共有変数アクセス表10を検索し、アクセスが書
き込みか読み取りかを、アクセスフラグ103に記録す
る。読み取りであればフラグ=0が、また書き込みであ
ればフラグ=1がそれぞれ前回値に対し論理和される。
従って、ブロック全体の構文解析が終了すると、ブロッ
ク別共有変数アクセス表10の内容は、書き込みを伴う
共有変数について、アクセスフラグ103が1となるよ
うに記録される。一つの処理ブロックについて処理が終
了すると、ブロック別共有変数アクセス表10の内容
は、そのつど共有変数アクセス表11に記録される。共
有変数アクセス表11は、読み取り参照しか行なわれな
いブロックのリストを連結リスト108として保持する
ためのデータ構造であり、各共有変数の参照番号10
5、変数名106、連結リストへのポインタ107によ
って構成される。個々のブロックのブロック別共有変数
アクセス表10については、アクセスフラグ103が検
査され、フラグ=0である変数の参照番号102が取り
出される。次にこの参照番号102と一致した参照番号
105の要素が、共有変数アクセス表11で検索され、
この要素のポインタ107以降の連結リストに、処理中
のブロックのブロック番号が追加される。
When the variable is accessed, the syntax analysis process 8 searches the in-block name table 9. If there is no variable name corresponding to this, the level of the block is set to -1, and the in-block name table 9 of the higher block is searched. The variable detected in the in-block name table 9 with the block level = 0 is a "variable declared at the main program level", which is a shared variable in this embodiment. Also,
For variable names that cannot be detected by this search, syntax error processing for variable name undefined is performed. The parsing process 8 refers to the shared variable in the order of declaration in the main program as it is with reference numeral 10.
2 (this matches the order of appearance in the name table 9), the shared variable access table for each block 10 is searched, and whether the access is write or read is recorded in the access flag 103. If read, flag = 0 is added, and if write, flag = 1 is added to the previous value.
Therefore, when the syntactic analysis of the entire block is completed, the contents of the block-by-block shared variable access table 10 are recorded so that the access flag 103 becomes 1 for the shared variable accompanied by writing. When the processing is completed for one processing block, the contents of the shared variable access table for each block 10 are recorded in the shared variable access table 11 each time. The shared variable access table 11 is a data structure for holding a list of blocks that are only read-referenced as a linked list 108, and reference number 10 of each shared variable.
5, variable name 106, and pointer 107 to the linked list. With respect to the shared variable access table 10 for each block of each block, the access flag 103 is checked, and the reference number 102 of the variable with flag = 0 is extracted. Next, the element with the reference number 105 that matches the reference number 102 is searched in the shared variable access table 11,
The block number of the block being processed is added to the linked list after the pointer 107 of this element.

【0075】以上の処理手順が、プログラム中のすべて
のブロックについて完了すると、共有変数アクセス表1
1には、全ての共有変数について、読み取り参照だけし
か行なわないブロックに関する情報が記録される。
When the above processing procedure is completed for all blocks in the program, the shared variable access table 1
In 1 is recorded information about blocks for which only read reference is performed for all shared variables.

【0076】上記の条件(3)は、オブジェクト中に述
語NEWPROC挿入することで実現される。リスト704の
例では、矢印706で示したCOBEGIN述語から、矢印7
07で示したCOEND述語の間に、並列実行を引き起こす
述語NEWPROC(16進数では2C)が挿入される。IP
P処理系は、実行時にこの述語を検出したら、他のIP
Pとの通信を行ない、接続を確立し、接続したIPPの
初期化を行なう。これについては、IPP間の通信に関
する動作説明の項目で後述する。
The above condition (3) is realized by inserting the predicate NEWPROC into the object. In the example of list 704, from the COBEGIN predicate shown by arrow 706, arrow 7
The predicate NEWPROC (2C in hexadecimal) that causes parallel execution is inserted between the COEND predicates indicated by 07. IP
If the P processing system detects this predicate at the time of execution, another P
It communicates with P, establishes a connection, and initializes the connected IPP. This will be described later in the item of operation description regarding communication between IPPs.

【0077】上記の条件(4)は、2つの技術的な利点
を持ち、本実施例において、最も基本的な構成要素をな
す。第1の技術的利点は、中間言語出力を中間言語イン
タープリタ(IPP)が実行する結果として生じるもの
であり、共有変数アクセス時の排他制御、同期制御の機
構を簡潔に処理できるという点である。これについて
は、”3−2.排他制御及びIPP間の通信”の節で説
明する。第2の技術的な利点は言うまでも無く、並列実
行のために必要となる共有変数アクセスの情報を中間言
語のオブジェクトファイルに記録する点であり、この操
作によって次節で説明する実行時の処理並列化が簡単な
操作で実現できる。仮に、共有変数アクセスに関する情
報が、オブジェクトファイル14を介してIPP群に渡
される事の無い処理系を実現しようとすると、実行時に
アクセスされる変数の実体を観測し、共有変数か否かを
判断する何らかの機構が必要となる。しかしその実現
は、IPP群が通信経路5等を介して通信しあうプロセ
ス群であるため、極めて困難であると言える。
The above condition (4) has two technical advantages, and constitutes the most basic constituent element in this embodiment. The first technical advantage is that the intermediate language output is generated as a result of execution by the intermediate language interpreter (IPP), and the mechanism of exclusive control and synchronous control when accessing a shared variable can be simply processed. This will be described in the section “3-2. Exclusive control and communication between IPPs”. Needless to say, the second technical advantage is that the information of shared variable access required for parallel execution is recorded in the object file of the intermediate language. This operation allows the runtime processing described in the next section. Parallelization can be realized with a simple operation. If it is attempted to realize a processing system in which information regarding shared variable access is not passed to the IPP group via the object file 14, the actual entity of the variable accessed at the time of execution is observed to determine whether or not the variable is a shared variable. Some mechanism to do this is required. However, the realization thereof can be said to be extremely difficult because the IPP group is a group of processes that communicate with each other via the communication path 5 or the like.

【0078】3−1−3.本実施例の中間言語実行時の
特徴 本実施例のIPPは、従来方式の中間言語インタープリ
タと2つの点において大きく異なる。第1の相違点は、
IPP間で通信し合い、並列実行可能な処理ブロックを
複数のIPPに分散し、処理を多重化する点である。こ
れについては、「3−2.排他制御及びIPP間の通
信」において詳しく説明する。第2の相違点は、図4で
概略を示した様に、読み取り参照だけの共有変数を各I
PPのローカルメモリに配置すると共に、他IPPで実
行中の処理ブロックがこれを書き換える際、通信を行な
い書き換え処理する点である。ここでは、この第2の相
違点について説明する。
3-1-3. Features of Execution of Intermediate Language of this Embodiment The IPP of this embodiment is largely different from the conventional intermediate language interpreter in two points. The first difference is that
The point is that the IPPs communicate with each other, the processing blocks that can be executed in parallel are distributed to a plurality of IPPs, and the processing is multiplexed. This will be described in detail in “3-2. Exclusive control and communication between IPPs”. The second difference is that as shown in FIG.
The point is that when the processing block is placed in the local memory of the PP and is rewritten by the processing block being executed by another IPP, the rewriting process is performed by performing communication. Here, the second difference will be described.

【0079】IPPがOBJ14に含まれる中間言語の
記述を解釈実行する際、コンパイラ6が作成した共有変
数アクセス表11の情報が必要となる。この情報はOB
J14を通して、IPP15の作業用メモリ領域16に
展開される。この結果生成される共有変数アクセス表3
0の内容を図13に示す。共有変数アクセス表30の内
容は、基本的に共有変数表11のコピーである。しか
し、実行時に必要な2つの変更が加えられる。第1の変
更は、変数名106が不要となる点である。実行時には
共有変数は参照番号105によってのみ参照される。第
2の変更点は、連結リスト108のデータ構造に、IP
P番号が付加される点である。IPP番号は、初期値は
0であり、並列実行時に処理ブロックを他のIPPに転
送した時、記録される。すなわちある処理ブロックを並
列実行する際には、連結リスト中のブロック番号が検索
され、該当するブロック番号の後に、実際にそのブロッ
クの処理を行なうIPPの番号(識別子)が記録され
る。
When the IPP interprets and executes the description of the intermediate language included in the OBJ 14, the information of the shared variable access table 11 created by the compiler 6 is required. This information is OB
It is expanded in the work memory area 16 of the IPP 15 through J14. Shared variable access table 3 generated as a result
The contents of 0 are shown in FIG. The content of the shared variable access table 30 is basically a copy of the shared variable table 11. However, it does make two changes needed at run time. The first change is that the variable name 106 is unnecessary. At runtime, shared variables are referenced only by reference numeral 105. The second change is that the data structure of the linked list 108
This is the point where the P number is added. The IPP number has an initial value of 0 and is recorded when a processing block is transferred to another IPP during parallel execution. That is, when a certain processing block is executed in parallel, the block number in the linked list is searched, and the IPP number (identifier) that actually processes the block is recorded after the corresponding block number.

【0080】共有変数も含め、あらゆる変数への代入処
理はIPPが、命令語STROREを実行する際に行なわれ
る。命令語STOREの処理内容は、”スタック最上段の値
を、スタックの上から2番目の段の示すアドレスに格納
する。”ことである。従ってこの時、データを格納する
アドレスが、共有変数のアドレスであるかどうかをIP
Pが判断できる機構が必要である。一方、命令語STORE
が評価すべき変数アドレスの値をスタック上に配置する
のは、命令語LODAである。従って、IPPが命令語LODA
を実行する時、評価されるアドレスが、共有変数のアド
レスであるか判断し記録しておく処理が必要である。
Substitution processing for all variables including shared variables is performed when the IPP executes the command word STRORE. The processing content of the instruction word STORE is that "the value of the uppermost stage of the stack is stored at the address indicated by the second stage from the top of the stack." Therefore, at this time, it is determined whether or not the address for storing the data is the address of the shared variable.
A mechanism that P can judge is necessary. On the other hand, the command STORE
It is the instruction word LODA that places the value of the variable address to be evaluated on the stack. Therefore, the IPP is the command word LODA.
When executing, it is necessary to determine whether the evaluated address is the address of the shared variable and record it.

【0081】以上の要請から本実施例では、共有変数へ
の代入か否かを判断し、必要な代入処理を実現するた
め、IPP内部に共有変数へのアクセスポインタ40を
設定した。
From the above request, in this embodiment, the access pointer 40 to the shared variable is set inside the IPP in order to determine whether or not the assignment is to the shared variable and to realize the necessary assignment processing.

【0082】まず図8を用いて命令語LODAの処理を説明
する。述語LODA(16進数で00)の命令の一語は、80
1、802、803の3つのフィールドから構成され
る。ここで801はOPコード(命令語述語コード)で
あり、802は操作対象の変数が宣言されたブロックの
深さのレベル(以下ブロックレベルと書く)であり、8
03はそのブロック内のスタック上での配置への指標で
ある。ブロックレベル802について値が0であれば、
主プログラムレベルで宣言された変数であると判断でき
る。言語仕様について、「主プログラムレベルで宣言さ
れる変数を共有変数とみなす」としたため、共有変数の
検出は、LODA命令のブロックレベル802の値が0であ
るかどうかによって決定できる。
First, the processing of the instruction word LODA will be described with reference to FIG. A word of the predicate LODA (hexadecimal 00) is 80
It is composed of three fields of 1, 802 and 803. Here, 801 is an OP code (instruction word predicate code), 802 is a depth level of a block in which a variable to be operated is declared (hereinafter referred to as a block level), and 8
03 is an index to the arrangement on the stack in the block. If the value for block level 802 is 0,
It can be judged that it is a variable declared at the main program level. Since the language specification states that “variables declared at the main program level are regarded as shared variables”, the detection of shared variables can be determined by whether or not the value of the block level 802 of the LODA instruction is 0.

【0083】次にアクセスポインタ40を用いた共有変
数アクセス処理について、図9の流れ図を用いて説明す
る。図9は、IPPの命令語処理手順の一部を示した流
れ図である。
Next, a shared variable access process using the access pointer 40 will be described with reference to the flowchart of FIG. FIG. 9 is a flowchart showing a part of the instruction word processing procedure of IPP.

【0084】オブジェクトコード中の命令語が取り出さ
れ(S901)、命令語LODAであった場合、ブロックレベル8
02の値が=0であるか検査される。この判断が{真}
であれば、スタック上での配置への指標803を用いて
の、共有変数表上でのアドレス計算が行なわれ、この値
はアクセスポインタ40に記録される(S903)。このあと
実際のLODA命令の処理が実行される(S904)。
If the instruction word in the object code is extracted (S901) and the instruction word is LODA, block level 8
The value of 02 is checked for = 0. This judgment is {true}
If so, the address calculation on the shared variable table is performed using the index 803 for the allocation on the stack, and this value is recorded in the access pointer 40 (S903). After this, the actual processing of the LODA instruction is executed (S904).

【0085】他方、命令語STOREを実行する時IPP
は、次の手順で処理を行なう。
On the other hand, when executing the instruction word STORE, IPP
Performs processing according to the following procedure.

【0086】アクセスポインタ40の内容が=0であれ
ば、通常のSTORE命令の処理を行なう(S907)。しかし、
アクセスポインタの内容が=0でなければ、アクセスポ
インタの値を、共有変数アクセス表30の指標とし、共
有変数アクセス表30から、共有変数を保持するプロセ
ッサ番号、IPP番号を取り出し、これら全てのIPP
に、後で述べる”データ書き換え命令”を転送し、共有
変数の値を更新する(S906)。
If the content of the access pointer 40 is = 0, a normal STORE instruction is processed (S907). But,
If the content of the access pointer is not 0, the value of the access pointer is used as an index of the shared variable access table 30, the processor number and the IPP number holding the shared variable are extracted from the shared variable access table 30, and all of these IPP
Then, the "data rewrite command" described later is transferred to update the value of the shared variable (S906).

【0087】読み取り参照しか行なわれない共有変数
(の複写)は、各IPPの作業用メモリ16内の共有変
数領域18に個々に初期化生成される。この共有変数領
域を図14に示す。共有変数領域18は、共有変数参照
番号141と実アドレスへのポインタ142を格納した
領域と、実際に変数を保持する領域が有る。個々の共有
変数は、参照番号141の値をキーとし、ポインタ14
2から実際の格納位置143のアドレスを知ることがで
きる。
Shared variables (copy of which are only read / referenced) are individually initialized and generated in the shared variable area 18 in the working memory 16 of each IPP. This shared variable area is shown in FIG. The shared variable area 18 has an area in which a shared variable reference number 141 and a pointer 142 to a real address are stored, and an area in which a variable is actually held. Each shared variable uses the value of the reference number 141 as a key, and uses the pointer 14
The address of the actual storage location 143 can be known from 2.

【0088】3−2.排他制御及びIPP間の通信 直接、機械語生成する形式のコンパイラでは、共有資源
へのアクセス時には、セマフォ型、モニタ型などの排他
制御に関する機構が必要であり、このためのコード生成
が行われる。しかし本実施例では、実行がインタープリ
タによって行われるため、共有変数について排他制御、
同期制御のための特殊なコード生成が必要とされない。
なぜなら、他のIPPから変数書き換えのためのメッセ
ージを通信手段によって受信した場合であっても、IP
Pは逐次処理するため、変数書き換え中に、IPP内で
他の処理単位が物理的に変数にアクセスする事が無いた
めである。
3-2. Exclusive control and communication between IPPs In a compiler that directly generates a machine language, a mechanism related to exclusive control such as a semaphore type or a monitor type is required when accessing a shared resource, and code generation is performed for this purpose. However, in this embodiment, since the execution is performed by the interpreter, exclusive control is performed on the shared variable,
No special code generation is required for synchronous control.
This is because even if the communication means receives a message for rewriting variables from another IPP, the IP
This is because P is processed sequentially, so that another processing unit does not physically access the variable while rewriting the variable.

【0089】通信経路5からデータ列を受信すると、プ
ロセッサの処理番地は、オペレーティングシステムによ
ってプロセス内の特定の処理部分に分岐される。この様
な一種のソフトウェア例外(割り込み)処理は、ほとん
どのオペレーティングシステムで供給されるサービスで
ある。通信手段23または24は、それぞれ通信の為に
確保したオペレーティングシステムの資源(通信ソケッ
ト)に、他プロセスからのデータ列が入力された時に処
理分岐によって実行される処理手続きである。IPP間
の通信によって転送されるデータ列は次の2つの種類に
分類される。 (1)インタープリタの処理待ち行列に格納され、順次
取り出し実行される中間言語記述のデータ列。
When the data string is received from the communication path 5, the processing address of the processor is branched by the operating system to a specific processing portion in the process. This kind of software exception (interrupt) processing is a service provided by most operating systems. The communication unit 23 or 24 is a processing procedure executed by a processing branch when a data string from another process is input to the resource (communication socket) of the operating system secured for communication. Data strings transferred by communication between IPPs are classified into the following two types. (1) A data string of an intermediate language description that is stored in the processing queue of the interpreter and is sequentially fetched and executed.

【0090】(2)受信した後、直ちに評価されるデー
タ列。
(2) A data string that is evaluated immediately after reception.

【0091】上記いずれのデータ列も、図5に示した形
式のデータ構造によって伝達される。データ列501
は、プロセッサ番号、プロセス番号によって一意に決定
される値を識別子502に持ち、終了符号503によっ
て終端が示される。また判別フラグ504の値が、0で
あれば、そのデータ列中のステートメント508は直ち
に評価される。一方、判別フラグ504の値が16進数
でFFであれば、データ列は待ち行列にエンキューされ
る。
Each of the above data strings is transmitted by the data structure of the format shown in FIG. Data string 501
Has a value uniquely determined by the processor number and the process number in the identifier 502, and an end code 503 indicates the end. If the value of the discrimination flag 504 is 0, the statement 508 in the data string is evaluated immediately. On the other hand, if the value of the determination flag 504 is hexadecimal FF, the data string is enqueued in the queue.

【0092】この時、待ち行列に格納されるデータ列
は、全て逐次実行可能な中間言語命令であるが、ほとん
どの場合、スタック初期化命令およびその引数からなる
スタック初期化コード505、共有変数表初期化命令お
よびその引数からなる共有変数表初期化コード506、
その他の実行可能なオブジェクト507の順で形成され
る。505、506、507はいずれかの要素が省略さ
れても良い。スタック初期化コード505は、より詳細
にはスタック初期化命令511、フィールド長512、
可変フィールド513で構成される。可変フィールドの
内容は、実際のスタックのデータ列が含まれる。また、
共有変数表初期化コード506、オブジェクト507の
いずれも、データ列の形式はスタック初期化コード50
5と同様である。
At this time, all the data strings stored in the queue are intermediate language instructions that can be sequentially executed, but in most cases, the stack initialization code 505 consisting of the stack initialization instruction and its arguments, the shared variable table. A shared variable table initialization code 506 consisting of an initialization instruction and its arguments,
Other executable objects 507 are formed in this order. Any of 505, 506, and 507 may be omitted. More specifically, the stack initialization code 505 includes a stack initialization instruction 511, a field length 512,
It is composed of a variable field 513. The content of the variable field contains the actual stack data string. Also,
In both the shared variable table initialization code 506 and the object 507, the data string format is the stack initialization code 50.
The same as 5.

【0093】一方、直ちに評価されるステートメントと
しては、次の5種類が有る。
On the other hand, there are the following five types of statements that are evaluated immediately.

【0094】・コネクト命令 ・リリース命令 ・状態取得命令 ・データ書き換え命令 ・データ読み取り命令 コネクト命令は、要求側のプロセスがIPPとの接続を
確立する際に転送する命令であり、プロセッサ番号、プ
ロセス番号を引数として送られる。受付側IPPが、ア
イドル状態にあるか、あるいは新たな処理を受付可能な
状態で有る時、応答として正常終了のコードが返送され
る。また、これ以外の場合はエラーコードが返される。
プロセッサ番号としては、ネットワークを用いたマルチ
プロセッサシステムの場合、ネットワーク機構の用意す
るアドレスを使用し、その他の通信手段を用いる場合
は、システムバスに対するアドレス割り当てなど、プロ
セッサを一意に特定しうる値を用いる。
-Connect command-Release command-Status acquisition command-Data rewriting command-Data reading command The connect command is a command transferred when the requesting process establishes a connection with the IPP, and is a processor number and a process number. Is sent as an argument. When the receiving IPP is in the idle state or in a state where it can accept a new process, a normal termination code is returned as a response. In other cases, an error code is returned.
As the processor number, in the case of a multiprocessor system using a network, an address prepared by the network mechanism is used, and when other communication means is used, a value that can uniquely identify the processor, such as address assignment to the system bus, is used. To use.

【0095】リリース命令は、要求側のプロセスが、コ
ネクト命令によって確立したIPPとの接続を開放する
際に転送する命令であり、引数を持たない。
The release instruction is an instruction to be transferred when the requesting process releases the connection with the IPP established by the connect instruction, and has no argument.

【0096】状態取得命令は、要求側のプロセスが、I
PPの現在の処理状態を要求する際に転送する命令であ
り、引数を持たず、応答としてIPPの状態コードが返
送される。
The status acquisition instruction is issued by the requesting process by the I
This is an instruction to be transferred when requesting the current processing status of the PP, it has no argument, and the IPP status code is returned as a response.

【0097】データ書き換え命令509は、共有変数ア
クセス表30の値の変更を処理するために、要求側プロ
セスからIPPに転送される命令である。IPP側は、
現在接続中のプロセスからこの命令を受信した場合のみ
処理を行ない、それ以外はエラーコードを返送する。デ
ータ書き換え命令509は、共有変数アクセス表30で
の指標141(配列の添え字)と、実際の変数値510
を引数とする。
The data rewrite command 509 is a command transferred from the requesting process to the IPP in order to process the change of the value of the shared variable access table 30. On the IPP side,
Only if this command is received from the currently connected process, the processing is performed, otherwise an error code is returned. The data rewriting instruction 509 is based on the index 141 (array subscript) in the shared variable access table 30 and the actual variable value 510.
Is an argument.

【0098】データ読み取り命令は、IPPの現在のス
タックの内容を取り出す処理を要求する命令であり、I
PP側は、現在接続中のプロセスからこの命令を受信し
た場合のみ処理を行ない、それ以外はエラーコードを返
送する。命令は取得したいスタックの深さの値を引数と
してこの命令を転送する。処理上、この命令は一連のオ
ブジェクトに対する実行が終了した後でないと、意味を
持たないため、状態取得命令によって処理終了が確認さ
れた後、転送される。
The data read command is a command for requesting the process of fetching the contents of the current stack of the IPP.
The PP side performs processing only when it receives this command from the currently connected process, and otherwise returns an error code. The instruction transfers this instruction with the stack depth value to be acquired as an argument. In terms of processing, this instruction is meaningless only after the execution of a series of objects has been completed, so it is transferred after the completion of processing is confirmed by the status acquisition instruction.

【0099】直ちに評価される以上の命令を実装しない
場合、並列処理の効果を失わせる問題が発生する。IP
P内の共有変数領域の書き換えを行う際に、「データ書
き換え命令」が逐次処理されるとすると、実質的に逐次
処理系と変らない。この問題を解決するため、本実施例
は上記の命令をIPP処理系に実装した。
If the instructions that are not evaluated immediately are not implemented, a problem occurs that the effect of parallel processing is lost. IP
If the "data rewriting instruction" is sequentially processed when rewriting the shared variable area in P, it is substantially the same as the sequential processing system. In order to solve this problem, this embodiment implements the above instruction in the IPP processing system.

【0100】以上の構成によって、本実施例は並列実行
中の複数の処理ブロックが共有変数にアクセスを行なっ
た場合のデータの整合性を維持し、並列動作の保証を実
現した。この際、共有変数値の読み取りだけを行なう処
理ブロックは、局所メモリに配置された共有変数の複写
された値(共有変数アクセス表30)を参照し、書き換
え処理を行なうブロックだけが、実際の通信経路5を使
用したデータ転送を行なう。この結果、並列実行される
処理単位間での、通信を最小限に抑えることができた。
With the above configuration, the present embodiment maintains the data consistency when a plurality of processing blocks that are executing in parallel access a shared variable, and guarantees the parallel operation. At this time, the processing block that only reads the shared variable value refers to the copied value (shared variable access table 30) of the shared variable that is placed in the local memory, and only the block that performs the rewriting process does the actual communication. Data transfer using path 5 is performed. As a result, communication between processing units executed in parallel could be minimized.

【0101】[0101]

【発明の効果】以上の実施例の中で明らかにした様に、
本発明は、中間言語記述を生成する並列記述言語コンパ
イラと、中間言語インタープリタによって構成されるマ
ルチプロセッサ並列処理装置において、共有変数へのア
クセスを行なう複数の中間言語インタープリタの内、共
有変数の読み取り参照だけを行なう中間言語インタープ
リタについては、共有変数値の複写を局所メモリ領域に
予め配置し、共有変数値の複写を参照する構成とし、一
方、共有変数の書き換えを行なう中間言語インタープリ
タについては、注目する共有変数の実体の書き換えと同
時に、該共有変数の値の複写を保持する中間言語インタ
ープリタを検出し、該共有変数の値の複写も書き換える
通信を行なう構成とし、実行時の不必要なプロセス間通
信を排除し、結果としてプロセス間通信の頻度を制約し
たことで、並列実行時の共有変数アクセス処理時間削減
を実現し、かつ並列実行の動作保証を実現する効果を持
つ。
As clarified in the above embodiments,
The present invention, in a multiprocessor parallel processing device configured by a parallel description language compiler that generates an intermediate language description and an intermediate language interpreter, reads and references a shared variable among a plurality of intermediate language interpreters that access a shared variable. For an intermediate language interpreter that does only that, the copy of the shared variable value is placed in the local memory area in advance and the copy of the shared variable value is referred to. On the other hand, the intermediate language interpreter that rewrites the shared variable is noted. Simultaneously with the rewriting of the shared variable entity, an intermediate language interpreter holding a copy of the value of the shared variable is detected, and communication for rewriting the copy of the value of the shared variable is performed. Is eliminated, and as a result, the frequency of interprocess communication is restricted, And implementing shared variable access processing time reduction of time, and has the effect of realizing the operation guarantee of the parallel execution.

【0102】[0102]

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

【図1】 本発明の一実施例の構成図。FIG. 1 is a configuration diagram of an embodiment of the present invention.

【図2】 一実施例においての処理の概要の流れ図。FIG. 2 is a flowchart of an outline of processing according to an embodiment.

【図3】 並列記述言語の説明図。FIG. 3 is an explanatory diagram of a parallel description language.

【図4】 変数更新処理の説明図。FIG. 4 is an explanatory diagram of variable update processing.

【図5】 IPP間の通信に使用するデータ構造の説明
図。
FIG. 5 is an explanatory diagram of a data structure used for communication between IPPs.

【図6】 中間言語仕様の説明図。FIG. 6 is an explanatory diagram of an intermediate language specification.

【図7】 コンパイル結果の説明図。FIG. 7 is an explanatory diagram of a compilation result.

【図8】 スタック仕様状況の説明図。FIG. 8 is an explanatory diagram of a stack specification status.

【図9】 IPP命令述語処理の一部についての流れ
図。
FIG. 9 is a flowchart of a part of IPP instruction predicate processing.

【図10】 共有変数アクセス表の説明図。FIG. 10 is an explanatory diagram of a shared variable access table.

【図11】 ブロック管理表の説明図。FIG. 11 is an explanatory diagram of a block management table.

【図12】 ブロックを検出したときの構文解析処理の
流れ図。
FIG. 12 is a flowchart of a syntax analysis process when a block is detected.

【図13】 IPP側の共有変数アクセス表の説明図。FIG. 13 is an explanatory diagram of a shared variable access table on the IPP side.

【図14】 共有変数領域の説明図。FIG. 14 is an explanatory diagram of a shared variable area.

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

1…要求発生側コンピュータ 2…コンピュータ 3…コンピュータ 4…ソースプログラム 5…通信経路 6…コンパイラ 7…字句解析処理 8…構文解析処理 9…ブロック内名前表 10…ブロック別共有変数アクセス表 11…共有変数アクセス表 12…ブロック管理表 13…コード生成処理 14…中間言語により記述されたオブジェクトコード
(OBJと略) 15…中間言語のインタープリタとなるプロセス(IP
Pと略) 16…IPPの作業用メモリ 17…アクティベーションレコード(ARと略) 18…共有変数(非局所変数)領域 20…遅延実行のための一時記録領域(実行バッファと
略) 21…転送のための一時記録領域(転送バッファと略) 22…変数評価のための一時記録領域(変数バッファと
略) 23…要求受付のための通信手段 24…要求発生のための通信手段 25…IPP 26…IPP 27…IPP 28…ファイル読み取り処理 29…文字データ 30…共有変数アクセス表(IPP15に複写された) 31…ブロック管理表(IPP15に複写された) 40…アクセスポインタ 143…共有変数の格納位置 301…逐次処理言語による記述例のリスト 302…逐次処理言語による記述例のリスト 303…並列処理言語による記述例のリスト 401…処理ブロック 403…共有変数 404…共有変数の複写 501…IPP間の通信に用いるデータ列の一形式 804…スタック領域
1 ... Request generating computer 2 ... Computer 3 ... Computer 4 ... Source program 5 ... Communication path 6 ... Compiler 7 ... Lexical analysis processing 8 ... Syntax analysis processing 9 ... Block name table 10 ... Shared variable access table for each block 11 ... Shared Variable access table 12 ... Block management table 13 ... Code generation process 14 ... Object code described in intermediate language (abbreviated as OBJ) 15 ... Process that becomes an intermediate language interpreter (IP
16 ... IPP work memory 17 ... Activation record (abbreviated as AR) 18 ... Shared variable (non-local variable) area 20 ... Temporary recording area for delayed execution (abbreviated as execution buffer) 21 ... Transfer Recording area for transfer (abbreviated as transfer buffer) 22 ... Temporary recording area for variable evaluation (abbreviated as buffer) 23 ... Communication means for accepting request 24 ... Communication means for generating request 25 ... IPP 26 ... IPP 27 ... IPP 28 ... File reading process 29 ... Character data 30 ... Shared variable access table (copied to IPP15) 31 ... Block management table (copied to IPP15) 40 ... Access pointer 143 ... Shared variable storage position 301 ... List of description examples in serial processing language 302 ... List of description examples in serial processing language 303 ... For parallel processing language One type 804 ... stack area of the data sequence used for communication between the copying 501 ... IPP list 401 ... processing block 403 ... shared variables 404 ... shared variables described example that

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 仮想された機械語(以下中間言語)によ
り記述されたオブジェクトコードを生成するコンパイラ
(a)と、このコンパイラの出力した中間言語を実行す
るインタープリタ(b)を実装した複数個のプロセッサ
ユニットが、共有メモリまたは通信経路で接続されたマ
ルチプロセッサ処理装置であって、コンパイラについて
は、 a-1)ソースコード内で記述された処理手続きにおいて、
読み取り参照のみが行われる共有変数を検出する構文解
析処理と、 a-2)並列実行が行われる各処理手続き中で、読み取り参
照のみが行われる共有変数の情報を記録した表構造のデ
ータを、実行コードである中間言語記述からなるオブジ
ェクトファイルに付加する手段とを有し、インタープリ
タについては、 b-1)実行コードに付加された読み取り参照のみが行われ
る共有変数の情報を記録した表構造のデータを参照し、
処理単位の並列実行時に、この処理単位の配置されるプ
ロセッサのローカルメモリに前記共有変数の複写を配置
するデータ通信手段と、 b-2)並列実行される個々の処理単位について共有変数の
書き換えを行う場合、他プロセッサのローカルメモリに
配置された該共有変数の複写についても書き換える命令
語通信手段と、を有し読み取りの際は、ローカルメモリ
に置かれた共有変数の値を参照することで共有変数アク
セスに関するプロセッサ間の通信頻度を減少させる構成
とした事を特徴とするマルチプロセッサ処理装置。
1. A plurality of compilers (a) for generating an object code written in a virtual machine language (hereinafter, intermediate language) and an interpreter (b) for executing the intermediate language output by the compiler. Regarding the compiler, the processor unit is a multiprocessor processing device connected by a shared memory or a communication path, and a-1) In the processing procedure described in the source code,
Parsing processing that detects shared variables that are only read-referenced, and a-2) Table-structured data that records information on shared variables that are only read-referenced in each processing procedure that is executed in parallel. The interpreter has a means for adding to an object file consisting of an intermediate language description that is an execution code. B-1) A table structure that records the information of shared variables that are read and added only to the execution code Refer to the data,
Data communication means for arranging a copy of the shared variable in the local memory of the processor in which the processing unit is arranged, and b-2) Rewriting the shared variable for each processing unit to be executed in parallel. When the reading is performed, the instruction variable communication unit that rewrites the copy of the shared variable placed in the local memory of another processor is also provided, and when reading, the value is shared by referring to the value of the shared variable placed in the local memory. A multiprocessor processing device characterized in that the frequency of communication between processors regarding variable access is reduced.
JP4209207A 1992-08-05 1992-08-05 Multiprocessor processor Pending JPH0660047A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4209207A JPH0660047A (en) 1992-08-05 1992-08-05 Multiprocessor processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4209207A JPH0660047A (en) 1992-08-05 1992-08-05 Multiprocessor processor

Publications (1)

Publication Number Publication Date
JPH0660047A true JPH0660047A (en) 1994-03-04

Family

ID=16569132

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4209207A Pending JPH0660047A (en) 1992-08-05 1992-08-05 Multiprocessor processor

Country Status (1)

Country Link
JP (1) JPH0660047A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08161990A (en) * 1994-11-30 1996-06-21 Sony Chem Corp Protective element and its manufacture
JP2006154971A (en) * 2004-11-25 2006-06-15 Matsushita Electric Ind Co Ltd Program conversion device, program conversion executing device, program conversion method, and program conversion executing method
JP2013014039A (en) * 2011-07-01 2013-01-24 Canon Inc Image forming apparatus, data processing method, and program
JP2014010754A (en) * 2012-07-02 2014-01-20 Denso Corp Program development supporting device, and program development supporting tool

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08161990A (en) * 1994-11-30 1996-06-21 Sony Chem Corp Protective element and its manufacture
JP2006154971A (en) * 2004-11-25 2006-06-15 Matsushita Electric Ind Co Ltd Program conversion device, program conversion executing device, program conversion method, and program conversion executing method
JP2013014039A (en) * 2011-07-01 2013-01-24 Canon Inc Image forming apparatus, data processing method, and program
JP2014010754A (en) * 2012-07-02 2014-01-20 Denso Corp Program development supporting device, and program development supporting tool

Similar Documents

Publication Publication Date Title
US6226789B1 (en) Method and apparatus for data flow analysis
US6199095B1 (en) System and method for achieving object method transparency in a multi-code execution environment
US6535903B2 (en) Method and apparatus for maintaining translated routine stack in a binary translation environment
US6993754B2 (en) Annotations to executable images for improved dynamic optimization functions
US6502237B1 (en) Method and apparatus for performing binary translation method and apparatus for performing binary translation
US6634023B1 (en) Compile method, exception handling method and computer
US6131189A (en) System and method to efficiently represent aliases and indirect memory operations in static single assignment form during compilation
US5930509A (en) Method and apparatus for performing binary translation
JP4923240B2 (en) Program processing apparatus, parallel processing program, program processing method, parallel processing compiler, recording medium storing parallel processing compiler, and multiprocessor system
JP5851396B2 (en) Processing method
US5802373A (en) Method for providing a pipeline interpreter for a variable length instruction set
US6665865B1 (en) Equivalence class based synchronization optimization
Gunnerson et al. A Programmer’s Introduction to C# 2.0
US20020046230A1 (en) Method for scheduling thread execution on a limited number of operating system threads
JPH08115209A (en) System and method for creation of source code
JPH0432416B2 (en)
Theobald et al. Overview of the Threaded-C language
US6948170B2 (en) Computer and computer-readable storage medium for command interpretation
US8782514B1 (en) Parallel XML parsing using meta-DFAs
US7251594B2 (en) Execution time modification of instruction emulation parameters
EP1226496B1 (en) System and method supporting type checking of options
JPH0660047A (en) Multiprocessor processor
JPH08123699A (en) Parallel processing method, parallel processing system, and conversion tool for program for parallel processing
US7162718B1 (en) Language extension for light weight threading in a JVM
Tremblay et al. Threaded-C language reference manual (release 2.0)