JPH0343835A - Paralleled process system - Google Patents

Paralleled process system

Info

Publication number
JPH0343835A
JPH0343835A JP17805289A JP17805289A JPH0343835A JP H0343835 A JPH0343835 A JP H0343835A JP 17805289 A JP17805289 A JP 17805289A JP 17805289 A JP17805289 A JP 17805289A JP H0343835 A JPH0343835 A JP H0343835A
Authority
JP
Japan
Prior art keywords
program
processors
target
parallel
processor
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
JP17805289A
Other languages
Japanese (ja)
Inventor
Akikazu Abe
安部 曉一
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP17805289A priority Critical patent/JPH0343835A/en
Publication of JPH0343835A publication Critical patent/JPH0343835A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To automatically secure and release the necessary processors with high efficiency by producing automatically an instruction train which secures the processors in number necessary for production of an object program and then releases these processors when they are not required. CONSTITUTION:In an compiler 2 a source program 1 is analyzed by an analyzing means 21 for production of an intermediate text 24 and a paralleled means 22 analyzes the text 24 to extract the parts which can work in parallel with each other for production of a paralleled intermediate text 25. At the same time, the compiler 2 decides the number of processors which are actiated in parallel with each other. An object program generating means 23 produces an instruction train which secures the processor in number decided by the means 22 and releases these processors when they are not required. A linker 3 decides the number of processors to be secured and buries them into a program. An executing program generating means 32 connects the necessary object programs to each other and produces an execution mode program 6. In such a constitution, the processors are effectively secured and released in a parallel process and many processors can be effectively used.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、所定のプログラムを複数のプロセッサを使用
して並列に処理する並列化処理方式に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a parallel processing method for processing a predetermined program in parallel using a plurality of processors.

〔従来の技術] 従来、あるプログラムを複数のプロセッサを使用して並
列に処理しようとした場合、プロセッサの確保/解放は
周知のマルヂタスキング機能を使用したときにはシステ
ムのタスク管理機能にまかせられていた。
[Prior Art] Conventionally, when a program was to be processed in parallel using multiple processors, the allocation/release of the processors was left to the task management function of the system when the well-known multitasking function was used.

また、利用者又はシステムが固定的にプロセッサを確保
して低オーバーヘッドの並列処理を行なわせることが可
能なシステムもあった。
There are also systems in which a user or system can secure a fixed processor to perform low-overhead parallel processing.

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

しかしながら、マルチタスキング機能を使用する方式で
は、システムのタスク管理におけるオーバーヘッドが大
きく、並列処理される計算量が少ない場合には性能が出
ないという問題があった。
However, the method using the multitasking function has a problem in that the overhead in system task management is large and performance is poor when the amount of calculations to be processed in parallel is small.

また、利用者又はシステムがプロセッサ数を固定して確
保するシステムでは、プロセッサ確保/解放のオーバー
ヘッドを抑えるために、広い範囲でプロセンサ確保/解
放を行なう必要があり、これによってプロセンサの使用
効率が落ちたり、またプログラム全体を調べてプロセッ
サの確保/解放のタイミングを決めなければならないの
で最適なプロセッサ割当てが困難であるというような問
題もあった。
In addition, in systems where the user or system secures a fixed number of processors, it is necessary to secure/release processors over a wide range in order to reduce the overhead of securing/releasing processors, which reduces the efficiency of processor usage. Furthermore, it is difficult to optimally allocate processors because the entire program must be examined to decide when to reserve/release processors.

本発明はこのような従来の欠点を改善したもので、その
目的は、並列処理時のプロセッサの確保/解放を効率化
し、多数のプロセッサの有効利用を図り、プロセッサの
確保/解放のオーバーヘッドを著しく削減することの可
能な並列化処理方式を提供することにある。
The present invention has improved the conventional drawbacks, and its purpose is to improve the efficiency of securing/releasing processors during parallel processing, to make effective use of a large number of processors, and to significantly reduce the overhead of securing/releasing processors. The object of the present invention is to provide a parallel processing method that can reduce the number of parallel processes.

〔課題を解決するための手段] 本発明の並列化処理方式は、ソースプログラムを入力し
て複数個のプロセッサで動作可能な目的プログラムを生
成するコンパイラと、目的プログラムを入力して実行時
プログラムを生成するリンカとを有し、前記コンパイラ
は、ソースプログラムを解析して中間テキストを生成す
る解析手段と、中間テキストを解析して並列動作可能な
部分を抽出し、並列化中間テキストを生威するとともに
並列動作させるプロセッサ数を決定する並列化手段と、
並列化中間テキストから目的プログラムを生威し、この
際に前記並列化手段で決定された数のプロセッサを確保
するような命令を生成し、また該プロセッサを必要でな
くなった時点で解放するような命令列を生成する目的プ
ログラム生成手段とを備え、前記リンカは、全ての目的
プログラドに対して該目的プログラムと関連している目
的プログラムを調べ、前記コンパイラで設定されたプロ
セッサ数のうち適切なものを当該プログラムで確保する
プロセッサ数として確定し、プログラム中に埋め込むプ
ロセッサ数確定手段と、必要な目的プログラムを結合し
実行時プログラムを生成する実行時プログラム生成手段
とを備えている。
[Means for Solving the Problems] The parallel processing method of the present invention includes a compiler that inputs a source program and generates a target program that can be run on a plurality of processors, and a compiler that inputs the target program and generates a runtime program. The compiler has an analysis means that analyzes a source program and generates an intermediate text, and an analysis means that analyzes the intermediate text and extracts a part that can be operated in parallel, and generates a parallelized intermediate text. parallelization means for determining the number of processors to be operated in parallel;
Generates a target program from the parallelization intermediate text, generates instructions to secure the number of processors determined by the parallelization means, and releases the processors when they are no longer needed. and a target program generating means for generating an instruction sequence, the linker checks the target program associated with the target program for all target program programs, and selects an appropriate number of processors from among the number of processors set by the compiler. The present invention includes means for determining the number of processors to be secured in the program and embedding it in the program, and runtime program generation means for combining necessary target programs and generating a runtime program.

〔作 用] コンパイラでは、解析手段によってソースプログラムを
解析して中間テキストを生威し、並列化手段によって中
間テキストを解析し、並列動作可能な部分を抽出して並
列化中間テキストを生成するとともに並列動作させるプ
ロセッサ数を決定する。しかる後、目的プログラム生成
手段は、並列化中間テキストから目的プログラムを生成
するがこの際に、並列化手段で決定された数のプロセッ
サが、プログラムの必要時点で確保されていなければこ
れを確保するような命令列を生成し、またプログラムで
プロセッサを確保している場合に該プロセッサがプログ
ラムで必要でなくなった時点で解放するような命令列を
生成する。リンカでは、プロセッサ数確定手段において
、コンパイラで設定されたプロセッサ数のうち適切なも
のをプログラムで確保するプロセッサ数として確定し、
プログラム中に埋め込み、実行時プログラム生成手段に
おいて、必要な目的プログラムを結合し、実行時プログ
ラムを生成する。
[Function] In the compiler, the analysis means analyzes the source program to generate intermediate text, the parallelization means analyzes the intermediate text, extracts parts that can be operated in parallel, and generates parallelized intermediate text. Determine the number of processors to operate in parallel. Thereafter, the target program generating means generates the target program from the parallelized intermediate text, but at this time, if the number of processors determined by the parallelizing means is not secured at the time when the program is required, it secures this. In addition, when a processor is reserved in a program, an instruction sequence is generated such that the processor is released when the processor is no longer needed by the program. In the linker, the number of processors determining means determines the appropriate number of processors set by the compiler as the number of processors to be secured by the program,
The program is embedded in the program, and a runtime program generation means combines necessary target programs to generate a runtime program.

〔実施例〕〔Example〕

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

第1図は本発明の並列化処理方式を適用したシステムの
ブロック図である。
FIG. 1 is a block diagram of a system to which the parallel processing method of the present invention is applied.

第1図において、コンパイラ2は、ソースプログラムl
を読み込み、構文解析を行なって中間テキスト24を生
成する解析部21と、中間テキスト24からソースプロ
グラム1の並列性を解析し、解析結果に基づき並列化中
間テキスト25を生成する並列化部22と、並列化中間
テキスト25から目的プログラム4を生成する目的プロ
グラム生成部23から構成されている。並列化部22は
さらに、プログラムの並列性の解析及び、並列化中間テ
キストを生成する並列性解析部221と、並列動作させ
る最適なプロセッサ数を決定するブロセッサ数決定部2
22とを有し、また、目的プログラム生成部23は、プ
ロセッサ確保命令列生成部231と、通常命令生成部2
32とを有している。プロセッサ確保命令生成部231
は、該プログラムが並列化部22で決定された数のプロ
セッサを必要とする時点で確保していなければ確保し、
確保していればそのプロセッサを使用するような命令列
を生成し、該プログラムがプロセッサを確保している場
合には該プロセッサが該プログラムで必要なくなった時
点で解放するような命令列を生成するようになっており
、通常命令列生成部232は、通常の命令列を生成する
ようになっている。
In FIG. 1, the compiler 2 includes a source program l
an analysis unit 21 that reads and parses the syntax to generate an intermediate text 24, and a parallelization unit 22 that analyzes the parallelism of the source program 1 from the intermediate text 24 and generates a parallelized intermediate text 25 based on the analysis result. , and a target program generation unit 23 that generates the target program 4 from the parallelized intermediate text 25. The parallelization unit 22 further includes a parallelism analysis unit 221 that analyzes the parallelism of the program and generates parallelized intermediate text, and a processor number determination unit 2 that determines the optimal number of processors to operate in parallel.
22, and the target program generation section 23 has a processor reservation instruction string generation section 231 and a normal instruction generation section 2.
32. Processor reservation instruction generation unit 231
If the number of processors determined by the program requires the number of processors determined by the parallelization unit 22 is not secured at the time, the processors are secured;
If the program has secured the processor, it will generate an instruction sequence that uses that processor, and if the program has secured the processor, it will generate an instruction sequence that will release the processor when it is no longer needed by the program. The normal instruction string generation unit 232 is designed to generate a normal instruction string.

またリンカ3は、プロセッサ数確定部31と、実行時プ
ログラム生成部32とを有している。プロセッサ数確定
部31は、目的プログラム4を読み込み、該目的プログ
ラム4で確保するプロセッサ数と該目的プログラム4か
ら参照している。他の目的プログラム5を、該参照目的
プログラムからさらに参照している目的プログラムまで
含めて調べ、上記プロセッサ確保命令列生成部231で
設定されたプロセッサ数のうち適切なものを当該プログ
ラムで確保するプロセッサ数として確定し、プログラム
中に埋め込むようになっており、実行時プログラム生成
部32は、必要な目的プログラムを結合し、実行時プロ
グラム6を生成するようになっている。
The linker 3 also includes a processor number determination section 31 and a runtime program generation section 32. The processor number determination unit 31 reads the target program 4 and refers to the number of processors secured by the target program 4 from the target program 4. A processor that examines other target programs 5, including the reference target program and the reference target program, and secures an appropriate number of processors for the program from among the number of processors set by the processor reservation instruction string generation unit 231. The runtime program generation unit 32 combines necessary target programs and generates the runtime program 6.

次にこのような構成における並列化処理について第2図
、第3図を用いて具体的に説明する。
Next, parallel processing in such a configuration will be specifically explained using FIGS. 2 and 3.

第2図には、本実施例が適用されるプログラムA、B、
C及びBBが示されており、第2図において“n a 
= 1 ”はプログラムAがプロセッサを1個必要とし
、 n b = 3 ”はプログラムBがプロセッサを
3個必要とし、 nc=1”はプログラムCがプロセッ
サを1個必要とし、“nbb=4”はプログラムBBが
プロセッサを4個必要とすることを示している。
FIG. 2 shows programs A, B, and programs to which this embodiment is applied.
C and BB are shown, and in FIG.
= 1'' means that program A requires one processor, n b = 3'' means that program B requires three processors, nc = 1'' means that program C requires one processor, and ``nbb = 4''. indicates that program BB requires four processors.

また、プログラムAはプログラムBとプログラムCを呼
び出しており、プログラムBはプログラムBBを呼び出
している。さらにプログラムBとプログラムBBは並列
実行部分すなわちプロセッサを複数個使用する部分を含
んでいる。
Further, program A calls program B and program C, and program B calls program BB. Further, program B and program BB include a parallel execution portion, that is, a portion that uses a plurality of processors.

なお第3図は第2図を基にして生成される実行時プログ
ラム6を示している。
Note that FIG. 3 shows the runtime program 6 generated based on FIG. 2.

コンパイラlは先づ、第2図に示すプログラムを1個つ
づ読み込んで解析部゛21により中間テキス1〜24を
生成する。並列化部22中の並列性解析部221は例え
ばプログラムBの並列実行部分を検出し、並列化中間テ
キスト25を生成する。
The compiler 1 first reads the programs shown in FIG. 2 one by one and generates intermediate texts 1 to 24 by the analysis section 21. The parallelism analysis unit 221 in the parallelization unit 22 detects, for example, a parallel execution portion of program B, and generates parallelized intermediate text 25.

また並列化時のプロセッサ数をプロセッサ数決定部22
2により“n b = 3 ”と決定する。目的プログ
ラム生成部23は、プロセッサを確保する命令列、例え
ば第3図のプログラムAの“get ”及びプロセッサ
を解放する命令列、例えば第3図のプログラムAの“r
elease ”を並列実行部分及び外部のプログラム
呼び出しの前後にプロセッサ確保命令列生成部231に
よって挿入する。通常命令列生成部232によって目的
プログラム4が生成されると、リンカ3に渡される。
In addition, the number of processors at the time of parallelization is determined by the number of processors determining unit 22.
2, it is determined that "n b = 3". The target program generation unit 23 generates an instruction sequence for securing a processor, for example, "get" of program A in FIG. 3, and an instruction sequence for releasing a processor, for example, "r" for program A in FIG.
"elease" is inserted by the processor reservation instruction string generating section 231 before and after the parallel execution part and the external program call.When the target program 4 is generated by the normal instruction string generating section 232, it is passed to the linker 3.

リンカ3のプロセッサ数確定部31は、例えば第2図の
プログラムAに対する目的プログラムを入力し、プログ
ラムAから呼び出しているプログラムB、C1さらにプ
ログラムBから呼び出しているプログラムBBを調べる
。ここで、プログラムAはti、プログラムBは3個、
プログラムCは1個、プログラムBBは4個のプロセッ
サを要求しているので、プログラムAに対しては例えば
プロセッサの個数として4個を確保し、以後プロセッサ
の追加要求が発生しないようにするというようにプロセ
ッサ数を確定する。また確定数は、実行時プログラム生
成部32によってプログラム中に設定される。実行時プ
ログラム生成部32は、入力目的プログラムに対して前
記の処理を施した後に、目的プログラムを結合し、第3
図に示すような実行時プログラム6を生成する。
The processor number determining unit 31 of the linker 3 inputs the target program for the program A in FIG. 2, for example, and checks the programs B and C1 called from the program A, and the program BB called from the program B. Here, program A is ti, program B is 3,
Since program C requests 1 processor and program BB requests 4 processors, for example, 4 processors are secured for program A to prevent requests for additional processors from occurring in the future. Determine the number of processors. Further, the determined number is set in the program by the runtime program generation unit 32. After performing the above processing on the input target program, the runtime program generation unit 32 combines the target programs and generates a third
A runtime program 6 as shown in the figure is generated.

