JPH03246746A - Parallel execution method, compiler, and parallel process schedule supporting tool - Google Patents

Parallel execution method, compiler, and parallel process schedule supporting tool

Info

Publication number
JPH03246746A
JPH03246746A JP2044828A JP4482890A JPH03246746A JP H03246746 A JPH03246746 A JP H03246746A JP 2044828 A JP2044828 A JP 2044828A JP 4482890 A JP4482890 A JP 4482890A JP H03246746 A JPH03246746 A JP H03246746A
Authority
JP
Japan
Prior art keywords
parallel
queue
execution
parallel process
execution cost
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
JP2044828A
Other languages
Japanese (ja)
Inventor
Giichi Tanaka
義一 田中
Takashi Hirooka
広岡 孝志
Yasuhiro Inagami
稲上 泰弘
Yoshiko Tamaoki
玉置 由子
Katsuyoshi Kitai
北井 克佳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2044828A priority Critical patent/JPH03246746A/en
Publication of JPH03246746A publication Critical patent/JPH03246746A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To efficiently attain the minimization of execution time by applying such control that a process can be taken out from a queue in sequence of higher execution cost in each parallel process in a series of parallel processes. CONSTITUTION:The execution cost can be obtained from an execution cost field in a parallel process execution information indicated to the parallel process execution information address field 72 of each process information table 70 by tracing the process information table 70 registered sequentially from a temporary queue leading pointer. Then, it is compared with the execution cost of the parallel process in a new process information table 70, and the new process information table 70 is inserted to a position just before and already registered process information table 70 in which the former is less than the latter first. In such a way, since parallel processing is started in sequence of higher execution cost in each parallel process in the scheduling of the parallel process, execution processing time can be shortened, and the parallel processing can be efficiently performed.

Description

【発明の詳細な説明】 [産業上の利用分野] 本発明は、並列実行方法およびコンパイラおよび並列プ
ロセススケジュール支援ツールに関し、さらに詳しくは
、密結合マルチプロセッサシステム上で効率的に並列プ
ロセスを実行させるための並列実行方法およびその並列
実行方法を支援するコンパイラおよび並列プロセススケ
ジュール支援ツールに関する。
[Detailed Description of the Invention] [Industrial Application Field] The present invention relates to a parallel execution method, a compiler, and a parallel process scheduling support tool, and more particularly, to a method for efficiently executing parallel processes on a tightly coupled multiprocessor system. The present invention relates to a parallel execution method, a compiler that supports the parallel execution method, and a parallel process schedule support tool.

[従来の技術] 並列プロセス(プログラムの並列化プロセス単位)をマ
ルチプロセッサシステムの各プロセッサに割り当てるた
めの従来技術としては、例えばrParallel P
rogramming and Compilers 
: KluwerAcademic Publishe
rs、 1988. pp97〜pp107Jにおいて
論じられている技術がある。それらは以下の如きもので
ある。
[Prior Art] As a conventional technology for allocating parallel processes (program parallelization process units) to each processor of a multiprocessor system, for example, rParallel P
programming and compilers
: KluwerAcademicPublish
rs, 1988. There are techniques discussed in pp97-pp107J. They are as follows.

(i)動的タスクスケジュール 並列プロセスか並列実行可能になった時点で、該並列プ
ロセスを並列実行可能キューに登録し、空いているプロ
セッサが前記キューを先入れ先出し方式で順に見て並列
プロセスを取り出し実行する方式である。
(i) Dynamic task schedule When a parallel process becomes parallel executable, it is registered in a parallel executable queue, and free processors sequentially look through the queue in a first-in, first-out manner and pick up and execute the parallel process. This is a method to do so.

(ii)ループスケジュール 並列プロセスがDOループ場合、ループ繰り返しに関し
て分割を行い、並列に処理を実行する方式である。
(ii) Loop schedule When the parallel process is a DO loop, this method divides the loop repetition and executes the process in parallel.

ループ繰り返し1回を1つの並列プロセスとするセルフ
スケジューリング(self scheduling)
と、ループ繰り返しn(固定)回を1つの並列プロセス
とするチャンクスケジューリング (chunk sc
heduling)と、残りループ回数に依存して簡単
な式で1つの並列プロセスを求めるガイデドセルフスケ
ジューリング(guided selfschedul
ing )とがある。
Self-scheduling in which one loop iteration is treated as one parallel process
and chunk scheduling (chunk sc
guided self-scheduling, which calculates one parallel process using a simple formula depending on the number of remaining loops.
ing).

前記論文では、並列処理時間の理論解析から、前記ガイ
デドセルフスケジューリングが、プロセッサの負荷バラ
ンスおよび分割オーバヘッドの両者を考慮して最も良い
と述べている。
The paper states that, based on a theoretical analysis of parallel processing time, the guided self-scheduling is the best in consideration of both processor load balance and division overhead.

[発明が解決しようとする課題] 上記従来技術では、以下のような問題点がある。[Problem to be solved by the invention] The above conventional technology has the following problems.

まず、上記従来技術(i)では、空いたプロセッサが、
キューに登録された先着順に並列プロセスを取り出して
実行するが、複数の並列プロセスの間で実行時間の差が
大きい場合、効率が悪くなる。
First, in the prior art (i) above, a vacant processor is
Parallel processes are taken out and executed on a first-come, first-served basis in the queue, but if there is a large difference in execution time between multiple parallel processes, efficiency will deteriorate.

次に、上記公知技術(ii)では、Doループ内に分岐
などがあってループ1回あたりの処理時間が条件により
異なる場合や、一般の並列プロセス(DOループ間並列
なと)に対しては有効でない。
Next, in the above-mentioned known technology (ii), when there is a branch in the Do loop and the processing time per loop varies depending on the conditions, or for general parallel processes (parallel between DO loops), Not valid.

そこで、本発明の目的は、上記の問題点を解決するため
、実行時間の最小化を効率良く達成することができ、一
般の並列プログラムに対して適用可能であり、簡単で且
つ実用的な並列実行方法およびそのためのコンパイラお
よび並列プロセススケジュール支援ツールを提供するこ
とにある。
SUMMARY OF THE INVENTION In order to solve the above-mentioned problems, it is an object of the present invention to implement a simple and practical parallel program that can efficiently minimize execution time, is applicable to general parallel programs, and The purpose of the present invention is to provide an execution method, a compiler for the same, and a parallel process scheduling support tool.

[課題を解決するための手段] 第1の観点では、本発明は、並列プロセスを含むオブジ
ェクトプログラムを、マルチプロセッサシステムで実行
する際、オブジェクトプログラム実行中に、並列プロセ
スが実行可能となった時点で、該並列プロセスのキュー
登録を行い、そのキューから並列プロセスを取り出して
各プロセッサに割り当てる並列実行方法において、一連
の並列プロセスについては各並列プロセスの実行コスト
の大きい順にキューから取り出されるように制御するこ
とを特徴とする並列実行方法を提供する。
[Means for Solving the Problems] According to a first aspect, the present invention provides an object program that when an object program including parallel processes is executed on a multiprocessor system, when the parallel process becomes executable during the execution of the object program. In the parallel execution method, the parallel processes are registered in a queue, and the parallel processes are taken out from the queue and assigned to each processor, and a series of parallel processes are controlled so that they are taken out from the queue in descending order of the execution cost of each parallel process. A parallel execution method is provided.

なお、「並列プロセスのキュー登録を行う」あるいは「
キューから並列プロセスを取り出す」とは、具体的には
「並列プロセスを表現するプロセス情報テーブルに対し
てキュー登録または取り出す操作を行う」ことを意味す
る。
In addition, "Register parallel process queue" or "
"Retrieving a parallel process from a queue" specifically means "performing a queue registration or retrieval operation on a process information table representing a parallel process."

第2の観点では、本発明は、ソースプログラムをオブジ
ェクトプログラムに変換するコンパイラにおいて、ソー
スプログラム中に並列プロセスの実行コスト値が指定し
てあるか否かを検出し、指定してある場合は、その指定
してある値をオブジェクトプログラム中の実行コストフ
ィールドに設定し、指定してない場合は、並列プロセス
部の演算量をコンパイラ内部の対応中間語の個数および
DOループ繰り返し回数に着目して計算したとき、その
計算結果が定数となるか否かを検出し、定数となる場合
は、オブジェクトプログラム中の実行コストフィールド
に計算結果を設定し、定数とならない場合は、オブジェ
クトプログラム中に、前記計算を行なうコードと、実行
コストフィールドに前記計算結果を設定するコードとを
生成することを特徴とするコンパイラを提供する。
In a second aspect, the present invention detects whether or not the execution cost value of a parallel process is specified in the source program in a compiler that converts a source program into an object program, and if it is specified, Set the specified value in the execution cost field in the object program, and if it is not specified, calculate the amount of computation in the parallel process section by focusing on the number of corresponding intermediate words in the compiler and the number of DO loop repetitions. When the calculation result is a constant, it is detected whether or not the calculation result is a constant. If it is a constant, the calculation result is set in the execution cost field in the object program, and if it is not a constant, the calculation result is The present invention provides a compiler characterized in that it generates a code for performing the calculation and a code for setting the calculation result in an execution cost field.

第3の観点では、本発明は、入力されたソースプログラ
ムを動的プロファイルオプションでコンパイルし、実行
を行い、前記ソースプログラムの各文に対応する機械語
命令数および実行回数を示す動的プロファイル情報を求
め、その動的プロファイル情報から各並列プロセスに属
する文の実行コストの総和を求め、その総和を実行コス
ト値情報として付加したソースプログラムを出力するこ
とを特徴とする並列プロセススケジュール支援ツールを
提供する。
In a third aspect, the present invention compiles and executes an input source program with a dynamic profile option, and provides dynamic profile information indicating the number of machine language instructions and the number of executions corresponding to each statement of the source program. Provided is a parallel process schedule support tool that is characterized in that it calculates the sum of execution costs of statements belonging to each parallel process from the dynamic profile information, and outputs a source program with the sum added as execution cost value information. do.

[作用] 本発明の並列実行方法では、一連の並列プロセスについ
ては、実行コストの大きい順にキューから取り出して、
各プロセッサに割り当て、実行する。
[Operation] In the parallel execution method of the present invention, a series of parallel processes are taken out of the queue in descending order of execution cost, and
Assigned to each processor and executed.

このため、キューへの登録の先着順(プログラムての並
列プロセスの出現順)にキューから取り出して、各プロ
セッサに割り当て、実行する場合に比へて、よりクリテ
ィカルパスに近い並列プロセスから実行を開始すること
になり、実行速度が大幅に向上する。
Therefore, compared to the case where the parallel processes are taken out of the queue on a first-come, first-served basis (in the order in which parallel processes appear in the program) and assigned to each processor for execution, execution starts from the parallel process that is closer to the critical path. This will greatly improve execution speed.

本発明のコンパイラでは、ソースプログラムに並列プロ
セスの実行コスト値の指定があればその値を実行コスト
としてオブジェクプログラム中に設定する。ソースプロ
グラムに実行コスト値の指定かなければ並列プロセスの
演算量を計算し、計算結果か定数になれば、その定数を
実行コストとしてオブジェクプログラム中の実行コスト
フィールドに設定する。計算結果か定数にならなければ
、計算を行なうコードと計算結果をオブジェクトプログ
ラム中の実行コストフィールドに格納するコートをオブ
ジェクプログラム中に生成する。
In the compiler of the present invention, if an execution cost value of a parallel process is specified in the source program, that value is set as the execution cost in the object program. If no execution cost value is specified in the source program, the amount of computation of the parallel process is calculated, and if the calculation result is a constant, that constant is set as the execution cost in the execution cost field in the object program. If the calculation result does not become a constant, a code for performing the calculation and a code for storing the calculation result in the execution cost field of the object program is generated in the object program.

このため、一般の並列プログラムに対して、上記並列実
行方法を適用できるようになる。
Therefore, the above parallel execution method can be applied to general parallel programs.

本発明の並列プロセススケジュール支援ツールでは、並
列プロセスの実行コスト値の指定のないソースプログラ
ムを人力すると、各並列プロセスの実行コストを計算し
て、並列プロセスの実行コスト値の指定の付いたソース
プログラムを出力する。
In the parallel process schedule support tool of the present invention, when a source program without a parallel process execution cost value is manually written, the execution cost of each parallel process is calculated, and the source program with a parallel process execution cost value specification is calculated. Output.

このため、一般の並列プログラムに対して、上記並列実
行方法を適用できるようになる。
Therefore, the above parallel execution method can be applied to general parallel programs.

[実施例] 以下、本発明の一実施例について図を参照しつつ説明す
る。なお、これにより本発明が限定されるものではない
[Example] Hereinafter, an example of the present invention will be described with reference to the drawings. Note that the present invention is not limited thereby.

第6図に、FORTRANで記述したソースプログラム
例を示す。
FIG. 6 shows an example of a source program written in FORTRAN.

このソースプログラムは、1重Doループのプログラム
部Aと、2重Doループのプログラム部Bと、サブルー
チンSUBをコールするプログラム部Cとからなってい
る。
This source program consists of a program section A of a single Do loop, a program section B of a double Do loop, and a program section C that calls a subroutine SUB.

並列化指示文rpoption paracaseJは
、前記プログラム部A、プログラム部B、プログラム部
Cがそれぞれ並列実行可能であることを指定するもので
ある。そこで、これらプログラム部A、プロダラム部B
、プログラム部Cをそれぞれ並列プロセスA、並列プロ
セスB、並列プロセスCと呼ぶ。
The parallelization directive rpoption paracaseJ specifies that each of the program section A, program section B, and program section C can be executed in parallel. Therefore, these program part A, program part B
, program portion C are called parallel process A, parallel process B, and parallel process C, respectively.

このように並列化指示文rpoption parac
aseJをソースプログラム中に記述して並列化可能性
をコンパイラに知らせることか出来るか、この外に、例
えば特開平1−108638号に開示されている技術に
よってコンパイラ自身で並列化可能性の判定を行なうこ
とも出来る。
In this way, the parallelization directive rpoption parac
Is it possible to write aseJ in the source program to notify the compiler of the parallelizability? In addition, is it possible to determine the parallelizability by the compiler itself using the technology disclosed in JP-A-1-108638? You can also do it.

コンパイラは、ソースプログラムから、第7図に示す如
きオブジェクトモジュール9を生成する。
The compiler generates an object module 9 as shown in FIG. 7 from the source program.

このオブジェクトモジュール9は、命令語領域10と、
データ領域20と、並列プロセス実行情報30とから成
っている。この構成のうち、並列プロセスオブジェクト
命令列14と並列プロセス情報30以外は、従来の逐次
実行方法における構成と同一である( rHITAc 
VO33最適化FORTRAN770FORT77 E
2.HAP FORTRAN77使用TR用J (80
90−3765−30) 476頁「オブジェクトモジ
ュールの構成」参照)。
This object module 9 includes a command word area 10,
It consists of a data area 20 and parallel process execution information 30. Of this configuration, the components other than the parallel process object instruction sequence 14 and parallel process information 30 are the same as the configuration in the conventional sequential execution method (rHITAc
VO33 optimization FORTRAN770FORT77 E
2. J for TR using HAP FORTRAN77 (80
90-3765-30) See page 476 "Object module configuration").

前記並列プロセスオブジェクト命令列14は、前記並列
プロセスA、並列プロセスB、並列プロセスCのオブジ
ェクト命令列をそれぞれ格納した部分である。詳細を第
9図に示す(但し、並列制御に関する部分の動作が分か
る程度にFORTRANライクに命令列を表現している
)。
The parallel process object instruction sequence 14 is a portion storing object instruction sequences of the parallel process A, parallel process B, and parallel process C, respectively. The details are shown in FIG. 9 (however, the instruction sequence is expressed in a FORTRAN-like manner to the extent that the operations related to parallel control can be understood).

前記並列プロセス実行情報30は、並列プロセスA、並
列プロセスB、並列プロセスCに対応して設けられてい
る。一つの並列プロセスの並列プロセス実行情報30は
、第8図に示すように、5個のフィールドを有している
The parallel process execution information 30 is provided corresponding to parallel process A, parallel process B, and parallel process C. The parallel process execution information 30 for one parallel process has five fields, as shown in FIG.

■並列プロセスのオブジェクト先頭アドレスフィールド ・・並列プロセスオブジェクト命令列14における対応
する並列プロセスの先頭アドレス■並列プロセスの実行
コストフィールド・・・対応する並列プロセスの実行コ
ストの推定値■並列プロセス内の外部参照アドレスフィ
ールド・並列プロセス内に外部手続きや外部関数の参照
がある場合、その各々に対する入口アドレス ■並列プロセスで必要なワーク領域の大きさ・・・並列
プロセスの実行のために必要な一時変数。
■Parallel process object start address field...The start address of the corresponding parallel process in the parallel process object instruction sequence 14 ■Parallel process execution cost field...Estimated execution cost of the corresponding parallel process ■External within the parallel process Reference address field - If there is a reference to an external procedure or external function within a parallel process, the entry address for each of them - Size of work area required for a parallel process: Temporary variables required for execution of a parallel process.

変数、配列のために必要なワーク領域の大きさ ■並列プロセスで必要なワーク領域で必要な初期値情報 ・・・例えばワーク領域の大きさが、1つのペースレジ
スタで届かない場合の、ワーク領域のベースアドレス値
など 説明の都合上、並列プロセスAの並列プロセス実行情報
30にはraJを付して、30aとする。
Size of work area required for variables and arrays ■ Initial value information required in the work area required for parallel processes... For example, work area size when the size of the work area cannot be reached by one pace register. For convenience of explanation, such as the base address value of , the parallel process execution information 30 of the parallel process A is appended with raJ and is referred to as 30a.

各フィールド31,32,33,34.35にもraJ
を付して、31a、32a、33a、34a、35aと
する。同様に、並列プロセスBに関しては「b」、並列
プロセスCに関してはrcJを付して区別する。一般的
に説明するときにはraJ  rbJ  rcJを付さ
ない。並列プロセス実行情報30a、並列プロセス実行
情報30b、並列プロセス実行情報30cの詳細を第1
0図に示す。
Each field 31, 32, 33, 34.35 also has raJ
31a, 32a, 33a, 34a, and 35a. Similarly, parallel process B is distinguished by "b", and parallel process C is distinguished by rcJ. When explaining generally, raJ rbJ rcJ will not be added. The details of the parallel process execution information 30a, the parallel process execution information 30b, and the parallel process execution information 30c are
Shown in Figure 0.

第10図において、並列プロセスのオブジェクト先頭ア
ドレスフィールド31a、31b、31Cには、並列プ
ロセスA、B、Cの先頭ラベルLABIO,LABII
、LAB12のアドレスが設定されている。実行コスト
フィールド32a。
In FIG. 10, object start address fields 31a, 31b, and 31C of parallel processes contain start labels LABIO, LABII of parallel processes A, B, and C.
, LAB12 addresses are set. Execution cost field 32a.

32bにはこの時点では未だ有効な値が設定されておら
ず、実行コストフィールド32cには値1010が設定
されている。並列プロセスA、Bには外部参照がないた
め並列プロセス内の外部参照アドレスフィールド33a
、33bには値が設定されておらず、並列プロセス内の
外部参照アドレスフィールド33cには“5UB2”の
アドレスか設定されている。また、並列プロセスで必要
なワーク領域の大きさフィールドフィールド34a。
32b has not yet been set to a valid value, and the execution cost field 32c has a value of 1010. Since parallel processes A and B have no external references, the external reference address field 33a in the parallel processes
, 33b are not set, and the external reference address field 33c in the parallel process is set to the address "5UB2". Also, a work area size field 34a required for parallel processes.

34b、34cには、各々20バイト、16バイト、1
2バイトが設定されている。
34b and 34c have 20 bytes, 16 bytes, and 1
2 bytes are set.

さて、第9図に示す並列プロセスオブジェクト命令列1
4において、コード261.コード264、コード26
6の部分は、並列プロセスA、並列プロセスB、並列プ
ロセスCを並列プロセス保持キューに登録するために実
行時ライブラリの一つである並列プロセス登録ライブラ
リ¥DI SPを呼び出す処理である。第1引数は、対
応する並列プロセスのプロセス実行情報の先頭アドレス
である。第2引数は、並列プロセス登録ライブラリ¥D
ISPが生成するプロセス情報テーブルのアドレスであ
る。第3引数は、対応する並列プロセスの登録が、一連
の並列プロセス(第9図の場合は、並列プロセスA、並
列プロセスB、並列プロセスC)の最初の場合はSとな
り、途中ならMとなり、最後ならEとなる。
Now, the parallel process object instruction sequence 1 shown in FIG.
4, code 261. code 264, code 26
Part 6 is a process for calling the parallel process registration library\DISP, which is one of the runtime libraries, in order to register parallel process A, parallel process B, and parallel process C in the parallel process holding queue. The first argument is the start address of the process execution information of the corresponding parallel process. The second argument is the parallel process registration library\D
This is the address of the process information table generated by the ISP. The third argument is S if the corresponding parallel process is registered at the beginning of a series of parallel processes (parallel process A, parallel process B, parallel process C in the case of Figure 9), and M if it is in the middle. If it is the last one, it will be E.

コンパイラが、このような並列プロセス登録ライブラリ
¥DISPを呼び出すコードを生成する方法は公知の技
術である。
The method by which the compiler generates a code that calls such a parallel process registration library \DISP is a known technique.

次に、第9図に示す並列プロセスオブジェクト命令列1
4において、コード260およびコード263の部分は
、並列プロセスAの実行コストを計算してその値を第1
0図に示す並列プロセスA実行情報30aの実行コスト
フィールド32aに格納する処理および並列プロセスB
の実行コストを計算してその値を第10図に示す並列プ
ロセスA実行情報30bの実行コストフィールド32b
に格納する処理である。
Next, parallel process object instruction string 1 shown in FIG.
4, code 260 and code 263 calculate the execution cost of parallel process A and set that value to the first
Processes stored in the execution cost field 32a of the parallel process A execution information 30a shown in FIG.
The execution cost field 32b of the parallel process A execution information 30b shown in FIG.
This is the process of storing the

