JPH01270119A - Clock synchronizing system in multiprocessor system - Google Patents

Clock synchronizing system in multiprocessor system

Info

Publication number
JPH01270119A
JPH01270119A JP63099937A JP9993788A JPH01270119A JP H01270119 A JPH01270119 A JP H01270119A JP 63099937 A JP63099937 A JP 63099937A JP 9993788 A JP9993788 A JP 9993788A JP H01270119 A JPH01270119 A JP H01270119A
Authority
JP
Japan
Prior art keywords
clock
processor
time
processors
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP63099937A
Other languages
Japanese (ja)
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 JP63099937A priority Critical patent/JPH01270119A/en
Priority to US07/253,478 priority patent/US5041966A/en
Publication of JPH01270119A publication Critical patent/JPH01270119A/en
Pending legal-status Critical Current

Links

Landscapes

  • Multi Processors (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

PURPOSE:To eliminate a dead lock state due to the queuing of a response message from a faulty processor by operating all of the processors on equal terms, and making the clock of each processor indicate a common time in a certain range. CONSTITUTION:Each of the processor (301-305) performs queuing after the lapse of a certain time since transmitting the clock, and after that, calculates the mean value of a clock difference with another processor, and performs the adjustment of its own clock based on the mean value. The above operation is repeated at every time when all of the processors (301-305) arrive at a prescribed time, and after a certain number of times of synchronism control is performed, the clocks of all processors (301-305) indicate almost the same time. Thus, each of the processors (301-305) performs control by using only a clock value transmitted from another processor. In such a way, the dead lock state due to the influence of the fault of the processor can be elominated even when either processors is set at a faulty state and transmission is impossible to perform.

Description

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

(従来の技術) マルチプロセッサシステムにおいては、システムを構成
する各プロセッサのクロックをシステム全体に共通な時
刻を示すように同期させることが必要となる。例えば、
分散ファイリングシステムにおいて、各ファイルに記録
された作成および編集時刻に基づきファイルのバージョ
ンを識別するためには、各プロセッサ間に共通な時刻が
必要となる。また、各プロセッサがシステムに共通な時
刻に基づいた自己の履歴情報を蓄積しておけば、障害発
生時にどのような順番で障害が検出されたかを知ること
ができ、障害の原因を特定するための有力な情報を得る
ことができる。
(Prior Art) In a multiprocessor system, it is necessary to synchronize the clocks of each processor making 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 the 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 cause of the failure. You can obtain useful information.

共有メモリを持たないマルチプロセッサシステムの一例
である通信ネットワークシステムにおいても、各通信ノ
ードのクロックが共通な時刻を示すようにする同期方式
が必要である。例えば、[第6回インターナショナルコ
ンファレンスオンデイストリビューティドコンピユーテ
イングシステム]の予稿集p、364−371に記載さ
れている論文「アンエレクションアルゴリズムフオーデ
イストリビューティドクロノクシンクロナイゼイション
プログラム](文献1)で紹介されているクロック同期
方式TEMPOは、UNIXオペレーティングシステム
4.3 BSDで動作するネットワークにインプリメン
トされているものである。上述のシステムにおいては、
マスクとなる1つのノードが、定められた時刻毎にすべ
てのノードに時刻の問い合わせを行い、求められた各ノ
ードの時刻をもとに平均時刻を計算する。この後マスク
のノードがすべてのノードに対し゛Cクロックの調整指
示を行い、各ノードはこの指示に従いクロックの調整を
行う。
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, the paper ``Unerected Algorithms and Distributed Chronic Synchronization Programs'' (Reference 1 The clock synchronization method TEMPO introduced in ) is implemented in a network running on the UNIX operating system 4.3 BSD.In the above system,
One node, which serves as a mask, queries all nodes about the time at every predetermined time, and calculates the average time based on the determined times of each node. Thereafter, the mask node instructs all nodes to adjust the C clock, and each node adjusts its clock according to this instruction.

また、「第16回アニュアルインターナショナルシンポ
ジウムオンフォールトトレラントコンピューティング]
の予稿集p、218−223に記載されている論文「ク
ロックシンクロナイゼイションインザプレゼンスオプフ
ォールツアンドプロセッサジョインズJ(文献2)で紹
介されているクロック同期方式は、先に説明したTEM
POのようなマスタ・スレーブ型の制御ではなく、分散
型の制御を用いている。同方式において、プロセッサは
システム内で定期的に同報される同期メツセージの中で
、最も速い時刻を示す同期メツセージに従いクロックの
時刻合せを行なう。このため、結果として最も速く進む
クロックを持つプロセッサがシステム内の時刻を支配す
ることになる。
Also, “16th Annual International Symposium on Fault Tolerant Computing”
The clock synchronization method introduced in the paper "Clock Synchronization in the Presence Opfaults and Processor Joins J (Reference 2)" described in Proceedings p., 218-223 is based on the TEM described earlier.
It uses distributed control rather than master-slave type control like PO. In this system, the processor adjusts the clock according to the synchronization message indicating the earliest time among the synchronization messages broadcast periodically within the system. As a result, the processor with the clock that advances the fastest will control the time in the system.

さらに、[ジャーナルオブアソシエーションフオーコン
ピューティングマシナリ−J Vol、32゜No、1
.January 1985. p、52−78に記載
されている論文「シンクロナイジングクロックインザプ
レゼンスオブフォールツ」(文献3)で紹介されている
クロック同期方式は、すべてのプロセッサが定期的に互
いのプロセッサの時刻を通信しあう、完全分散制御に基
づく同期方式である。
Furthermore, [Journal of Association for Computing Machinery-J Vol. 32° No. 1
.. January 1985. The clock synchronization method introduced in the paper "Synchronizing Clock in the Presence of Faults" (Reference 3) described in p. This is a synchronization method based on completely distributed control.

(発明が解決しようとする課題) 文献1記載のクロック同期方式においてはマスタノード
が必要不可欠である。このため、マスタノードの障害時
には他のノードがマスタノードの機能を果たすように、
マスタノードの代行方式が必要となる。また、すべての
ノードのクロックの問い合せ等を1つのマスタノードが
行うために、ノードの数が増えるとマスタノードへの通
信量が増加するとともに、すべてのノードの時刻の平均
を求める作業が増大する。
(Problem to be Solved by the Invention) In the clock synchronization method described in Document 1, a master node is essential. Therefore, when the master node fails, other nodes can perform the function of the master node.
A proxy method for the master node is required. 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 work of calculating the average time of all nodes increases. .

これに対し、分散型の制御を採用している文献2記載の
方式では、分散型ではあるものの、結果として最も速い
クロックを持つ1つのプロセッサがシステム内の時刻を
支配してしまう。しかもプロセッサのクロックがほぼ同
じ時刻を示す場合には、複数のプロセッサから同時に同
期メツセージが送信され、最も速い時刻を示す同期メツ
セージの選出処理が複雑になる。また、文献3の方式で
は、それぞれのプロセッサが互いに他のすべてのプロセ
ッサと通信を行なうために、実際のシステムに適用する
場合には通信のオーバヘッドが問題となる。
On the other hand, in the method described in Reference 2 that employs distributed control, although it is distributed, one processor with the fastest clock ends up controlling the time within the system. Moreover, if the clocks of the processors indicate approximately the same time, synchronization messages will be sent simultaneously from a plurality of processors, making the process of selecting the synchronization message indicating the earliest time complicated. Furthermore, in the method of Document 3, since each processor communicates with all other processors, communication overhead becomes a problem when applied to an actual system.

これらの問題点を解決する方式として、電子情報通信学
会主催の[情報通信網の安全性・信頼性シンポジューム
」第1回資料p、35−38記載の「ネットワークにお
ける時刻管理方式の基礎検討」(文献4)で述べられて
いる方式では、それぞれのプロセッサが、周期的に複数
個のプロセッサをランダムに選択し、これらプロセッサ
に時刻の問い合せを行なう。プロセッサは、選択された
プロセッサから返送される時刻に基づき同期を確保する
。文献4の方式では、集中制御を行なうプロセッサを設
ける必要がなく、システム内のプロセッサ数が増加した
場合にも、通信のメツセージがあるプロセッサに集中す
ることがない。しかしながら、各プロセッサは選択した
プロセッサからの応答を待ななければならないために、
選択されたプロセッサが障害状態にあり応答メツセージ
を送信することができない場合には、該障害プロセッサ
からの応答メツセージを待っているプロセッサは、デッ
ドロック状態に陥ってしまうという問題点がある。
As a method to solve these problems, "Basic study of time management methods in networks" described in the first document p. In the method described in Reference 4), each processor periodically selects a plurality of processors at random and queries these processors about the time. The processors ensure synchronization based on the time returned from the selected processor. In the method of Document 4, there is no need to provide a processor for centralized control, and even if the number of processors in the system increases, communication messages will not be concentrated on a certain processor. However, since each processor must wait for a response from the selected processor,
If the selected processor is in a faulty state and cannot send a response message, there is a problem in that the processors waiting for a response message from the faulty processor end up in a deadlock state.

本発明の目的は、それぞれのプロセッサは他のプロセッ
サへの時刻の問い合せを行なうことなく、あるプロセッ
サが障害状態にありメツセージの送信が不可能となった
場合にも、デッドロック状態を生ずることのないマルチ
プロセッサシステムにおけるクロック同期方式を提供す
ることにある。
It is an object of the present invention to prevent deadlock conditions from occurring even when a processor is in a failure state and cannot send messages without each processor inquiring the time of the other processors. The object of the present invention is to provide a clock synchronization method in a multiprocessor system that does not require the use of multiple processors.

(課題を解決するための手段) 本発明によれば、n個のプロセッサからなるマルチプロ
セッサシステムのクロック同期において、前記プロセッ
サは時刻を示すクロックを具備し、予め定められた時刻
毎に前記n個のプロセッサの中からm個のプロセッサを
ランダムに選択して、該m個のプロセッサに自己のクロ
ックが示す値を送信するとともに、他のプロセッサから
前記クロック値を受信した場合には、該タロツク値を受
信した時の自己のクロックが示す値から前記受信したク
ロック値を差引いてクロック差分を求め、前記予め定め
られた時刻に一定時間を加えた時刻においては、該時刻
までに求められた前記クロック差分の平均値を計算し、
前記平均値が負の値の場合には、自分のクロックに該平
均値の絶対値を加算し、前記平均値が正の値の場合には
、自己のクロックを該平均値の時間だけ停止させること
を特徴とするマルチプロセッサシステムにおけるクロッ
ク同期方式が得られる。
(Means for Solving the Problem) According to the present invention, in clock synchronization of a multiprocessor system consisting of n processors, the processors are provided with a clock indicating time, and the n processors are synchronized at each predetermined time. m processors are randomly selected from among the processors of A clock difference is obtained by subtracting the received clock value from the value indicated by the own clock when the clock is received, and at a time when a certain period of time is added to the predetermined time, the clock obtained up to that time is calculated. Calculate the average value of the differences,
When the average value is a negative value, the absolute value of the average value is added to the own clock, and when the average value is a positive value, the own clock is stopped for the time of the average value. A clock synchronization method in a multiprocessor system is obtained.

(発明の作用) 本発明の原理について第3図を参照して説明する。第3
図はマルチプロセッサシステムの具体例を示す。各プロ
セッサ301.302.303.304.305は、自
己の時刻を示すクロックを備えている。さらに各プロセ
ッサは任意のプロセッサと通信できるように相互に論理
的な通信路306〜315により接続されている。互い
のプロセッサが共通にアクセスできる共有メモリを持た
ないマルチプロセッサシステムでは、システムの初期状
態においては、各プロセッサのクロックが同一の時刻を
示しているとは限らない。しかも、同じ値からスタート
したクロックも、凡そ同じ割合で時刻を測定するものの
、時刻の経過にともない徐々にずれて行く。従って、各
プロセッサは以下に説明する本発明による同期方式を用
いて、互いのクロックの同期制御を行う必要がある。
(Operation of the invention) The principle of the invention will be explained with reference to FIG. Third
The figure shows a specific example of a multiprocessor system. Each processor 301.302.303.304.305 is equipped with a clock that indicates its own time. Furthermore, each processor is mutually connected by logical communication paths 306 to 315 so that it can communicate with any processor. In a multiprocessor system that does not have a shared memory that can be commonly accessed by both processors, the clocks of each processor do not necessarily indicate the same time in the initial state of the system. Moreover, although clocks that start from the same value measure time at approximately the same rate, they gradually shift as time passes. Therefore, it is necessary for each processor to synchronize each other's clocks using the synchronization method according to the present invention, which will be described below.

この同期方式では、各プロセッサは、クロックが例えば
1:00.2:00.3:00というように予め定めら
れた時刻になると、システム内のn個のプロセッサの中
からm個のプロセッサをランダムに選択する。この後、
これらm個のプロセッサに自己のクロックが示す時刻を
送信する。プロセッサ301において、クロックがに〇
〇を示した時に5つのプロセッサの中からランダムに3
つのプロセッサ302.303.304を選択したとす
ると、プロセッサ3o1は通信路306.312゜31
1を介してこれらプロセッサに自己の現在のクロック値
1:00を送信する。一方、プロセッサ302は自己の
クロックが1=04の時に、プロセッサ301がらクロ
ツタ値1:00を受信したとする。プロセッサ302は
自己のクロック値から受信されたクロック値を差引き、
クロック差分0:04を求める。この時、プロセッサ3
02は、自己のクロックがプロセッサ301のクロック
よりも0二04だけ進んでいることがわかる。例えば、
プロセッサ302がプロセッサ301に同期するために
は自己のクロックを時間O:04だけ停止させればよい
In this synchronization method, when the clock reaches a predetermined time such as 1:00.2:00.3:00, each processor randomly selects m processors from among the n processors in the system. Select. After this,
The time indicated by its own clock is transmitted to these m processors. In the processor 301, when the clock shows
If one processor 302, 303, 304 is selected, the processor 3o1 is connected to the communication path 306, 312, 31
1 to these processors via their current clock value of 1:00. On the other hand, it is assumed that processor 302 receives a clock value of 1:00 from processor 301 when its own clock is 1=04. Processor 302 subtracts the received clock value from its own clock value;
Find a clock difference of 0:04. At this time, processor 3
02, it can be seen that its own clock is ahead of the clock of the processor 301 by 0204. for example,
In order for the processor 302 to synchronize with the processor 301, it is sufficient to stop its own clock for a time period of 0:04.

各プロセッサがクロック値を送信する時刻は、実時刻上
では同期誤差の分だけばらついており、これに加えてク
ロック値の送信処理に要する時間およびメツセージの伝
達時間にもあるばらつきが生じると考えられるために、
他のプロセッサから送信された複数のクロック値が同時
に受信されるとは限らない。従って、各プロセッサはク
ロック値を送信してからある時間経過を待合わせた後、
それまでに求められた他のプロセッサとのクロック差分
の平均値を計算し、該平均値をもとに自己のクロックの
調整を行なう。この待合わせ時間は、同期誤差、処理時
間およびメツセージ伝達時間を考慮して、送信されたク
ロック値がそれぞれのプロセッサに到達した後に同期制
御が実施されるように定める。ここでは例えば、1:3
0.2:30゜3:30というように、予め定められた
時刻に30分加算した時刻にクロック差分の平均値を求
めるように定める。これは数分程度の同期誤差が生じて
いても、クロック値を送信してから凡そ30分の後には
送信されたすべてのクロック値は目的のプロセッサに受
信されていると予想されるからである。プロセッサ30
2のクロックが、時刻1:30を示した時、他のプロセ
ッサ301.304.305とのクロック差分、0:0
4.−0:01.0:03がすでに求められている場合
、プロセッサ302はこれらクロック差分の平均値を計
算し、該平均値が0:02であることを知る。この時、
プロセッサ302は自己のクロックが他の3つのプロセ
ッサの平均時刻に比べ、時間0:02だけ進んでいるこ
とがわかる。従って、プロセッサ302は求めたクロッ
ク差分の平均値時間(0:02)が経過するまで自己の
クロックを停止させ、他のプロセッサとの同期を確保す
る。同様にして、自己のクロックが他のプロセッサの平
均時刻よりも遅れている場合は、自分のクロックに求め
られたクロック差分の平均値を加算することで同期を保
つことができる。以上の操作は、すべてのプロセッサが
、予め定められた時刻になる毎に繰り返し行なわれ、あ
る回数の同期制御が行なわれた後には、すべてのプロセ
ッサのクロックはほぼ同じ時刻を示すようになる。
The times at which each processor sends a clock value vary based on the actual time by the amount of synchronization error, and in addition to this, it is thought that there will be some variation in the time required to transmit the clock value and the time to transmit the message. for,
Multiple clock values sent from other processors are not necessarily received at the same time. Therefore, each processor waits for a certain amount of time to pass after transmitting the clock value, and then
The average value of the clock differences with other processors determined so far is calculated, and the own clock is adjusted based on the average value. This waiting time is determined in consideration of synchronization error, processing time, and message transmission time so that synchronization control is performed after the transmitted clock value reaches each processor. For example, 1:3
It is determined that the average value of the clock differences is determined at a time obtained by adding 30 minutes to a predetermined time, such as 0.2:30° and 3:30. This is because even if there is a synchronization error of several minutes, all the transmitted clock values are expected to have been received by the target processor approximately 30 minutes after the clock values are transmitted. . processor 30
When the clock of processor 2 indicates time 1:30, the clock difference with other processors 301.304.305 is 0:0.
4. If -0:01.0:03 has already been determined, processor 302 calculates the average value of these clock differences and finds that the average value is 0:02. At this time,
It can be seen that the processor 302's own clock is ahead of the average time of the other three processors by a time of 0:02. Therefore, the processor 302 stops its own clock until the calculated average value time (0:02) of the clock difference has elapsed, thereby ensuring synchronization with other processors. Similarly, if the own clock is behind the average time of other processors, synchronization can be maintained by adding the average value of the calculated clock differences to the own clock. The above operations are repeatedly performed on all processors at predetermined times, and after synchronization control has been performed a certain number of times, the clocks of all processors come to indicate approximately the same time.

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

以上の説明で明らかなように、各プロセッサは他のプロ
セッサから送信されるクロック値だけを用いて制御を実
施するために、いずれかのプロセッサが障害状態にあり
送信不可能であったとしても、該障害プロセッサの影響
を受はデッドロック状態になることはない。しかもこの
時、各プロセッサは平均的にはm個のプロセッサのクロ
ック情報をもとに同期制御を行なうため、通信量を削減
することができるとともに、それぞれのプロセッサはm
個のプロセッサをランダムに選択するため、制御の繰り
返しにより、システム内のすべてのプロセッサのクロッ
ク情報が同期制御に反映される。
As is clear from the above explanation, each processor performs control using only the clock values sent from other processors, so even if one of the processors is in a failure state and cannot transmit data, Those affected by the faulty processor will not be in a deadlock condition. Moreover, at this time, each processor performs synchronous control based on the clock information of m processors on average, so it is possible to reduce the amount of communication, and each processor
Since the processors are selected at random, the clock information of all processors in the system is reflected in the synchronization control by repeating the control.

(実施例) 以降図面を参照して本発明の詳細な説明を行なう。第1
図および第2図に本発明によるクロック同期方式を実現
するアルゴリズムの例を示す。第1図は、各プロセッサ
が実行するアルゴリズムである。アルゴリズムは、大き
くは次の3つのモジュールに分割される。すなわち、自
プロセッサのり60ツクが、例えば1:00.2:00
.3:00というように定められた時刻になる度に発生
するように設定された時刻割込み1を検出した場合に、
ランダムにm個のプロセッサを選択し、該プロセッサに
自己のクロック値を送信するモジュール、また、他のプ
ロセッサjからクロック値を受信した場合に発生する受
信割込みを検出した時に、同プロセッサjとのクロック
差分δjを求めるモジュール、さらに、自プロセッサの
クロックが1:30.2:30.3:30というように
、予め定められた時刻に30分加えた時刻になる度に発
生するように設定された時刻割込み2が検出された場合
に、該時刻側込み2が検出されるまでに他のプロセッサ
から受信されたクロック差分δjの平均値δを求め、該
平均値δに基づいて自己のクロックの調整を行なうモジ
ュールの3つである。制御ブロック101は、以上の3
つのモジュールのうちのいずれを実行するかを決定する
ための各側込み信号の検出を行なう。
(Example) Hereinafter, the present invention will be described in detail with reference to the drawings. 1st
An example of an algorithm for implementing the clock synchronization method according to the present invention is shown in FIG. FIG. 1 shows the algorithm executed by each processor. The algorithm is roughly divided into the following three modules. In other words, the self-processor time is 60 times, for example, 1:00.2:00.
.. If time interrupt 1, which is set to occur every time a predetermined time such as 3:00, is detected,
A module that randomly selects m processors and sends its own clock value to the selected processor, and when detecting a reception interrupt that occurs when receiving a clock value from another processor j, The module that calculates the clock difference δj is set to occur every time the own processor's clock reaches a predetermined time plus 30 minutes, such as 1:30.2:30.3:30. When a time interrupt 2 is detected, the average value δ of the clock differences δj received from other processors until the time interrupt 2 is detected is calculated, and the own clock is calculated based on the average value δ. There are three modules that perform adjustment. The control block 101 has the above three functions.
Detection of each side-in signal is performed to determine which of the two modules to execute.

各プロセッサが制御ブロック101において時刻割込み
1を検出した場合には、制御ブロック102においてシ
ステム内のn4tiThのプロセッサの中からm個のプ
ロセッサをランダムに選択し、続いて制御ブロック10
3においてこれら選択されたプロセッサに自己のクロッ
クが示す値を送信する。この後、制御ブロック101に
戻り、次に発生する割込み信号を待つ。また、各プロセ
ッサが制御ブロック101において受信割込みを検出し
た場合には、制御ブロック108において、自己のクロ
ックが示す値からプロセッサJにより送信されたクロッ
ク値を差引き、クロック差分δjを求める。この後、制
御ブロック101に戻り、次に発生する割込み信号を待
つ。さらに、各プロセッサが制御ブロック101におい
て時刻割込み2を検出した場合には、制御ブロック10
4において、該時刻側込み2が発生するまでに求められ
たクロック差分δjの平均値δを求める。引続き、制御
ブロック105において該平均値δの値を判別し、δ〉
0であるならば、自己のクロックは他のプロセッサに比
べ進んでいるとみなして制御ブロック107において自
己のクロックを時間δだけ停止させる。また、δく0で
あるならば、自己のクロックは他のプロセッサに比べ遅
れているとみなして自己のクロックにδの絶対値を加算
する。さらに、δ=0であるならば他のプロセッサに同
期しているものとみなし特にクロックの調整は必要ない
。以上説明したクロック差分の平均値δに基づく制御を
行なった後に、再び制御ブロック101に戻り、次に発
生する割込み信号を検出する。このアルゴリズムはすべ
てのプロセッサが実行する。
When each processor detects time interrupt 1 in control block 101, control block 102 randomly selects m processors from n4tiTh processors in the system, and then
In step 3, the value indicated by its own clock is transmitted to these selected processors. Thereafter, the process returns to control block 101 and waits for the next interrupt signal to occur. Furthermore, when each processor detects a reception interrupt in the control block 101, the control block 108 subtracts the clock value transmitted by the processor J from the value indicated by its own clock to obtain a clock difference δj. Thereafter, the process returns to control block 101 and waits for the next interrupt signal to occur. Further, when each processor detects time interrupt 2 in the control block 101, the control block 10
4, the average value δ of the clock differences δj determined until the time delay 2 occurs is determined. Subsequently, in the control block 105, the value of the average value δ is determined, and δ>
If it is 0, it is assumed that the processor's own clock is ahead of other processors, and the control block 107 stops the processor's own clock for a time δ. If δ is 0, it is assumed that its own clock is delayed compared to other processors, and the absolute value of δ is added to its own clock. Further, if δ=0, it is assumed that the processor is synchronized with other processors, and no particular clock adjustment is required. After performing the control based on the average value δ of the clock differences as described above, the process returns to the control block 101 and detects the next interrupt signal. This algorithm is executed by all processors.

第2図は、第1図で示した制御ブロック107における
制御を詳細に示すアルゴリズムである。プロセッサ内の
クロックを任意時間停止させるために、各プロセッサは
任意時間の経過を測定するタイマを備えておく。制御ブ
ロック201では、同タイマに求められたクロック差分
の平均値δ(〉0)を設定し時間経過の測定を開始させ
る。これとともにクロックを停止させ、制御ブロック2
03にて前記タイマからの時間δ経過時に発生するタイ
マ割込みを待ち、該タイマ割込みにより時間δだけ経過
したことを知ると、制御ブロック204において再び自
己のクロックをスタートさせる。
FIG. 2 is an algorithm showing in detail the control in control block 107 shown in FIG. In order to stop the clock within the processor for an arbitrary period of time, each processor is equipped with a timer that measures the passage of an arbitrary period of time. The control block 201 sets the average value δ (>0) of the calculated clock differences to the timer and starts measuring the passage of time. At the same time, the clock is stopped and control block 2
At step 03, it waits for a timer interrupt that occurs when the time δ from the timer has elapsed, and when it learns from the timer interrupt that the time δ has elapsed, it restarts its own clock at control block 204.

(発明の効果) このように、本発明のクロック同期方法を用いることに
より、マルチプロセッサシステムにおいて、集中制御を
行なうプロセッサを設けることなく、すべてのプロセッ
サを対等に動作させて、各プロセッサのクロックをある
範囲内で共通な時刻を指すように制御することができる
。本同期方式においては、各プロセッサは、他の送信さ
れてきたクロック値だけを用いて同期制御を行なう。
(Effects of the Invention) As described above, by using the clock synchronization method of the present invention, in a multiprocessor system, all processors can be operated equally without providing a processor that performs centralized control, and the clock of each processor can be adjusted. It can be controlled to point to a common time within a certain range. In this synchronization method, each processor performs synchronization control using only other transmitted clock values.

従って、あるプロセッサからの応答メツセージの待合わ
せを行なう必要がないために、障害状態にありメツセー
ジの送信が不可能なプロセッサがあったとしても該障害
プロセッサからの応答メツセージ待合わせによるデッド
ロック状態を生ずることはない。しかも集中制御を行な
うプロセッサが不要であるために、特定のプロセッサの
障害がシステムに致命的な障害を与えることがなく高い
信頼性が確保できるとともに、各プロセッサが送信する
メツセージは特定のプロセッサに集中することもないた
め、プロセッサの処理を分散させることが可能である。
Therefore, since there is no need to wait for a response message from a certain processor, even if there is a processor that is in a faulty state and cannot send messages, a deadlock situation due to waiting for a response message from the faulty processor can be avoided. It will never occur. Furthermore, since there is no need for a centrally controlled processor, a failure in a specific processor will not cause a fatal failure to the system, ensuring high reliability, and messages sent by each processor are concentrated in a specific processor. Therefore, the processing of the processors can be distributed.

各プロセッサが必要とする情報は、平均的にはm個のプ
ロセッサの時刻情報だけでよく、模擬実験によれば、プ
ロセッサ数が十分に大きな場合でもm=4〜10で充分
な同期精度が得られる。以上のように本発明により得ら
れる効果は大きい。
The information required by each processor is, on average, only the time information of m processors, and according to simulation experiments, even when the number of processors is sufficiently large, sufficient synchronization accuracy can be obtained with m = 4 to 10. It will be done. As described above, the effects obtained by the present invention are significant.

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

第1図および第2図は、本発明による実施例を示す流れ
図、第3図は、マルチプロセッサシステムの一例を示す
図である。 図において、101〜108、および201〜204は
制御ブロック、301〜305はプロセッサ、306〜
315はプロセッサ間の論理的な通信路を示す。
1 and 2 are flowcharts showing an embodiment of the present invention, and FIG. 3 is a diagram showing an example of a multiprocessor system. In the figure, 101 to 108 and 201 to 204 are control blocks, 301 to 305 are processors, and 306 to 204 are control blocks.
315 indicates a logical communication path between processors.

Claims (1)

【特許請求の範囲】[Claims]  n個のプロセッサからなるマルチプロセッサシステム
のクロック同期において、前記プロセッサは時刻を示す
クロックを具備し、予め定められた時刻毎に前記n個の
プロセッサの中からm個のプロセッサをランダムに選択
して、該m個のプロセッサに自己のクロックが示す値を
送信するとともに、他のプロセッサから前記クロック値
を受信した場合には、該クロック値を受信した時の自己
のクロックが示す値から前記受信したクロック値を差引
いてクロック差分を求め、前記予め定められた時刻に一
定時間を加えた時刻においては、該時刻までに求められ
た前記クロック差分の平均値を計算し、前記平均値が負
の値の場合には、自分のクロックに該平均値の絶対値を
加算し、前記平均値が正の値の場合には、自己のクロッ
クを該平均値の時間だけ停止させることを特徴とするマ
ルチプロセッサシステムにおけるクロック同期方式。
In clock synchronization of a multiprocessor system consisting of n processors, the processors are equipped with clocks that indicate time, and m processors are randomly selected from among the n processors at predetermined times. , transmits the value indicated by its own clock to the m processors, and if the clock value is received from another processor, the received value is determined from the value indicated by the own clock at the time when the clock value is received. A clock difference is obtained by subtracting the clock value, and at a time when a certain time is added to the predetermined time, the average value of the clock differences obtained up to that time is calculated, and the average value is a negative value. In this case, the multiprocessor adds the absolute value of the average value to its own clock, and when the average value is a positive value, stops its own clock for the time of the average value. Clock synchronization method in the system.
JP63099937A 1987-10-06 1988-04-21 Clock synchronizing system in multiprocessor system Pending JPH01270119A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP63099937A JPH01270119A (en) 1988-04-21 1988-04-21 Clock synchronizing system in multiprocessor system
US07/253,478 US5041966A (en) 1987-10-06 1988-10-05 Partially distributed method for clock synchronization

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63099937A JPH01270119A (en) 1988-04-21 1988-04-21 Clock synchronizing system in multiprocessor system

Publications (1)

Publication Number Publication Date
JPH01270119A true JPH01270119A (en) 1989-10-27

Family

ID=14260631

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63099937A Pending JPH01270119A (en) 1987-10-06 1988-04-21 Clock synchronizing system in multiprocessor system

Country Status (1)

Country Link
JP (1) JPH01270119A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5469840A (en) * 1991-12-10 1995-11-28 Olympus Optical, Ltd. Electromotive warping type endoscope with velocity control

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5469840A (en) * 1991-12-10 1995-11-28 Olympus Optical, Ltd. Electromotive warping type endoscope with velocity control

Similar Documents

Publication Publication Date Title
US8601165B2 (en) Method for synchronization in networks
US8169856B2 (en) Time synchronization in cluster systems
CN105680973B (en) The method for synchronizing time of free-running node in avionic device network
JP5063704B2 (en) Method, system, and computer program for facilitating synchronization of servers in an agreement timing network
Sousa et al. Optimistic total order in wide area networks
JP2000115210A (en) Distribution system
JP2010528345A (en) Method, system, and computer program for defining a tier 1 configuration in an agreement timing network
Zhang et al. Adaptive consistency strategy of multiple controllers in SDN
WO2019233403A1 (en) Synchronization information transmission method, sending end device, receiving end device and storage medium
CN108377265B (en) Real-time synchronization method for control protection distributed system in power system
US20230362854A1 (en) Method and Apparatus for Selecting Clock Source
Waldhauser et al. Time synchronization in time-sensitive networking
JPH01270119A (en) Clock synchronizing system in multiprocessor system
Li et al. A high-accuracy clock synchronization method in distributed real-time system
JPH01116862A (en) Clock synchronizing system for multiprocessor system
CN112583513A (en) Cloud platform clock time service method and system
JPH07117940B2 (en) Clock synchronization method in multiprocessor system
JPH0194467A (en) Clock synchronizing system for multiplexer system
JPH0528864B2 (en)
JPS63314669A (en) Clock synchronizing system for multi-processor system
CN108540317A (en) A kind of double-deck detection method of multiple domain SDN control node failures
JPH0528866B2 (en)
Gaderer et al. IEEE 1588 real-time networks with hybrid master group enhancements
CN112350951B (en) PTP clock and method for load bearing processing
Czechowski Dedicated communication protocols and network interfaces in time synchronization cyber security in complex distribution smart grid