JPH0528865B2 - - Google Patents

Info

Publication number
JPH0528865B2
JPH0528865B2 JP62252787A JP25278787A JPH0528865B2 JP H0528865 B2 JPH0528865 B2 JP H0528865B2 JP 62252787 A JP62252787 A JP 62252787A JP 25278787 A JP25278787 A JP 25278787A JP H0528865 B2 JPH0528865 B2 JP H0528865B2
Authority
JP
Japan
Prior art keywords
time
clock
processors
processor
control block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP62252787A
Other languages
Japanese (ja)
Other versions
JPH0194467A (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
Nippon Electric Co Ltd
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 Nippon Electric Co Ltd filed Critical Nippon Electric Co Ltd
Priority to JP62252787A priority Critical patent/JPH0194467A/en
Priority to US07/253,478 priority patent/US5041966A/en
Publication of JPH0194467A publication Critical patent/JPH0194467A/en
Publication of JPH0528865B2 publication Critical patent/JPH0528865B2/ja
Granted legal-status Critical Current

Links

Description

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

〔従来の技術〕[Conventional technology]

マルチプロセツサシステムにおいては、システ
ムを構成する各プロセツサのクロツクをシステム
全体に共通な時刻を示すように同期させることが
必要となる。例えば、分散フアイリングシステム
において、各フアイルに記録された作成および編
集時刻に基づきフアイルのバージヨンを識別する
ためには、各プロセツサ間に共通な時刻が必要と
なる。また、各プロセツサが、システムに共通な
時刻に基づき自己の履歴情報を蓄積しておけば、
障害発生時にどのような順番で障害が検出された
かを知ることができ、障害の発生箇所を特定する
ための有力な情報を得ることができる。
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 throughout the system. For example, in a distributed filing system, a common time between processors is required to identify versions of files based on the creation and editing times recorded in each file. Also, if each processor accumulates its own history information based on the time common to the system,
It is possible to know in what order the failures were detected when they occur, and useful information for identifying the location where the failure has occurred can be obtained.

共有メモリを持たないマルチプロセツサシステ
ムの一例である通信ネツトワークシステムにおい
ても、各通信ノードのクロツクが共通な時刻を示
すようにする同期方式が必要である。例えば、第
6回インターナシヨナルコンフアレンス オン
テイストリビユーテイドコンピユーテイングシス
テムの予稿集p.364−371に記載されている論文
「アン エレクシヨン アルゴリズム フオーテ
イストリビユーテイド クロツク シンクロ
ナイゼイシヨン プログラム」(文献1)で紹介
されているクロツク同期方式TEMPOは、UNIX
オペレーテイングシステム4.3BSDで動作する
ネツトワークにインプリメントされているもので
ある。
Even in a communication network system, which is an example of a multiprocessor system without a shared memory, a synchronization method is required so that the clocks of each communication node indicate a common time. For example, the 6th International Conference on
The clock synchronization method introduced in the paper ``An Erection Algorithm and Feature-Reviewed Clock Synchronization Program'' (Reference 1), which is included in the Proceedings of Taste-Reviewed Computing Systems, pages 364-371. TEMPO is UNIX
It is implemented in a network running on the 4.3BSD operating system.

上述のシステムにおいては、マスタとなる1つ
のノードが定められた時間毎にすべてのノードに
時刻の間い合せを行い、求められた各ノードの時
刻をもとに平均時刻を計算する。この後、すべて
のノードに対してクロツクの調整指示を行い、各
ノードはこの指示に従いクロツクの調整を行う。
In the above-mentioned system, one node serving as a master adjusts the time of all nodes at predetermined time intervals, and calculates an average time 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.

また、「第16回アニユアル インターナシヨナ
ルシンポジウム オン フオールトトレラントコ
ンピユーテイング」のダイジエストペイパー
p.218−223に記載されている論文「クロツク シ
ンクロナイゼイシヨン イン ザ プレゼンス
オブ フオールツ アンド プロセツサ ジヨイ
ンズ」(文献2)で紹介されているクロツク同期
方式は、上で説明した“TEMPO”のようなマス
タ・スレーブ型の制御ではなく、分散型の制御を
用いている。同方式において、プロセツサはシス
テム内で定期的に時報される同期メツセージの中
で、最も速い時刻を示す同期メツセージに従いク
ロツクの時刻合せを行なう。このため、結果とし
て最も速く進むクロツクがシステム内の時刻を支
配することになる。
In addition, the digest paper of “16th Annual International Symposium on Fault Tolerant Computing”
The paper “Clock Synchronization in the Presence” on p.218-223
The clock synchronization method introduced in "Of Faults and Processors Joints" (Reference 2) uses distributed control rather than master-slave control like "TEMPO" explained above. In this system, the processor adjusts the clock according to the synchronization message indicating the earliest time among the synchronization messages periodically transmitted within the system. As a result, the fastest running clock will control the time in the system.

さらに、「ジヤーナル オブ アソシエーシヨ
ン フオー コンピユーテイング マシナリ
ー」Vol.32,No.1,January 1985,p.52−78に
記載されている論文「シンクロナイジング クロ
ツク イン ザ プレゼンス オブ フオール
ツ」(文献3)で紹介されているクロツク同期方
式は、すべてのプロセツサが定期的に互いのプロ
セツサの時刻を通信しあう完全分散制御による同
期方式である。
Furthermore, the paper ``Synchronizing Clocks in the Presence of Faults'' (Reference 3) described in ``Journal of Association of Computing Machinery'' Vol. 32, No. 1, January 1985, p. 52-78. The clock synchronization method introduced in 2007 is a synchronization method based on completely distributed control in which all processors periodically communicate the time of each processor.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

文献1記載の同期方式においては、マスタノー
ドが必要不可欠である。このため、マスタノード
の障害時には、他のノードがマスタノードの機能
を果すように、マスタノードの代行の方法が必要
となる。また、すべてのノードのクロツクの間い
合せ等を1つのマスタノードが行うために、ノー
ドの数が増えると、マスタノードへの通信量が増
加するとともに、すべてのノードの時刻の平均を
求める作業が増大する。
In the synchronization method described in Document 1, 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 coordinates 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. increases.

これに対し、分散型の制御を採用している文献
2記載の方式では、分散型ではあるものの、最も
速いクロツクを持つ1つのプロセツサがシステム
内の時刻を支配する。しかも、プロセツサのクロ
ツクがほぼ同じ時刻を示す場合には、複数のプロ
セツサから同時に同期メツセージが送信されるこ
とになり、同期制御のための処理がある時刻に集
中してしまう問題がある。
On the other hand, in the method described in Reference 2 which employs distributed control, although it is distributed, one processor with the fastest clock controls the time within the system. Furthermore, if the clocks of the processors indicate approximately the same time, synchronization messages will be transmitted from a plurality of processors at the same time, resulting in a problem that the processing for synchronization control will be concentrated at a certain time.

また、文献3の方式は、すべてのプロセツサが
互いにすべてのプロセツサと通信を行なうため
に、実際のシステムに適用する場合に通信のオー
バヘツドが問題となる。
Furthermore, in the method of Reference 3, since all processors communicate with each other, 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" (Reference 4) described in the 1st material of the Institute of Electronics, Information and Communication Engineers' Information and Communication Network Safety and Reliability Symposium, p. 35-38, In the method described in , each processor periodically selects a plurality of processors at random and ensures synchronization based on the time of the selected processors. In the method of Reference 4, there is no need to provide a processor for centralized control, and even when the number of processors in the system increases, communication messages are not concentrated on a certain processor, and the total number of messages in the system can be reduced. It is possible to reduce the amount compared to the conventional method. However, since all processors start synchronous control at a predetermined time, if synchronization is ensured and all processors indicate approximately the same time, the message transmission for synchronous control is There is a problem in that they are concentrated at a predetermined time.

本発明の目的は、プロセツサの時刻の同期を確
保するためのメツセージが特定の時刻に集中して
送信されることのないマルチプロセツサシステム
におけるクロツク同期方式を提供することにあ
る。
SUMMARY OF THE INVENTION An object of the present invention is to provide a clock synchronization method for a multiprocessor system in which messages for ensuring time synchronization of processors are not sent concentrated at specific times.

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

本発明によれば、n個のプロセツサからなるマ
ルチプロセツサシステムのクロツク同期方式であ
り、前記プロセツサが時刻を示すクロツクを具備
し、前記n個のプロセツサの中からm個のプロセ
ツサをランダムに選択して該m個のプロセツサの
クロツク情報を読み出し、該m個のプロセツサの
時刻に基づく前記クロツクの制御を繰り返すこと
を特徴とするマルチプロセツサシステムにおける
クロツク同期方式において、前記プロセツサは、
予め定められた範囲内で任意な時間の経過を測定
できるタイマを具備し、前記クロツクが予め定め
られた時刻になると、前記タイマに前記範囲内の
ランダムな値を設定して起動するとともに、前記
タイマが前記ランダム値に対応する時間を計測し
てタイムアウトを発生した時刻に、前記ランダム
に選択されたm個のプロセツサのクロツク情報を
読み出すことを特徴とするマルチプロセツサシス
テムにおけるクロツク同期方式が得られる。
According to the present invention, there is provided a clock synchronization method for a multiprocessor system consisting of n processors, in which the processors are provided with a clock indicating time, and m processors are randomly selected from among the n processors. In a clock synchronization method in a multiprocessor system, the processor reads clock information of the m processors, and repeats control of the clock based on the time of the m processors.
A timer capable of measuring the passage of arbitrary time within a predetermined range is provided, and when the clock reaches the predetermined time, the timer is set to a random value within the range and activated, and the timer is activated. A clock synchronization method in a multiprocessor system is provided, characterized in that a timer measures the time corresponding to the random value and reads clock information of the randomly selected m processors at the time when a timeout occurs. It will be done.

〔発明の作用〕[Action of the invention]

本発明の原理について、第3図を参照して説明
する。
The principle of the present invention will be explained with reference to FIG.

第3図は、マルチプロセツサシステムの具体例
を示す図である。各プロセツサ301,302,
303,304,305は、自己の時刻を示すク
ロツクを備えている。さらに、各プロセツサは任
意のプロセツサのクロツク情報を読み出せるよ
う、相互に論理的な通信路306により接続され
ている。互いのプロセツサが共通にアクセスでき
る共有メモリを持たないマルチプロセツサシステ
ムにおいては、システムが初期状態の時に、各プ
ロセツサのクロツクは同一の時刻を示してはいな
い。しかも同じ値からスタートしたクロツクも、
凡そ同じ割合で時刻を測定するものの、時刻の経
過にともない徐々にずれて行く。従つて、各プロ
セツサは以下に説明する本同期方式に従い、メツ
セージ通信により互いにクロツクの調整を行う。
この結果、すべてのプロセツサのクロツクがある
同期精度の範囲内で同一の時刻を指すように制御
される。
FIG. 3 is a diagram showing a specific example of a multiprocessor system. Each processor 301, 302,
303, 304, and 305 are equipped with clocks that indicate their own time. Further, each processor is connected to each other by a logical communication path 306 so that clock information of any processor can be read out. 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 its initial state. Moreover, the clock started from the same value,
Although the time is measured at roughly the same rate, the time gradually deviates as time passes. Therefore, each processor adjusts 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.

本同期方式では、各プロセツサは自プロセツサ
のクロツクが予め決められた時刻になると、予め
定められた範囲内のランダムな時間経過を待つ。
この後に、システム内のn個のプロセツサの中か
らm個のプロセツサをランダムに選択し、同プロ
セツサのクロツク情報を問い合せる。さらに、こ
れら問い合せたクロツク情報に基づき自分のクロ
ツクの値を再設定する。例えば、ランダムな待合
わせ時間の範囲を10分とし、1:00,2:00,
3:00という時刻に同期制御を行なうと決められ
ているとする。プロセツサ301は自己のクロツ
クが1:00になると、10分までの範囲でランダム
な時間経過を待つ。ランダムな待ち時間に6分が
選択された場合には時刻1:06に、システム内の
5つのプロセツサの中から、ランダムに3つのプ
ロセツサを選択する。プロセツサ301がプロセ
ツサ302,303,304を選択したとする
と、通信路306を介してこれらプロセツサにク
ロツク値を問い合せるメツセージを送信する。プ
ロセツサ301は、返送される3個のプロセツサ
のクロツク値の平均値を計算し、該平均値をもと
に自分のクロツクの値を再設定する。一方、プロ
セツサ302は、時刻1:00にランダムな待ち時
間4分を選択したとすると、時刻1:04にすでに
説明した制御を行なう。各々のプロセツサは、例
えば3個のプロセツサの時刻の平均値が自分のク
ロツクの示す時刻よりもδ進んでいる場合は自分
のクロツクに該差分δを加算し、該3個のプロセ
ツサの時刻の平均値が自分のクロツクが示す時刻
よりもδ遅れている場合は、自分のクロツクをδ
停止させる。以上の操作は、すべてのプロセツサ
が自分のもつクロツクが1:00,2:00,3:00
というように予め定められた時刻になる毎に繰り
返し行なわれる。
In this synchronization method, each processor waits for a random period of time within a predetermined range to elapse when its own processor's clock reaches a predetermined time.
After this, m processors are randomly selected from among the n processors in the system, and the clock information of the processors is queried. Furthermore, it resets its own clock value based on the inquired clock information. For example, if the range of random meeting times is 10 minutes, 1:00, 2:00,
Assume that it is determined that synchronous control is to be performed at a time of 3:00. When the processor 301's clock reaches 1:00, it waits for a random period of time up to 10 minutes to elapse. If 6 minutes is selected as the random waiting time, at time 1:06, three processors are randomly selected from among the five processors in the system. If processor 301 selects processors 302, 303, and 304, it sends a message to these processors via communication path 306 inquiring about their clock values. Processor 301 calculates the average value of the returned clock values of the three processors, and resets its own clock value based on the average value. On the other hand, if the processor 302 selects a random waiting time of 4 minutes at time 1:00, it performs the control described above at time 1:04. For example, if the average value of the times of three processors is δ ahead of the time indicated by its own clock, each processor adds the difference δ to its own clock, and calculates the average of the times of the three processors. If the value is δ behind the time indicated by your clock, change your clock to δ
make it stop. The above operation requires that all processors set their own clocks to 1:00, 2:00, and 3:00.
This is repeated every predetermined time.

このようにすべてのプロセツサは、完全対等な
立場にあり、全く同一のアルゴリズムを実施す
る。この時、各プロセツサはm個のプロセツサの
クロツク情報をもとに同期制御を行なうため、従
来に比べ通信量を削減することができる。しか
も、この際にm個のプロセツサはランダムに選択
されるため、同期制御を繰り返し行なうことによ
り、システム内のすべてのプロセツサのクロツク
情報が同期制御に反映される。さらに、それぞれ
のプロセツサは、予め定められた時刻からランダ
ムな時間経過の後に、時刻の間い合せメツセージ
の送信を開始するためにメツセージの送信が特定
の時刻に集中することがなく、個々のプロセツサ
の行なう処理を分散させることができる。模擬実
験により、プロセツサのクロツクの同期範囲がn
の値には依存せず、m=2〜10で充分な同期精度
を満足するように収束することを確認した。
In this way, all processors are on a completely equal footing and implement exactly the same algorithms. At this time, since each processor performs synchronous control based on the clock information of the m processors, the amount of communication can be reduced compared to the conventional method. Moreover, since the m processors are selected at random at this time, the clock information of all the processors in the system is reflected in the synchronization control by repeating the synchronization control. Furthermore, since each processor starts sending time-aligned messages after a random lapse of time from a predetermined time, message sending does not concentrate at a specific time, and each processor processing can be distributed. A simulation experiment showed that the synchronization range of the processor clock was n
It has been confirmed that the convergence is independent of the value of m and satisfies sufficient synchronization accuracy when m = 2 to 10.

〔実施例〕〔Example〕

以下、本発明について図面を参照して説明す
る。
Hereinafter, the present invention will be explained with reference to the drawings.

第1図aおよびbに、本発明によるクロツク同
期方式を実現するアルゴリズムの第1の実施例を
示す。
FIGS. 1a and 1b show a first embodiment of an algorithm implementing the clock synchronization scheme according to the invention.

第1図aは、プロセツサが自分のクロツクが予
め定められた時刻を示した時に実行するアルゴリ
ズムであり、例えば、自己のクロツクが1:00,
2:00,3:00、というようにある定められた時
刻になる毎に実行が開始される。第1図bは、あ
るプロセツサが第1図aのアルゴリズムを実行
し、同プロセツサからのメツセージを受信した時
に、実行されるアルゴリズムを示す。なお、これ
ら2つのアルゴリズムは並列に実行されるととも
に、自分自身に対するクロツク情報の送信要求が
発生してもかまわない。
Figure 1a shows an algorithm that the processor executes when its own clock indicates a predetermined time; for example, when its own clock indicates 1:00,
Execution starts at certain predetermined times, such as 2:00 and 3:00. FIG. 1b shows the algorithm executed when a processor executes the algorithm of FIG. 1a and receives a message from the same processor. Note that these two algorithms may be executed in parallel, and a request to send clock information to itself may be generated.

プロセツサは、自分のクロツクが予め定められ
た時刻になると発生するように設定されたクロツ
クからの割込みを、第1図aに示す制御ブロツク
100において検出する。このクロツクからの割
込みの検出により、以降の同期制御アルゴリズム
が起動される。
The processor detects in control block 100 shown in FIG. 1a an interrupt from a clock that is set to occur when its own clock reaches a predetermined time. Detection of an interrupt from this clock activates the subsequent synchronous control algorithm.

すなわち、制御ブロツク101において、前記
タイマに予め定められた範囲内のランダムな値を
設定するとともに、このタイマを起動する。次
に、制御ブロツク102において前記タイマのタ
イムアウトの発生を待ち、同タイムアウトの発生
後、制御ブロツク103において、n個のプロセ
ツサの中からランダムにm個のプロセツサを選択
する。引続き制御ブロツク104ではこれらm個
のプロセツサにクロツク情報の問い合せを行なう
メツセージを送信する。
That is, the control block 101 sets the timer to a random value within a predetermined range and starts the timer. Next, the control block 102 waits for the timer to time out, and after the timeout occurs, the control block 103 randomly selects m processors from among the n processors. Subsequently, control block 104 sends a message to these m processors to inquire about clock information.

各プロセツサは、第1図bに示したアルゴリズ
ムも並列に実行しており、同図の制御ブロツク1
10では、プロセツサからのクロツク情報の送信
要求メツセージの受信時に発生する受信割込みを
検出することができる。つまり、あるプロセツサ
が第1図aの制御ブロツク104にてメツセージ
を送信すると、該メツセージを受信したプロセツ
サは第1図bの制御ブロツク110にて、受信割
込みを検出し、続いて第1図bの制御ブロツク1
11において該メツセージの送信元プロセツサに
クロツク情報を送信する。この時にプロセツサが
送信するクロツク情報は、クロツクの示す値自身
とするが、クロツク情報を要求するプロセツサが
該要求メツセージに自分の時刻を記録するものと
すると、該要求プロセツサの時刻との差分をクロ
ツク情報として送信してもかまわない。
Each processor also executes the algorithm shown in Figure 1b in parallel.
10, it is possible to detect a reception interrupt that occurs when a clock information transmission request message is received from the processor. That is, when a certain processor sends a message in control block 104 of FIG. 1a, the processor that received the message detects a reception interrupt in control block 110 of FIG. control block 1
At step 11, clock information is sent to the processor that sent the message. The clock information sent by the processor at this time is the value indicated by the clock itself, but if the processor requesting clock information records its own time in the request message, the difference between the clock and the requesting processor's time is recorded. You may send it as information.

このように、クロツク情報の送信要求メツセー
ジを送信したプロセツサは、m個のプロセツサか
らクロツク情報を受信する。続く制御ブロツク1
05においては、これらm個のプロセツサのクロ
ツク情報に基づきm個のプロセツサの平均クロツ
ク値を計算し、自プロセツサのクロツクが示す時
刻から該m個のプロセツサの平均時刻を差引き、
差分δを求める。
In this way, the processor that sent the clock information transmission request message receives clock information from m processors. Continuing control block 1
In 05, the average clock value of the m processors is calculated based on the clock information of these m processors, and the average time of the m processors is subtracted from the time indicated by the clock of the own processor.
Find the difference δ.

プロセツサは、以上のようにして求めたm個の
プロセツサの平均時刻との差分δに基づき、制御
ブロツク106以降において次に説明するように
自分のクロツクの値を設定する。
Based on the difference δ from the average time of the m processors obtained as described above, the processor sets the value of its own clock as described below in control block 106 and thereafter.

すなわち、自プロセツサのクロツクが示す時刻
が該平均時刻に等しい場合(δ=0)には、制御
ブロツク100に戻る。また、該平均時刻よりも
自分のクロツクが示す時刻が遅れている場合(δ
<0)には、制御ブロツク107において、自分
のクロツクに該差分δを加算して時刻を進めた後
に制御ブロツク100に戻る。さらに、該平均時
刻よりも自分のクロツクが示す時刻が進んでいる
場合(δ>0)には、制御ブロツク108におい
て、時間δが経過するまでクロツクを停止させ
る。このようにして時刻を遅らせた後に制御ブロ
ツク100に戻る。いずれの場合にも、制御ブロ
ツク100では、定められた時刻に発生する次の
クロツクからの割込みを検出する。
That is, if the time indicated by the own processor's clock is equal to the average time (δ=0), control returns to control block 100. Also, if the time indicated by your own clock is later than the average time (δ
<0), control block 107 adds the difference δ to its own clock to advance the time, and then returns to control block 100. Furthermore, if the time indicated by its own clock is ahead of the average time (δ>0), the control block 108 stops the clock until the time δ has elapsed. After delaying the time in this manner, control returns to block 100. In either case, control block 100 detects an interrupt from the next clock occurring at a predetermined time.

以上説明したアルゴリズムはすべてのプロセツ
サが実行する。
The algorithm described above is executed by all processors.

第2図aおよびbに、本発明によるクロツク同
期方式を実現するアルゴリズムの第2の実施例を
示す。
FIGS. 2a and 2b show a second embodiment of the algorithm implementing the clock synchronization scheme according to the invention.

マルチプロセツサシステムの一例である通信ネ
ツトワークシステムにおいては、プロセツサが互
いに他のクロツク情報を読み出す場合に、プロセ
ツサ間の通信遅延、もしくは通信処理・平均時刻
の計算に必要な時間がクロツクの時間精度に比べ
て大きくなることが考えられる。クロツクの同期
制御にこのような処理オーバヘツドによる悪影響
を与えないようにするために、次に説明するよう
なアルゴリズムを用いてクロツク情報を読み出し
たプロセツサの時刻を定義する。
In a communication network system, which is an example of a multiprocessor system, when processors read each other's clock information, there is a communication delay between the processors, or the time required for communication processing and average time calculation is affected by the time accuracy of the clock. It is possible that it will be larger than . In order to prevent the clock synchronization control from being adversely affected by such processing overhead, the processor time at which the clock information is read is defined using an algorithm as described below.

第2図aおよびbは、同アルゴリズムを示して
いる。ここに示したアルゴリズムは、すでに説明
した第1図aの制御ブロツク103,104およ
び105に相当するアルゴリズムであり、具体的
には、プロセツサをランダムに選択するととも
に、同プロセツサにクロツク情報の送信を要求す
るメツセージの送信をm回繰り返し行ない、さら
に、逐次受信されるこれらm個のプロセツサから
のクロツク情報に基づき、自プロセツサのクロツ
クが示す時刻と平均時刻との差分δを求める制御
を示している。なお、第2の実施例において、第
2図aおよびb以降の制御手順は、第1図aの制
御ブロツク107以下の手順と同一である。
Figures 2a and b illustrate the same algorithm. The algorithm shown here corresponds to the control blocks 103, 104, and 105 in FIG. This figure shows control in which the requested message is repeatedly transmitted m times, and the difference δ between the time indicated by the clock of the own processor and the average time is calculated based on the clock information sequentially received from these m processors. . In the second embodiment, the control procedures after the control block 107 in FIG. 1a are the same as those after the control block 107 in FIG. 1a.

第2図aに示す結合子200は、第1図aの制
御ブロツク102の後部に接続される。制御ブロ
ツク201において、選択すべきプロセツサの数
を計数する変数kに値0を代入し、制御ブロツク
202においてシステム内のn個のプロセツサか
らランダムにプロセツサiを選択する。続いて制
御ブロツク203において、この時に自プロセツ
サ内のクロツクが示す時刻を変数Ti,0に代入
するとともに、制御ブロツク204において、該
プロセツサiにクロツク情報の送信を要求するメ
ツセージを送信する。この後制御ブロツク205
において、ランダムに選択したプロセツサ数を計
数する変数kに1を加える。制御ブロツク206
において、変数kを値mと比較し、k<mならば
再び制御ブロツク202に戻り、k=mならば次
の処理に接続される結合子207へと続く。
The connector 200 shown in FIG. 2a is connected to the rear of the control block 102 of FIG. 1a. In control block 201, a value 0 is assigned to a variable k that counts the number of processors to be selected, and in control block 202, processor i is randomly selected from n processors in the system. Next, in control block 203, the time indicated by the clock in its own processor at this time is substituted into variable Ti,0, and in control block 204, a message is sent to request processor i to send clock information. After this, control block 205
, 1 is added to a variable k that counts the number of randomly selected processors. Control block 206
At , the variable k is compared with the value m, and if k<m, the process returns to the control block 202, and if k=m, the process continues to the connector 207 connected to the next process.

結合子207は、第2図bに示す制御ブロツク
208の前部に接続される。制御ブロツク208
では、第2図aで説明したように、m個のプロセ
ツサに対して送信したクロツク情報の要求メツセ
ージに対する応答を待つている。該要求メツセー
ジの送信時刻のばらつきおよび通信遅延のばらつ
きにより、各プロセツサからの応答の到着もまち
まちとなる。あるプロセツサiからの応答が到着
すると、制御ブロツク209において、該応答が
到着した時刻を変数ti,1に代入し、さらに制御
ブロツク210において該応答メツセージの中に
記録されたプロセツサiの時刻を変数Tiに代入
する。この後ランダムに選択し、前記要求メツセ
ージを送信したプロセツサ数を記憶した変数kか
ら1を差引き、制御ブロツク212において該変
数kの値を比較し、k>0ならば制御ブロツク2
08に戻つて他のプロセツサからの応答を待ち、
すべてのプロセツサからの応答を受信し、k=0
であるならば、制御ブロツク213を実行する。
Connector 207 is connected to the front of control block 208 shown in FIG. 2b. control block 208
Now, as explained in FIG. 2a, responses to the clock information request messages sent to m processors are awaited. Due to variations in the transmission times of the request messages and variations in communication delays, responses from each processor also arrive at different times. When a response from a processor i arrives, a control block 209 assigns the time at which the response arrived to a variable ti,1, and a control block 210 assigns the time of the processor i recorded in the response message to a variable ti,1. Assign to Ti. Thereafter, 1 is subtracted from a variable k that stores the number of processors that are randomly selected and sent the request message, and the value of the variable k is compared in control block 212. If k>0, control block 2
Return to step 08 and wait for responses from other processors.
Receive responses from all processors, k=0
If so, control block 213 is executed.

