JP2017162266A - Parallel processor, parallel processing method, and program - Google Patents
Parallel processor, parallel processing method, and program Download PDFInfo
- Publication number
- JP2017162266A JP2017162266A JP2016047000A JP2016047000A JP2017162266A JP 2017162266 A JP2017162266 A JP 2017162266A JP 2016047000 A JP2016047000 A JP 2016047000A JP 2016047000 A JP2016047000 A JP 2016047000A JP 2017162266 A JP2017162266 A JP 2017162266A
- Authority
- JP
- Japan
- Prior art keywords
- thread
- communication
- inter
- processing
- parallel
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000003672 processing method Methods 0.000 title claims description 7
- 238000000034 method Methods 0.000 claims abstract description 467
- 230000006854 communication Effects 0.000 claims abstract description 431
- 238000004891 communication Methods 0.000 claims abstract description 387
- 238000012545 processing Methods 0.000 claims abstract description 364
- 230000008569 process Effects 0.000 claims abstract description 261
- 238000012546 transfer Methods 0.000 claims abstract description 100
- 230000001360 synchronised effect Effects 0.000 claims abstract description 10
- 230000002250 progressing effect Effects 0.000 claims abstract 3
- 238000003860 storage Methods 0.000 claims description 19
- 238000004590 computer program Methods 0.000 claims description 12
- 238000004364 calculation method Methods 0.000 abstract description 97
- 238000004422 calculation algorithm Methods 0.000 description 74
- 230000006870 function Effects 0.000 description 54
- 230000004888 barrier function Effects 0.000 description 42
- 238000010586 diagram Methods 0.000 description 14
- 230000009467 reduction Effects 0.000 description 7
- 230000000903 blocking effect Effects 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 6
- 238000012986 modification Methods 0.000 description 5
- 230000004048 modification Effects 0.000 description 5
- 230000000694 effects Effects 0.000 description 4
- 230000003111 delayed effect Effects 0.000 description 3
- 239000004065 semiconductor Substances 0.000 description 3
- 238000012790 confirmation Methods 0.000 description 2
- 230000010365 information processing Effects 0.000 description 2
- 241000220317 Rosa Species 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000013480 data collection Methods 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 238000009826 distribution Methods 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
Images
Landscapes
- Multi Processors (AREA)
Abstract
Description
本発明は、複数のプロセスの間で実行されるプロセス間通信と、その他の演算処理とを並列に実行する並列処理装置等に関する。 The present invention relates to a parallel processing device or the like that executes interprocess communication executed between a plurality of processes and other arithmetic processing in parallel.
HPC(High Performance Computing)の分野では、複数のコンピューティング・ノード(演算処理装置等)を用いて並列処理を実行する、並列プログラムが用いられている。係る並列プログラムは、例えば、複数のコンピューティング・ノード(以下、「計算ノード」と記載する場合がある)に対して個別にプロセスを割り当てることにより、複数のプロセスを並列に実行する。各プロセスは、相互にデータを送受信することで、実装された処理を実行する。また、各計算ノードが複数のスレッドを並列に処理可能な演算装置(例えば、マルチコアCPU(Central Processing Unit)等)を含む場合、各プロセスは、複数のスレッドを用いることで、並列処理を実行することができる。 In the field of HPC (High Performance Computing), a parallel program that executes parallel processing using a plurality of computing nodes (arithmetic processing devices or the like) is used. For example, such a parallel program executes a plurality of processes in parallel by individually allocating processes to a plurality of computing nodes (hereinafter may be referred to as “calculation nodes”). Each process performs implemented processing by transmitting and receiving data to and from each other. In addition, when each computing node includes an arithmetic device (for example, a multi-core CPU (Central Processing Unit)) that can process a plurality of threads in parallel, each process executes parallel processing by using a plurality of threads. be able to.
複数のスレッドを用いた並列処理に関する技術が、以下の各特許文献に開示されている。特許文献1は、マルチスレッド・プロセッサにおいて、スレッドの切り替え処理を高速に実行することを目的とした技術を開示する。特許文献1に開示された装置は、休止状態にあるスレッド用の命令を予め準備しておくことで、スレッドの切り替えに要する時間(特には、命令の取出しに要する時間)を短縮する。特許文献2は、プロセッサの稼働率を向上することを目的としたバリア同期方法に関する技術を開示する。特許文献2に開示された方法は、所定の個数のプロセッサがバリア同期ポイントに到達したした際、それらのプロセッサに、全プロセッサがバリア同期ポイントに到達するまで、バリア同期処理を行ったジョブとは別のジョブを実行させる。
Techniques related to parallel processing using a plurality of threads are disclosed in the following patent documents. Japanese Patent Application Laid-Open No. 2004-228561 discloses a technique aimed at executing thread switching processing at high speed in a multi-thread processor. The apparatus disclosed in
また、複数のスレッドの同期処理に関する技術が以下の各特許文献に開示されている。特許文献3は、処理の絶対量が確定している処理を並列化する場合と、処理の絶対量が確定していない処理を並列化する場合とに共通して適用可能な同期処理方法に関する技術を開示する。特許文献4は、複数のプロセッサにおいて並列に処理される複数のスレッドに対して、階層構造のグループを設定し、当該グループ毎にバリア同期処理を実行する技術を開示する。
Further, technologies relating to the synchronization processing of a plurality of threads are disclosed in the following patent documents.
並列プログラムにおいて、プロセス間通信の進行を管理する方式として、「通信スレッド方式」と、「計算スレッド方式」とが知られている。通信スレッド方式は、計算スレッドとは独立した通信スレッドが、専らプロセス間通信の進行を管理する方式である。また、計算スレッド方式は、演算処理ユニット(演算装置等)において実行される計算スレッド自身が、プロセス間通信の進行を管理する方式である。通信スレッド方式の場合、通信スレッドが独立していることから、計算処理と通信処理の進行とを並行して実行可能である。一方、通信スレッド方式には以下のような問題点がある。即ち、通信スレッド方式の場合、通信スレッドの分、計算スレッドで利用できる演算資源(演算処理ユニットの処理能力)が減少する。また、通信スレッドと計算スレッドとが演算処理ユニットを共用する場合、スレッドの切り替え(スイッチ)が生じることから、コンテキストスイッチなどのオーバーヘッドが生じる。HPCでは、多くの場合、可能な限り計算処理に演算資源を割り当てること望ましく、計算スレッド方式が用いられることが多い。計算スレッド方式は、通信スレッドを利用しないことから、通信スレッド方式で問題となる、演算資源の減少及び通信スレッドと計算スレッドとのコンテキストスイッチが発生しない。 As a method for managing the progress of inter-process communication in a parallel program, a “communication thread method” and a “calculation thread method” are known. The communication thread method is a method in which a communication thread independent of a calculation thread exclusively manages the progress of inter-process communication. The calculation thread method is a method in which a calculation thread itself executed in an arithmetic processing unit (such as an arithmetic device) manages the progress of interprocess communication. In the case of the communication thread method, since the communication thread is independent, the calculation process and the progress of the communication process can be executed in parallel. On the other hand, the communication thread method has the following problems. That is, in the case of the communication thread method, the calculation resources (processing capacity of the calculation processing unit) that can be used by the calculation thread are reduced by the communication thread. In addition, when the communication thread and the calculation thread share the arithmetic processing unit, thread switching (switching) occurs, and overhead such as context switching occurs. In HPC, in many cases, it is desirable to allocate calculation resources to calculation processing as much as possible, and a calculation thread method is often used. Since the calculation thread method does not use a communication thread, a reduction in computing resources and a context switch between the communication thread and the calculation thread, which are problems in the communication thread method, do not occur.
しかしながら、計算スレッド方式では、並列プログラムにおける計算処理の途中でプロセス間通信に関する処理が記述されていない場合、プロセス間のデータ転送に関する処理が実行されない。この場合、プロセス間のデータ転送処理が実行されるタイミングが遅延してしまう場合がある。これにより、データ転送処理と、複数のプロセスにおける計算処理とが並列に実行されない場合がある、という問題を生じる。 However, in the calculation thread method, if the process related to the interprocess communication is not described during the calculation process in the parallel program, the process related to the data transfer between the processes is not executed. In this case, the timing at which data transfer processing between processes is executed may be delayed. This causes a problem that data transfer processing and calculation processing in a plurality of processes may not be executed in parallel.
これに対して、上記特許文献1に開示された技術は、スレッドの切り替えの高速化を目的とした技術であり、特許文献2に開示された技術は、スレッドを切り替えることで演算装置の稼働率を改善することを目的とした技術である。即ち、これらの技術はいずれもスレッドの切り替えを前提としていることから、コンテキストスイッチ等のオーバーヘッド自体を完全に排除することはできない。また、これらの技術は、いずれも、計算スレッド方式に関する上記課題を解決可能な技術ではない。上記特許文献3及び特許文献4に開示された技術は、いずれも複数スレッド間の同期処理そのものを実装する技術であり、計算スレッド方式に関する上記課題を解決可能な技術ではない。
On the other hand, the technique disclosed in
本発明は、上記のような事情を鑑みてなされたものである。即ち、本発明は、並列プログラムにおける計算処理の過程で消費される演算資源を用いて、プロセス間通信処理と、計算処理とを並列に実行可能な並列処理装置等を提供することを、主たる目的の一つとする。 The present invention has been made in view of the above circumstances. That is, the main object of the present invention is to provide a parallel processing device and the like capable of executing inter-process communication processing and calculation processing in parallel using calculation resources consumed in the process of calculation processing in a parallel program. One of them.
上記の目的を達成すべく、本発明の一態様に係る並列処理装置は、並列プログラムにおける複数のプロセスの間で実行される、データ転送処理を少なくとも含むプロセス間通信を制御可能なプロセス間通信部と、上記並列プログラムの実行過程で生成された複数のスレッドのうち、第1のスレッドにおいて同期処理が実行されてから、その上記第1のスレッドと、複数の上記スレッドのうち、他の上記スレッドである1以上の第2のスレッドとが同期されるまでに、上記第1のスレッドにより上記プロセス間通信を進行するマルチスレッド制御部と、を備える。 In order to achieve the above object, a parallel processing device according to one aspect of the present invention is an interprocess communication unit capable of controlling interprocess communication including at least data transfer processing, which is executed between a plurality of processes in a parallel program. Among the plurality of threads generated in the execution process of the parallel program, the first thread and the other thread among the plurality of threads after the synchronization process is executed in the first thread. A multi-thread control unit that advances the inter-process communication by the first thread until one or more second threads are synchronized.
また、本発明の一態様に係る並列処理方法は、並列プログラムの実行に応じて、上記並列プログラムにおける複数のプロセスの間で実行される、データ転送処理を少なくとも含むプロセス間通信を制御し、上記並列プログラムの実行過程で生成された複数のスレッドうち、第1のスレッドにおいて同期処理が実行されてから、その上記第1のスレッドと、複数の上記スレッドのうち、他の上記スレッドである1以上の第2のスレッドとが同期されるまでに、上記第1のスレッドにより上記プロセス間通信を進行する。 The parallel processing method according to one aspect of the present invention controls inter-process communication including at least data transfer processing executed between a plurality of processes in the parallel program according to execution of the parallel program. Among the plurality of threads generated in the execution process of the parallel program, after the synchronization process is executed in the first thread, the first thread and one or more other threads among the plurality of threads Until the second thread is synchronized, the inter-process communication proceeds by the first thread.
また、同目的は、上記構成を有する並列処理装置、並列処理方法をコンピュータによって実現するコンピュータ・プログラム、及び、そのコンピュータ・プログラムが格納されているコンピュータ読み取り可能な記録媒体等によっても達成される。 The object is also achieved by a parallel processing device having the above configuration, a computer program that implements the parallel processing method by a computer, a computer-readable recording medium in which the computer program is stored, and the like.
本発明によれば、並列プログラムにおける計算処理の過程で消費される演算資源を用いて、プロセス間通信処理と、計算処理とを並列に実行可能である。 According to the present invention, it is possible to execute inter-process communication processing and calculation processing in parallel by using computation resources consumed in the process of calculation processing in a parallel program.
本発明の実施形態に関する説明に先立って、本発明に関する技術的な検討事項等についてより詳細に説明する。 Prior to describing the embodiment of the present invention, technical considerations and the like regarding the present invention will be described in more detail.
HPC分野のプログラミングにおいては、並列プログラムのプロセス間通信に、例えば、MPI(Message Passing Interface)等のプロセス間通信技術が用いられる。なお、以下の説明においては、具体例として、プロセス間通信がMPIを用いて実行されることを想定するが、本実施形態はこれに限定されるものではない。なお、以下において、MPIを用いたプロセス間通信を「MPI通信」と記載する場合がある。 In programming in the HPC field, inter-process communication technology such as MPI (Message Passing Interface) is used for inter-process communication of parallel programs. In the following description, as a specific example, it is assumed that inter-process communication is performed using MPI, but the present embodiment is not limited to this. In the following, inter-process communication using MPI may be referred to as “MPI communication”.
MPIの通信処理は、データ転送要求の発行処理、データ転送処理、データ転送の完了処理から構成される。データ転送要求の発行処理は、CPUコアがIO(Input/Output)デバイスに通信の開始を要求する処理である。データ転送処理は、IOデバイスがデータを転送する処理である。データ転送の完了処理は、CPUコアが、IOデバイスのデータ転送の完了を確認又は待ち合せる処理である。ここで、CPUコアは、例えば、1以上のスレッドに関する処理を実行可能な演算処理ユニットである。例えば、1つのCPUには1以上のCPUコアが含まれてもよい。1つのCPUは、例えば、CPUコア数又はそれ以上のスレッドを並列に処理可能であってもよい。 The MPI communication process includes a data transfer request issue process, a data transfer process, and a data transfer completion process. The data transfer request issuance process is a process in which the CPU core requests an IO (Input / Output) device to start communication. The data transfer process is a process in which the IO device transfers data. The data transfer completion process is a process in which the CPU core confirms or waits for the completion of the data transfer of the IO device. Here, the CPU core is an arithmetic processing unit capable of executing processing related to one or more threads, for example. For example, one CPU may include one or more CPU cores. For example, one CPU may be capable of processing a thread having a number of CPU cores or more in parallel.
MPIの通信方式は、ブロッキング通信と非ブロッキング通信とに分類することができる。ブロッキング通信の場合、CPUコアは、例えば、データ転送要求の発行処理を実行した後、続けてデータ転送の完了処理を行い、IOデバイスによるデータ転送処理が完了するのを待ち合せる。その後、CPUコアは、プロセス間通信以外の演算処理を実行する。 The MPI communication method can be classified into blocking communication and non-blocking communication. In the case of blocking communication, for example, after executing a data transfer request issuance process, the CPU core performs a data transfer completion process and waits for the data transfer process by the IO device to be completed. Thereafter, the CPU core executes arithmetic processing other than inter-process communication.
非ブロッキング通信の場合、CPUコアは、データ転送要求の発行処理を実行した後、データ転送の完了処理を実行せずに計算処理を実行する。その後、CPUコアは適切なタイミングでデータ転送の完了処理を実行する。非ブロッキング通信の場合、CPUコアによる計算処理と、IOデバイスによるデータ転送処理とが並列に実行されることから、プログラム全体の実行時間が短縮される。 In the case of non-blocking communication, the CPU core executes a calculation process without executing a data transfer completion process after executing a data transfer request issuance process. Thereafter, the CPU core executes a data transfer completion process at an appropriate timing. In the case of non-blocking communication, since the calculation process by the CPU core and the data transfer process by the IO device are executed in parallel, the execution time of the entire program is shortened.
また、MPIの通信方式は、通信対象の数の観点から、一対一通信と集団通信とに分類することができる。一対一通信は、二つのプロセス間でデータを送信又は受信するMPI通信である。集団通信は二つ以上のプロセス集団(複数のプロセスから構成される集合)において、データの収集、配布、交換、リダクション演算などを行うMPI通信である。集団通信は、例えば、一対一通信を組合せることで実現されてもよい。 In addition, the MPI communication method can be classified into one-to-one communication and collective communication from the viewpoint of the number of communication objects. One-to-one communication is MPI communication that transmits or receives data between two processes. Collective communication is MPI communication that performs data collection, distribution, exchange, reduction operation, and the like in two or more process groups (a group composed of a plurality of processes). Collective communication may be realized, for example, by combining one-to-one communication.
MPIにおいては、例えば、MPI_Iallreduce関数という非ブロッキングの集団通信関数が提供されている。この関数は、あるプロセス集団にリダクション演算を実行させ、その結果を全プロセスに返却する関数である。なお、リダクション演算は、ある特定数の要素からなるデータ集合に対して特定の演算を施すことで、特定数よりも少数の要素からなる演算結果集合を求める演算である。具体的には、リダクション演算は、例えば、複数の入力データから1つの出力データを求める演算である。具体例を用いて説明する。並列プログラムが8個プロセスを用いて実行され、各プロセスが”0”から”7”の値を一つずつ持ち合っている場合を想定する。係る並列プログラムにおいて、MPI_Iallreduce関数を用いて総和を計算するリダクション演算が実行されると、8個のプロセス全てに23(”0”から”7”の総和の結果)が返却される。MPI_Iallreuce関数を実現可能な単純な通信アルゴリズムとしては、各プロセスが他の全プロセスとデータを送受信した後でリダクション演算を行う方法が考えられる。この場合の通信回数は、”O(N^2)(N:プロセス数)”のオーダになる。即ち、通信回数がプロセス数の2乗に比例して増大することから、プロセスの数が増加すると、プロセス間通信に要する処理負荷が増大する。 In MPI, for example, a non-blocking collective communication function called MPI_Iallreduce function is provided. This function is a function that causes a certain process group to perform a reduction operation and returns the result to all processes. The reduction operation is an operation for obtaining an operation result set including a smaller number of elements than a specific number by performing a specific operation on a data set including a specific number of elements. Specifically, the reduction operation is an operation for obtaining one output data from a plurality of input data, for example. This will be described using a specific example. Assume that a parallel program is executed using eight processes, and each process has a value of “0” to “7” one by one. In such a parallel program, when a reduction operation for calculating the sum using the MPI_Iallreduce function is executed, 23 (the result of the sum from “0” to “7”) is returned to all eight processes. As a simple communication algorithm capable of realizing the MPI_Iallreuce function, a method of performing a reduction operation after each process transmits / receives data to / from all other processes can be considered. The number of communications in this case is on the order of “O (N ^ 2) (N: number of processes)”. That is, since the number of communication increases in proportion to the square of the number of processes, when the number of processes increases, the processing load required for inter-process communication increases.
一般的に、プロセス間通信を高速化するために、より効率的な通信アルゴリズムが用いられる。そのようなアルゴリズムの一つに、バタフライ方式がある。バタフライ方式は、通信を段階(ラウンド)に分ける。換言すると、バタフライ方式においては、複数の段階(ラウンド)の通信処理が実行される。各ラウンドにおいては、各プロセスは、前のラウンドまでに演算した途中結果を、他の所定のプロセスとの間で送受信する。 In general, more efficient communication algorithms are used to speed up interprocess communication. One such algorithm is the butterfly method. The butterfly method divides communication into stages. In other words, in the butterfly method, a plurality of stages (rounds) of communication processing are executed. In each round, each process transmits / receives an intermediate result calculated up to the previous round to / from another predetermined process.
図1は、バタフライ方式を採用した場合に、プロセス「0」が保持する値の遷移を示している。プロセス「0」は最初に値”0”を持っている。ラウンド1では、プロセス「0」は、プロセス「4」から値”4”を受信する。プロセス「0」は受信した値を、自身が保持する値”0”と演算(この場合は加算)し、値”4”を得る。ラウンド2では、プロセス「0」は、プロセス「2」から値”8”を受信し、自身が保持する値”4”と演算して値”12”を得る。ここで、プロセス「2」から受信する値”8”は、プロセス2がラウンド1までに演算した途中結果である。最後に、プロセス「0」は、ラウンド3で、プロセス「1」から値”11”を受信し、自身が保持する値”12”と演算することで、値”23”を得る。値”11”は、プロセス「1」がラウンド2までに演算した途中結果である。最終的に得られた値”23”がMPI_Iallreduce関数の結果である。
FIG. 1 shows transition of values held by the process “0” when the butterfly method is employed. Process “0” initially has the value “0”. In
バタフライ方式の場合、各プロセスが演算の途中結果を送受信することにより、通信回数がO(N×log(N))(N:プロセス数)のオーダにまで削減される。しかしながら、バラフライ方式は、演算の途中結果を送受信することから、前のラウンドが完了していないと、その次のラウンドを開始することができない。即ち、バタフライ方式のような通信アルゴリズムは、演算処理の途中結果を送受信することで通信回数を削減するが、これにより、通信に順序関係が発生する。このため、各プロセスは、係る順序関係に従って通信処理を順番に繰り返す必要がある。以下、順序関係に従った通信処理の実行を、「通信処理の進行」(又は「プロセス間通信処理の進行」)と記載する場合がある。通信処理の進行は、例えば、通信スレッド方式と計算スレッド方式とのいずれかを用いて行われる。 In the case of the butterfly method, each process transmits and receives an intermediate result of an operation, so that the number of communication is reduced to the order of O (N × log (N)) (N: number of processes). However, since the rose fly method transmits and receives a result in the middle of an operation, the next round cannot be started unless the previous round is completed. That is, a communication algorithm such as the butterfly method reduces the number of times of communication by transmitting and receiving intermediate results of arithmetic processing, but this causes an order relationship in communication. For this reason, each process needs to repeat communication processing in order according to the order relation. Hereinafter, execution of communication processing in accordance with the order relationship may be referred to as “progress of communication processing” (or “progress of inter-process communication processing”). The progress of the communication process is performed using, for example, either a communication thread method or a calculation thread method.
以下、通信スレッド方式を採用した場合の通信処理の進行について概要を説明する。通信スレッド方式を採用した場合、各プロセスは、計算スレッドとは独立した通信スレッドを用いて通信処理の進行を実行する。計算スレッドは、並列プログラムに記述されたMPIライブラリ関数の一つであるMPI通信開始関数を実行し、通信スレッドに通信処理を依頼する。そして、計算スレッドは、通信処理以外の計算処理を開始する。係る計算スレッドにおける計算処理と並行して、通信スレッド及びIOデバイスは、データ転送要求の発行処理、データ転送処理、データ転送の完了処理、次のデータ転送要求の発行処理等、通信処理を繰り返し実行する。計算スレッドは、計算処理を実行した後、並列プログラムに記述されたMPI通信完了関数を実行し、通信スレッドによるデータ転送の完了処理の終了を待ち合せる。 Hereinafter, an overview of the progress of communication processing when the communication thread method is adopted will be described. When the communication thread method is adopted, each process executes the progress of communication processing using a communication thread independent of the calculation thread. The calculation thread executes an MPI communication start function that is one of MPI library functions described in the parallel program, and requests communication processing from the communication thread. Then, the calculation thread starts calculation processing other than communication processing. In parallel with the calculation processing in the calculation thread, the communication thread and the IO device repeatedly execute communication processing such as data transfer request issue processing, data transfer processing, data transfer completion processing, and next data transfer request issue processing. To do. After executing the calculation process, the calculation thread executes the MPI communication completion function described in the parallel program, and waits for the completion of the data transfer completion process by the communication thread.
通信スレッド方式は、通信スレッドが計算スレッドとは独立していることから、計算処理と、通信処理の進行とが並行して実行される。一方、通信スレッド方式の場合、通信スレッドの分、計算スレッドが利用可能なCPUコアの演算能力が減少する、という問題がある。また、通信スレッドと計算スレッドとがCPUコアを共用する場合、スレッドを切り替える際に、コンテキストスイッチなどのオーバーヘッドが生じる、という問題がある。例えば、スレッド切り替えを高速化することにより、通信スレッド本方式に関する上記問題を緩和することが考えられるが、コンテキストスイッチ自体はなくならないことから、その効果は限定的である。 In the communication thread method, since the communication thread is independent of the calculation thread, the calculation process and the progress of the communication process are executed in parallel. On the other hand, in the case of the communication thread method, there is a problem that the calculation capability of the CPU core that can use the calculation thread is reduced by the communication thread. Further, when a communication thread and a calculation thread share a CPU core, there is a problem that an overhead such as a context switch occurs when switching threads. For example, it may be possible to alleviate the above-described problem related to the communication thread main method by speeding up thread switching, but the effect is limited because the context switch itself is not lost.
HPCでは、計算処理に対してCPUコアの処理能力を可能な限り多く割り当てることが望ましく、計算スレッド方式が多く用いられる。以下、計算スレッド方式の概要について説明する。計算スレッド方式は、CPUコアで実行される計算スレッド自身が通信処理を進行する方式である。計算スレッドは、並列プログラムに記述されたMPI通信開始関数を実行する。そして、計算スレッドは、データ転送要求の発行処理を実行し、計算処理を開始する。要求を受け取ったIOデバイスは、計算スレッドの計算処理と並行して、データ転送処理を実行する。計算スレッドは、例えば、計算処理の途中で、並列プログラムに記述されたMPI関数(MPIにおいて定義されたAPI)を実行し、その過程において、先に要求したデータ転送の完了処理と、次のデータ転送要求の発行処理とを実行する。計算スレッドは、計算処理の後、並列プログラムに記述されたMPI通信完了関数を実行し、データ転送の完了処理が終了するのを待ち合せる。 In HPC, it is desirable to allocate as much processing capacity of the CPU core as possible to calculation processing, and a calculation thread method is often used. The outline of the calculation thread method will be described below. The calculation thread method is a method in which a calculation thread itself executed by a CPU core advances communication processing. The calculation thread executes an MPI communication start function described in the parallel program. Then, the calculation thread executes a data transfer request issuance process and starts the calculation process. The IO device that has received the request executes data transfer processing in parallel with the calculation processing of the calculation thread. For example, the calculation thread executes an MPI function (API defined in MPI) described in the parallel program in the middle of the calculation process, and in the process, completes the data transfer completion process requested earlier and the next data. Transfer request issuance processing is executed. After the calculation process, the calculation thread executes the MPI communication completion function described in the parallel program, and waits for the completion of the data transfer completion process.
計算スレッド方式は、通信スレッドを利用しないことから、通信スレッド方式を採用した場合に発生する問題を解消可能である。即ち、計算スレッド方式を採用した場合、計算スレッドが利用可能なCPUコアの演算能力が、通信スレッドの分、減少するという問題は発生しない。また、計算スレッドと、通信スレッドとの切り替えが不要であることから、スレッドの切り替えに伴うコンテキストスイッチが発生しない。 Since the calculation thread method does not use a communication thread, the problem that occurs when the communication thread method is adopted can be solved. In other words, when the calculation thread method is adopted, there is no problem that the calculation capability of the CPU core that can use the calculation thread is reduced by the communication thread. In addition, since there is no need to switch between a calculation thread and a communication thread, no context switch occurs due to thread switching.
しかしながら、計算スレッド方式では、計算処理の途中にMPI関数の実行が記述されていない場合、MPI関数が実行されない。即ち、開発者等が並列プログラムを作成する際に、計算処理の途中にMPI関数を記述していない場合、計算処理の途中ではMPI関数が実行されない。この場合、計算処理の途中では、データ転送の完了処理と後続のデータ転送要求の発行処理とが実行されない。これにより、データ転送の完了処理と後続のデータ転送要求の発行処理とが、例えば、MPI通信完了関数が実行されるまで遅延してしまい、これに続く後続のデータ転送処理と計算処理とが並列に実行されない可能性がある。 However, in the calculation thread method, if the execution of the MPI function is not described during the calculation process, the MPI function is not executed. That is, when a developer or the like creates a parallel program and the MPI function is not described during the calculation process, the MPI function is not executed during the calculation process. In this case, during the calculation process, the data transfer completion process and the subsequent data transfer request issue process are not executed. As a result, the data transfer completion process and the subsequent data transfer request issuance process are delayed until, for example, the MPI communication completion function is executed, and the subsequent data transfer process and the calculation process are paralleled. May not be executed.
上記のような現象を図2、図3に示す具体例を参照して説明する。図2は、並列プログラムのプログラムコードの一例である。”para1()”、”para2()”における計算処理は計算ノードにおける1以上のCPUコアを用いて、マルチスレッドで実行される。即ち、係る並列プログラムは、マルチスレッドプログラムであることを想定する。”para1()”完了時、”para2()”完了時に、スレッド間でバリア同期が実行される。 The above phenomenon will be described with reference to specific examples shown in FIGS. FIG. 2 is an example of the program code of the parallel program. The calculation processing in “para1 ()” and “para2 ()” is executed in a multi-thread using one or more CPU cores in the calculation node. That is, it is assumed that the parallel program is a multithread program. Barrier synchronization is executed between threads when “para1 ()” is completed and when “para2 ()” is completed.
”para1()”、”para2()”における計算処理が実行される前でMPI_Iallreduce関数によりプロセス間通信を開始し、計算処理が実行された後でMPI_Wait関数によりプロセス通信の完了を待ち合せる。係るプロセス間通信は、異なる計算ノードで実行されるプロセスの間で実行される。即ち、係る並列プログラムは、複数の計算ノードにおいて並列にプロセスが実行される、マルチプロセスプログラムであることを想定する。 Inter-process communication is started by the MPI_Illreduce function before the calculation process in “para1 ()” and “para2 ()” is executed, and the completion of the process communication is waited by the MPI_Wait function after the calculation process is executed. Such inter-process communication is executed between processes executed in different calculation nodes. That is, the parallel program is assumed to be a multi-process program in which processes are executed in parallel on a plurality of calculation nodes.
ここで、”para1()”、”para2()”の実装コードの途中には、MPI関数の呼び出しが実装されていないことを想定する。即ち、”para1()”、”para2()”の途中には、MPI関数の呼び出しが記述されていないことから、MPI関数が実行されない。 Here, it is assumed that the MPI function call is not implemented in the middle of the implementation code of “para1 ()” and “para2 ()”. That is, since the MPI function call is not described in the middle of “para1 ()” and “para2 ()”, the MPI function is not executed.
図3は、図2のプログラムコードを、4個のCPUコア(図3における”Core 0”乃至”Core 3”)を用いて実行した場合のタイムラインチャートである。”para1()”、”para2()”は、CPUコア4個を使用して、4スレッドで実行される。仮に、MPI_Iallreduce関数が3ラウンドで構成されていることを想定する。この場合、MPI_Iallreduce関数が実行されると、ラウンド1のデータ転送要求の発行処理が実行される。その後、”para1()”、”para2()”の計算処理が開始される。ラウンド1のデータ転送処理は、”para1()”、”para2()”の計算処理と並列に実行される。一方、”para1()”、”para2()”の計算処理の途中でMPI関数が実行されないことから、MPI_Wait関数が実行されるまで、ラウンド1のデータ転送の完了処理が実行されない。これにより、ラウンド2のデータ転送要求の発行処理が実行されない。その結果、ラウンド2、ラウンド3のデータ転送処理が、”para1()”、”para2()”の計算処理の後まで遅延してしまい、計算処理と並列に実行されない。
FIG. 3 is a timeline chart when the program code of FIG. 2 is executed using four CPU cores (“
これに対して、本発明に係る以下の各実施形態における並列処理装置は、上記のような問題を解決可能な技術を提供する。以下の各実施形態における並列処理装置は、一例として、並列プログラムにおいてスレッドの同期処理が実行される際に、プロセス間通信を進行させることが可能である。スレッドの同期待ち時間にCPUコアの演算資源を利用することで、通信処理と計算処理とを並列に実行し、プログラム全体の実行時間を短縮することが可能である。 On the other hand, the parallel processing device in each of the following embodiments according to the present invention provides a technique capable of solving the above-described problems. As an example, the parallel processing device in each of the following embodiments can advance interprocess communication when thread synchronization processing is executed in a parallel program. By using the computation resources of the CPU core for the thread synchronization waiting time, it is possible to execute the communication process and the calculation process in parallel to reduce the execution time of the entire program.
<第1の実施形態>
以下、本発明の基本的な実施形態である第1の実施形態について図面を参照して説明する。
<First Embodiment>
Hereinafter, a first embodiment, which is a basic embodiment of the present invention, will be described with reference to the drawings.
図4Aに例示するように、本実施形態における並列処理装置100は、プロセス間通信部101と、マルチスレッド制御部102と、を含む。並列処理装置100を構成するこれらの構成要素の間は、適切な通信方法を用いて通信可能に接続されている。
As illustrated in FIG. 4A, the
本実施形態における並列処理装置100は、並列プログラムを実行可能な情報処理装置(計算ノード)であってもよい。並列処理装置100は、例えば、複数のスレッドを並列処理可能な演算処理装置(例えば、マルチコアCPU等)と、メモリと、を少なくとも備える。並列処理装置100は、複数の演算処理ユニットを備えてもよい。係る演算処理装置は、例えば、演算処理を実行可能な演算処理ユニット(例えば、CPUコア)を複数備えてもよい。係る演算処理ユニットは、例えば、1以上のスレッドを並列に実行可能であってもよい。なお、メモリには、並列プログラム及び当該並列プログラムの実行に必要なデータが保持されてもよい。
The
並列プログラムは、1以上のスレッドにより並列に実行可能な処理を含むプロセスを1以上含んでもよい。具体的には、並列プログラムが実行された際、1以上のプロセスが生成される。プロセスが複数生成された場合、各プロセスは、例えば、演算処理装置のうちのいずれかに割り当てられてもよい。なお、並列プログラムの実行過程において生成されたプロセスは、一つの並列処理装置100に含まれる複数の演算処理装置に割り当てられてもよく、複数の並列処理装置100に割り当てられてもよい。それぞれのプロセスは、割り当てられた演算処理装置を用いて、並列プログラムに実装された処理を実行してもよい。
The parallel program may include one or more processes including processes that can be executed in parallel by one or more threads. Specifically, when a parallel program is executed, one or more processes are generated. When a plurality of processes are generated, each process may be assigned to any of the arithmetic processing devices, for example. It should be noted that the processes generated in the execution process of the parallel program may be assigned to a plurality of arithmetic processing devices included in one
並列プログラムは、その実行過程において(具体的には、各プロセスの実行過程において)、1以上のスレッドを生成してもよい。複数のスレッドが生成された場合、それらは、演算処理装置において並列に実行可能である。 The parallel program may generate one or more threads in the execution process (specifically, in the execution process of each process). When a plurality of threads are generated, they can be executed in parallel in the arithmetic processing unit.
プロセス間通信部101は、並列プログラムにおける複数のプロセスの間で実行される、データの転送処理を少なくとも含むプロセス間通信を制御する。具体的には、プロセス間通信部101は、例えば、ある演算処理装置(第1の演算処理装置と記載する)において実行されるプロセスと、他の演算処理装置(第2の演算処理装置と記載する)において実行されるプロセスとの間のデータの送受信等に関するプロセス間通信の進行を制御可能である。この場合、第1の演算処理装置と、第2の演算処理装置とは、同じ計算ノードに存在してもよく、異なる計算ノードに存在してもよい。
The
プロセス間通信部101は、例えば、複数のプロセスの間における、データ転送要求の発行処理(データ転送の開始処理)、データ転送処理、データ転送の完了処理等を処理してもよい。プロセス間通信部101は、例えば、ある順序関係に従って、上記したようなプロセス間通信におけるデータ転送処理を進行させてもよい。
The
上記説明したプロセス間通信部101は、MPIを用いてプロセス間通信処理を実行してもよい。また、係るプロセス間通信部101は、例えば、MPIを拡張することにより実現されてもよい。係るプロセス間通信部101は、MPIに限定されず、他の適切なプロセス間通信技術を使用あるいは拡張することで実現されてもよい。
The
マルチスレッド制御部102は、並列処理装置100において並列プログラムが実行された際、当該並列プログラムにより生成されるスレッドによるプロセス間通信に関する処理を制御する。例えば、マルチスレッド制御部102は、あるスレッド(第1のスレッドと記載する)において同期処理が実行されてから、当該第1のスレッドと、他のスレッド(第2のスレッドと記載する)とが同期されるまでに、当該第1のスレッドにより、プロセス間通信を進行する。マルチスレッド制御部102は、例えば、上記第1のスレッドにより、プロセス間通信部101を用いて(プロセス間通信部101が提供する機能を使用して)、プロセス間通信に関する処理を実行してもよい。
When a parallel program is executed in the
マルチスレッド制御部102は、例えば、第1のスレッドにおいて同期処理(例えば、バリア同期処理)が実行された際、他に実行されている全ての第2のスレッドが同期処理を実行済みか否か(同期待ち状態か否か)を確認してもよい。そして、他に同期処理を実行していない第2のスレッドが存在する場合、当該第2のスレッドが同期処理を実行するまで、第1のスレッドが、プロセス間通信部101の機能を用いてプロセス間通信処理を実行するよう、第1のスレッドを制御してもよい。
For example, when the synchronization processing (for example, barrier synchronization processing) is executed in the first thread, the
上記説明したマルチスレッド制御部102は、例えば、OpenMPを用いてスレッド間の並列処理を実行してもよい。また、係るマルチスレッド制御部102は、例えば、OpenMPを拡張することにより実現されてもよい。係るマルチスレッド制御部102は、OpenMPに限定されず、他の適切な並列処理技術を使用あるいは拡張することで実現されてもよい。
The
上記のように構成された並列処理装置100は、第1のスレッドが、並列に実行される第2のスレッドの同期を待つ間に、演算処理装置の演算資源を用いてプロセス間通信を進行することが可能である。これにより、並列プログラムの実行時間が短縮される。
The
また、並列処理装置100は、第1のスレッドが実行する計算処理の途中に、プロセス願通信処理が明示的には実装されていない場合であっても計算処理の途中でプロセス間通信処理を進行することができる。なぜならば、第1のスレッドが同期処理を実行した際に、当該第1のスレッドがプロセス間通信処理を実行するよう制御するからである。これにより、並列処理装置100は、並列処理プログラムの計算処理の途中に明示的にプロセス間通信処理を記載することなく、プロセス間通信処理と、計算処理とを並列に実行可能である。並列処理装置100は、プロセス間通信用の、独立した通信スレッドを生成することなく、プロセス間通信処理と、計算処理とを並列に実行可能である。以上より、本実施形態における並列処理装置100によれば、並列プログラムにおける計算処理の過程で消費される演算資源を用いて、プロセス間通信処理と、計算処理とを並列に実行可能である。
Further, the
<第2の実施形態>
上記第1の実施形態を基礎とする、本発明の第2の実施形態について図面を参照して詳細に説明する。
<Second Embodiment>
A second embodiment of the present invention based on the first embodiment will be described in detail with reference to the drawings.
[構成]
図4Bは本実施形態における並列処理装置400の機能的な構成を例示するブロック図である。
[Constitution]
FIG. 4B is a block diagram illustrating a functional configuration of the
本発明は、大別して、プロセス間通信部200と、マルチスレッド制御部300とから構成される。
The present invention is roughly composed of an
プロセス間通信部200は、通信開始処理部201と、通信完了処理部202と通信処理管理部203と、通信処理記録部204とを含む。
The
プロセス間通信部200は、複数のプロセスの間のプロセス間通信に関する処理を実行する。通信開始処理部201は、プロセス間通信処理を開始する機能を提供する。通信完了処理部202は、プロセス間通信を終了する機能を提供する。通信処理管理部203は、プロセス間通信におけるデータ転送処理を制御する機能を提供する。通信処理記録部204は、プロセス間通信に関する情報を保持する。
The
マルチスレッド制御部300はバリア同期処理部301と、同期待ちスレッド記録部302とを含む。バリア同期処理部301は、複数のスレッドの間の同期(バリア同期)処理を実行する機能を提供する。同期待ちスレッド記録部302は、同期待ち状態にあるスレッドに関する情報を保持する。同期待ちスレッド記録部302は、同期待ち状態にあるスレッドの数(あるいは、同期待ち状態にないスレッドの数)を表す情報を保持してもよい。
The
図5Aは、通信処理管理部203が実行する通信処理を実現可能な通信アルゴリズムを表すプログラム(疑似コード)の一例である。以下、図5Aに例示するプログラムにより表される通信アルゴリズムを、単に「通信アルゴリズム」と記載する。図5Bは、通信処理管理部203が実行する通信処理を表すフローチャートであり、通信アルゴリズムの処理を表す。
FIG. 5A is an example of a program (pseudo code) representing a communication algorithm capable of realizing the communication process executed by the communication
通信アルゴリズムにおいては、データ転送要求の発行処理とデータ転送の完了処理とが必要なラウンド数分繰り返される。図5Aに示す具体例の場合、ラウンド数は”N”(Nは1以上の自然数)である。図5Aに示す通信アルゴリズムにおいては、「step 1」乃至「step N」のラウンドにおいて、データ転送要求の発行処理及びデータ転送の完了処理の少なくとも一方の処理が実行される。
In the communication algorithm, the data transfer request issuance process and the data transfer completion process are repeated for the required number of rounds. In the specific example shown in FIG. 5A, the number of rounds is “N” (N is a natural number of 1 or more). In the communication algorithm shown in FIG. 5A, at least one of a data transfer request issuance process and a data transfer completion process is executed in the “
データ転送の完了処理は、データ転送処理が完了したか否かの完了確認を実行し、データ転送が未完了の場合、完了を待ち合せずに完了処理を中断してよい。この場合、図5Aにおけるstep(「step1」乃至「stepN」)は、例えば、処理を再開する位置(ラウンド)を示す。通信アルゴリズムは、処理を中断した場合、処理を再開する際のstep(ラウンド)を通信アルゴリズムの実行元(通信アルゴリズムの呼び出し元)に返却(提供)してもよい。通信アルゴリズムは、処理を完了した場合、データ転送処理が完了したことを表す情報を、通信アルゴリズムの実行元に返却(提供)してもよい。図5Aに示す具体例ではデータ転送処理が完了したことを表す情報として「アルゴリズム完了」を表す情報が用いられる。通信アルゴリズムは、データ転送処理の完了を待ち合せないので、短い時間で実行可能である。
In the data transfer completion process, completion confirmation as to whether or not the data transfer process has been completed is executed. If the data transfer has not been completed, the completion process may be interrupted without waiting for completion. In this case, step (“
図5Bに例示するフローチャートを参照して、通信アルゴリズムの同債について概要を説明する。以下の説明においては、一例として、通信処理管理部203が、通信アルゴリズムを実行することを想定する。
An outline of the bond of the communication algorithm will be described with reference to the flowchart illustrated in FIG. 5B. In the following description, as an example, it is assumed that the communication
通信処理管理部203が通信アルゴリズムを実行する際、データ転送処理のラウンド数を指定する。データ転送処理が開始される場合、例えば、ラウンド数として「1」が設定されてもよい。
When the communication
データ転送処理のラウンド数を確認した結果(ステップS501)、ラウンド数が「1」の場合、通信アルゴリズムは、1番目のラウンド(最初のラウンド)におけるデータ転送要求の発行処理を実行する(ステップS502)。ラウンド数に「2」が設定される(ステップS503)。通信アルゴリズムは、通信アルゴリズムの実行元に処理を再開する際のstep(ラウンド数)を返却(提供)する(ステップS513)。 As a result of confirming the number of rounds in the data transfer process (step S501), when the number of rounds is “1”, the communication algorithm executes a process for issuing a data transfer request in the first round (first round) (step S502). ). “2” is set as the number of rounds (step S503). The communication algorithm returns (provides) a step (number of rounds) at the time of resuming the processing to the execution source of the communication algorithm (step S513).
データ転送処理のラウンド数を確認した結果(ステップS501)、ラウンド数が「i」(iは2以上N未満の整数)の場合、通信アルゴリズムは、「i−1」番目のラウンドにおけるデータ転送の完了処理を実行する(ステップS504)。 As a result of confirming the number of rounds in the data transfer process (step S501), when the number of rounds is “i” (i is an integer not less than 2 and less than N), the communication algorithm is the data transfer in the “i−1” -th round. A completion process is executed (step S504).
「i−1」番目のラウンドのデータ転送が完了していない場合(ステップS505においてNO)、通信アルゴリズムは、処理を再開する際のstep(ラウンド)を「i」に設定する(ステップS506)。即ち、再度「i」番目のラウンドから処理が再開されるよう、処理を再開する際のstepが設定される。この場合、通信アルゴリズムは、「i−1」番目のラウンドのデータ転送の完了を待ち合せず、ステップS513に処理を進める。 If the data transfer of the “i−1” -th round has not been completed (NO in step S505), the communication algorithm sets step (round) when restarting the process to “i” (step S506). In other words, a step for restarting the process is set so that the process is restarted from the “i” -th round. In this case, the communication algorithm does not wait for completion of the data transfer of the “i−1” -th round, and proceeds to step S513.
「i−1」番目のラウンドのデータ転送が完了した場合(ステップS505においてYES)、通信アルゴリズムは、「i」番目のラウンドのデータ転送要求を発行する(ステップS507)。通信アルゴリズムは、処理を再開する際のstep(ラウンド)を「i+1」に設定する(ステップS508)。即ち、「i+1」番目のラウンド(次のラウンド)から処理が再開されるよう、処理を再開する際のstepが設定される。 When the data transfer for the “i−1” -th round is completed (YES in step S505), the communication algorithm issues a data transfer request for the “i” -th round (step S507). The communication algorithm sets “i + 1” as a step (round) when the process is resumed (step S508). That is, a step for resuming the process is set so that the process is resumed from the “i + 1” -th round (next round).
ステップS506又はステップS508の処理を実行した後、通信アルゴリズムは、通信アルゴリズムの実行元に処理を再開する際のstep(ラウンド数)を返却(提供)する(ステップS513)。 After executing the process of step S506 or step S508, the communication algorithm returns (provides) a step (number of rounds) when the process is resumed to the execution source of the communication algorithm (step S513).
データ転送処理のラウンド数を確認した結果(ステップS501)、ラウンド数が「N」(最後のラウンド)の場合、通信アルゴリズムは、「M」番目のラウンドにおけるデータの転送の完了処理を実行する(ステップS509)。「M」番目のラウンドは、例えば、「N」番目のラウンドの、一つ前のラウンドを表す。 As a result of confirming the number of rounds in the data transfer process (step S501), when the number of rounds is “N” (the last round), the communication algorithm executes a data transfer completion process in the “M” -th round ( Step S509). The “M” th round represents, for example, the previous round of the “N” th round.
「M」番目のラウンドのデータ転送が完了していない場合(ステップS510においてNO)、通信アルゴリズムは、処理を再開する際のstep(ラウンド)を「N」に設定する(ステップS511)。この場合、通信アルゴリズムは、「M」番目のラウンドのデータ転送の完了を待ち合せず、ステップS513に処理を進める。 If the data transfer of the “M” -th round has not been completed (NO in step S510), the communication algorithm sets “N” as the step (round) when the process is resumed (step S511). In this case, the communication algorithm does not wait for completion of the data transfer of the “M” -th round, and proceeds to step S513.
「M」番目のラウンドのデータ転送が完了した場合(ステップS510においてYES)、通信アルゴリズムは、通信アルゴリズムの実行元に、データン転送処理の完了を表す情報(例えば、図5Aにおける「アルゴリズム完了」)を提供する(ステップS512)。 When the data transfer of the “M” -th round is completed (YES in step S510), the communication algorithm sends information indicating the completion of the data transfer process to the execution source of the communication algorithm (for example, “algorithm completion” in FIG. 5A). Is provided (step S512).
図6Aは、通信処理記録部204に記録されるデータの一例を示す説明図である。
FIG. 6A is an explanatory diagram illustrating an example of data recorded in the communication
通信ID601は、プロセス間通信を識別可能な識別子(ID:Identifier)を示す。通信ID601には、例えば、プロセス間通信を特定可能な識別子を表すデータが設定されてもよい。
The
通信アルゴリズム602は、プロセス間通信に適用される通信アルゴリズムを示す。プロセス間通信に適用される通信アルゴリズムとしては、1以上のラウンド(段階)で通信処理が実行される通信アルゴリズムが適宜選択されてよい。例えば、係る通信アルゴリズムは、バタフライ方式であってもよい。また、係る通信アルゴリズムは、各プロセスが他の全プロセスとデータを送受信する方式であってもよい。係る通信アルゴリズムは、例えば、MPIにおける集団通信関数ごとに、適切に選択されてもよい。通信アルゴリズム602には、例えば、通信アルゴリズムを特定可能なデータが設定されてもよい。通信アルゴリズム602には、プロセス間通信に適用される種々のアルゴリズムが設定され得る。
A
再開位置603は、通信アルゴリズムを再開する際のstep(ラウンド数)、又は、通信アルゴリズムの完了を示す。再開位置603には、例えば、step(ラウンド数)を表すデータ、又は、通信アルゴリズムの完了を表すデータが設定されてもよい。再開位置603の初期値は、例えば、「step1」に設定されてもよい。係る初期値の設定は、例えば、図5Aに示す通信アルゴリズムにおいて、最初のデータ転送要求の発行処理を実行することを表す。再開位置603に、「アルゴリズム完了」が設定されている場合、例えば、通信アルゴリズムが完了(データ転送処理が完了)していることを表す。以下、通信処理記録部204に記録される通信ID601と、通信アルゴリズム602と、再開位置603との組合せを、単に「エントリ」と記載する場合がある。
The
図6Bは、同期待ちスレッド記録部302に記録されるデータの一例を示す説明図である。同期待ちスレッド記録部302には、ある並列処理を実行する1以上のスレッドの内、同期待ち状態にないスレッドの数を表すカウンタ604を保持する。例えば、1以上のスレッドにより並列処理が実行される際、当該並列処理を実行するスレッドの総数がカウンタ604に設定される。一つの具体例として、OMPを用いてスレッドの並列処理が実装される場合、”#pragma omp parallel”等、並列処理が開始されるタイミングで、カウンタ604に、当該並列処理を実行するスレッドの総数が設定されてもよい。
FIG. 6B is an explanatory diagram illustrating an example of data recorded in the synchronization waiting
各スレッドは、同期処理を実行した際(即ち、当該スレッドが同期待ち状態になった際)、カウンタ604の値を漸減(デクリメント)させる。一つの具体例として、OMPを用いて並列処理が実装される場合、”#pragma omp bariier”等のバリア同期処理の実行開始時に、各スレッドはカウンタ604をデクリメントする。
Each thread gradually decreases (decrements) the value of the
各スレッドは、カウンタ604が”0”になるまで、同期待ち状態となる。各スレッドは、例えば、カウンタ604が”0”になるまでループ処理で待ち続けてもよい。この場合、各スレッドはか、カウンタ604が”0”になった際にループを抜け、カウンタ604の値を、再度並列処理を実行する総スレッド数で初期化してもよい。
Each thread is in a synchronization waiting state until the
上記のように構成された並列処理装置400は、上記第1の実施形態における並列処理装置100と同様の処理を実現可能であってもよい。本実施形態におけるプロセス間通信部200は、第1の実施形態におけるプロセス間通信部101と同様の処理を実現可能であってもよい。本実施形態におけるマルチスレッド制御部300は、第1の実施形態におけるマルチスレッド制御部102と同様の処理を実現可能であってもよい。
The
[動作]
以下、本実施形態における並列処理装置400の動作について説明する。図7は、通信開始処理部201の動作の一例を表したフローチャートである。図8Aは、通信処理管理部203の動作の一例を表したフローチャートである。図9Aは、バリア同期処理部301の動作の一例を表したフローチャートである。図10は、通信完了処理部202の動作の一例を表したフローチャートである。
[Operation]
Hereinafter, the operation of the
本実施形態における並列処理装置400は、上記第1の実施形態と同様、並列プログラムを実行する。係る並列プログラムは、1以上のスレッドにより並列に実行可能な処理を含むプロセスを1以上含んでもよい。即ち、並列処理装置400において実行される並列処理プログラムは、マルチプロセス・マルチスレッド処理が実装されたプログラムであってもよい。
The
係る並列プログラムが実行された場合、例えば、複数のプロセスが生成され、それらが並行して実行されてもよい。この場合各プロセスは、同一の並列処理装置400において実行されてもよく、複数の並列処理装置400において並行して実行されてもよい。複数のプロセスは、必要に応じてプロセス間通信を実行することにより、並列プログラムとして実装された処理を実行する。この際、あるプロセスを実行する過程において、複数のスレッドが生成され、当該複数のスレッドが並列に実行されてもよい。複数のスレッドによる並列処理が開始する際、当該並列処理を実行するスレッドの総数が、同期待ちスレッド記録部302のカウンタ604に設定されてもよい。
When such a parallel program is executed, for example, a plurality of processes may be generated and executed in parallel. In this case, each process may be executed by the same
以下、並列プログラムがプロセス間通信を開始した場合の動作について説明する。以下の説明においては、並列処理プログラムが、通信開始処理部201、通信完了処理部202及び通信処理管理部203等が提供する機能を用いて、各種処理を実行することを想定する。例えば、通信開始処理部201、通信完了処理部202及び通信処理管理部203がコンピュータ・プログラムとして実現される場合、並列処理プログラムは、係るコンピュータ・プログラム(例えば、ライブラリや実行ファイル等)を呼び出す(実行する)ことが可能である。
The operation when the parallel program starts interprocess communication will be described below. In the following description, it is assumed that the parallel processing program executes various processes using functions provided by the communication
通信開始処理部201は、例えば、プロセス間通信に関する情報を、通信処理記録部204に記録する機能を提供してもよい。具体的には、通信開始処理部201は、例えば、あるプロセス間通信について、通信処理記録部204における通信ID601、通信アルゴリズム602及び再開位置603にそれぞれ適切な情報を設定してもよい。通信開始処理部201は、例えば、通信処理管理部203に、通信処理を実行するよう通知することで、プロセス間通信を開始する機能を提供してもよい。
For example, the communication
並列プログラムがプロセス間通信を開始した際、通信開始処理部201は、当該プロセス間通信に関する情報を、通信処理記録部204に記録する(ステップS701)。この場合、例えば、並列プログラムにおいて生成されたスレッドが、通信開始処理部201を用いて、プロセス間通信に関する情報を通信処理記録部204に記録してもよい。係る処理は、スレッド間で排他的に実行され得る。この場合、通信開始処理部201は、上記再開位置を表す情報として、初期値「step1」を再開位置603に設定してもよい。
When the parallel program starts inter-process communication, the communication
通信開始処理部201は、通信処理を開始する(ステップS702)。例えば、通信開始処理部201は、通信処理管理部203がプロセス間通信に関する処理(プロセス間通信処理)を開始するよう制御してもよい。
The communication
一つの具体例として、図2に示すような疑似コードの場合、並列プログラムは、例えば、MPI_Iallreduce関数を実行した際に、上記したプロセス間通信を開始する処理を実行してもよい。また、”#pragma omp parallel”(複数スレッドによる並列処理の開始処理)が実行された際、並列処理を実行するスレッドの総数が、同期待ちスレッド記録部302のカウンタ604に設定される。
As a specific example, in the case of the pseudo code as shown in FIG. 2, the parallel program may execute the above-described process for starting the inter-process communication when the MPI_Iallreduce function is executed, for example. Also, when “#pragma om parallel” (parallel processing start processing by a plurality of threads) is executed, the total number of threads that execute parallel processing is set in the
以下、プロセス間通信処理について具体的に説明する。並列処理プログラム(特には、並列プログラムで生成されたスレッド)は、以下に説明する通信処理管理部203が提供する機能を用いて、プロセス間通信処理を実行してもよい。以下説明するステップS801乃至ステップS805の処理は、スレッド間で排他的に実行され得る。
Hereinafter, the inter-process communication process will be specifically described. A parallel processing program (in particular, a thread generated by the parallel program) may execute inter-process communication processing using a function provided by the communication
通信処理管理部203は、未処理の通信処理の有無を判定する(ステップS801)。具体的には、通信処理管理部203は、通信処理記録部204を参照し、通信処理記録部204にプロセス間通信に関する情報(エントリ)が登録されている場合、未処理のプロセス間通信があると判定してもよい。
The communication
ステップS801における判定の結果、未処理のプロセス間通信が存在しない場合(ステップS801においてNO)、通信処理管理部203は、処理を終了してもよい。
If the result of determination in step S801 is that there is no unprocessed interprocess communication (NO in step S801), the communication
ステップS801における判定の結果、未処理のプロセス間通信が存在する場合(ステップS801においてYES)、通信処理管理部203は、通信処理記録部204に設定されたエントリ(通信ID601、通信アルゴリズム602及び再開位置603)を取得する(ステップS802)。
If there is unprocessed interprocess communication as a result of the determination in step S801 (YES in step S801), the communication
通信処理管理部203は、ステップS802において取得した通信ID601に関する再開位置603を確認する。再開位置603に「アルゴリズム完了」を表すデータが設定されている場合(ステップS803においてNO)、通信処理管理部203は、ステップS801から処理を続行する。
The communication
再開位置603に「アルゴリズム完了」以外のデータが設定されている場合(ステップS803においてYES)、通信処理管理部203は、当該通信ID601により識別されるプロセス間通信に関する通信アルゴリズムを実行する(ステップS804)。具体的には、通信処理管理部203は、通信処理記録部204に設定された各通信ID601について、再開位置603に設定されたデータ確認する。そして、再開位置603に設定されたデータが「アルゴリズム完了」ではない場合、通信処理管理部203は、通信ID601に設定されたデータにより識別されるプロセス間通信に関して、通信アルゴリズムを実行する。通信処理管理部203は、この際、通信アルゴリズムに対して、再開位置603に設定されたデータ(stepを表す)を提供する。
When data other than “algorithm completion” is set at the resume position 603 (YES in step S803), the communication
通信処理管理部203は、通信アルゴリズムから返却(提供)されたデータを用いて、再開位置603を更新する(ステップS805)。上記したように、通信アルゴリズムからは、プロセス間通信のstep(ラウンド数)を表すデータが提供されてもよい。通信アルゴリズムからは、プロセス間通信が完了したことを表すデータ(例えば、「アルゴリズム完了」を表すデータ)が提供されてもよい。
The communication
以下、並列プログラムが、スレッドのバリア同期処理を実行した場合の処理について説明する。並列処理プログラム(具体的には、並列プログラムにおいて生成されたスレッド)は、以下において説明するバリア同期処理部301の機能を用いて、スレッドのバリア同期処理を実行してもよい。例えば、バリア同期処理部301がコンピュータ・プログラムとして実現される場合、並列処理プログラムにおいて生成されてスレッドは、係るコンピュータ・プログラムを呼び出す(実行する)ことが可能である。
Hereinafter, processing when the parallel program executes thread barrier synchronization processing will be described. A parallel processing program (specifically, a thread generated in the parallel program) may execute thread barrier synchronization processing using the function of the barrier
バリア同期処理部301は、例えば、スレッドの状態を取得する機能、スレッドの状態を設定する機能、及び、スレッド状態を消去する機能を提供してもよい。バリア同期処理部301は、例えば、スレッドを同期する機能(スレッドの同期を待ち合わせる機能)を提供してもよい。バリア同期処理部301は、例えば、通信処理管理部203に、通信処理を実行させる機能を提供してもよい。
For example, the barrier
並列プログラムが、スレッドのバリア同期処理を実行した場合、バリア同期処理部301は、当該スレッドが同期待ち状態になったことを、同期待ちスレッド記録部302に記録する(ステップS901)。例えば、あるスレッドはバリア同期処理部301を用いて、同期待ちスレッド記録部302に記録されたカウンタ604の値をデクリメント(”1”漸減)してもよい。一つの具体例として、OMPを用いて、スレッドの並列処理が実装される場合、スレッドのバリア同期処理は、例えば、”#pragma omp barrier”等のコードが実行された際に、実行されてもよい。
When the parallel program executes thread barrier synchronization processing, the barrier
同期待ち状態になったスレッドは、他のスレッドの状態を取得する(ステップS902)。係るスレッドは、バリア同期処理部301を用いて、他のスレッドの状態を取得してもよい。例えば、係るスレッドは、同期待ちスレッド記録部302に記録された604の値を参照し、その値に基づいて他のスレッドの状態を判定してもよい。係る参照処理は、例えば、排他的に実行され得る。以下、同期待ち状態になったスレッドを、「同期待ちスレッド」(第1のスレッドに相当)と記載する場合がある。
The thread that has entered the synchronization waiting state acquires the state of another thread (step S902). Such a thread may acquire the state of another thread using the barrier
ステップS902において取得した他のスレッドの状態から、ある並列処理に関する同期に参加するスレッドのうち、同期待ち状態ではないスレッドが存在すると判定された場合(ステップS903においてNOの場合)について以下に説明する。同期待ちスレッドは、例えば、同期待ちスレッド記録部302に記録された604の値が”0”ではない場合、ある並列処理に関して、同期待ち状態では無いスレッドが残っていると判定してもよい。
A case will be described below in which it is determined from the state of another thread acquired in step S902 that there is a thread that is not in a synchronization waiting state among threads participating in synchronization related to certain parallel processing (NO in step S903). . For example, when the value of 604 recorded in the synchronization waiting
ここで、同期に参加するスレッドは、例えば、ある並列処理において、自スレッドにおける処理が完了した後、他のスレッドによる処理の完了を待ち合わせるスレッドであってよい。例えば、1以上のスレッドが同期に参加する場合、それらのスレッドは、ある同期点(タイミング)において、他のスレッドによる処理の実行を待ち合せてよい。 Here, the thread participating in the synchronization may be, for example, a thread that waits for the completion of the process by another thread after the process in the own thread is completed in a certain parallel process. For example, when one or more threads participate in synchronization, they may wait for execution of processing by other threads at a certain synchronization point (timing).
ステップS903においてNOの場合、同期待ちスレッドは、自スレッドが最初に同期待ち状態になったスレッドであるか否かを確認する(ステップS904)。係るスレッドは、例えば、スレッド記録部302に記録された604の値に基づいて、自スレッドが最初に同期待ちになったスレッドか否かを判定してもよい。一例として、同期待ちスレッドは、スレッド記録部302に記録された604の値が他のスレッドによりデクリメントされていなければ、自スレッドが最初に同期待ちになったスレッドであると判定してもよい。
In the case of NO in step S903, the synchronization waiting thread confirms whether or not its own thread is the thread that first entered the synchronization waiting state (step S904). For example, the thread may determine whether or not the own thread is a thread that is initially waiting for synchronization based on the value of 604 recorded in the
同期待ちスレッドが、最初に同期待ち状態になったスレッドである場合(ステップS904においてYES)について以下に説明する。係る同期待ちスレッドは、他のスレッドが同期待ち状態になるまで、通信処理管理部203による通信処理(例えば、上記ステップS801乃至ステップS805)を繰り返し実行する(ステップS905)。係る同期待ちスレッドは、バリア同期処理部301を用いて、通信処理管理部203が上記通信処理を実行するよう制御してもよい。係る同期待ちスレッドは、通信処理管理部203による通信処理を、適宜設定可能な時間間隔毎に、繰り返して実行してもよい。
The case where the synchronization waiting thread is the thread that first entered the synchronization waiting state (YES in step S904) will be described below. The synchronization waiting thread repeatedly executes communication processing (for example, steps S801 to S805 described above) by the communication
同期待ちスレッドが、最初に同期待ち状態になったスレッドではない場合(ステップS904においてNO)、同期待ちスレッドは、ステップS902から処理を続行し、他のスレッドが同期待ち状態になるまで待ち合せる。 If the synchronization waiting thread is not the thread that first entered the synchronization waiting state (NO in step S904), the synchronization waiting thread continues processing from step S902 and waits until another thread enters the synchronization waiting state.
同期待ちスレッドが、ある並列処理に関して、同期待ち状態ではない他のスレッドが存在しないことを確認した場合(ステップS903においてYES)について説明する。この場合、係る同期待ちスレッドは、ある並列処理に関する同期待ち処理を終了する。そして係る同期待ちスレッドは、他のスレッドが、ある並列処理に関する同期待ち処理を終了することを待ち合せる(ステップS906)。 A case where the synchronization waiting thread confirms that there is no other thread that is not in the synchronization waiting state for a certain parallel processing (YES in step S903) will be described. In this case, the synchronization waiting thread ends the synchronization waiting process related to a certain parallel process. Then, the synchronization waiting thread waits for another thread to finish the synchronization waiting process related to a certain parallel process (step S906).
ステップS906における同期処理は、ある並列処理を実行する各スレッドが、他のスレッドが同期待ち状態になったことを確認するまで待ち合せる処理である。これにより、例えば、あるスレッドが同期待ち状態になる前に他のスレッドが処理を続行してしまい、同期待ちスレッド記録部302に記録されたカウンタ604を変更してしまうことを防止可能である。
The synchronization process in step S906 is a process in which each thread executing a certain parallel process waits until it is confirmed that another thread has entered a synchronization wait state. As a result, for example, it is possible to prevent another thread from continuing processing before a certain thread enters the synchronization waiting state and changing the
あるスレッドが最初に同期待ち状態になったスレッドである場合(ステップS907においてYES)、係るスレッドは、同期待ちスレッド記録部302に記録された、同期に参加した全てのスレッドに関する状態を初期化する(ステップS908)。係るスレッドは、例えば、バリア同期処理部301を用いて、同期待ちスレッド記録部302に記録されたカウンタを、並列処理を実行する総スレッド数により再度初期化する処理を実行してもよい。
If a thread is a thread that has been in a synchronization waiting state first (YES in step S907), the thread initializes the state relating to all threads that have participated in synchronization recorded in the synchronization waiting
なお、図9Aは、説明の便宜上、最初に同期待ち状態になったスレッドがステップS908を実行する態様を示しているが、本実施形態はこれには限定されない。ステップS908は、最初に同期待ち状態になったスレッド以外のいずれかのスレッドにより実行されてもよい。 For convenience of explanation, FIG. 9A shows a mode in which a thread that is initially in a synchronization waiting state executes step S908, but the present embodiment is not limited to this. Step S908 may be executed by any thread other than the thread that first entered the synchronization wait state.
ステップS907においてにおいてNOの場合、又は、ステップS908における処理が実行された場合、同期待ちスレッドは、再度他のスレッドを待ち合せてもよい(ステップS909)。これにより、例えば、同期待ちスレッド記録部302に記録されたカウンタ604が初期化される前に、あるスレッドが処理を続行してしまうことを防止可能である。
If NO in step S907, or if the process in step S908 is executed, the synchronization waiting thread may wait for another thread again (step S909). Thereby, for example, it is possible to prevent a thread from continuing processing before the
以下、並列プログラムがプロセス間通信を完了する場合の動作について説明する。以下の説明においては、並列処理プログラムが、通信完了処理部202等が提供する機能を用いて、各種処理を実行することを想定する。例えば、通信完了処理部202がコンピュータ・プログラム(例えば、ライブラリや実行ファイル等)として実現される場合、並列処理プログラムは、係るコンピュータ・プログラムを呼び出す(実行する)ことが可能である。 The operation when the parallel program completes the interprocess communication will be described below. In the following description, it is assumed that the parallel processing program executes various processes using functions provided by the communication completion processing unit 202 and the like. For example, when the communication completion processing unit 202 is realized as a computer program (for example, a library or an execution file), the parallel processing program can call (execute) the computer program.
並列プログラムがプロセス間通信を完了する際、通信完了処理部202は、通信処理記録部204を参照し、当該並列プログラムに関するプロセス間通信の再開位置を表すデータ(図6Aにおける再開位置603)を取得する(ステップS1001)。
When the parallel program completes the inter-process communication, the communication completion processing unit 202 refers to the communication
通信完了処理部202は、プロセス間通信の再開位置を表すデータを用いて、プロセス間通信が完了したか否かを判定する。具体的には、通信完了処理部202は、プロセス間通信の再開位置を表すデータに「アルゴリズム完了」が設定されているか否かを判定する。(ステップS1002)。 The communication completion processing unit 202 determines whether or not the interprocess communication has been completed, using data representing the restart position of the interprocess communication. Specifically, the communication completion processing unit 202 determines whether or not “algorithm completion” is set in the data indicating the restart position of the interprocess communication. (Step S1002).
上記したように、プロセス間通信(データ転送処理)が完了している場合、プロセス間通信の再開位置(例えば、図6の603)に「アルゴリズム完了」が設定される。プロセス間通信(データ転送処理)が完了していない場合、プロセス間通信の再開位置には、例えば、step数(ラウンド数)が設定される。 As described above, when the inter-process communication (data transfer process) is completed, “algorithm complete” is set at the restart position of the inter-process communication (for example, 603 in FIG. 6). When inter-process communication (data transfer processing) has not been completed, for example, the number of steps (number of rounds) is set as the restart position of inter-process communication.
プロセス間通信の再開位置が「アルゴリズム完了」ではない場合(ステップS1002においてNO)、並列プログラムに関するプロセス間通信が完了していない。この場合、通信完了処理部202は、通信処理管理部203によるプロセス間通信処理を実行し(ステップS1003)、ステップS1001から処理を続行する。即ち、通信完了処理部202は、プロセス間通信の再開位置に「アルゴリズム完了」が設定されるまで、通信処理管理部203によるプロセス間通信処理を繰り返し実行する。通信完了処理部202、例えば、通信処理管理部203がプロセス間通信処理を実行するよう制御してもよい。
When the restart position of the interprocess communication is not “algorithm completion” (NO in step S1002), the interprocess communication regarding the parallel program is not completed. In this case, the communication completion processing unit 202 executes inter-process communication processing by the communication processing management unit 203 (step S1003), and continues processing from step S1001. That is, the communication completion processing unit 202 repeatedly executes the interprocess communication processing by the communication
プロセス間通信の再開位置が「アルゴリズム完了」である場合(ステップS1002においてYES)、並列プログラムに関するプロセス間通信が完了している。この場合、通信完了処理部202は、通信処理管理部203に記録された当該プロセス間通信に関するエントリを削除する(ステップS1004)。ステップS1004における処理は、スレッド間で排他的に実行され得る。 When the restart position of the interprocess communication is “algorithm complete” (YES in step S1002), the interprocess communication regarding the parallel program is completed. In this case, the communication completion processing unit 202 deletes the entry related to the interprocess communication recorded in the communication processing management unit 203 (step S1004). The process in step S1004 can be executed exclusively between threads.
一つの具体例として、並列プログラムは、MPI_Wait関数を実行した際に、上記したプロセス間通信を開始する処理を実行してもよい。 As one specific example, the parallel program may execute the above-described process of starting the interprocess communication when the MPI_Wait function is executed.
[効果]
例えば、並列プログラムにおいて生成されたスレッドが単純に同期処理のみを実行する場合、当該スレッドは、他のスレッドの同期を待つ同期待ち状態になることがある。この場合、CPUコアにおいては、当該同期待ち状態になったスレッドに関する演算処理は実行されない。即ち、スレッドが同期待ち状態になることにより、CPUコアの演算資源が有効に活用されることなく消費される。
[effect]
For example, when a thread generated in a parallel program simply executes a synchronization process, the thread may be in a synchronization wait state waiting for the synchronization of another thread. In this case, the CPU core does not execute arithmetic processing related to the thread in the synchronization waiting state. That is, when the thread enters a synchronization waiting state, the CPU core's computing resources are consumed without being effectively utilized.
これに対して、上記のように構成された並列処理装置400おいては、並列プログラムのスレッドは、同期処理を実行してから他のスレッドの同期を待つ間に、プロセス間通信を実行可能である(例えば、上記ステップS902乃至S905)。
On the other hand, in the
即ち、並列処理装置400は、スレッドの同期待ちで消費されていたCPUコアの演算資源を使用して、プロセス間通信処理を進行することが可能である。これにより、計算処理に割り当てられるCPUコアの演算資源を減らすことなく、プロセス間通信処理を進行することが可能である。
That is, the
上記のように構成された並列処理装置400においては、独立した通信スレッドを生成する必要がない。また、並列処理装置400においては、ユーザが、例えば、並列プログラムにおける計算処理の途中に、プロセス間通信処理に関する処理を明示的に記載せずともよい。なぜならば、スレッドが同期待ち状態になった際に、プロセス間通信部200及びマルチスレッド制御部300によって、プロセス間通信を進行する処理が実行されるからである。これにより、プロセス間通信におけるデータ転送処理と、計算処理とを並列に実行することが可能になる。
In the
上記のような効果について、説明図を参照して説明する。図11は、例えば、図2に例示したプログラムを、本実施形態の並列処理装置400において実行した場合の効果を説明する説明図である。
The above effects will be described with reference to the explanatory drawings. FIG. 11 is an explanatory diagram for explaining the effect when, for example, the program illustrated in FIG. 2 is executed in the
図3に例示するチャートと比較すると、図11のチャートにおいては、”para1()”と、”para2()”との計算処理の後で実行されるスレッドのバリア同期処理の際、プロセス間通信処理が実行される。これにより、並列処理装置400は、スレッドが同期待ち状態にある(スレッドの同期を待ち合せている)CPUコアの演算資源を利用して、以下のプロセス間通信処理を順次進行することができる。即ち、並列処理装置400は、具体的には、ラウンド1のテータ転送の完了処理(S1101)、ラウンド2のデータ転送要求の発行処理(S1102)、ラウンド2のデータ転送の完了処理(S1103)、ラウンド3のデータ転送要求の発行処理(S1104)を順に実行可能である。これにより、ラウンド2及びラウンド3のデータ転送処理が、計算処理と並行して実行されることから、並列プログラム全体の実行時間が短縮される。
Compared to the chart illustrated in FIG. 3, in the chart of FIG. 11, the inter-process communication is performed during the barrier synchronization processing of the thread executed after the calculation processing of “para1 ()” and “para2 ()”. Processing is executed. As a result, the
以上より、本実施形態によれば、並列プログラムにおける計算処理の過程で消費される演算資源を用いて、プロセス間通信処理と、計算処理とを並列に実行可能である。 As described above, according to the present embodiment, the inter-process communication process and the calculation process can be executed in parallel using the operation resources consumed in the process of the calculation process in the parallel program.
以下、上記各実施形態に関する変形例等について説明する。 Hereinafter, modifications and the like related to the above embodiments will be described.
上記説明した実施形態においては、ステップS904乃至ステップS905における処理は、最初に同期待ち状態になったスレッドにより実行される。これにより、同期待ち状態のスレッドが発生してからなるべく早いタイミングで、プロセス間通信の処理を進行させることができる。 In the above-described embodiment, the processes in steps S904 to S905 are executed by the thread that first enters the synchronization wait state. As a result, the inter-process communication process can proceed at the earliest possible timing after the generation of the synchronization waiting thread.
本実施形態の一つの変形例として、図9AのステップS905における通信処理(図8AのステップS801乃至S805を含む)は、最初に同期待ち状態になったスレッド以外の適切なスレッドにより実行されてもよい。例えば、並列処理装置400が、通信処理を実行しているスレッドの有無を表すデータ(フラグ)等を保持してもよい。この場合、例えば、あるスレッドが同期待ち状態になった際、当該スレッドは、上記フラグを確認する。通信処理を実行している他のスレッドが存在しない場合、当該スレッド自身が通信処理を実行してもよい。係る変形例は、具体的には、以下のように実現され得る。以下、図8B,図9Bを参照して説明する。
As a modification of the present embodiment, the communication process (including steps S801 to S805 in FIG. 8A) in step S905 in FIG. 9A may be executed by an appropriate thread other than the thread that first entered the synchronization wait state. Good. For example, the
本変形例においては、例えば、通信処理記録部204に、各通信ID(図6Aの601)に関連付けて、当該通信IDに関する通信処理が実行中であるか否かを表す情報が設定される。以下、係る情報を「処理中フラグ」と記載する。係る処理中フラグは、例えば、各スレッドがから排他的にアクセスされることを想定する。即ち、ある時点では1つのスレッドのみが、係る処理中フラグを参照、更新、削除することができることを想定する。
In this modification, for example, information indicating whether or not a communication process related to the communication ID is being executed is set in the communication
図7のステップS701において、通信開始処理部201は、あるプロセス間通信に関する処理中フラグを初期化する。具体的には、通信開始処理部201は、通信処理が実行されていないことを表す情報(例えば、「OFF」等)を、処理中フラグに設定してよい。
In step S701 in FIG. 7, the communication
あるスレッドが、同期処理を実行した場合、当該スレッドは、例えば、バリア同期処理部301をもいて、図9BのステップS901乃至ステップS905を実行する。この際、当該スレッドは、自スレッドが最初に同期待ち状態になったスレッドであるか否か(図9AのステップS904)を実行せずともよい。
When a certain thread executes the synchronization process, the thread has, for example, the barrier
当該スレッドは、例えば、通信処理管理部203を用いて、図8BのステップS801を実行する。
The thread executes step S801 of FIG. 8B using, for example, the communication
係るスレッドは、未処理のプロセス間通信処理が存在する場合(ステップS801においてYES)、当該プロセス間通信処理に関する処理中フラグを確認する(図8BのステップS806)。具体的には、係るスレッドは、通信処理記録部204において、未処理のプロセス間通信に関する通信IDに関連付けされた、処理中フラグを確認する。
When there is an unprocessed inter-process communication process (YES in step S801), the thread confirms a processing flag relating to the inter-process communication process (step S806 in FIG. 8B). Specifically, the thread checks the in-process flag associated with the communication ID related to unprocessed interprocess communication in the communication
係る処理中フラグがOFFの場合、当該通信処理を実行している他のスレッドが存在しない。この場合(ステップS806においてYES)、係るスレッドは、係る処理中フラグに、通信処理が実行されていることを表す情報(例えば「ON」等)を設定する(図8BのステップS807)。ここで、ステップS806における処理中フラグの確認及び更新は、排他的に(アトミックに)実行され得る。 When the in-process flag is OFF, there is no other thread executing the communication process. In this case (YES in step S806), the thread sets information (for example, “ON” or the like) indicating that the communication process is being executed in the in-process flag (step S807 in FIG. 8B). Here, the confirmation and update of the processing flag in step S806 can be executed exclusively (atomically).
ステップS807の後、係るスレッドは、ステップS802から処理を続行する。ステップS802乃至ステップS805の処理は上記説明した実施形態と同様としてよい。 After step S807, the thread continues processing from step S802. The processing from step S802 to step S805 may be the same as in the above-described embodiment.
ステップS803においてNO(即ち、通信アルゴリズムが完了している場合)、又は、ステップS805のおける処理が実行された後、係るスレッドは、処理中フラグに「OFF」を設定する(ステップS808)。 In step S803, NO (that is, when the communication algorithm is completed), or after the processing in step S805 is executed, the thread sets “OFF” in the processing flag (step S808).
また、ステップS806において、処理中フラグがOFFではない場合(ONの場合)、他のスレッドが、当該通信処理を実行している可能性がある。この場合、係るスレッドは、ステップS801から処理を続行する。 In step S806, if the processing flag is not OFF (ON), there is a possibility that another thread is executing the communication process. In this case, the thread continues processing from step S801.
上記のような処理により、図8Bに例示する通信処理は、ある特定のスレッド(例えば、最初に同期待ち状態になったスレッド)に限定されず、複数のスレッドのうちいずれかのスレッドにより実行され得る。 Through the processing as described above, the communication processing illustrated in FIG. 8B is not limited to a specific thread (for example, a thread that is first in a synchronization waiting state), and is executed by any one of a plurality of threads. obtain.
上記実施形態においては、同期が成立するまで(例えば、同期に参加する全てのスレッドが同期待ち状態になるまで)バリア同期処理部301が通信処理管理部203を用いてプロセス間通信に関する処理を実行する。これにより、バリア同期処理部301がプロセス間通信に関する処理を実行しない場合に比べて、バリア同期に多少多くの時間を要する場合がある。バリア同期の実行時間を優先する場合、同期が成立するまでの基準時間を適切に定め、バリア同期処理部301が、係る基準時間を超えない範囲でプロセス間通信処理を進行してもよい。係る基準時間は、例えば、あるスレッドにより初の同期処理が実行されてから経過した時間であってもよい。係る基準時間は、例えば、以前の同期成立までに要した時間と、通信処理の進行に要した時間とを記録することで、同期成立に要した時間を超えないように定められてもよい。あるいは、係る基準時間は、例えば、並列プログラムのテスト等の際に実験的に定められてもよい。係る基準時間を定める方法は、上記に限定されず、他の適切な方法を採用してもよい。
In the above embodiment, until synchronization is established (for example, until all threads participating in synchronization are in a synchronization waiting state), the barrier
上記実施形態の説明においては、バリア同期処理部301が、スレッドがバリア同期処理を実行した際に、プロセス間通信処理を進行する。上記に限定されず、上記実施形態は、バリア同期以外のスレッドの待ち合わせが発生する機能(例えば、ロック取得機能など)にも適用することができる。
In the description of the above embodiment, the barrier
上記各実施形態においては、本発明を並列処理装置(100、400)に適用した例として説明した。上記各実施形態では、例えば、並列処理装置(100、400)を動作させることによって、並列処理方法を実施することができる。並列処理方法を実施する方法は上記に限定されず、並列処理装置(100、400)と同様の動作あるいは処理を実行可能な、他の装置(例えば、コンピュータ等の情報処理装置)によって実施することも可能である。 In each of the above embodiments, the present invention has been described as an example in which the present invention is applied to a parallel processing device (100, 400). In each said embodiment, a parallel processing method can be implemented by operating a parallel processing apparatus (100,400), for example. The method of executing the parallel processing method is not limited to the above, and is executed by another device (for example, an information processing device such as a computer) capable of executing the same operation or processing as the parallel processing device (100, 400). Is also possible.
<ハードウェア及びソフトウェア・プログラム(コンピュータ・プログラム)の構成>
以下、上記説明した各実施形態を実現可能なハードウェア構成について説明する。
<Configuration of hardware and software program (computer program)>
Hereinafter, a hardware configuration capable of realizing each of the above-described embodiments will be described.
以下の説明においては、上記各実施形態において説明した並列処理装置(100、400)をまとめて、単に「並列処理装置」と記載する。また、これら並列処理装置の各構成要素を、単に「並列処理装置の構成要素」と記載する場合がある。 In the following description, the parallel processing devices (100, 400) described in the above embodiments are collectively referred to simply as “parallel processing devices”. In addition, each component of the parallel processing device may be simply referred to as “component of the parallel processing device”.
上記各実施形態において説明した並列処理装置は、1つ又は複数の専用のハードウェア装置により構成されてもよい。その場合、上記各図(図4A、図4B)に示した各構成要素は、その一部又は全部を統合したハードウェア(処理ロジックを実装した集積回路あるいは記憶デバイス等)を用いて実現されてもよい。 The parallel processing device described in each of the above embodiments may be configured by one or a plurality of dedicated hardware devices. In that case, each component shown in each of the above figures (FIGS. 4A and 4B) is realized by using hardware (an integrated circuit or a storage device on which processing logic is mounted) that is partially or entirely integrated. Also good.
並列処理装置が専用のハードウェアにより実現される場合、係る並列処理装置の構成要素は、例えば、それぞれの機能を提供可能な回路構成(circuitry)により実現されてもよい。係る回路構成は、例えば、SoC(System on a Chip)等の集積回路や、当該集積回路を用いて実現されたチップセット等を含む。この場合、並列処理装置の構成要素が保持するデータは、例えば、SoCとして統合されたRAM(Random Access Memory)領域やフラッシュメモリ領域、あるいは、当該SoCに接続された記憶デバイス(半導体記憶装置等)に記憶されてもよい。また、この場合、並列処理装置の各構成要素を接続する通信回線としては、周知の通信ネットワークを採用してもよい。また、各構成要素を接続する通信回線は、それぞれの構成要素間をピアツーピアで接続してもよい。 When the parallel processing device is realized by dedicated hardware, the components of the parallel processing device may be realized by, for example, a circuit configuration capable of providing each function. Such a circuit configuration includes, for example, an integrated circuit such as SoC (System on a Chip), a chip set realized using the integrated circuit, and the like. In this case, the data held by the components of the parallel processing device is, for example, a RAM (Random Access Memory) area integrated as SoC, a flash memory area, or a storage device (such as a semiconductor storage device) connected to the SoC. May be stored. In this case, a well-known communication network may be adopted as a communication line for connecting each component of the parallel processing device. Further, the communication line connecting each component may be connected between each component by peer-to-peer.
また、上述した並列処理装置は、図12に例示するような汎用のハードウェアと、係るハードウェアによって実行される各種ソフトウェア・プログラム(コンピュータ・プログラム)とによって構成されてもよい。この場合、並列処理装置は、適切な数の汎用のハードウェア装置1200と、ソフトウェア・プログラムとの組合せにより構成されてもよい。
Further, the parallel processing device described above may be configured by general-purpose hardware as exemplified in FIG. 12 and various software programs (computer programs) executed by the hardware. In this case, the parallel processing device may be configured by a combination of an appropriate number of general-
図12における演算装置1201は、汎用のCPU(中央処理装置:Central Processing Unit)やマイクロプロセッサ等の演算処理装置である。演算装置1201は、例えば後述する不揮発性記憶装置1203に記憶された各種ソフトウェア・プログラムを記憶装置1202に読み出し、係るソフトウェア・プログラムに従って処理を実行してもよい。例えば、上記各実施形態における並列処理装置の構成要素の機能は、演算装置1201により実行されるソフトウェア・プログラムを用いて実現されてもよい。
An
演算装置1201は、例えば、複数のCPUコアを備えたマルチコアCPUであってもよい。また演算装置1201は、1つのCPUコアが複数のスレッドを実行可能な、マルチスレッドCPUであってもよい。ハードウェア装置1200は、複数の演算装置1201を備えてもよい。
The
上記各実施形態において説明した並列プログラムは、複数の演算装置1201を用いて、並列にプロセスを実行することができる。この場合、並列プログラムは、1台のハードウェア装置1200に含まれる複数の演算装置1201により実行されもよい。並列プログラムは、複数のハードウェア装置1200に含まれる1以上の演算装置1201により実行されもよい。並列プログラムが生成するスレッドは、例えば、演算装置1201におけるCPUコアを用いて並列に実行される。
The parallel programs described in the above embodiments can execute processes in parallel using a plurality of
記憶装置1202は、演算装置1201から参照可能な、RAM等のメモリ装置であり、ソフトウェア・プログラムや各種データ等を記憶する。なお、記憶装置1202は、揮発性のメモリ装置であってもよい。
The
不揮発性記憶装置1203は、例えば磁気ディスクドライブや、フラッシュメモリによる半導体記憶装置等の、不揮発性の記憶装置である。不揮発性記憶装置1203は、各種ソフトウェア・プログラムやデータ等を記憶可能である。例えば、並列プログラムは、不揮発性記憶装置1203に記憶されてもよい。
The
ドライブ装置1204は、例えば、後述する記録媒体1205に対するデータの読み込みや書き込みを処理する装置である。
The
記録媒体1205は、例えば光ディスク、光磁気ディスク、半導体フラッシュメモリ等、データを記録可能な任意の記録媒体である。並列プログラムは、記録媒体1205に記録されていてもよい。
The
入出力インタフェース1206は、外部装置との間の入出力を制御する装置である。
The input /
上述した各実施形態を例に説明した本発明における並列処理装置、あるいはその構成要素は、例えば、図12に例示するハードウェア装置1200に対して、上記各実施形態において説明した機能を実現可能なソフトウェア・プログラムを供給することにより、実現されてもよい。
The parallel processing device according to the present invention described with the above-described embodiments as an example, or a component thereof, for example, can implement the functions described in the above-described embodiments with respect to the
より具体的には、例えば、係るハードウェア装置1200に対して供給したソフトウェア・プログラムを、演算装置1201が実行することによって、本発明が実現されてもよい。この場合、係るハードウェア装置1200で稼働しているオペレーティングシステムや、データベース管理ソフト、ネットワークソフト、仮想環境基盤等のミドルウェアなどが各処理の一部を実行してもよい。
More specifically, for example, the present invention may be realized by the
上述した各実施形態において、上記各図に示した各部は、上述したハードウェアにより実行されるソフトウェア・プログラムの機能(処理)単位である、ソフトウェアモジュールとして実現することができる。ただし、これらの図面に示した各ソフトウェアモジュールの区分けは、説明の便宜上の構成であり、実装に際しては、様々な構成が想定され得る。 In each embodiment described above, each unit illustrated in each of the above drawings can be realized as a software module, which is a function (processing) unit of a software program executed by the hardware described above. However, the division of each software module shown in these drawings is a configuration for convenience of explanation, and various configurations can be assumed for implementation.
図4A、図4Bに例示した並列処理装置の各構成要素をソフトウェアモジュールとして実現する場合、例えば、これらのソフトウェアモジュールが不揮発性記憶装置1203に記憶されてもよい。そして、演算装置1201がそれぞれの処理を実行する際に、これらのソフトウェアモジュールを記憶装置1202に読み出してもよい。
When the respective components of the parallel processing device illustrated in FIGS. 4A and 4B are realized as software modules, for example, these software modules may be stored in the
また、これらのソフトウェアモジュールは、共有メモリやプロセス間通信等の適宜の方法により、相互に各種データを伝達できるように構成されてもよい。このような構成により、これらのソフトウェアモジュールは、相互に通信可能に接続される。 In addition, these software modules may be configured to transmit various data to each other by an appropriate method such as shared memory or inter-process communication. With such a configuration, these software modules are connected so as to communicate with each other.
更に、上記ソフトウェア・プログラムは記録媒体1205に記録されてもよい。この場合、上記ソフトウェア・プログラムは、上記並列処理装置の出荷段階、あるいは運用段階等において、適宜ドライブ装置1204を通じて不揮発性記憶装置1203に格納されるよう構成されてもよい。
Further, the software program may be recorded on the
なお、上記の場合において、上記ハードウェア装置1200への各種ソフトウェア・プログラムの供給方法は、出荷前の製造段階、あるいは出荷後のメンテナンス段階等において、適当な治具を利用して当該装置内にインストールする方法を採用してもよい。また、各種ソフトウェア・プログラムの供給方法は、インターネット等の通信回線を介して外部からダウンロードする方法等のように、現在では一般的な手順を採用してもよい。
In the above case, the method of supplying various software programs to the
そして、このような場合において、本発明は、係るソフトウェア・プログラムを構成するコード、あるいは係るコードが記録されたところの、コンピュータ読み取り可能な記録媒体によって構成されると捉えることができる。この場合、係る記録媒体は、ハードウェア装置1200と独立した媒体に限らず、LANやインターネットなどにより伝送されたソフトウェア・プログラムをダウンロードして記憶又は一時記憶した記録媒体を含む。
In such a case, the present invention can be considered to be configured by a code that constitutes the software program or a computer-readable recording medium on which the code is recorded. In this case, the recording medium is not limited to a medium independent of the
また、上述した並列処理装置の構成要素は、図12に例示するハードウェア装置1200を仮想化した仮想化環境と、当該仮想化環境において実行される各種ソフトウェア・プログラム(コンピュータ・プログラム)とによって構成されてもよい。この場合、図12に例示するハードウェア装置1200の構成要素は、当該仮想化環境における仮想デバイスとして提供される。なお、この場合も、図12に例示するハードウェア装置1200を物理的な装置として構成した場合と同様の構成にて、本発明を実現可能である。
Further, the components of the parallel processing device described above are configured by a virtualized environment in which the
以上、本発明を、上述した模範的な実施形態に適用した例として説明した。しかしながら、本発明の技術的範囲は、上述した各実施形態に記載した範囲には限定されない。当業者には、係る実施形態に対して多様な変更又は改良を加えることが可能であることは明らかである。そのような場合、係る変更又は改良を加えた新たな実施形態も、本発明の技術的範囲に含まれ得る。上述した各実施形態を組合せた実施形態も本発明の技術的範囲に含まれる。更に、上述した各実施形態と、上述した各実施形態に変更又は改良を加えた新たな実施形態とを組合せた実施形態も、本発明の技術的範囲に含まれ得る。そしてこのことは、特許請求の範囲に記載した事項から明らかである。 In the above, this invention was demonstrated as an example applied to exemplary embodiment mentioned above. However, the technical scope of the present invention is not limited to the scope described in the above embodiments. It will be apparent to those skilled in the art that various modifications and improvements can be made to such embodiments. In such a case, new embodiments to which such changes or improvements are added can also be included in the technical scope of the present invention. Embodiments combining the above-described embodiments are also included in the technical scope of the present invention. Furthermore, embodiments combining the above-described embodiments and new embodiments obtained by changing or improving the above-described embodiments may also be included in the technical scope of the present invention. This is clear from the matters described in the claims.
100 並列処理装置
101 プロセス間通信部
102 マルチスレッド制御部
200 プロセス間通信部
201 通信開始処理部
202 通信完了処理部
203 通信処理管理部
204 通信処理記録部
300 マルチスレッド制御部
301 バリア同期処理部
302 同期待ちスレッド記録部
1201 演算装置
1202 記憶装置
1203 不揮発性記憶装置
1204 ドライブ装置
1205 記録媒体
1206 入出力インタフェース
DESCRIPTION OF
Claims (10)
前記並列プログラムの実行過程で生成された複数のスレッドのうち、第1のスレッドにおいて同期処理が実行されてから、その前記第1のスレッドと、複数の前記スレッドのうち、他の前記スレッドである1以上の第2のスレッドとが同期されるまでに、前記第1のスレッドにより前記プロセス間通信を進行するマルチスレッド制御部と、を備える
並列処理装置。 An interprocess communication unit capable of controlling interprocess communication including at least data transfer processing, which is executed between a plurality of processes in a parallel program;
Among the plurality of threads generated in the execution process of the parallel program, the first thread and the other of the plurality of threads after the synchronization processing is executed in the first thread. A parallel processing device comprising: a multi-thread control unit that advances the inter-process communication by the first thread until one or more second threads are synchronized.
前記第1のスレッドにおいて同期処理が実行されることにより、その前記第1のスレッドが同期待ち状態になった場合、1以上の前記第2のスレッドのそれぞれについて同期待ち状態であるか否かを判定し、いずれか1以上の前記第2のスレッドが同期待ち状態でない場合に、前記第1のスレッドにより、前記プロセス間通信部が提供する機能を用いて、前記プロセス間通信に関する処理を実行する
請求項1に記載の並列処理装置。 The multi-thread controller is
When synchronization processing is executed in the first thread and the first thread enters a synchronization waiting state, whether or not each of the one or more second threads is in a synchronization waiting state is determined. And when any one or more of the second threads is not in a synchronization waiting state, the first thread executes a process related to the inter-process communication using a function provided by the inter-process communication unit. The parallel processing apparatus according to claim 1.
前記マルチスレッド制御部は、前記第1のスレッドが同期待ち状態になってから、全ての前記第2のスレッドが同期待ち状態になるまでの間に、前記第1のスレッドにより、前記プロセス間通信部が提供する機能を用いて、前記プロセス間通信を進行する処理を実行する
請求項2に記載の並列処理装置。 The first thread is a thread that is first in a synchronization waiting state among the plurality of generated threads,
The multi-thread control unit performs the inter-process communication by the first thread between the time when the first thread is in a synchronization waiting state and the time when all the second threads are in a synchronization waiting state. The parallel processing apparatus according to claim 2, wherein a process that advances the interprocess communication is executed using a function provided by a unit.
前記プロセス間通信部は、前記順序関係に従って前記データ転送処理の段階を進めることにより、前記プロセス間通信の進行を制御可能であり、
前記マルチスレッド制御部は、前記第1のスレッドにより、前記プロセス間通信部が提供する機能を用いて、前記プロセス間通信を進行する処理を実行する
請求項2又は請求項3に記載の並列処理装置。 The inter-process communication includes one or more stages of the data transfer process having an order relationship,
The inter-process communication unit can control the progress of the inter-process communication by advancing the stage of the data transfer process according to the order relationship,
4. The parallel processing according to claim 2, wherein the multi-thread control unit executes a process of progressing the inter-process communication by using the function provided by the inter-process communication unit by the first thread. 5. apparatus.
前記プロセス間通信部は、前記完了処理において、一つ前の段階の前記データ転送処理が完了したか否かを確認し、
一つ前の段階の前記データ転送処理が完了した場合には、当該段階における前記データ転送処理を実行するとともに前記プロセス間通信の段階を次の段階に設定し、
一つ前の段階の前記データ転送処理が完了していない場合には、当該一つ前の段階における前記データ転送処理の完了を待たずに前記完了処理を中断するとともに、前記データ転送処理が完了していない前記プロセス間通信の段階を表す情報を提供する
請求項4に記載の並列処理装置。 The inter-process communication includes, for each stage of the inter-process communication, at least one of a completion process that completes the data transfer of the previous stage and a process that executes the data transfer in each stage,
The inter-process communication unit confirms whether or not the data transfer process of the previous stage is completed in the completion process,
When the data transfer process of the previous stage is completed, the data transfer process in the stage is executed and the inter-process communication stage is set to the next stage,
If the data transfer process in the previous stage is not completed, the completion process is interrupted without waiting for the completion of the data transfer process in the previous stage, and the data transfer process is completed. The parallel processing device according to claim 4, wherein the parallel processing device provides information indicating a stage of the inter-process communication that is not performed.
前記プロセス間通信を特定可能な情報と、前記プロセス間通信の段階を表す情報とを関連付けて保持する通信処理記録部を有し、
前記データ転送の完了を待たずに前記完了処理を中断する場合、前記データ転送処理が完了していない前記プロセス間通信の段階を表す情報を前記通信処理記録部に設定し、
前記第1のスレッドにより前記プロセス間通信に関する処理が実行された際、前記通信処理記録部に設定された前記プロセス間通信の段階を表す情報を用いて、その情報により表される段階から、前記プロセス間通信を進行する処理を実行する
請求項5に記載の並列処理装置。 The inter-process communication unit is
A communication processing recording unit that holds information that can identify the inter-process communication and information that represents a stage of the inter-process communication;
When the completion process is interrupted without waiting for the completion of the data transfer, information indicating the stage of the inter-process communication in which the data transfer process is not completed is set in the communication process recording unit,
When processing related to the inter-process communication is executed by the first thread, using the information indicating the stage of the inter-process communication set in the communication processing recording unit, from the stage represented by the information, The parallel processing device according to claim 5, wherein the processing for performing interprocess communication is executed.
請求項2又は請求項3に記載の並列処理装置。 The multi-thread control unit is configured such that the first thread enters a synchronization wait state after all the second threads enter a synchronization wait state after the first thread enters a synchronization wait state. 3. The process for advancing the inter-process communication is executed by the first thread using a function provided by the inter-process communication unit within a range that does not exceed a reference time. Item 4. The parallel processing device according to Item 3.
前記回路要素から参照可能な記憶領域を提供する記憶装置と、を備え、
前記回路要素は、
並列プログラムにおける複数のプロセスの間で実行される、データ転送処理を少なくとも含むプロセス間通信を制御する機能と、
前記並列プログラムの実行過程で生成された複数のスレッドのうち、第1のスレッドにおいて同期処理が実行されてから、その前記第1のスレッドと、複数の前記スレッドのうち、他の前記スレッドである1以上の第2のスレッドとが同期されるまでに、前記プロセス間通信に関する処理を実行する機能と、を実行可能な構成を有する
並列処理装置。 One or more circuit elements including one or more arithmetic units;
A storage device that provides a storage area that can be referred to from the circuit element,
The circuit element is:
A function for controlling inter-process communication including at least data transfer processing executed between a plurality of processes in a parallel program;
Among the plurality of threads generated in the execution process of the parallel program, the first thread and the other of the plurality of threads after the synchronization processing is executed in the first thread. A parallel processing device having a configuration capable of executing a function for executing processing related to the inter-process communication until one or more second threads are synchronized.
前記並列プログラムの実行過程で生成された複数のスレッドうち、第1のスレッドにおいて同期処理が実行されてから、その前記第1のスレッドと、複数の前記スレッドのうち、他の前記スレッドである1以上の第2のスレッドとが同期されるまでに、前記第1のスレッドにより前記プロセス間通信を進行する
並列処理方法。 Controlling inter-process communication including at least data transfer processing executed between a plurality of processes in the parallel program in response to execution of the parallel program;
Among the plurality of threads generated in the execution process of the parallel program, the first thread is the other thread among the first thread and the plurality of threads after the synchronization process is executed in the first thread. A parallel processing method in which the inter-process communication proceeds by the first thread before the above second thread is synchronized.
並列プログラムの実行に応じて、前記並列プログラムにおける複数のプロセスの間で実行される、データ転送処理を少なくとも含むプロセス間通信を制御する処理と、
前記並列プログラムの実行過程で生成された複数のスレッドうち、第1のスレッドにおいて同期処理が実行されてから、その前記第1のスレッドと、複数の前記スレッドのうち、他の前記スレッドである1以上の第2のスレッドとが同期されるまでに、前記第1のスレッドにより前記プロセス間通信を進行する処理と、を実行させる
コンピュータ・プログラム。 In a computer equipped with an arithmetic processing unit capable of processing a plurality of threads in parallel,
A process for controlling inter-process communication including at least a data transfer process, which is executed between a plurality of processes in the parallel program according to the execution of the parallel program;
Among the plurality of threads generated in the execution process of the parallel program, the first thread is the other thread among the first thread and the plurality of threads after the synchronization process is executed in the first thread. A computer program for executing the process of progressing the inter-process communication by the first thread until the above second thread is synchronized.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2016047000A JP6658123B2 (en) | 2016-03-10 | 2016-03-10 | Parallel processing device, parallel processing method and program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2016047000A JP6658123B2 (en) | 2016-03-10 | 2016-03-10 | Parallel processing device, parallel processing method and program |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2017162266A true JP2017162266A (en) | 2017-09-14 |
| JP6658123B2 JP6658123B2 (en) | 2020-03-04 |
Family
ID=59857063
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2016047000A Active JP6658123B2 (en) | 2016-03-10 | 2016-03-10 | Parallel processing device, parallel processing method and program |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP6658123B2 (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2026019013A1 (en) * | 2024-07-16 | 2026-01-22 | 삼성전자 주식회사 | Electronic device and method for communicating between plurality of processes, and storage medium |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH05290005A (en) * | 1992-04-10 | 1993-11-05 | Fujitsu Ltd | Load uniformalizing method for parallel processing |
| JPH11312148A (en) * | 1998-04-28 | 1999-11-09 | Hitachi Ltd | Barrier synchronization method and apparatus |
| JP2012048515A (en) * | 2010-08-27 | 2012-03-08 | Internatl Business Mach Corp <Ibm> | Parallel calculation processing for transmission and reception of data over multiple nodes without barrier synchronization |
-
2016
- 2016-03-10 JP JP2016047000A patent/JP6658123B2/en active Active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH05290005A (en) * | 1992-04-10 | 1993-11-05 | Fujitsu Ltd | Load uniformalizing method for parallel processing |
| JPH11312148A (en) * | 1998-04-28 | 1999-11-09 | Hitachi Ltd | Barrier synchronization method and apparatus |
| JP2012048515A (en) * | 2010-08-27 | 2012-03-08 | Internatl Business Mach Corp <Ibm> | Parallel calculation processing for transmission and reception of data over multiple nodes without barrier synchronization |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2026019013A1 (en) * | 2024-07-16 | 2026-01-22 | 삼성전자 주식회사 | Electronic device and method for communicating between plurality of processes, and storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| JP6658123B2 (en) | 2020-03-04 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP4597553B2 (en) | Computer processor and processor | |
| US9665404B2 (en) | Optimization of map-reduce shuffle performance through shuffler I/O pipeline actions and planning | |
| CN107077390B (en) | A task processing method and network card | |
| CN107943592B (en) | GPU cluster environment-oriented method for avoiding GPU resource contention | |
| JP2002366533A (en) | Computer network and computer readable medium | |
| JP2019535072A (en) | System and method for providing messages to multiple subscribers | |
| JP2010079622A (en) | Multi-core processor system and task control method thereof | |
| WO2013185571A1 (en) | Thread control and invoking method of multi-thread virtual assembly line processor, and processor thereof | |
| US8464269B2 (en) | Handling and reporting of object state transitions on a multiprocess architecture | |
| WO2024001411A1 (en) | Multi-thread scheduling method and device | |
| WO2021218492A1 (en) | Task allocation method and apparatus, electronic device, and computer readable storage medium | |
| US10289306B1 (en) | Data storage system with core-affined thread processing of data movement requests | |
| JP6658123B2 (en) | Parallel processing device, parallel processing method and program | |
| WO2023086204A1 (en) | Reducing latency in highly scalable hpc applications via accelerator-resident runtime management | |
| JP2019071037A (en) | Mpi achieving system based on built-in type operating system and method | |
| CN119743366A (en) | A Paxos message sending method, device, equipment, medium and product | |
| TWI442323B (en) | Work scheduling and distribution management architecture and method for multi-core/core core | |
| US10901807B2 (en) | Computer system with concurrency for multithreaded applications | |
| Deniziak et al. | Scheduling of distributed applications in HHPCaaS clouds for Internet of Things | |
| CN106936911B (en) | Lightweight distributed computing platform and computing resource management and control method | |
| JP5623187B2 (en) | Parallel computation processing that transmits and receives data across multiple nodes without barrier synchronization | |
| Shi et al. | DFlow: Efficient Dataflow-based Invocation Workflow Execution for Function-as-a-Service | |
| US20220276902A1 (en) | Method and processing unit for performing tasks through master slave rotation | |
| US20130290584A1 (en) | Sequence-based process locking | |
| US9189301B2 (en) | Data processing method and data processing system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20190215 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20191218 |
|
| TRDD | Decision of grant or rejection written | ||
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20200107 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20200120 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 6658123 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |