JPH02114360A - Clock synchronizing method for multiprocessor system - Google Patents

Clock synchronizing method for multiprocessor system

Info

Publication number
JPH02114360A
JPH02114360A JP63268622A JP26862288A JPH02114360A JP H02114360 A JPH02114360 A JP H02114360A JP 63268622 A JP63268622 A JP 63268622A JP 26862288 A JP26862288 A JP 26862288A JP H02114360 A JPH02114360 A JP H02114360A
Authority
JP
Japan
Prior art keywords
time
clock
processor
processors
timer
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
JP63268622A
Other languages
Japanese (ja)
Other versions
JPH07117940B2 (en
Inventor
Shoichiro Nakai
正一郎 中井
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 JP63268622A priority Critical patent/JPH07117940B2/en
Publication of JPH02114360A publication Critical patent/JPH02114360A/en
Publication of JPH07117940B2 publication Critical patent/JPH07117940B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Abstract

PURPOSE:To allow the clocks of all processors to point out the same time within the range of a certain synchronizing accuracy by allowing each processor to control its own clock based upon all clock information arriving every generation of a time interruption. CONSTITUTION:After measuring a random time within a previously determined time range, a timer generates a time-out, each of processors 301 to 305 starts the timer at the time of a generation of a time interruption. When the time-out generating time is before the generation of a time interruption, each of the processors 301 to 305 sends its own clock shown in its parentheses to all the processors 301 to 305 at the time of generating a time-out. In addition, each of the processors 301 to 305 controls its own clock based upon all clock information arriving every generation of a time interruption. Even when the number of processors in the system is increased, the increment of processing overhead due to the sharp increment of the number of communication message is not generated and the total number of messages in the system can be reduced.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、それぞれのプロセッサが共通にアクセスでき
る共有メモリを持たないマルチプロセッサシステムにお
いて、各々のプロセッサが時刻を示すために有するクロ
ックを互いに調整するためのクロック同期方式に関する
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention is a multiprocessor system in which each processor does not have a shared memory that can be accessed in common, and in which each processor mutually adjusts the clocks that each processor has to indicate time. This paper relates to a clock synchronization method for

〔従来の技術〕[Conventional technology]

マルチプロセッサシステムにおいては、システムを構成
する各プロセッサのクロックをシステム全体に共通な時
刻を示すように同期させることが必要となる0例えば、
分散ファイリングシステムにおいて、各ファイルに記録
された作成および編集時刻に基づきファイルのバージョ
ンを識別するためには、各プロセッサ間に共通な時刻が
必要となる。また、各プロセッサが、システムに共通な
時刻に基づき自己の履歴情報を蓄積しておけば、障害発
生時にどのような順番で障害が検出されたかを知ること
ができ、障害の発生箇所を特定するための有力な情報を
得ることができる。
In a multiprocessor system, it is necessary to synchronize the clocks of each processor that makes up the system so that they indicate a common time for the entire system.For example,
In a distributed filing system, a common time is required between each processor in order to identify a file version based on the creation and editing times recorded in each file. In addition, if each processor accumulates its own history information based on a time common to the system, it will be possible to know the order in which failures were detected when they occur, and to identify the location of the failure. You can obtain useful information for this purpose.

共有メモリを持たないマルチプロセッサシステムの一例
である通信ネットワークシステムにおいても、各通信ノ
ードのクロックが共通な時刻を示すようにする同期方式
が必要である。例えば、1986年5月に開催された第
6回インターナショナル・コンファランス・オン・デイ
ストリビューテッド・コンピユーテイング・システムズ
(International  Conferenc
e  on  D I  STRI BUT EDCO
MPUTING  SYSTEMS)の予稿集2゜36
4−371に記載されている論文「アン・エレクション
・アルゴリズム・フォー・デイストリビューテッド・ク
ロック・シンクロナイゼーション・プログラム(An 
Election Algorithm for a 
Distributed C1ock 5yncron
ization Program) j(文献1)で紹
介されているクロック同期方式TEMPOは、UNIX
オペレーティングシステム4.38SDで動作するネッ
トワークにインプリメントされているものである。上述
のシステムにおいては、マスクとなる1つのノードが、
定められた時間毎にすべてのノードに時刻の問い合せを
行い、求められた各ノードの時刻をもとに平均時刻を計
算する。この後、すべてのノードに対してクロックの調
整指示を行い、各ノードはこの指示に従いクロックの調
整を行う。
Even in a communication network system, which is an example of a multiprocessor system that does not have a shared memory, a synchronization method is required so that the clocks of each communication node indicate a common time. For example, at the 6th International Conference on Distributed Computing Systems held in May 1986,
e on DI STRI BUT EDCO
MPUTING SYSTEMS) Proceedings 2゜36
4-371, the paper “An Election Algorithm for Distributed Clock Synchronization Programs (An
Election Algorithm for a
Distributed C1ock 5syncron
The clock synchronization method TEMPO introduced in the document 1 (Reference 1) is compatible with UNIX
It is implemented in a network running on operating system 4.38SD. In the above system, one node serving as a mask is
Time queries are made to all nodes at predetermined intervals, and an average time is calculated based on the determined times of each node. Thereafter, a clock adjustment instruction is given to all nodes, and each node adjusts its clock according to this instruction.

また、1986年に開催された第16回アニュアル・イ
ンターナショナル・シンポジウム・オン・フォールトト
レラント・コンピユーテイング(AnnualInte
rnational  Symposium  on 
  FAULT−T。
In addition, the 16th Annual International Symposium on Fault-Tolerant Computing (Annual Intel) was held in 1986.
National Symposium on
FAULT-T.

LERANT  COMPUTING)のダイジェスト
ペーパーp、218−223に記載されている論文「ク
ロック・シンクロナイゼーション・イン・ザ・プレゼン
ス・オン・オミッション・アンド・パフォーマンス・フ
ォール゛ソ・アンド・プロセッサ・ジョインズ(CLO
CK 5YNCHRONIZATION IN THE
 PRESENCE OF 0Ml5SION AND
 PERFORMANCE FAULTS、ANDPR
OCESSORJOINS) J  (文献2)で紹介
されているクロック同期方式は、上で説明した°“TE
MPO′″のようにマスク・スレーブ型の制御ではなく
分散型の制御を用いている。同方式において、プロセッ
サは、システム内で定期的に同報される同期メツセージ
の中で、最も速い時刻を示す同期メツセージに従いクロ
ックの時刻合せを行なう、このため、結果として最も速
く進むクロックがシステム内の時刻を支配することにな
る。
The paper ``Clock Synchronization in the Presence on Omission and Performance Faults and Processor Joins (CLO
CK 5YNCHRONIZATION IN THE
PRESENCE OF 0Ml5SION AND
PERFORMANCE FAULTS, ANDPR
The clock synchronization method introduced in OCESSORJOINS) J (Reference 2) is
It uses distributed control rather than masked slave type control like MPO'''. In this method, the processor selects the earliest time among the synchronization messages that are periodically broadcast within the system. The clocks are time-synchronized according to the synchronization message shown, and as a result, the clock that advances fastest controls the time within the system.

さらに、ジャーナル・オン・アソシエーション・フォー
・コンピユーテイング・マシナリー(J。
In addition, the Journal on Association for Computing Machinery (J.

urnal of As5ociation for 
Computing Machinery)、Vol、
32.No、1.January 1985.p、52
−78に記載されている論文「シンクロナイジング・ク
ロツクス・イン・ザ・プレゼンス・オン・フォールツ(
Synchronizing C1ocks in t
he Presence of Faults)」(文
献3)で紹介されているクロック同期方式は、すべての
プロセッサが定期的に互いのプロセッサの時刻を通信し
あう完全分散制御による同期方式〔発明が解決しようと
する課題〕 上述したUNIXオペレーティングシステム4.3BS
DのTEMPOの同期方法においては、マスタノードが
必要不可欠である。このため、マスタノードの障害時に
は、他のノードがマスタノードの機能を果すように、マ
スタノードの代行の方法が必要となる。また、すべての
ノードのクロックの問い合せ等を1つのマスタノードが
行うために、ノードの数が増えると、マスタノードへの
通信量が増加するとともに、すべてのノードの時刻の平
均を求める作業が増大する。
Urnal of As5ocation for
Computing Machinery), Vol.
32. No, 1. January 1985. p.52
-78, the paper “Synchronizing Clocks in the Presence on Faults”
Synchronizing C1ocks in t
The clock synchronization method introduced in ``He Presence of Faults'' (Reference 3) is a synchronization method using completely distributed control in which all processors periodically communicate the time of each other's processors [Problem to be solved by the invention] ] UNIX operating system 4.3BS mentioned above
In D's TEMPO synchronization method, a master node is essential. Therefore, in the event of a failure of the master node, a method of acting as a master node is required so that another node can perform the function of the master node. In addition, since one master node queries the clocks of all nodes, as the number of nodes increases, the amount of communication to the master node increases, and the task of calculating the average time of all nodes increases. do.

これに対し、分散型の制御を採用している文献2記載の
方式では、分散型ではあるものの、最も速いクロックを
もつ1つのプロセッサがシステム内の時刻を支配する結
果となる。また、文献3の方式は、すべてのプロセッサ
が互いにすべてのプロセッサと通信を行なうなめに、実
際のシステムに適用する場合に通信オーバヘッドが問題
となる。
On the other hand, in the method described in Document 2 that employs distributed control, although it is distributed, one processor with the fastest clock controls the time within the system. Further, in the method of Document 3, since all processors communicate with each other, communication overhead becomes a problem when applied to an actual system.

本発明の目的は、集中制御を行なうプロセッサを設ける
必要がなく、よって一つのプロセッサがシステム内の時
刻を支配することがなく、システム内のプロセッサ数が
増大した場合にも、通信のメツセージ数が極端に増加し
て処理オーバヘッドが増加することがなく、システム内
の総メツセージ数を従来方式より削減することが可能な
分散制御型のマルチプロセッサシステムにおけるクロッ
ク同期方式を提供することにある。
An object of the present invention is that there is no need to provide a processor for centralized control, so that one processor does not control the time in the system, and even when the number of processors in the system increases, the number of communication messages can be reduced. An object of the present invention is to provide a clock synchronization method in a distributed control multiprocessor system, which is capable of reducing the total number of messages in the system compared to conventional methods without excessively increasing processing overhead.

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

本発明によれば、n個のプロセッサからなるマルチプロ
セッサシステムのクロック同期方式において、前記各プ
ロセッサは時刻を示すクロックとランダム時間を計測す
るタイマと予め定められた間隔で時刻割込みを発生する
手段とを具備し、該タイマはあらかじめ定められた時間
範囲内でのランダムな時間を計測後タイムアウトし、前
記各プロセッサでは、前記時刻割込みが生起すると前記
タイマを起動し、タイムアウトが発生した時刻が前記時
刻割込み前であれば゛、前記タイムアウトが発生した時
刻に全てのプロセッサに対して自己のクロックを送出し
、さらに、各プロセッサは、前記時刻割込みが生起する
毎に到着した全てのクロック情報に基づき各自のクロッ
クを制御することを特徴とするマルチプロセッサシステ
ムにおけるクロック同期方式が得られる。
According to the present invention, in a clock synchronization method for a multiprocessor system consisting of n processors, each processor has a clock indicating the time, a timer measuring random time, and means for generating time interrupts at predetermined intervals. The timer times out after measuring a random time within a predetermined time range, and in each of the processors, when the time interrupt occurs, the timer is started, and the time when the timeout occurs is set as the time. If it is before an interrupt, the clock will be sent to all processors at the time when the timeout occurs, and each processor will transmit its own clock based on all the clock information that arrives each time the time interrupt occurs. A clock synchronization method for a multiprocessor system is obtained, which is characterized by controlling the clock of the multiprocessor system.

〔作用〕[Effect]

互いのプロセッサが共通にアクセスできる共有メモリを
持たないマルチプロセッサシステムにおいては、システ
ムが初期状邪の時に、各プロセッサのクロックは同一の
時刻を示してはいない。しかも同じ値からスタートした
クロックも、凡そ同じ割合で時刻を測定するものの、時
刻の経過にともない徐々にずれて行く。従って、各プロ
セッサは、以下に説明する本同期方式に従い、メツセー
ジ通信により互いにクロックの調整を行う必要がある。
In a multiprocessor system that does not have a shared memory that can be commonly accessed by each processor, the clocks of each processor do not indicate the same time when the system is in an initial state. Moreover, although clocks that start from the same value measure time at roughly the same rate, they gradually shift as time passes. Therefore, each processor needs to adjust the clocks of each other through message communication according to this synchronization method described below.

この結果、すべてのプロセッサのクロックがある同期精
度の範囲内で同一の時刻を指すように制御される。
As a result, the clocks of all processors are controlled to point to the same time within a certain synchronization accuracy.

本発明の原理について、第2図、第3図を参照して説明
する。第3図は、マルチプロセッサシステムの具体例を
示す。各プロセッサ301,302.303,304.
305は、自己の時刻を示すクロックを備えており、各
自のクロックに基づき時刻割り込みを発生する。さらに
、各プロセッサは任意のプロセッサにクロック情報を通
知できるよう、相互に論理的な通信路により接続されて
いる0例えば、プロセッサ303とプロセッサ304の
間は通信路306により接続されている。
The principle of the present invention will be explained with reference to FIGS. 2 and 3. FIG. 3 shows a specific example of a multiprocessor system. Each processor 301, 302. 303, 304.
305 is provided with a clock that indicates its own time, and generates a time interrupt based on its own clock. Furthermore, each processor is connected to each other by a logical communication path so that clock information can be notified to any processor. For example, processor 303 and processor 304 are connected by a communication path 306.

また、各プロセッサにはランダム時間を計測できるタイ
マが具備されており、予め定められた時間範囲内でラン
ダムな時間を計測することができる。
Furthermore, each processor is equipped with a timer capable of measuring random time, and can measure random time within a predetermined time range.

第2図は、あるプロセッサiでのタイミングチャートを
示し、上記時刻割込みおよびランダムタイマの動作を説
明しながら本発明のクロック同期方式の原理を述べる。
FIG. 2 shows a timing chart for a certain processor i, and describes the principle of the clock synchronization method of the present invention while explaining the operations of the above-mentioned time interrupt and random timer.

第2図において、ある時刻割込みから次の時刻割込みま
での時間がクロック同期の制御期間であり、例えばこの
例では1時間となっている。いま、図に示すように、k
番目のクロック同期制御期間の開始を示す時刻割込みを
O:00、k番地のクロック同期期間の終わりを示すと
ともに(k+1)番目のクロック同期期間の開始を示す
時刻割込みを1:00とする。プロセッサiでは、0:
00の時刻割込みを検出すると、タイマの起動をかける
。例えば、タイマを360分間の間のランダムな時刻に
タイムアウトが発生するように設定しておくものとする
。このようにすると、0:00の時刻割込みからに00
の時刻割込みの間にタイムアウトが生起する確率が1/
6となる。ネットワーク内の全てのプロセッサが独立に
同じタイマ起動およびランダムタイムアウトの発生処理
を行なうので、ネットワーク中の全プロセッサ数をnと
すると、上記の例では平均的にn / 6のプロセッサ
がクロック同期制御期間の間にタイムアウトを起こすこ
とになる。
In FIG. 2, the time from one time interrupt to the next time interrupt is the clock synchronization control period, which is, for example, one hour in this example. Now, as shown in the figure, k
The time interrupt indicating the start of the clock synchronization control period at address k is set to O:00, and the time interrupt indicating the end of the clock synchronization period at address k and the start of the (k+1)th clock synchronization period is set to 1:00. On processor i, 0:
When a time interrupt of 00 is detected, the timer is activated. For example, assume that a timer is set so that a timeout occurs at a random time within 360 minutes. In this way, from the time interrupt at 0:00,
The probability that a timeout occurs during the time interrupt is 1/
It becomes 6. All processors in the network independently perform the same timer activation and random timeout generation processing, so if the total number of processors in the network is n, in the above example, on average, n / 6 processors perform the clock synchronization control period. A timeout will occur in between.

第2図においてタイムアウト例1で示しているのがクロ
ック同期制御期間にタイムアウトを起こした例であり、
タイムアウト例2で示しているのが(k+1)回目の時
刻割込みの後にタイムアウトを起こして例である。しか
しながら、実際には1:00になるとタイマは再起動さ
れるために、O:00に起動されたタイマが1:00以
降にタイムアウトすることはない。
In Fig. 2, timeout example 1 is an example in which a timeout occurs during the clock synchronization control period.
Timeout example 2 is an example in which a timeout occurs after the (k+1)th time interrupt. However, since the timer is actually restarted at 1:00, the timer started at 0:00 will not time out after 1:00.

本発明の方式では、上記タイムアウト例1に示したよう
に、クロック制御期間にタイムアウトを起こした場合の
みに、タイムアウトを起こした時刻にその時刻のクロッ
ク情報を全てのプロセ・ツサに送出するものである。一
方、各プロセッサでは、各時刻割込が発生するもでに到
着したクロック情報に対して受信処理がなされる。
In the method of the present invention, as shown in timeout example 1 above, only when a timeout occurs during the clock control period, clock information at that time is sent to all processors at the time when the timeout occurs. be. On the other hand, in each processor, reception processing is performed on clock information that has already arrived before each time interrupt occurs.

本同期方式を、第3図のネットワーク例を用いて説明す
る。説明において、各プロセッサでの時刻割込みは1:
00とする。各プロセッサは、自プロセッサの時刻割込
みを検出するとタイマを起動し、タイムアウト時が自己
のクロックで測定して1:OO以前ならば、タイムアウ
トを起こした時刻を刻印したクロック情報を全プロセッ
サに通知する。また、1:00以前にクロックを受信し
たプロセッサでは、受信した全てのクロック値とクロッ
ク値を受信した自プロセッサの時刻との差分をとり、そ
の差分の平均値Δによりクロックの調整を行なうもので
ある。即ち、Δが正ならば自クロック値にΔを加算し、
Δが負ならば自クロックをΔだけ停止させる。先程述べ
たタイムアウト分布に従って各プロセッサがタイムアウ
トを生起させるものとすると、全プロセッサ数nに対し
て1回の制御あたり平均n / 6個のプロセッサが自
己のクロックを全プロセッサに送出することになる。各
プロセッサでは、この平均n / 6個のプロセッサか
らのクロック値の平均値に自分のクロック値をあわせる
ことになる。
This synchronization method will be explained using the network example shown in FIG. In the explanation, the number of time interrupts in each processor is 1:
Set to 00. When each processor detects a time interrupt from its own processor, it starts a timer, and if the timeout is before 1:OO as measured by its own clock, it notifies all processors of clock information stamped with the time when the timeout occurred. . In addition, for a processor that receives a clock before 1:00, the difference is calculated between all the received clock values and the time of the own processor that received the clock value, and the clock is adjusted using the average value Δ of the differences. be. That is, if Δ is positive, add Δ to the own clock value,
If Δ is negative, the own clock is stopped by Δ. Assuming that each processor causes a timeout according to the timeout distribution described earlier, an average of n/6 processors will send their own clock to all processors per control for the total number n of processors. Each processor adjusts its own clock value to the average value of the clock values from n/6 processors.

例えば、本発明によるクロック制御がかけられる前に、
第3図(a)に示すようなりロック値を各プロセッサが
とっているものとする。いま、プロセッサ301とプロ
セッサ302が次のクロック同期制御期間の1:00以
前にタイムアウトを引き起こしたものとし、プロセッサ
301のタイムアウト時刻をプロセッサ301のクロッ
クで見て0:38、プロセッサ302のタイムアウト時
刻をプロセッサ302のクロックで見てO:46とする
。通信遅延および各プロセッサのクロックの傾きに起因
するクロックずれを無視すると、まず、プロセッサ30
1のクロック値が0:38に到達し、そのクロック値(
0:3g)をすべてのプロセッサに送出する。
For example, before the clock control according to the present invention is applied,
It is assumed that each processor has a lock value as shown in FIG. 3(a). Now, assume that processor 301 and processor 302 have caused a timeout before 1:00 of the next clock synchronization control period, and if we check the timeout time of processor 301 using the clock of processor 301 and find that the timeout time of processor 302 is 0:38, then It is assumed to be O:46 based on the clock of the processor 302. Ignoring communication delays and clock deviations caused by the clock inclination of each processor, first, the processor 30
The clock value of 1 reaches 0:38, and the clock value (
0:3g) to all processors.

プロセッサ301がそのクロック値を送出したときの各
プロセッサの示す時刻を第3図(b)に示す。第3図(
b)でわかるように、各プロセッサの示す時刻は全てに
00以前であり、全プロセッサはプロセッサ301から
のクロック情報を受信する。各プロセッサでは、プロセ
ッサ301のクロック値を受信すると、自己のクロック
値との差分をとる。差分値は、プロセッサ301では0
、プロセッサ302では+6、プロセッサ303では+
4、プロセッサ304では+8、プロセッサ305では
+2となる。続いて、プロセッサ302のクロック値が
0:46に達したときにクロック値を送出し、そのクロ
ック値を全てのプロセッサが受信するわけである。この
ときの各プロセッサの示す時刻を第3図(C)に示して
おく。この場合も同様に、各プロセッサの示す時刻は全
て1:00以前であり、全プロセッサはプロセッサ30
2からのクロック情報を受信する。各プロセッサでの差
分値は、プロセッサ301では−6、プロセッサ302
では0、プロセッサ303では−2、プロセッサ304
では+2、プロセッサ305では−4となる。よって、
各プロセッサは上記の差分値の平均値をとり、その値は
プロセッサ301では−3、プロセッサ302では+3
、プロセッサ303では+1、プロセッサ304では+
5、プロセッサ305では−1となる。この差分値の平
均値に基づき、先に示したクロック値の調整を行なうこ
ととすると、各プロセッサにて1=00の時刻割込みが
生起したときに、プロセッサ301のクロックは3分遅
らされ、プロセッサ302のクロックは3分進められ、
プロセッサ303のクロックは1分進められ、プロセッ
サ304のクロックは5分進められ、全てのプロセッサ
のクロック値が同一の値となるように調整されることが
わかる。
The time indicated by each processor when the processor 301 sends out its clock value is shown in FIG. 3(b). Figure 3 (
As can be seen in b), the times indicated by each processor are all before 00, and all processors receive clock information from processor 301. When each processor receives the clock value of the processor 301, it calculates the difference between it and its own clock value. The difference value is 0 in the processor 301.
, +6 for processor 302, +6 for processor 303
4, the processor 304 has +8, and the processor 305 has +2. Subsequently, when the clock value of the processor 302 reaches 0:46, it sends out a clock value, and all processors receive the clock value. The times indicated by each processor at this time are shown in FIG. 3(C). In this case as well, the times indicated by each processor are all before 1:00, and all processors are
Receive clock information from 2. The difference value for each processor is -6 for processor 301, and -6 for processor 302.
0 for processor 303, -2 for processor 304,
In the case of the processor 305, the value is +2, and in the processor 305, the value is -4. Therefore,
Each processor takes the average value of the above difference values, and the value is -3 for processor 301 and +3 for processor 302.
, +1 for processor 303, +1 for processor 304
5, it becomes -1 in the processor 305. If the clock value shown above is adjusted based on the average value of the difference values, when a time interrupt of 1=00 occurs in each processor, the clock of the processor 301 will be delayed by 3 minutes, The clock of processor 302 is advanced by three minutes;
It can be seen that the clock of processor 303 is advanced by one minute, the clock of processor 304 is advanced by five minutes, and the clock values of all processors are adjusted to the same value.

以上の制御は、すべてのプロセッサが、自分の持つクロ
ックに基づく時刻割込みに従って繰り返し行われるもの
である。勿論、タイムアウト時刻は、各クロック同期期
間毎に各プロセッサでランダムであるので、クロック同
期期間毎に自己のクロックを送出するプロセッサおよび
プロセッサ数は結果としてランダムとなる。
The above control is repeatedly performed by all processors according to time interrupts based on their own clocks. Of course, since the timeout time is random for each processor in each clock synchronization period, the processors that send their own clocks and the number of processors in each clock synchronization period are random as a result.

このようにすべてのプロセッサは、完全対等な立場にあ
り、全く同一のアルゴリズムを実施する。
In this way, all processors are on a completely equal footing and implement exactly the same algorithms.

この時、ランダムに選択されたプロセッサのみがそのク
ロック値を送出するので、従来に比べて通信量を削減す
ることができる。また、1つのプロセッサのみがシステ
ムの時刻を制御するのではなく、複数のプロセッサの平
均時刻でシステム時刻を制御することにより、耐障害性
のある時刻制御が可能となる。さらに、耐障害性の度合
いは、タイムアウトを時刻割込み間で起確率を変えるこ
とで柔軟に制御することができる。また、クロック情報
を送出する時刻がある範囲内(クロック同期制御期間)
でランダムであるから、複数のプロセッサが送出するク
ロック情゛報にてネットワークが輻そう状態となる可能
性を軽減できる。
At this time, only the randomly selected processor sends out its clock value, so the amount of communication can be reduced compared to the conventional method. Further, by controlling the system time using the average time of a plurality of processors instead of only one processor controlling the system time, fault-tolerant time control becomes possible. Furthermore, the degree of fault tolerance can be flexibly controlled by changing the probability of timeout occurring between timed interrupts. Also, within a certain range of time to send clock information (clock synchronization control period)
Since the clock information is random, it is possible to reduce the possibility that the network will be congested due to clock information sent by multiple processors.

〔実施例〕〔Example〕

第1図(a)、(b)に本発明の方式を実現するために
各プロセッサにて実行される制御の一フローチャート例
を示す、第1図(a)はクロック情報の送信制御を示す
フローチャート例であり、第1図(b)はクロック情報
の受信制御を示すフローチャート例である。
FIGS. 1(a) and 1(b) show an example of a flowchart of control executed by each processor to implement the method of the present invention. FIG. 1(a) is a flowchart showing clock information transmission control. As an example, FIG. 1(b) is an example flowchart showing clock information reception control.

まず、第1図(a)の送信制御フローチャートの説明を
行なう、各プロセッサでは、ブロック100にて時刻割
込みを検出すると、ブロック101にてタイマを起動す
る。102のブロックでは時刻割込みの発生を検出し、
もし、時刻割込みを検出すれば、この同期制御期間での
送信制御を終了しく即ち、この期間ではクロック情報送
出プロセッサにはならなかった)、ブロック100に戻
り、再びタイマの起動を行なう、もし、ブロック102
にて時刻割込みを検出しなかったら、ブロック103に
進み、セットしたタイマがタイムアウトしたかどうかを
検出する。もし、タイムアウトしていなければ、再びブ
ロック102に戻り時刻割込みの検出判定を行なう。
First, the transmission control flowchart of FIG. 1(a) will be explained. In each processor, when a time interrupt is detected in block 100, a timer is activated in block 101. Block 102 detects the occurrence of a time interrupt,
If a time interrupt is detected, the transmission control in this synchronous control period is terminated (in other words, the clock information sending processor did not become a processor in this period), the process returns to block 100, and the timer is started again. block 102
If no time interrupt is detected at block 103, it is detected whether the set timer has timed out. If the timeout has not occurred, the process returns to block 102 again to determine if a time-of-day interrupt has been detected.

即ち、ブロック102とブロック103のループは、時
刻割込みかタイムアウトのどちらかを検出するまで続き
、ブロック103にてタイムアウトを検出すると(この
とき、時刻割込みが発生する前にタイムアウトを検出し
たことになる)、ブロック104にてタイムアウトが発
生した時刻を刻印したクロック情報が全てのプロセッサ
に送出され(即ち、このクロック同期制御期間でクロッ
ク情報送出プロセッサとなった)、この同期制御期間で
の送信制御を終了し、ブロック100に戻り、次の同期
制御期間の開始を示す時刻割込みを待つ。
That is, the loop between block 102 and block 103 continues until either a time interrupt or a timeout is detected, and when a timeout is detected in block 103 (at this time, the timeout is detected before the time interrupt occurs). ), in block 104, clock information stamped with the time when the timeout occurred is sent to all processors (that is, they became clock information sending processors during this clock synchronization control period), and the transmission control during this synchronization control period is performed. Upon completion, the process returns to block 100 and waits for a time interrupt indicating the start of the next synchronous control period.

第1図(b)の受信制御では、ブロック111において
、他のプロセッサが送信するクロック情報の受信を行な
う。続くブロック112にて、受信したクロック値と自
クロック値との差分を算出し格納する。ブロック113
では、時刻割込みが生起したかどうかの判定を行ない、
時刻割込みが生起していなければ、再びクロック情報の
受信を行ない、このループは受信時間窓が終了するまで
繰り返し行なわれる。ブロック113にて時刻割込が生
起したことを検出すると、ブロック114に行き、受信
した全てのクロック情報と自己のクロック値との差分く
ブロック112にて求まっている)の平均値を算出する
In the reception control shown in FIG. 1(b), in block 111, clock information transmitted by another processor is received. In the subsequent block 112, the difference between the received clock value and the own clock value is calculated and stored. Block 113
Now, let's determine whether a time interrupt has occurred,
If no time interrupt has occurred, clock information is received again, and this loop is repeated until the reception time window ends. When it is detected in block 113 that a time interrupt has occurred, the process goes to block 114 and calculates the average value of the differences between all the received clock information and its own clock value (calculated in block 112).

続くブロック115では、算出されたΔの正負により制
御のスイッチを行ない、もし、Δが正ならばブロック1
16にて、自クロック値にΔを加算して自クロックの調
整を行なう、もし、Δが負ならば、ブロック117にて
、目クロックをΔだけ停止させて自クロックの調整を行
なう。プロッり116あるいは117の処理が終了する
と、この周期制御期間での受信処理を終了してブロック
110に戻り、次のクロック周期制御期間での受信制御
を開始する。
In the following block 115, control is switched depending on the sign of the calculated Δ, and if Δ is positive, block 1
In block 16, the own clock is adjusted by adding Δ to the own clock value. If Δ is negative, in block 117, the second clock is stopped by Δ and the own clock is adjusted. When the process of plot 116 or 117 is completed, the reception process in this periodic control period is ended and the process returns to block 110, where reception control in the next clock periodic control period is started.

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

このように、本発明のクロック同期方式を用いることに
より、マルチプロセッサシステムにおいて、集中制御を
行なうプロセッサを設けることなく、すべてのプロセッ
サを対等に動作させて、各プロセッサのクロックを共通
な時刻を指すように制御することができる。クロック同
期制御を行なうプロセッサは、同期制御期間ごとにラン
ダムに選択されることになり、特定のプロセッサの障害
がシステムの致命的な障害を与えることがなく高い信頼
性が確保できる。また、この信頼性の度合いは、タイム
アウトがクロック同期制御区間に入る確率を制御するこ
とで柔軟に変えることが可能である。
In this way, by using the clock synchronization method of the present invention, in a multiprocessor system, all processors can operate equally without providing a processor that performs centralized control, and the clocks of each processor can point to a common time. It can be controlled as follows. Processors that perform clock synchronization control are randomly selected for each synchronization control period, and a failure of a particular processor will not cause a fatal failure of the system, ensuring high reliability. Furthermore, the degree of reliability can be flexibly changed by controlling the probability that a timeout will fall within the clock synchronization control interval.

さらに、固定の数のプロセッサが、各同期制御期間毎に
選択されるのではなく、同期制御用にクロックを送出す
るプロセッサ数もランダムであり、各同期制御期間毎に
平均値として与えられるので、制御にともなうデッドロ
ック状態を回避することは容易である。また、全てのプ
ロセッサのクロック値を用いて同期制御を行なうもので
はなく、部分プロセッサ集合のクロック値を用いて制御
がなされるので、プロセッサ数が増えた場合にも、同期
制御に要する処理時間が極端に増大することはない。
Furthermore, a fixed number of processors is not selected for each synchronous control period, but the number of processors that send out clocks for synchronous control is also random, and is given as an average value for each synchronous control period. It is easy to avoid deadlock situations associated with control. In addition, since synchronous control is not performed using the clock values of all processors, but is performed using the clock values of a partial set of processors, the processing time required for synchronous control even when the number of processors increases. It will not increase significantly.

さらには、クロック情報を送出するタイミングがクロッ
ク同期制御期間の間でランダムに分布することになるの
で、クロック情報送出にともなうネットワークの輻そう
状態を避けることが可能となる。
Furthermore, since the timing of transmitting clock information is randomly distributed during the clock synchronization control period, it is possible to avoid network congestion caused by transmitting clock information.

以上のように本発明により得られる効果は太きAs described above, the effects obtained by the present invention are significant.

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

第1図(a)、(b)は本発明によるクロック同期方式
の一実施例を示すフローチャート、第2図は本発明によ
るクロック同期方式の制御タイミングチャート、第3図
(a)、(b)、(c)は本発明の詳細な説明するため
のマルチプロセッサシステムの一例および各プロセッサ
の時刻例を示す図である。 100〜104,111〜117・・・制御ブロック、
301〜305・・・プロセッサ、306・・・プロセ
ッサ303とプロセッサ304間の論理的な通第 1 
回(,1) 、牟 ! 閃(b) 茅 ガ (わ )゛ロゼ、ゾサ3θ/ 茅 圀(b)
FIGS. 1(a) and (b) are flowcharts showing an embodiment of the clock synchronization method according to the present invention, FIG. 2 is a control timing chart of the clock synchronization method according to the present invention, and FIGS. 3(a) and (b). , (c) are diagrams showing an example of a multiprocessor system and an example of time of each processor for detailed explanation of the present invention. 100-104, 111-117... control blocks,
301 to 305... Processor, 306... Logical communication between processor 303 and processor 304 first
Times (,1), Mu! Flash (b) Chiga (wa) Rose, Zosa 3θ / Kayakuni (b)

Claims (1)

【特許請求の範囲】 1、n個のプロセッサからなるマルチプロセッサシステ
ムのクロック同期方式において、前記各プロセッサは時
刻を示すクロックとランダム時間を計測するタイマと予
め定められた間隔で時刻割込みを発生する手段とを具備
し、該タイマはあらかじめ定められた時間範囲内でのラ
ンダムな時間を計測後タイムアウトし、前記各プロセッ
サでは、前記時刻割込みが生起すると前記タイマを起動
し、タイムアウトが発生した時刻が前記時刻割込み前で
あれば、前記タイムアウトが発生した時刻に全てのプロ
セッサに対して自己のクロックを送出し、さらに、前記
各プロセッサは、前記時刻割込みが生起する毎に到着し
た全てのクロック情報に基づき各自のクロックを制御す
ることを特徴とするマルチプロセッサシステムにおける
クロック同期方式。 2、前記各プロセッサのクロック制御において、前記受
信した全てのクロック情報の平均時刻が、自分のクロッ
クの示す時刻よりもΔ進んでいる場合は自分のクロック
にΔを加算し、前記平均時刻が自分のクロックの示す時
刻よりもΔ遅れている場合は、前記タイマが時間Δの経
過を通知するまで自分のクロックを停止させることを特
徴とする特許請求の範囲第1項記載のマルチプロセッサ
システムにおけるクロック同期方式。
[Claims] 1. In a clock synchronization system for a multiprocessor system consisting of n processors, each processor generates time interrupts at predetermined intervals using a clock indicating time and a timer measuring random time. and the timer times out after measuring a random time within a predetermined time range, and in each of the processors, when the time interrupt occurs, the timer is activated and the time at which the timeout occurs is determined. Before the time interrupt occurs, each processor sends its own clock to all processors at the time when the timeout occurs, and each processor sends its own clock to all clock information that arrives each time the time interrupt occurs. A clock synchronization method in a multiprocessor system, which is characterized by controlling each clock based on the system. 2. In the clock control of each processor, if the average time of all the received clock information is Δ ahead of the time indicated by its own clock, add Δ to its own clock, and set the average time to its own clock. In the multiprocessor system according to claim 1, the clock in the multiprocessor system according to claim 1 is characterized in that when the timer is delayed by Δ from the time indicated by the clock, the clock stops its own clock until the timer notifies that the time Δ has elapsed. Synchronous method.
JP63268622A 1988-10-24 1988-10-24 Clock synchronization method in multiprocessor system Expired - Lifetime JPH07117940B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63268622A JPH07117940B2 (en) 1988-10-24 1988-10-24 Clock synchronization method in multiprocessor system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63268622A JPH07117940B2 (en) 1988-10-24 1988-10-24 Clock synchronization method in multiprocessor system

Publications (2)

Publication Number Publication Date
JPH02114360A true JPH02114360A (en) 1990-04-26
JPH07117940B2 JPH07117940B2 (en) 1995-12-18

Family

ID=17461102

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63268622A Expired - Lifetime JPH07117940B2 (en) 1988-10-24 1988-10-24 Clock synchronization method in multiprocessor system

Country Status (1)

Country Link
JP (1) JPH07117940B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05165792A (en) * 1991-12-16 1993-07-02 Fujitsu Ltd Timer synchronizing system
JP2014163678A (en) * 2013-02-21 2014-09-08 Nec Corp Clock-time supply device, clock-time supply method, and program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05165792A (en) * 1991-12-16 1993-07-02 Fujitsu Ltd Timer synchronizing system
JP2014163678A (en) * 2013-02-21 2014-09-08 Nec Corp Clock-time supply device, clock-time supply method, and program

Also Published As

Publication number Publication date
JPH07117940B2 (en) 1995-12-18

Similar Documents

Publication Publication Date Title
US6199169B1 (en) System and method for synchronizing time across a computer cluster
US4584643A (en) Decentralized synchronization of clocks
US8601165B2 (en) Method for synchronization in networks
US4531185A (en) Centralized synchronization of clocks
Arvind Probabilistic clock synchronization in distributed systems
AU2006200299B2 (en) Synchronization of multiple operational flight programs
US7334014B2 (en) Consistent time service for fault-tolerant distributed systems
Dunigan Hypercube clock synchronization
US6145008A (en) Conflict free time-triggered method and apparatus for the transmission of messages in a distributed real-time computer system
JPH02114360A (en) Clock synchronizing method for multiprocessor system
JPH01116862A (en) Clock synchronizing system for multiprocessor system
JPH02114359A (en) Clock synchronizing method for multiprocessor system
Li et al. A high-accuracy clock synchronization method in distributed real-time system
JPH0528866B2 (en)
Chakravarthi et al. A fine-grain clock synchronization mechanism for QoS based communication on myrinet
EP0223031A2 (en) Clock synchronisation in a distributed processing system
de Azevedo et al. Fault-tolerant clock synchronization for distributed systems with high message delay variation
Beck et al. Implementation issues in clock synchronization
JPH01270119A (en) Clock synchronizing system in multiprocessor system
Martins et al. An Approach to the Synchronization of Backup Masters in Dynamic Master-Slave Systems
JPH0528864B2 (en)
JPH0528863B2 (en)
JPH02288750A (en) Inter-node time matching system
Ciuffoletti et al. Clock synchronization in virtual rings
Jones Experiments in high precision clock synchronisation.