コンパイラが、このような実行コストの計算と格納のた
めのコードを生成する方法を第4図を参照して説明する
The method by which the compiler generates code for calculating and storing such execution costs will be explained with reference to FIG.

ステップ501では、ソースプログラム中の全ての並列
プロセス(すなわち、第6図に示すソースプログラムの
プログラム部A、B、C)について、ステップ502〜
ステツプ510を行う。
In step 501, all parallel processes in the source program (that is, program parts A, B, and C of the source program shown in FIG. 6) are
Step 510 is performed.

ステップ502では、並列プロセスに対する実行コスト
指定がソースプログラム中にあるか判定する。実行コス
ト指定がある場合はステップ503に進み、ない場合は
ステップ504に進む。
In step 502, it is determined whether there is an execution cost specification for a parallel process in the source program. If there is an execution cost designation, the process advances to step 503; otherwise, the process advances to step 504.

実行コスト指定がある場合とは、ユーザがソースプログ
ラム中に記述した場合か、又は、後述する並列プロセス
スケジュール支援ツールを用いてソースプログラム中に
設定した場合である。
The execution cost specification is when the user has written it in the source program, or when it has been set in the source program using a parallel process schedule support tool, which will be described later.

実行コスト指定がない場合とは、第6図に示すソースプ
ログラムのような場合である。
The case where there is no execution cost designation is a case like the source program shown in FIG.

ステップ503では、実行コスト指定の値を並列プロセ
ス実行情報30の対応する実行コストフィールドに設定
する。
In step 503, the execution cost specification value is set in the corresponding execution cost field of the parallel process execution information 30.

一方、ステップ504では、ステップ505〜507の
処理を行いながら、並列プロセス内の全ての中間語をた
どる。
On the other hand, in step 504, all intermediate words in the parallel process are traced while performing the processing in steps 505 to 507.

ステップ505では、中間語の種類により、中間語の1
回実行当たりの単価Tcを設定する。例えば、中間語が
外部手続きや関数呼出しの場合はTc=1000.数学
関数の場合はT c = 100゜その他の場合はTc
=1を設定する。これは、外部手続きや関数呼出しは経
験的に実行コストか大きいことか多いから、比較的大き
い値に設定するものである。数学関数に関しては、関数
の種類ごとに実行コストを分けて設定するのが望ましい
In step 505, one of the intermediate words is selected depending on the type of the intermediate word.
Set the unit price Tc per execution. For example, if the intermediate word is an external procedure or function call, Tc=1000. For mathematical functions, T c = 100°; for other cases, T c
Set =1. This is set to a relatively large value because, empirically, external procedures and function calls often have high execution costs. Regarding mathematical functions, it is desirable to set execution costs separately for each type of function.

ステップ506では、中間語か属する並列プロセス内の
DOループループ長またはループ繰り返し数を示す変数
りを求める。DOループ処理にはループ長を示す変数を
保持する中間語が必す存在するため、変数りを求めるこ
とは容易である。
In step 506, a variable indicating the loop length or loop repetition number of the DO loop within the parallel process to which the intermediate word belongs is determined. Since DO loop processing always requires an intermediate word that holds a variable indicating the loop length, it is easy to obtain the variable.

第6図に示すソースプログラムのプログラム部Bのよう
に多重ループのときは、全ループ繰り返し数を求める。
When there are multiple loops as in program part B of the source program shown in FIG. 6, the total number of loop repetitions is determined.

この例では、N*Mである。In this example, it is N*M.

ステップ507では、中間語の単価Tcに前記変数りを
乗算して、この中間語についての実行コストを算出し、
これを並列プロセスの実行コストを計算するための変数
Tに加える。すなわち、TT+TcXLを算出する。
In step 507, the unit price Tc of the intermediate word is multiplied by the variable ri to calculate the execution cost for this intermediate word,
This is added to the variable T for calculating the execution cost of the parallel process. That is, TT+TcXL is calculated.

以上のステップ504〜507により並列プロセスの実
行コストTが算出される。
The execution cost T of the parallel process is calculated through steps 504 to 507 above.

例えば、第6図に示すプログラム部Cの場合、手続きの
呼び出し中間語1つとその他の中間語が10あるとすれ
ば、T=1000X1+lX10=1010が算出され
る。
For example, in the case of program portion C shown in FIG. 6, if there is one procedure call intermediate word and 10 other intermediate words, T=1000X1+1X10=1010 is calculated.

ステップ508では、実行コストTが定数となるかを判
定する。定数となるならステップ509に進み、定数と
ならないならステップ510へ進む。
In step 508, it is determined whether the execution cost T is a constant. If it is a constant, proceed to step 509; if not, proceed to step 510.

ステップ509では、定数である実行コストTの値をオ
ブジェクトモジュールの並列プロセス実行情報30の実
行コストフィールドに設定する。
In step 509, the value of the execution cost T, which is a constant, is set in the execution cost field of the parallel process execution information 30 of the object module.

実行コストTの値が定数となるのは、ループ長か定数の
とき又はループか無い場合である。
The value of the execution cost T becomes a constant when the loop length is a constant or when there is no loop.

例えば、第6図に示すプログラム部Cの場合、第10図
に示す並列プロセスC実行情報30cのの実行コストフ
ィールド32cに、前記算出したTの値11010Jか
設定される。
For example, in the case of the program portion C shown in FIG. 6, the calculated value of T, 11010J, is set in the execution cost field 32c of the parallel process C execution information 30c shown in FIG.

ステップ510では、実行コストTを計算して並列プロ
セス実行情報中の実行コストフィールドに格納するため
の中間語を生成し、並列プロセス登録ライブラリ¥DI
SPを呼び出す中間語の直前に挿入する。
In step 510, an intermediate word for calculating the execution cost T and storing it in the execution cost field in the parallel process execution information is generated, and
Insert just before the intermediate word that calls SP.

例えば、第6図に示すプログラム部Bの場合、DO20
およびDO30の2重ループ内の中間語の数は4て、D
O20の1重ループ内の中間語の数は5て、ループ外の
中間語の数は10であるとすると、T=4XNXM+5
XN+10を計算して第10図に示す並列プロセスB実
行情報30bの実行コストフィールド32bに格納する
ための中間語か、並列プロセスBのために並列プロセス
登録ライブラリ¥DISPを呼び出す中間語の直前に挿
入される。
For example, in the case of program section B shown in FIG.
And the number of intermediate words in the double loop of DO30 is 4, and D
Assuming that the number of intermediate words in the single loop of O20 is 5 and the number of intermediate words outside the loop is 10, then T=4XNXM+5
Insert immediately before the intermediate word for calculating XN+10 and storing it in the execution cost field 32b of the parallel process B execution information 30b shown in FIG. 10, or the intermediate word for calling the parallel process registration library\DISP for parallel process B. be done.

以上の処理の結果、コンパイル後には、第9図に示すよ
うに、並列プロセス登録ライブラリ¥DISPを呼び出
すコード261の直前に実行コストの計算と格納のため
のコード260が挿入され、また、並列プロセス登録ラ
イブラリ¥DISPを呼び出すコート264の直前に実
行コストの計算と格納のためのコード263が挿入され
ることになる。
As a result of the above processing, after compilation, a code 260 for calculating and storing the execution cost is inserted immediately before the code 261 that calls the parallel process registration library\DISP, and A code 263 for calculating and storing the execution cost is inserted immediately before the code 264 that calls the registered library\DISP.

さて次に、並列実行方法について説明する。Next, the parallel execution method will be explained.

オペレーティング・システムは、ユーザからの処理要求
(ジョブステップ)を受は付けると、第11図に示すよ
うに、ユーザ空間(アドレス空間制御ブロック)ASC
BOを生成し、そのユーザ空間ASCBOの中で、タス
ク(タスク制御ブロック)TCBOを生成し、前記オブ
ジェクトモジュール9の実行を開始させる。
When the operating system accepts a processing request (job step) from a user, the operating system executes the user space (address space control block) ASC as shown in FIG.
A BO is generated, a task (task control block) TCBO is generated in the user space ASCBO, and execution of the object module 9 is started.

オペレーティング・システムより制御を受けたユーザプ
ログラムは、メインプログラムの開始部であるプロロー
グ処理12の先頭で、実行時ライブラリの一つであるサ
ブタスク生成ライブラリ¥ATTACHを呼ぶ。
A user program controlled by the operating system calls the subtask generation library\ATTACH, which is one of the runtime libraries, at the beginning of prologue processing 12, which is the start of the main program.

サブタスク生成ライブラリ¥ATTACHは、特願昭6
3−285643号に開示されているように、ジョブ制
御言語のEXEC文のPARAMオペランドによってユ
ーザが指定したサブタスク数のサブタスクを生成するも
のである。
The subtask generation library \ATTACH is
As disclosed in No. 3-285643, the number of subtasks specified by the user is generated using the PARAM operand of the EXEC statement of the job control language.

これにより、第11図に示すように、サブタスク(タス
ク制御ブロック)TCBI、TCB2゜・・・が生成さ
れる。なお、これらサブタスクTCB1、TCB2.・
・・は、実行時ライブラリの一つである並列プロセス取
り出し実行ライブラリ¥PRC8を実行するためのもの
である。並列プロセス取り出し実行ライブラリ¥PRC
3については後で詳述する。
As a result, as shown in FIG. 11, subtasks (task control blocks) TCBI, TCB2°, . . . are generated. Note that these subtasks TCB1, TCB2 .・
... is for executing the parallel process extraction execution library\PRC8, which is one of the runtime libraries. Parallel process extraction execution library\PRC
3 will be explained in detail later.

命令列の実行が、並列プロセスオブジェクト命令列14
に到達すると、第9図に示すコード260を実行し、並
列プロセスAの実行コストを計算して、実行コストフィ
ールド32aに格納する。
The execution of the instruction sequence is executed by the parallel process object instruction sequence 14
When reaching , the code 260 shown in FIG. 9 is executed to calculate the execution cost of the parallel process A and store it in the execution cost field 32a.

次いで、コート261でオブジェクト並列プロセス登録
ライブラリ¥DISPを呼ぶ。
Next, in code 261, the object parallel process registration library\DISP is called.

並列プロセス登録ライブラリ¥DISPは、第1図(a
)(b)に示すフローチャートの処理である。
The parallel process registration library\DISP is shown in Figure 1 (a
) This is the process of the flowchart shown in (b).

ステップ101では、第12図に示すごときプロセス情
報テーブル70の領域を確保する。
In step 101, an area for the process information table 70 as shown in FIG. 12 is secured.

このプロセス情報テーブル70は、他のプロセス情報テ
ーブルと連結するためのポインタとなるチエインフィー
ルド71と、対応する並列プロセスのプロセス実行情報
の先頭アドレスを保持するための並列プロセス実行情報
アドレスフィールド72と、並列プロセスが終了したこ
とを連絡してもらう連絡領域である並列プロセス終了通
知のためのE CB (Event Control 
Block )フィールド73とを有している。
This process information table 70 includes a chain field 71 that serves as a pointer for connecting with other process information tables, and a parallel process execution information address field 72 that holds the start address of process execution information of the corresponding parallel process. ECB (Event Control) is a communication area for notifying the completion of parallel processes.
Block) field 73.

説明の都合上、コード261による並列プロセス登録ラ
イブラリ¥DISPの呼び出しで確保されるプロセス情
報テーブル70にはraJを付して、70aとする。各
フィールド71,72,73、にもraJを付して、7
1 a、  72 a、  73aとする。同様に、コ
ード264により確保されるプロセス情報テーブル70
に関してはrbJ、コード261により確保されるプロ
セス情報テーブル70に関してはrcJを付して区別す
る。
For convenience of explanation, the process information table 70 secured by calling the parallel process registration library \DISP using the code 261 is designated as 70a by adding raJ. Also add raJ to each field 71, 72, 73, 7
1 a, 72 a, and 73 a. Similarly, process information table 70 secured by code 264
For the process information table 70 secured by the code 261, rcJ is added for distinction.

般的に説明するときにはraJ  rbJ  rcJを
付さない。
When explaining generally, raJ rbJ rcJ will not be added.

ステップ102では、プロセス情報テーブル70の各フ
ィールド71に初期値としてOを設定し、並列プロセス
実行情報アドレスフィールド72に第1引数の値を設定
し、並列プロセス終了通知のためのECBフィールド7
3に初期値としてOを設定する。
In step 102, O is set as an initial value in each field 71 of the process information table 70, the value of the first argument is set in the parallel process execution information address field 72, and the ECB field 7 for parallel process termination notification is set.
3 is set to O as the initial value.

コード261による並列プロセス登録ライブラリ¥DI
SPの呼び出しでは、プロセス情報テーブル70aの並
列プロセス実行情報アドレスフィールド72aにINF
aが設定される。
Parallel process registration library with code 261\DI
When calling the SP, INF is set in the parallel process execution information address field 72a of the process information table 70a.
a is set.

ステップ103では、一連の並列プロセスの最初の登録
か否かを第3引数から判定し、最初の登録ならステップ
104に進み、最初の登録でないならステップ106に
進む。
In step 103, it is determined from the third argument whether this is the first registration in a series of parallel processes, and if it is the first registration, the process advances to step 104, and if it is not the first registration, the process advances to step 106.

コード261による並列プロセス登録ライブラリ¥DI
SPの呼び出しでは、第3引数が「S」つまり最初であ
るから、ステップ104に進む。
Parallel process registration library with code 261\DI
When calling SP, the third argument is "S", that is, the first, so the process advances to step 104.

ステップ104では、一連の並列プロセスの一括登録の
ために、生成したプロセス情報テーブル70を一時的に
保持するため、並列プロセス登録ライブラリ¥DISP
実行タスク用のローカルデータ領域の一時的保持用キュ
ー先頭ポインタTQHに、プロセス情報テーブル70の
アドレスを設定する。
In step 104, the parallel process registration library\DISP is used to temporarily hold the generated process information table 70 for the batch registration of a series of parallel processes.
The address of the process information table 70 is set in the temporary holding queue head pointer TQH of the local data area for execution tasks.

コード261による並列プロセス登録ライブラリ¥DI
SPの呼び出しでは、第13図に示すように、−時的保
持用キュー先頭ポインタTQHに、プロセス情報テーブ
ル70aのアドレスを設定する。
Parallel process registration library with code 261\DI
When calling the SP, as shown in FIG. 13, the address of the process information table 70a is set in the temporary holding queue head pointer TQH.

ステップ105では、一連の並列プロセスの最後の登録
か否かを第3引数から判定し、最後ならステップ107
に進み、最後でないなら終了する。
In step 105, it is determined from the third argument whether the registration is the last in the series of parallel processes, and if it is the last, step 107
Proceed to , and if it is not the last, exit.

コード261による並列プロセス登録ライブラリ¥DI
SPの呼び出しでは、「S」つまり最後でないから、並
列プロセス登録ライブラリ¥DISPの実行を終了する
Parallel process registration library with code 261\DI
In the SP call, since it is "S", that is, it is not the last, execution of the parallel process registration library\DISP is ended.

第9図において、コート261の処理が終了すると、コ
ード262からコード263に進む。
In FIG. 9, when the processing of coat 261 is completed, the process proceeds from code 262 to code 263.

コード263では、並列プロセスBの実行コストを計算
し、実行コストフィールド292に格納する。
Code 263 calculates the execution cost of parallel process B and stores it in the execution cost field 292.

次のコート264ては、再び並列プロセス登録ライブラ
リ¥DISPを呼び出す。
In the next code 264, the parallel process registration library\DISP is called again.

コード264による並列プロセス登録ライブラリ¥DI
SPの呼び出しては、第1図(a)のフローチャートの
ステップ101において、プロセス情報テーブル70b
か確保される。また、ステップ102において、チエイ
ンフィールド71bに0か設定され、並列プロセス実行
情報アドレスフィールド72bにINFbが設定され、
並列プロセス終了通知のためのECBフィールド73b
に0か設定される。
Parallel process registration library with code 264\DI
To call the SP, in step 101 of the flowchart in FIG. 1(a), the process information table 70b is called.
or guaranteed. Further, in step 102, 0 is set in the chain field 71b, INFb is set in the parallel process execution information address field 72b,
ECB field 73b for parallel process termination notification
is set to 0.

コート264による並列プロセス登録ライブラリ¥DI
SPの呼び出しでは、第3引数が「M」つまり最初でな
いから、ステップ103からステップ106に進む。
Parallel process registration library by coat 264\DI
When SP is called, the third argument is "M", that is, it is not the first, so the process advances from step 103 to step 106.

ステップ106では、−時キュー先頭ポインタから順に
登録されているプロセス情報テーブル70をたどり、各
プロセス情報テーブル70の並列プロセス実行情報アド
レスフィールド72に指すれる並列プロセス実行情報中
の実行コストフィールドから実行コストを得て、新しい
プロセス情報テーブル70の並列プロセスの実行コスト
と比較し、最初に前者が後者より小さくなった既登録プ
ロセス情報テーブル70の直前に新しいプロセス情報テ
ーブル70を挿入する。つまり、実行コストの大きい順
に並ぶように、プロセス情報テーブル70の列に新しい
プロセス情報テーブル70を挿入する。
In step 106, the process information tables 70 registered in order from the time queue head pointer are followed, and the execution cost is determined from the execution cost field in the parallel process execution information pointed to by the parallel process execution information address field 72 of each process information table 70. is compared with the execution cost of the parallel process in the new process information table 70, and the new process information table 70 is first inserted immediately before the registered process information table 70 for which the former is smaller than the latter. That is, a new process information table 70 is inserted into a column of the process information table 70 so that it is arranged in descending order of execution cost.

これを第14図を参照して一般的に説明する。This will be explained generally with reference to FIG.

いま、第14図において、−時キュー先頭ポインタTQ
Hと、並列プロセスiのプロセス情報テーブル70iと
、並列プロセスjのプロセス情報テーブル70jとが連
結されている。並列プロセスの実行コストは、プロセス
情報テーブル70iの並列プロセス実行情報アドレスフ
ィールド721に指される並列プロセスi実行情報30
i中の実行コストフィールド32iに設定されているr
looOJである。並列プロセスjの実行コストは、プ
ロセス情報テーブル70jの並列プロセス実行情報アド
レスフィールド72jに指される並列プロセスj実行情
報30j中の実行コストフィールド32jに設定されて
いるr500Jである。ここで、新しいプロセス情報テ
ーブル70kをつなぐ場合、その並列プロセスにの実行
コストかr700Jであるとすると、既登録プロセス情
報テーブル70iと既登録プロセス情報テーブル70j
の間に新しいプロセス情報テーブル70kか挿入され、
実行コストの大きい順番にプロセス情報テーブル70か
並べられることになる。
Now, in FIG. 14, - time queue head pointer TQ
H, the process information table 70i of the parallel process i, and the process information table 70j of the parallel process j are connected. The execution cost of the parallel process is determined by the parallel process i execution information 30 indicated in the parallel process execution information address field 721 of the process information table 70i.
r set in the execution cost field 32i in i
This is looOJ. The execution cost of parallel process j is r500J set in the execution cost field 32j in the parallel process j execution information 30j pointed to the parallel process execution information address field 72j of the process information table 70j. Here, when connecting the new process information table 70k, assuming that the execution cost for the parallel process is r700J, the registered process information table 70i and the registered process information table 70j
A new process information table 70k is inserted between
The process information tables 70 are arranged in descending order of execution cost.

コード264による並列プロセス登録ライブラリ¥DI
SPの呼び出しにおけるステップ106では、既登録プ
ロセス情報テーブル70aについての実行コストと新し
いプロセス情報テーブル70bについての実行コストを
比較し、前者か後者より大きいならば既登録プロセス情
報テーブル70aの後に新しいプロセス情報テーブル7
0bをつなぎ、前者が後者より小さいならば既登録プロ
セス情報テーブル70aの前に新しいプロセス情報テー
ブル70bを挿入する。
Parallel process registration library with code 264\DI
In step 106 in calling the SP, the execution cost for the already registered process information table 70a and the execution cost for the new process information table 70b are compared, and if the former is greater than the latter, the new process information is placed after the already registered process information table 70a. table 7
0b are connected, and if the former is smaller than the latter, a new process information table 70b is inserted before the registered process information table 70a.

次に、ステップ105では、コード264による並列プ
ロセス登録ライブラリ¥DISPの呼び出しにおいては
、第3引数が「M」つまり最後でないから、並列プロセ
ス登録ライブラリ¥DISPの実行を終了する。
Next, in step 105, when the parallel process registration library \DISP is called by the code 264, the third argument is "M", that is, it is not the last, so the execution of the parallel process registration library \DISP is ended.

第9図において、コード264の処理が終了すると、コ
ード265からコード266に進む。
In FIG. 9, when the processing of code 264 is completed, the process proceeds from code 265 to code 266.

コード266では、再び並列プロセス登録ライブラリ¥
DISPを呼び出す。なお、並列プロセスCの実行コス
トは先述したようにコンパイル時に既に計算・格納済で
ある。
In code 266, again the parallel process registration library\
Call DISP. Note that the execution cost of the parallel process C has already been calculated and stored at the time of compilation, as described above.

コード266による並列プロセス登録ライブラリ¥DI
SPの呼び出しでは、第1図(a)のフローチャートの
ステップ101において、プロセス情報テーブル70c
が確保される。また、ステップ102において、チエイ
ンフィールド71cに0が設定され、並列プロセス実行
情報アドレスフィールド72cにlNFcが設定され、
並列プロセス終了通知のためのECBフィールド73c
に0が設定される。
Parallel process registration library with code 266\DI
When calling the SP, in step 101 of the flowchart of FIG. 1(a), the process information table 70c is
is ensured. Further, in step 102, 0 is set in the chain field 71c, lNFc is set in the parallel process execution information address field 72c,
ECB field 73c for parallel process termination notification
is set to 0.

