JP2004171167A - Multiprocessor computer and program - Google Patents

Multiprocessor computer and program Download PDF

Info

Publication number
JP2004171167A
JP2004171167A JP2002334577A JP2002334577A JP2004171167A JP 2004171167 A JP2004171167 A JP 2004171167A JP 2002334577 A JP2002334577 A JP 2002334577A JP 2002334577 A JP2002334577 A JP 2002334577A JP 2004171167 A JP2004171167 A JP 2004171167A
Authority
JP
Japan
Prior art keywords
processor
thread
execution time
parallel execution
parallel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2002334577A
Other languages
Japanese (ja)
Other versions
JP3876818B2 (en
Inventor
Jun Tanabe
純 田辺
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 JP2002334577A priority Critical patent/JP3876818B2/en
Publication of JP2004171167A publication Critical patent/JP2004171167A/en
Application granted granted Critical
Publication of JP3876818B2 publication Critical patent/JP3876818B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To acquire the parallel execution time of each parallel program even when a plurality of the parallel programs are executed on a multiprocessor computer. <P>SOLUTION: When a thread is generated in a processor of a processor 100-n's own (1≤n≤N) and the thread is the first one in a process, the processor 100-n generates a parallel execution time table 202 peculiar to the above process on a main storage device 200. When the processor 100-n allocates the processor of its own to the thread in the process and when the processor 100-n gets back the processor of its own from the thread in the process, the processor 10-n updates the parallel execution time table 202 on the basis of a current time which a system timer 205 shows; a time when the parallel execution time table is updated, which a time stamp 204 shows; the number of the threads which a parallel counter 203 shows; and the contents of the parallel execution time table 202. The thread acquires the contents of the parallel execution time table 202 by means of a parallel execution time acquisition system call. <P>COPYRIGHT: (C)2004,JPO

Description

【0001】
【発明の属する技術分野】
本発明は、複数のプロセッサが主記憶装置を共有するマルチプロセッサ計算機に関し、特に、並列プログラムが如何に効率良く動作したかを表す指標である並列実行時間を算出する技術に関する。
【0002】
【従来の技術】
複数のプロセッサから構成されるマルチプロセッサ計算機の性能評価を行う従来の技術として、各プロセッサ毎にプロセッサが稼働状態にあるときの開始時刻及び終了時刻と、プロセッサが非稼働状態のときの時刻とを記録し、制御部が、上記各時刻に基づいて任意の時刻におけるプロセッサの稼働台数や、稼働率を求める技術が知られている(例えば、特許文献1参照)。
【0003】
【特許文献1】
特開平5−189395号公報
【0004】
【発明が解決しようとする課題】
上述した従来の技術によれば、何台のプロセッサが同時に稼働しているかを知ることはできるが、マルチプロセッサ計算機を使用して並列プログラムを実行するユーザにとって重要なことは、プロセッサが何台同時に稼働しているかではなく、並列プログラムが効率的に実行されるか否かである。マルチプロセッサ計算機で実行される並列プログラムが1つの場合には、上述した従来の技術によっても並列プログラムが効率的に実行されているか否かを判定することができる。つまり、多くのプロセッサが同時に稼働している時間が長いほど、並列プログラムが効率的に実行されていると判定することができる。
【0005】
しかし、マルチプロセッサ計算機で実行される並列プログラムが複数の場合は、プロセッサの稼働台数が分かったとしても、稼働台数に基づいて並列プログラムが効率的に実行されているか否かを判定することはできない。例えば、並列プログラムαの2つのスレッドと、並列プログラムβの1つのスレッドとがマルチプロセッサ計算機で実行されている場合、上述した従来の技術では、プロセッサの稼働台数が3台であることが分かるだけであり、並列プログラムα,β毎に、同時に実行されているスレッド数が分からないため、各並列プログラムが効率的に実行されているか否かを判定することはできない。
【0006】
そこで、本発明の目的は、複数の並列プログラムが同時に実行されている場合でも、各並列プログラムが効率的に実行されているか否かを判定できるようにすることにある。
【0007】
【課題を解決するための手段】
本発明にかかる第1のマルチプロセッサ計算機は、上記目的を達成するため、複数のプロセッサと、該複数のプロセッサによって共有される主記憶装置とを備えたマルチプロセッサ計算機において、
前記各プロセッサが、
自プロセッサで生成されたスレッドが、該スレッドが属するプロセス中の最初のスレッドである場合、前記主記憶装置上に、前記プロセスに固有の並列実行時間テーブルであって、複数のスレッド数毎に、そのスレッド数以上のスレッドに同時にプロセッサが割り当てられた時間を登録する領域を有する並列実行時間テーブルを生成する手段と、
自プロセッサを前記プロセス内のスレッドに割り当てるとき、及び自プロセッサを前記プロセス内のスレッドから返還させるとき、現時点においてプロセッサが割り当てられている、前記プロセス内のスレッドの数と、現時点の時刻と、現時点における前記並列実行時間テーブルの内容と、前記並列実行時間テーブルに対する最新の更新時刻とに基づいて、前記並列実行時間テーブルを更新する手段と、
前記並列実行時間テーブルの内容を取得する手段とを備えたことを特徴とする。
【0008】
また、本発明にかかる第2のマルチプロセッサ計算機は、
第1のマルチプロセッサ計算機において、
前記並列実行時間テーブルが、前記主記憶装置以外の、前記複数のプロセッサによって共有される記憶装置上に生成されることを特徴とする。
【0009】
より具体的には、本発明にかかる第3のマルチプロセッサ計算機は、
複数のプロセッサと、該複数のプロセッサによって共有される主記憶装置とを備えたマルチプロセッサ計算機において、
前記各プロセッサが、
自プロセッサで生成されたスレッドが、該スレッドが属するプロセス中の最初のスレッドである場合、前記主記憶装置上に、前記プロセスに固有のスレッド共有空間であって、複数のスレッド数毎に、そのスレッド数以上のスレッドに同時にプロセッサが割り当てられていた時間が登録される領域を有する並列実行時間テーブルと、前記プロセス内のスレッドの内の、現時点においてプロセッサが割り当てられているスレッドの数が設定される並列カウンタと、前記並列実行時間テーブルに対する最新の更新時刻が設定されるタイムスタンプとを含むスレッド共有空間を生成する手段と、
自プロセッサを前記プロセス内のスレッドに割り当てるとき、現在時刻と、前記並列実行時間テーブルの内容と、前記並列カウンタの内容と、前記タイムスタンプの内容とに基づいて、前記並列実行時間テーブルの内容を更新すると共に、前記タイムスタンプに現在時刻を設定し、更に、前記並列カウンタの値を増加させる手段と、
自プロセッサを前記プロセス内のスレッドから返還させるとき、現在時刻と、前記並列実行時間テーブルの内容と、前記並列カウンタの内容と、前記タイムスタンプの内容とに基づいて、前記並列実行時間テーブルの内容を更新すると共に、前記タイムスタンプに現在時刻を設定し、更に、前記並列カウンタの値を減少させる手段と、
前記並列実行時間テーブルの内容を取得する手段とを備えたことを特徴とする。
【0010】
本発明にかかる第4のマルチプロセッサ計算機は、
第3のマルチプロセッサ計算機において、
前記スレッド共有空間が、前記主記憶装置以外の、前記複数のプロセッサによって共有される記憶装置上に生成されることを特徴とする。
【0011】
【作用】
或るプロセッサでスレッドが生成されると、そのスレッドがプロセス中の最初のスレッドである場合、主記憶装置上に上記プロセス固有の並列実行時間テーブルが作成される。その後、何れかのプロセッサが、上記プロセス内のスレッドにプロセッサを割り当てたり、上記プロセス内のスレッドからプロセッサを返還させるとき、現時点の時刻と、上記並列実行時間テーブルに対する最新の更新時刻と、現時点においてプロセッサが割り当てられている上記プロセスに属するスレッドの数と、並列実行時間テーブルの内容とに基づいて並列実行時間テーブルを更新する。このように、プロセス固有の並列実行時間テーブルを用いて並列実行時間を管理するようにしているので、マルチプロセッサ計算機で複数の並列プログラムが同時に実行されている場合であっても、各並列プログラムが効率的に動作しているか否かを判定することが可能になる。
【0012】
【発明の実施の形態】
次に本発明の実施の形態について図面を参照して詳細に説明する。
【0013】
【実施例の構成】
図1は本発明にかかるマルチプロセッサ計算機の実施例のブロック図であり、複数のプロセッサ(CPU,演算器)100−1〜100−Nと、各プロセッサ100−1〜100−Nによって共有される主記憶装置200とから構成されている。
【0014】
先ず、以下の説明で使用する用語の定義について述べておく。
【0015】
プロセスとは、UNIX(登録商標)システムにおいて一般的にプロセスと呼ばれる概念に相当する。すなわち、プロセスとは、固有の記憶領域を有する最小の実行単位であり、時分割処理によりスケジューリングされるものである。従って、マルチプロセッサ計算機においては、複数のプロセッサ上で同時に異なるプロセスを実行することができ、シングルプロセッサシステムにおいても複数のプロセスをインタラクティブに実行することができる。
【0016】
また、スレッドとは、UNIX(登録商標)システムにおいて一般的にスレッドと呼ばれる概念に相当する。すなわち、スレッドは単一のプロセスから生成された複数の実行単位であり、プロセスと同様に時分割処理によりスケジューリングされる。スレッドは固有の記憶領域を持たない最小の実行単位であり、同一プロセスに属する各スレッドはそれらが属している同一プロセスに固有の記憶領域を共有している。
【0017】
また、時分割処理とは、非同期的あるいは同期的に発生する割り込みを契機として、実行待ち状態のプロセスのうち実行優先度の高いものからプロセッサが割り当てられ、プロセッサ上で実行される間に実行優先度が低下し、優先度が低いものからプロセッサを返還して実行待ち状態に移行するスケジューリング方式のことである。一般的にはマルチプロセッサ計算機における並列プログラムの最小実行単位はスレッドにより実現される事が多いが、プロセスによって実現される場合もある。スレッドにより実現される場合は、並列プログラムは複数のスレッドにより構成されたプロセスに相当し、このプロセスに固有の空間でかつこのプロセスを構成する複数のスレッドが互いに共有するスレッド共有空間を利用して動作する。プロセスにより実現される場合は、並列プログラムは複数のプロセスにより構成されたジョブに相当し、このジョブに固有の空間でかつこのジョブを構成する複数のプロセスが互いに共有するプロセス共有空間を利用して動作する。以下では並列プログラムの最小の実行単位がスレッドである事を想定した記述となっているが、最小の実行単位がプロセスであるようなシステムの場合でも、プロセスをスレッド、ジョブをプロセスと読み替えることで同様の効果を得ることができる。
【0018】
図1において、主記憶装置200は、各プロセッサ100−1〜100−Nから等価に共有されたシステムに唯一の主記憶装置である。主記憶装置200は、スレッド共有空間201と、システムタイマ205とを含んでいる。
【0019】
スレッド共有空間201は、任意のある時点においてシステムに存在する複数のプロセスの内の任意の一つが占有してアクセス可能な記憶領域であり、なおかつそのプロセスに属する各スレッドが共有している記憶領域である。このようなスレッド共有空間201には、並列実行時間テーブル202と、並列カウンタ203と、タイムスタンプ204とが設けられている。
【0020】
並列実行時間テーブル202は、対応するプロセスを構成しているスレッドに関する1並列実行時間からN並列実行時間までの配列(要素数N)が格納される領域を表している。ここで、n並列実行時間(n=1,2,…,N)とはn個以上のスレッドが同時に動作していた時間(n個以上のスレッドに同時にプロセッサが割り当てられていた時間)を表すものとする。
【0021】
並列カウンタ203は、対応するプロセスを構成するスレッドの内、同時に異なるプロセッサで動作しているスレッドの数(0〜N)を表している。
【0022】
タイムスタンプ204には、並列実行時間テーブル202に対する最新の更新時刻が格納される。
【0023】
システムタイマ205には、システム稼働中にマシンクロック単位で単調増加し続けるシステムに唯一のタイマ値が格納される。
【0024】
また、図1においてプロセッサ100−1は、ユーザプログラム実行処理部101と、割込み開始処理部102と、並列実行時間算出処理部103と、並列カウンタ減少処理部104と、並列実行時間取得処理部105と、処理部106と、並列実行時間算出処理部107と、並列カウンタ増加処理部108と、割込み終了処理部109と、スレッド開始処理部110と、プロセッサ割当処理部111と、ウェイト処理部112と、プロセッサ返還処理部113と、スレッド終了処理部114と、記録媒体Kとを備えている。なお、他のプロセッサもプロセッサ100−1と同様の構成を有している。
【0025】
ユーザプログラム実行処理部101は、スレッドがユーザモードでプログラムのコードを実行する手段である。
【0026】
割込み開始処理部102は、システムコールやI/O処理、例外処理などの非同期ないし同期的な割込みの発生に伴い、プロセッサコンテキストのセーブや割込み原因に対応する割込みハンドラを呼び出す。
【0027】
並列実行時間算出部103は、割込み開始処理の直後に呼び出され、システムコールの発行元のスレッドが属するプロセスに固有のスレッド共有空間201内の並列カウンタ203の値を参照し、その値が、「1」以上であった場合は、並列実行時間テーブル202内の第1番目のエントリから並列カウンタ203の値に対応するエントリまでの各値に、システムタイマ205とタイムスタンプ204との差分を加算し、その後、タイムスタンプ204にシステムタイマ205の値を設定する。また、並列カウンタ203の値が「0」であった場合は、タイムスタンプ204にシステムタイマ205の値を設定する処理のみを行い、並列実行時間テーブル202に対する更新処理は行わない。
【0028】
並列カウンタ減少処理部104は、並列カウンタ203の値を1減少させる機能を有する。
【0029】
並列実行時間取得処理部105は、並列実行時間取得システムコールにより呼び出され、発行元のスレッドが属するプロセスに対応するスレッド共有空間201の並列実行時間テーブル202の各エントリの内容を取得し、スレッドに返却する機能を有する。
【0030】
並列実行時間算出処理部107は、並列実行時間算出処理部103と同様の機能を有する。
【0031】
並列カウンタ増加処理部108は、並列カウンタ203の値を1増加させる機能を有する。
【0032】
割込み終了処理部109は、プロセッサコンテキストのリストアや割込み発生ポイントへの復帰を行う。
【0033】
スレッド開始処理部110は、新たに生成されたスレッドが、そのスレッドの属しているプロセス内の最初のスレッドであった場合、プロセスに固有の空間で且つそのプロセスに属している全てのスレッドが共有するスレッド共有空間201を確保した上で、並列実行時間テーブル202、並列カウンタ203及びタイムスタンプ204の値を「0」に初期化する。
【0034】
プロセッサ割当処理部111は、他の実行優先度の低いスレッドからプロセッサを奪い取り、仮想空間の切り替えなどのスイッチ処理を実行してスレッドの実行を開始させる。
【0035】
ウェイト処理部112は、スリープシステムコールやタイムスライス切れが発生した場合、スレッドを実行待ちキューやスリープキューなどを用いて停止させる。
【0036】
プロセッサ返還処理部113は、システムコールやI/O待ちによるスリープ呼び出しや、終了処理、タイムスライス切れ割込みで自スレッドよりも実行優先度の高いスレッドがある時などに呼び出され、他の実行優先度の高いスレッドにプロセッサを譲るために仮想空間の切り替えなどのスイッチ処理を実行する。
【0037】
スレッド終了処理部114は、終了したスレッドがプロセス内の最後のスレッドである場合は、上記プロセス固有のスレッド共有空間201を解放する機能を有する。
【0038】
なお、並列実行時間算出処理部103,並列カウンタ減少処理部104によって連続的に行われる処理と、並列実行時間算出処理部107,並列カウンタ増加処理部108によって連続的に行われる処理と、並列実行時間取得処理部105によって行われる処理とはそれぞれ互いに、同一プロセス内の異なるスレッドにおいて同時に実行されないよう、排他制御によりシリアライズされている。
【0039】
処理部106は、プロセッサ返還処理、並列実行時間取得処理以外の、システムコールに応じた処理、I/O処理、例外処理などの一般的な割込み処理を行う。
【0040】
記録媒体Kは、ディスク、半導体メモリ、その他の記録媒体である。この記録媒体Kに記録されているプログラムは、プロセッサ100−1によって読み取られ、その動作を制御することで、プロセッサ100−1上に、ユーザプログラム実行処理部101、割込み開始処理部102、並列実行時間算出処理部103、並列カウンタ減少処理部104、並列実行時間取得処理部105、処理部106、並列実行時間算出処理部107、並列カウンタ増加処理部108、割込み終了処理部109、スレッド開始処理部110、プロセッサ割当処理部111、ウェイト処理部112、プロセッサ返還処理部113、スレッド終了処理部114を実現する。
【0041】
【実施例の動作】
次に各図を参照して本実施例の動作について詳細に説明する。
【0042】
先ず、プロセッサ100−1においてスレッドXが生成されると、プロセッサ100−1内のスレッド開始処理部110は、スレッドXを実行待ちキュー(図示せず)につなぎ、更に、図2の流れ図に示すように、スレッドXが、それが属するプロセスZ内の最初のスレッドであるか否かを判断し(ステップS1)、最初のスレッドであった場合(ステップS1がYes)は、上記プロセスZに固有のスレッド共有空間201を生成し、更に、並列実行時間テーブル202の各エントリ、並列カウンタ203及びタイムスタンプ204の値を「0」に初期設定する(ステップS2)。これに対して、最初のスレッドでなかった場合(ステップS1がNo)は、ステップS2をスキップする。
【0043】
その後、或るプロセッサ(例えば、プロセッサ100−1)内のプロセッサ割当処理部111によって、実行待ちキューにつながれているスレッドXにプロセッサ100−1が割り当てられると、並列実行時間算出処理部107が、並列実行時間の算出処理を行う(ステップS13)。
【0044】
このステップS13の処理を詳しく説明すると、次のようになる。先ず、スレッドXが属するプロセスZに割り当てられているスレッド共有空間201中の並列カウンタ203の値Cを参照し、その値Cが「1」以上であるか否かを調べる。
【0045】
そして、「1」以上であった場合は、システムタイマ205の値STMとタイムスタンプ204の値TSとの差分(STM−TS)を求める。その後、並列実行時間テーブル202の各エントリの内の、第1番目のエントリから並列カウンタ203の値に対応するエントリまでを対象にして、そこに設定されている値に上記差分(STM−TS)を加算する。そして、最後に、タイムスタンプ204の値TSにシステムタイマ205の値STMを設定する。
【0046】
これに対して、並列カウンタ203の値Cが「1」未満であった場合は、タイムスタンプ204の値TSにシステムタイマ205の値STMを設定する処理のみを行い、並列実行時間テーブル202に対する更新処理は行わない。以上がステップS13で行う処理の詳細である。
【0047】
並列実行時間算出処理部107の処理が終了すると、並列カウンタ増加処理部108が、スレッドXが属しているプロセスZに割り当てられているスレッド共有空間201内の並列カウンタ203の値Cを増加させる(ステップS14)。なお、本実施例では、並列カウンタ203の値Cを「1」増加させるものとする。
【0048】
その後、割込み終了処理部109による割込み終了処理が行われ、上記スレッドXは、ユーザモードに移行し、ユーザプログラム実行処理部101でユーザプログラムを実行する(ステップS3)。このステップS3では、並列プログラムがプログラムの記述に従って実行され、割込みが発生しない限り(ステップS4がYesとならない限り)、ユーザプログラムが実行され続ける。
【0049】
スレッドXがシステムコールやI/Oを発行したり、タイムスライス切れや例外処理により割り込まれた場合(ステップS4がYes)は、割込み開始処理部102に処理が移行し、以下の処理が行われる。
【0050】
先ず、並列実行時間算出処理部103がスレッドXが属しているプロセスZのスレッド共有空間201を対象にして、ステップS13において並列実行時間算出処理部107が行った処理と同様の処理を行う(ステップS7)。次いで、並列カウンタ減少処理部104が並列カウンタ203の値Cを減少させる(ステップS8)。本実施例では、並列カウンタ203の値Cを「1」減少させるものとする。
【0051】
その後、割込み要因に対応する割込み処理が実行される。もし、割込み要因が並列実行時間取得システムコールである場合(ステップS9がYes)は、並列実行時間取得処理部105において、並列実行時間の取得処理が行われる(ステップS11)。このステップS11の並列実行時間の取得処理では、並列実行時間テーブル202の内容を全て取得し、システムコールの発行元のスレッドに返却する処理が行われる。その後、並列実行時間算出処理部107において、スレッドXが属するプロセスZのスレッド共有空間201を処理対象にして前述した並列実行時間の算出処理が行われ(ステップS13)、更に、並列カウンタ増加処理部108において前述した並列カウンタ203の増加処理が行われる(ステップS14)。その後、割込み終了処理部109において割込み終了処理が実行され、上記スレッドXは、ユーザモードに移行し、ユーザプログラム実行処理部101でユーザプログラムを実行する(ステップS3)。
【0052】
また、割込み要因が並列実行時間取得システムコールでなかった場合(ステップS9がNo)は、割込み要因が終了システムコールであるか否かを判定する(ステップS10)。
【0053】
そして、終了システムコールでなかった場合(ステップS10がNo)は、処理部106において割込み要因に応じた割込み処理が行われる(ステップS12)。このステップS12で行われる処理としては、例えば、新たなスレッドYの生成処理などがある。もし、ステップS12で新たなスレッドYが生成されたとすると、スレッド開始処理部110は、スレッドYを実行待ちキューにつなぐと共に、上記スレッドYを処理対象にして前述したステップS1の処理を行う。この場合、スレッドYはプロセスZ中の最初のスレッドでないので(ステップS1がNo)、ステップS2はスキップされる。その後、プロセッサ100−1〜100−Nの内の、或る1台のプロセッサ100−n(1≦n≦N)内のプロセッサ割当処理部111によってスレッドYにプロセッサ100−nが割り当てられると、並列実行時間算出処理部107、並列カウンタ増加処理部108、割込み終了処理部109による処理が順次行われる。
【0054】
これに対して、割込み要因が終了システムコールであった場合(ステップS10がYes)は、プロセッサ返還処理部113によるプロセッサ返還処理が行われた後、スレッド終了処理部114によるスレッド終了処理が行われる。このスレッド終了処理においては、先ず、終了システムコールの発行元のスレッド(例えば、スレッドX)が、同一プロセスZ内の最後のスレッドであるか否かを判断する(ステップS5)。そして、最後のスレッドである場合(ステップS5がYes)は、スレッドXが属しているプロセスZに割り当てられているスレッド共有空間201を解放する(ステップS6)。これに対して、最後のスレッドでない場合(ステップS5がNo)は、ステップS6をスキップする。その後、スレッドXは終了する。
【0055】
以上の処理により、割込みの発生毎に並列実行時間テーブル202に1並列実行時間からN並列実行時間までの各値が適時採取されことになる。なお、並列実行時間をTn、並列カウンタ203の値をC、タイムスタンプ204の値をTS、システムタイマ205の値をSTMと表記すると、ステップS7、S13の並列実行時間の算出処理は、Tn=Tn+(STM−TS)(但し1≦n≦Cの各値について)、およびTS=STM と表記できる。また、ステップS8の並列カウンタ減算処理はC=C−1と表記でき、ステップS14の並列カウンタ増加処理は C=C+1と表記できる。
【0056】
次に、具体例を用いて並列実行時間が算出される様子を説明する。
【0057】
図3は、3つのスレッドA、B、Cにより構成される並列プログラムが動作した際の、並列実行時間テーブル202の各エントリの値Tn(n=1,2,…,N)、並列カウンタ203の値C及びタイムスタンプ204の値TSの遷移を表した図である。なお、以下では説明を容易にするために、割り込みは時刻P1,P2,…,P8の8箇所においてのみ発生したものとし、なおかつ割り込みが発生してから終了するまでに要する時間は十分に短く0に等しかったと仮定する。すなわち、割込み開始処理部102で割込み開始処理が行われてから割込み終了処理部109で割込み終了処理が行われるまでの間にシステムタイマ205の値は変動しなかったと仮定する。なお、現実のシステムおいては、割り込みは任意のスレッドの任意の時点で発生し、割り込みが発生してから終了するまでに要する時間は0以上の可変値となるが、現実のシステムのどのような場合も図3で例示した処理の組み合わせにすぎず、並列実行時間が正しく採取される。
【0058】
時刻P1(STM=10)において、プロセッサ100−1でスレッドAが生成されると、プロセッサ100−1内のスレッド開始処理部110は、スレッドAを実行待ちキューにつなぐと共に、スレッドAが、それが属するプロセスD内の最初のスレッドであるか否かを判断する(図2、ステップS1)。この場合、スレッドAは最初のスレッドであるので(ステップS1がYes)、スレッド開始処理部110は、スレッドAが属するプロセスD固有のスレッド共有空間201を生成し、更に、並列実行時間テーブル202の各エントリの値T1〜TN、並列カウンタ203の値C及びタイムスタンプ204の値TSを全て「0」に初期化する(ステップS2)。
【0059】
その後、或るプロセッサ(例えば、プロセッサ100−1)内のプロセッサ割当処理部111によって、実行待ちキューにつながれているスレッドAにプロセッサ100−1が割り当てられると、並列実行時間算出処理部107が、ステップS13の並列実行時間算出処理を行う。この場合、並列カウンタ203の値Cは「0」であるので、並列実行時間算出処理部107は、並列実行時間テーブル202に対する更新処理は行わず、タイムスタンプ204の値TSにシステムタイマ205の値STMの値を設定する処理だけを行う。従って、TS=10となる。
【0060】
その後、並列カウンタ増加処理部108が、並列カウンタ203の値Cを+1し、C=1とする(ステップS14)。その後、割込み終了処理部109による割込み終了処理が行われ、スレッドAがユーザプログラム実行処理部101でユーザプログラムの実行を開始する(ステップS3)。
【0061】
次に、時刻P2(STM=25)において、スレッドAが新たなスレッドBを生成するためにスレッド生成システムコールを発行する(ステップS4がYes)。これにより、割込み開始処理部102に処理が移行し、並列実行時間算出処理部103において並列実行時間算出処理が行われる(ステップS7)。このとき、並列カウンタ203の値Cは「1」であるので、並列実行時間テーブル202の第1番目のエントリの値T1に、システムタイマ205の値STMとタイムスタンプ204の値TSとの差分(STM−TS)を加算し、更に、システムタイマ205の値STMをタイムスタンプ204の値TSに設定する。すなわち、T1=T1+(STM−TS)=0+(25−10)=15、TS=STM=25となる。その後、並列カウンタ減少処理部104が、並列カウンタ203の値Cを1減少させ、C=0とする(ステップS8)。
【0062】
その後、プロセッサ100−1内の処理部106においてスレッドBが生成される(ステップS12)。
【0063】
スレッドBが生成されると、プロセッサ100−1内のスレッド開始処理部110は、スレッドBを実行待ちキューにつなぐと共に、スレッドBがプロセスDの最初のスレッドであるか否かを判断する(ステップS1)。この場合、スレッドBは最初のスレッドでないので、ステップS2の処理はスキップされる。
【0064】
また、プロセッサ100−1内の並列実行時間算出処理部107において、並列実行時間算出処理が行われる(ステップS13)。このとき、並列カウンタ203の値Cは「0」であるので、並列実行時間テーブル202は更新されず、タイムスタンプ204の値TSにシステムタイマ205の値STMが設定される。すなわち、TS=25となる(STMは変動しなかったと仮定)。その後、並列カウンタ増加処理部108において、並列カウンタ増加処理が行われ、並列カウンタ203の値Cが「1」にされる(ステップS14)。その後、割込み終了処理部109による割込み終了処理が行われ、スレッドAはユーザプログラムの処理に復帰する。
【0065】
一方、実行待ちキューにつながれたスレッドB(新たに生成されたスレッド)に、或るプロセッサ(例えば、プロセッサ100−2)内のプロセッサ割当処理部111によりプロセッサ100−2が割り当てられると、プロセッサ100−2内の並列実行時間算出処理部107が並列実行時間の算出処理を行う(ステップS13)。この時、スレッドBが属するプロセスDに割り当てられているスレッド共有空間201内の並列カウンタ203の値Cは「1」であるので、並列実行時間テーブル202の第1番目のエントリの値T1をT1=T1+(STM−TS)=15+(25−25)=15とし、タイムスタンプ204の値TSを「25」とする。その後、並列カウンタ増加処理部108において、並列カウンタ203に対する増加処理が行われ、並列カウンタ203の値Cが「2」にされる。
【0066】
その後、割込み終了処理部109による割込み終了処理が行われ、スレッドBは、ユーザプログラムの実行を開始する。ここで、スレッドAが割り当てられているプロセッサ100−1内の並列実行時間算出処理部107、並列カウンタ増加処理部108よりも、スレッドBが割り当てられるプロセッサ100−2内の並列実行時間算出処理部107、割込み終了処理部109が先の処理を行ったとしても最終的な結果は同じである。
【0067】
次に、時刻P3(STM=35)において、プロセッサ100−2で実行されているスレッドBがスリープシステムコールを発行すると、プロセッサ100−2内の割込み開始処理部102に制御が移り、並列実行時間算出処理部103が並列実行時間の算出処理を行う(ステップS7)。この時、並列カウンタ203の値Cは「2」であるので、並列実行時間テーブル202の第1番目、第2番目の値T1、T2が更新される。すなわち、STM−TS=35−25=10が、値T1、T2に加算され、T1=T1+(STM−TS)=15+10=25、T2=T2+(STM−TS)=0+10=10となる。その後、並列実行時間算出処理部103において並列カウンタ203の減少処理が行われ、並列カウンタ203の値Cが「1」にされる(ステップS8)。その後、プロセッサ返還処理部113がプロセッサの返還処理を行い、更に、ウェイト処理部112がスレッドBをスリープキューにつなぎ、停止させる。
【0068】
次に、時刻P4(STM=40)において、例えば、プロセッサ100−2内のプロセッサ割当処理部111が、停止していたスレッドBにプロセッサ100−2を割り当てると、プロセッサ100−2内の並列実行時間算出処理部107が、並列実行時間の算出処理を行う(ステップS13)。この時、並列カウンタ203の値Cは「1」となっているので、並列実行時間算出処理部107は、並列実行時間テーブル202の第1番目のエントリの値T1を更新すると共に、タイムスタンプ204の値TSを更新する。すなわち、T1=T1+(STM−TS)=25+(40−35)=30、TS=STM=40とする。その後、並列カウンタ増加処理部108が、並列カウンタ203の値Cを+1して「2」にする。その後、割込み終了処理部109により割込み終了処理が行われ、スレッドBがユーザプログラムの実行を再開する。
【0069】
次に、時刻P5(STM=50)において、プロセッサ100−2で動作しているスレッドBが、スレッドCを生成するためにスレッド生成システムコールを発行すると、プロセッサ100−2内の割込み開始処理部102に制御が移る。これにより、並列実行時間算出処理部103が並列実行時間の算出処理を行う(ステップS7)。この時、並列カウンタ203の値Cは「2」となっているので、並列実行時間テーブル202の第1、第2番目のエントリの値T1、T2に(STM−TS)を加算し、その後、タイムスタンプ204の値TSにシステムタイマ205の値STMを設定する。すなわち、T1=T1+(STM−TS)=30+(50−40)=40、T2=T2+(STM−TS)=10+(50−40)=20、TS=STM=50となる。次に、並列カウンタ減少処理部104が、並列カウンタ203の値Cを1減少させ、C=1とする。
【0070】
その後、プロセッサ100−2内の処理部106でスレッドCが生成される。スレッドCが生成されると、プロセッサ100−2内のスレッド開始処理部110は、スレッドCを実行待ちキューにつなぐと共に、スレッドCがプロセスD内の最初のスレッドであるか否かを判断する(ステップS1)。この場合、スレッドCは最初のスレッドでないので、ステップS2の処理はスキップされる。
【0071】
また、プロセッサ100−2内の並列実行時間算出処理部107において、並列実行時間の算出処理が実行される(ステップS13)。この時、並列カウンタ203の値Cが「1」であるので、並列実行時間テーブル202の第1番目のエントリの値T1を更新すると共に、タイムスタンプ204の値TSを更新する。すなわち、T1=T1+(STM−TS)=40+(50−50)=40、TS=STM=50となる。次に、並列カウンタ増加処理部108が、並列カウンタ203の値Cを1増加させ、C=2とする(ステップS14)。その後、割込み終了処理部109で割込み終了処理が実行され、スレッドBは、ユーザプログラムの処理に復帰する。
【0072】
一方、実行待ちキューにつながれている、新たに生成されたスレッドCに或るプロセッサ(例えば、プロセッサ100−3とする)内のプロセッサ割当処理部111によりプロセッサ100−3が割り当てられると、並列実行時間算出処理部107が、並列実行時間の算出処理を行う(ステップS13)。この時、並列カウンタ203の値Cは「2」であるので、並列実行時間テーブル202の第1番目、第2番目のエントリの値T1、T2が更新されると共に、タイムスタンプ204の値TSが更新される。すなわち、T1=T1+(STM−TS)=40+(50−50)=40、T2=T2+(STM−TS)=20+(50−50)=20、TS=STM=50となる。次に、並列カウンタ増加処理部108が、並列カウンタ203の値Cを1増加させ、C=3とする。
【0073】
その後、割込み終了処理部109が割込み終了処理を行い、スレッドCはユーザプログラムの実行を開始する。なお、スレッドBが実行されているプロセッサ100−2内の並列実行時間算出処理部107、並列カウンタ増加処理部108よりも先に、スレッドCが実行されるプロセッサ100−3内の並列実行時間算出処理部107、並列カウンタ増加処理部108がステップS13、S14の処理を実行したとしても最終的な結果は同じである。
【0074】
次に、時刻P6(STM=60)において、プロセッサ100−1で動作しているスレッドAが、終了するために終了システムコールを発行すると、プロセッサ100−1内の割込み開始処理部102に制御が移り、並列実行時間算出処理部103が並列実行時間の算出処理を行う(ステップS7)。このとき、並列カウンタ203の値Cは「3」であるので、並列実行時間テーブル202の第1番目、第2番目、第3番目のエントリの値T1、T2、T3が更新されると共に、タイムスタンプ204の値TSが更新される。すなわち、T1=T1+(STM−TS)=40+(60−50)=50、T2=T2+(STM−TS)=20+(60−50)=30、T3=T3+(STM−TS)=0+(60−50)=10、TS=60となる。その後、並列カウンタ減少処理部104が、並列カウンタ203の値Cを−1し、C=2とする。
【0075】
その後、プロセッサ返還処理部113が、スレッドAに割り当てていたプロセッサの返還処理を行い、更に、スレッド終了処理部114が、スレッドAの終了処理を行う。このとき、スレッドAは、プロセスD内の最後のスレッドでないので(ステップS5がNo)、スレッド共有空間201の解放処理は行われない。
【0076】
次に、時刻P7(STM=65)において、プロセッサ100−3で動作しているスレッドCが、終了するために終了システムコールを発行すると、プロセッサ100−3内の割込み開始処理部102に制御が移る。これにより、並列実行時間算出処理部103が、並列実行時間の算出処理を行う(ステップS7)。このとき、並列カウンタ203の値Cは、「2」であるので、並列実行時間テーブル202の第1番目、第2番目のエントリの値T1、T2が更新されると共に、タイムスタンプ204の値TSが更新される。すなわち、T1=T1+(STM−TS)=50+(65−60)=55、T2=T2+(STM−TS)=30+(65−60)=35、TS=STM=65となる。その後、並列カウンタ減少処理部104が並列カウンタ203の値Cを1減少させ、C=1とする(ステップS8)。
【0077】
その後、プロセッサ返還処理部113が、スレッドCに割り当てていたプロセッサの返還処理を行い、更に、スレッド終了処理部114が、スレッドCの終了処理を行う。このとき、スレッドCは、プロセスD内の最後のスレッドでないので(ステップS5がNo)、スレッド共有空間201の解放処理は行われない。
【0078】
次に、時刻P8(STM=70)において、プロセッサ100−2で動作しているスレッドBが、終了するために終了システムコールを発行すると、プロセッサ100−2内の割込み開始処理部102に制御が移る。これにより、並列実行時間算出処理部103が、並列実行時間の算出処理を行う(ステップS7)。このとき、並列カウンタ203の値Cは「1」であるので、並列実行時間テーブル202の第1番目の値T1を更新すると共に、タイムスタンプ204の値TSを更新する。すなわち、T1=T1+(STM−TS)=55+(70−65)=60、TS=STM=70となる。その後、並列カウンタ減少処理部104が、並列カウンタ203の値Cを1減算し、C=0とする(ステップS8)。
【0079】
その後、プロセッサ返還処理部113がスレッドBに割り当てていたプロセッサの返還処理を行い、更に、スレッド終了処理部114がスレッドBの終了処理を行う。この時、スレッドBは、プロセスD内で最後のスレッドであるので(ステップS5がYes)、スレッド終了処理部114は、スレッド共有空間201を解放する(ステップS6)。
【0080】
以上の処理によりスレッドA、B、Cから構成される並列プログラムの並列実行時間が算出でき、任意の時点で発行する並列実行時間取得システムコールにより、その瞬間の並列実行時間(T1,T2,T3)を容易に取得することが可能となる。例えば、時刻P8でスレッドBが並列実行時間取得システムコールを発行した場合、スレッドBは、並列実行時間(T1=60,T2=35,T1=10)を取得することができる。そして、スレッドBは、上記並列実行時間を取得すると、例えば、取得した並列実行時間を表示部(図示せず)に表示したり、並列実行時間に基づいて2並列度=35/60=0.5833(約58.3%)、3並列度=10/60=0.16666(約16.7%)を算出し、それらを表示部に表示する。
【0081】
なお、上述した実施例においては、主記憶装置200上にスレッド共有空間201を生成するようにしたが、各プロセッサ100−1〜100−Nによって共有される他の記憶装置上にスレッド共有空間201を生成するようにしても構わない。
【0082】
【発明の効果】
本発明の第1の効果は、マルチプロセッサ計算機上で複数の並列プログラムが動作している場合であっても、各並列プログラムの並列実行時間を取得できるという点である。その理由は、プロセス固有或いはジョブ固有の並列実行時間テーブルを利用して並列実行時間を管理するようにしているからである。
【0083】
本発明の第2の効果は、並列プログラムの実行時の並列度として、2並列度からN並列度までの最大(N−1)個の並列度が取得でき、並列度の詳細な検証ができる点である。その理由は、複数のスレッド数(1,2,…,N)毎に、そのスレッド数以上のスレッドに同時にプロセッサが割り当てられた時間を登録する領域を有する並列実行時間テーブルを用いて、並列実行時間を管理しているからである。
【図面の簡単な説明】
【図1】本発明の実施例のブロック図である。
【図2】図1の処理例を示す流れ図である。
【図3】具体例を挙げて実施例の動作を説明するための図である。
【符号の説明】
100−1〜100−N…プロセッサ
101…ユーザプログラム実行処理部
102…割込み開始処理部
103…並列実行時間算出処理部
104…並列カウンタ減少処理部
105…並列実行時間取得処理部
106…処理部
107…並列実行時間算出処理部
108…並列カウンタ増加処理部
109…割込み終了処理部
110…スレッド開始処理部
111…プロセッサ割当処理部
112…ウェイト処理部
113…プロセッサ返還処理部
114…スレッド終了処理部
200…主記憶装置
201…スレッド共有空間
202…並列実行時間テーブル
203…並列カウンタ
204…タイムスタンプ
205…システムタイマ
K…記録媒体
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a multiprocessor computer in which a plurality of processors share a main storage device, and more particularly, to a technique for calculating a parallel execution time, which is an index indicating how efficiently a parallel program operates.
[0002]
[Prior art]
As a conventional technique for evaluating the performance of a multiprocessor computer including a plurality of processors, a start time and an end time when a processor is in an operating state and a time when the processor is in an inactive state for each processor are described. There is known a technique in which a control unit records the number of operating processors and an operating rate at an arbitrary time based on each of the above times (see, for example, Patent Document 1).
[0003]
[Patent Document 1]
JP-A-5-189395
[0004]
[Problems to be solved by the invention]
According to the above-described conventional technology, it is possible to know how many processors are operating at the same time. However, it is important for a user who executes a parallel program using a multiprocessor computer that how many processors are simultaneously operating. It is not whether it is running, but whether or not the parallel program is executed efficiently. In the case where the number of parallel programs executed by the multiprocessor computer is one, it is possible to determine whether or not the parallel programs are being efficiently executed by the above-described conventional technique. That is, it is possible to determine that the parallel program is being executed more efficiently as the time during which many processors are operating simultaneously is longer.
[0005]
However, when there are a plurality of parallel programs executed by the multiprocessor computer, it is not possible to determine whether or not the parallel programs are being efficiently executed based on the number of operating processors, even if the number of operating processors is known. . For example, when two threads of the parallel program α and one thread of the parallel program β are executed by the multiprocessor computer, the above-described conventional technology only shows that the number of operating processors is three. Since the number of simultaneously executing threads is not known for each of the parallel programs α and β, it cannot be determined whether or not each parallel program is being executed efficiently.
[0006]
Therefore, an object of the present invention is to make it possible to determine whether or not each parallel program is being executed efficiently even when a plurality of parallel programs are being executed simultaneously.
[0007]
[Means for Solving the Problems]
In order to achieve the above object, a first multiprocessor computer according to the present invention is a multiprocessor computer including a plurality of processors and a main storage device shared by the plurality of processors.
Each of the processors,
When the thread generated by the own processor is the first thread in the process to which the thread belongs, a parallel execution time table unique to the process is provided on the main storage device, and for each of a plurality of threads, Means for generating a parallel execution time table having an area for registering a time at which a processor is simultaneously allocated to threads equal to or greater than the number of threads;
When assigning the own processor to a thread in the process, and when returning the own processor from the thread in the process, the number of threads in the process to which the processor is currently assigned, the current time, Means for updating the parallel execution time table based on the content of the parallel execution time table and the latest update time for the parallel execution time table,
Means for acquiring the contents of the parallel execution time table.
[0008]
Further, a second multiprocessor computer according to the present invention includes:
In the first multiprocessor computer,
The parallel execution time table is generated on a storage device shared by the plurality of processors other than the main storage device.
[0009]
More specifically, the third multiprocessor computer according to the present invention comprises:
In a multiprocessor computer including a plurality of processors and a main storage device shared by the plurality of processors,
Each of the processors,
When the thread created by the own processor is the first thread in the process to which the thread belongs, the thread is a thread shared space unique to the process on the main storage device, and the thread is shared by a plurality of threads. A parallel execution time table having an area in which the time at which a processor is simultaneously allocated to threads equal to or more than the number of threads is registered, and the number of threads to which a processor is currently allocated among threads in the process are set. Means for generating a thread shared space including a parallel counter, and a time stamp at which the latest update time for the parallel execution time table is set.
When allocating its own processor to a thread in the process, the content of the parallel execution time table is determined based on the current time, the content of the parallel execution time table, the content of the parallel counter, and the content of the time stamp. Means for updating, setting the current time in the time stamp, and further increasing the value of the parallel counter;
When returning the own processor from a thread in the process, the content of the parallel execution time table is determined based on the current time, the content of the parallel execution time table, the content of the parallel counter, and the content of the time stamp. Means for updating the timestamp with the current time, and further reducing the value of the parallel counter;
Means for acquiring the contents of the parallel execution time table.
[0010]
A fourth multiprocessor computer according to the present invention comprises:
In a third multiprocessor computer,
The thread sharing space is created on a storage device shared by the plurality of processors other than the main storage device.
[0011]
[Action]
When a thread is generated by a certain processor, if the thread is the first thread in the process, the process-specific parallel execution time table is created on the main storage device. Thereafter, when any processor assigns a processor to the thread in the process or returns the processor from the thread in the process, the current time, the latest update time for the parallel execution time table, The parallel execution time table is updated based on the number of threads belonging to the process to which the processor is assigned and the contents of the parallel execution time table. As described above, since the parallel execution time is managed using the parallel execution time table unique to the process, even when a plurality of parallel programs are simultaneously executed by the multiprocessor computer, each parallel program is executed. It is possible to determine whether the operation is efficient.
[0012]
BEST MODE FOR CARRYING OUT THE INVENTION
Next, embodiments of the present invention will be described in detail with reference to the drawings.
[0013]
[Configuration of the embodiment]
FIG. 1 is a block diagram of an embodiment of a multiprocessor computer according to the present invention, which is shared by a plurality of processors (CPUs, arithmetic units) 100-1 to 100-N and each of the processors 100-1 to 100-N. And a main storage device 200.
[0014]
First, definitions of terms used in the following description will be described.
[0015]
The process corresponds to a concept generally called a process in the UNIX (registered trademark) system. That is, a process is a minimum execution unit having a unique storage area, and is scheduled by time division processing. Therefore, in a multiprocessor computer, different processes can be executed simultaneously on a plurality of processors, and in a single processor system, a plurality of processes can be executed interactively.
[0016]
Further, a thread corresponds to a concept generally called a thread in a UNIX (registered trademark) system. That is, a thread is a plurality of execution units generated from a single process, and is scheduled by time-division processing like a process. A thread is the smallest execution unit having no unique storage area, and threads belonging to the same process share a unique storage area with the same process to which they belong.
[0017]
The time-division processing means that a processor is assigned from an execution waiting process having a higher execution priority when an interrupt that occurs asynchronously or synchronously occurs, and the execution priority is assigned to the processor while the process is executed on the processor. This is a scheduling method in which the degree is reduced and the processor is returned from the one with the lower priority and shifts to the execution waiting state. Generally, the minimum execution unit of a parallel program in a multiprocessor computer is often realized by a thread, but may be realized by a process. When implemented by threads, a parallel program is equivalent to a process composed of a plurality of threads, and utilizes a space unique to this process and a thread shared space shared by a plurality of threads constituting the process. Operate. When realized by a process, a parallel program is equivalent to a job configured by a plurality of processes, and utilizes a space unique to the job and a process shared space shared by a plurality of processes configuring the job. Operate. The description below assumes that the minimum execution unit of a parallel program is a thread.However, even in a system where the minimum execution unit is a process, a process can be read as a thread and a job can be read as a process. Similar effects can be obtained.
[0018]
In FIG. 1, the main storage device 200 is the only main storage device in a system equivalently shared by the processors 100-1 to 100-N. The main storage device 200 includes a thread sharing space 201 and a system timer 205.
[0019]
The thread shared space 201 is a storage area that can be occupied and accessed by any one of a plurality of processes existing in the system at an arbitrary point in time, and is a storage area shared by threads belonging to the process. It is. In such a thread sharing space 201, a parallel execution time table 202, a parallel counter 203, and a time stamp 204 are provided.
[0020]
The parallel execution time table 202 represents an area in which an array (number of elements N) from one parallel execution time to N parallel execution times for threads constituting the corresponding process is stored. Here, the n-parallel execution time (n = 1, 2,..., N) represents the time during which n or more threads are operating at the same time (the time during which processors are allocated to n or more threads at the same time). Shall be.
[0021]
The parallel counter 203 indicates the number (0 to N) of threads operating on different processors at the same time among the threads constituting the corresponding process.
[0022]
The time stamp 204 stores the latest update time for the parallel execution time table 202.
[0023]
The system timer 205 stores the only timer value in the system that keeps increasing monotonically in machine clock units during the operation of the system.
[0024]
1, the processor 100-1 includes a user program execution processing unit 101, an interrupt start processing unit 102, a parallel execution time calculation processing unit 103, a parallel counter decrease processing unit 104, and a parallel execution time acquisition processing unit 105. , A processing unit 106, a parallel execution time calculation processing unit 107, a parallel counter increase processing unit 108, an interrupt end processing unit 109, a thread start processing unit 110, a processor allocation processing unit 111, and a weight processing unit 112. , A processor return processing unit 113, a thread end processing unit 114, and a recording medium K. The other processors have the same configuration as the processor 100-1.
[0025]
The user program execution processing unit 101 is means for executing a program code in a thread in a user mode.
[0026]
When an asynchronous or synchronous interrupt such as a system call, an I / O process, or an exception process occurs, the interrupt start processing unit 102 saves a processor context and calls an interrupt handler corresponding to the cause of the interrupt.
[0027]
The parallel execution time calculation unit 103 is called immediately after the interrupt start process, refers to the value of the parallel counter 203 in the thread shared space 201 unique to the process to which the thread that issued the system call belongs, and sets the value to “ If the value is “1” or more, the difference between the system timer 205 and the time stamp 204 is added to each value from the first entry in the parallel execution time table 202 to the entry corresponding to the value of the parallel counter 203. Then, the value of the system timer 205 is set to the time stamp 204. When the value of the parallel counter 203 is “0”, only the process of setting the value of the system timer 205 to the time stamp 204 is performed, and the update process for the parallel execution time table 202 is not performed.
[0028]
The parallel counter decrease processing unit 104 has a function of decreasing the value of the parallel counter 203 by one.
[0029]
The parallel execution time acquisition processing unit 105 is called by the parallel execution time acquisition system call, acquires the contents of each entry of the parallel execution time table 202 of the thread shared space 201 corresponding to the process to which the issuing thread belongs, and Has a function to return.
[0030]
The parallel execution time calculation processing unit 107 has the same function as the parallel execution time calculation processing unit 103.
[0031]
The parallel counter increase processing unit 108 has a function of increasing the value of the parallel counter 203 by one.
[0032]
The interrupt termination processing unit 109 restores the processor context and returns to the interrupt occurrence point.
[0033]
When the newly created thread is the first thread in the process to which the thread belongs, the thread start processing unit 110 shares the space unique to the process with all the threads belonging to the process. After securing the thread shared space 201 to be executed, the values of the parallel execution time table 202, the parallel counter 203, and the time stamp 204 are initialized to “0”.
[0034]
The processor allocation processing unit 111 robbs a processor from another thread having a low execution priority, executes switch processing such as switching of a virtual space, and starts execution of the thread.
[0035]
When a sleep system call or a time slice expires, the wait processing unit 112 stops the thread using an execution wait queue or a sleep queue.
[0036]
The processor return processing unit 113 is called when there is a thread having a higher execution priority than its own thread due to a sleep call due to a system call or an I / O wait, a termination process, or a time-slice outage interrupt. Switch processing such as switching of a virtual space in order to yield a processor to a thread having a high thread count.
[0037]
The thread termination processing unit 114 has a function of releasing the process-specific thread shared space 201 when the terminated thread is the last thread in the process.
[0038]
Note that a process continuously performed by the parallel execution time calculation processing unit 103 and the parallel counter decrease processing unit 104, a process continuously performed by the parallel execution time calculation processing unit 107 and the parallel counter increase processing unit 108, The processing performed by the time acquisition processing unit 105 is serialized by exclusive control so as not to be simultaneously executed in different threads in the same process.
[0039]
The processing unit 106 performs general interrupt processing such as processing according to a system call, I / O processing, and exception processing other than the processor return processing and the parallel execution time acquisition processing.
[0040]
The recording medium K is a disk, a semiconductor memory, or another recording medium. The program recorded on the recording medium K is read by the processor 100-1, and by controlling the operation thereof, the user program execution processing unit 101, the interrupt start processing unit 102, the parallel execution Time calculation processing unit 103, parallel counter decrease processing unit 104, parallel execution time acquisition processing unit 105, processing unit 106, parallel execution time calculation processing unit 107, parallel counter increase processing unit 108, interrupt end processing unit 109, thread start processing unit 110, a processor assignment processing unit 111, a weight processing unit 112, a processor return processing unit 113, and a thread termination processing unit 114.
[0041]
[Operation of the embodiment]
Next, the operation of this embodiment will be described in detail with reference to the drawings.
[0042]
First, when the thread X is generated in the processor 100-1, the thread start processing unit 110 in the processor 100-1 connects the thread X to an execution waiting queue (not shown), and furthermore, is shown in the flowchart of FIG. As described above, it is determined whether or not the thread X is the first thread in the process Z to which the thread X belongs (step S1). If the thread X is the first thread (step S1 is Yes), the thread X is unique to the process Z. Of the parallel execution time table 202, and initializes the values of the parallel counter 203 and the time stamp 204 to "0" (step S2). On the other hand, if it is not the first thread (No in step S1), step S2 is skipped.
[0043]
Thereafter, when the processor 100-1 is assigned to the thread X connected to the execution queue by the processor assignment processing unit 111 in a certain processor (for example, the processor 100-1), the parallel execution time calculation processing unit 107 The parallel execution time is calculated (step S13).
[0044]
The processing in step S13 will be described in detail below. First, referring to the value C of the parallel counter 203 in the thread shared space 201 assigned to the process Z to which the thread X belongs, it is checked whether or not the value C is equal to or more than “1”.
[0045]
If the value is “1” or more, a difference (STM−TS) between the value STM of the system timer 205 and the value TS of the time stamp 204 is obtained. Then, for the entries from the first entry to the entry corresponding to the value of the parallel counter 203 among the entries of the parallel execution time table 202, the difference (STM-TS) is set to the value set therein. Is added. Finally, the value STM of the system timer 205 is set to the value TS of the time stamp 204.
[0046]
On the other hand, if the value C of the parallel counter 203 is less than “1”, only the process of setting the value STM of the system timer 205 to the value TS of the time stamp 204 is performed, and the update to the parallel execution time table 202 is performed. No processing is performed. The above is the details of the processing performed in step S13.
[0047]
When the processing of the parallel execution time calculation processing unit 107 ends, the parallel counter increase processing unit 108 increases the value C of the parallel counter 203 in the thread shared space 201 allocated to the process Z to which the thread X belongs ( Step S14). In this embodiment, the value C of the parallel counter 203 is increased by “1”.
[0048]
Thereafter, an interrupt end process is performed by the interrupt end processing unit 109, and the thread X shifts to the user mode, and the user program is executed by the user program execution processing unit 101 (step S3). In step S3, the parallel program is executed according to the description of the program, and the user program continues to be executed unless an interrupt occurs (unless step S4 becomes Yes).
[0049]
If the thread X issues a system call or I / O, or is interrupted due to an out-of-time-slice or exceptional processing (Yes in step S4), the processing shifts to the interrupt start processing unit 102, and the following processing is performed. .
[0050]
First, the parallel execution time calculation processing unit 103 performs the same processing as the processing performed by the parallel execution time calculation processing unit 107 in step S13 on the thread shared space 201 of the process Z to which the thread X belongs (step S13). S7). Next, the parallel counter decrease processing unit 104 decreases the value C of the parallel counter 203 (Step S8). In this embodiment, the value C of the parallel counter 203 is decreased by "1".
[0051]
Thereafter, an interrupt process corresponding to the interrupt factor is executed. If the interrupt factor is a parallel execution time acquisition system call (Yes in step S9), the parallel execution time acquisition processing unit 105 performs a parallel execution time acquisition process (step S11). In the process of acquiring the parallel execution time in step S11, a process of acquiring all the contents of the parallel execution time table 202 and returning it to the thread that issued the system call is performed. Thereafter, the parallel execution time calculation processing unit 107 performs the above-described parallel execution time calculation processing on the thread shared space 201 of the process Z to which the thread X belongs (step S13). At 108, the above-described process of increasing the parallel counter 203 is performed (step S14). Thereafter, an interrupt end process is executed in the interrupt end processing unit 109, the thread X shifts to the user mode, and the user program execution processing unit 101 executes the user program (step S3).
[0052]
If the interrupt factor is not the parallel execution time acquisition system call (No in step S9), it is determined whether the interrupt factor is a termination system call (step S10).
[0053]
If it is not an end system call (No in step S10), the processing unit 106 performs an interrupt process according to the interrupt factor (step S12). The process performed in step S12 includes, for example, a process of generating a new thread Y. If a new thread Y is generated in step S12, the thread start processing unit 110 connects the thread Y to the execution waiting queue, and performs the above-described step S1 on the thread Y as a processing target. In this case, since the thread Y is not the first thread in the process Z (No in Step S1), Step S2 is skipped. Thereafter, when the processor 100-n is assigned to the thread Y by the processor assignment processing unit 111 in one of the processors 100-1 to 100-N (1 ≦ n ≦ N), Processing by the parallel execution time calculation processing unit 107, the parallel counter increase processing unit 108, and the interruption end processing unit 109 is sequentially performed.
[0054]
On the other hand, when the interrupt factor is the termination system call (Yes in step S10), the processor return processing unit 113 performs the processor return processing, and then the thread termination processing unit 114 performs the thread termination processing. . In this thread end processing, first, it is determined whether or not the thread that issued the end system call (for example, thread X) is the last thread in the same process Z (step S5). If it is the last thread (Yes in step S5), the thread shared space 201 allocated to the process Z to which the thread X belongs is released (step S6). On the other hand, if it is not the last thread (No in step S5), step S6 is skipped. Thereafter, the thread X ends.
[0055]
With the above processing, each value from one parallel execution time to N parallel execution times is collected in the parallel execution time table 202 every time an interrupt occurs. If the parallel execution time is represented by Tn, the value of the parallel counter 203 is represented by C, the value of the time stamp 204 is represented by TS, and the value of the system timer 205 is represented by STM, the processing of calculating the parallel execution time in steps S7 and S13 is as follows. Tn + (STM-TS) (for each value of 1 ≦ n ≦ C) and TS = STM. Further, the parallel counter subtraction process in step S8 can be expressed as C = C-1, and the parallel counter increase process in step S14 can be expressed as C = C + 1.
[0056]
Next, how the parallel execution time is calculated will be described using a specific example.
[0057]
FIG. 3 shows a value Tn (n = 1, 2,..., N) of each entry of the parallel execution time table 202 and a parallel counter 203 when a parallel program composed of three threads A, B, and C operates. Is a diagram showing the transition of the value C of the time stamp 204 and the value TS of the time stamp 204. In the following, for the sake of simplicity, it is assumed that interrupts have occurred only at eight points at times P1, P2,..., P8, and the time required from the occurrence of the interrupt to the end thereof is sufficiently short to 0. Suppose that That is, it is assumed that the value of the system timer 205 does not change between the time when the interrupt start processing is performed by the interrupt start processing unit 102 and the time when the interrupt end processing is performed by the interrupt end processing unit 109. In an actual system, an interrupt occurs at an arbitrary point in an arbitrary thread, and the time required from the occurrence of an interrupt to the end thereof is a variable value of 0 or more. In such a case, this is only a combination of the processes illustrated in FIG. 3 and the parallel execution time is correctly collected.
[0058]
At time P1 (STM = 10), when the thread A is generated by the processor 100-1, the thread start processing unit 110 in the processor 100-1 connects the thread A to the execution waiting queue, and the thread A Is the first thread in the process D to which it belongs (step S1 in FIG. 2). In this case, since the thread A is the first thread (Yes in step S1), the thread start processing unit 110 generates a thread shared space 201 unique to the process D to which the thread A belongs, The values T1 to TN of each entry, the value C of the parallel counter 203, and the value TS of the time stamp 204 are all initialized to “0” (step S2).
[0059]
Thereafter, when the processor 100-1 is assigned to the thread A connected to the execution waiting queue by the processor assignment processing unit 111 in a certain processor (for example, the processor 100-1), the parallel execution time calculation processing unit 107 The parallel execution time calculation processing of step S13 is performed. In this case, since the value C of the parallel counter 203 is “0”, the parallel execution time calculation processing unit 107 does not perform the update process on the parallel execution time table 202 and sets the value TS of the time stamp 204 to the value of the system timer 205. Only the process of setting the STM value is performed. Therefore, TS = 10.
[0060]
Thereafter, the parallel counter increase processing unit 108 increments the value C of the parallel counter 203 by 1 and sets C = 1 (step S14). Thereafter, an interrupt end process is performed by the interrupt end processing unit 109, and the thread A starts execution of the user program by the user program execution processing unit 101 (step S3).
[0061]
Next, at time P2 (STM = 25), the thread A issues a thread generation system call to generate a new thread B (Yes in step S4). As a result, the processing shifts to the interrupt start processing unit 102, and the parallel execution time calculation processing is performed in the parallel execution time calculation processing unit 103 (step S7). At this time, since the value C of the parallel counter 203 is “1”, the difference T1 between the value STM of the system timer 205 and the value TS of the time stamp 204 is added to the value T1 of the first entry of the parallel execution time table 202. (STM-TS), and the value STM of the system timer 205 is set to the value TS of the time stamp 204. That is, T1 = T1 + (STM-TS) = 0 + (25-10) = 15 and TS = STM = 25. Thereafter, the parallel counter decrease processing unit 104 decreases the value C of the parallel counter 203 by 1 and sets C = 0 (step S8).
[0062]
Then, the thread B is generated in the processing unit 106 in the processor 100-1 (Step S12).
[0063]
When the thread B is generated, the thread start processing unit 110 in the processor 100-1 connects the thread B to the execution waiting queue and determines whether the thread B is the first thread of the process D (step S1). S1). In this case, since the thread B is not the first thread, the processing in step S2 is skipped.
[0064]
The parallel execution time calculation processing section 107 in the processor 100-1 performs a parallel execution time calculation process (step S13). At this time, since the value C of the parallel counter 203 is “0”, the parallel execution time table 202 is not updated, and the value TS of the system timer 205 is set to the value TS of the time stamp 204. That is, TS = 25 (assuming that the STM has not changed). Thereafter, the parallel counter increase processing unit 108 performs parallel counter increase processing, and the value C of the parallel counter 203 is set to "1" (step S14). Thereafter, an interrupt end process is performed by the interrupt end processing unit 109, and the thread A returns to the process of the user program.
[0065]
On the other hand, when the processor 100-2 is assigned to the thread B (a newly created thread) connected to the execution waiting queue by the processor assignment processing unit 111 in a certain processor (for example, the processor 100-2), the processor 100 The parallel execution time calculation processing unit 107 in -2 performs a parallel execution time calculation process (step S13). At this time, since the value C of the parallel counter 203 in the thread shared space 201 assigned to the process D to which the thread B belongs is “1”, the value T1 of the first entry of the parallel execution time table 202 is changed to T1. = T1 + (STM-TS) = 15 + (25−25) = 15, and the value TS of the time stamp 204 is “25”. Thereafter, the parallel counter increase processing unit 108 performs an increase process on the parallel counter 203, and the value C of the parallel counter 203 is set to “2”.
[0066]
Thereafter, an interrupt end process is performed by the interrupt end processing unit 109, and the thread B starts executing the user program. Here, the parallel execution time calculation processing unit in the processor 100-2 to which the thread B is assigned is more than the parallel execution time calculation processing unit 107 and the parallel counter increase processing unit 108 in the processor 100-1 to which the thread A is assigned. 107, the final result is the same even if the interrupt end processing unit 109 performs the previous processing.
[0067]
Next, at time P3 (STM = 35), when the thread B executed by the processor 100-2 issues a sleep system call, the control is transferred to the interrupt start processing unit 102 in the processor 100-2, and the parallel execution time The calculation processing unit 103 performs a parallel execution time calculation process (step S7). At this time, since the value C of the parallel counter 203 is “2”, the first and second values T1 and T2 of the parallel execution time table 202 are updated. That is, STM-TS = 35-25 = 10 is added to the values T1 and T2, and T1 = T1 + (STM-TS) = 15 + 10 = 25 and T2 = T2 + (STM-TS) = 0 + 10 = 10. Thereafter, the parallel execution time calculation processing unit 103 performs a process of decreasing the parallel counter 203, and the value C of the parallel counter 203 is set to “1” (step S8). After that, the processor return processing unit 113 performs the return processing of the processor, and the wait processing unit 112 connects the thread B to the sleep queue and stops it.
[0068]
Next, at time P4 (STM = 40), for example, when the processor allocation processing unit 111 in the processor 100-2 allocates the processor 100-2 to the stopped thread B, the parallel execution in the processor 100-2 The time calculation processing unit 107 performs a parallel execution time calculation process (step S13). At this time, since the value C of the parallel counter 203 is “1”, the parallel execution time calculation processing unit 107 updates the value T1 of the first entry of the parallel execution time table 202 and sets the time stamp 204 Is updated. That is, T1 = T1 + (STM-TS) = 25 + (40-35) = 30 and TS = STM = 40. After that, the parallel counter increase processing unit 108 increases the value C of the parallel counter 203 by “1” to “2”. After that, the interrupt end processing is performed by the interrupt end processing unit 109, and the thread B resumes the execution of the user program.
[0069]
Next, at time P5 (STM = 50), when the thread B operating in the processor 100-2 issues a thread generation system call to generate the thread C, the interrupt start processing unit in the processor 100-2 Control is transferred to 102. Thus, the parallel execution time calculation processing unit 103 performs a parallel execution time calculation process (Step S7). At this time, since the value C of the parallel counter 203 is "2", (STM-TS) is added to the values T1 and T2 of the first and second entries of the parallel execution time table 202, and thereafter, The value STM of the system timer 205 is set to the value TS of the time stamp 204. That is, T1 = T1 + (STM-TS) = 30 + (50-40) = 40, T2 = T2 + (STM-TS) = 10 + (50-40) = 20, and TS = STM = 50. Next, the parallel counter decrease processing unit 104 decreases the value C of the parallel counter 203 by one, and sets C = 1.
[0070]
Then, the thread C is generated by the processing unit 106 in the processor 100-2. When the thread C is generated, the thread start processing unit 110 in the processor 100-2 connects the thread C to the execution queue and determines whether the thread C is the first thread in the process D ( Step S1). In this case, since the thread C is not the first thread, the processing in step S2 is skipped.
[0071]
Further, the parallel execution time calculation processing unit 107 in the processor 100-2 executes a parallel execution time calculation process (step S13). At this time, since the value C of the parallel counter 203 is “1”, the value T1 of the first entry of the parallel execution time table 202 is updated, and the value TS of the time stamp 204 is updated. That is, T1 = T1 + (STM-TS) = 40 + (50-50) = 40 and TS = STM = 50. Next, the parallel counter increase processing unit 108 increases the value C of the parallel counter 203 by 1 and sets C = 2 (step S14). Thereafter, the interrupt end processing unit 109 executes the interrupt end processing, and the thread B returns to the processing of the user program.
[0072]
On the other hand, when the processor 100-3 is allocated by the processor allocation processing unit 111 in a certain processor (for example, the processor 100-3) to the newly generated thread C connected to the execution waiting queue, parallel execution is performed. The time calculation processing unit 107 performs a parallel execution time calculation process (step S13). At this time, since the value C of the parallel counter 203 is “2”, the values T1 and T2 of the first and second entries of the parallel execution time table 202 are updated, and the value TS of the time stamp 204 is changed. Be updated. That is, T1 = T1 + (STM-TS) = 40 + (50-50) = 40, T2 = T2 + (STM-TS) = 20 + (50-50) = 20, and TS = STM = 50. Next, the parallel counter increase processing unit 108 increases the value C of the parallel counter 203 by 1 and sets C = 3.
[0073]
Thereafter, the interrupt end processing unit 109 performs an interrupt end process, and the thread C starts executing the user program. Note that, prior to the parallel execution time calculation processing unit 107 and the parallel counter increase processing unit 108 in the processor 100-2 in which the thread B is executed, the parallel execution time calculation in the processor 100-3 in which the thread C is executed is performed. Even if the processing unit 107 and the parallel counter increase processing unit 108 execute the processing of steps S13 and S14, the final result is the same.
[0074]
Next, at time P6 (STM = 60), when the thread A operating in the processor 100-1 issues a termination system call to terminate, the interrupt start processing unit 102 in the processor 100-1 is controlled. Then, the parallel execution time calculation processing unit 103 performs a parallel execution time calculation process (step S7). At this time, since the value C of the parallel counter 203 is “3”, the values T1, T2, and T3 of the first, second, and third entries of the parallel execution time table 202 are updated, and the time is updated. The value TS of the stamp 204 is updated. That is, T1 = T1 + (STM-TS) = 40 + (60-50) = 50, T2 = T2 + (STM-TS) = 20 + (60-50) = 30, T3 = T3 + (STM-TS) = 0 + (60 −50) = 10 and TS = 60. Thereafter, the parallel counter decrease processing unit 104 decrements the value C of the parallel counter 203 by 1 and sets C = 2.
[0075]
Thereafter, the processor return processing unit 113 performs a return process of the processor assigned to the thread A, and further, the thread termination processing unit 114 performs a termination process of the thread A. At this time, since the thread A is not the last thread in the process D (No in step S5), the release processing of the thread shared space 201 is not performed.
[0076]
Next, at time P7 (STM = 65), when the thread C operating in the processor 100-3 issues a termination system call to terminate, the interrupt start processing unit 102 in the processor 100-3 is controlled. Move on. Thereby, the parallel execution time calculation processing unit 103 performs a parallel execution time calculation process (Step S7). At this time, since the value C of the parallel counter 203 is “2”, the values T1 and T2 of the first and second entries of the parallel execution time table 202 are updated, and the value TS of the time stamp 204 is updated. Is updated. That is, T1 = T1 + (STM-TS) = 50 + (65-60) = 55, T2 = T2 + (STM-TS) = 30 + (65-60) = 35, and TS = STM = 65. After that, the parallel counter decrease processing unit 104 decreases the value C of the parallel counter 203 by 1 and sets C = 1 (step S8).
[0077]
Thereafter, the processor return processing unit 113 performs return processing of the processor assigned to the thread C, and further, the thread termination processing unit 114 performs termination processing of the thread C. At this time, since the thread C is not the last thread in the process D (No in step S5), the release processing of the thread shared space 201 is not performed.
[0078]
Next, at time P8 (STM = 70), when the thread B operating in the processor 100-2 issues an end system call to end, the interrupt start processing unit 102 in the processor 100-2 is controlled. Move on. Thereby, the parallel execution time calculation processing unit 103 performs a parallel execution time calculation process (Step S7). At this time, since the value C of the parallel counter 203 is “1”, the first value T1 of the parallel execution time table 202 is updated and the value TS of the time stamp 204 is updated. That is, T1 = T1 + (STM-TS) = 55 + (70-65) = 60, and TS = STM = 70. Thereafter, the parallel counter decrease processing unit 104 subtracts 1 from the value C of the parallel counter 203, and sets C = 0 (step S8).
[0079]
Thereafter, the processor return processing unit 113 performs return processing of the processor assigned to the thread B, and further, the thread termination processing unit 114 performs termination processing of the thread B. At this time, since the thread B is the last thread in the process D (Step S5: Yes), the thread termination processing unit 114 releases the thread shared space 201 (Step S6).
[0080]
With the above processing, the parallel execution time of the parallel program composed of the threads A, B, and C can be calculated, and the parallel execution time (T1, T2, T3) at that moment can be calculated by the parallel execution time acquisition system call issued at any time. ) Can be easily obtained. For example, when thread B issues a parallel execution time acquisition system call at time P8, thread B can acquire the parallel execution time (T1 = 60, T2 = 35, T1 = 10). Then, when the thread B acquires the parallel execution time, for example, it displays the acquired parallel execution time on a display unit (not shown), or based on the parallel execution time, the degree of parallelism = 35/60 = 0. 5833 (approximately 58.3%), 3 parallelism = 10/60 = 0.166666 (approximately 16.7%), and display them on the display unit.
[0081]
In the above-described embodiment, the thread shared space 201 is created on the main storage device 200. However, the thread shared space 201 is created on another storage device shared by the processors 100-1 to 100-N. May be generated.
[0082]
【The invention's effect】
A first effect of the present invention is that even when a plurality of parallel programs are operating on a multiprocessor computer, the parallel execution time of each parallel program can be obtained. The reason is that the parallel execution time is managed using a parallel execution time table specific to the process or the job.
[0083]
The second effect of the present invention is that a maximum of (N-1) parallelisms from 2 parallelisms to N parallelisms can be acquired as parallelisms at the time of execution of a parallel program, and detailed verification of the parallelisms can be performed. Is a point. The reason is that, for each of a plurality of threads (1, 2,..., N), a parallel execution time table having an area for registering a time at which a processor is simultaneously allocated to threads equal to or more than the number of threads is used. This is because they manage time.
[Brief description of the drawings]
FIG. 1 is a block diagram of an embodiment of the present invention.
FIG. 2 is a flowchart showing a processing example of FIG. 1;
FIG. 3 is a diagram for explaining the operation of the embodiment by giving a specific example;
[Explanation of symbols]
100-1 to 100-N: Processor
101: User program execution processing unit
102: Interrupt start processing unit
103: Parallel execution time calculation processing unit
104: parallel counter decrease processing unit
105: Parallel execution time acquisition processing unit
106 ... Processing unit
107: Parallel execution time calculation processing unit
108: Parallel counter increase processing unit
109: Interruption end processing unit
110: thread start processing unit
111: Processor allocation processing unit
112 ... Weight processing unit
113: Processor return processing unit
114: thread end processing unit
200: Main storage device
201: thread sharing space
202: Parallel execution time table
203 ... Parallel counter
204 ... Time stamp
205: System timer
K: Recording medium

