JP2560491B2 - Parallelized procedure execution method - Google Patents

Parallelized procedure execution method

Info

Publication number
JP2560491B2
JP2560491B2 JP1259146A JP25914689A JP2560491B2 JP 2560491 B2 JP2560491 B2 JP 2560491B2 JP 1259146 A JP1259146 A JP 1259146A JP 25914689 A JP25914689 A JP 25914689A JP 2560491 B2 JP2560491 B2 JP 2560491B2
Authority
JP
Japan
Prior art keywords
procedure
object program
called
parallel object
parallel
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.)
Expired - Fee Related
Application number
JP1259146A
Other languages
Japanese (ja)
Other versions
JPH03119428A (en
Inventor
彰一 左近
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.)
NEC Corp
Original Assignee
Nippon Electric Co 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 Nippon Electric Co Ltd filed Critical Nippon Electric Co Ltd
Priority to JP1259146A priority Critical patent/JP2560491B2/en
Publication of JPH03119428A publication Critical patent/JPH03119428A/en
Application granted granted Critical
Publication of JP2560491B2 publication Critical patent/JP2560491B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

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

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は並列化手続き実行方式に関し、特にマルチプ
ロセッサシステムの並列処理プログラムにおける手続き
の呼出しに対する並列化手続き実行方式に関する。
Description: TECHNICAL FIELD The present invention relates to a parallelized procedure execution method, and more particularly to a parallelized procedure execution method for a procedure call in a parallel processing program of a multiprocessor system.

〔従来の技術〕[Conventional technology]

マルチプロセッサシステムの並列処理プログラムで手
続きの呼出しを行う場合に、呼出しを行う手続き内で、
すでに並列処理が行われているときには、呼出された手
続きでも並列処理を行おうとしても、プロセッサがすで
に使われてしまっているので、並列処理を実行できず、
呼出された手続きの並列目的プログラムを使用すれば、
呼出された手続きの通常の非並列目的プログラムを使用
するより、並列化のオーバーヘッドのために一層長い実
行時間がかかってしまう。
When calling a procedure in a parallel processing program of a multiprocessor system, within the calling procedure,
When parallel processing has already been performed, even if the called procedure tries to perform parallel processing, the processor has already been used, so parallel processing cannot be executed,
With a parallel object program of the called procedure,
It takes longer execution time due to the overhead of parallelization than using a normal non-parallel object program of the called procedure.

そこで、並列化された手続きからの手続きの呼出しに
は、呼出された手続きの通常の非並列目的プログラムを
呼出すことが望ましいこととなる。
Therefore, in order to call a procedure from a parallelized procedure, it is desirable to call a normal non-parallel object program of the called procedure.

しかし、従来の並列化手続き実行方式では、このよう
な場合に呼出される各手続きに対して、使用者が、並列
目的プログラムと非並列目的プログラムとのどちらを使
用するかを指定することを必要としている。
However, in the conventional parallelized procedure execution method, it is necessary for the user to specify for each procedure called in such a case whether to use a parallel object program or a non-parallel object program. I am trying.

〔発明が解決しようとする課題〕[Problems to be Solved by the Invention]

上述した従来の並列化手続き実行方式は、呼出される
各手続きに対して、使用者が、並列目的プログラムと非
並列目的プログラムとのどちらを使用するかを指定して
いるので、使用者に取って繁雑であり誤りを生じ易いと
いう欠点を有している。
In the conventional parallelized procedure execution method described above, the user specifies whether to use a parallel object program or a non-parallel object program for each called procedure. It has the drawback of being complicated and error-prone.

本発明の目的は、マルチプロセッサシステムの並列処
理プログラムで手続きの呼出しを行う場合に、呼出され
る各手続きに対する並列目的プログラムと非並列目的プ
ログラムとの適切な方を自動的に呼出することができる
並列化手続き実行方式を提供することにある。
An object of the present invention is to automatically call an appropriate one of a parallel object program and a non-parallel object program for each called procedure when a procedure is called by a parallel processing program of a multiprocessor system. It is to provide a parallelized procedure execution method.

〔課題を解決するための手段〕[Means for solving the problem]

