JPH03148729A - Parallel execution program translating and processing system - Google Patents

Parallel execution program translating and processing system

Info

Publication number
JPH03148729A
JPH03148729A JP28758289A JP28758289A JPH03148729A JP H03148729 A JPH03148729 A JP H03148729A JP 28758289 A JP28758289 A JP 28758289A JP 28758289 A JP28758289 A JP 28758289A JP H03148729 A JPH03148729 A JP H03148729A
Authority
JP
Japan
Prior art keywords
exclusive control
parallel
compiler
program
procedure
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.)
Granted
Application number
JP28758289A
Other languages
Japanese (ja)
Other versions
JPH0743652B2 (en
Inventor
Hiroshi Nagakura
長倉 浩士
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.)
National Institute of Advanced Industrial Science and Technology AIST
Original Assignee
Agency of Industrial Science and Technology
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 Agency of Industrial Science and Technology filed Critical Agency of Industrial Science and Technology
Priority to JP1287582A priority Critical patent/JPH0743652B2/en
Publication of JPH03148729A publication Critical patent/JPH03148729A/en
Publication of JPH0743652B2 publication Critical patent/JPH0743652B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Abstract

PURPOSE:To execute a processing to avoid the possibility of conflict generation caused by a multiple call by a compiler by providing an analysis processing part, exclusive control part and translation processing part. CONSTITUTION:A compiler 10 is equipped with an analysis processing part 11, exclusive control part 12 and translation processing part 13. The exclusive control part 12 receives an intermediate text as the processed result of the analysis processing part 11, scans the text and retrieves a parallel execution part designated by a parallel execution designating sentence. When there is the group of the part to be parallelly executed, it is identified whether thee is the same procedure call in the plural parts of the group or not and when there is such a call, all the common procedures to respective objects are listed up. Then, all the procedured are corrected to execute exclusive control for each procedure. Thus, in the part with the possibility to be called from the plural parts to be parallelly executed, the possibility of the conflict generation caused by the multiple call can be processed so as to be automatically avoided by the compiler.

Description

【発明の詳細な説明】 〔概 要〕 計算機のコンパイラ、特に並列実行可能な目的プログラ
ムを生成するコンパイラに関し、並列実行可能な複数の
部分から呼び出される可能性のある部分がある場合に、
多重呼出による矛盾発生の可能性を避ける処置を、コン
パイラが自動的に行うようにした並列実行プログラム翻
訳処理方式を目的とし、 解析処理部と、排他制御部と、翻訳処理部を有し、該解
析処理部は所与の原始プログラムを解析して、該原始プ
ログラムを所定の並列実行可佳な部分に分割し、該排他
制御部は、手続きが、並列実行可能な複数の該部分から
呼び出されることを検出し、該手続きに所定の排他制御
命令を追加して、排他的実行状態を獲得した後、該手続
きを実行し、該実行後該状態を解除するように修正し、
該翻訳処理部は、該修正結果を翻訳処理して目的プログ
ラムを生成するように構成する。
[Detailed Description of the Invention] [Summary] Regarding a computer compiler, especially a compiler that generates a target program that can be executed in parallel, if there is a part that may be called from multiple parts that can be executed in parallel,
The purpose of this is a parallel execution program translation processing method in which a compiler automatically takes measures to avoid the possibility of contradictions occurring due to multiple calls. The analysis processing unit analyzes a given source program and divides the source program into predetermined parts that can be executed in parallel, and the exclusive control unit allows procedures to be called from a plurality of parts that can be executed in parallel. Detecting this, adding a predetermined exclusive control instruction to the procedure to obtain an exclusive execution state, executing the procedure, and modifying the procedure to release the state after the execution,
The translation processing unit is configured to perform translation processing on the correction result to generate a target program.

【産業上の利用分野〕[Industrial application field]