なお、メツセージの紛失等により、一定時間経
過しても、すべてのプロセツサからの応答が得ら
れない場合が生ずる。この場合、すでに得られて
いるクロツク情報をもとに制御ブロツク213を
実行してもかまわない。同制御ブロツク213で
は、プロセツサiを選択した時の時刻を示す変数
ti,0とプロセツサiからの応答が到着した時刻
を示す変数ti,1およびプロセツサiからの応答
メツセージの中に記録されたプロセツサiの時刻
を示す変数Tiをもとに、自プロセツサが時刻ti,
0の時のプロセツサiの時刻を予測し、プロセツ
サiの時刻と自プロセツサの時刻の差分δiを求め
る。つまり、プロセツサaからプロセツサiへの
メツセージの通信遅延とほぼ同時に送信されたプ
ロセツサiからプロセツサaへのメツセージの通
信遅延は等しいと仮定し、次式に従いプロセツサ
iの時刻を予測する。
Note that there may be cases where responses are not obtained from all processors even after a certain period of time has elapsed due to message loss or the like. In this case, control block 213 may be executed based on already obtained clock information. In the same control block 213, a variable indicating the time when processor i was selected.
Based on ti,0, a variable ti,1 indicating the time when the response from processor i arrived, and a variable Ti indicating the time of processor i recorded in the response message from processor i, the own processor determines the time ti. ,
The time of processor i when the time is 0 is predicted, and the difference δi between the time of processor i and the time of its own processor is determined. That is, assuming that the communication delay of a message from processor a to processor i is equal to the communication delay of a message sent from processor i to processor a almost at the same time, the time of processor i is predicted according to the following equation.

Ti−(ti,1−ti,0)/2 ……(1) 従つて自プロセツサのクロツクが示す時刻とプ
ロセツサiのクロツクが示す時刻の差分δiは次の
ように示される。
Ti-(ti, 1-ti, 0)/2 (1) Therefore, the difference δi between the time indicated by the clock of its own processor and the time indicated by the clock of processor i is expressed as follows.

δi=ti,0−{Ti−(ti,1−ti,0)/2}
……(2) 制御ブロツク214においては、このようにし
て求めたm個のδiの平均値を計算し、同値がラン
ダムに選択されたm個のプロセツサの平均時刻と
の差分δであるとする。
δi=ti,0−{Ti−(ti,1−ti,0)/2}
...(2) The control block 214 calculates the average value of the m δi obtained in this way, and assumes that the same value is the difference δ from the average time of m randomly selected processors. .

なお、結合子215は、第1図aの制御ブロツ
ク106の前部に接続される。以上のように求め
た平均時刻との差分δをもとに、すでに説明した
第1図aの制御ブロツク106以降の手順を実施
する。このアルゴリズムでは、プロセツサ間の通
信遅延を考慮してプロセツサの時刻を予測してお
り、通信遅延による影響を除くことが可能であ
る。
Note that the connector 215 is connected to the front of the control block 106 in FIG. 1a. Based on the difference δ from the average time obtained as described above, the procedures starting from control block 106 in FIG. 1A, which have already been explained, are carried out. This algorithm predicts processor time by taking into account communication delays between processors, making it possible to eliminate the effects of communication delays.

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

このように、本発明のクロツク同期方法を用い
ることにより、マルチプロセツサシステムにおい
て、集中制御を行なうプロセツサを設けることな
く、すべてのプロセツサを対等に動作させて、各
プロセツサのクロツクをある範囲内で共通な時刻
を指すように制御することができる、集中制御を
行なうプロセツサが不要であるために、特定のプ
ロセツサの障害がシステムに致命的な障害を与え
ることがなく高い信頼性が確保でき、しかも各プ
ロセツサが送信するメツセージは特定の時刻に集
中することがないため、プロセツサの処理を分散
させることが可能である。各プロセツサが必要と
する情報は、m個のプロセツサの時刻情報だけで
よく、模擬実験によれば、m=2〜10で充分な同
期精度が得られる。以上のように本発明により得
られる効果は大きい。
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 centrally controlled processor, and the clocks of each processor can be controlled within a certain range. Since there is no need for a centrally controlled processor that can be controlled to point to a common time, a failure in a particular processor will not cause a fatal failure to the system, ensuring high reliability. Since the messages sent by each processor are not concentrated at a specific time, it is possible to distribute the processing of the processors. The information required by each processor is only the time information of m processors, and according to simulation experiments, sufficient synchronization accuracy can be obtained when m=2 to 10. As described above, the effects obtained by the present invention are significant.

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

第1図a,bは、本発明による第1の実施例を
示す流れ図、第2図a,bは通信遅延を考慮した
場合の第2の実施例におけるプロセツサの時刻を
求めるためのアルゴリズムを示す図、第3図は、
マルチプロセツサシステムの一例を示す図であ
る。 100〜111,201〜214……制御ブロ
ツク、200,207,215……結合子、30
1〜305……プロセツサ、306……プロセツ
サ間の論理的な通信路。
Figures 1a and b are flowcharts showing a first embodiment of the present invention, and Figures 2a and b show an algorithm for determining processor time in the second embodiment when communication delays are taken into account. Figure 3 is
1 is a diagram showing an example of a multiprocessor system. 100-111, 201-214... Control block, 200, 207, 215... Connector, 30
1 to 305... processors, 306... logical communication path between processors.

Claims (1)

【特許請求の範囲】[Claims] 1 n個のプロセツサからなるマルチプロセツサ
システムのクロツク同期方式であり、前記プロセ
ツサが時刻を示すクロツクを具備し、前記n個の
プロセツサの中からm個のプロセツサをランダム
に選択して該m個のプロセツサのクロツク情報を
読み出し、該m個のプロセツサの時刻に基づく前
記クロツク制御を繰り返すことを特徴とするマル
チプロセツサシステムにおけるクロツク同期方式
において、前記プロセツサは、予め定められた範
囲内で任意な時間の経過を測定できるタイマを具
備し、前記クロツクが予め定められた時刻になる
と、前記タイマに前記範囲内のランダムな値を設
定して起動するとともに、前記タイマが前記ラン
ダム値に対応する時間を計測してタイムアウトを
発生した時刻に、前記ランダムに選択されたm個
のプロセツサのクロツク情報を読み出すことを特
徴とするマルチプロセツサシステムにおけるクロ
ツク同期方式。
1 This is a clock synchronization method for a multiprocessor system consisting of n processors, in which the processor is equipped with a clock that indicates the time, and m processors are randomly selected from among the n processors. In a clock synchronization method in a multiprocessor system, the clock information of the m processors is read out and the clock control based on the clock information of the m processors is repeated. A timer capable of measuring the passage of time is provided, and when the clock reaches a predetermined time, the timer is set to a random value within the range and activated, and the timer is set to a random value within the range, and the timer is set to a time corresponding to the random value. 1. A clock synchronization method in a multiprocessor system, characterized in that clock information of the m randomly selected processors is read out at a time when a timeout occurs.
JP62252787A 1987-10-06 1987-10-06 Clock synchronizing system for multiplexer system Granted JPH0194467A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP62252787A JPH0194467A (en) 1987-10-06 1987-10-06 Clock synchronizing system for multiplexer 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
JP62252787A JPH0194467A (en) 1987-10-06 1987-10-06 Clock synchronizing system for multiplexer system

Publications (2)

Publication Number Publication Date
JPH0194467A JPH0194467A (en) 1989-04-13
JPH0528865B2 true JPH0528865B2 (en) 1993-04-27

Family

ID=17242257

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62252787A Granted JPH0194467A (en) 1987-10-06 1987-10-06 Clock synchronizing system for multiplexer system

Country Status (1)

Country Link
JP (1) JPH0194467A (en)

Also Published As

Publication number Publication date
JPH0194467A (en) 1989-04-13

Similar Documents

Publication Publication Date Title
Arvind Probabilistic clock synchronization in distributed systems
US7716375B2 (en) Method for synchronization in networks
US5396613A (en) Method and system for error recovery for cascaded servers
JP3798661B2 (en) Method for processing a merge request received by a member of a group in a clustered computer system
CN111460039A (en) Relational database processing system, client, server and method
JPH06242980A (en) Synchronization system for redundancy task
Cristian et al. Agreeing on processor group membership in timed asynchronous distributed systems
JPH0528865B2 (en)
WO2004025890A1 (en) Method for dynamically switching fault tolerance schemes
JPH0528864B2 (en)
JPH0528863B2 (en)
JP6446315B2 (en) Multiplexing computer storage area matching device
JPH01270119A (en) Clock synchronizing system in multiprocessor system
Cisco Understanding Replication
JPH0528867B2 (en)
JPH07117940B2 (en) Clock synchronization method in multiprocessor system
JPH0528866B2 (en)
CN111385352A (en) Instance control method, node, terminal and distributed storage system
Kitamura et al. Development of File Management System for a Peer-to-Peer Method Server Management System
JPH09311843A (en) Client server type communication method and equipment therefor
JPS62120567A (en) Clock synchronization of decentralized processing system
JPS63213013A (en) Time point designating system for computer network system
JP2732688B2 (en) Management host switching control method
JP2716307B2 (en) Local area network system
Rao et al. Gossip-based asynchronous and robust aggregation protocol—A pessimistic approach