第1の発明の並列化手続き実行方式は、 (A)マルチプロセッサシステムのソースプログラムを
サブルーチンや関数などの手続きごとに分割する手続き
分割手段、 (B)前記手続き分割手段で分割された各々の手続きの
中で、各プロセッサに振分けて並列に実行可能な部分で
ある並列化部を取出して、その他の部分を非並列化部と
する並列化部取出し手段、 (C)前記手続き分割手段で分割された全ての手続きご
とに、並列化部については各プロセッサに振分けて実行
するとともに、非並列化部については各プロセッサで同
一コードを実行する形態の並列目的プログラムを生成す
る並列目的プログラム生成手段、 (D)前記手続き分割手段で分割された全ての手続きご
とに、通常の非並列目的プログラムを生成する非並列目
的プログラム生成手段、 (E)前記並列目的プログラム生成手段で生成される並
列目的プログラムの中で、並列化部から他の手続きの読
出しを行うときには、呼出される手続きとして並列目的
プログラムを選択して呼出し、非並列化部から他の手続
きの呼出しを行うときには、呼出される手続きとして並
列目的プログラムを選択して呼出すように、前記並列目
的プログラム生成手段に並列目的プログラムを生成させ
る手続き静的選択手段、 をマルチプロセッサシステムに備えるとともに、 (F)前記並列目的プログラム生成手段で生成される並
列目的プログラムおよび前記非並列目的プログラム生成
手段で生成される非並列目的プログラムのそれぞれのロ
ーカルデータ領域中にフラグを設け、最初に実行される
手続きのフラグをオフにし、実行時の手続きの呼出しの
際に、並列目的プログラムから非並列目的プログラムの
呼出しに対しては、呼出された非並列目的プログラムの
フラグをオンにするとともに、その他の呼出しに対して
は、呼出された手続きのフラグの状態を呼出しを行った
手続きのフラグの状態にするフラグ処理手段、 (G)非並列目的プログラムの中で手続きの呼出しを行
う際に、呼出しを行う手続きのフラグがオンであれば、
呼出される手続きとして非並列目的プログラムを選択し
て呼出し、呼出しを行う手続きのフラグがオフであれ
ば、呼出される手続きとして並列目的プログラムを選択
して呼出す手続き動的選択手段、 を前記マルチプロセッサシステムに備えて構成されてい
る。
The parallelized procedure execution method of the first invention is (A) a procedure dividing means for dividing a source program of a multiprocessor system into procedures such as subroutines and functions, and (B) each procedure divided by the procedure dividing means. In the above, the parallelization part extraction means that distributes to each processor and takes out the parallelization part, which is a part that can be executed in parallel, and makes the other parts non-parallelization parts, (C) is divided by the procedure division means For each procedure, a parallel object program generating means for generating a parallel object program in a form in which the parallelizing section is distributed to each processor and executed, and the non-parallelizing section executes the same code in each processor. D) A non-parallel object program generating an ordinary non-parallel object program for every procedure divided by the procedure dividing means. (E) In the parallel object program generated by the parallel object program generating means, when another procedure is read from the parallelization unit, the parallel object program is selected and called as the procedure to be called, When calling another procedure from the non-parallelization unit, a procedure static selecting means for causing the parallel object program generating means to generate the parallel object program so that the parallel object program is selected and called as a procedure to be called, A multiprocessor system is provided, and (F) a flag is provided in each local data area of the parallel object program generated by the parallel object program generating means and the non-parallel object program generated by the non-parallel object program generating means. , Turn off the flag for the first procedure to be executed, and When a call is made from a parallel object program to a non-parallel object program, the flag of the called non-parallel object program is set to ON, and for other calls, the flag of the called procedure is changed. Flag processing means for setting the state to the state of the flag of the calling procedure, (G) when calling the procedure in the non-parallel object program, if the flag of the calling procedure is ON,
A multi-processor dynamic selection means for selecting and calling a non-parallel object program as a called procedure, and selecting and calling a parallel object program as a called procedure if the flag of the calling procedure is off It is configured for the system.

また、第2の発明のマルチプロセッサシステムの並列
化・手続き実行方法は、 (A)マルチプロセッサシステムのソースプログラムを
サブルーチンや関数などの手続きごとに分割し、 (B)分割された各々の前記手続きの中で、各プロセッ
サに振分けて並列に実行可能な部分である並列化部を取
出すとともに、その他の部分を非並列化部とし、 (C)分割された全ての前記手続きごとに、前記並列化
部については各プロセッサに振分けて実行するととも
に、前記非並列化部については各プロセッサで同一コー
ドを実行する形態の並列目的プログラムを生成し、 (D)分割された全ての前記手続きごとに、通常の非並
列目的プログラムも生成し、 (E)生成された実行時プログラム上で、前記並列目的
プログラムおよび前記非並列目的プログラムのそれぞれ
にフラグを設け、最初に実行される前記手続きのフラグ
をオフにし、 (F)前記並列目的プログラムの中で、前記並列化部か
ら他の前記手続きの呼出しを行うときには、呼出される
前記手続きとして前記非並列目的プログラムを選択して
呼出すとともに、呼出された前記非並列目的プログラム
のフラグをオンにし、前記非並列化部から他の前記手続
きの呼出しを行うときには、呼出される前記手続きとし
て前記並列目的プログラムを選択して呼出すとともに、
呼出された前記並列目的プログラムのフラグを呼出しを
行った前記手続きのフラグの状態にし、 (G)前記非並列目的プログラムの中で前記手続きの呼
出しを行うときには、呼出しを行う前記手続きのフラグ
がオンであれば、呼出される前記手続きとして前記非並
列目的プログラムを選択して呼出し、呼出しを行う前記
手続きのフラグがオフであれば、呼出される前記手続き
として前記並列目的プログラムを選択して呼出すととも
に、何れも呼出された前記手続きのフラグを呼出しを行
った前記手続きのフラグの状態にする、 ことにより構成されている。
Further, a parallelization / procedure execution method for a multiprocessor system according to a second aspect of the present invention is (A) a source program of the multiprocessor system is divided into procedures such as subroutines and functions, and (B) each of the divided procedures. Among them, the parallelization unit which is a part that can be distributed to each processor and executed in parallel is taken out, and the other part is a non-parallelization unit, and (C) the parallelization is performed for each of all the divided procedures. Parts are executed by each processor, and the non-parallelization part generates a parallel object program in which each processor executes the same code. (D) For each of the divided procedures, (E) The parallel object program and the non-parallel object program are generated on the generated runtime program. A flag is provided for each of the RAMs, the flag of the procedure to be executed first is turned off, and (F) is called when the parallelization unit calls another procedure in the parallel object program. When the non-parallel object program is selected and called as the procedure, a flag of the called non-parallel object program is turned on, and the non-parallelization unit calls another procedure, the procedure to be called While selecting and calling the parallel target program as
The flag of the called parallel object program is set to the flag state of the calling procedure, and (G) when the procedure is called in the non-parallel object program, the flag of the calling procedure is turned on. If so, the non-parallel object program is selected and called as the procedure to be called, and if the flag of the procedure to be called is off, the parallel object program is selected and called as the procedure to be called. In each case, the flag of the called procedure is set to the state of the flag of the called procedure.

さらに、第3の発明の並列化手続き実行方式は、 (A)マルチプロセッサシステムのソースプログラムを
サブルーチンや関数などの手続きごとに分割する手続き
分割手段、 (B)前記手続き分割手段で分割された全ての手続きご
とに、各プロセッサに振分けて並列に実行可能な部分で
ある並列化部を各プロセッサに振分けて実行するととも
に、並列に実行できない部分である非並列化部に対して
各プロセッサで同一コードを実行する形態の並列目的プ
ログラムを生成する並列目的プログラム生成手段、 (C)前記手続き分割手段で分割された全ての手続きご
とに、通常の非並列目的プログラムを生成する非並列目
的プログラム生成手段、 (D)前記並列目的プログラム生成手段で生成される並
列目的プログラムの中で並列化部から他の手続きの呼出
しを行うときには、呼出される手続きとして非並列目的
プログラムを選択して呼出し、非並列化部から他の手続
きの呼出しを行うときには、呼出される手続きとして並
列目的プログラムを選択して呼出すように、前記並列目
的プログラム生成手段に並列目的プログラムを生成させ
る手続き静的選択手段、 をマルチプロセッサシステムに備えるとともに、 (E)前記並列目的プログラム生成手段で生成される並
列目的プログラムおよび前記非並列目的プログラム生成
手段で生成される非並列目的プログラムのそれぞれにフ
ラグを設け、最初に実行される手続きのフラグをオフに
し、実行時の手続きの呼出しの際に、並列目的プログラ
ムから非並列目的プログラムの呼出しに対しては、呼出
された非並列目的プログラムのフラグをオンにするとと
もに、その他の呼出しに対しては、呼出された手続きの
フラグの状態を呼出しを行った手続きのフラグの状態に
するフラグ処理手段、 (F)非並列目的プログラムの中で手続きの呼出しを行
う際に、呼出しを行う手続きのフラグがオンであれば、
呼出される手続きとして非並列目的プログラムを選択し
て呼出し、呼出しを行う手続きのフラグがオフであれ
ば、呼出される手続きとして並列目的プログラムを選択
して呼出す手続き動的選択手段、 を前記マルチプロセッサシステムに備えて構成されてい
る。
Furthermore, the parallelized procedure execution system of the third invention is (A) a procedure dividing unit that divides a source program of a multiprocessor system for each procedure such as a subroutine and a function, and (B) all the procedure dividing units. For each procedure, the parallelization part, which is the part that can be distributed to each processor and executed in parallel, is distributed to each processor and executed, and the same code is used in each processor for the non-parallelization part, which cannot be executed in parallel. Parallel object program generation means for generating a parallel object program in a form of executing (C) non-parallel object program generation means for generating a normal non-parallel object program for every procedure divided by the procedure dividing means, (D) Another procedure from the parallelization unit in the parallel object program generated by the parallel object program generating means The non-parallel object program is selected as the procedure to be called, and the parallel object program is selected as the procedure to be called when the other procedure is called from the non-parallelization unit. And a procedure static selecting means for causing the parallel object program generating means to generate a parallel object program, and (E) a parallel object program and the non-parallel object generated by the parallel object program generating means. A flag is provided for each of the non-parallel object programs generated by the program generating means, the flag of the procedure to be executed first is turned off, and the non-parallel object program is called from the parallel object program when the procedure is called at the time of execution. Turn on the flag of the called non-parallel object program for For other calls, flag processing means for changing the flag state of the called procedure to the flag state of the calling procedure (F) Calling the procedure in the non-parallel object program If the flag of the procedure to be called is on,
A multi-processor dynamic selection means for selecting and calling a non-parallel object program as a called procedure, and selecting and calling a parallel object program as a called procedure if the flag of the calling procedure is off It is configured for the system.

〔実施例〕〔Example〕

次に、第1の発明の実施例について図面を参照して説
明する。
Next, an embodiment of the first invention will be described with reference to the drawings.

第1図は第1の発明の並列化手続き実行方式の一実施
例を示すブロック図である。
FIG. 1 is a block diagram showing an embodiment of a parallelization procedure execution system of the first invention.

第1図に示すように、マルチプロセッサシステムのソ
ースプログラム1は、コンパイラ2に入力されている。
そして、コンパイラ2中の手続き分割手段21は、ソース
プログラム1をサブルーチンや関数などの手続きごとに
分割している。
As shown in FIG. 1, the source program 1 of the multiprocessor system is input to the compiler 2.
Then, the procedure dividing means 21 in the compiler 2 divides the source program 1 into procedures such as subroutines and functions.

また、コンパイラ2中の並列化部取出し手段22は、手
続き分割手段21で分割された各々の手続きの中で、各プ
ロセッサに振分けて並列に実行可能な部分である並列化
部を、自動的にまたは使用者の指定により取出して、そ
の他の部分を非並列化部としている。
In addition, the parallelization part extraction means 22 in the compiler 2 automatically determines the parallelization part which is a part that can be distributed to each processor and executed in parallel in each procedure divided by the procedure division means 21. Alternatively, it is taken out by the user's designation, and the other part is made the non-parallelization part.

そこで、コンパイラ2中の並列目的プログラム生成手
段23は、手続き分割手段21で分割された全ての手続きご
とに、並列化部については各プロセッサに振分けて実行
するとともに、非並列化部については各プロセッサで同
一コードを実行する形態の並列目的プログラムを生成し
ている。
Therefore, the parallel object program generating means 23 in the compiler 2 distributes and executes the parallelizing section to each processor for each procedure divided by the procedure dividing section 21, and executes the non-parallelizing section by each processor. Generates a parallel object program that executes the same code.

また、コンパイラ2中の非並列目的プログラム生成手
段24は、手続き分割手段21で分割された全ての手続きご
とに、通常の非並列目的プログラムを生成している。
Further, the non-parallel object program generation means 24 in the compiler 2 generates a normal non-parallel object program for every procedure divided by the procedure division means 21.