本発明は、計算機のコンパイラ、特に並列実行可能な目
的プログラムを生成するコンパイラの並列実行プログラ
ム翻訳処理方式に関する。
The present invention relates to a computer compiler, and particularly to a parallel execution program translation processing method for a compiler that generates a target program that can be executed in parallel.

〔従来の技術〕[Conventional technology]

第3図は計算機において、所定のプログラミング言語、
例えばFORTRAN言語、で記述された原始プログラ
ムから、並列実行可能な目的プログラムを生成するコン
パイラの構成例を示すブロック図である。
Figure 3 shows a computer using a predetermined programming language,
1 is a block diagram showing an example of the configuration of a compiler that generates a target program that can be executed in parallel from a source program written in the FORTRAN language, for example.

コンパイラ1の解析処理部5は原始プログラム2を解析
して、解析結果を所定の中間テキストとし、翻訳処理部
6はこの中間テキストから所定の機械語の目的プログラ
ム4を生成する。
The analysis processing unit 5 of the compiler 1 analyzes the source program 2 and uses the analysis result as a predetermined intermediate text, and the translation processing unit 6 generates a target program 4 in a predetermined machine language from this intermediate text.

こ\でコンパイラ1は、並列実行可能な目的プログラム
を生成することができるように、例えばFORTRAN
言語に追加された並列実行指定文を解析して、指定の複
数の部分を、それぞれ個別のいわゆるタスクとして実行
できるように目的プログラムを生成する。
Here, the compiler 1 uses FORTRAN, for example, so that it can generate a target program that can be executed in parallel.
A parallel execution specification statement added to the language is analyzed and an objective program is generated so that multiple parts of the specification can be executed as individual so-called tasks.

例えば第4図(a)は、そのような並列実行指定文を含
む原始プログラムの例であって、並列実行指定文として
、PARBLOCK 、 BLOCK 、 END B
LOCK文があり、PARIlLOCK文とEND B
LOCK文で挟まれたプログラムの中の、肚OCR文で
区切られている各部分(この例では、中央部のBLOC
K文で2部分に区切られている)が、プログラムの論理
上互いに並行実行可蛯なプログラムの部分であって、そ
れらを個別のタスクとして同時に実行できるように目的
プログラムを生成すべきことを指定する意味を持つ。
For example, FIG. 4(a) is an example of a source program that includes such parallel execution specification statements, and the parallel execution specification statements include PARBLOCK, BLOCK, END B.
There is a LOCK statement, a PARIlLOCK statement and an END B
Each part of the program between LOCK statements is separated by OCR statements (in this example, the central BLOC
Specifies that the target program should be generated so that the program parts (separated into two parts by the K statement) are logically executable parts of the program in parallel with each other, and can be executed simultaneously as separate tasks. has the meaning of

翻訳処理部6は、解析処理部5の解析結果に従って、そ
れらの複数の並列実行部分が、例えば複数の処理装置に
分配されて、並行して処理できるように分割し、且つそ
れらが実行を終わった後に、次のシーケンシ¥ルに実行
すべき部分へ進むように、必要な同期制御が行われるよ
うに目的プログラムを生成する。
According to the analysis results of the analysis processing unit 5, the translation processing unit 6 divides the plurality of parallel execution parts so that they can be distributed to, for example, a plurality of processing devices and processed in parallel, and also divides them into parts so that they can be processed in parallel. After that, the target program is generated so that the necessary synchronization control is performed to proceed to the part to be executed in the next sequence.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

このように並列実行可能な部分が、並列に実行された場
合に、第4図(a)の例のように、複数の並列に実行す
るプログラムが同じ手続きSn2を呼び出す場合には、
誤った処理結果を生じる場合がある。そのような結果は
、手続きについて、実行時にただlAllの実体(変数
等に割り当てるいわゆる局所領域)しか生成しないよう
に翻訳する場合に生じ得、多くの場合にそのような翻訳
が行われる。
In this way, when the parts that can be executed in parallel are executed in parallel, and multiple programs to be executed in parallel call the same procedure Sn2, as in the example in FIG. 4(a),
This may result in incorrect processing results. Such a result can occur when a procedure is translated in such a way that only 1All entities (so-called local areas assigned to variables, etc.) are generated during execution, and such translation is often performed.

即ち、第4図(6)の例で、例えば変数Xの値を3、変
数Aの値を5としてプログラムの両部分がそれぞれサブ
ルーチンを実行したとすると、サブルーチンの局所変数
W等の領域はl SJI域しか無いから、第1の部分の
呼び出しによるSn2(Y、X)の実行で、W=3X3
=9が代入された直後に、第2の部分の呼び出しによる
S(14(B、^)の実行によってWが5X5=25に
書き換えられる可能性があり、この場合には、両呼び出
しに対して、Y = B =25X25=625が結果
として返され、一方は正しくない結果を得る。
That is, in the example shown in FIG. 4 (6), if the value of variable Since there is only the SJI area, by executing Sn2 (Y, X) by calling the first part, W = 3X3
Immediately after =9 is assigned, W may be rewritten to 5 , Y=B=25X25=625 is returned as the result, one gets an incorrect result.

従って、このような可能性がある場合には、並列実行を
断念して、通常のシーケンシャルなプロ  ーダラムに
書き直すか、又は前記例で言えば51)4の呼び出しを
並列実行指定部分の外に出して、シーケンシャルに実行
するようにした第4図(ロ)のようなプログラムに書き
直す必要がある。
Therefore, if there is such a possibility, either abandon parallel execution and rewrite to a normal sequential programmer, or, in the example above, move the call in 51) 4 outside the parallel execution specification part. Therefore, it is necessary to rewrite the program as shown in Figure 4 (b) to execute it sequentially.