Claims (8)

複数のプロセッサと、該複数のプロセッサによって共有される主記憶装置とを備えたマルチプロセッサ計算機において、
前記各プロセッサが、
自プロセッサで生成されたスレッドが、該スレッドが属するプロセス中の最初のスレッドである場合、前記主記憶装置上に、前記プロセスに固有の並列実行時間テーブルであって、複数のスレッド数毎に、そのスレッド数以上のスレッドに同時にプロセッサが割り当てられた時間を登録する領域を有する並列実行時間テーブルを生成する手段と、
自プロセッサを前記プロセス内のスレッドに割り当てるとき、及び自プロセッサを前記プロセス内のスレッドから返還させるとき、現時点においてプロセッサが割り当てられている、前記プロセス内のスレッドの数と、現時点の時刻と、現時点における前記並列実行時間テーブルの内容と、前記並列実行時間テーブルに対する最新の更新時刻とに基づいて、前記並列実行時間テーブルを更新する手段と、
前記並列実行時間テーブルの内容を取得する手段とを備えたことを特徴とするマルチプロセッサ計算機。
In a multiprocessor computer including a plurality of processors and a main storage device shared by the plurality of processors,
Each of the processors,
When the thread generated by the own processor is the first thread in the process to which the thread belongs, a parallel execution time table unique to the process is provided on the main storage device, and for each of a plurality of threads, Means for generating a parallel execution time table having an area for registering a time at which a processor is simultaneously allocated to threads equal to or greater than the number of threads;
When assigning the own processor to a thread in the process, and when returning the own processor from the thread in the process, the number of threads in the process to which the processor is currently assigned, the current time, Means for updating the parallel execution time table based on the content of the parallel execution time table and the latest update time for the parallel execution time table,
Means for acquiring the contents of the parallel execution time table.
請求項1記載のマルチプロセッサ計算機において、
前記並列実行時間テーブルが、前記主記憶装置以外の、前記複数のプロセッサによって共有される記憶装置上に生成されることを特徴とするマルチプロセッサ計算機。
The multiprocessor computer according to claim 1,
A multiprocessor computer, wherein the parallel execution time table is generated on a storage device shared by the plurality of processors other than the main storage device.
複数のプロセッサと、該複数のプロセッサによって共有される主記憶装置とを備えたマルチプロセッサ計算機において、
前記各プロセッサが、
自プロセッサで生成されたスレッドが、該スレッドが属するプロセス中の最初のスレッドである場合、前記主記憶装置上に、前記プロセスに固有のスレッド共有空間であって、複数のスレッド数毎に、そのスレッド数以上のスレッドに同時にプロセッサが割り当てられていた時間が登録される領域を有する並列実行時間テーブルと、前記プロセス内のスレッドの内の、現時点においてプロセッサが割り当てられているスレッドの数が設定される並列カウンタと、前記並列実行時間テーブルに対する最新の更新時刻が設定されるタイムスタンプとを含むスレッド共有空間を生成する手段と、
自プロセッサを前記プロセス内のスレッドに割り当てるとき、現在時刻と、前記並列実行時間テーブルの内容と、前記並列カウンタの内容と、前記タイムスタンプの内容とに基づいて、前記並列実行時間テーブルの内容を更新すると共に、前記タイムスタンプに現在時刻を設定し、更に、前記並列カウンタの値を増加させる手段と、
自プロセッサを前記プロセス内のスレッドから返還させるとき、現在時刻と、前記並列実行時間テーブルの内容と、前記並列カウンタの内容と、前記タイムスタンプの内容とに基づいて、前記並列実行時間テーブルの内容を更新すると共に、前記タイムスタンプに現在時刻を設定し、更に、前記並列カウンタの値を減少させる手段と、
前記並列実行時間テーブルの内容を取得する手段とを備えたことを特徴とするマルチプロセッサ計算機。
In a multiprocessor computer including a plurality of processors and a main storage device shared by the plurality of processors,
Each of the processors,
When the thread created by the own processor is the first thread in the process to which the thread belongs, the thread is a thread shared space unique to the process on the main storage device, and the thread is shared by a plurality of threads. A parallel execution time table having an area in which the time at which a processor is simultaneously allocated to threads equal to or more than the number of threads is registered, and the number of threads to which a processor is currently allocated among threads in the process are set. Means for generating a thread shared space including a parallel counter, and a time stamp at which the latest update time for the parallel execution time table is set.
When allocating its own processor to a thread in the process, the content of the parallel execution time table is determined based on the current time, the content of the parallel execution time table, the content of the parallel counter, and the content of the time stamp. Means for updating, setting the current time in the time stamp, and further increasing the value of the parallel counter;
When returning the own processor from a thread in the process, the content of the parallel execution time table is determined based on the current time, the content of the parallel execution time table, the content of the parallel counter, and the content of the time stamp. Means for updating the timestamp with the current time, and further reducing the value of the parallel counter;
Means for acquiring the contents of the parallel execution time table.
請求項3記載のマルチプロセッサ計算機において、
前記スレッド共有空間が、前記主記憶装置以外の、前記複数のプロセッサによって共有される記憶装置上に生成されることを特徴とするマルチプロセッサ計算機。
The multiprocessor computer according to claim 3,
A multiprocessor computer, wherein the thread sharing space is created on a storage device shared by the plurality of processors other than the main storage device.
複数のプロセッサと、該複数のプロセッサによって共有される主記憶装置とを備えたマルチプロセッサ計算機において、
前記各プロセッサが、
自プロセッサで生成されたプロセスが、該プロセスが属するジョブ中の最初のプロセスである場合、前記主記憶装置上に、前記ジョブに固有の並列実行時間テーブルであって、複数のプロセス数毎に、そのプロセス数以上のプロセスに同時にプロセッサが割り当てられた時間を登録する領域を有する並列実行時間テーブルを生成する手段と、
自プロセッサを前記ジョブ内のプロセスに割り当てるとき、及び自プロセッサを前記ジョブ内のプロセスから返還させるとき、現時点においてプロセッサが割り当てられている、前記ジョブ内のプロセスの数と、現時点の時刻と、現時点における前記並列実行時間テーブルの内容と、前記並列実行時間テーブルに対する最新の更新時刻とに基づいて、前記並列実行時間テーブルを更新する手段と、
前記並列実行時間テーブルの内容を取得する手段とを備えたことを特徴とするマルチプロセッサ計算機。
In a multiprocessor computer including a plurality of processors and a main storage device shared by the plurality of processors,
Each of the processors,
When the process generated by the own processor is the first process in a job to which the process belongs, a parallel execution time table unique to the job is provided on the main storage device, and for each of a plurality of processes, Means for generating a parallel execution time table having an area for registering a time at which a processor is simultaneously allocated to processes equal to or greater than the number of processes;
When assigning its own processor to a process in the job, and when returning its own processor from the process in the job, the number of processes in the job to which the processor is currently assigned, the current time, Means for updating the parallel execution time table based on the content of the parallel execution time table and the latest update time for the parallel execution time table,
Means for acquiring the contents of the parallel execution time table.
複数のプロセッサと、該複数のプロセッサによって共有される主記憶装置とを備えたマルチプロセッサ計算機において、
前記各プロセッサが、
自プロセッサで生成されたプロセスが、該プロセスが属するジョブ中の最初のプロセスである場合、前記主記憶装置上に、前記ジョブに固有の共有空間であって、複数のプロセス数毎に、そのプロセス数以上のプロセスに同時にプロセッサが割り当てられていた時間が登録される領域を有する並列実行時間テーブルと、前記ジョブ内のプロセスの内の、現時点においてプロセッサが割り当てられているプロセスの数が設定される並列カウンタと、前記並列実行時間テーブルに対する最新の更新時刻が設定されるタイムスタンプとを含むプロセス共有空間を生成する手段と、
自プロセッサを前記ジョブ内のプロセスに割り当てるとき、現在時刻と、前記並列実行時間テーブルの内容と、前記並列カウンタの内容と、前記タイムスタンプの内容とに基づいて、前記並列実行時間テーブルの内容を更新すると共に、前記タイムスタンプに現在時刻を設定し、更に、前記並列カウンタの値を増加させる手段と、
自プロセッサを前記ジョブ内のプロセスから返還させるとき、現在時刻と、前記並列実行時間テーブルの内容と、前記並列カウンタの内容と、前記タイムスタンプの内容とに基づいて、前記並列実行時間テーブルの内容を更新すると共に、前記タイムスタンプに現在時刻を設定し、更に、前記並列カウンタの値を減少させる手段と、
前記並列実行時間テーブルの内容を取得する手段とを備えたことを特徴とするマルチプロセッサ計算機。
In a multiprocessor computer including a plurality of processors and a main storage device shared by the plurality of processors,
Each of the processors,
When the process generated by the own processor is the first process in a job to which the process belongs, the process is a shared space unique to the job on the main storage device, and the process is executed for each of a plurality of processes. A parallel execution time table having an area in which the time during which a processor is allocated to more than one process at the same time is registered, and the number of processes to which a processor is currently allocated among the processes in the job are set. Means for generating a process shared space including a parallel counter and a timestamp at which the latest update time for the parallel execution time table is set;
When allocating its own processor to a process in the job, based on the current time, the contents of the parallel execution time table, the contents of the parallel counter, and the contents of the time stamp, the contents of the parallel execution time table are Means for updating, setting the current time in the time stamp, and further increasing the value of the parallel counter;
When returning the own processor from the process in the job, the content of the parallel execution time table is based on the current time, the content of the parallel execution time table, the content of the parallel counter, and the content of the time stamp. Means for updating the timestamp with the current time, and further reducing the value of the parallel counter;
Means for acquiring the contents of the parallel execution time table.
複数のプロセッサと、該複数のプロセッサによって共有される主記憶装置とを備えたマルチプロセッサ計算機の構成要素であるプロセッサを、
自プロセッサで生成されたスレッドが、該スレッドが属するプロセス中の最初のスレッドである場合、前記主記憶装置上に、前記プロセスに固有の並列実行時間テーブルであって、複数のスレッド数毎に、そのスレッド数以上のスレッドに同時にプロセッサが割り当てられた時間を登録する領域を有する並列実行時間テーブルを生成する手段、
自プロセッサを前記プロセス内のスレッドに割り当てるとき、及び自プロセッサを前記プロセス内のスレッドから返還させるとき、現時点においてプロセッサが割り当てられている、前記プロセス内のスレッドの数と、現時点の時刻と、現時点における前記並列実行時間テーブルの内容と、前記並列実行時間テーブルに対する最新の更新時刻とに基づいて、前記並列実行時間テーブルを更新する手段、
前記並列実行時間テーブルの内容を取得する手段として機能させるためのプログラム。
A processor that is a component of a multiprocessor computer including a plurality of processors and a main storage device shared by the plurality of processors,
When the thread generated by the own processor is the first thread in the process to which the thread belongs, a parallel execution time table unique to the process is provided on the main storage device, and for each of a plurality of threads, Means for generating a parallel execution time table having an area for registering the time at which a processor is simultaneously allocated to the number of threads or more,
When assigning the own processor to a thread in the process, and when returning the own processor from the thread in the process, the number of threads in the process to which the processor is currently assigned, the current time, Means for updating the parallel execution time table based on the content of the parallel execution time table and the latest update time for the parallel execution time table,
A program for functioning as a means for acquiring the contents of the parallel execution time table.
複数のプロセッサと、該複数のプロセッサによって共有される主記憶装置とを備えたマルチプロセッサ計算機の構成要素であるプロセッサを、
自プロセッサで生成されたプロセスが、該プロセスが属するジョブ中の最初のプロセスである場合、前記主記憶装置上に、前記ジョブに固有の並列実行時間テーブルであって、複数のプロセス数毎に、そのプロセス数以上のプロセスに同時にプロセッサが割り当てられた時間を登録する領域を有する並列実行時間テーブルを生成する手段、
自プロセッサを前記ジョブ内のプロセスに割り当てるとき、及び自プロセッサを前記ジョブ内のプロセスから返還させるとき、現時点においてプロセッサが割り当てられている、前記ジョブ内のプロセスの数と、現時点の時刻と、現時点における前記並列実行時間テーブルの内容と、前記並列実行時間テーブルに対する最新の更新時刻とに基づいて、前記並列実行時間テーブルを更新する手段、
前記並列実行時間テーブルの内容を取得する手段として機能させるためのプログラム。
A processor that is a component of a multiprocessor computer including a plurality of processors and a main storage device shared by the plurality of processors,
When the process generated by the own processor is the first process in a job to which the process belongs, a parallel execution time table unique to the job is provided on the main storage device, and for each of a plurality of processes, Means for generating a parallel execution time table having an area for registering a time at which a processor is simultaneously assigned to the number of processes or more,
When assigning its own processor to a process in the job, and when returning its own processor from the process in the job, the number of processes in the job to which the processor is currently assigned, the current time, Means for updating the parallel execution time table based on the content of the parallel execution time table and the latest update time for the parallel execution time table,
A program for functioning as a means for acquiring the contents of the parallel execution time table.
JP2002334577A 2002-11-19 2002-11-19 Multiprocessor computer and program Expired - Fee Related JP3876818B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002334577A JP3876818B2 (en) 2002-11-19 2002-11-19 Multiprocessor computer and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002334577A JP3876818B2 (en) 2002-11-19 2002-11-19 Multiprocessor computer and program

Publications (2)

Publication Number Publication Date
JP2004171167A true JP2004171167A (en) 2004-06-17
JP3876818B2 JP3876818B2 (en) 2007-02-07

Family

ID=32698920

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002334577A Expired - Fee Related JP3876818B2 (en) 2002-11-19 2002-11-19 Multiprocessor computer and program

Country Status (1)

Country Link
JP (1) JP3876818B2 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008004054A (en) * 2006-05-26 2008-01-10 Fujitsu Ltd Task transition chart display method and display apparatus
CN101382911A (en) * 2007-09-03 2009-03-11 松下电器产业株式会社 Program control device
US7614056B1 (en) * 2003-09-12 2009-11-03 Sun Microsystems, Inc. Processor specific dispatching in a heterogeneous configuration
JP2017509078A (en) * 2014-03-27 2017-03-30 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Computer-implemented method, system and computer program for tracking usage in a multi-threading computer system
CN112415996A (en) * 2020-10-12 2021-02-26 星火科技技术(深圳)有限责任公司 Calibration system and method based on steering engine execution time
JP2022177955A (en) * 2021-05-19 2022-12-02 株式会社ユニバーサルエンターテインメント game machine

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7614056B1 (en) * 2003-09-12 2009-11-03 Sun Microsystems, Inc. Processor specific dispatching in a heterogeneous configuration
JP2008004054A (en) * 2006-05-26 2008-01-10 Fujitsu Ltd Task transition chart display method and display apparatus
CN101382911A (en) * 2007-09-03 2009-03-11 松下电器产业株式会社 Program control device
JP2009059310A (en) * 2007-09-03 2009-03-19 Panasonic Corp Program controller
US8413163B2 (en) 2007-09-03 2013-04-02 Panasonic Corporation Program control device including per-timeslot switching of thread execution
JP2017509078A (en) * 2014-03-27 2017-03-30 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Computer-implemented method, system and computer program for tracking usage in a multi-threading computer system
CN112415996A (en) * 2020-10-12 2021-02-26 星火科技技术(深圳)有限责任公司 Calibration system and method based on steering engine execution time
CN112415996B (en) * 2020-10-12 2024-03-15 星火科技技术(深圳)有限责任公司 Calibration system and method based on steering engine execution time
JP2022177955A (en) * 2021-05-19 2022-12-02 株式会社ユニバーサルエンターテインメント game machine
JP7278632B2 (en) 2021-05-19 2023-05-22 株式会社ユニバーサルエンターテインメント game machine

Also Published As

Publication number Publication date
JP3876818B2 (en) 2007-02-07

Similar Documents

Publication Publication Date Title
JP4205066B2 (en) Apparatus, method, and program for managing resources in a multi-node computer system
JP5651214B2 (en) Scheduling in multi-core architecture
US7752620B2 (en) Administration of locks for critical sections of computer programs in a computer that supports a multiplicity of logical partitions
KR101629989B1 (en) Method for the deterministic execution and synchronisation of an information processing system comprising a plurality of processing cores executing system tasks
US5448735A (en) Task organization for execution using linked records referencing code modules
US7739685B2 (en) Decoupling a central processing unit from its tasks
CN102789395B (en) Apparatus and method for managing hypercalls in a hypervisor and the hypervisor thereof
US20060130062A1 (en) Scheduling threads in a multi-threaded computer
WO2002069174A1 (en) Method for executing parallel process, and multi-processor computer
JP2561801B2 (en) Method and system for managing process scheduling
US6304891B1 (en) Execution control for processor tasks
WO2009150815A1 (en) Multiprocessor system
Sudarsan et al. ReSHAPE: A framework for dynamic resizing and scheduling of homogeneous applications in a parallel environment
US6951019B1 (en) Execution control for processor tasks
CN111459622B (en) Method, device, computer equipment and storage medium for scheduling virtual CPU
US6854116B1 (en) Execution control for process task
JP5820525B2 (en) Virtual computer scheduling system and method thereof
EP2282265A1 (en) A hardware task scheduler
JP2004171167A (en) Multiprocessor computer and program
EP1594048A2 (en) Thread selection unit and method for a multithreaded processor
US20020010732A1 (en) Parallel processes run scheduling method and device and computer readable medium having a parallel processes run scheduling program recorded thereon
WO2023165485A1 (en) Scheduling method and computer system
Alhussian et al. An unfair semi-greedy real-time multiprocessor scheduling algorithm
JP3644042B2 (en) Multitask processing device
US20050066093A1 (en) Real-time processor system and control method

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20060522

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060530

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060727

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: 20061010

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20061023

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091110

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101110

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees