JPH0528863B2 - - Google Patents
Info
- Publication number
- JPH0528863B2 JPH0528863B2 JP62151826A JP15182687A JPH0528863B2 JP H0528863 B2 JPH0528863 B2 JP H0528863B2 JP 62151826 A JP62151826 A JP 62151826A JP 15182687 A JP15182687 A JP 15182687A JP H0528863 B2 JPH0528863 B2 JP H0528863B2
- Authority
- JP
- Japan
- Prior art keywords
- processor
- clock
- time
- processors
- 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
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)で紹介されて
いるクロツク同期方式は、上で説明した
“TENPO”のようにマスタ・スレーブ型の制御
ではなく分散型の制御を用いている。同方式にお
いて、プロセツサはシステム内で定期的に同報さ
れる同期メツセージの中で、最も速い時刻を示す
同期メツセージに従いクロツクの時刻合せを行な
う。このため、結果として最も速く進むクロツク
がシステム内の時刻を支配することになる。 Also, the 16th Annual International Symposium on Fault Tolerant Computing (Annual
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 ``TENPO'' 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のTENPOの同期方式においては、マスタノ
ードが必要不可欠である。このため、マスタノー
ドの障害時には、他のノードがマスタノードの機
能を果すように、マスタノードの代行の方法が必
要となる。また、すべてのノードのクロツクの問
い合せ等を1つのマスタノードが行うために、ノ
ードの数が増えると、マスタノードへの通信量が
増加するとともに、すべてのノードの時刻の平均
を求める作業が増大する。(Problem to be solved by the invention) UNIX operating system mentioned above 4.3
In the BSD TENPO synchronization method, a master node is essential. Therefore, in the event of a failure of the master node, a method of acting as a master node is required so that another node can perform the function of the master node. In addition, since one master node queries the clocks of all nodes, as the number of nodes increases, the amount of communication to the master node increases, and the task of calculating the average time of all nodes increases. do.
これに対し、分散型の制御を採用している文献
2記載の方式では、分散型ではあるものの、最も
速いクロツクをもつ1つのプロセツサがシステム
内の時刻を支配する結果となる。また、文献3の
方式は、すべてのプロセツサが互いにすべてのプ
ロセツサと通信を行なうために、実際のシステム
に適用する場合に通信のオーバヘツドが問題とな
る。 On the other hand, in the method described in 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 that can reduce the number of clocks compared to the previous method.
(問題を解決するための手段)
本発明によれば、n個のプロセツサからなるマ
ルチプロセツサシステムのクロツク同期方式であ
り、前記プロセツサは、時刻を示すクロツクを具
備し、前記クロツクが予め定められた時刻を示す
時に、前記n個のプロセツサの中からm個のプロ
セツサをランダムに選択して該m個のプロセツサ
のクロツク情報を読み出し、該m個のプロセツサ
の時刻に基づき前記クロツクを制御することを特
徴とするマルチプロセツサシステムにおけるクロ
ツク同期方式において、前記プロセツサは、読み
出した前記クロツる情報をともに得られる時刻
が、前記自分のクロツクの示す時刻よりも予め定
められた値以上はなれている場合には、該時刻を
使用しないことを特徴とするマルチプロセツサシ
ステムにおけるクロツク同期方式が得られる。(Means for Solving the Problem) According to the present invention, there is provided a clock synchronization method for a multiprocessor system consisting of n processors, wherein the processor is provided with a clock indicating time, and the clock is predetermined. when the time indicated by the clock is indicated, randomly selecting m processors from among the n processors, reading clock information of the m processors, and controlling the clock based on the time of the m processors. In the clock synchronization method in a multiprocessor system, the processor may read out the clock information when the time at which the clock information is obtained is different from the time indicated by the processor's own clock by a predetermined value or more. This provides a clock synchronization method in a multiprocessor system that is characterized in that the time is not used.
(作用)
本発明の原理について、第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, the clocks of each processor do not indicate the same time when the system is in its initial state. Moreover, although clocks that start from the same value measure time at roughly the same rate, they gradually shift as time passes. Therefore, each processor 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を選択し、通信路30
6を介してこれらプロセツサにクロツク値を問い
合せる。プロセツサ301は、得られた3個のプ
ロセツサのクロツク値に基づき、これらクロツク
値の平均値を計算し、該平均値をもとに自分のク
ロツクの値を再設定する。この場合に、プロセツ
サから読み出したクロツク情報により得られる同
プロセツサの時刻が、自分のクロツクの示す時刻
よりも予め定められた値以上離れている場合に
は、該クロツク情報を無視して平均値を求める。
例えば、プロセツサ301は、求めたプロセツサ
301の時刻が自分の時刻よりもある値以上離れ
ている場合には、同プロセツサのクロツク値を除
き、プロセツサ302,304のクロツク値をも
とに平均時刻を計算する。さらに、これらプロセ
ツサの時刻の平均値が自分のクロツクの示す時刻
よりもδ進んでいる場合は自分のクロツクに該差
分δを加算し、これらプロセツサの時刻の平均値
が自分のクロツクが示す時よりもδ遅れている場
合は、自分のクロツクをδ停止させる。以上の操
作は、すべてのプロセツサが、自分のもつクロツ
クが予め定められた時刻になる毎に繰り返し行
う。 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, the processor 301 selects the processors 302, 302, 304 and uses the communication path 30.
These processors are queried for their clock values via 6. 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. In this case, if the time of the processor obtained from the clock information read from the processor is more than a predetermined value away from the time indicated by its own clock, the clock information is ignored and the average value is calculated. demand.
For example, if the determined time of the processor 301 is more than a certain value away from its own time, the processor 301 removes the clock value of the same processor and calculates the average time based on the clock values of the processors 302 and 304. calculate. Furthermore, if the average value of the times of these processors is δ ahead of the time indicated by the own clock, the difference δ is added to the own clock, and the average value of the times of these processors is ahead of the time indicated by the own clock. If it is also behind by δ, its own 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, each processor performs synchronous control based on the clock information of m processors, which reduces the amount of communication compared to the conventional method, and also allows a processor to transmit abnormal clock information if it is in a failure state. Even in the case of a faulty processor, it is not affected by the faulty processor. Furthermore, since the m processors are selected at random at this time, by repeating the synchronization control, the clock information of all non-faulty processors in the system is reflected in the synchronization control. A simulation experiment has shown that the synchronization range of the processor clock is m independent of the value of n.
It was confirmed that the convergence satisfies sufficient synchronization accuracy when = 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 synchronous 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. Figure 1b is
The algorithm executed when a certain processor executes the synchronous control algorithm and receives a message from the same processor is shown. 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個のプロセツサか
らクロツク情報を受信する。制御ブロツク104
においては、これらm個のプロセツサからのクロ
ツク情報をもとに各プロセツサの時刻を求めると
ともに、自分の時刻と比較し、自分の時刻から、
予め定められた値よりも離れている時刻がないか
を調べ、自分の時刻から、予め定められた値より
も離れた値を示す時刻は、以降の処理には使用し
ない。続く制御ブロツク105においては、これ
らプロセツサのクロツク情報に基づき平均クロツ
ク値を計算するとともに、自プロセツサのクロツ
クが示す時刻から該m個のプロセツサの平均時刻
を差引き、差分δを求める。 In this way, the processor that sent the clock information transmission request message receives clock information from m processors. Control block 104
In , the time of each processor is determined based on the clock information from these m processors, and compared with the own time, and from the own time,
A check is made to see if there is a time that is farther away than a predetermined value, and a time that is farther from the user's time than the predetermined value is not used in subsequent processing. In the subsequent control block 105, an average clock value is calculated based on the clock information of these processors, and the average time of the m processors is subtracted from the time indicated by the clock of the own processor to obtain a difference δ.
プロセツサは以上のようにして求めたm個のプ
ロセツサの平均時刻との差分δに基づき、制御ブ
ロツク106以降において次に説明するように自
分のクロツクの値を設定する。すなわち、自プロ
セツサのクロツクが示す時刻が該平均時刻に等し
い場合(δ=0)には、制御ブロツクに101に
戻る。また、該平均時刻よりも自分のクロツクが
示す時刻が遅れている場合(δ<0)には、制御
ブロツク107において自分のクロツクに該差分
δを加算して時刻を進めた後に制御ブロツク10
1に戻る。さらに、該平均時刻よりも自分のクロ
ツクが示す時刻が進んでいる場合(δ>0)に
は、制御ブロツク108において自分のクロツク
を該差分δだけ停止させ時刻を遅らせた後に制御
ブロツク101に戻る。いずれの場合にも制御ブ
ロツク101では、定められた時刻に発生する次
のクロツクからの割込みを検出する。 Based on the difference .delta. from the average time of the m processors obtained as described above, the processor sets its own clock value in the following manner from control block 106 onward. 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 107 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), control block 108 stops its own clock by the difference δ, delays the time, and then 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 in comparison. 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,1
04および105に相当するアルゴリズムであ
り、具体的には、プロセツサをランダムに選択す
るとともに、同プロセツサにクロツク情報の送信
を要求するメツセージの送信をm回繰り返し行な
い、さらに逐次受信されるこれらm個のプロセツ
サからのクロツク情報に基づき、自プロセツサの
クロツクが示す時刻と平均時刻との差分δを求め
る制御を示しており、第2図aおよびb以降は、
第1図aの制御ブロツク106以下の手順と同一
である。 Figures 2a and b illustrate the same algorithm. The algorithm shown here is based on the control blocks 102, 103, 1 of FIG.
This algorithm corresponds to 04 and 105. Specifically, it randomly selects a processor, repeatedly sends a message requesting the processor to send clock information m times, and then sends a message that requests the processor to send clock information m times. This figure shows control to calculate the difference δ between the time indicated by the clock of the own processor and the average time based on the clock information from the processor of the processor.
The procedure is the same as that of control block 106 and subsequent steps in FIG. 1a.
第2図aに示す結合子200は、第1図aの制
御ブロツク101の後部に接続される。制御ブロ
ツク201において、選択すべきプロセツサの数
を計数する変数kに値Oを代入し、制御ブロツク
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 O 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, 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の時刻を予測する。プロセツサiの時刻は、
Ti−(Ti,1−Ti,0)/2 (1)
となり、従つて自プロセツサのクロツクが示す時
刻とプロセツサiのクロツクが示す時刻の差分δ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. The time of processor i is Ti - (Ti, 1 - Ti, 0)/2 (1), so the difference between the time indicated by its own processor's clock and the time indicated by processor i's clock is δi
is shown as follows.
δi=Ti,0−{Ti−(Ti,1−Ti,0)/2}
(2)
制御ブロツク214では、このようにして求めた
m個のδiの中から、予め定められた値よりも大き
なδiを除く、これは、第1図の制御ブロツク10
4と同じ効果をもち、障害状態にあるプロセツサ
から受信された異常なクロツク情報による影響を
受けないようにするためである。さらに制御ブロ
ツク215において、得られたδiの平均値を求
め、同値をランダムに選択されたm個のプロセツ
サの平均時刻との差分δとする。なお、結合子2
16は、第1図aの前部に接続され、求められた
平均時刻との差分δをもとに、すでに説明した第
1図aの制御ブロツク105以降が実施される。
このアルゴリズムでは、プロセツサ間の通信遅延
を考慮してプロセツサの時刻を予測しており、通
信遅延による影響を除くことが可能である。 δi=Ti,0−{Ti−(Ti,1−Ti,0)/2}
(2) The control block 214 removes δi larger than a predetermined value from among the m δi obtained in this way.
This has the same effect as No. 4, and is intended to prevent the clock from being affected by abnormal clock information received from a processor in a faulty state. Further, in control block 215, the average value of the obtained δi is determined, and the same value is set as the difference δ from the average time of m randomly selected processors. In addition, connector 2
16 is connected to the front part of FIG. 1a, and the already explained control block 105 and subsequent steps of FIG. 1a are executed based on the calculated difference δ from the average time.
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 the clocks of each processor 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. moreover,
The information required by each processor is only the time information of m processors, and according to a simulation experiment,
Sufficient synchronization accuracy can be obtained when m=2 to 10. 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. Furthermore, by removing values that are more than a certain value away from the own time from among the collected processor times, the processor is not affected by a processor in a faulty state. Furthermore, 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.
第1図a,bは、本発明による第1の実施例を
示す流れ図、第2図a,bは通信遅延を考慮した
場合の第2の実施例におけるプロセツサの時刻を
求めるためのアルゴリズムを示す図、第3図は、
マルチプロセツサシステムの一例を示す図であ
る。
図において、101〜111、および201〜
215は制御ブロツク、200,207,216
は結合子、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-
215 is a control block, 200, 207, 216
is a connector, 301 to 305 are processors, 306
indicates a logical communication path between processors.
Claims (1)
システムのクロツク同期方式であり、前記プロセ
ツサは、時刻を示すクロツクを具備し、前記クロ
ツクが予め定められた時刻を示す時に、前記n個
のプロセツサの中からm個のプロセツサをランダ
ムに選択して該m個のプロセツサのクロツク情報
を読み出し、該m個のプロセツサの時刻に基づき
前記クロツクを制御することを特徴とするマルチ
プロセツサシステムにおけるクロツク同期方式に
おいて、前記プロセツサは、読み出した前記クロ
ツク情報をもとに得られる時刻が、前記自分のク
ロツクの示す時刻よりも予め定められた値以上は
なれている場合には、該時刻を使用しないことを
特徴とするマルチプロセツサシステムにおけるク
ロツク同期方式。1. This is a clock synchronization method for a multiprocessor system consisting of n processors, wherein the processor is equipped with a clock that indicates time, and when the clock indicates a predetermined time, one of the n processors is synchronized. A clock synchronization method in a multiprocessor system characterized in that m processors are randomly selected, clock information of the m processors is read out, and the clock is controlled based on the time of the m processors. The processor is characterized in that if the time obtained based on the read clock information is different from the time indicated by the processor's own clock by a predetermined value or more, the processor does not use the time. Clock synchronization method in multiprocessor systems.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP62151826A JPS63314669A (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 |
|---|---|---|---|
| JP62151826A JPS63314669A (en) | 1987-06-17 | 1987-06-17 | Clock synchronizing system for multi-processor system |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS63314669A JPS63314669A (en) | 1988-12-22 |
| JPH0528863B2 true JPH0528863B2 (en) | 1993-04-27 |
Family
ID=15527159
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP62151826A Granted JPS63314669A (en) | 1987-06-17 | 1987-06-17 | Clock synchronizing system for multi-processor system |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPS63314669A (en) |
-
1987
- 1987-06-17 JP JP62151826A patent/JPS63314669A/en active Granted
Also Published As
| Publication number | Publication date |
|---|---|
| JPS63314669A (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 | |
| US8601165B2 (en) | Method for synchronization in networks | |
| US6351821B1 (en) | System and method for synchronizing time across a computer cluster | |
| Ricciardi et al. | Using process groups to implement failure detection in asynchronous environments | |
| US5041966A (en) | Partially distributed method for clock synchronization | |
| Agarwal et al. | The Totem multiple-ring ordering and topology maintenance protocol | |
| US20080052327A1 (en) | Secondary Backup Replication Technique for Clusters | |
| CN110492967A (en) | A kind of method for synchronizing time, trunking and device | |
| JPH06242980A (en) | Redundant task synchronization system | |
| Eischer et al. | Low-latency geo-replicated state machines with guaranteed writes | |
| US6745339B2 (en) | Method for dynamically switching fault tolerance schemes | |
| KR20040078113A (en) | Fault-tolerant clock synchronisation | |
| Cristian et al. | Agreeing on processor group membership in timed asynchronous distributed systems | |
| JPH0528863B2 (en) | ||
| JPH0528864B2 (en) | ||
| Törngren | A perspective to the design of distributed real-time control applications based on CAN | |
| JPH0528865B2 (en) | ||
| CN113014347A (en) | Server time synchronization method and device, computer equipment and storage medium | |
| CN109088937B (en) | Cluster authorization method and device based on unified management | |
| JPH0528867B2 (en) | ||
| Claesson et al. | An efficient TDMA start-up and restart synchronization approach for distributed embedded systems | |
| JPH07117940B2 (en) | Clock synchronization method in multiprocessor system | |
| JPH0528866B2 (en) | ||
| JPH01270119A (en) | Clock synchronizing system in multiprocessor system |