本発明は、並列実行可能な複数の部分から呼び出される
手続きがある場合に、多重呼出による矛盾発生の可能性
を避ける処置を、コンパイラが自動的に行うようにした
並列実行プログラム翻訳処理方式を目的とする。
The present invention aims at a parallel execution program translation processing method in which a compiler automatically takes measures to avoid the possibility of inconsistency due to multiple calls when there are procedures called from multiple parts that can be executed in parallel. shall be.

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

第1図は、本発明の構成を示すブロック図である。 FIG. 1 is a block diagram showing the configuration of the present invention.

図は並列実行プログラム翻訳処理方式を構成するコンパ
イラlOであって、解析処理部11と、排他制御部12
と、翻訳処理部13を有し、解析処理部llは所与の原
始プログラム2を解析して、原始プログラム2を所定の
並列実行可能な部分に分割し、排他制御部12は、手続
きが、並列実行可能な複数の該部分から呼び出されるこ
とを検出し、該手続きに所定の排他制御命令を追加して
、排他的実行状態を獲得した後、該手続きを実行し、該
実行後該状態を解除するように修正し、翻訳処理部13
は、該修正結果を翻訳処理して目的プログラム14を生
成する。
The figure shows a compiler lO constituting a parallel execution program translation processing method, which includes an analysis processing section 11 and an exclusive control section 12.
and a translation processing unit 13, the analysis processing unit 11 analyzes a given source program 2 and divides the source program 2 into predetermined parallel executable parts, and the exclusive control unit 12 has a procedure that Detects that it is called from multiple parts that can be executed in parallel, adds a predetermined exclusive control instruction to the procedure, acquires an exclusive execution state, executes the procedure, and changes the state after execution. Modify to release the translation processing unit 13
generates the target program 14 by translating the modified result.

〔作 用〕[For production]

