JP3951230B2 - Program allocation control method, program, and program allocation control system - Google Patents
Program allocation control method, program, and program allocation control system Download PDFInfo
- Publication number
- JP3951230B2 JP3951230B2 JP2002269762A JP2002269762A JP3951230B2 JP 3951230 B2 JP3951230 B2 JP 3951230B2 JP 2002269762 A JP2002269762 A JP 2002269762A JP 2002269762 A JP2002269762 A JP 2002269762A JP 3951230 B2 JP3951230 B2 JP 3951230B2
- Authority
- JP
- Japan
- Prior art keywords
- parallel
- program
- processor
- processing
- parallel program
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Description
【0001】
【発明の属する技術分野】
本発明は、汎用あるいは特定の用途を持ったコンピュータシステムにおいて、特に、複数のプロセッサを用いたジョブの多重スケジューリングに関するものである。
【0002】
【従来の技術】
複数のプロセッサ(CPU、MPU)を用いて実行される並列プログラムは、いくつかのプロセスやスレッドなどの処理単位に分割され、各々、別のプロセッサ上で並列に動作する。各プロセッサ上で並列に動作する処理単位は、互いにデータをやりとりしながら、全体として一つの結果を導き出す。
【0003】
このように実行される並列プログラムでは、あるチェックポイントごとに同期して実行が行われる。このとき、相手の処理単位が、そのチェックポイントに達していない場合、相手の処理単位とのデータのやりとりが行えず、いわゆる同期待ちが生じる。
【0004】
並列コンピュータシステムで、複数の並列プログラムが多重に実行される場合、複数のプロセッサ間の相互で協調することなく並列プログラムの各処理単位をスケジューリングすると、各プロセッサで実行される処理単位の実行時間差のために、同期待ち時間が大きくなるという課題がある。
【0005】
この同期待ち時間の増大を避けるために、プロセッサ間の相互で協調したスケジューリングを行う技術として、福田晃著「並列オペレーティングシステム」(株式会社コロナ社、1997年発行)(ISBN4−339−02587−9)の第56頁から第62頁に記載のものがある。
【0006】
ここでは、並列プログラムの並列プロセスをタイムスライスの間同時実行し、その後、グローバルなスケジューラがよばれ、次に実行するプロセスを選び、各プロセッサに通知するといった、プロセスのスケジューリング技術が示されている。
【0007】
また、特開平10−74150号公報においては、複数のプロセッサ上で並列プロセスを実行するため、一定期間のプロセスの開始、停止時刻をあらかじめ決定したプログラム割当て表を作成し、各プロセッサに通知しておき、各プロセッサでは、それにしたがってプロセスを実行する、プロセスのスケジューリング技術が記載されている。
【0008】
しかしながら、ほとんどの並列プログラムでは、並列演算処理の合間に、データの読み込みや書き出し等の逐次的な処理(逐次処理)を必要とし、特に大量のデータの読み込みや書き出しを行なうプログラムにおいては、一回の逐次処理の処理時間が、数ms〜数秒等、並列処理に較べて長時間にわたる場合がある。
【0009】
上記の従来技術においては、このような逐次処理を行なっている間、逐次処理を行なっている処理単位以外の処理単位が、並列演算処理の開始を待つアイドルループを行うため、上述のように大量のデータの読み込みや書き出しを行なうプログラムにおいては、計算機システムの実際の演算に対する稼働率が低下してしまう。
【0010】
【発明が解決しようとする課題】
解決しようとする問題点は、従来の技術では、並列プログラムにおいて、逐次的な処理(逐次処理)を行なっている間、この逐次処理を行なっている処理単位以外の処理単位が、並列演算処理の開始を待つアイドルループを行うため、例えば大量のデータの読み込みや書き出しを行なうプログラムにおいては一回の逐次処理の処理時間が長時間にわたる場合があり、計算機システムの実際の演算に対する稼働率が低下してしまう点である。
【0011】
本発明の目的は、これら従来技術の課題を解決し、複数の並列プログラム、及び逐次プログラムを多重に実行する複数のプロセッサを有するコンピュータシステムにおける各プロセッサの稼働率を向上させることである。
【0012】
【課題を解決するための手段】
上記目的を達成するため、本発明では、並列プログラムの逐次処理中には、この逐次処理処理にのみ独立したプロセッサを割り当て、空いたプロセッサに他の並列プログラムや逐次プログラムを割り当て、並列演算処理の開始時に、並列プログラムの全ての並列演算処理に独立したプロセッサを同時に割り当てる。尚、例えば、並列演算処理の終了後の逐次処理が、一定時間、並列演算処理の開始が行なわれなかった場合に、並列プログラムの逐次処理にのみ独立したプロセッサを割り当てる。このことにより、短時間の逐次処理の開始、及び、並列演算処理の開始で、頻繁なプロセッサの割り当て変更によるオーバヘッドを低減する。また、定期的なスケジュール切り替え時に、次にスケジュールする並列プログラムが、逐次処理中か並列演算処理中かを判断し、逐次処理中には、並列プログラムの逐次処理にのみ独立したプロセッサを割り当て、並列演算処理の開始時に、並列プログラムの全ての並列演算処理に独立したプロセッサを同時に割り当てる。このことにより、各々の並列演算処理が不均一であった場合に断片的に発生するプロセッサの割り当て変更によるオーバヘッドを低減する。
【0013】
【発明の実施の形態】
以下、本発明の実施の形態を、図面により詳細に説明する。
【0014】
図1は、本発明に係わるプログラム割当制御システムの第1の構成例を示すブロック図である。
【0015】
図1におけるプログラム割当制御システムは、CPU(Central Processing Unit)や主メモリ、表示装置、入力装置、外部記憶装置等からなるコンピュータシステムであり、光ディスク駆動装置等を介してCD−ROM等の記憶媒体に記録されたプログラムやデータを外部記憶装置内にインストールした後、この外部記憶装置から主メモリに読み込みCPUで処理することにより、本発明に係わるマルチプロセッサのスケジュール処理を行う各機能を構築する。
【0016】
図1において、プロセッサ群1000は、例えばCPUやMPUからなる4台のプロセッサ1100〜1400によって構成されている。各プロセッサ1100〜1400は、プロセッサ1100において示すように、並列演算処理の開始と終了の同期点到達を検知するバリア同期待ち機構1110を備える。
【0017】
並列プログラムスケジューラ2000は、プロセッサ割り当て済みキュー3000とプロセッサ割り当て待ちキュー4000と、空きプロセッサ数5000(カウンタ)と、空きプロセッサビットマップ5100とを有し、プロセッサ1100〜1400へ割り当てる並列プログラムのスケジュールを管理する。
【0018】
各並列プログラムは、並列プログラム3100において示すように、任意の数の演算処理を管理するテーブル(図中及び以降「演算処理」と記載)3110と、各演算処理3110が演算を行なっているかどうかを示す演算フラグ3120と、並列プログラムの演算処理数3130と、並列プログラムの実際に演算を行なっている演算処理数を示す演算処理実行数3140と、並列プログラムの優先度3150と、並列プログラムにプロセッサが割り当てられているかどうかを示すスケジュールフラグ3160とを保持している。
【0019】
尚、本例では、並列プログラムの実際に演算を行なっている演算処理数を示す演算処理実行数3140を保持するとしているが、例えば、並列プログラムの演算処理の起動待ちを行なう演算起動待ち数などのような、簡単な計算によって、並列プログラムの実際に演算を行なっている演算処理実行数が求められる情報を保持しても良い。
【0020】
このような構成により、本例のプログラム割当制御システムでは、一つの連続する演算を複数の処理単位(プロセスやスレッドなど)に分け、複数のプロセッサに割り当てて並列に処理する並列プログラムを実行する際、並列プログラムでの逐次演算処理の開始を検知すると、逐次演算処理に対してはプロセッサを割り当て、逐次演算処理が完了するまで、当該並列プログラムの並列演算処理に対してのプロセッサの割り当ては保留する。
【0021】
以下、並列プログラムスケジューラ2000による各プロセッサへの並列プログラムのスケジュール処理手順について、図2から図5を用いて説明する。
【0022】
図2は、図1における並列プログラムスケジューラによる並列プログラムのスケジュール処理手順例を示すフローチャートである。
【0023】
図1における並列プログラムスケジューラ2000は、定期的に、優先度3150などで決定するプロセッサの割り当て率に従い、プロセッサ割り当て済みキュー3000につなげた並列プログラム3100〜3300と、プロセッサ割り当て待ちキュー4000につなげた並列プログラム4100〜4300とを入れ替えるスケジュール切り替え処理を行なう。
【0024】
先ず、ステップS101において、プロセッサ割り当て待ちキュー4000に並列プログラムが存在するかどうかを判断する。このステップS101で、プロセッサ割り当て待ちキュー4000に並列プログラムが存在しない場合、ステップS107において、次のスケジュールタイミングとなるまでスリープする。
【0025】
前述のステップS101で、プロセッサ割り当て待ちキュー4000に並列プログラムが存在する場合、ステップS102において、プロセッサ割り当て待ちキュー4000に存在する並列プログラムの優先度3150を、プロセッサの割り当て待ち時間に応じて高い優先度3150に変更する。
【0026】
次に、ステップS103において、プロセッサ割り当て済みキュー3000に並列プログラムが存在するか否かを判断する。このステップS103で、プロセッサ割り当て済みキュー3000に並列プログラムが存在する場合、ステップS104において、プロセッサ割り当て済みキュー3000に存在する並列プログラムの優先度3150を、プロセッサの割り当て時間に応じて低い優先度3150に変更する。
【0027】
次に、ステップS105において、前述のステップS102、及びステップS104で変更された、プロセッサ割り当て済みキュー3000、及びプロセッサ割り当て待ちキュー4000の各並列プログラムの優先度3150に従って、プロセッサ割り当て済みキュー3000の並列プログラムと、プロセッサ割り当て待ちキュー4000の並列プログラムとの入れ替え処理を行なうスケジュール選択処理を呼び出す。このスケジュール選択処理の詳細については、図3を用いて後述する。
【0028】
次に、ステップS106において、前述のステップS105により変更されたプロセッサ割り当て済みキュー3000に従って、並列プログラムの各演算処理を各プロセッサへ同時に割り当てる処理である、スケジュール切替処理を呼び出し、その後、ステップS107において、次のスケジュールタイミングとなるまでスリープする。尚、ステップS106におけるスケジュール切替処理の詳細については、図4を用いて後述する。
【0029】
図3は、図1の並列プログラムスケジューラによる各プロセッサへの並列プログラムのスケジュール処理におけるスケジュール選択処理手順例を示すフローチャートである。
【0030】
本図3に示す処理例は、図2におけるステップS105でのスケジュール選択処理の詳細を示すものであり、先ず、ステップS201において、プロセッサ割り当て済みキュー3000に並列プログラムが存在するか否かを判断する。
【0031】
このステップS201での判断で、プロセッサ割り当て済みキュー3000に並列プログラムが存在しない場合、後述のステップS210以降を処理する。また、プロセッサ割り当て済みキュー3000に並列プログラムが存在する場合、ステップS202において、プロセッサ割り当て待ちキュー4000に、並列プログラムが存在するか否かを判断する。
【0032】
このステップS202で、プロセッサ割り当て待ちキュー4000に、並列プログラムが存在しない場合、ステップS214において、スケジュール選択処理を終了する。
【0033】
前述のステップS202で、プロセッサ割り当て待ちキュー4000に、並列プログラムが存在する場合、ステップS203において、プロセッサ割り当て待ちキュー4000につなげた中で最も優先度3150の高い並列プログラム(A)を選択する。
【0034】
次に、ステップS204において、前述のステップS203で選択した最も優先度3150の高い並列プログラム(A)の演算処理実行数3140と、空きプロセッサ数5000との比較を行なう。
【0035】
ここで、並列プログラム(A)の演算処理数3130ではなく、演算処理実行数3140を使用することにより、実際に演算を行なっておらず、並列演算の開始待ち処理を行なっている演算処理の数は、空きプロセッサ数5000との比較の対象外とする。尚、この演算処理実行数3140の詳細については、図7を用いて後述する。
【0036】
前述のステップS204で、最も優先度の高い並列プログラム(A)の演算処理実行数3140が、空きプロセッサ数以下である場合、ステップS205において、この最も優先度の高い並列プログラム(A)を、プロセッサ割り当て待ちキュー4000から取り出し、プロセッサ割り当て済みキュー3000に挿入する。その後、ステップS202の処理に戻り、処理を繰り返す。
【0037】
前述のステップS204で、最も優先度の高い並列プログラム(A)の演算処理実行数3140が、空きプロセッサ数を超える場合、ステップS206において、プロセッサ割り当て済みキュー3000につなげた中で最も優先度3150の低い並列プログラム(B)を選択する。
【0038】
そして、ステップS207において、前述のステップS203で選択した最も優先度の高い並列プログラム(A)の優先度と、前述のステップS206で選択した最も優先度の低い並列プログラム(B)の優先度との比較を行なう。
【0039】
このステップS207で、前述のステップS203で選択した最も優先度の高い並列プログラム(A)の優先度が、前述のステップS206で選択した最も優先度の低い並列プログラム(B)の優先度以下である場合、後述のステップS210以降を処理する。
【0040】
また、ステップS207で、前述のステップS203で選択した最も優先度の高い並列プログラム(A)の優先度が、前述のステップS206で選択した最も優先度の低い並列プログラム(B)の優先度より大きい場合、ステップS208において、並列プログラム(B)をプロセッサ割り当て済みキュー3000より取り出し、プロセッサ割り当て待ちキュー4000に挿入する。
【0041】
そして、ステップS209において、空きプロセッサ数5000から、前述のステップS208でプロセッサ割り当て待ちキュー4000に移動した並列プログラム(B)の演算処理実行数3140を減算する。
【0042】
その後、ステップS204に戻り、ステップS204からステップS209の処理を繰り返して、優先度にしたがってプロセッサ割り当て済みキュー3000の並列プログラムとプロセッサ割り当て待ちキュー4000の並列プログラムとのスケジュール入れ替え処理を行う。
【0043】
また、ステップS210においては、すなわち、前述のステップS207で、前述のステップS203で選択した最も優先度の高い並列プログラム(A)の優先度が、前述のステップS206で選択した最も優先度の低い並列プログラム(B)の優先度以下である場合、プロセッサ割り当て待ちキュー4000につなげた中で最も優先度が高く、空きプロセッサ数5000以下の演算処理実行数3140である並列プログラム(C)を選択する。
【0044】
尚、このステップS210で、プロセッサ割り当て待ちキュー4000につなげた中で最も優先度が高く、演算処理実行数3140が空きプロセッサ数5000以下である並列プログラム(C)が存在しない場合には、ステップS211に示すようにして、前述のステップS214の処理に進み、スケジュール選択処理を終了する。
【0045】
また、ステップS211で、プロセッサ割り当て待ちキュー4000につなげた中で最も優先度が高く、演算処理実行数3140が空きプロセッサ数5000以下である並列プログラム(C)が存在する場合、ステップS212において、当該並列プログラム(C)を、プロセッサ割り当て待ちキュー4000から取り出し、プロセッサ割り当て済みキュー3000に挿入する。
【0046】
そして、ステップS213において、空きプロセッサ数5000から、前述のステップS212でプロセッサ割り当て済みキュー3000に移動した並列プログラム(C)の演算処理実行数3140を減算する。その後、ステップS210の処理に戻り、空きプロセッサへのスケジュール選択処理を繰り返す。
【0047】
図4は、図1の並列プログラムスケジューラによる各プロセッサへの並列プログラムのスケジュール処理におけるスケジュール切替処理手順例を示すフローチャートである。
【0048】
本図4に示す処理例は、図2におけるステップS106でのスケジュール切替処理の詳細を示すものであり、先ず、ステップS301において、プロセッサ割り当て待ちキュー4000の先頭の並列プログラム(D)を選択する。
【0049】
次に、ステップS302において、前述のステップS301での選択対象である並列プログラム(D)が存在するか否かを判断し、当該並列プログラム(D)が存在しない場合、後述のステップS307以降の処理を行う。
【0050】
前述のステップS302で、並列プログラム(D)が存在する場合、ステップS303において、並列プログラム(D)のスケジュールフラグ3160が、プロセッサが割り当てられていることを示す「TRUE」であるか、プロセッサが割り当てられていないことを示す「FALSE」であるかを判断する。
【0051】
このステップS303の判断で、並列プログラム(D)のスケジュールフラグ3160が「FALSE」である場合、ステップS306において、プロセッサ割り当て待ちキューの4000の次の並列プログラム(D)を選択する。
【0052】
また、ステップS303の判断で、並列プログラム(D)のスケジュールフラグ3160が「TRUE」である場合、ステップS304において、並列プログラム(D)のプロセッサが割り当てられた演算処理を停止し、その演算処理へのプロセッサの割り当てを解除する。
【0053】
その後、ステップS305において、並列プログラム(D)のスケジュールフラグ3160を、プロセッサが割り当てられていないことを示す「FALSE」に変更し、ステップS306において、プロセッサ割り当て待ちキュー4000の次の並列プログラム(D)を選択する。
【0054】
このような、ステップS302からステップS306の繰り返しにより、プロセッサ割り当て待ちキュー4000の全ての並列プログラムの各々の演算処理へのプロセッサ割り当てを解除し、停止させ、その後、ステップS307において、プロセッサ割り当て済みキュー3000の先頭の並列プログラム(E)を選択する。
【0055】
次のステップS308においては、このステップS307で選択する並列プログラム(E)が存在するか否かを判断し、当該並列プログラム(E)が存在しない場合、ステップS313において、スケジュール切替処理を終了する。
【0056】
また、並列プログラム(E)が存在する場合には、ステップS309において、この並列プログラム(E)のスケジュールフラグ3160が、プロセッサが割り当てられていることを示す「TRUE」であるか、プロセッサが割り当てられていないことを示す「FALSE」であるかを判断する。
【0057】
このステップS309での判断結果が、並列プログラム(E)のスケジュールフラグ3160が、プロセッサが割り当てられていることを示す「TRUE」である場合、ステップS312において、プロセッサ割り当て済みキュー3000の次の並列プログラム(E)を選択する。
【0058】
また、前述のステップS309で、並列プログラム(E)のスケジュールフラグ3160が、プロセッサが割り当てられていないことを示す「FALSE」である場合、ステップS310において、当該並列プログラム(E)の演算処理に対し、プロセッサ割り当て処理を行なう。尚、このプロセッサ割り当て処理の詳細については、図5を用いて後述する。
【0059】
次に、ステップS311において、並列プログラム(D)のスケジュールフラグ3160を、プロセッサが割り当てられていることを示す「TRUE」に変更する。その後、ステップS312において、プロセッサ割り当て済みキュー3000の次の並列プログラム(E)を選択し、前述のステップS308の処理に戻る。
【0060】
そして、このステップS312で選択した、プロセッサ割り当て済みキュー3000の次の並列プログラム(E)に対して、ステップS308からステップS312の処理を行なうことで、プロセッサ割り当て済みキューの全ての並列プログラムの、全ての演算実行中である演算処理に、独立したプロセッサを割り当て、動作させる。
【0061】
図5は、図1の並列プログラムスケジューラによる各プロセッサへの並列プログラムのスケジュール処理におけるプロセッサ割り当て処理手順例を示すフローチャートである。
【0062】
本図5に示す処理例は、図4におけるステップS310でのプロセッサ割り当て処理の詳細を示すものであり、先ず、ステップS401において、プロセッサを割り当てる並列プログラム(E)の先頭の演算処理(T)を選択する。
【0063】
このステップS401で選択した演算処理(T)が存在するか否かを、ステップS402において判断し、演算処理(T)が存在しない場合、ステップS411において、プロセッサ割り当て処理を終了する。
【0064】
また、ステップS402で、演算処理(T)が存在する場合、ステップS403において、演算処理(T)の演算フラグ3120が、演算処理実行中であることを示す「TRUE」であるか、演算処理実行待ちであることを示す「FALSE」であるかを判断する。尚、演算フラグ3120の詳細については、図7を用いて後述する。
【0065】
ステップS403での判断結果が、演算処理(T)の演算フラグ3120が、演算処理実行待ちであることを示す「FALSE」である場合、プロセッサの割り当てを行わずに、ステップS410において、並列プログラム(E)の次の演算処理(T)を選択する。
【0066】
また、前述のステップS403での判断結果が、演算処理(T)の演算フラグ3120が、演算処理実行中であることを示す「TRUE」である場合、ステップS404において、空きプロセッサビットマップ5100より、空き状態のプロセッサ(P)を一つ選択する。そして、選択したプロセッサ(P)のビットを、ステップS405において、クリアする。
【0067】
次に、ステップS406において、プロセッサ割り当て待ちキュー4000にプロセッサ割り当て待ちの並列プログラムが存在するか否かを判断する。
【0068】
プロセッサ割り当て待ちの並列プログラムが存在する場合、ステップS407において、プロセッサ(P)のバリア同期待ち機構1110に対し、バリア同期待ち命令の発行をトラップするように設定する。尚、このバリア同期待ち命令の発行時のトラップ処理の詳細については、図7を用いて後述する。
【0069】
また、ステップS406において、プロセッサ割り当て待ちキュー4000にプロセッサ割り当て待ちの並列プログラムが存在しない場合、ステップS408において、並列プログラム(E)の演算処理数3130が演算処理実行数3140と等しいか否かを判断する。
【0070】
このステップS408での判断結果において、並列プログラム(E)の演算処理数3130が演算処理実行数3140と等しくない場合、ステップS407の処理を行う。すなわち、プロセッサ(P)のバリア同期待ち機構1110に対し、バリア同期待ち命令の発行をトラップするように設定する。
【0071】
また、前述のステップS408での判断結果において、並列プログラム(E)の演算処理数3130が演算処理実行数3140と等しい場合、ステップS409において、当該プロセッサ(P)に当該演算処理(T)をディスパッチ(割り当て)する。
【0072】
そして、ステップS410において、並列プログラム(E)の次の演算処理(T)を選択し、ステップS402に戻り、前述のステップS402からステップS410の処理を繰り返す。このようにして、並列プログラム(E)へのプロセッサ割り当て処理を行う。
【0073】
次に、図6を用いて、本例のプログラム割当制御システムによる並列プログラムの制御動作について説明する。
【0074】
図6は、図1のプログラム割当制御システムにおける並列プログラムの制御動作例を示す説明図である。
【0075】
プロセッサ1100〜1400までの4台のプロセッサには、並列プログラム3100の演算処理3121〜3124が、それぞれ独立して割り当てられ、時刻T501〜T503の流れで、逐次処理と並列演算処理とを交互に繰り返し実行している。
【0076】
並列プログラム3100の演算処理3121は、並列演算処理に加え、逐次処理を行なう代表の演算処理とし、演算処理3122〜3124は、並列演算処理のみを行なう演算処理とする。
【0077】
先ず、時刻T501において、演算処理3121が逐次処理を開始し、演算処理3122〜3124は、バリア同期待ち命令を発行して、次の並列演算処理が開始を示すバリア同期の確立を待ち合わせる。
【0078】
このとき、図5を用いて説明したステップS407での処理によりバリア同期待ち命令トラップを設定している場合、図7を用いて後述するバリア同期待ちトラップ処理が動作する。
【0079】
次に、時刻T502において、演算処理3121は、逐次処理を完了し、並列演算処理を行なうためにバリア同期命令を発行する。
【0080】
この演算処理3121のバリア同期命令の発行により、前述の時刻T501でバリア同期を発行していた各演算処理3122〜3124のバリア同期待ちが解除され、各演算処理3121〜3124で、並列演算処理を開始する。
【0081】
そして、時刻T503において、各演算処理3121〜3124の並列演算処理が完了し、演算処理3121が逐次処理を開始し、残りの演算処理3122〜3124は、バリア同期命令を発行して、次の並列演算処理が開始を示すバリア同期の確立を待ち合わせる。
【0082】
以下、図7を用いて、バリア同期待ちトラップ処理を説明する。
【0083】
図7は、図1の並列プログラムスケジューラによる各プロセッサへの並列プログラムのスケジュール処理におけるバリア同期待ちトラップ処理手順例を示すフローチャートである。
【0084】
本図7に示すバリア同期待ちトラップ処理600は、前述の図6の時刻T501において各演算処理3122〜3124がバリア同期待ち命令を発行して、バリア同期確立の待ち合わせ処理を行った際に、前述の図5のプロセッサ割り当て処理でのステップS407においてバリア同期待ち命令の発行をトラップするように設定されている場合のバリア同期待ち例外に対する処理である。
【0085】
先ず、ステップS601において、バリア同期待ちトラップが発生したプロセッサに割り当てられた演算処理3110に対応する演算フラグ3120を「FALSE」に変更する。
【0086】
次に、ステップS602において、バリア同期待ちトラップが発生したプロセッサに割り当てられた演算処理3110が属する並列プログラム3100の演算処理実行数3140を1減算する。また、ステップS603において、バリア同期待ちトラップが発生したプロセッサへの演算処理3110の割り当てを解除する。
【0087】
そして、ステップS604において、前述のステップS602で減算した並列プログラム3100の演算処理実行数3140が「0」より大きいかどうかを判断する。演算処理実行数3140が「0」より大きい場合、後述のステップS607からのステップを行う。
【0088】
また、演算処理実行数3140が「0」である場合、ステップS605において、トラップが発生した演算処理3110が属する並列プログラム3100の演算処理実行数3140を、演算処理数3130の値とする。
【0089】
さらに、ステップS606において、トラップが発生した演算処理3110が属する並列プログラム3100の全ての演算処理の演算フラグ3120を「TRUE」に変更する。
【0090】
そして、ステップS607において、他のプロセッサで同様のバリア同期待ちトラップが発生し、これを保留しているかどうかを判断する。保留中のバリア同期待ちトラップが存在する場合、前述のステップS601からステップS607の処理を繰り返す。
【0091】
また、保留中のバリア同期待ちトラップが存在しない場合、ステップS608において、図2から図5を用いて前述した並列プログラムスケジューラ処理を行い、ステップS609において、バリア同期待ちトラップ処理を終了する。
【0092】
次に、図8を用いて、本例の並列プログラムスケジューラによる並列プログラムの動作制御について、特に、複数の並列プログラムが多重に実行される場合を例に説明する。
【0093】
すなわち、図1のプログラム割当制御システムにおいて、一つの連続する演算を複数の処理単位に分けて並列に処理する並列プログラムを、複数のプロセッサで多重に実行する際、処理中の並列プログラムAでの逐次演算処理の開始を検知すると、この逐次演算処理にはプロセッサを割り当てるが、並列プログラムAの並列演算処理に対しては、そのプロセッサの割り当てを解除し、このように割り当てを解除したプロセッサを、他の並列プログラムBの並列演算処理に割り当てるものである。
【0094】
図8は、図1のプログラム割当制御システムにおける多重に実行された複数の並列プログラムの動作制御例を示す説明図である。
【0095】
本例では、プロセッサ1100〜1400の4台のプロセッサで、並列プログラムAと並列プログラムBの2つの並列プログラムが多重に動作しているものとする。また、並列プログラムAは4つの演算処理を持つ4並列の並列プログラムであり、並列プログラムBは3つの演算処理を持つ3並列の並列プログラムであるものとする。
【0096】
先ず、時刻T701において、並列プログラムAがスケジュールされており、並列プログラムAの演算処理A3121〜A3124のそれぞれが、プロセッサ1100〜1400に割り当てられ、並列演算処理を実行している。このとき、並列プログラムBは、プロセッサ割り当て待ちキュー4000に接続されて、次のプロセッサ割り当て待ちとなっている。
【0097】
次に、時刻T702において、並列プログラムAの並列演算処理が完了し、演算処理A3121が逐次処理を開始し、並列プログラムAの演算処理A3122〜A3124は、次の並列演算処理のためのバリア同期待ち命令を発行する。
【0098】
このバリア同期待ち命令の発行により、バリア同期待ちトラップが発生し、図7を用いて説明したバリア同期待ちトラップ処理600により、並列プログラムAの演算処理A3122〜A3124のプロセッサ1200〜1400への割り当てが解除され、図2〜図5を用いて説明した並列プログラムスケジューラ2000の動作により、並列プログラムBの演算処理B3121〜B3123が、プロセッサ1200〜1400に割り当てられ、並列プログラムBの並列演算処理を実行する。
【0099】
さらに、時刻T703において、並列プログラムAの逐次処理が完了し、演算処理A3121がバリア同期待ち命令を発行する。このバリア同期待ち命令の発行により、バリア同期待ちトラップが発生し、図7を用いて説明したバリア同期待ちトラップ処理600により、一旦、演算処理A3121のプロセッサ1100への割り当てが解除され、図2〜図5を用いて説明した並列プログラムスケジューラ2000の動作によって、プロセッサ使用量などを考慮した優先度に従って、並列プログラムAのスケジュールが決定し、並列プログラムAの演算処理A3121〜A3124がプロセッサ1100〜1400に割り当てられ、並列プログラムAの並列演算処理を実行する。
【0100】
そして、時刻T704において、図2を用いて説明したように並列プログラムスケジューラ2000が定期的な動作を開始し、プロセッサ使用量などを考慮した優先度に従って、並列プログラムBのスケジュールを決定し、並列プログラムBの演算処理B3121〜B3123がプロセッサ1200〜1400に割り当てられ、並列プログラムBの並列演算処理を実行する。
【0101】
次に、図9〜図11を用いて、本発明に係わるプログラム割当制御システムの他の実施形態について説明する。
【0102】
図9は、本発明に係わるプログラム割当制御システムの第2の構成例を示すブロック図である。
【0103】
本図9に示すプログラム割当制御システムにおいては、図1で示したプログラム割当制御システムにおけるプロセッサ1100〜1400のそれぞれに、バリア同期待ちタイマ1120を設けた構成となっている。
【0104】
そして、本例におけるマルチプロセッサのスケジュール方法には、図2〜図4を用いて説明した、並列プログラムスケジューラの処理手順に加えて、図10で説明するプロセッサ割り当て処理手順を含む。
【0105】
以下、図10を用いて、図9に示す構成のプログラム割当制御システムにおけるプロセッサ割り当て処理手順を説明する。
【0106】
図10は、図9のプログラム割当制御システムにおける並列プログラムスケジューラによる各プロセッサへの並列プログラムのスケジュール処理におけるプロセッサ割り当て処理手順例を示すフローチャートである。
【0107】
先ず、ステップS801において、プロセッサを割り当てる並列プログラム(E)の先頭の演算処理(T)を選択し、ステップS802において、この選択した演算処理(T)が存在するか否かを判断する。
【0108】
演算処理(T)が存在しない場合、ステップS811において、プロセッサ割り当て処理を終了し、演算処理(T)が存在する場合、ステップS803において、演算処理(T)の演算フラグ3120が、演算処理実行中であることを示す「TRUE」であるか、演算処理実行待ちであることを示す「FALSE」であるかを判断する。
【0109】
この演算処理(T)の演算フラグ3120が演算処理実行待ちであることを示す「FALSE」である場合、プロセッサの割り当てを行わずに、ステップS810において、並列プログラム(E)の次の演算処理(T)を選択し、また、演算処理(T)の演算フラグ3120が、演算処理実行中であることを示す「TRUE」である場合、ステップS804において、空きプロセッサビットマップ5100より、空き状態のプロセッサ(P)を一つ選択する。
【0110】
そして、ステップS805において、空きプロセッサビットマップ5100の前述のステップS804で選択したプロセッサ(P)のビットをクリアし、さらに、ステップS806において、プロセッサ割り当て待ちキュー4000にプロセッサ割り当て待ちの並列プログラムが存在するか否かを判断する。
【0111】
プロセッサ割り当て待ちキュー4000にプロセッサ割り当て待ちの並列プログラムが存在する場合、ステップS807において、プロセッサ(P)のバリア同期待ちタイマ1120に対し、バリア同期待ちのタイムアウトを設定する。尚、バリア同期待ちのタイムアウトが発生した場合、図1に示した構成のシステムにおける図7を用いて説明したバリア同期待ちトラップ処理が実施される。
【0112】
前述のステップS806で、プロセッサ割り当て待ちキュー4000にプロセッサ割り当て待ちの並列プログラムが存在しない場合、ステップS808において、並列プログラム(E)の演算処理数3130が演算処理実行数3140と等しいか否かを判断する。
【0113】
並列プログラム(E)の演算処理数3130が演算処理実行数3140と等しくない場合、ステップS807において、プロセッサ(P)のバリア同期待ちタイマ1120に対し、バリア同期待ちのタイムアウトを設定する。
【0114】
その後、あるいは、並列プログラム(E)の演算処理数3130が演算処理実行数3140と等しい場合、ステップS809において、プロセッサ(P)に演算処理(T)をディスパッチ(割り当て)する。
【0115】
そして、ステップS810において、並列プログラム(E)の次の演算処理(T)を選択し、ステップS802に戻り、このステップS802からステップS810の処理を繰り返すことで、並列プログラム(E)へのプロセッサ割り当て処理を行う。
【0116】
次に、図11を用いて、本例の並列プログラムスケジューラによる並列プログラムの動作制御手順について、特に、複数の並列プログラムを多重に実行する場合に、逐次演算処理の開始を検知した際、この逐次演算処理が所定時間経過した後に、逐次演算処理に対するプロセッサの割り当てと、並列演算処理に対するプロセッサの割り当ての解除・保留を行う動作を説明する。
【0117】
図11は、図9のプログラム割当制御システムにおける多重に実行された複数の並列プログラムの動作制御例を示す説明図である。
【0118】
ここでは、プロセッサ1100〜1400の4台のプロセッサで、並列プログラムAと並列プログラムBの2つの並列プログラムが多重に動作しているものとする。また、並列プログラムAは4つの演算処理を持つ4並列の並列プログラムであり、並列プログラムBは3つの演算処理を持つ3並列の並列プログラムであるものとする。
【0119】
先ず、時刻T901において、並列プログラムAがスケジュールされており、並列プログラムAの演算処理A3121〜A3124のそれぞれが、プロセッサ1100〜1400に割り当てられ、並列演算処理を実行している。このとき、並列プログラムBは、プロセッサ割り当て待ちキュー4000に接続されて、次のプロセッサ割り当て待ちとなっている。
【0120】
次の時刻T902において、並列プログラムAの並列演算処理が完了し、演算処理A3121が逐次処理を開始し、並列プログラムAの演算処理A3122〜A3124は、次の並列演算処理のためのバリア同期待ち命令を発行する。
【0121】
このバリア同期待ち命令の発行により、バリア同期待ちタイマ1120の動作が開始される。バリア同期待ちタイマ1120は、時間の経過とともに減算されてタイマが「0」になった時点でバリア同期待ちトラップを発生させる。
【0122】
そして、時刻T903において、並列プログラムAの逐次処理が完了し、演算処理A3121がバリア同期待ち命令を発行する。これにより、演算処理A3121〜A3124の全ての演算処理でバリア同期待ちが発行されたことにより、バリア同期が成立し、一斉に並列演算処理を開始する。
【0123】
さらに、時刻T904において、並列プログラムAの並列演算処理が完了し、演算処理A3121が逐次処理を開始し、演算処理A3122〜A3124は、次の並列演算処理のためのバリア同期待ち命令を発行する。このバリア同期待ち命令の発行により、バリア同期待ちタイマ1120の動作が開始される。
【0124】
そして、時刻905において、並列プログラムAの演算処理A3122〜A3124がバリア同期命令を実行している各プロセッサ1200〜1400で、バリア同期待ちタイマが「0」となり、バリア同期待ちトラップが発生する。
【0125】
このバリア同期待ちトラップ処理600により、並列プログラムAの演算処理A3122〜A3124のプロセッサ1200〜1400への割り当てが解除され、並列プログラムスケジューラ2000により、並列プログラムBの演算処理B3121〜B3123が、プロセッサ1200〜1400に割り当てられ、並列プログラムBの並列演算処理を実行する。
【0126】
次に、図12〜図16を用いて、本発明に係わるプログラム割当制御システムの他の(第3の)実施形態について説明する。
【0127】
図12は、本発明に係わるプログラム割当制御システムの第3の構成例を示すブロック図である。
【0128】
本図12に示すプログラム割当制御システムにおいては、図1で示したプログラム割当制御システムにおけるプロセッサ1100〜1400のそれぞれに、バリア同期ステータス1130を設けた構成となっている。
【0129】
そして、本例におけるマルチプロセッサのスケジュール方法には、図2および図3を用いて説明した、並列プログラムスケジューラの処理手順に加えて、図13〜図15で説明するスケジュール切替処理手順を含む。
【0130】
以下、図13〜図15を用いて、図2に示す構成のプログラム割当制御システムにおけるプロセッサ割り当て処理手順を説明する。
【0131】
図13は、図12のプログラム割当制御システムにおける並列プログラムスケジューラによる各プロセッサへの並列プログラムのスケジュール処理におけるスケジュール切替処理手順例を示すフローチャートである。
【0132】
先ず、ステップS1001において、プロセッサ割り当て待ちキュー4000の先頭の並列プログラム(D)を選択し、ステップS1002において、選択対象のプロセッサ割り当て待ちキュー4000の先頭の並列プログラム(D)が存在するか否かを判断する。
【0133】
並列プログラム(D)が存在しない場合、後述のステップS1007以降を処理し、また、並列プログラム(D)が存在する場合、ステップS1003において、並列プログラム(D)のスケジュールフラグ3160が、プロセッサが割り当てられていることを示す「TRUE」であるか、プロセッサが割り当てられていないことを示す「FALSE」であるかを判断する。
【0134】
スケジュールフラグ3160が「FALSE」である場合、ステップS1006において、プロセッサ割り当て待ちキューの4000の次の並列プログラム(D)を選択し、また、スケジュールフラグ3160がプロセッサが「TRUE」である場合、ステップS1004において、並列プログラム(D)の演算処理に対し、プロセッサ割り当ての解除処理を行なう。このプロセッサ割り当ての解除処理の詳細については、図14を用いて後述する。
【0135】
次のステップS1005において、並列プログラム(D)のスケジュールフラグ3160を、プロセッサが割り当てられていないことを示す「FALSE」に変更し、さらに、ステップS1006において、プロセッサ割り当て待ちキュー4000の次の並列プログラム(D)を選択する。
【0136】
そして、前述のステップS1002〜ステップS1006の処理の繰り返しにより、プロセッサ割り当て待ちキュー4000の全ての並列プログラムの各々の演算処理へのプロセッサ割り当てを解除し、停止させた後、次に、ステップS1007において、プロセッサ割り当て済みキュー3000の先頭の並列プログラム(E)を選択する。
【0137】
次に、ステップS1008において、前述のステップS1007で説明した、プロセッサ割り当て済みキュー3000の先頭の並列プログラム(E)が存在するか否かを判断する。
【0138】
並列プログラム(E)が存在しない場合、ステップS1013において、スケジュール切替処理を終了し、並列プログラム(E)が存在する場合、ステップS1009において、並列プログラム(E)のスケジュールフラグ3160が、プロセッサが割り当てられていることを示す「TRUE」であるか、プロセッサが割り当てられていないことを示す「FALSE」であるかを判断する。
【0139】
並列プログラム(E)のスケジュールフラグ3160が「TRUE」で、プロセッサが割り当てられていることを示す場合、ステップS1012において、プロセッサ割り当て済みキュー3000の次の並列プログラム(E)を選択し、ステップS1008からの処理に戻る。
【0140】
また、並列プログラム(E)のスケジュールフラグ3160が「FALSE」で、プロセッサが割り当てられていないことを示す場合、ステップS1010において、並列プログラム(E)の演算処理に対し、プロセッサ割り当て処理を行なう。尚、このプロセッサ割り当て処理の詳細については、図15を用いて後述する。
【0141】
その後、ステップS1011において、並列プログラム(D)のスケジュールフラグ3160を、プロセッサが割り当てられていることを示す「TRUE」に変更し、次のステップS1012において、プロセッサ割り当て済みキュー3000の次の並列プログラム(E)を選択する。
【0142】
以降、ステップS1008での処理に戻り、ステップS1012で選択した、プロセッサ割り当て済みキュー3000の次の並列プログラム(E)に対して、ステップS1009からステップS1012の処理を繰り返して行なうことで、プロセッサ割り当て済みキューの全ての並列プログラムの、全ての演算実行中である演算処理に、独立したプロセッサを割り当て、動作させる。
【0143】
次に、図14を用いて、図13におけるステップS1004でのプロセッサ割り当て解除処理手順を説明する。
【0144】
図14は、図12の並列プログラムスケジューラによる各プロセッサへの並列プログラムのスケジュール処理におけるプロセッサ割り当て解除処理手順例を示すフローチャートである。
【0145】
先ず、ステップS1101において、プロセッサ割り当てを解除する並列プログラム(D)の先頭の演算処理(T)を選択する。
【0146】
このステップS1101で選択した演算処理(T)が存在するか否かを、ステップS1102において判断し、演算処理(T)が存在しない場合、ステップS1109において、プロセッサ割り当て解除処理を終了する。
【0147】
また、前述のステップS1102で、演算処理(T)が存在する場合、ステップS1103において、演算処理(T)の演算フラグ3120が、演算処理実行中であることを示す「TRUE」であるか、演算処理実行待ちであることを示す「FALSE」であるかを判断する。
【0148】
演算処理(T)の演算フラグ3120が「FALSE」で、演算処理実行待ちであることを示す場合、プロセッサの割り当て解除を行わずに、後述するステップS1108以降の処理を行う。
【0149】
また、演算処理(T)の演算フラグ3120が「TRUE」で、演算処理実行中であることを示す場合、ステップS1104において、演算処理(T)が割り当てられているプロセッサのバリア同期ステータス1130を参照し、演算処理(T)がバリア同期待ち中であるか否かを判断する。
【0150】
バリア同期ステータス1130すなわち演算処理(T)がバリア同期待ち中である場合、ステップS1105において、演算処理(T)の演算フラグ3120を、演算処理実行待ちであることを示す「FALSE」に変更し、その後、あるいはバリア同期ステータス1130すなわち演算処理(T)がバリア同期待ち中でない場合、ステップS1106において、演算処理(T)へのプロセッサディスパッチを解除する。
【0151】
そして、ステップS1107において、空きプロセッサビットマップ5100の演算処理(T)が割り当てられていたプロセッサに対応するビットをセットする。さらに、ステップS1108において、並列プログラム(D)の次の演算処理(T)を選択し、ステップS1102に戻る。
【0152】
このステップS1102からステップS1208の処理を繰り返すことで、並列プログラム(D)へのプロセッサ割り当て解除処理を行う。
【0153】
次に、図15を用いて、図13におけるステップS1010でのプロセッサ割り当て処理手順を説明する。
【0154】
図15は、図12の並列プログラムスケジューラによる各プロセッサへの並列プログラムのスケジュール処理におけるプロセッサ割り当て処理手順例を示すフローチャートである。
【0155】
先ず、ステップS1201において、プロセッサを割り当てる並列プログラム(E)の先頭の演算処理(T)を選択し、次に、ステップS1202において、ここで選択した演算処理(T)が存在するか否かを判断する。演算処理(T)が存在しない場合、ステップS1210において、プロセッサ割り当て処理を終了する。
【0156】
また、演算処理(T)が存在する場合、ステップS1203において、演算処理(T)の演算フラグ3120が、演算処理実行中であることを示す「TRUE」であるか、演算処理実行待ちであることを示す「FALSE」であるかを判断する。
【0157】
演算処理(T)の演算フラグ3120が「FALSE」で、演算処理(T)が演算処理実行待ちであることを示す場合、プロセッサの割り当てを行わずに、後述するステップS1209以降の処理を行う。
【0158】
また、演算処理(T)の演算フラグ3120が「TRUE」で、演算処理(T)が演算処理実行中であることを示す場合、ステップS1204において、空きプロセッサビットマップ5100より、空き状態のプロセッサ(P)を一つ選択し、ステップS1205において、空きプロセッサビットマップ5100の前述のステップS1204で選択したプロセッサ(P)のビットをクリアする。
【0159】
そして、ステップS1206において、並列プログラム(E)の演算処理数3130が演算処理実行数3140と等しいか否かを判断する。並列プログラム(E)の演算処理数3130が演算処理実行数3140と等しくない場合、ステップS1207において、プロセッサ(P)のバリア同期待ち機構1110に対し、バリア同期待ちのタイムアウトを設定する。バリア同期待ちのタイムアウトが発生した場合、図7を用いて説明したバリア同期待ちトラップ処理が行われる。
【0160】
その後、あるいはステップS1206において並列プログラム(E)の演算処理数3130が演算処理実行数3140と等しい場合、ステップS1208において、プロセッサ(P)に演算処理(T)をディスパッチする。
【0161】
そして、ステップS1209において、並列プログラム(E)の次の演算処理(T)を選択し、ステップS1202に戻り、このステップS1202からステップ1209の処理を繰り返すことで、並列プログラム(E)へのプロセッサ割り当て処理を行う。
【0162】
次に、図16を用いて、本例の並列プログラムスケジューラによる並列プログラムの動作制御手順について、特に、複数の並列プログラムを多重に実行する場合に、予め定められた周期で、並列プログラムのプロセッサへの割り当ての変更要否を判別し、次周期で変更要と判別された変更前の並列プログラムで逐次演算処理を実行中であれば、この逐次演算処理を次周期での空きプロセッサに割り当てる動作を説明する。
【0163】
図16は、図12のプログラム割当制御システムにおける多重に実行された複数の並列プログラムの動作制御例を示す説明図である。
【0164】
ここでは、プロセッサ1100〜1400の4台のプロセッサで、並列プログラムAと並列プログラムBの2つの並列プログラムが多重に動作しているものとする。
【0165】
また、並列プログラムAは4つの演算処理を持つ4並列の並列プログラムであり、並列プログラムBは3つの演算処理を持つ3並列の並列プログラムであるものとする。
【0166】
先ず、時刻T1301において、並列プログラムAがスケジュールされており、並列プログラムAの演算処理A3121〜A3124が、プロセッサ1100〜1400に割り当てられ、並列演算処理を実行している。
【0167】
このとき、並列プログラムBは、プロセッサ割り当て待ちキュー4000に接続されて、次のプロセッサ割り当て待ちとなっている。
【0168】
次の時刻T1302において、並列プログラムAの並列演算処理が完了し、演算処理A3121が逐次処理を開始し、並列プログラムAの演算処理A3122〜A3124は、次の並列演算処理のためのバリア同期待ち命令を発行する。
【0169】
そして、時刻T1303において、定期的な並列プログラムスケジューラの動作が発生し、プロセッサ使用量などを考慮した優先度に従って、並列プログラムAへのプロセッサ1100〜1400の割り当てが解除され、並列プログラムBにプロセッサ1200〜1400が割り当てられる。
【0170】
この並列プログラムAへのプロセッサ割り当て解除処理において、演算処理A3122〜A3124はバリア同期待ちを行っており、演算処理A3121への1プロセッサのみで実行が可能であるため、演算処理A3121が空きプロセッサ1100へ割り当てられる。
【0171】
以上、図1〜図16を用いて説明したように、本例では、一つの連続する演算を複数の処理単位に分け、複数のプロセッサに割り当てて並列に処理する並列プログラムを実行する際、並列プログラムでの逐次演算処理の開始を検知すると、この逐次演算処理に対してプロセッサを割り当てるが、逐次演算処理が完了するまで、並列プログラムの並列演算処理に対してのプロセッサの割り当ては保留する。
【0172】
あるいは、処理中の並列プログラムAでの逐次演算処理の開始を検知し、この逐次演算処理にプロセッサを割り当てると、並列プログラムAの並列演算処理に対するプロセッサの割り当てを解除し、この割り当てを解除したプロセッサを、他の並列プログラムの並列演算処理に割り当てる。
【0173】
また、逐次演算処理の開始を検知した後、この逐次演算処理が所定時間経過したことを検知した後、逐次演算処理に対するプロセッサの割り当て、並列演算処理に対するプロセッサの割り当て解除等を実行する。あるいは、予め定められた周期で、並列プログラムのプロセッサへの割り当ての変更要否を判別し、次周期で変更要と判別された変更前の並列プログラムで逐次演算処理を実行中であれば、この逐次演算処理を次周期での空きプロセッサに割り当てる。
【0174】
このように、本例では、逐次処理中には、並列プログラムの逐次処理処理にのみ独立したプロセッサを割り当て、空いたプロセッサに他の並列プログラムや逐次プログラムを割り当て、並列演算処理の開始時には、並列プログラムの全ての並列演算処理に独立したプロセッサを同時に割り当てることにより、実際の演算に対するプロセッサの稼働率を向上し得る。
【0175】
また、並列演算処理の開始待ちが一定時間に達したことを検知する機能を持ち、並列演算処理の終了後の逐次処理が、一定時間、並列演算処理の開始が行なわれなかった場合に、並列プログラムの逐次処理にのみ独立したプロセッサを割り当てることにより、短時間の逐次処理の開始、及び、並列演算処理の開始で、頻繁なプロセッサの割り当て変更によるオーバヘッドを低減し得る。
【0176】
また、並列演算の開始待ちを行なっていることを静的に検知する機能を持ち、スケジュール切り替え時に、次にスケジュールする並列プログラムが、逐次処理中か並列演算処理中かを判断し、逐次処理中には、並列プログラムの逐次処理にのみ独立したプロセッサを割り当て、並列演算処理の開始時には、並列プログラムの全ての並列演算処理に独立したプロセッサを同時に割り当てることにより、各々の並列演算処理が不均一であった場合に断片的に発生するプロセッサの割り当て変更によるオーバヘッドを低減し得る。
【0177】
これにより、複数の並列プログラム、及び逐次プログラムを多重に実行する複数のプロセッサを用いたコンピュータシステムにおいて、実際の演算に対するプロセッサの稼働率を向上させることができる。
【0178】
尚、本発明は、図1〜図16を用いて説明した例に限定されるものではなく、その要旨を逸脱しない範囲において種々変更可能である。例えば、本例では、プロセッサの台数を4台として説明したが、プロセッサの台数はこの4台に限られるものではない。
【0179】
また、本例で複数のプロセッサ(CPU、MPU)に割り当てる処理単位は、プロセスとしてもスレッドとしても、あるいは、各並列プログラム単位としても良い。
【0180】
また、コンピュータ構成例としても、キーボードや光ディスクの駆動装置の無いコンピュータ構成としても良い。また、本例では、光ディスクを記録媒体として用いているが、FD(Flexible Disk)等を記録媒体として用いることでも良い。また、プログラムのインストールに関しても、通信装置を介してネットワーク経由でプログラムをダウンロードしてインストールすることでも良い。
【0181】
【発明の効果】
本発明によれば、複数の並列プログラム、及び逐次プログラムを多重に実行する複数のプロセッサを用いたコンピュータシステムにおいて、実際の演算に対するプロセッサの稼働率の向上を図ることが可能である。
【図面の簡単な説明】
【図1】本発明に係わるプログラム割当制御システムの第1の構成例を示すブロック図である。
【図2】図1における並列プログラムスケジューラによる並列プログラムのスケジュール処理手順例を示すフローチャートである。
【図3】図1の並列プログラムスケジューラによる各プロセッサへの並列プログラムのスケジュール処理におけるスケジュール選択処理手順例を示すフローチャートである。
【図4】図1の並列プログラムスケジューラによる各プロセッサへの並列プログラムのスケジュール処理におけるスケジュール切替処理手順例を示すフローチャートである。
【図5】図1の並列プログラムスケジューラによる各プロセッサへの並列プログラムのスケジュール処理におけるプロセッサ割り当て処理手順例を示すフローチャートである。
【図6】図1のプログラム割当制御システムにおける並列プログラムの制御動作例を示す説明図である。
【図7】図1の並列プログラムスケジューラによる各プロセッサへの並列プログラムのスケジュール処理におけるバリア同期待ちトラップ処理手順例を示すフローチャートである。
【図8】図1のプログラム割当制御システムにおける多重に実行された複数の並列プログラムの動作制御例を示す説明図である。
【図9】本発明に係わるプログラム割当制御システムの第2の構成例を示すブロック図である。
【図10】図9のプログラム割当制御システムにおける並列プログラムスケジューラによる各プロセッサへの並列プログラムのスケジュール処理におけるプロセッサ割り当て処理手順例を示すフローチャートである。
【図11】図9のプログラム割当制御システムにおける多重に実行された複数の並列プログラムの動作制御例を示す説明図である。
【図12】本発明に係わるプログラム割当制御システムの第3の構成例を示すブロック図である。
【図13】図12のプログラム割当制御システムにおける並列プログラムスケジューラによる各プロセッサへの並列プログラムのスケジュール処理におけるスケジュール切替処理手順例を示すフローチャートである。
【図14】図12の並列プログラムスケジューラによる各プロセッサへの並列プログラムのスケジュール処理におけるプロセッサ割り当て解除処理手順例を示すフローチャートである。
【図15】図12の並列プログラムスケジューラによる各プロセッサへの並列プログラムのスケジュール処理におけるプロセッサ割り当て処理手順例を示すフローチャートである。
【図16】図12のプログラム割当制御システムにおける多重に実行された複数の並列プログラムの動作制御例を示す説明図である。
【符号の説明】
1000:プロセッサ群、1100〜1400:プロセッサ、1110:バリア同期待ち機構、1120:バリア同期待ちタイマ、1130:バリア同期ステータス、2000:並列プログラムスケジューラ、3000:プロセッサ割り当て済みキュー、3100〜3300,4100〜4300:並列プログラム、3110:演算処理(管理テーブル)、3120:演算フラグ、3130:演算処理数、3140:演算処理実行数、3150:優先度、3160:スケジュールフラグ、4000:プロセッサ割り当て待ちキュー、5000:空きプロセッサ数(カウンタ)、5100:空きプロセッサビットマップ。[0001]
BACKGROUND OF THE INVENTION
The present invention relates to multi-scheduling of jobs using a plurality of processors in a general-purpose or specific computer system.The
[0002]
[Prior art]
A parallel program executed using a plurality of processors (CPU, MPU) is divided into several processing units such as processes and threads, and each operates in parallel on another processor. The processing units operating in parallel on each processor derive one result as a whole while exchanging data with each other.
[0003]
In the parallel program executed in this way, execution is performed in synchronization with each checkpoint. At this time, if the partner processing unit does not reach the check point, data exchange with the partner processing unit cannot be performed, and so-called synchronization wait occurs.
[0004]
When multiple parallel programs are executed in parallel in a parallel computer system, scheduling each processing unit of the parallel program without mutual cooperation between the multiple processors will result in a difference in execution time difference between the processing units executed by each processor. Therefore, there is a problem that the synchronization waiting time becomes large.
[0005]
To avoid this increase in synchronization waiting time, as a technique for performing a coordinated scheduling between processors, Satoshi Fukuda, “Parallel Operating System” (Corona Inc., issued in 1997) (ISBN4-339-02587-9) ) From page 56 to page 62is there.
[0006]
Here, a process scheduling technique is shown in which parallel processes of a parallel program are executed simultaneously during a time slice, then a global scheduler is called, a process to be executed next is selected, and each processor is notified. .
[0007]
In JP-A-10-74150, in order to execute parallel processes on a plurality of processors, a program allocation table in which the start and stop times of processes for a certain period are determined in advance is notified to each processor. Each processor describes a process scheduling technique in which processes are executed accordingly.
[0008]
However, most parallel programs require sequential processing (sequential processing) such as reading and writing data between parallel operations, especially in programs that read and write large amounts of data. The processing time of the sequential processing may take a long time compared to parallel processing, such as several ms to several seconds.
[0009]
In the above-described prior art, while such sequential processing is performed, processing units other than the processing unit performing sequential processing perform an idle loop that waits for the start of parallel arithmetic processing. In the program for reading and writing the data, the operation rate for the actual calculation of the computer system is lowered.
[0010]
[Problems to be solved by the invention]
The problem to be solved is that, in the conventional technology, while a sequential processing (sequential processing) is performed in a parallel program, processing units other than the processing unit performing this sequential processing are Since an idle loop that waits for the start is performed, for example, in a program that reads or writes a large amount of data, the processing time of one sequential processing may take a long time, and the operating rate for the actual calculation of the computer system decreases. This is the point.
[0011]
An object of the present invention is to solve these problems of the prior art and improve the operating rate of each processor in a computer system having a plurality of processors that execute a plurality of parallel programs and sequential programs in a multiplexed manner.
[0012]
[Means for Solving the Problems]
In order to achieve the above object, according to the present invention, during the sequential processing of parallel programs, an independent processor is allocated only to this sequential processing, and another parallel program or sequential program is allocated to the vacant processor. At the start, an independent processor is assigned simultaneously to all parallel operations of the parallel program. For example, when the sequential processing after the end of the parallel processing is not started for a certain time, an independent processor is assigned only to the sequential processing of the parallel program. As a result, the overhead due to frequent processor assignment changes is reduced at the start of a short time sequential process and the start of a parallel operation process. Also, at the time of periodic schedule switching, it is determined whether the next parallel program to be scheduled is in sequential processing or parallel arithmetic processing. During sequential processing, an independent processor is assigned only to the sequential processing of the parallel program, and parallel processing is performed. At the start of arithmetic processing, independent processors are simultaneously assigned to all parallel arithmetic processing of the parallel program. This reduces overhead due to processor allocation changes that occur in a fragmentary manner when each parallel processing is uneven.
[0013]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
[0014]
FIG. 1 is a block diagram showing a first configuration example of a program allocation control system according to the present invention.
[0015]
1 is a computer system including a CPU (Central Processing Unit), a main memory, a display device, an input device, an external storage device, and the like, and a storage medium such as a CD-ROM via an optical disk drive device or the like. After the program and data recorded in the external storage device are installed in the external storage device, each function for performing the multiprocessor schedule processing according to the present invention is constructed by reading this program from the external storage device into the main memory and processing it by the CPU.
[0016]
In FIG. 1, the
[0017]
The
[0018]
Each parallel program, as shown in the
[0019]
In this example, it is assumed that the number of
[0020]
With such a configuration, in the program allocation control system of this example, when executing a parallel program that divides one continuous operation into a plurality of processing units (processes, threads, etc.) and allocates them to a plurality of processors for processing in parallel. When the start of the sequential calculation process in the parallel program is detected, a processor is assigned to the sequential calculation process, and the assignment of the processor to the parallel calculation process of the parallel program is suspended until the sequential calculation process is completed. .
[0021]
Hereinafter, the schedule processing procedure of the parallel program to each processor by the
[0022]
FIG. 2 is a flowchart showing an example of a parallel program schedule processing procedure by the parallel program scheduler in FIG.
[0023]
The
[0024]
First, in step S101, it is determined whether or not a parallel program exists in the processor
[0025]
If there is a parallel program in the processor
[0026]
Next, in step S103, it is determined whether or not there is a parallel program in the processor assigned
[0027]
Next, in step S105, the parallel program of the processor assigned
[0028]
Next, in step S106, in accordance with the processor-allocated
[0029]
FIG. 3 is a flowchart showing an example of a schedule selection process procedure in the schedule process of the parallel program to each processor by the parallel program scheduler of FIG.
[0030]
The processing example shown in FIG. 3 shows details of the schedule selection processing in step S105 in FIG. 2. First, in step S201, it is determined whether or not a parallel program exists in the processor assigned
[0031]
If it is determined in step S201 that no parallel program exists in the processor-allocated
[0032]
If there is no parallel program in the processor
[0033]
If there is a parallel program in the processor
[0034]
Next, in step S204, the number of
[0035]
Here, by using the number of executions of
[0036]
If the number of
[0037]
If the number of
[0038]
In step S207, the priority of the parallel program (A) having the highest priority selected in step S203 described above and the priority of the parallel program (B) having the lowest priority selected in step S206 described above. Make a comparison.
[0039]
In step S207, the priority of the parallel program (A) having the highest priority selected in step S203 is equal to or lower than the priority of the parallel program (B) having the lowest priority selected in step S206. In this case, the process from step S210 described later is processed.
[0040]
In step S207, the priority of the parallel program (A) having the highest priority selected in step S203 is higher than the priority of the parallel program (B) having the lowest priority selected in step S206. In step S208, the parallel program (B) is taken out from the processor assigned
[0041]
In step S209, the number of
[0042]
Thereafter, the process returns to step S204, and the processes from step S204 to step S209 are repeated, and the schedule exchange process between the parallel program in the processor assigned
[0043]
In step S210, that is, the priority of the parallel program (A) having the highest priority selected in step S203 described above in step S207 described above is the parallel program having the lowest priority selected in step S206 described above. If the priority is equal to or lower than the priority of the program (B), the parallel program (C) having the highest priority and connected to the processor
[0044]
In step S210, if there is no parallel program (C) having the highest priority among the queues assigned to the processor
[0045]
In step S211, if there is a parallel program (C) having the highest priority among the queues connected to the processor
[0046]
In step S213, the number of
[0047]
FIG. 4 is a flowchart showing an example of a schedule switching process procedure in the parallel program schedule process for each processor by the parallel program scheduler of FIG.
[0048]
The processing example shown in FIG. 4 shows details of the schedule switching process in step S106 in FIG. 2. First, in step S301, the first parallel program (D) in the processor
[0049]
Next, in step S302, it is determined whether or not the parallel program (D) that is the selection target in the above-described step S301 exists. If the parallel program (D) does not exist, the processing after step S307 described later is performed. I do.
[0050]
If the parallel program (D) exists in step S302 described above, in step S303, the
[0051]
If it is determined in step S303 that the
[0052]
If it is determined in step S303 that the
[0053]
After that, in step S305, the
[0054]
By repeating steps S302 to S306 in this manner, the processor assignment to all the arithmetic processes of all the parallel programs in the processor
[0055]
In the next step S308, it is determined whether or not the parallel program (E) selected in step S307 exists. If the parallel program (E) does not exist, the schedule switching process is terminated in step S313.
[0056]
If the parallel program (E) exists, in step S309, the
[0057]
If the determination result in step S309 is “TRUE” indicating that the
[0058]
If the
[0059]
Next, in step S311, the
[0060]
Then, by performing the processing from step S308 to step S312 for the next parallel program (E) in the processor assigned
[0061]
FIG. 5 is a flowchart showing an example of a processor assignment processing procedure in the parallel program schedule processing to each processor by the parallel program scheduler of FIG.
[0062]
The processing example shown in FIG. 5 shows the details of the processor assignment processing in step S310 in FIG. 4. First, in step S401, the first arithmetic processing (T) of the parallel program (E) to which the processor is assigned is executed. select.
[0063]
In step S402, it is determined whether or not the calculation process (T) selected in step S401 exists. If the calculation process (T) does not exist, the processor allocation process ends in step S411.
[0064]
Also, if there is a calculation process (T) in step S402, in step S403, the
[0065]
If the result of the determination in step S403 is “FALSE” indicating that the
[0066]
In addition, when the result of the determination in step S403 is “TRUE” indicating that the
[0067]
Next, in step S406, it is determined whether or not there is a parallel program waiting for processor allocation in the processor
[0068]
If there is a parallel program waiting for processor allocation, in step S407, the barrier
[0069]
If there is no parallel program waiting for processor assignment in the processor
[0070]
If it is determined in step S408 that the number of
[0071]
Further, in the determination result in step S408 described above, when the number of
[0072]
In step S410, the next calculation process (T) of the parallel program (E) is selected, the process returns to step S402, and the processes from step S402 to step S410 described above are repeated. In this way, the processor allocation process to the parallel program (E) is performed.
[0073]
Next, the parallel program control operation by the program allocation control system of this example will be described with reference to FIG.
[0074]
FIG. 6 is an explanatory diagram showing an example of the control operation of the parallel program in the program allocation control system of FIG.
[0075]
[0076]
The
[0077]
First, at time T501, the
[0078]
At this time, when the barrier synchronization waiting instruction trap is set by the processing in step S407 described with reference to FIG. 5, the barrier synchronization waiting trap processing described later with reference to FIG. 7 operates.
[0079]
Next, at time T502, the
[0080]
By issuing the barrier synchronization command of this
[0081]
Then, at time T503, the parallel calculation processing of each
[0082]
Hereinafter, the barrier synchronization waiting trap process will be described with reference to FIG.
[0083]
FIG. 7 is a flowchart showing an example of the barrier synchronization wait trap processing procedure in the parallel program schedule processing to each processor by the parallel program scheduler of FIG.
[0084]
The barrier synchronization waiting trap processing 600 shown in FIG. 7 is performed when each
[0085]
First, in step S601, the
[0086]
Next, in step S602, 1 is subtracted from the operation
[0087]
In step S604, it is determined whether the number of
[0088]
If the operation
[0089]
Further, in step S606, the operation flags 3120 of all the operation processes of the
[0090]
Then, in step S607, it is determined whether a similar barrier synchronization waiting trap has occurred in another processor and is suspended. If there is a pending barrier synchronization waiting trap, the processing from step S601 to step S607 described above is repeated.
[0091]
If there is no pending barrier synchronization waiting trap, the parallel program scheduler process described above with reference to FIGS. 2 to 5 is performed in step S608, and the barrier synchronization waiting trap process is terminated in step S609.
[0092]
Next, the operation control of the parallel program by the parallel program scheduler of this example will be described with reference to FIG. 8, particularly in the case where a plurality of parallel programs are executed in multiple.
[0093]
That is, in the program allocation control system of FIG. 1, when a parallel program that divides one continuous operation into a plurality of processing units and processes them in parallel is executed by a plurality of processors, When the start of the sequential calculation process is detected, a processor is assigned to the sequential calculation process. However, for the parallel calculation process of the parallel program A, the processor assignment is canceled, and the processor thus unassigned is This is assigned to parallel processing of another parallel program B.
[0094]
FIG. 8 is an explanatory diagram showing an example of operation control of a plurality of parallel programs executed in the program allocation control system of FIG.
[0095]
In this example, it is assumed that two parallel programs of parallel program A and parallel program B are operating in a multiplex manner with four
[0096]
First, at time T701, the parallel program A is scheduled, and each of the arithmetic processing A3121 to A3124 of the parallel program A is assigned to the
[0097]
Next, at time T702, the parallel processing of the parallel program A is completed, the
[0098]
By issuing this barrier synchronization wait instruction, a barrier synchronization wait trap occurs, and the barrier synchronization wait trap processing 600 described with reference to FIG. 7 assigns the
[0099]
Further, at time T703, the sequential processing of the parallel program A is completed, and the
[0100]
At time T704, the
[0101]
Next, another embodiment of the program allocation control system according to the present invention will be described with reference to FIGS.
[0102]
FIG. 9 is a block diagram showing a second configuration example of the program allocation control system according to the present invention.
[0103]
In the program allocation control system shown in FIG. 9, a barrier
[0104]
The multiprocessor scheduling method in this example includes a processor allocation processing procedure described in FIG. 10 in addition to the processing procedure of the parallel program scheduler described with reference to FIGS.
[0105]
Hereinafter, the processor assignment processing procedure in the program assignment control system having the configuration shown in FIG. 9 will be described with reference to FIG.
[0106]
FIG. 10 is a flowchart showing an example of a processor assignment processing procedure in the parallel program schedule processing to each processor by the parallel program scheduler in the program assignment control system of FIG.
[0107]
First, in step S801, the first arithmetic process (T) of the parallel program (E) to which the processor is assigned is selected, and in step S802, it is determined whether or not the selected arithmetic process (T) exists.
[0108]
If the arithmetic process (T) does not exist, the processor assignment process is terminated in step S811, and if the arithmetic process (T) exists, the
[0109]
When the
[0110]
In step S805, the processor (P) bit selected in the above-described step S804 of the
[0111]
If there is a parallel program waiting for processor allocation in the processor
[0112]
If there is no parallel program waiting for processor allocation in the processor
[0113]
When the number of
[0114]
Thereafter, or when the number of
[0115]
In step S810, the next calculation process (T) of the parallel program (E) is selected, the process returns to step S802, and the processing from step S802 to step S810 is repeated to assign the processor to the parallel program (E). Process.
[0116]
Next, with reference to FIG. 11, regarding the operation control procedure of the parallel program by the parallel program scheduler of the present example, particularly when a plurality of parallel programs are executed in a multiplexed manner, An operation of assigning processors to sequential arithmetic processing and releasing / holding processor assignment to parallel arithmetic processing after a predetermined time has elapsed will be described.
[0117]
FIG. 11 is an explanatory diagram showing an example of operation control of a plurality of parallel programs executed in a multiple manner in the program allocation control system of FIG.
[0118]
Here, it is assumed that two parallel programs of parallel program A and parallel program B are operating in a multiplex manner with four
[0119]
First, at time T901, the parallel program A is scheduled, and each of the arithmetic processes A3121 to A3124 of the parallel program A is assigned to the
[0120]
At the next time T902, the parallel arithmetic processing of the parallel program A is completed, the
[0121]
By issuing this barrier synchronization wait instruction, the operation of the barrier
[0122]
At time T903, the sequential processing of the parallel program A is completed, and the
[0123]
Furthermore, at time T904, the parallel operation processing of the parallel program A is completed, the operation processing A 3121 starts sequential processing, and the
[0124]
At time 905, the barrier synchronization wait timer is set to “0” in each of the
[0125]
By this barrier synchronization waiting trap processing 600, the assignment of the arithmetic processing A3122 to A3124 of the parallel program A to the
[0126]
Next, another (third) embodiment of the program allocation control system according to the present invention will be described with reference to FIGS.
[0127]
FIG. 12 is a block diagram showing a third configuration example of the program allocation control system according to the present invention.
[0128]
In the program allocation control system shown in FIG. 12, a barrier synchronization status 1130 is provided for each of the
[0129]
The multiprocessor scheduling method in this example includes the schedule switching processing procedure described with reference to FIGS. 13 to 15 in addition to the processing procedure of the parallel program scheduler described with reference to FIGS. 2 and 3.
[0130]
Hereinafter, the processor allocation processing procedure in the program allocation control system having the configuration shown in FIG. 2 will be described with reference to FIGS.
[0131]
FIG. 13 is a flowchart showing an example of a schedule switching process procedure in the parallel program schedule process for each processor by the parallel program scheduler in the program allocation control system of FIG.
[0132]
First, in step S1001, the top parallel program (D) of the processor
[0133]
When the parallel program (D) does not exist, the processing after step S1007 described later is processed. When the parallel program (D) exists, the
[0134]
When the
[0135]
In the next step S1005, the
[0136]
Then, by repeating the processes in steps S1002 to S1006 described above, the processor assignment to all the arithmetic processes of all the parallel programs in the processor
[0137]
Next, in step S1008, it is determined whether or not the first parallel program (E) in the processor-allocated
[0138]
If the parallel program (E) does not exist, the schedule switching process is terminated in step S1013. If the parallel program (E) exists, the
[0139]
If the
[0140]
If the
[0141]
Thereafter, in step S1011, the
[0142]
Thereafter, returning to the processing in step S1008, the processing from step S1009 to step S1012 is repeated for the next parallel program (E) in the processor-allocated
[0143]
Next, with reference to FIG. 14, the processor assignment deallocation processing procedure in step S <b> 1004 in FIG. 13 will be described.
[0144]
FIG. 14 is a flowchart showing an example of a processor allocation deallocation process procedure in the parallel program schedule process for each processor by the parallel program scheduler of FIG.
[0145]
First, in step S1101, the first arithmetic processing (T) of the parallel program (D) whose processor assignment is to be canceled is selected.
[0146]
In step S1102, it is determined whether or not the calculation process (T) selected in step S1101 exists. If the calculation process (T) does not exist, the processor deallocation process ends in step S1109.
[0147]
Also, in the above-described step S1102, if the calculation process (T) exists, in step S1103, whether the
[0148]
When the
[0149]
When the
[0150]
If the barrier synchronization status 1130, that is, the calculation process (T) is waiting for the barrier synchronization, in step S1105, the
[0151]
In step S1107, the bit corresponding to the processor to which the calculation process (T) of the
[0152]
By repeating the processing from step S1102 to step S1208, processor assignment cancellation processing to the parallel program (D) is performed.
[0153]
Next, the processor allocation processing procedure in step S1010 in FIG. 13 will be described with reference to FIG.
[0154]
FIG. 15 is a flowchart showing an example of a processor assignment processing procedure in the parallel program schedule processing to each processor by the parallel program scheduler of FIG.
[0155]
First, in step S1201, the first arithmetic processing (T) of the parallel program (E) to which the processor is assigned is selected, and then in step S1202, it is determined whether or not the arithmetic processing (T) selected here exists. To do. If the calculation process (T) does not exist, the processor allocation process ends in step S1210.
[0156]
If the calculation process (T) exists, in step S1203, the
[0157]
When the
[0158]
If the
[0159]
In step S1206, it is determined whether or not the number of
[0160]
Thereafter, or when the number of
[0161]
In step S1209, the next arithmetic processing (T) of the parallel program (E) is selected, the processing returns to step S1202, and the processing from step S1202 to step 1209 is repeated to assign the processor to the parallel program (E). Process.
[0162]
Next, with reference to FIG. 16, the parallel program operation control procedure by the parallel program scheduler of this example, particularly when a plurality of parallel programs are executed in a multiplexed manner, to the processor of the parallel program at a predetermined cycle. If the sequential calculation process is being executed in the parallel program before the change that was determined to be changed in the next cycle, the operation of assigning this sequential calculation process to the free processor in the next cycle is performed. explain.
[0163]
FIG. 16 is an explanatory diagram showing an example of operation control of a plurality of parallel programs executed in a multiple manner in the program allocation control system of FIG.
[0164]
Here, it is assumed that two parallel programs of parallel program A and parallel program B are operating in a multiplex manner with four
[0165]
In addition, it is assumed that the parallel program A is a four parallel program having four arithmetic processes, and the parallel program B is a three parallel program having three arithmetic processes.
[0166]
First, at time T1301, the parallel program A is scheduled, and the arithmetic processes A3121 to A3124 of the parallel program A are assigned to the
[0167]
At this time, the parallel program B is connected to the processor
[0168]
At the next time T1302, the parallel arithmetic processing of the parallel program A is completed, the
[0169]
Then, at time T1303, a periodic operation of the parallel program scheduler occurs, the assignment of the
[0170]
In this processor deallocating process to the parallel program A, the arithmetic processes A 3122 to A 3124 are waiting for barrier synchronization and can be executed by only one processor to the
[0171]
As described above with reference to FIGS. 1 to 16, in this example, when executing a parallel program in which one continuous operation is divided into a plurality of processing units and assigned to a plurality of processors for parallel processing, When the start of the sequential calculation process in the program is detected, a processor is assigned to the sequential calculation process, but the assignment of the processor to the parallel calculation process of the parallel program is suspended until the sequential calculation process is completed.
[0172]
Alternatively, when the start of the sequential operation processing in the parallel program A being processed is detected and a processor is assigned to the sequential operation processing, the processor assignment to the parallel operation processing of the parallel program A is released, and the processor that has released this assignment Are assigned to parallel processing of other parallel programs.
[0173]
In addition, after detecting the start of the sequential calculation process, it is detected that a predetermined time has elapsed, and then, for example, processor allocation to the sequential calculation process and processor allocation release to the parallel calculation process are executed. Alternatively, it is determined whether or not the allocation of the parallel program to the processor needs to be changed at a predetermined cycle, and if the sequential calculation processing is being executed in the parallel program before the change determined to be changed at the next cycle, Sequential arithmetic processing is assigned to an empty processor in the next cycle.
[0174]
Thus, in this example, during sequential processing, an independent processor is allocated only to the sequential processing of the parallel program, and another parallel program or sequential program is allocated to the free processor. By simultaneously assigning independent processors to all the parallel computation processes of a program, the processor utilization rate for actual computations can be improved.
[0175]
Also, it has a function to detect that the waiting time for the start of the parallel processing has reached a certain time, and if the sequential processing after the end of the parallel processing is not started for a certain time, the parallel processing By assigning independent processors only to the sequential processing of programs, overhead due to frequent processor allocation changes can be reduced at the start of short-time sequential processing and parallel arithmetic processing.
[0176]
In addition, it has a function to statically detect that it is waiting for the start of parallel computation. When switching schedules, it determines whether the next parallel program to be scheduled is in sequential processing or parallel computation processing, and is in sequential processing. Assigns independent processors only to sequential processing of parallel programs, and at the start of parallel computing processing, assigns independent processors to all parallel computing processing of parallel programs at the same time, so that each parallel computing processing is uneven. In such a case, overhead due to a change in processor allocation that occurs in a fractional manner can be reduced.
[0177]
As a result, in a computer system using a plurality of processors that execute a plurality of parallel programs and sequential programs in a multiplexed manner, it is possible to improve the operating rate of the processor for actual calculations.
[0178]
In addition, this invention is not limited to the example demonstrated using FIGS. 1-16, and can be variously changed in the range which does not deviate from the summary. For example, in this example, the number of processors is described as four, but the number of processors is not limited to four.
[0179]
In this example, the processing unit allocated to a plurality of processors (CPU, MPU) may be a process, a thread, or each parallel program unit.
[0180]
Also, as a computer configuration example, a computer configuration without a keyboard or optical disk drive may be used. In this example, an optical disk is used as a recording medium. However, an FD (Flexible Disk) or the like may be used as a recording medium. As for the program installation, the program may be downloaded and installed via a network via a communication device.
[0181]
【The invention's effect】
According to the present invention, in a computer system using a plurality of processors that execute a plurality of parallel programs and sequential programs in a multiplexed manner, it is possible to improve the operating rate of the processor for actual computation.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a first configuration example of a program allocation control system according to the present invention.
FIG. 2 is a flowchart showing an example of a parallel program schedule processing procedure by the parallel program scheduler in FIG. 1;
FIG. 3 is a flowchart showing an example of a schedule selection process procedure in a parallel program schedule process for each processor by the parallel program scheduler of FIG. 1;
4 is a flowchart showing an example of a schedule switching process procedure in a parallel program schedule process for each processor by the parallel program scheduler of FIG. 1;
5 is a flowchart showing an example of a processor assignment process procedure in a parallel program schedule process for each processor by the parallel program scheduler of FIG. 1;
6 is an explanatory diagram showing an example of a control operation of a parallel program in the program allocation control system of FIG. 1. FIG.
7 is a flowchart showing an example of a barrier synchronization wait trap processing procedure in a parallel program schedule processing to each processor by the parallel program scheduler of FIG. 1;
8 is an explanatory diagram showing an example of operation control of a plurality of parallel programs executed in a multiplexed manner in the program allocation control system of FIG. 1. FIG.
FIG. 9 is a block diagram showing a second configuration example of the program allocation control system according to the present invention.
10 is a flowchart showing an example of a processor assignment process procedure in a parallel program schedule process for each processor by a parallel program scheduler in the program assignment control system of FIG. 9;
11 is an explanatory diagram showing an example of operation control of a plurality of parallel programs executed in a multiplexed manner in the program allocation control system of FIG. 9;
FIG. 12 is a block diagram showing a third configuration example of the program allocation control system according to the present invention.
13 is a flowchart showing an example of a schedule switching process procedure in a parallel program schedule process for each processor by a parallel program scheduler in the program allocation control system of FIG. 12;
14 is a flowchart showing an example of a processor deallocation process procedure in a parallel program schedule process for each processor by the parallel program scheduler of FIG. 12;
15 is a flowchart showing an example of a processor assignment processing procedure in the parallel program schedule processing to each processor by the parallel program scheduler of FIG. 12;
16 is an explanatory diagram showing an example of operation control of a plurality of parallel programs executed in a multiple manner in the program allocation control system of FIG. 12;
[Explanation of symbols]
1000: Processor group, 1100 to 1400: Processor, 1110: Barrier synchronization wait mechanism, 1120: Barrier synchronization wait timer, 1130: Barrier synchronization status, 2000: Parallel program scheduler, 3000: Processor assigned queue, 3100-3300, 4100 4300: Parallel program, 3110: Operation processing (management table), 3120: Operation flag, 3130: Number of operation processing, 3140: Number of execution of operation processing, 3150: Priority, 3160: Schedule flag, 4000: Processor allocation waiting queue, 5000 : Number of free processors (counter), 5100: Free processor bitmap.
Claims (6)
処理中の並列プログラムAでの並列演算処理の完了および第1のプロセッサによる逐次演算処理の開始を検知する第1のステップと、
該第1のステップで上記並列演算処理の完了および上記逐次演算処理の開始を検知すると、上記並列プログラムAの並列演算処理に対する上記第1のプロセッサ以外のプロセッサの割り当てを解除する第2のステップと、
該割り当てを解除したプロセッサを、他の並列プログラムBの並列演算処理に割り当て、該並列プログラムBの並列演算処理を上記第1のプロセッサによる上記並列プログラムAの逐次演算処理と並列して実行する第3のステップとを有することを特徴とするプログラム割当制御方法。A plurality of parallel programs to be processed in parallel by dividing one consecutive operations on a plurality of processing units, respectively, a program allocation control method of a computer system that executes the multiplexed plurality of processors,
A first step of detecting completion of parallel arithmetic processing in the parallel program A being processed and start of sequential arithmetic processing by the first processor ;
Upon detecting the start of the completion and the sequential processing of the parallel processing in the first step, a second step of releasing the allocation of processors other than the first processor for parallel processing of the parallel program A When,
A processor cancels the allocation, assignment to parallel processing of other parallel program B, that perform parallel processing of said parallel program B in parallel with the sequential processing of the parallel program A according to the first processor A program allocation control method comprising: a third step.
上記割り当てを解除したプロセッサを割り当てる並列プログラムBとして、
上記並列プログラムA以外の並列プログラムのうち、当該並列プログラムの実際に演算を行っている演算処理数を示す演算処理実行数が空きプロセッサ数以下で、かつ、予め算出された割り当て優先度が最も高い並列プログラムを選択することを特徴とするプログラム割当制御方法。The program allocation control method according to claim 1,
As a parallel program B for assigning a processor whose deallocation has been canceled,
Among the parallel programs other than the parallel program A, the number of operation processing executions indicating the number of operation processes actually executing the parallel program is equal to or less than the number of free processors, and the pre-assigned allocation priority is the highest A program allocation control method comprising selecting a parallel program.
上記第1のステップで逐次演算処理の開始を検知した後、該逐次演算処理が所定時間経過したことを検知するステップを有し、
該ステップでの検知後、上記第2のステップでの処理および上記第3のステップでの処理を行うことを特徴とするプログラム割当制御方法。A program allocation control method according to claim 1 or 2 , wherein:
After detecting the start of the sequential calculation process in the first step, detecting that the sequential calculation process has passed a predetermined time;
A program allocation control method comprising: performing the processing in the second step and the processing in the third step after the detection in the step.
予め定められた周期で、並列プログラムのプロセッサへの割り当ての変更要否を判別するステップと、
次周期で変更要と判別された変更前の並列プログラムで逐次演算処理を実行中であれば、該逐次演算処理を次周期での空きプロセッサに割り当てるステップと
を有することを特徴とするプログラム割当制御方法。A program allocation control method according to any one of claims 1 to 3, comprising:
Determining whether it is necessary to change the assignment of the parallel program to the processor at a predetermined cycle; and
A program assignment control, comprising: a step of assigning the sequential calculation process to an empty processor in the next period if the sequential calculation process is being executed in the parallel program before the change determined to be required in the next period. Method.
処理中の並列プログラムAでの並列演算処理の完了および第1のプロセッサによる逐次演算処理の開始を検知する第1の手段と、
該第1の手段で上記並列演算処理の完了および上記逐次演算処理の開始を検知すると、上記並列プログラムAの並列演算処理に対する上記第1のプロセッサ以外のプロセッサの割り当てを解除し、該割り当てを解除したプロセッサを、他の並列プログラムBの並列演算処理に割り当て、該並列プログラムBの並列演算処理を上記第1のプロセッサによる上記並列プログラムAの逐次演算処理と並列して実行する第2の手段とを有することを特徴とするプログラム割当制御システム。A plurality of parallel programs to be processed in parallel by dividing one consecutive operations on a plurality of processing units, respectively, a program assignment control system of the computer system to run multiple in multiple processors,
First means for detecting completion of parallel arithmetic processing in the parallel program A being processed and start of sequential arithmetic processing by the first processor ;
Upon detecting the start of the completion and the sequential processing of the parallel processing by the first means, to deallocate the processors other than the first processor for parallel processing of the parallel program A, releasing the allocation was processor, assigned to the parallel processing of other parallel programs B, said parallel program second means parallel processing to run in parallel with the sequential processing of the parallel program a according to the first processor B And a program allocation control system.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2002269762A JP3951230B2 (en) | 2002-09-17 | 2002-09-17 | Program allocation control method, program, and program allocation control system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2002269762A JP3951230B2 (en) | 2002-09-17 | 2002-09-17 | Program allocation control method, program, and program allocation control system |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2004110249A JP2004110249A (en) | 2004-04-08 |
JP3951230B2 true JP3951230B2 (en) | 2007-08-01 |
Family
ID=32267598
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2002269762A Expired - Fee Related JP3951230B2 (en) | 2002-09-17 | 2002-09-17 | Program allocation control method, program, and program allocation control system |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP3951230B2 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4586873B2 (en) * | 2008-03-28 | 2010-11-24 | セイコーエプソン株式会社 | Socket management apparatus and method |
NL2004392A (en) * | 2009-04-15 | 2010-10-18 | Asml Netherlands Bv | Lithographic apparatus, control system, multi-core processor, and a method to start tasks on a multi-core processor. |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH02144657A (en) * | 1988-11-26 | 1990-06-04 | Hitachi Ltd | Parallel arithmetic processor |
JPH06139210A (en) * | 1992-10-26 | 1994-05-20 | Toshiba Corp | Video signal processor |
JPH1074150A (en) * | 1996-06-28 | 1998-03-17 | Fujitsu Ltd | Method and device for scheduling process and program storage medium |
JPH10143380A (en) * | 1996-11-07 | 1998-05-29 | Hitachi Ltd | Multiprocessor system |
JP3730740B2 (en) * | 1997-02-24 | 2006-01-05 | 株式会社日立製作所 | Parallel job multiple scheduling method |
-
2002
- 2002-09-17 JP JP2002269762A patent/JP3951230B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2004110249A (en) | 2004-04-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4606142B2 (en) | Scheduling method, scheduling apparatus, and multiprocessor system | |
JP4056471B2 (en) | System for transferring to a processor | |
US5349682A (en) | Dynamic fault-tolerant parallel processing system for performing an application function with increased efficiency using heterogeneous processors | |
EP0843849B1 (en) | Method and apparatus for strong affinity multiprocessor scheduling | |
Baruah et al. | Rate-monotonic scheduling on uniform multiprocessors | |
JP5408356B2 (en) | Scheduler program, multi-core processor system, and scheduling method | |
WO2013140529A1 (en) | Information processing method, program, and information processing device | |
JP2008084009A (en) | Multiprocessor system | |
US8020164B2 (en) | System for determining and reporting benefits of borrowed computing resources in a partitioned environment | |
KR100942740B1 (en) | Computer-readable recording medium recording schedule control program and schedule control method | |
JPWO2002069174A1 (en) | Parallel process execution method and multiprocessor computer | |
JPH03147047A (en) | Balancing of load on input/output channel path | |
CN101276293A (en) | Method and system for balancing physical system resource access between logic partitions | |
JP2008090546A (en) | Multiprocessor system | |
CN101310257A (en) | Multi-processor system and program for causing computer to execute multi-processor system control method | |
JPH02249055A (en) | Multiprocessor system, multiprocessing method and work allocation method | |
KR20070090649A (en) | Apparatus and method for providing cooperative scheduling on multi-core system | |
JP5321748B2 (en) | Multi-core processor system, thread control method, and thread control program | |
JP3962370B2 (en) | RESOURCE RESERVATION SYSTEM, RESOURCE RESERVATION METHOD, AND RECORDING MEDIUM CONTAINING PROGRAM FOR EXECUTING THE METHOD | |
JP3951230B2 (en) | Program allocation control method, program, and program allocation control system | |
JP6135392B2 (en) | Cache memory control program, processor incorporating cache memory, and cache memory control method | |
JP2015148909A (en) | Parallel computer system, control method of parallel computer system, and control program of management node | |
JP5243822B2 (en) | Workload management in a virtualized data processing environment | |
JP2010182199A (en) | Job scheduling system, method, and program | |
JP3885748B2 (en) | Group unit gang scheduling method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20040813 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20060912 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20061006 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20061204 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20070330 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20070412 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
LAPS | Cancellation because of no payment of annual fees |