JPH0528864B2 - - Google Patents

Info

Publication number
JPH0528864B2
JPH0528864B2 JP62151827A JP15182787A JPH0528864B2 JP H0528864 B2 JPH0528864 B2 JP H0528864B2 JP 62151827 A JP62151827 A JP 62151827A JP 15182787 A JP15182787 A JP 15182787A JP H0528864 B2 JPH0528864 B2 JP H0528864B2
Authority
JP
Japan
Prior art keywords
clock
time
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
JP62151827A
Other languages
Japanese (ja)
Other versions
JPS63314670A (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 JP62151827A priority Critical patent/JPS63314670A/en
Publication of JPS63314670A publication Critical patent/JPS63314670A/en
Publication of JPH0528864B2 publication Critical patent/JPH0528864B2/ja
Granted legal-status Critical Current

Links

Landscapes

  • Multi Processors (AREA)

Description

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

(従来の技術) マルチプロセツサシステムにおいては、システ
ムを構成する各プロセツサのクロツクをシステム
全体に共通な時刻を示すように同期させることが
必要となる。例えば、分散フアイリングシステム
において、各フアイルに記録された作成および編
集時刻に基づきフアイルのバージヨンを識別する
ためには、各プロセツサ間に共通な時刻が必要と
なる。また、各プロセツサが、システムに共通な
時刻に基づき自己の履歴情報を蓄積しておけば、
障害発生時にどのような順番で障害が検出された
かを知ることができ、障害の発生箇所を特定する
ための有力な情報を得ることができる。
(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 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回インターナシヨナル コンフアレンス オ
ン デイストリビユーテイド コンピユーテイン
グ システム(International Conference on
DISTRIBUTED COMPUTING SYSTEMS)
の予稿集p.364−371に記載されている論文「アン
エレクシヨンアルゴリズム フオー デイスト
リビユーテイド クロツク シンクロナイゼイシ
ヨン プログラム(An Election Algorithm for
a Distributed Clock Synchronization
Program)」(文献1)で紹介されているクロツ
ク同期方式TEMPOは、UNIXオペレーテイング
システム4.3 BSDで動作するネツトワークにイン
プリメントされているものである。上述のシステ
ムにおいては、マスタとなる1つのノードが、定
められた時間毎にすべてのノードに時刻の問い合
せを行い、求められた各ノードの時刻をもとに平
均時刻を計算する。この後すべてのノードに対し
てクロツクの調整指示を行い、各ノードはこの指
示に従いクロツクの調整を行う。
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,
6th International Conference on Distributed Computing Systems
DISTRIBUTED COMPUTING SYSTEMS)
The paper “An Election Algorithm for Distributed Clocks Synchronization Program (An Election Algorithm for Distributed Clocks Synchronization Program)” is published in the proceedings of
a Distributed Clock Synchronization
The clock synchronization method TEMPO introduced in ``Program'' (Reference 1) is implemented in a network running on the UNIX operating system 4.3 BSD. In the above-mentioned system, one node serving as a master queries all nodes about the time at predetermined 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回アニユマル インターナシヨナル
シンポジウム オン フオールト トレラント
コンピユーテイング(Annual
InternationalSymposium on FAULT−
TOLERANT COMPUTING)のダイジエスト
ペーパーp.218−223に記載されている論文「クロ
ツク シンクロナイゼーシヨン インザ プレゼ
ンス オブ オミツシヨン アンド パフオーマ
ンス フオールツ,アンド プロセツサ ジヨイ
ンズ(CLOCK SYNCHRONIZATION IN
THE PRESENCE OF OMISSION AND
PERFORMANCE FAULTS,AND
PROCESSOR JOINS)」(文献2)で紹介されて
いるクロツク同期方式は、上で説明した
“TEMPO”のようにマスタ・スレーブ型の制御
ではなく分散型の制御を用いている。同方式にお
いて、プロセツサはシステム内で定期的に同報さ
れる同期メツセージの中で、最も速い時刻を示す
同期メツセージに従いクロツクの時刻合せを行な
う。このため、結果として最も速く進むクロツク
がシステム内の時刻を支配することになる。
Also, the 16th Annual International Symposium on Fault Tolerant Computing (Annual International Symposium on Fault Tolerant Computing)
International Symposium on FAULT−
The paper ``CLOCK SYNCHRONIZATION IN THE PRESENCE OF OMISSION AND PERFORMANCE FOULTS, AND PROCESSORS'' (CLOCK SYNCHRONIZATION IN
THE PRESENCE OF OMISSION AND
PERFORMANCE FAULTS, AND
The clock synchronization method introduced in ``PROCESSOR JOINS'' (Reference 2) uses distributed control rather than master-slave type 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 broadcast periodically within the system. As a result, the fastest running clock will control the time in the system.

さらに、ジヤーナル オブ アソシエーシヨン
フオー コンピユーテイング マシナリー
(Journal of Association for Computing
Machinery)Vol.32,No.1,January 1985,
p.52−78に記載されている論文「シンクロナイズ
イング クロツクス イン ザ プレズンス オ
ブ フオールツ(Synchronizing Clocks in the
Presence of Faults)」(文献3)で紹介されてい
るクロツク同期方式は、すべてのプロセツサが定
期的に互いのプロセツサの時刻を通信しあう完全
分散制御による同期方式である。
In addition, the Journal of Association for Computing Machinery
Machinery) Vol.32, No.1, January 1985,
The article “Synchronizing Clocks in the Presence of Faults” is listed on p.52-78.
The clock synchronization method introduced in "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.

(発明が解決しようとする問題点) 上述のUNIXオペレーテイングシステム 4.3
BSDのTEMPOの同期方式においては、マスタ
ノードが必要不可欠である。このため、マスタノ
ードの障害時には、他のノードがマスタノードの
機能を果すように、マスタノードの代行の方法が
必要となる。また、すべてのノードのクロツクの
問い合せ等を1つのマスタノードが行うために、
ノードの数が増えると、マスタノードへの通信量
が増加するとともに、すべてのノードの時刻の平
均を求める作業が増大する。
(Problem to be solved by the invention) UNIX operating system mentioned above 4.3
In the BSD 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. Also, 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 finding the average time of all nodes increases.

これに対し、分散型の制御を採用している文献
2記載の方式では、分散型ではあるものの、最も
速いクロツクをもつ1つのプロセツサがシステム
内の時刻を支配する結果となる。また、文献3の
方式は、すべてのプロセツサが互いにすべてのプ
ロセツサと通信を行なうために、実際のシステム
に適用する場合に通信のオーバヘツドが問題とな
る。
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, in the method of Reference 3, since all processors communicate with each other, communication overhead becomes a problem when applied to an actual system.

本発明においては、集中制御を行なうプロセツ
サを設ける必要がなく、システム内のプロセツサ
数が増加した場合にも、通信のメツセージがある
プロセツサに集中することがないとともに、シス
テム内の総メツセージ数を従来方式より削減する
ことが可能な分散型制御型のマルチプロセツサシ
ステムにおけるクロツク同期方式を提供すること
にある。
In the present invention, there is no need to provide a processor for centralized control, and even if 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 compared to the previous method. It is an object of the present invention to provide a clock synchronization method in a distributed control type multiprocessor system, which can reduce the number of clocks in a distributed control multiprocessor system.

(問題を解決するための手段) 本発明によれば、n個のプロセツサからなるマ
ルチプロセツサシステムのクロツク同期方式にお
いて、前記プロセツサは、時刻を示すクロツクを
具備し、前記クロツクが予め定められた時刻を示
す時に、前記n個のプロセツサの中からm個のプ
ロセツサをランダムに選択して該m個のプロセツ
サのクロツク情報を読み出し、該m個のプロセツ
サの時刻に基づき前記クロツクを制御することを
特徴とするマルチプロセツサシステムにおけるク
ロツク同期方式が得られる。
(Means for Solving the Problem) According to the present invention, in a clock synchronization method for a multiprocessor system consisting of n processors, the processor is provided with a clock indicating time, and the clock is a predetermined clock. When indicating the time, m processors are randomly selected from among the n processors, clock information of the m processors is read out, and the clock is controlled based on the time of the m processors. A clock synchronization method in a multiprocessor system with characteristics can be obtained.

(作用) 本発明の原理について、第3図を参照して説明
する。第3図は、マルチプロセツサシステムの具
体例を示す。各プロセツサ301,302,30
3,304,305は、自己の時刻を示すクロツ
クを備えている。さらに各プロセツサは任意のプ
ロセツサのクロツク情報を読み出せるよう、相互
に論理的な通信路306により接続されている。
互いのプロセツサが共通にアクセスできる共有メ
モリを持たないマルチプロセツサシステムにおい
ては、システムが初期状態の時に、各プロセツサ
のクロツクは同一の時刻を示してはいない、しか
も同じ値からスタートしたクロツクも、凡そ同じ
割合で時刻を測定するものの、時刻の経過にとも
ない徐々にずれて行く。従つて、各プロセツサは
以下に説明する本同期方式に従い、メツセージ通
信により互いにクロツクの調整を行う。この結
果、すべてのプロセツサのクロツクがある同期精
度の範囲内で同一の時刻を指すように制御され
る。
(Operation) The principle of the present invention will be explained with reference to FIG. FIG. 3 shows a specific example of a multiprocessor system. Each processor 301, 302, 30
3, 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, when the system is in its initial state, the clocks of each processor do not indicate the same time, and even clocks that start 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個のプ
ロセツサをランダムに選択し、同プロセツサのク
ロツク情報を問い合せる。さらに、これら問い合
せたクロツク情報に基づき自分のクロツクの値を
再設定する。例えば、プロセツサ301は自己の
クロツクが1:00,2:00,3:00、というよう
に定められた時刻になる毎に、システム内の5つ
のプロセツサの中から、ランダムにプロセツサを
選択する。プロセツサ301は、ある時、プロセ
ツサ302,302,304を選択し、通信路3
06を介してこれらプロセツサにクロツク値を問
い合せる。プロセツサ301は、得られた3個の
プロセツサのクロツク値に基づき、これらクロツ
ク値の平均値を計算し、該平均値をもとに自分の
クロツクの値を再設定する。例えば、3個のプロ
セツサの時刻の平均値が自分のクロツクの示す時
刻よりもδ進んでいる場合は自分のクロツクに該
差分δを加算し、該3個のプロセツサの時刻の平
均値が自分のクロツクが示す時刻よりもδ遅れて
いる場合は、自分のクロツクをδ停止させる。以
上の操作は、すべてのプロセツサが、自分のもつ
クロツクが予め定められた時刻になる毎に繰り返
し行う。
In this synchronization method, each processor clocks its own processor at a predetermined time.
Among the n processors in the system, m processors are randomly selected and the clock information of the processors is queried. Furthermore, it resets its own clock value based on the inquired clock information. For example, processor 301 randomly selects a processor from among the five processors in the system each time its own clock reaches a predetermined time such as 1:00, 2:00, and 3:00. At some point, processor 301 selects processors 302, 302, and 304, and
These processors are queried for their clock values via 06. Based on the obtained clock values of the three processors, processor 301 calculates the average value of these clock values, and resets its own clock value based on the average value. For example, if the average value of the times of three processors is δ ahead of the time indicated by the processor's own clock, the difference δ is added to the processor's own clock, and the average value of the times of the three processors is δ ahead of the time indicated by the own clock. If the time is δ behind the time indicated by the clock, the clock is stopped by δ. The above operations are repeated by all processors each time their own clock reaches a predetermined time.

このようにすべてのプロセツサは、完全対等な
立場にあり全く同一のアルゴリズムを実施する。
この時、各プロセツサはm個のプロセツサのクロ
ツク情報をもとに同期制御を行なうため、従来に
比べ通信量を削減することができる。しかもこの
際にm個のプロセツサはランダムに選択されるた
め、同期制御を繰り返し行なうことにより、シス
テム内のすべてのプロセツサのクロツク情報が同
期制御に反映される。模擬実験により、プロセツ
サのクロツクの同期範囲が、nの値には依存せず
m=2〜10で充分な同期精度を満足するように収
束することを確認した。
In this way, all processors are on completely equal footing and execute exactly the same algorithm.
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. Furthermore, since the m processors are selected at random at this time, the clock information of all processors in the system is reflected in the synchronization control by repeating the synchronization control. Through a simulation experiment, it was confirmed that the synchronization range of the processor clock does not depend on the value of n and converges to satisfy sufficient synchronization accuracy when m=2 to 10.

以上のように、特定のプロセツサが共通時刻を
定義し同期制御を実施することがないため、ある
プロセツサの障害がシステムに致命的な障害をも
たらすことがない。
As described above, since a specific processor does not define a common time and perform synchronous control, a failure of a certain processor will not cause a fatal failure to the system.

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

第1図aは、プロセツサが自分のクロツクが予
め定められた時刻を示した時に実行する同期制御
アルゴリズムであり、例えば、自己のクロツクが
1:00,2:00,3:00というようにある定めら
れた時刻になる毎に実行される。第1図bは、あ
るプロセツサが前記同期制御アルゴリズムを実行
し、同プロセツサからのメツセージを受信した時
に、実行されるアルゴリズムを示す。なお、これ
ら2つのアルゴリズムは並列に実行されるととも
に、自分自身に対するクロツク情報の送信要求が
発生してもかまわない。
Figure 1a shows a synchronization control algorithm that the processor executes when its own clock indicates a predetermined time; for example, when its own clock indicates 1:00, 2:00, 3:00, etc. It is executed at every set time. FIG. 1b shows the algorithm executed when a processor executes the synchronization control algorithm 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に示す制御ブロツク
101において検出する。このクロツクからの割
込みの検出により、以降の同期制御アルゴリズム
が起動される。すなわち、制御ブロツク102に
おいては、n個のプロセツサの中からランダムに
m個のプロセツサを選択し、引続き制御ブロツク
103ではこれら各プロセツサにクロツク情報の
送信を要求するメツセージを送信する。
The processor detects in control block 101 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. That is, control block 102 randomly selects m processors from n processors, and control block 103 subsequently sends a message requesting each of these processors to transmit clock information.

各プロセツサは、第1図bに示したアルゴリズ
ムも並列に実行しており、同図の制御ブロツク1
10では、プロセツサからのクロツク情報の送信
要求メツセージの受信時に発生する受信割込みが
検出することができる。つまり、あるプロセツサ
が第1図aの制御ブロツク103にてメツセージ
を送信すると、該メツセージを受信したプロセツ
サは第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 transmits a message in control block 103 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
04においては、これら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 04, 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個のプ
ロセツサの平均時刻との差分δに基づき、制御ブ
ロツク105以降において次に説明するように自
分のクロツクの値を設定する。すなわち、自プロ
セツサのクロツクが示す時刻が該平均時刻に等し
い場合(δ=0)には、制御ブロツクに101に
戻る。また、該平均時刻よりも自分のクロツクが
示す時刻が遅れている場合(δ<0)には、制御
ブロツク106において自分のクロツクに該差分
δを加算して時刻を進めた後に制御ブロツク10
1に戻る。さらに、該平均時刻よりも自分のクロ
ツクが示す時刻が進んでいる場合(δ>0)に
は、制御ブロツク107において自プロセツサ内
のタイマに該誤差δを設定し、制御ブロツク10
8において、タイマが時間δの経過を通知するま
でクロツクを停止させる。このようにして時刻を
遅らせた後に制御ブロツク101に戻る。いずれ
の場合にも制御ブロツク101では、定められた
時刻に発生する次のクロツクからの割込みを検出
する。
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 105 and thereafter. That is, if the time indicated by the own processor's clock is equal to the average time (δ=0), the process returns to control block 101. If the time indicated by the own clock is later than the average time (δ<0), the control block 106 adds the difference δ to the own clock to advance the time, and then the control block 10
Return to 1. Furthermore, if the time indicated by its own clock is ahead of the average time (δ>0), the control block 107 sets the error δ in a timer in its own processor, and the control block 10
At 8, the clock is stopped until the timer signals that time δ has elapsed. After delaying the time in this manner, control returns to control block 101. In either case, control block 101 detects an interrupt from the next clock occurring at a predetermined time.

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

(第2の実施例) 第2図aおよびbに、本発明によるクロツク同
期方式を実現するアルゴリズムの第2の実施例を
示す。
(Second Embodiment) FIGS. 2a and 2b show a second embodiment of an algorithm for implementing the clock synchronization method according to the present 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の制御ブロツク102,103およ
び104に相当するアルゴリズムであり、具体的
には、プロセツサをランダムに選択するととも
に、同プロセツサにクロツク情報の送信を要求す
るメツセージの送信をm回繰り返し行ない、さら
に逐次受信されるこれらm個のプロセツサからの
クロツク情報に基づき、自プロセツサのクロツク
が示す時刻と平均時刻との差分δを求める制御を
示している。なお、第2の実施例において、第2
図aおよびb以降の制御手順は、第1図aの制御
ブロツク105以下の手順と同一である。
Figures 2a and b illustrate the same algorithm. The algorithm shown here corresponds to the control blocks 102, 103 and 104 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 determined based on clock information sequentially received from these m processors. Note that in the second embodiment, the second
The control procedure from Figures a and b is the same as the procedure from control block 105 in Figure 1a.

第2図aに示す結合子200は、第1図aの制
御ブロツク101の後部に接続される。制御ブロ
ツク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 101 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. Thereafter, in control block 205, 1 is added to a variable k that counts the number of randomly selected processors. In the control block 206, the variable k is compared with the value m, and if k<m, the process returns to the control block 202 again, and if k=m, the process continues to the connector 207, which is 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ならば制御ブロツク20
8に戻つて他のプロセツサからの応答を待ち、す
べてのプロセツサからの応答を受信し、k=0で
あるならば、制御ブロツク213を実行する。な
お、メツセージの紛失等により一定時間経過して
もすべてのプロセツサからの応答が得られない場
合が生ずる。この場合、すでに得られているクロ
ツク情報をもとに制御ブロツク213を実行して
もかまわない。同制御ブロツク213では、プロ
セツサiを選択した時の時刻を示す変数Ti,0
とプロセツサiからの応答が到着した時刻を示す
変数Ti,1およびプロセツサiからの応答メツ
セージの中に記録されたプロセツサiの時刻を示
す変数Tiをもとに、自プロセツサが時刻Ti,0
の時のプロセツサiの時刻を予測し、プロセツサ
iの時刻と自プロセツサの時刻の差分δiを求め
る。つまり、プロセツサaからプロセツサiへの
メツセージの通信遅延とほぼ同時に送信されたプ
ロセツサiからプロセツサaへのメツセージの通
信遅延は等しいと仮定し、次式に従いプロセツサ
iの時刻を予測する。
Connector 207 is connected to the front of control block 208 shown in FIG. 2b. control block 208
Now, as explained in FIG. 2a, a response to the clock information request message sent to m processors is 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 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 20
The process returns to step 8 to wait for responses from other processors, and if responses from all processors are received and k=0, control block 213 is executed. Note that there may be cases where responses are not obtained from all the 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 Ti,0 indicating the time when processor i was selected is set.
Based on the variable Ti,1 indicating the time when the response from processor i arrived, and the variable Ti indicating the time of processor i recorded in the response message from processor i, the own processor calculates the time Ti,0.
The time of processor i at the time 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 .delta.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個のプロセツサの平均時刻と
の差分δであるとする。なお、結合子215は、
第1図aの制御ブロツク105の前部に接続され
る。以上のように求めた平均時刻との差分δをも
とに、すでに説明した第1図aの制御ブロツク1
05以降の手順を実施する。このアルゴリズムで
は、プロセツサ間の通信遅延を考慮してプロセツ
サの時刻を予測しており、通信遅延による影響を
除くことが可能である。
δi=Ti,0−{Ti−(Ti,1−Ti,0)/2}
(2) The control block 214 calculates the average value of the m δi thus obtained, and assumes that the same value is the difference δ from the average time of m randomly selected processors. Note that the connector 215 is
It is connected to the front of the control block 105 of FIG. 1a. Based on the difference δ from the average time obtained as above, control block 1 of FIG.
Perform the steps from 05 onwards. This algorithm predicts processor time by taking into account communication delays between processors, making it possible to eliminate the effects of communication delays.

(発明の効果) このように、本発明のクロツク同期方式を用い
ることにより、マルチプロセツサシステムにおい
て、集中制御を行なうプロセツサを設けることな
く、すべてのプロセツサを対等に動作させて、各
プロセツサのクロツクをある範囲内で共通な時刻
を指すように制御することができる。集中制御を
行なうプロセツサが不要であるために、特定のプ
ロセツサの障害がシステムに致命的な障害を与え
ることがなく高い信頼性が確保できる。また、各
プロセツサが必要とする情報は、m個のプロセツ
サの時刻情報だけでよく、模擬実験によれば、m
=2〜10で充分な同期精度が得られる。従つて、
すべてのプロセツサのクロツク情報を集める必要
がないため、プロセツサ数が増えた場合にも同期
制御に要する処理時間が増大することはない。し
かも、これらプロセツサは周期的にランダムに選
択されるために、すべてのプロセツサのクロツク
情報をもとにして同期制御が実施される。
(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, and each processor's clock can be synchronized. can be controlled to point to a common time within a certain range. Since there is no need for a processor that performs centralized control, a failure in a particular processor will not cause a fatal failure to the system, and high reliability can be ensured. In addition, the information required by each processor is only the time information of m processors, and according to a simulation experiment, m
= 2 to 10 provides sufficient synchronization accuracy. Therefore,
Since it is not necessary to collect clock information of all processors, the processing time required for synchronous control does not increase even when the number of processors increases. Moreover, since these processors are periodically and randomly selected, synchronization control is performed based on clock information of all processors.

以上のように本発明により得られる効果は大き
い。
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図は、
マルチプロセツサシステムの一例を示す図であ
る。 図において、101〜111、および201〜
214は制御ブロツク、200,207,215
は結合子、301〜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. In the figure, 101-111 and 201-
214 is a control block, 200, 207, 215
is a connector, 301 to 305 are processors, 306
indicates a logical communication path between processors.

Claims (1)

【特許請求の範囲】 1 n個のプロセツサからなるマルチプロセツサ
システムのクロツク同期方式において、前記プロ
セツサは、時刻を示すクロツクを具備し、前記ク
ロツクが予め定められた時刻を示す時に、前記n
個のプロセツサの中からm個のプロセツサをラン
ダムに選択して該m個のプロセツサのクロツク情
報を読み出し、該m個のプロセツサの時刻に基づ
き前記クロツクを制御することを特徴とするマル
チプロセツサシステムにおけるクロツク同期方
式。 2 前記プロセツサは、任意時間の経過を測定で
きるタイマを具備し、前記m個のクロツク情報に
基づき求められるm個のプロセツサの平均時刻
が、自分のクロツクの示す時刻よりもδ進んでい
る場合は自分のクロツクにδを加算し、該m個の
プロセツサの平均時刻が自分のクロツクの示す時
刻よりもδ遅れている場合は、前記タイマが時間
δの経過を通知するまで自分のクロツクを停止さ
せることを特徴とする特許請求の範囲第1項記載
のマルチプロセツサシステムにおけるクロツク同
期方式。
[Scope of Claims] 1. In a clock synchronization system for a multiprocessor system consisting of n processors, the processor is provided with a clock that indicates time, and when the clock indicates a predetermined time, the n
A multiprocessor system characterized in that m processors are randomly selected from among the m processors, clock information of the m processors is read out, and the clock is controlled based on the time of the m processors. clock synchronization method. 2. The processor is equipped with a timer that can measure the passage of arbitrary time, and if the average time of the m processors determined based on the m clock information is δ ahead of the time indicated by its own clock, Add δ to its own clock, and if the average time of the m processors is behind the time indicated by its own clock by δ, stop its own clock until the timer notifies that time δ has passed. A clock synchronization method in a multiprocessor system as claimed in claim 1.
JP62151827A 1987-06-17 1987-06-17 Clock synchronizing system for multi-processor system Granted JPS63314670A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62151827A JPS63314670A (en) 1987-06-17 1987-06-17 Clock synchronizing system for multi-processor system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62151827A JPS63314670A (en) 1987-06-17 1987-06-17 Clock synchronizing system for multi-processor system

Publications (2)

Publication Number Publication Date
JPS63314670A JPS63314670A (en) 1988-12-22
JPH0528864B2 true JPH0528864B2 (en) 1993-04-27

Family

ID=15527179

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62151827A Granted JPS63314670A (en) 1987-06-17 1987-06-17 Clock synchronizing system for multi-processor system

Country Status (1)

Country Link
JP (1) JPS63314670A (en)

Also Published As

Publication number Publication date
JPS63314670A (en) 1988-12-22

Similar Documents

Publication Publication Date Title
US4746920A (en) Method and apparatus for clock management
Arvind Probabilistic clock synchronization in distributed systems
US7716375B2 (en) Method for synchronization in networks
US5041966A (en) Partially distributed method for clock synchronization
US6351821B1 (en) System and method for synchronizing time across a computer cluster
US5627766A (en) Performance and status monitoring in a computer network
US5001730A (en) Clock synchronization algorithm for address independent networks
Rodrigues et al. Automatic reconfiguration for large-scale reliable storage systems
Eischer et al. Low-latency geo-replicated state machines with guaranteed writes
Cristian et al. Agreeing on processor group membership in timed asynchronous distributed systems
WO2004025890A1 (en) Method for dynamically switching fault tolerance schemes
JPH0528864B2 (en)
JPH0528863B2 (en)
Törngren A perspective to the design of distributed real-time control applications based on CAN
JPH0528865B2 (en)
Daliot et al. Self-stabilizing byzantine agreement
JPH0528867B2 (en)
JPH07117940B2 (en) Clock synchronization method in multiprocessor system
JPH01270119A (en) Clock synchronizing system in multiprocessor system
JPH0528866B2 (en)
CN112583513B (en) Cloud platform clock timing method and system
EP0223031A2 (en) Clock synchronisation in a distributed processing system
JPH07117939B2 (en) Clock synchronization method in multiprocessor system
CN114979180B (en) Data synchronization method, system and equipment
CN111049607A (en) Clock synchronization method, device and system for vehicle and storage medium