以上の処理方式により、プログラム中に並列実行可能に
すべき複数の部分から同一の手続きの呼び出しがあり、
、実行時に手続きに局所領域を1組しか設けないために
、多重呼出があると結果に矛盾発生の可能性がある場合
に、そのような矛盾発生を避ける処置を、コンパイラが
自動的に行うの、で、そのような場合のプログラムの書
き直しを不要とし、且つコンパイラは問題の手続きの実
行のみを直列化するように修正するので、並列実行を可
能な限り生かすことができる。
With the above processing method, the same procedure is called from multiple parts of the program that should be able to be executed in parallel.
, because only one set of local areas is provided for a procedure at runtime, if there is a possibility of inconsistent results due to multiple calls, the compiler automatically takes measures to avoid such contradictions. , it is not necessary to rewrite the program in such a case, and the compiler corrects it so that only the execution of the procedure in question is serialized, so parallel execution can be utilized as much as possible.

〔実施例〕〔Example〕

第1図において、解析処理部11は処理結果を排他制御
部12に渡す他は前記従来の解析処理部5と同様であり
、又翻訳処理部13は排他制御部12が修正したテキス
トについて処理する他は、前記従来の翻訳処理部13と
同様である。
In FIG. 1, the analysis processing section 11 is the same as the conventional analysis processing section 5 except that it passes the processing result to the exclusive control section 12, and the translation processing section 13 processes the text modified by the exclusive control section 12. The rest is the same as the conventional translation processing section 13 described above.

第2図は、排他制御部12の処理の流れの一例を示す図
であり、排他制御部12は、解析処理部11の処理結果
の中間テキストを受は取ると、処理ステップ20でテキ
ストを走査して、前記従来の説明で述べたような並列実
行指定又で指定された並列実行部分を検索する。
FIG. 2 is a diagram showing an example of the processing flow of the exclusive control section 12. When the exclusive control section 12 receives the intermediate text of the processing result of the analysis processing section 11, it scans the text in processing step 20. Then, the parallel execution portion specified by the parallel execution designation or as described in the conventional explanation is searched.

並列実行する部分のグループがあると、処理ステップ2
1でそのグループの中の複数の部分で同一の手続き呼び
出しがあるか識別し、そのような呼び出しがある場合に
は、それぞれの対象にする共通の手続きをすべてり°ス
トアップする。
If there is a group of parts to be executed in parallel, processing step 2
Step 1 identifies whether there are identical procedure calls in multiple parts of the group, and if there are such calls, restores all common procedures targeted for each.

処理ステップ22で、決定したすべての手続きについて
、甚平続きごとに排他制御化する修正を行う、この修正
は、例えばこのプログ−ラムを実行するシステムがいわ
ゆるセマフォの制SaCを持つ場合には、該当手続きの
実行文の前にセマフォのいわゆるP命令を挿入して、P
命令により公知のように例えばセマフォの値を検査して
0であればl減じて次の命令に進み、負であればl減じ
て次の命令へ進むのを待ち合わせるようにし、又その手
続きの実行を終わる時にセマフォの■命令を置き、■命
令によりセマフォの値を1増加して、待ちにあるlタス
クの実行を進めるようにする。
In processing step 22, all determined procedures are modified to have exclusive control for each continuation. This modification is applicable, for example, if the system that executes this program has a so-called semaphore control SaC. Insert a semaphore's so-called P command before the procedure execution statement, and
As is well known, the command checks the value of a semaphore, and if it is 0, it decrements it by 1 and proceeds to the next instruction, and if it is negative, it decrements it by 1 and waits for it to proceed to the next instruction, and then executes the procedure. When the semaphore is finished, the semaphore ■ command is placed, and the semaphore value is incremented by 1 by the ■ command so that the execution of the waiting l task can proceed.

処理ステップ22で該当手続きをすべて修正するか、又
は処理ステップ21で複数の部分の同一の手続き呼び出
しが無いと識別した場合は、処理ステップ20に戻って
次のグループを走査し、このようなグループをすべて処
理すれば、排他制御部12の処理を終わる。
If all applicable procedures are modified in process step 22, or if it is identified in process step 21 that there are no identical procedure calls in multiple parts, the process returns to process step 20 and the next group is scanned. Once all of these are processed, the processing of the exclusive control unit 12 ends.