コード266による並列プロセス登録ライブラリ¥DI
SPの呼び出しでは、第3引数がrEJつまり最初でな
いから、ステップ103からステップ106に進む。
Parallel process registration library with code 266\DI
When SP is called, the third argument is rEJ, that is, it is not the first argument, so the process advances from step 103 to step 106.

コード266による並列プロセス登録ライブラリ¥DI
SPの呼び出しでは、ステップ106で、既登録プロセ
ス情報テーブル70aについての実行コストおよび既登
録プロセス情報テーブル70bについての実行コストと
新しいプロセス情報テーブル70cについての実行コス
トを比較し、実行コストの大きい順になるように新しい
プロセス情報テーブル70cをつなぐ。
Parallel process registration library with code 266\DI
When calling the SP, in step 106, the execution cost for the registered process information table 70a, the execution cost for the registered process information table 70b, and the execution cost for the new process information table 70c are compared, and the execution costs are ranked in descending order of execution cost. The new process information table 70c is connected as shown in FIG.

次に、ステップ105では、コード266による並列プ
ロセス登録ライブラリ¥DISPの呼び出しにおいては
、第3引数が「E」つまり最後であるから、ステップ1
07に進む。
Next, in step 105, in the call of the parallel process registration library\DISP by code 266, the third argument is "E", that is, the last argument, so step 1
Proceed to 07.

ステップ107では、これまでに作成し保持してきた一
時保持キューを、並列プロセス保持キューの先頭に排他
的に挿入する。排他制御が必要なのは、並列プロセス保
持キューの更新が他のプロセッサにより同時になされる
可能性があるためである。排他制御は、例えばHITA
CM−seriesでは、CS (compare a
nd swap)命令を用いて実現できる。
In step 107, the temporary holding queue that has been created and held so far is exclusively inserted at the head of the parallel process holding queue. Exclusive control is necessary because the parallel process holding queue may be updated simultaneously by other processors. Exclusive control is, for example, HITA
In CM-series, CS (compare a
This can be realized using the nd swap) instruction.

これを第15図を参照して一般的に説明する。This will be explained generally with reference to FIG.

いま、第15図において、並列プロセス保持キュー先頭
ポインタQH,プロセスS、プロセスT。
Now, in FIG. 15, the parallel process holding queue head pointer QH, process S, and process T.

プロセスUをつないだ並列プロセス保持キューがあり、
これに−時保持キュー先頭ポインタT Q H。
There is a parallel process holding queue that connects process U,
In addition to this, there is a time holding queue head pointer TQH.

プロセス情報テーブル701.プロセス情報テーブル7
0に、プロセス情報テーブル70jをつないだ一時保持
キューを一括登録する場合、以下のような命令列となる
Process information table 701. Process information table 7
When registering all the temporary holding queues connected to the process information table 70j in the process information table 70j, the command sequence is as follows.

********** L   R3,TQH L   R1,QH LOOP   ST   R1,プロセス情報チー7′
ルj のチエインフィールドCS   RI  R3,
QH BNZ  LOOP LR1=O 5T   R1,TQH ******本*** なお、命令rLJは、第2アドレスの指定するオペラン
ドを第1アドレスの指定する汎用レジスタにロードする
。命令rSTJは、第1アドレスの指定する汎用レジス
タ内のオペランドを第2アドレスの指定する記憶領域内
に格納する。命令「S」は、第1アドレスの指定する汎
用レジスタ内の第1オペランドと第3アドレスで指定す
る主記憶内の第2オペランドを比較し、等しいなら第2
アドレスの指定する汎用レジスタの内容を第2オペラン
ド位置に格納する。等しくなければ第2オペランドを第
1アドレスの指定する汎用レジスタにロードする。命令
rBNZJは、条件コードがOでないなら、分岐先アド
レスの指定する命令へ分岐する。条件コードが0なら、
分岐しない。
********** L R3, TQH L R1, QH LOOP ST R1, Process information team 7'
Le j chain field CS RI R3,
QH BNZ LOOP LR1=O 5T R1,TQH **** * * * Book * * Note that the instruction rLJ loads the operand specified by the second address into the general-purpose register specified by the first address. The instruction rSTJ stores the operand in the general-purpose register specified by the first address in the storage area specified by the second address. The instruction "S" compares the first operand in the general-purpose register specified by the first address and the second operand in the main memory specified by the third address, and if they are equal, the second operand is
Stores the contents of the general-purpose register specified by the address in the second operand location. If they are not equal, the second operand is loaded into the general-purpose register specified by the first address. If the condition code is not O, the instruction rBNZJ branches to the instruction specified by the branch destination address. If the condition code is 0,
No branching.

上記命令列において、rBNZ LOOPJにより、他
のプロセッサで並列プロセス保持キューの更新がなされ
たら、アドレスLOOPの命令より再実行することにな
る。
In the above instruction sequence, if the parallel process holding queue is updated in another processor by rBNZ LOOPJ, the instruction at address LOOP will be re-executed.

第1図(b)に戻り、ステップ108では、後で説明す
る並列プロセス取り出し実行ライブラリ¥PRC8が、
並列プロセス保持キュー上に並列プロセスが存在しない
とき、CPU資源の有効利用のため、WAITマクロを
発行し、当該タスクを待ち状態させる。この場合、WA
 I Tマクロで指定したタスク対応のECHの中にあ
るウェイトビットかオンとなっている。各タスクのEC
Bのウェイトビットがオンになっているとき、PO8T
マクロを発行し、待ち状態を解除する。
Returning to FIG. 1(b), in step 108, the parallel process extraction execution library\PRC8, which will be explained later, is
When there are no parallel processes on the parallel process holding queue, a WAIT macro is issued to put the task in a waiting state in order to make effective use of CPU resources. In this case, WA
The wait bit in the ECH corresponding to the task specified by the IT macro is on. EC for each task
When the weight bit of B is on, PO8T
Issue a macro and release the wait state.

ステップ108の処理が終ると、並列プロセス登録ライ
ブラリ¥DISPの実行を終了する。
When the processing in step 108 is completed, the execution of the parallel process registration library\DISP is ended.

第9図において、コード266の処理が終了すると、コ
ート267からコート268に進む。
In FIG. 9, when the processing of code 266 is completed, the process proceeds from court 267 to court 268.

コード268では、実行時ライブラリの一つである並列
プロセス完了待ちライブラリ¥WA I Tを呼び出す
。第1引数は一連の並列プロセスの数である。第2引数
以後は、並列プロセスA、並列プロセスB、並列プロセ
スCに対応するプロセス情報テーブル70a、プロセス
情報テーブル70b、プロセス情報テーブル70cのア
ドレスである。
Code 268 calls the parallel process completion waiting library \WAIT, which is one of the runtime libraries. The first argument is the number of parallel processes in the series. The second argument and subsequent arguments are the addresses of the process information table 70a, process information table 70b, and process information table 70c corresponding to parallel process A, parallel process B, and parallel process C.

並列プロセス完了待ちライブラリ¥WAITは、第2図
に示すフローチャートの処理である。
Waiting for parallel process completion library\WAIT is the process of the flowchart shown in FIG.

ステップ151では、複数事象を待つためのECBリス
トを生成するため、(4×一連の並列プロセス数)バイ
トの領域を、並列プロセス完了待ちライブラリ¥WA 
I T実行タスク用のローカルデータ領域に確保する。
In step 151, in order to generate an ECB list for waiting for multiple events, an area of (4 x number of series of parallel processes) bytes is allocated to the parallel process completion waiting library\WA.
Reserved in the local data area for IT execution tasks.

ステップ152では、一連のプロセス情報テーブル70
中の並列プロセス終了通知のためのECBフィールド7
3のアドレスを、ECBリストに順番に格納する。
In step 152, a series of process information tables 70
ECB field 7 for parallel process termination notification in
3 addresses are stored in the ECB list in order.

ステップ153では、上記ECBリストを用いて一連の
並列プロセスの全ての完了を待つWAITマクロを発行
する。
In step 153, the ECB list is used to issue a WAIT macro that waits for the completion of all the series of parallel processes.

上記ステップ152とステップ153を実現する命令列
は、以下のようになる。
The instruction sequence for realizing the above steps 152 and 153 is as follows.

*******************L    G
Rl、並タ17°ロセス数LRGR2GRI LGR4=O LOOP   L    GR3,並タ17°ロセスE
CBアドレスST   GR3,ECBL(GR4)A
GR4=4 BCT  GR2LOOP S    GR4=4 L    GR5,ECBL(GR4)OGR5=X−
80000000− 3T   GR5,ECBL(GR4)WAIT  G
RI  ECBLIST=ECBLECBL  ・・・ *******************なお、命令r
 LRJは、第2アドレスの指定するオペランドを第1
アドレスの指定する汎用レジスタにロードする。命令r
AJは、第1アドレスの指定するオペランドを第2アド
レスの指定するオペランドに加え、結果を第1アドレス
の指定する汎用レジスタに格納し、結果に応じた条件コ
ードがセットされる。命令rBCTJは、第1フイール
ドの指定する汎用レジスタの内容をデクリメントし、結
果がOでなければ分岐先アドレスの指定する命令へ分岐
する。0なら分岐しない。命令「S」は、第1アドレス
の指定するオペランドから第2アドレスの指定するオペ
ランドを減し、結果を第1アドレスの指定する汎用レジ
スタに格納し、結果に応した条件コートがセットされる
。命令「0」は、2つのオペランドのビット対ビットの
論理和をとり、結果を第1アドレスで指定する記憶領域
に格納する。結果に応じた条件コードがセットされる。
*******************L G
Rl, number of 17° recesses LRGR2GRI LGR4=O LOOP L GR3, 17° recess E
CB address ST GR3, ECBL(GR4)A
GR4=4 BCT GR2LOOP S GR4=4 L GR5, ECBL (GR4) OGR5=X-
80000000- 3T GR5, ECBL (GR4) WAIT G
RI ECBLIST=ECBLECBL... *******************************************************************************************************************************************************************************************************************************************************************************************
LRJ transfers the operand specified by the second address to the first
Loads the general-purpose register specified by the address. command r
AJ adds the operand specified by the first address to the operand specified by the second address, stores the result in the general-purpose register specified by the first address, and sets a condition code according to the result. The instruction rBCTJ decrements the contents of the general-purpose register specified by the first field, and if the result is not O, branches to the instruction specified by the branch destination address. If it is 0, there is no branch. The instruction "S" subtracts the operand specified by the second address from the operand specified by the first address, stores the result in the general-purpose register specified by the first address, and sets a condition code corresponding to the result. Instruction "0" performs a bit-to-bit OR of two operands and stores the result in the storage area specified by the first address. A condition code is set depending on the result.

マクロ命令「WAITJは、指定した数の事象発生の連
絡かあるまで本マクロ発行元タスクを待ち状態にする。
The macro instruction "WAITJ" puts the task that issued this macro in a wait state until it receives notification of the occurrence of a specified number of events.

連絡かあると、本マクロ発行元タスクに制御を移す。When contacted, control is transferred to this macro issuer task.

上記命令列で、ECBLは、ECBリストのためのデー
タ領域である。
In the above instruction sequence, ECBL is a data area for the ECB list.

ステップ154では、一連の並列プロセスの全ての完了
の後、ECBリストのデータ領域を解放する。
In step 154, the data area of the ECB list is released after all the series of parallel processes are completed.

並列プロセスAのコード、並列プロセスBのコード、並
列プロセスCのコードは、プログラム先頭で生成された
ユーザ指定数のサブタスクTCB1、TCB2.・・・
のもとで実行される並列プロセス取り出し実行ライブラ
リ¥PRCSから呼び出されて実行される。
The code for parallel process A, the code for parallel process B, and the code for parallel process C are based on the user-specified number of subtasks TCB1, TCB2 . ...
It is called and executed from the parallel process extraction execution library \PRCS, which is executed under .

並列プロセス取り出し実行ライブラリ¥PRC8の処理
を第3図を参照して説明する。
The processing of the parallel process extraction execution library \PRC8 will be explained with reference to FIG.

ステップ201では、並列プロセス保持キュー先頭ポイ
ンタQHが0か否かを判定し、0であればステップ20
8に進み、0でない場合はステップ202に進む。
In step 201, it is determined whether the parallel process holding queue head pointer QH is 0 or not. If it is 0, step 201
If the value is not 0, the process proceeds to step 202.

並列プロセス保持キュー先頭ポインタQHかOであると
は、実行可能な並列プロセスが残っていないことを意味
する。並列プロセス保持キュー先頭ポインタQHがOで
ないとは、実行可能な並列プロセスが残っていることを
意味する。
When the parallel process holding queue head pointer is QH or O, it means that there are no executable parallel processes remaining. If the parallel process holding queue head pointer QH is not O, it means that there remain executable parallel processes.

ステップ202では、並列プロセス保持キュー先頭ポイ
ンタQHより、プロセス情報テーブル70を排他的に取
り出す。
In step 202, the process information table 70 is exclusively retrieved from the parallel process holding queue head pointer QH.

ステップ203では、他のプロセッサによる並列プロセ
ス保持キューの更新のために排他アクセスが失敗したと
きは前記ステップ201に戻り、排他アクセスが成功し
たときはステップ204に進む。
In step 203, if the exclusive access fails due to an update of the parallel process holding queue by another processor, the process returns to step 201, and if the exclusive access is successful, the process proceeds to step 204.

¥PRC3は、以下のような命令列によって実現できる
\PRC3 can be realized by the following instruction sequence.

********* LOOP  L  RIQH LTRRI RI BZ  処理208 L  R3,(R1) C3R1,R3QH BE  処理204 B   LOOP ********* なお、命令rLTRJは、第2オペランドを第1オペラ
ンドの場所にロードする。第2オペランドに応じて条件
コードをセットする。命令r BZJは、条件コードが
0なら、分岐先アドレスの指定する命令へ分岐する。条
件コードがOでないなら、分岐しない。命令[BEJは
、条件コードがOなら、分岐先アドレスの指定する命令
へ分岐する。条件コードが0でないなら、分岐しない。
********* LOOP L RIQH LTRRI RI BZ Processing 208 L R3, (R1) C3R1, R3QH BE Processing 204 B LOOP ********* Note that the instruction rLTRJ uses the second operand Load into the location of the first operand. Sets a condition code according to the second operand. If the condition code is 0, instruction r BZJ branches to the instruction specified by the branch destination address. If the condition code is not O, do not branch. If the condition code is O, the instruction BEJ branches to the instruction specified by the branch destination address. If the condition code is not 0, do not branch.

命令rBJは、無条件で、分岐先アドレスの指定する命
令へ分岐する。
Instruction rBJ unconditionally branches to the instruction specified by the branch destination address.

これを第16図により説明すると、並列プロセス保持キ
ュー先頭ポインタQHに連なる一連のプロセス情報テー
ブル70i、70に、70jから先頭のプロセス情報テ
ーブル70iを取り出す結果となる。この場合、上記命
令列において、レジスタR1には、最初のプロセス情報
テーブル701のアドレスが設定される。レジスタR3
には、プロセス情報テーブル70iの次のプロセス情報
テーブル70にのアドレスを設定する。B命令でアドレ
スLOOPに戻るのは、他のプロセッサによる並列プロ
セス保持キューの更新が発生した場合である。
To explain this with reference to FIG. 16, the result is that the first process information table 70i is extracted from 70j to a series of process information tables 70i, 70 connected to the parallel process holding queue head pointer QH. In this case, in the above instruction sequence, the address of the first process information table 701 is set in register R1. Register R3
, the address of the next process information table 70 after the process information table 70i is set. The B instruction returns to address LOOP when another processor updates the parallel process holding queue.

ステップ204では、取り出したプロセス情報テーブル
70の並列プロセス実行情報アドレスフィールド72が
指す並列プロセス実行情報30の中の並列プロセスで必
要なワーク領域の大きさフィールド34を読み出し、そ
の大きさのワーク領域を、並列プロセス取り出し実行ラ
イブラリ¥PRC3実行タスク用ローカルデータ領域に
確保する。
In step 204, the size field 34 of the work area required for the parallel process in the parallel process execution information 30 pointed to by the parallel process execution information address field 72 of the retrieved process information table 70 is read out, and the work area of that size is read out. , parallel process extraction execution library\PRC3 is secured in the local data area for execution tasks.

ステップ205では、確保したワーク領域の先頭アドレ
スをワーク領域ペースレジスタとして用いるレジスタに
設定する。次いで、プロセス情報テーブル70の並列プ
ロセス実行情報アドレスフィールド72か指す並列プロ
セス実行情報30の中の並列プロセスのオブジェクト先
頭アドレスフィールド31の値を読み出し、その値のア
ドレスへ分岐する。これにより、並列プロセスを実行す
る。
In step 205, the start address of the secured work area is set in a register used as a work area pace register. Next, the value of the object start address field 31 of the parallel process in the parallel process execution information 30 pointed to by the parallel process execution information address field 72 of the process information table 70 is read, and the process branches to the address of that value. This runs parallel processes.

ステップ206では、前記ステップ204で確保したワ
ーク領域を解放する。
In step 206, the work area secured in step 204 is released.

ステップ207では、当該プロセスの終了を親プロセス
へ通知するため、PO3Tマクロを発行する。対応する
ECBフィールドは、当該プロセス情報テーブル70中
にある並列プロセス終了通知のためのECBフィールド
73である。
In step 207, a PO3T macro is issued to notify the parent process of the termination of the process. The corresponding ECB field is the ECB field 73 in the process information table 70 for parallel process termination notification.

さて、ステップ208では、CPU資源の有効活用の観
点から、当実行タスク対応のECBを用いて当タスクに
関しWA I Tマクロを発行し待ち状態とし、今後、
並列プロセスが並列プロセス登録ライブラリ¥DISP
によって登録された時点で、並列プロセス登録ライブラ
リ¥DISPによるPO8Tマクロで当タスクを起こし
てもらう制御を行う。
Now, in step 208, from the viewpoint of effective utilization of CPU resources, a WAIT macro is issued for this task using the ECB corresponding to the execution task, and the task is placed in a waiting state.
Parallel process is parallel process registration library\DISP
When the task is registered, the PO8T macro by the parallel process registration library\DISP is used to control the task to wake up.

ステップ209では、当タスク対応のECBを初期化す
る。
In step 209, the ECB corresponding to this task is initialized.

さて、第7図に戻り、最後に、メインプログラムの終了
部であるエピローグ処理15で、サブタスフ消滅ライブ
ラリ¥DETACHを呼び、サブタスクTCBI、TC
B2.・・・を消滅させ、プログラムを終了する。
Now, returning to FIG. 7, in the epilogue process 15, which is the end of the main program, the subtask extinction library\DETACH is called, and the subtasks TCBI, TC
B2. ... and terminate the program.

なお、マルチユーザ環境で実行されるときは、他のユー
ザ空間のタスクも存在するが、この場合のスケジュール
処理は公知のオペレーティング・システムの制御処理で
あるため、説明は省略する。
Note that when executed in a multi-user environment, other user space tasks also exist, but the schedule processing in this case is a known operating system control processing, so a description thereof will be omitted.

また、上記実施例においては、並列プロセス保持キュー
の管理として、LIFO(後入れ、先出し)方式で説明
したか、FIFO(先入れ、先出し)方式をとる場合も
同様に本発明を適用することが出来る。
Furthermore, in the above embodiment, the LIFO (last in, first out) method was used for managing the parallel process holding queue, but the present invention can be similarly applied to cases where the FIFO (first in, first out) method is used. I can do it.

さて、次に、実行コスト指定のないソースプログラムを
、実行コスト指定を付加したソースプログラムに変換す
る並列プロセススケジュール支援ツールについて説明す
る。
Next, a description will be given of a parallel process schedule support tool that converts a source program without execution cost designation into a source program with execution cost designation added.

第5図は、並列プロセススケジュール支援ツールの処理
を示すものである。
FIG. 5 shows the processing of the parallel process schedule support tool.

ステップ521では、人力ソースプログラム526を、
動的プロファイルオプションでコンパイルし、実行し、
プログラムの動的プロファイル情報527を得る。動的
プロファイルオプションで、コンパイルと実行を行うこ
とは公知の技術である(例えば、rHITAc VO5
3最適化FORTRAN770FORT77E2  H
AP FORTRAN77使用TR用(8090−3−
765−30)第42頁のC0UNTオプシヨン」が該
当する)。
In step 521, the human source program 526 is
Compile with dynamic profile option, run,
Dynamic profile information 527 of the program is obtained. Compiling and executing with dynamic profile options is a known technique (e.g. rHITAc VO5
3 optimization FORTRAN770FORT77E2 H
For TR using AP FORTRAN77 (8090-3-
765-30) "C0UNT option" on page 42).

動的プロファイル情報527は、第17図に示すように
、入力ソースプログラム526の各文に対応して実行回
数、オブジェクト命令数、全実行ステップ数(実行回数
×オブジェクト命令数)を出力し、実際のプログラムの
負荷状況を示すものである。
As shown in FIG. 17, the dynamic profile information 527 outputs the number of executions, the number of object instructions, and the total number of execution steps (number of executions x number of object instructions) corresponding to each statement of the input source program 526. This shows the load status of the program.

ステップ522では、入力ソースプログラム526中の
全ての並列プロセスに対して、ステラフ523〜ステツ
プ525の処理を行う。
In step 522, the processing of steps 523 to 525 is performed for all parallel processes in the input source program 526.

ステップ523では、一つの並列プロセスに属する文番
号を求める。これは、入力ソースプログラム中の並列プ
ロセス開始を示す並列指示文poption para
caseから次の並列プロセス開始を示す並列指示文p
option paracaseまでの間にある文の番
号である。または、並列プロセス開始を示す並列指示文
poption paracaseから並列処理の終わ
りを示す並列指示文poption paracase
endまでの間にある文の番号である。
In step 523, the statement number belonging to one parallel process is determined. This is a parallel directive option para that indicates the start of a parallel process in the input source program.
Parallel directive p indicating the start of the next parallel process from case
This is the number of the statement up to option paracase. Or, from the parallel directive ``portion paracase'' indicating the start of a parallel process to the parallel directive ``portion paracase'' indicating the end of parallel processing.
This is the number of the sentence up to the end.

ステップ524では、上記ステップ523で求めた文番
号の文の全実行ステップ数を動的プロファイル情報52
7より得て加算し、当該並列プロセスに属する文の全実
行ステップ数の総和を求める。
In step 524, the total number of execution steps of the statement with the statement number obtained in step 523 is calculated using the dynamic profile information 52.
7 and add them to find the total number of all execution steps of the statements belonging to the parallel process.

ステップ525では、当該並列プロセス開始を示す並列
指示文poption paracaseに、実行コス
トとして上記総和を付は加える。すなわち、並列指示文
poption paracase (cost= ’
総和の値l)に変換する。
In step 525, the above-mentioned sum is added as an execution cost to the parallel directive ``option paracase'' indicating the start of the parallel process. In other words, the parallel directive portion paracase (cost='
Convert to the sum value l).

最後に、全ての並列指示文poption parac
aseを変換したソースプログラムを出力ソースプログ
ラム528として出力する。
Finally, all parallel directives portion parac
The source program obtained by converting ase is output as an output source program 528.

例えば、第17図の入力ソースプログラム526では、
文番号10.11の文が1つの並列プロセスを構成する
ので、動的プロファイル情報527の文番号10.11
の全実行ステップ数[500J、r8000Jを加えて
、その総和「8500」を求め、これを対応する並列指
示文531に実行コストとして付加する。そこで、並列
指示文539をもつ出力ソースプログラム528か得ら
れる。
For example, in the input source program 526 of FIG.
Since the statement with statement number 10.11 constitutes one parallel process, statement number 10.11 in the dynamic profile information 527
The total number of execution steps [500J and r8000J are added to obtain the sum "8500", and this is added to the corresponding parallel directive 531 as the execution cost. Therefore, an output source program 528 having a parallel directive 539 is obtained.

別の例として、第9図のソースプログラムを上記並列プ
ロセススケジュール支援ツールに人力すると、第18図
のような実行コスト指定のあるソースプログラムが得ら
れる。
As another example, when the source program shown in FIG. 9 is manually entered into the parallel process schedule support tool, a source program with an execution cost specification as shown in FIG. 18 is obtained.

この実行コスト指定のあるソースプログラムを並列化コ
ンパイルオプションのもとでコンパイルすると、第19
図の並列プロセスオブジェクト命令列および第20図の
並列プロセス実行情報をもつオブジェクトモジュールが
得られる。
When a source program with this execution cost specification is compiled under the parallelization compilation option, the 19th
An object module having the parallel process object instruction string shown in the figure and the parallel process execution information shown in FIG. 20 is obtained.

さて、第21図(a)(b)(c)は、本発明の効果を
示す説明図である。
Now, FIGS. 21(a), (b), and (c) are explanatory diagrams showing the effects of the present invention.

第21図(a)に示すように、一連の並列プロセスa、
b、cがあり、その実行時間を20.1030とする。
As shown in FIG. 21(a), a series of parallel processes a,
b and c, and their execution time is 20.1030.

また、並列プロセスa、b、cの順にソースプログラム
に記述されているものとする。
It is also assumed that parallel processes a, b, and c are written in the order of the source program.

サラニ、2つのCPUが、常に与えられると仮定する。Assume that two CPUs are always given.

第21図(b)の右図に示すようにソースプログラムに
おける出現順の並列プロセス保持キューを作ると、並列
プロセスa、b、cの順で処理が開始されるため、第2
1図(b)の左図に示すタイムチャートとなる。
If a parallel process holding queue is created in the order of appearance in the source program as shown in the right diagram of FIG. 21(b), processing will start in the order of parallel processes a, b, and c, so
The time chart is shown in the left diagram of FIG. 1(b).

一方、本発明によれば、第21図(c)の右図に示すよ
うに並列プロセスa、  b、  cの実行コスト類の
並列プロセス保持キューが作られ、並列プロセスc、a
、bの順で処理が開始されるため、第21図(C)の左
図に示すタイムチャートとなる。
On the other hand, according to the present invention, as shown in the right diagram of FIG. 21(c), a parallel process holding queue is created for the execution costs of parallel processes a, b, and c.
Since the processing is started in the order of , b, the time chart shown in the left diagram of FIG. 21(C) is obtained.

第21図(b)の左図に示すタイムチャートと第21図
(c)の左図に示すタイムチャートとを比較すれば明ら
かなように、本発明により処理時間を短くできる効果が
ある。
As is clear from a comparison of the time chart shown in the left diagram of FIG. 21(b) and the time chart shown in the left diagram of FIG. 21(c), the present invention has the effect of shortening the processing time.

[発明の効果] 本発明の並列実行方法によれば、並列プロセスのスケジ
ューリングにおいて、各並列プロセスの実行コストの大
きい順に並列処理を開始させるため、実行処理時間の短
縮が可能となり、効率的な並列処理を実現する効果があ
る。特に、並列プロセスがさらに並列プロセスを生成す
る並列処理のネストがある場合には、並列プロセスの実
行コストのばらつきが大きいため、本発明の効果が大き
くなる。
[Effects of the Invention] According to the parallel execution method of the present invention, in scheduling parallel processes, parallel processing is started in descending order of the execution cost of each parallel process, so execution processing time can be shortened, and efficient parallel processing can be achieved. It has the effect of realizing processing. In particular, if there is a nest of parallel processing in which a parallel process generates further parallel processes, the effects of the present invention will be greater because the execution costs of the parallel processes will vary widely.

また、本発明のコンパイラによれば、コンパイル時に実
行コスト指定がオブジェクトに付加され、コンパイル時
には実行コストが分からない場合には実行コストを計算
するコードがオブジェクトに付加されるから、一般のソ
ースプログラムに対して上記並列実行方法を適用するこ
とが可能となる効果がある。
Furthermore, according to the compiler of the present invention, an execution cost specification is added to the object at the time of compilation, and if the execution cost is not known at the time of compilation, a code for calculating the execution cost is added to the object, so that it can be used for general source programs. This has the effect of making it possible to apply the above parallel execution method to the above.

さらに、本発明の並列プロセススケジュール支援ツール
によれば、プログラムを実際に実行させて実行コストを
プログラムに反映させるから、外部呼び出しを並列プロ
セス部に持つ場合でも実行コストの見積もりが正確にな
り、より効率的な並列実行が可能となる効果がある。
Furthermore, according to the parallel process schedule support tool of the present invention, since the program is actually executed and the execution cost is reflected in the program, the execution cost can be estimated more accurately even when the parallel process part has external calls. This has the effect of enabling efficient parallel execution.

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

第1図(a)(b)は本発明の並列実行方法の一実施例
に係る並列プロセス登録ライブラリの処理の要部フロー
チャート、第2図は本発明の並列実行方法の一実施例に
係る並列プロセス完了待ちライブラリの処理の要部フロ
ーチャート、第3図は本発明の並列実行方法の一実施例
に係る並列プロセス取り出し実行ライブラリの処理の要
部フローチャート、第4図は本発明のコンパイラの一実
施例に係る実行コスト計算処理の要部フローチャート、
第5図は本発明の並列プロセススケジュール支援ツール
の一実施例の処理の要部フローチャート、第6図はソー
スプログラムの例示図、第7図は本発明にかかるオブジ
ェクトモジュールの概念図、第8図は本発明にかかる並
列プロセス実行情報の概念図、第9図は並列プロセスオ
ブジェクト命令列の例示図、第10図は並列プロセス実
行情報例示図、第11図はタスクの生成の概念図、第1
2図はプロセス情報テーブルの概念図、第13図は一時
保持キューの概念図、第14図は一時保持キニーの更新
の概念図、第15図は並列プロセス保持キューへの一時
保持キューの登録の概念図、第16図は並列プロセス保
持キューの更新の概念図、第17図はソースプログラム
と動的プロファイル情報の関係を示す概念図、第18図
は本発明の並列プロセススケジュール支援ツールによる
出力ソースプログラムの例示図、第19図は第18図の
ソースプログラムに対応するオブジェクトモジュールの
並列プロセスオブジェクト命令列の例示図、第20図は
第18図のソースプログラムに対応するオブジェクトモ
ジュールの並列プロセス実行情報の例示図、第21図(
a)(bHc)は本発明の詳細な説明する概念図である
。 (符号の説明) ¥DISP・・・並列プロセス登録ライブラリ¥WA 
I T・・・並列プロセス完了待ちライブラリ¥PRC
S ・・・並列プロセス取り出し実行ライブラリ501〜5
10 ・・・コンパイラの実行コスト計算処理521〜525 ・・・並列プロセススケジュール支援ツールの処理30
・・・並列プロセス実行情報 32・・並列プロセスの実行コストフィールド260.
263 ・・実行コストの計算と格納のためのコード。
FIGS. 1(a) and (b) are flowcharts of main parts of the processing of the parallel process registration library according to an embodiment of the parallel execution method of the present invention, and FIG. FIG. 3 is a flowchart of the main part of the process of the process completion waiting library, FIG. 3 is a flowchart of the main part of the process of the parallel process extraction execution library according to an embodiment of the parallel execution method of the present invention, and FIG. 4 is an implementation of the compiler of the present invention. A main part flowchart of the execution cost calculation process according to the example,
FIG. 5 is a flowchart of a main part of processing of an embodiment of the parallel process schedule support tool of the present invention, FIG. 6 is an exemplary diagram of a source program, FIG. 7 is a conceptual diagram of an object module according to the present invention, and FIG. 8 9 is a conceptual diagram of parallel process execution information according to the present invention, FIG. 9 is an exemplary diagram of a parallel process object instruction sequence, FIG. 10 is an exemplary diagram of parallel process execution information, FIG.
Figure 2 is a conceptual diagram of a process information table, Figure 13 is a conceptual diagram of a temporary holding queue, Figure 14 is a conceptual diagram of updating a temporary holding Kinney, and Figure 15 is a conceptual diagram of registering a temporary holding queue in a parallel process holding queue. Conceptual diagram, Figure 16 is a conceptual diagram of updating the parallel process holding queue, Figure 17 is a conceptual diagram showing the relationship between the source program and dynamic profile information, and Figure 18 is the output source by the parallel process schedule support tool of the present invention. An example diagram of a program, FIG. 19 is an example diagram of a parallel process object instruction sequence of an object module corresponding to the source program of FIG. 18, and FIG. 20 is parallel process execution information of an object module corresponding to the source program of FIG. 18. An illustrative diagram of FIG. 21 (
a) (bHc) is a conceptual diagram explaining the present invention in detail; (Explanation of symbols) \DISP...Parallel process registration library\WA
IT...Parallel process completion waiting library\PRC
S...Parallel process extraction execution library 501-5
10...Compiler execution cost calculation processing 521-525...Parallel process schedule support tool processing 30
...Parallel process execution information 32...Parallel process execution cost field 260.
263...Code for calculating and storing execution costs.

Claims (1)

【特許請求の範囲】 1、並列プロセスを含むオブジェクトプログラムを、マ
ルチプロセッサシステムで実行する際、オブジェクトプ
ログラム実行中に、並列プロセスが実行可能となった時
点で、該並列プロセスのキュー登録を行い、そのキュー
から並列プロセスを取り出して各プロセッサに割り当て
る並列実行方法において、 一連の並列プロセスについては各並列プロ セスの実行コストの大きい順にキューから取り出される
ように制御することを特徴とする並列実行方法。 2、請求項1の並列実行方法において、並列プロセスの
キュー登録を行うために、並列プロセスキュー登録用実
行時ライブラリを呼び、その実行時ライブラリへのイン
タフェース情報として、オブジェクトプログラムの実行
コストフィールドに設定された並列プロセスの実行コス
トを渡し、 前記実行時ライブラリは、一連の並列プロ セスを実行コストの大きい順につなぎ、一連の並列プロ
セスの最後の並列プロセスのキュー登録依頼時に、キュ
ーの管理として先入れ先出し方式を採用し、キューの最
後を保持するポインタの指すプロセスと前記一連の並列
プロセスの最大の実行コストの並列プロセスをつなぎ、
さらに前記キューの最後を保持するポインタを、前記一
連の並列プロセスの最小の実行コストの並列プロセスを
指すように書き替えて、一連の並列プロセスを一括して
キュー登録し、 前記キューから並列プロセスを取り出すた めに、前記キューを監視して、前記キュー上に並列プロ
セスが存在するときは、前記キューの先頭を保持するポ
インタで示される並列プロセスを前記キューから取り出
す、 ことを特徴とする並列実行方法。 3、請求項1の並列実行方法において、並列プロセスの
キュー登録を行うために、並列プロセスキュー登録用実
行時ライブラリを呼び、その実行時ライブラリへのイン
タフェース情報として、オブジェクトプログラムの実行
コストフィールドに設定された並列プロセスの実行コス
トを渡し、 前記実行時ライブラリは、一連の並列プロ セスを実行コストの大きい順につなぎ、一連の並列プロ
セスの最後の並列プロセスのキュー登録依頼時に、キュ
ーの管理として後入れ先出し方式を採用し、キューの最
後を保持するポインタの指すプロセスと前記一連の並列
プロセスの最小の実行コストの並列プロセスをつなぎ、
さらに前記キューの最後を保持するポインタを、前記一
連の並列プロセスの最大の実行コストの並列プロセスを
指すように書き替えて、一連の並列プロセスを一括して
キュー登録し、 前記キューから並列プロセスを取り出すた めに、前記キューを監視して、前記キュー上に並列プロ
セスが存在するときは、前記キューの最後を保持するポ
インタで示される並列プロセスを前記キューから取り出
す、 ことを特徴とする並列実行方法。 4、ソースプログラムをオブジェクトプログラムに変換
するコンパイラにおいて、 ソースプログラム中に並列プロセスの実行 コスト値が指定してあるか否かを検出し、 指定してある場合は、その指定してある値 をオブジェクトプログラム中の実行コストフィールドに
設定し、 指定してない場合は、並列プロセス部の演 算量をコンパイラ内部の対応中間語の個数およびDOル
ープの繰り返し回数に着目して計算したとき、その計算
結果が定数となるか否かを検出し、 定数となる場合は、オブジェクトプログラ ム中の実行コストフィールドに計算結果を設定し、 定数とならない場合は、オブジェクトプロ グラム中に、前記計算を行なうコードと、実行コストフ
ィールドに前記計算結果を設定するコードとを生成する
、 ことを特徴とするコンパイラ。 5、入力されたソースプログラムを動的プロファイルオ
プションでコンパイルし、実行を行い、前記ソースプロ
グラムの各文に対応する機械語命令数および実行回数を
示す動的プロファイル情報を求め、その動的プロファイ
ル情報から各並列プロセスに属する文の実行コストの総
和を求め、その総和を実行コスト値情報として付加した
ソースプログラムを出力することを特徴とする並列プロ
セススケジュール支援ツール。
[Claims] 1. When an object program including parallel processes is executed on a multiprocessor system, the parallel process is registered in a queue when the parallel process becomes executable during execution of the object program; A parallel execution method in which parallel processes are taken out from the queue and assigned to each processor, characterized in that a series of parallel processes are controlled so that each parallel process is taken out from the queue in descending order of execution cost. 2. In the parallel execution method according to claim 1, in order to register the parallel process in the queue, a runtime library for parallel process queue registration is called, and interface information to the runtime library is set in the execution cost field of the object program. The runtime library connects a series of parallel processes in descending order of execution cost, and uses a first-in, first-out method for queue management when requesting queue registration for the last parallel process in the series of parallel processes. connect the process pointed to by the pointer that holds the end of the queue and the parallel process with the maximum execution cost of the series of parallel processes;
Furthermore, the pointer holding the end of the queue is rewritten to point to the parallel process with the lowest execution cost of the series of parallel processes, the series of parallel processes are collectively registered in the queue, and the parallel processes are removed from the queue. In order to take out the queue, the queue is monitored, and when a parallel process exists on the queue, the parallel process indicated by a pointer holding the head of the queue is taken out from the queue. . 3. In the parallel execution method according to claim 1, in order to register the parallel process in the queue, a runtime library for parallel process queue registration is called, and interface information to the runtime library is set in the execution cost field of the object program. The runtime library connects a series of parallel processes in descending order of execution cost, and uses last-in-first-out as queue management when requesting queue registration for the last parallel process in the series of parallel processes. connect the process pointed to by the pointer holding the end of the queue to the parallel process with the minimum execution cost of the series of parallel processes,
Furthermore, the pointer holding the end of the queue is rewritten to point to the parallel process with the highest execution cost of the series of parallel processes, the series of parallel processes are collectively registered in the queue, and the parallel processes are removed from the queue. In order to take out the queue, the queue is monitored, and if there is a parallel process on the queue, the parallel process indicated by the pointer holding the end of the queue is taken out from the queue. . 4. A compiler that converts a source program into an object program detects whether a parallel process execution cost value is specified in the source program, and if so, converts the specified value into an object program. If set in the execution cost field in the program, but not specified, the calculation result will be Detect whether it is a constant or not. If it is a constant, set the calculation result in the execution cost field in the object program. If it is not a constant, write the code that performs the calculation and the execution cost in the object program. A compiler that generates a code for setting the calculation result in a field. 5. Compile the input source program with the dynamic profile option, execute it, obtain dynamic profile information indicating the number of machine language instructions and the number of executions corresponding to each statement of the source program, and calculate the dynamic profile information. A parallel process schedule support tool characterized by calculating the sum of execution costs of statements belonging to each parallel process from , and outputting a source program with the sum added as execution cost value information.
JP2044828A 1990-02-26 1990-02-26 Parallel execution method, compiler, and parallel process schedule supporting tool Pending JPH03246746A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2044828A JPH03246746A (en) 1990-02-26 1990-02-26 Parallel execution method, compiler, and parallel process schedule supporting tool

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2044828A JPH03246746A (en) 1990-02-26 1990-02-26 Parallel execution method, compiler, and parallel process schedule supporting tool

Publications (1)

Publication Number Publication Date
JPH03246746A true JPH03246746A (en) 1991-11-05

Family

ID=12702319

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2044828A Pending JPH03246746A (en) 1990-02-26 1990-02-26 Parallel execution method, compiler, and parallel process schedule supporting tool

Country Status (1)

Country Link
JP (1) JPH03246746A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010055405A (en) * 2008-08-28 2010-03-11 Hitachi Ltd Execution environment selection system, execution environment selecting method, and execution environment selection program
WO2019044340A1 (en) * 2017-08-30 2019-03-07 富士フイルム株式会社 Image processing apparatus, image processing method, and image processing program

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010055405A (en) * 2008-08-28 2010-03-11 Hitachi Ltd Execution environment selection system, execution environment selecting method, and execution environment selection program
WO2019044340A1 (en) * 2017-08-30 2019-03-07 富士フイルム株式会社 Image processing apparatus, image processing method, and image processing program
CN111052084A (en) * 2017-08-30 2020-04-21 富士胶片株式会社 Image processing apparatus, image processing method, and image processing program
JPWO2019044340A1 (en) * 2017-08-30 2020-10-29 富士フイルム株式会社 Image processing equipment, image processing method, and image processing program
US11257178B2 (en) 2017-08-30 2022-02-22 Fujifilm Corporation Image processing device, image processing method, and storage medium
CN111052084B (en) * 2017-08-30 2023-10-17 富士胶片株式会社 Image processing device, image processing method, and image processing program

Similar Documents

Publication Publication Date Title
US4636948A (en) Method for controlling execution of application programs written in high level program language
US6718541B2 (en) Register economy heuristic for a cycle driven multiple issue instruction scheduler
Hsu et al. Highly concurrent scalar processing
US5828886A (en) Compiling apparatus and method for promoting an optimization effect of a program
US5021945A (en) Parallel processor system for processing natural concurrencies and method therefor
Eichenberger et al. Using advanced compiler technology to exploit the performance of the Cell Broadband Engine™ architecture
US6094528A (en) Method and apparatus for system building with a transactional interpreter
JP3039953B2 (en) Parallelization device
JP2818016B2 (en) Process parallel execution method and apparatus
US7181730B2 (en) Methods and apparatus for indirect VLIW memory allocation
JPH03230225A (en) Process dispersion system
US6738893B1 (en) Method and apparatus for scheduling to reduce space and increase speed of microprocessor operations
CN108874727A (en) GPDSP-oriented multi-core parallel computing implementation method
JPH09134287A (en) Microprocessor and its load address predicting method
US6101326A (en) Method and apparatus for frame elimination for simple procedures with tail calls
US20030130834A1 (en) Execution time modification of instruction emulation parameters
Pancake Multithreaded languages for scientific and technical computing
JPH03246746A (en) Parallel execution method, compiler, and parallel process schedule supporting tool
Rico et al. Available task-level parallelism on the Cell BE
Shu et al. Asynchronous problems on SIMD parallel computers
Nicolau et al. Fine-grain compilation for pipelined machines
Nácul et al. Code partitioning for synthesis of embedded applications with phantom
Gupta code Optimization as a side effect of instruction scheduling
JP3191263B2 (en) Optimal object selection execution processor
Tremblay et al. Threaded-C language reference manual (release 2.0)