第3図のプログラム実行時において、プログラムAにお
いてプロセッサが確保された後は、プログラムBでプロ
セッサ確保要求がなされても、無視される。また、プロ
グラムBでプロセッサ解放要求がなされても無視される
。プログラムBBにおけるプロセッサの確保/解放要求
も同様に無視される。プログラムB、BBの実行が終了
しプログラムAでプロセッサ解放要求が出されたときに
は、プログラムAがプロセッサを確保したプログラムで
あるので、その要求を受は入れプロセッサを解放する。
When the program shown in FIG. 3 is executed, after a processor is secured in program A, even if a processor reservation request is made in program B, it is ignored. Further, even if a processor release request is made by program B, it is ignored. Processor reservation/release requests in program BB are similarly ignored. When execution of programs B and BB is completed and program A issues a processor release request, since program A is the program that has secured the processor, the request is accepted and the processor is released.

なおプログラムAにおいてプログラムCが呼び出されて
いるがプログラムCは並列に実行されないので、プロセ
ッサの確保/解放はなされない。
Note that although program C is called in program A, since program C is not executed in parallel, the processor is not secured/released.

(発明の効果) 以上説明したように本発明では、コンパイラにおいて、
目的プログラムを生成する際に必要な個数のプロセッサ
を確保し、また必要でなくなった時点でこれを解放する
ような命令列を自動的に生威し、リンカにおいて、コン
パイラで設定されたプロセッサ数のうち適切なものをプ
ログラムで6在保するプロセッサ数として確保するよう
にしているので、必要とするプロセッサを自動的に効率
よく確保/解放することができて、これにより多数のプ
ロセッサの有効利用を図り、プロセッサ確保/解放のオ
ーバーヘッドを自動的に削減することができるという効
果がある。
(Effect of the invention) As explained above, in the present invention, in the compiler,
The linker automatically generates an instruction sequence that allocates the necessary number of processors when generating the target program and releases them when they are no longer needed. Since the appropriate number of processors is secured by the program as the number of reserved processors, the required processors can be automatically and efficiently secured/released, thereby making effective use of a large number of processors. This has the effect of automatically reducing the overhead of securing/releasing processors.

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

第1図は本発明の一実施例のブロック図、第2図は本発
明が適用されるプログラムの一例を示す図、第3図は第
2図に示すプログラムに対して本発明を適用した後のプ
ログラムの状態を示す図である。 第1図において、1・・・ソースプログラム、2・・・
コンパイラ、3・・・リンカ、4・・・目的プログラム
、5・・・他の目的プログラム、6・・・実行時プログ
ラム、21・・・解析部、22・・・並列化部、23・
・・目的プログラム生成部、24・・・中間テキスト、
25並列化中間テキスト、31・・・プロセッサ数確定
部、32・・・実行時プログラム生成部、221・・・
並列性解析部、222・・・プロセンサ数決定部、23
1・・・プロセッサ確保命令列生成部、232・・・通
常命令生成部である。
FIG. 1 is a block diagram of an embodiment of the present invention, FIG. 2 is a diagram showing an example of a program to which the present invention is applied, and FIG. 3 is a diagram showing an example of a program to which the present invention is applied. FIG. 2 is a diagram showing the state of the program. In FIG. 1, 1...source program, 2...
Compiler, 3... Linker, 4... Target program, 5... Other target program, 6... Runtime program, 21... Analysis section, 22... Parallelization section, 23.
...Objective program generation unit, 24...Intermediate text,
25 parallelization intermediate text, 31... processor number determination unit, 32... runtime program generation unit, 221...
Parallelism analysis section, 222...Prosensor number determination section, 23
1... Processor reservation instruction string generation unit, 232... Normal instruction generation unit.

Claims (1)

【特許請求の範囲】[Claims] 1、ソースプログラムを入力して複数個のプロセッサで
動作可能な目的プログラムを生成するコンパイラと、目
的プログラムを入力して実行時プログラムを生成するリ
ンカとを有し、前記コンパイラは、ソースプログラムを
解析して中間テキストを生成する解析手段と、中間テキ
ストを解析して並列動作可能な部分を抽出し、並列化中
間テキストを生成するとともに並列動作させるプロセッ
サ数を決定する並列化手段と、並列化中間テキストから
目的プログラムを生成し、この際に前記並列化手段で決
定された数のプロセッサを確保するような命令列を生成
し、また該プロセッサを必要でなくなった時点で解放す
るような命令列を生成する目的プログラム生成手段とを
備え、前記リンカは、全ての目的プログラムに対して該
目的プログラムと関連している目的プログラムを調べ、
前記コンパイラで設定されたプロセッサ数のうち適切な
ものを当該プログラムで確保するプロセッサ数として確
定し、プログラム中に埋め込むプロセッサ数確定手段と
、必要な目的プログラムを結合し実行時プログラムを生
成する実行時プログラム生成手段とを備えていることを
特徴とする並列化処理方式。
1. It has a compiler that inputs a source program and generates a target program that can be run on multiple processors, and a linker that inputs the target program and generates a runtime program, and the compiler analyzes the source program. a parallelizing means that analyzes the intermediate text to extract parts that can be operated in parallel, generates a parallelized intermediate text, and determines the number of processors to operate in parallel; Generate a target program from text, and at this time generate an instruction sequence that secures the number of processors determined by the parallelization means, and also generate an instruction sequence that releases the processors when they are no longer needed. and a target program generating means for generating a target program, the linker checks target programs related to the target program for all target programs,
A means for determining the number of processors to be set in the program by determining an appropriate number of processors set by the compiler as the number of processors to be secured in the program, and a means for determining the number of processors to be embedded in the program, and a runtime program for generating a runtime program by combining a necessary target program. A parallel processing method characterized by comprising: program generation means.
JP17805289A 1989-07-12 1989-07-12 Paralleled process system Pending JPH0343835A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP17805289A JPH0343835A (en) 1989-07-12 1989-07-12 Paralleled process system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP17805289A JPH0343835A (en) 1989-07-12 1989-07-12 Paralleled process system

Publications (1)

Publication Number Publication Date
JPH0343835A true JPH0343835A (en) 1991-02-25

Family

ID=16041763

Family Applications (1)

Application Number Title Priority Date Filing Date
JP17805289A Pending JPH0343835A (en) 1989-07-12 1989-07-12 Paralleled process system

Country Status (1)

Country Link
JP (1) JPH0343835A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5752030A (en) * 1992-08-10 1998-05-12 Hitachi, Ltd. Program execution control in parallel processor system for parallel execution of plural jobs by selected number of processors

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5752030A (en) * 1992-08-10 1998-05-12 Hitachi, Ltd. Program execution control in parallel processor system for parallel execution of plural jobs by selected number of processors

Similar Documents

Publication Publication Date Title
KR20120068572A (en) Apparatus and method for compilation of program on multi core system
US20100229161A1 (en) Compile method and compiler
US10007495B2 (en) Code generation method for scheduling processors using hook function and exception handling function
JP6428476B2 (en) Parallelizing compilation method and parallelizing compiler
JPS6184740A (en) Generating system of general-use object code
JPH0343835A (en) Paralleled process system
US6134708A (en) Program compilation execution system
JPH09293057A (en) Task allocation method in hierarchical structure type multiprocessor system
JP2910676B2 (en) Load equalizer
JP2817349B2 (en) Parallel processing method
JPH0991258A (en) Hierarchical parallel compiler
JP2560491B2 (en) Parallelized procedure execution method
US20090187895A1 (en) Device, method, program, and recording medium for converting program
Obuchi et al. Efficient translation and execution method for automated parallel processing system by using valgrind
JP2576659B2 (en) Task common area allocation method
JP2000020482A (en) Loop parallelizing method
JP2001184320A (en) Distributed executing device and recording medium
JP2682215B2 (en) Procedure call method during parallel processing
JPH05204875A (en) Scheduling system for thread
JPH0573332A (en) Parallel translation system for source program
JP2518504B2 (en) Target program generator
Quammen et al. A risc architecture for multitasking
JPH02163831A (en) Object program reduction system
JPH0744507A (en) Compile method for parallel program
JPH03257534A (en) Memory allocating system