さらに、並列目的プログラム生成手段23内の手続き静
的選択手段231は、並列目的プログラム生成手段23で生
成される並列目的プログラムの中で、並列化部から他の
手続きの呼出しを行うときには、呼出される手続きとし
て非並列目的プログラムを選択して呼出し、非並列化部
から他の手続きの呼出しを行うときには、呼出される手
続きとして並列目的プログラムを選択して呼出すよう
に、並列目的プログラム生成手段23に並列目的プログラ
ムを生成させている。
Further, the procedure static selection means 231 in the parallel object program generation means 23 is called when the parallelization part of the parallel object program generated by the parallel object program generation means 23 calls another procedure. When the non-parallel object program is selected and called as the procedure to be called and another procedure is called from the non-parallelization unit, the parallel object program generation means 23 is configured to select and call the parallel object program as the called procedure. Generating a parallel object program.

他方、コンパイラ2に生成された実行時プログラム3
は、並列目的プログラム領域32に並列目的プログラム生
成手段23で生成される各々の並列目的プログラム、およ
び非並列目的プログラム領域33に非並列目的プログラム
生成手段24で生成される各々の非並列目的プログラムを
有している。
On the other hand, the runtime program 3 generated by the compiler 2
Is a parallel object program area 32 in which each parallel object program generated by the parallel object program generation means 23, and a non-parallel object program area 33 in which each non-parallel object program generated by the non-parallel object program generation means 24 Have

そして、実行時プログラム3中のフラグ処理手段34
は、各々の並列目的プログラムおよび各々の非並列目的
プログラムに対して、フラグ領域31中にそれぞれのフラ
グを設け、最初に実行される手続きのフラグをオフに
し、実行時の手続きの呼出しの際に、並列目的プログラ
ムから非並列目的プログラムの呼出しに対しては、呼出
された非並列目的プログラムのフラグをオンにするとと
もに、その他の呼出しに対しては、呼出された手続きの
フラグの状態を呼出しを行った手続きのフラグの状態に
している。
Then, the flag processing means 34 in the runtime program 3
Provides each flag in the flag area 31 for each parallel object program and each non-parallel object program, turns off the flag of the procedure to be executed first, and calls the procedure at the time of execution. , When a parallel object program calls a non-parallel object program, the flag of the called non-parallel object program is turned on, and for other calls, the state of the called procedure flag is called. The state of the flag of the performed procedure is set.

また、実行時プログラム3の手続き動的選択手段35
は、非並列目的プログラムの中で手続きの呼出しを行う
際に、呼出しを行う手続きのフラグがオンであれば、呼
出される手続きとして非並列目的プログラムを選択して
呼出し、呼出しを行う手続きのフラグがオフであれば、
呼出される手続きとして並列目的プログラムを選択して
呼出している。
Also, the procedure dynamic selection means 35 of the runtime program 3
Is a flag for the procedure to call when the procedure is called in the non-parallel object program, if the flag of the procedure to be called is on, the non-parallel object program is selected and called as the procedure to be called. Is off,
A parallel object program is selected and called as the procedure to be called.

第2図は第1の発明の並列化手続き実行方式の動作の
一例を示す動作説明図である。
FIG. 2 is an operation explanatory view showing an example of the operation of the parallelization procedure execution system of the first invention.

マルチプロセッサシステムの並列処理プログラムが動
作を開始すると、第2図に示すように、まず、非並列の
手続きに対する非並列目的プログラムAがフラグをオフ
で動作を開始する。そして、非並列目的プログラムAに
手続きの呼出しがあれば、非並列目的プログラムAは、
自己のフラグがオフなので、呼出すべき手続きに対する
並列目的プログラムB1を呼出す。
When the parallel processing program of the multiprocessor system starts its operation, as shown in FIG. 2, first, the non-parallel object program A for the non-parallel procedure starts its operation with the flag off. If the non-parallel object program A has a procedure call, the non-parallel object program A
Since the own flag is off, the parallel object program B1 for the procedure to be called is called.

次に、並列目的プログラムB1の非並列化部を実行中に
手続きの呼出しがあれば、非並列化部でありフラグがオ
フなので、呼出すべき手続きに対する並列目的プログラ
ムC1をフラグがオフの状態にして呼出す。また、並列目
的プログラムB1の並列化部を実行中に手続きの呼出しが
あれば、並列化部でありフラグがオフなので、呼出すべ
き手続きに対する非並列目的プログラムC2をフラグがオ
ンの状態にして呼出す。
Next, if a procedure is called during execution of the non-parallelization part of the parallel object program B1, the parallel target program C1 for the procedure to be called is turned off because it is the non-parallelization part and the flag is off. Call. If a procedure is called during execution of the parallelization part of the parallel object program B1, the non-parallel object program C2 corresponding to the procedure to be called is called with the flag turned on because it is the parallelization part and the flag is off.

さらに、非並列目的プログラムC2を実行中に手続きの
呼出しがあれば、フラグがオンなので、呼出すべき手続
きに対する非並列目的プログラムD2をフラグがオンの状
態にして呼出す。
Furthermore, if there is a procedure call while the non-parallel object program C2 is being executed, the flag is on, so the non-parallel object program D2 for the procedure to be called is called with the flag on.

このようにして、マルチプロセッサシステムの並列処
理プログラムは、次々に動作を行っている。
In this way, the parallel processing programs of the multiprocessor system are operating one after another.

次に、第2の発明の実施例について図面を参照して説
明する。
Next, an embodiment of the second invention will be described with reference to the drawings.

第3図は第2の発明の並列化手続き実行方式の一実施
例を示す流れ図である。
FIG. 3 is a flow chart showing an embodiment of the parallelization procedure execution system of the second invention.

第2の発明の実施例では、第3図に示すように、ま
ず、ステップS1で、コンパイラは、マルチプロセッサシ
ステムのソースプログラムをサブルーチンや関数などの
手続きごとに分割する。
In the embodiment of the second invention, as shown in FIG. 3, first, in step S1, the compiler divides the source program of the multiprocessor system into procedures such as subroutines and functions.