以上のようにして、第4図(a)に例示したプログラム
の手続きを修正した例を、第4図(C)に示す。
An example in which the procedure of the program illustrated in FIG. 4(a) is modified as described above is shown in FIG. 4(C).

この図で、rsEIlAPIIORE SEM Jは変
数SE?1をセマフォの領域とする宣言文であり、これ
によって変数SEHの領域が設けられ、所定の初期値(
例えばO)に設定される。又、実行文の最初に挿入され
ているrCALL P(SEW)J文、及び最後に挿入
されているrCALL V(SUN)J文が、(! )
 フ #の変数SEM ニついて、それぞれセマフォの
P命令及びV命令を実行するよ′うに関数を呼び出す文
である。    −このように手続きを修正することに
より、並列実行部分の何れかでこの手続きSO2が呼ば
れて、実行開始すると、その実行が終わって、最後の■
命令が実行されるまでに、他の並列実行している部分か
ら手続きSO2の呼び出しがあっても、その実行はP命
令の実行で待ち状態となり、先に実行中の結果を妨害す
ることが無い、即ち、手続き−の呼び出し側には何も手
を加える必要無しに、正常な並列実行結果が保証される
In this figure, rsEIlAPIIORE SEM J is the variable SE? This is a declaration statement that sets 1 as the semaphore area. This creates an area for the variable SEH, and a predetermined initial value (
For example, it is set to O). Also, the rCALL P(SEW)J statement inserted at the beginning of the executable statement and the rCALL V(SUN)J statement inserted at the end are (!)
These are statements that call functions to execute the semaphore's P and V instructions for the variable SEM in F#. - By modifying the procedure in this way, when this procedure SO2 is called in any of the parallel execution parts and execution starts, the execution ends and the final
Even if procedure SO2 is called from another part executing in parallel before the instruction is executed, its execution will be in a waiting state with the execution of the P instruction, and will not interfere with the result being executed earlier. That is, normal parallel execution results are guaranteed without the need for any modification on the calling side of the procedure.

〔発明の効果〕〔Effect of the invention〕

以上の説明から明らかなように本発明によれば、計算機
の並列実行可能な目的プログラムを生成するコンパイラ
において、並列実行可能な複数の部分から呼び出される
可能性のある部分の、多重呼出による矛盾発生の可能性
を、コンパイラが自動的に避けるように処理するので、
プログラムの開発効率を改善し、且つ並列実行機能の利
用性を向上するという著しい工業的効果がある。
As is clear from the above description, according to the present invention, in a compiler that generates a target program that can be executed in parallel by a computer, inconsistencies occur due to multiple calls of parts that may be called from multiple parts that can be executed in parallel. The compiler automatically avoids the possibility of
This has a significant industrial effect of improving program development efficiency and increasing the usability of parallel execution functions.

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

第1図は本発明の構成を示すブロック図、第2図は本発
明の処理の流れ図、 第3図は従来の構成例を示すブロック図、第4図はプロ
グラム例の説明図 である。 図において、 1.1(lはコンパイラ、  2は原始プログラム、4
.14ば目的プログラム、 5.11は解析処理部、 6.13は翻訳処理部、12
は排他制御部、   20〜22は処理ステップを示す
。 特許出願人 工業技術院長 杉 浦  賢11)1z)
      フン1ずイラ   ′未発明の構成を示す
ブロフり図 1   1  手続き修正 ヒ 本発明の処理の流れ圀
FIG. 1 is a block diagram showing the configuration of the present invention, FIG. 2 is a flowchart of the processing of the present invention, FIG. 3 is a block diagram showing a conventional configuration example, and FIG. 4 is an explanatory diagram of a program example. In the figure, 1.1 (l is the compiler, 2 is the source program, 4
.. 14 is the target program, 5.11 is the analysis processing section, 6.13 is the translation processing section, 12
indicates an exclusive control unit, and 20 to 22 indicate processing steps. Patent applicant Ken Sugiura, Director of the Agency of Industrial Science and Technology11)1z)
1. Brochure diagram showing the uninvented structure 1. Modification of procedures Process flow diagram of the present invention

Claims (1)

【特許請求の範囲】 解析処理部(11)と、排他制御部(12)と、翻訳処
理部(13)を有し、 該解析処理部(11)は所与の原始プログラム(2)を
解析して、該原始プログラムを所定の並列実行可能な部
分に分割し、 該排他制御部(12)は、手続きが、並列実行可能な複
数の該部分から呼び出されることを検出し、該手続きに
所定の排他制御命令を追加して、排他的実行状態を獲得
した後、該手続きを実行し、該実行後該状態を解除する
ように修正し、 該翻訳処理部(13)は、該修正結果を翻訳処理して目
的プログラム(14)を生成するように構成されている
ことを特徴とする並列実行プログラム翻訳処理方式。
[Claims] It has an analysis processing section (11), an exclusive control section (12), and a translation processing section (13), and the analysis processing section (11) analyzes a given source program (2). and divides the source program into predetermined parallel executable parts, and the exclusive control unit (12) detects that the procedure is called from a plurality of parallel executable parts, and divides the source program into predetermined parallel executable parts. After acquiring an exclusive execution state by adding an exclusive control instruction, the translation processing unit (13) executes the procedure and cancels the state after the execution, and the translation processing unit (13) A parallel execution program translation processing method, characterized in that it is configured to perform translation processing and generate a target program (14).
JP1287582A 1989-11-06 1989-11-06 Parallel execution program translation processing method Expired - Lifetime JPH0743652B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1287582A JPH0743652B2 (en) 1989-11-06 1989-11-06 Parallel execution program translation processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1287582A JPH0743652B2 (en) 1989-11-06 1989-11-06 Parallel execution program translation processing method

Publications (2)

Publication Number Publication Date
JPH03148729A true JPH03148729A (en) 1991-06-25
JPH0743652B2 JPH0743652B2 (en) 1995-05-15

Family

ID=17719177

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1287582A Expired - Lifetime JPH0743652B2 (en) 1989-11-06 1989-11-06 Parallel execution program translation processing method

Country Status (1)

Country Link
JP (1) JPH0743652B2 (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01108638A (en) * 1987-10-21 1989-04-25 Hitachi Ltd Parallelized compilation system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01108638A (en) * 1987-10-21 1989-04-25 Hitachi Ltd Parallelized compilation system

Also Published As

Publication number Publication date
JPH0743652B2 (en) 1995-05-15

Similar Documents

Publication Publication Date Title
JPH03148729A (en) Parallel execution program translating and processing system
JPH01277934A (en) Switching system for parameter list reference method
JPS63211432A (en) Automatic generating system for patch
JP2871693B2 (en) Critical section optimization method
JPH01240934A (en) Automatic re-compiling method
JP2560491B2 (en) Parallelized procedure execution method
JPH0447337B2 (en)
JPS63266556A (en) Dump analysis processing system
JPH03278232A (en) Exclusive control system for non-reentrant structure subroutine
JPS63195731A (en) Program setting system
JPH04205430A (en) Program execution controller
JPH0776926B2 (en) Loop control processing method
JPH04101237A (en) Debug processing system
JPS6367649A (en) Program test system
JPS592154A (en) Test-processing system of program to be test-processed
JPH0695868A (en) Software management system
JPH0740228B2 (en) Computer programming language processor
JPS62264333A (en) Processing method for optimization of program
JPS63184136A (en) Optimization processing system
JPS63308640A (en) Device for correcting high-level language program debugger
JPS63116247A (en) Program debugging system
JPH04195525A (en) Job control language forming system
JPS63118837A (en) Producing device for load module
JPH03230228A (en) Output system for program error
JPH04128929A (en) Parameter checking system for program calling

Legal Events

Date Code Title Description
EXPY Cancellation because of completion of term