そして、ステップS2で、コンパイラは、分割された各
々の手続きの中で、各プロセッサに振分けて並列に実行
可能な部分である並列化部を取出すとともに、その他の
部分を非並列化部とする。
Then, in step S2, the compiler takes out a parallelization unit that is a part that can be distributed to each processor and executed in parallel in each of the divided procedures, and sets the other part as a non-parallelization unit.

そこで、ステップS3で、コンパイラは、分割された全
ての手続きごとに、並列化部については各プロセッサに
振分けて実行するとともに、非並列化部については各プ
ロセッサで非並列処理を行わせる形態の並列目的プログ
ラムを生成する。
Therefore, in step S3, the compiler distributes all the divided procedures to each processor for the parallelization unit and executes the parallelization unit in each processor for the non-parallelization unit. Generate the target program.

また、ステップS4で、コンパイラは、分割された全て
の手続きごとに、通常の非並列目的プログラムも生成す
る。
Further, in step S4, the compiler also generates a normal non-parallel object program for each of the divided procedures.

なお、ステップS5で、コンパイラは、生成される並列
目的プログラムの中で、並列化部から他の手続きの呼出
しを行うときには、呼出される手続きとして非並列目的
プログラムを選択して呼出し、非並列化部から他の手続
きの呼出しを行うときには、呼出される手続きとして並
列目的プログラムを選択して呼出すように、並列目的プ
ログラムを生成している。
In step S5, the compiler selects the non-parallel object program as the procedure to be called from the parallelization unit when calling another procedure in the generated parallel object program, and calls the non-parallelized program. When calling another procedure from the department, the parallel object program is generated so that the parallel object program is selected and called as the procedure to be called.

そして、ステップS6で、コンパイラに生成された実行
時プログラムは、並列目的プログラムおよび非並列目的
プログラムのそれぞれにフラグを設け、最初に実行され
る手続きのフラグをオフにし、実行時の手続きの呼出し
の際に、並列目的プログラムから非並列目的プログラム
の呼出しに対しては、呼出された非並列目的プログラム
のフラグをオンにするとともに、その他の呼出しに対し
ては、呼出された手続きのフラグの状態を呼出しを行っ
た手続きのフラグの状態にしている。
Then, in step S6, the runtime program generated by the compiler provides a flag to each of the parallel object program and the non-parallel object program, turns off the flag of the procedure to be executed first, and calls the procedure at runtime. At this time, when a parallel object program calls a non-parallel object program, the flag of the called non-parallel object program is turned on, and for other calls, the state of the called procedure flag is changed. The state of the flag of the calling procedure is set.

また、ステップS7で、実行時プログラムは、非並列目
的プログラムの中で手続きの呼出しを行う際に、呼出し
を行う手続きのフラグがオンであれば、呼出される手続
きとして非並列目的プログラムを選択して呼出し、呼出
しを行う手続きのフラグがオフであれば、呼出される手
続きとして並列目的プログラムを選択して呼出してい
る。
Further, in step S7, when the procedure is called in the non-parallel object program, if the flag of the calling procedure is ON, the runtime program selects the non-parallel object program as the procedure to be called. If the flag of the calling procedure is off, the parallel object program is selected and called as the procedure to be called.

次に、第3の発明の実施例について説明する。 Next, an embodiment of the third invention will be described.

第3の発明の実施例では、まず、コンパイラの手続き
分割手段は、マルチプロセッサシステムのソースプログ
ラムをサブルーチンや関数などの手続きごとに分割して
いる。
In the third embodiment of the invention, first, the procedure dividing means of the compiler divides the source program of the multiprocessor system into procedures such as subroutines and functions.

そして、コンパイラの並列目的プログラム生成手段
は、手続き分割手段で分割された全ての手続きごとに、
各プロセッサに振分けて並列に実行可能な部分である並
列化部を各プロセッサに振分けて実行するとともに、並
列に実行できない部分である非並列化部に対して各プロ
セッサで同一コードを実行する形態の並列目的プログラ
ムを生成している。
Then, the parallel object program generating means of the compiler, for each procedure divided by the procedure dividing means,
A parallelization unit that is a part that can be distributed to each processor and can be executed in parallel is allocated to each processor and executed, and the same code is executed by each processor to a non-parallelization part that is a part that cannot be executed in parallel. Generates a parallel object program.

また、コンパイラの非並列目的プログラム生成手段
は、手続き分割手段で分割された全ての手続きごとに、
通常の非並列目的プログラムを生成している。
In addition, the non-parallel object program generation means of the compiler, for each procedure divided by the procedure dividing means,
Generating a normal non-parallel object program.

なお、並列目的プログラム生成手段に含む手続き静的
選択手段は、並列目的プログラム生成手段で生成される
並列目的プログラムの中で並列化部から他の手続きの呼
出しを行うときには、呼出される手続きとして非並列目
的プログラムを選択して呼出し、非並列化部から他の手
続きの呼出しを行うときには、呼出される手続きとして
並列目的プログラムを選択して呼出すように、並列目的
プログラム生成手段に並列目的プログラムを生成させて
いる。
The procedure static selection means included in the parallel object program generation means does not call the procedure to be called when the parallelization part calls another procedure in the parallel object program generated by the parallel object program generation means. A parallel object program is generated in the parallel object program generation means so that the parallel object program is selected and called when the parallel object program is selected and called from the non-parallelization unit as the procedure to be called. I am letting you.

そこで、コンパイラに生成された実行時プログラムの
フラグ処理手段は、並列目的プログラム生成手段で生成
される並列目的プログラムおよび非並列目的プログラム
生成手段で生成される非並列目的プログラムのそれぞれ
にフラグを設け、最初に実行される手続きのフラグをオ
ンにして、実行時の手続きの呼出しの際に、並列目的プ
ログラムから非並列目的プログラムの呼出しに対して
は、呼出された非並列目的プログラムのフラグをオンに
するとともに、その他の呼出しに対しては、呼出された
手続きのフラグの状態を呼出しを行った手続きのフラグ
の状態にしている。
Therefore, the flag processing means of the runtime program generated by the compiler provides a flag to each of the parallel object program generated by the parallel object program generating means and the non-parallel object program generated by the non-parallel object program generating means, Turn on the flag of the procedure to be executed first, and turn on the flag of the called non-parallel object program for the call of the non-parallel object program from the parallel object program when the procedure is called at runtime. At the same time, for other calls, the flag state of the called procedure is set to the flag state of the calling procedure.

また、実行時プログラムの手続き動的選択手段は、非
並列目的プログラムの中で手続きの呼出しを行う際に、
呼出しを行う手続きのフラグがオンであれば、呼出され
る手続きとして非並列目的プログラムを選択して呼出
し、呼出しを行う手続きのフラグがオフであれば、呼出
される手続きとして並列目的プログラムを選択して呼出
している。
In addition, the procedure dynamic selection means of the runtime program, when calling the procedure in the non-parallel object program,
If the flag of the calling procedure is on, the non-parallel object program is selected and called as the procedure to be called, and if the flag of the calling procedure is off, the parallel object program is selected as the called procedure. Calling.

〔発明の効果〕〔The invention's effect〕

以上説明したように、本発明の並列化手続き実行方式
は、マルチプロセッサシステムの並列処理プログラムで
手続きの呼出しを行う場合に、呼出される各手続きに対
する並列目的プログラムと非並列目的プログラムとの適
切な方を自動的に呼出すことができるという効果を有し
ている。
As described above, the parallelized procedure execution method of the present invention, when a procedure is called by a parallel processing program of a multiprocessor system, is suitable for a parallel object program and a non-parallel object program for each called procedure. It has the effect that it can be called automatically.

この結果、本発明の並列化手続き実行方式は、マルチ
プロセッサシステムの並列処理プログラムに対する使用
者に取っての繁雑さを回避して誤りを防止するととも
に、マルチプロセッサシステムの処理能力を向上するこ
とができるという効果を有している。
As a result, the parallelized procedure execution method of the present invention avoids the complexity of the user for the parallel processing program of the multiprocessor system, prevents errors, and improves the processing capability of the multiprocessor system. It has the effect of being able to.

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

第1図は第1の発明の並列化手続き実行方式の一実施例
を示すブロック図、第2図は第1の発明の並列化手続き
実行方式の動作の一例を示す動作説明図、第3図は第2
の発明の並列化手続き実行方式の一実施例を示す流れ図
である。 1……ソースプログラム、2……コンパイラ、3……実
行時プログラム、21……手続き分割手段、22……並列化
部取出し手段、23……並列目的プログラム生成手段、23
1……手続き静的選択手段、24……非並列目的プログラ
ム生成手段、31……フラグ領域、32……並列目的プログ
ラム領域、33……非並列目的プログラム領域、33、34…
…フラグ処理手段、35……手続き動的選択手段、A,B2,C
2,D2……非並列目的プログラム、B1,C1,D1……並列目的
プログラム。
FIG. 1 is a block diagram showing an embodiment of a parallelization procedure execution system of the first invention, FIG. 2 is an operation explanatory diagram showing an example of operations of a parallelization procedure execution system of the first invention, and FIG. Is the second
Is a flowchart showing an embodiment of the parallelization procedure execution system of the invention of FIG. 1 ... Source program, 2 ... Compiler, 3 ... Run-time program, 21 ... Procedure dividing means, 22 ... Parallelizing part extracting means, 23 ... Parallel object program generating means, 23
1 ... Procedure static selection means, 24 ... Non-parallel object program generation means, 31 ... Flag area, 32 ... Parallel object program area, 33 ... Non-parallel object program area, 33, 34 ...
… Flag processing means, 35 …… Procedure dynamic selection means, A, B2, C
2, D2 …… Non-parallel object program, B1, C1, D1 …… Parallel object program.

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】(A)マルチプロセッサシステムのソース
プログラムをサブルーチンや関数などの手続きごとに分
割する手続き分割手段、 (B)前記手続き分割手段で分割された各々の手続きの
中で、各プロセッサに振分けて並列に実行可能な部分で
ある並列化部を取出して、その他の部分を非並列化部と
する並列化部取出し手段、 (C)前記手続き分割手段で分割された全ての手続きご
とに、並列化部については各プロセッサに振分けて実行
するとともに、非並列化部については各プロセッサで同
一コードを実行する形態の並列目的プログラムを生成す
る並列目的プログラム生成手段、 (D)前記手続き分割手段で分割された全ての手続きご
とに、通常の非並列目的プログラムを生成する非並列目
的プログラム生成手段、 (E)前記並列目的プログラム生成手段で生成される並
列目的プログラムの中で、並列化部から他の手続きの呼
出しを行うときには、呼出される手続きとして並列目的
プログラムを選択して呼出し、非並列化部から他の手続
きの呼出しを行うときには、呼出される手続きとして並
列目的プログラムを選択して呼出すように、前記並列目
的プログラム生成手段に並列目的プログラムを生成させ
る手続き静的選択手段、 をマルチプロセッサシステムに備えるとともに、 (F)前記並列目的プログラム生成手段で生成される並
列目的プログラムおよび前記非並列目的プログラム生成
手段で生成される非並列目的プログラムのそれぞれのロ
ーカルデータ領域中にフラグを設け、最初に実行される
手続きのフラグをオフにし、実行時の手続きの呼出しの
際に、並列目的プログラムから非並列目的プログラムの
呼出しに対しては、呼出された非並列目的プログラムの
フラグをオンにするとともに、その他の呼出しに対して
は、呼出された手続きのフラグの状態を呼出しを行った
手続きのフラグの状態にするフラグ処理手段、 (G)非並列目的プログラムの中で手続きの呼出しを行
う際に、呼出しを行う手続きのフラグがオンであれば、
呼出される手続きとして非並列目的プログラムを選択し
て呼出し、呼出しを行う手続きのフラグがオフであれ
ば、呼出される手続きとして並列目的プログラムを選択
して呼出す手続き動的選択手段、 を前記マルチプロセッサシステムに備えることを特徴と
する並列化手続き実行方式。
1. A procedure dividing means for dividing a source program of a multiprocessor system into procedures such as subroutines and functions, and (B) each procedure among the procedures divided by the procedure dividing means. A parallelization part extraction means that extracts a parallelization part that is a part that can be distributed and executed in parallel, and uses the other part as a non-parallelization part, (C) for each procedure divided by the procedure division means, A parallel object program generating means for generating a parallel object program in a form in which the parallelizing part is distributed to each processor and executed, and the non-parallelizing part executes the same code in each processor, (D) The procedure dividing means Non-parallel object program generating means for generating a normal non-parallel object program for each of all divided procedures, (E) the parallel program In the parallel object program generated by the dynamic program generating means, when the parallelizing part calls another procedure, the parallel object program is selected and called as the procedure to be called, and the non-parallelizing part calls another procedure. When a call is made, a multiprocessor system is provided with a procedure static selection means for causing the parallel object program generation means to generate a parallel object program so that the parallel object program is selected and called as a procedure to be called. F) A flag is provided in each of the local data areas of the parallel object program generated by the parallel object program generating means and the non-parallel object program generated by the non-parallel object program generating means, and the procedure to be executed first is set. Turn off the flag and use the parallel purpose when calling the procedure at runtime. If the program calls the non-parallel object program from the program, the flag of the called non-parallel object program is turned on, and for other calls, the state of the flag of the called procedure is called. (G) When a procedure is called in a non-parallel object program, if the flag of the procedure to be called is ON,
A multi-processor dynamic selection means for selecting and calling a non-parallel object program as a called procedure, and selecting and calling a parallel object program as a called procedure if the flag of the calling procedure is off A parallelized procedure execution method characterized by being provided in a system.
【請求項2】(A)マルチプロセッサシステムのソース
プログラムをサブルーチンや関数などの手続きごとに分
割し、 (B)分割された各々の前記手続きの中で、各プロセッ
サに振分けて並列に実行可能な部分である並列化部を取
出すとともに、その他の部分を非並列化部とし、 (C)分割された全ての前記手続きごとに、前記並列化
部については各プロセッサに振分けて実行するととも
に、前記非並列化部については各プロセッサで同一コー
ドを実行する形態の並列目的プログラムを生成し、 (D)分割された全ての前記手続きごとに、通常の非並
列目的プログラムも生成し、 (E)生成された実行時プログラム上で、前記並列目的
プログラムおよび前記非並列目的プログラムのそれぞれ
にフラグを設け、最初に実行される前記手続きのフラグ
をオフにし、 (F)前記並列目的プログラムの中で、前記並列化部か
ら他の前記手続きの呼出しを行うときには、呼出される
前記手続きとして前記非並列目的プログラムを選択して
呼出すとともに、呼出された前記非並列目的プログラム
のフラグをオンにし、前記非並列化部から他の前記手続
きの呼出しを行うときには、呼出される前記手続きとし
て前記並列目的プログラムを選択して呼出すとともに、
呼出された前記並列目的プログラムのフラグを呼出しを
行った前記手続きのフラグの状態にし、 (G)前記非並列目的プログラムの中で前記手続きの呼
出しを行うときには、呼出しを行う前記手続きのフラグ
がオンであれば、呼出される前記手続きとして前記非並
列目的プログラムを選択して呼出し、呼出しを行う前記
手続きのフラグがオフであれば、呼出される前記手続き
として前記並列目的プログラムを選択して呼出すととも
に、何れも呼出された前記手続きのフラグを呼出しを行
った前記手続きのフラグの状態にする、 ことを特徴とするマルチプロセッサシステムの並列化手
続き実行方法。
2. A source program of a multiprocessor system is divided into procedures such as subroutines and functions, and (B) each of the divided procedures can be distributed to respective processors and executed in parallel. While taking out the parallelization part which is a part and making the other part a non-parallelization part, (C) the parallelization part is distributed to each processor and executed for each of the divided procedures, and For the parallelization unit, a parallel object program in a form in which each processor executes the same code is generated, (D) A normal non-parallel object program is also generated for each of the divided procedures, and (E) is generated. On the run-time program, a flag is provided for each of the parallel object program and the non-parallel object program, and the procedure of the first executed (F) In the parallel object program, when the other parallel procedure is called from the parallel object program, the non-parallel object program is selected and called as the procedure to be called, and is called. When the flag of the non-parallel object program is turned on, and when the other parallel procedure is called from the non-parallelization unit, the parallel target program is selected and called as the procedure to be called,
The flag of the called parallel object program is set to the state of the flag of the procedure that has called, and (G) when the procedure is called in the non-parallel object program, the flag of the procedure that makes the call is turned on. If so, the non-parallel object program is selected and called as the procedure to be called, and if the flag of the procedure to be called is off, the parallel object program is selected and called as the procedure to be called. A parallelization procedure execution method for a multiprocessor system, characterized in that the flag of the procedure that has been called is set to the state of the flag of the procedure that has called.
【請求項3】(A)マルチプロセッサシステムのソース
プログラムをサブルーチンや関数などの手続きごとに分
割する手続き分割手段、 (B)前記手続き分割手段で分割された全ての手続きご
とに、各プロセッサに振分けて並列に実行可能な部分で
ある並列化部を各プロセッサに振分けて実行するととも
に、並列に実行できない部分である非並列化部に対して
各プロセッサで同一コードを実行する形態の並列目的プ
ログラムを生成する並列目的プログラム生成手段、 (C)前記手続き分割手段で分割された全ての手続きご
とに、通常の非並列目的プログラムを生成する非並列目
的プログラム生成手段、 (D)前記並列目的プログラム生成手段で生成される並
列目的プログラムの中で並列化部から他の手続きの呼出
しを行うときには、呼出される手続きとして非並列目的
プログラムを選択して呼出し、非並列化部から他の手続
きの呼出しを行うときには、呼出される手続きとして並
列目的プログラムを選択して呼出すように、前記並列目
的プログラム生成手段に並列目的プログラムを生成させ
る手続き静的選択手段、 をマルチプロセッサシステムに備えるとともに、 (E)前記並列目的プログラム生成手段で生成される並
列目的プログラムおよび前記非並列目的プログラム生成
手段で生成される非並列目的プログラムのそれぞれにフ
ラグを設け、最初に実行される手続きのフラグをオフに
し、実行時の手続きの呼出しの際に、並列目的プログラ
ムから非並列目的プログラムの呼出しに対しては、呼出
された非並列目的プログラムのフラグをオンにするとと
もに、その他の呼出しに対しては、呼出された手続きの
フラグの状態を呼出しを行った手続きのフラグの状態に
するフラグ処理手段、 (F)非並列目的プログラムの中で手続きの呼出しを行
う際に、呼出しを行う手続きのフラグがオンであれば、
呼出される手続きとして非並列目的プログラムを選択し
て呼出し、呼出しを行う手続きのフラグがオフであれ
ば、呼出される手続きとして並列目的プログラムを選択
して呼出す手続き動的選択手段、 を前記マルチプロセッサシステムに備えることを特徴と
する並列化手続き実行方式。
3. A procedure dividing means for dividing a source program of a multiprocessor system into procedures such as subroutines and functions, and (B) distributing to each processor for every procedure divided by the procedure dividing means. A parallel object program that distributes and executes the parallelization part that is a part that can be executed in parallel to each processor, and executes the same code in each processor for the non-parallelization part that is a part that cannot be executed in parallel. (C) non-parallel object program generating means for generating a normal non-parallel object program for every procedure divided by the procedure dividing means, and (D) the parallel object program generating means. When calling other procedures from the parallelization part in the parallel object program generated by When the non-parallel object program is selected and called as the procedure to be called and another procedure is called from the non-parallelization unit, the parallel object program generation means is configured to select and call the parallel object program as the called procedure. A multiprocessor system is provided with a procedure static selection means for generating a parallel object program, and (E) a parallel object program generated by the parallel object program generating means and a non-parallel object generated by the non-parallel object program generating means. Set a flag for each of the target programs, turn off the flag of the procedure to be executed first, and call the non-parallel target program from the parallel target program when the procedure is called at runtime. Turns on the parallel object program flag and makes it available to other calls. A flag processing means for changing the flag state of the called procedure to the flag state of the calling procedure; (F) the procedure to be called when the procedure is called in the non-parallel object program. If the flag is on,
A multi-processor dynamic selection means for selecting and calling a non-parallel object program as a called procedure, and selecting and calling a parallel object program as a called procedure if the flag of the calling procedure is off A parallelized procedure execution method characterized by being provided in a system.
JP1259146A 1989-10-03 1989-10-03 Parallelized procedure execution method Expired - Fee Related JP2560491B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1259146A JP2560491B2 (en) 1989-10-03 1989-10-03 Parallelized procedure execution method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1259146A JP2560491B2 (en) 1989-10-03 1989-10-03 Parallelized procedure execution method

Publications (2)

Publication Number Publication Date
JPH03119428A JPH03119428A (en) 1991-05-21
JP2560491B2 true JP2560491B2 (en) 1996-12-04

Family

ID=17329974

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1259146A Expired - Fee Related JP2560491B2 (en) 1989-10-03 1989-10-03 Parallelized procedure execution method

Country Status (1)

Country Link
JP (1) JP2560491B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5119590B2 (en) * 2005-11-10 2013-01-16 富士通セミコンダクター株式会社 Task distribution program and task distribution device for processor device having multiprocessor
GB0911099D0 (en) * 2009-06-26 2009-08-12 Codeplay Software Ltd Processing method

Also Published As

Publication number Publication date
JPH03119428A (en) 1991-05-21

Similar Documents

Publication Publication Date Title
US4949255A (en) Message interface and method for recursive calling between interpretive and compiled computer processes
US5524247A (en) System for scheduling programming units to a resource based on status variables indicating a lock or lock-wait state thereof
JPH02188833A (en) Interface for computer system
JP2582992B2 (en) Data processing system including general-purpose control interface
JPH09502558A (en) Method and system for protecting shared code and data in a multitasking operating system
JP2560491B2 (en) Parallelized procedure execution method
JP2576659B2 (en) Task common area allocation method
JPH05204875A (en) Scheduling system for thread
Olsson et al. A Language for Parallel and Distributed Programming
JPH0452491B2 (en)
JPH0743652B2 (en) Parallel execution program translation processing method
JPH0991258A (en) Hierarchical parallel compiler
JP3239963B2 (en) Multi-processor computer system
JP2790472B2 (en) Multiple conversation processing control method
JPH08272757A (en) Multiprocessor system and program starting method
JP2001184320A (en) Distributed executing device and recording medium
JPH05233307A (en) Plural process generating method
JPH03164835A (en) Compiling method for global variable processing in interpreter type language processing system
JPH04238539A (en) Operating system for program
Mellor et al. Adapting Modula-2 for distributed systems
JPH02206838A (en) Common sub routine linking method
JPH0343835A (en) Paralleled process system
JPH0764802A (en) Simulation device for real-time system
JPH03290732A (en) Program execution control system
Pierson Integrating parallel lisp with modern unix-based operating systems

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees