JP2005078244A - Program execution method and program performing device - Google Patents

Program execution method and program performing device Download PDF

Info

Publication number
JP2005078244A
JP2005078244A JP2003305958A JP2003305958A JP2005078244A JP 2005078244 A JP2005078244 A JP 2005078244A JP 2003305958 A JP2003305958 A JP 2003305958A JP 2003305958 A JP2003305958 A JP 2003305958A JP 2005078244 A JP2005078244 A JP 2005078244A
Authority
JP
Japan
Prior art keywords
program
thread
information
activation
information indicating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2003305958A
Other languages
Japanese (ja)
Inventor
Teruhiko Kamigata
輝彦 上方
Hideo Miyake
英雄 三宅
Atsuhiro Suga
敦浩 須賀
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2003305958A priority Critical patent/JP2005078244A/en
Publication of JP2005078244A publication Critical patent/JP2005078244A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To much more quickly and efficiently execute parallel processing by a plurality of PE(processor elements). <P>SOLUTION: A thread #0 transmits data to be transferred to a thread #1 attached with the start instruction of the thread #1 to a PE#1. When the instruction is inputted to the memory of the PE#1, interruption to the PE#1 is generated, and the thread #1 is started. Also, the thread #1 attaches the end notification of the thread #1 to the data(processing result) to be transferred to the thread #0, and when the notification is transmitted from the memory of the PE#1 to the PE#0, interruption to the PE#0 is generated, and the thread #1 is ended. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

この発明は、複数のPE(Processing Element:プロセッサエレメント)間で連携してプログラムを実行するプログラム実行方法およびプログラム実行装置に関する。   The present invention relates to a program execution method and a program execution device for executing a program in cooperation between a plurality of PEs (Processing Elements).

多種多様な機能を備えた巨大なプログラムを、ひとまとまりの機能を実現する部分プログラムに分割可能に作成しておき、それらのうち必要なものだけを選択的に組み合わせることで、処理の効率化を図る技術は従来から存在していた(たとえば、特許文献1参照。)。   A huge program with various functions can be divided into partial programs that realize a group of functions, and only those necessary ones can be selectively combined to improve processing efficiency. The technique to plan has existed conventionally (for example, refer patent document 1).

そして近年の計算機システムでは、複数のPEを搭載し、プログラム中の各部分プログラムをこれらのPEに配分することで処理能力の向上を図る例がある。その方式には大別して、PE間でメモリを共有する「共有メモリ型マルチプロセッサ方式(Shared-Memory Multiprocessors)」と、PEごとに専用のメモリを設ける「分散メモリ型マルチプロセッサ方式(Distributed-Memory Multiprocessors)」との2種類がある。   In recent computer systems, there is an example in which a plurality of PEs are mounted, and each partial program in the program is distributed to these PEs to improve the processing capacity. The methods are broadly divided into “Shared-Memory Multiprocessors” that share memory between PEs, and “Distributed-Memory Multiprocessors” that provides dedicated memory for each PE. ) ”.

そしてこのようなシステムにおいては、MPI(Message-Passing Interface)などのプロセッサ間通信機構を用いることで、SPMD(Single-Program,Multiple-Data)プログラミングにもとづくプログラムが実行されることが多い。   In such a system, a program based on SPMD (Single-Program, Multiple-Data) programming is often executed by using an inter-processor communication mechanism such as MPI (Message-Passing Interface).

図7はSPMDプログラミングにもとづいて作成されたプログラム(以下では単に「SPMDプログラム」と呼ぶ)の一例を示す説明図である。図示するプログラムは複数あるPEのそれぞれで実行される。プログラムは同一でも、PEのID(番号)により処理が分岐するので、複数のPEによる並列処理が実現される。たとえば図示するプログラムでは、「myrank」が上記IDを示す変数であり、myrank=0のPE(PE#0)ではTh0(スレッド#0)が、myrank=1のPE(PE#1)ではTh1(スレッド#1)が、myrank=2のPE(PE#2)ではTh2(スレッド#2)が、myrank=3のPE(PE#3)ではTh3(スレッド#3)が、それぞれ実行されることになる。   FIG. 7 is an explanatory diagram showing an example of a program created based on SPMD programming (hereinafter simply referred to as “SPMD program”). The illustrated program is executed by each of a plurality of PEs. Even if the program is the same, the processing branches depending on the ID (number) of the PE, so that parallel processing by a plurality of PEs is realized. For example, in the program shown in the figure, “myrank” is a variable indicating the ID, and Th0 (thread # 0) is used for PE (PE # 0) with myrank = 0, and Th1 (PE # 1) is used for PE with myrank = 1 (PE # 1). When thread # 1) is executed, PE2 with myrank = 2 (PE # 2) executes Th2 (thread # 2), and PE with myrank = 3 (PE # 3) executes Th3 (thread # 3). Become.

ただ、少なくとも分散メモリ型マルチプロセッサ方式の場合は、個々のプロセッサが実行するのはプログラムの一部のみ(部分プログラムのみ)であるにもかかわらず、すべてのPEにプログラムの全体が配分されるので、各PEにそれだけの容量のメモリを用意しなければならずコストがかさんでしまう。そこで、プログラムをSPMDでなく、MPMD(Multiple-Program,Multiple-Data)プログラミングにもとづいて作成することが考えられている。   However, at least in the case of the distributed memory type multiprocessor system, each processor executes only a part of the program (only a partial program), but the entire program is distributed to all PEs. Therefore, it is necessary to prepare a memory of that capacity for each PE, which increases costs. Therefore, it is considered to create a program based on MPMD (Multiple-Program, Multiple-Data) programming instead of SPMD.

MPMDにもとづくプログラミングでは、SPMDのように各PEにより実行される部分プログラムをすべて結合したようなプログラムでなく、端的にそれぞれのPE向けのプログラムを作成する。図8はPE#0、図9はPE#1、図10はPE#2、図11はPE#3向けのプログラムの一例をそれぞれ示す説明図である。図示するように各PE用のプログラムには、他PE用の部分プログラムが含まれないので、その分各PEのメモリの容量を小さくすることができる(なお、MPMDプログラミングの詳細については下記非特許文献1参照。)。   In programming based on MPMD, a program for each PE is created rather than a program in which all partial programs executed by each PE are combined as in SPMD. 8 is an explanatory diagram showing an example of a program for PE # 0, FIG. 9 is a PE # 1, FIG. 10 is a PE # 2, and FIG. 11 is an example of a program for PE # 3. As shown in the figure, since the program for each PE does not include a partial program for other PEs, the capacity of the memory of each PE can be reduced by that amount. Reference 1).

特開2001−282513号公報JP 2001-282513 A P.パチェコ著 「MPI並列プログラミング」培風館P. Pacheco "MPI Parallel Programming" Baifukan

しかしながら、分散メモリ型マルチプロセッサ方式のもとでMPMDプログラミングにもとづくプログラム(以下では単に「MPMDプログラム」と呼ぶ)を実行する場合、MPIによるプロセッサ間の通信の前/後に、相手先のプロセッサのスレッド(またはタスク、以下同じ)の起動/終了が必要であった。   However, when a program based on MPMD programming (hereinafter simply referred to as “MPMD program”) is executed under the distributed memory multiprocessor system, the thread of the partner processor is used before / after communication between processors by MPI. (Or task, the same shall apply hereinafter) must be started / stopped.

図8〜図11に示した各プログラムは、相手先のスレッドがすでに起動していることを前提としているが、もし相手先のスレッドが起動されていない場合、たとえば図8のプログラムでは「MPI_Send」を呼び出して他PEにデータを送信する前に、まずスレッド起動用のAPIを呼び出して、当該他PEにスレッドの起動を指示しなければならない。逆に、データを渡して処理を依頼したPEから「MPI_Recv」でその結果を受信した後は、スレッド終了用のAPIを呼び出して、当該PEにスレッドの終了を指示しなければならない。   Each of the programs shown in FIGS. 8 to 11 is based on the premise that the other party's thread has already been activated. If the other party's thread has not been activated, for example, in the program of FIG. 8, "MPI_Send" Before calling and sending data to another PE, it is necessary to first call a thread activation API to instruct the other PE to start a thread. On the other hand, after receiving the result with “MPI_Recv” from the PE that has passed the data and requested processing, the API for thread termination must be called to instruct the PE to terminate the thread.

MPIなどを利用した非同期な遠隔手続き呼び出し(Remote Procedure Call)における、スレッドの起動/終了の概念を図12に、データ転送の概念を図13に示す。図12および図13において、網掛けで示した部分はスレッドが処理を実行している状態、白抜きで示した部分はスレッドが処理を一時停止している状態、直線で示した部分はスレッドが起動されていない状態をそれぞれ意味している。   FIG. 12 shows the concept of thread activation / termination and FIG. 13 shows the concept of data transfer in asynchronous remote procedure call using MPI or the like. 12 and 13, the shaded portion indicates that the thread is executing processing, the outlined portion indicates that the thread is temporarily suspending processing, and the straight portion indicates that the thread is processing. It means that each is not activated.

PE#0上のスレッド#0は、PE#1上のスレッド#1を起動(図12「START」)してスレッド#1による処理の完了を待ち(図12「WAIT」)、当該処理が完了するとスレッド#1を終了する(図12「EXIT」)。   Thread # 0 on PE # 0 starts thread # 1 on PE # 1 (FIG. 12 “START”) and waits for the completion of processing by thread # 1 (FIG. 12 “WAIT”), and the processing is completed. Then, thread # 1 is terminated (FIG. 12, “EXIT”).

この起動から終了までの間(スレッド#1の起動中)に、スレッド#0は処理に必要なデータをスレッド#1へ送信し(図13上側の「MOVE」)、全データの送信完了まで待ちに入る(図13上側の「WAIT」)。そして送信完了後、スレッド#0はスレッド#1に処理結果を返信するよう指示するとともに(図13下側の「MOVE」)、全データの受信完了まで待ちに入り(図13下側の「WAIT」)、受信完了後に再び処理を開始する。   Between this start and end (while thread # 1 is starting), thread # 0 transmits data necessary for processing to thread # 1 ("MOVE" on the upper side of FIG. 13), and waits until transmission of all data is completed. ("WAIT" on the upper side of FIG. 13). After the transmission is completed, the thread # 0 instructs the thread # 1 to return the processing result (“MOVE” on the lower side of FIG. 13) and waits until reception of all the data is completed (“WAIT” on the lower side of FIG. 13). "), The processing is started again after the reception is completed.

このように従来技術においては、複数のPEによる並列処理を実現するには、(1)スレッドの起動(2)データの送信(3)データの受信(4)スレッドの終了、という4つの手順を踏む必要があり、これに対応して、MPMDプログラムにも少なくとも4種類の命令が含まれていた。そのため、プロセッサ間で処理を分散するためのオーバーヘッドが大きくなり、それだけ処理時間が長くかかってしまうという問題があった。   As described above, in the prior art, in order to realize parallel processing by a plurality of PEs, four procedures of (1) starting a thread (2) transmitting data (3) receiving data (4) ending a thread are performed. In response to this, the MPMD program also includes at least four types of instructions. For this reason, there is a problem that the overhead for distributing the processing among the processors becomes large, and the processing time is increased accordingly.

この発明は、上述した従来技術による問題点を解消するため、複数のPEによる並列処理をより高速かつ効率的に実行することが可能なプログラム実行方法およびプログラム実行装置を提供することを目的とする。   An object of the present invention is to provide a program execution method and a program execution apparatus capable of executing parallel processing by a plurality of PEs more quickly and efficiently in order to eliminate the above-described problems caused by the prior art. .

上述した課題を解決し、目的を達成するため、この発明にかかるプログラム実行方法およびプログラム実行装置は、第1のPEで実行中の第1のプログラムから第2のPEに第2のプログラムを実行させるプログラム実行方法またはプログラム実行装置において、前記第2のPEが、前記第1のプログラムから受信した情報中に前記第2のプログラムの起動を意味する情報が含まれている場合に、前記第2のプログラムを起動することを特徴とする。   In order to solve the above-described problems and achieve the object, a program execution method and a program execution device according to the present invention execute a second program from a first program being executed on a first PE to a second PE. In the program execution method or the program execution device to be executed, when the second PE includes information indicating activation of the second program in the information received from the first program, the second PE The program is started.

この発明によれば、第1のPEで実行中の第1のプログラムは、第2のプログラムが使用するデータに当該プログラムの起動を意味する値を添付して送信するだけで、すなわち、あらかじめ第2のプログラムを起動しておかなくても、当該送信先のPEのプログラムを起動することができる。   According to the present invention, the first program being executed by the first PE simply transmits the data used by the second program with a value indicating the start of the program attached, that is, the first program in advance. Even if the second program is not activated, the program of the destination PE can be activated.

また、この発明にかかるプログラム実行方法およびプログラム実行装置は、さらに前記第2のPEが、前記第1のプログラムへ送信した情報中に前記第2のプログラムの終了を意味する情報が含まれている場合に、前記第2のプログラムを終了することを特徴とする。   In the program execution method and the program execution device according to the present invention, the information transmitted from the second PE to the first program includes information indicating the end of the second program. In this case, the second program is terminated.

この発明によれば、第1のPEで実行中の第1のプログラムは、第2のプログラムに当該プログラムの終了を意味する値を送信させるだけで、当該送信元のプログラムを終了させることができる。   According to the present invention, the first program being executed by the first PE can end the transmission source program only by causing the second program to transmit a value indicating the end of the program. .

また、この発明にかかるプログラム実行方法およびプログラム実行装置は、前記第1のプログラムから受信もしくは前記第1のプログラムへ送信した情報中に前記第2のプログラムの起動もしくは終了を意味する値が含まれているか否かを、前記第2のPEのメモリに具備された検出回路により判定することを特徴とする。   In the program execution method and the program execution device according to the present invention, a value indicating activation or termination of the second program is included in the information received from the first program or transmitted to the first program. It is determined by a detection circuit provided in the memory of the second PE whether or not it is present.

この発明によれば、プログラムの起動もしくは終了を専用のハードウエアにより高速に実行することができる。   According to the present invention, the activation or termination of the program can be executed at high speed by dedicated hardware.

本発明にかかるプログラム実行方法およびプログラム実行装置によれば、データ転送を契機としてその送信先や送信元のプログラムを起動もしくは終了するので、従来転送命令とは別に必要であった起動命令や終了命令の実行が不要となる分、複数のPEによる並列処理の高速化および効率化を図ることができるという効果を奏する。   According to the program execution method and the program execution apparatus according to the present invention, the transmission destination and transmission source programs are activated or terminated in response to the data transfer, so that the activation instruction and termination instruction that are necessary separately from the conventional transfer instruction As a result, it is possible to increase the speed and efficiency of parallel processing by a plurality of PEs.

以下に添付図面を参照して、この発明にかかるプログラム実行方法およびプログラム実行装置の好適な実施の形態を詳細に説明する。   Exemplary embodiments of a program execution method and a program execution device according to the present invention will be explained below in detail with reference to the accompanying drawings.

この発明にかかるプログラム実行装置は、具体的には分散メモリ型マルチプロセッサ方式にもとづく計算機システムであり、プロセッサなどから構成されるn個のPEと、各PE専用のn個のメモリとが、相互接続網(Interconnection Network)により接続されている。そして各メモリには、スレッドの起動もしくは終了を意味する所定の値が入力した場合にその事実を検出するとともに、対応するプロセッサへ割り込みをかけて、スレッドを起動もしくは終了させる検出回路が設けられている。   The program execution device according to the present invention is specifically a computer system based on a distributed memory type multiprocessor system, and n PEs composed of processors and the like and n memories dedicated to each PE are mutually connected. Connected via an interconnection network. Each memory is provided with a detection circuit for detecting the fact when a predetermined value indicating the start or end of a thread is input and for interrupting the corresponding processor to start or end the thread. Yes.

図1および図2は、この発明にかかるプログラム実行装置における、複数PEによる並列処理の手順を模式的に示す説明図である。以下では説明の便宜上n=2とし、PE#0およびPE#1の連携を例として説明するが、n>2の場合も同様の手順となる。   1 and 2 are explanatory diagrams schematically showing a procedure of parallel processing by a plurality of PEs in the program execution device according to the present invention. In the following, for convenience of explanation, it is assumed that n = 2, and the cooperation of PE # 0 and PE # 1 is described as an example, but the same procedure is performed when n> 2.

まず、PE#0で実行中のスレッド#0は、PE#1により実行されるスレッド#1に処理を依頼するにあたって、スレッド#1が必要とする入力データをPE#0用のメモリ(以下では「メモリ#0」と呼ぶ)からPE#1用のメモリ(同「メモリ#1」)に送信する。このとき上記データに、スレッドの起動を意味する所定の値を付加する(図1(1))。   First, when thread # 0 executing in PE # 0 requests processing to thread # 1 executed by PE # 1, input data required by thread # 1 is stored in PE # 0 memory (hereinafter referred to as PE # 0). “Memory # 0”) is transmitted to the memory for PE # 1 (“memory # 1”). At this time, a predetermined value indicating the activation of the thread is added to the data (FIG. 1 (1)).

そしてこれを受信したメモリ#1の検出回路が、上記所定値を検出してPE#1に対する割り込み信号を発生し(図1(2))、これを受けたPE#1がスレッド#1を起動する。この起動されたスレッド#1が、メモリ#0からメモリ#1に送信されてきたデータを読み出して、所定の処理を実行する。   Upon receiving this, the detection circuit of the memory # 1 detects the predetermined value and generates an interrupt signal for the PE # 1 (FIG. 1 (2)). Upon receiving this, the PE # 1 starts the thread # 1. To do. The activated thread # 1 reads data transmitted from the memory # 0 to the memory # 1, and executes a predetermined process.

その後上記処理が終了すると、スレッド#1はメモリ#1に保存した上記処理の処理結果(スレッド#1からの出力データ)に、スレッド#1の終了を意味する所定の値を付加して、メモリ#0に送信し(図2(3))、PE#1によってスレッド#1が終了される(図2(4))。そしてこの受信時に上記所定値を検出したメモリ#0の検出回路が、PE#0に対する割り込み信号を発生する(図2(5))。   Thereafter, when the above process ends, the thread # 1 adds a predetermined value indicating the end of the thread # 1 to the processing result (output data from the thread # 1) stored in the memory # 1 to store the memory # 1. Transmit to # 0 (FIG. 2 (3)), and thread # 1 is terminated by PE # 1 (FIG. 2 (4)). The detection circuit of the memory # 0 that detects the predetermined value at the time of reception generates an interrupt signal for the PE # 0 (FIG. 2 (5)).

図3は、図1のようにして複数PEによる並列処理を実現する場合の各PEの稼働状況を示す説明図である。実行中のスレッド#0からの指示を受けたPE#0が、メモリ#0内のデータおよびスレッド起動指示をPE#1へ送信すると(図3(1))、メモリ#1から割り込みを受けたPE#1によりスレッド#1が起動される(図3(2))。そして、起動したスレッド#1からの指示を受けたPE#1により、メモリ#1内の上記データが読み出されて(図3(3))、これをもとにスレッド#1での処理がおこなわれる。   FIG. 3 is an explanatory diagram showing the operation status of each PE when parallel processing by a plurality of PEs is realized as shown in FIG. When PE # 0 receiving an instruction from the executing thread # 0 sends the data in thread # 0 and the thread activation instruction to PE # 1 (FIG. 3 (1)), an interrupt is received from memory # 1. Thread # 1 is activated by PE # 1 (FIG. 3 (2)). The data in the memory # 1 is read by the PE # 1 that has received an instruction from the activated thread # 1 (FIG. 3 (3)), and the processing in the thread # 1 is performed based on this data. It is carried out.

そしてその処理結果をスレッド#1から受け取ったPE#1(図3(4))が、PE#0に当該データおよびスレッド終了通知を送信する(図3(5))と同時に、PE#1によりスレッド#1が終了される(図3(6))。したがって、スレッド#1は図3(2)から(6)までの間だけ起動状態となる。一方、スレッド#0は終始起動中であるが、スレッド#1の処理結果を待つ間だけ一時停止状態となる(なお、通常スレッド#0はこの待ちの間に、スレッド#1の処理とは無関係な別の処理をおこなうが、ここでは簡略化して説明している)。   PE # 1 (FIG. 3 (4)) that receives the processing result from thread # 1 transmits the data and thread end notification to PE # 0 (FIG. 3 (5)). Thread # 1 is terminated (FIG. 3 (6)). Therefore, the thread # 1 is activated only during the period from (2) to (6) in FIG. On the other hand, thread # 0 has been running all the time, but is suspended only while waiting for the processing result of thread # 1 (note that normal thread # 0 is not related to the processing of thread # 1 during this waiting period) However, it is simplified here).

図4は、図1のような複数PEによる並列処理を従来技術のMPIを利用して実現する具体例を示す説明図である。図示するようにデータの送信時には「MPI_Send」、データの受信時には「MPI_Recv」を、それぞれ実行中のスレッドから呼び出して利用する。そしてこれらMPIの機能自体は従来技術と同様であるが、起動を意味する特定の値を他のスレッドから受信したときは、特段の指示がなくともスレッドを起動し、終了を意味する特定の値を他のスレッドに送信したときは、特段の指示がなくとも実行中のスレッドを終了する点が、本発明の特徴となっている。   FIG. 4 is an explanatory diagram showing a specific example in which parallel processing by a plurality of PEs as shown in FIG. 1 is realized using MPI of the prior art. As shown in the drawing, “MPI_Send” is called when data is transmitted, and “MPI_Recv” is called and used when data is received. These MPI functions themselves are the same as in the prior art, but when a specific value that means activation is received from another thread, the thread is activated without any special instruction, and a specific value that means termination. Is transmitted to another thread, the feature of the present invention is that the thread being executed is terminated without any special instruction.

図5は、この発明にかかるプログラム実行装置の機能構成を示す説明図である。図中、実行部500a/501aは各PEのプロセッサにより実現され、後述するスレッド起動/終了部500e/501eにより起動されたスレッドを実行する機能部である。   FIG. 5 is an explanatory diagram showing a functional configuration of the program execution device according to the present invention. In the drawing, an execution unit 500a / 501a is a functional unit that is realized by a processor of each PE and executes a thread activated by a thread activation / termination unit 500e / 501e described later.

送信部500b/501bは実行部500a/501aからの指示に従い、後述する記憶部500d/501d内のデータなどを他PEに送信する機能部である。受信部500c/501cは、他PEの送信部500b/501bから送信されてきたデータなどを受信する機能部である。なお、送信部500b/501bあるいは受信部500c/501cは、具体的には実行中のスレッドから呼び出された「MPI_Send」あるいは「MPI_Recv」によりソフトウエア的に実現される。   The transmission unit 500b / 501b is a functional unit that transmits data in a storage unit 500d / 501d, which will be described later, to another PE in accordance with an instruction from the execution unit 500a / 501a. The receiving unit 500c / 501c is a functional unit that receives data transmitted from the transmitting unit 500b / 501b of another PE. Note that the transmission unit 500b / 501b or the reception unit 500c / 501c is specifically realized by software by “MPI_Send” or “MPI_Recv” called from the thread being executed.

記憶部500d/501dは各PEのメモリにより実現され、実行部500a/501aにより実行されるスレッドのプログラムコード、他PEに送信するデータや他PEから受信したデータなどを保持する機能部である。スレッド起動/終了部500e/501eは各PEのメモリに具備された検出回路により実現され、スレッドの起動を意味する値が受信部500c/501cから記憶部500d/501dに入力したのを検知すると、実行部500a/501aに指示してスレッドを起動させるとともに、スレッドの終了を意味する値が記憶部500d/501dから送信部500b/501bに出力されたのを検知すると、実行部500a/501aに指示して実行中のスレッドを終了させる機能部である。   The storage units 500d / 501d are realized by the memories of the PEs, and are functional units that hold program codes of threads executed by the execution units 500a / 501a, data transmitted to other PEs, data received from other PEs, and the like. The thread activation / termination unit 500e / 501e is realized by a detection circuit provided in the memory of each PE, and detects that a value meaning thread activation is input from the reception unit 500c / 501c to the storage unit 500d / 501d. When the execution unit 500a / 501a is instructed to start the thread, and when it is detected that a value indicating the end of the thread is output from the storage unit 500d / 501d to the transmission unit 500b / 501b, the execution unit 500a / 501a is instructed. This is a functional unit that terminates the running thread.

図6は、この発明にかかるプログラム実行装置における、複数PEによる並列処理の手順を示すフローチャートである。   FIG. 6 is a flowchart showing the procedure of parallel processing by a plurality of PEs in the program execution device according to the present invention.

まず、PE#0側(処理を依頼する側)の実行部500aは、実行中のスレッド#0からの指示に従い、PE#1側への送信データを作成して記憶部500dに保存する(ステップS601)。この送信データは、具体的には(1)相手先PEに対するスレッドの起動指示(起動指示を意味する所定の値)、および(2)起動された当該スレッドへの入力データ、の二つからなる。   First, the execution unit 500a on the PE # 0 side (the requesting side) creates transmission data to the PE # 1 side and saves it in the storage unit 500d in accordance with an instruction from the executing thread # 0 (step 500). S601). Specifically, this transmission data is composed of (1) a thread activation instruction (a predetermined value meaning the activation instruction) to the partner PE, and (2) input data to the activated thread. .

次に、実行部500aからの指示を受けた送信部500bが、記憶部500d内の送信データをPE#1側に送信する(ステップS602)。そして、PE#1側の受信部501cにより受信された上記データは、スレッド起動/終了部501eを経由して記憶部501dに保存されるが(ステップS603)、このときスレッド起動/終了部501eが上記データ中にスレッドの起動指示を検出するのを待って、検出すると(ステップS604:Yes)、スレッド起動/終了部501eからの指示を受けた実行部501aによりスレッド#1が起動される(ステップS605)。   Next, the transmission unit 500b that receives the instruction from the execution unit 500a transmits the transmission data in the storage unit 500d to the PE # 1 side (step S602). The data received by the receiving unit 501c on the PE # 1 side is stored in the storage unit 501d via the thread activation / termination unit 501e (step S603). At this time, the thread activation / termination unit 501e Waiting for detection of a thread activation instruction in the data and detecting it (step S604: Yes), thread # 1 is activated by the execution unit 501a that has received an instruction from the thread activation / termination unit 501e (step S604). S605).

その後、実行部501aはスレッド#1による処理が終了すると、スレッド#1からの指示に従い、PE#0側への送信データを作成して記憶部501dに保存する(ステップS606)。この送信データは、具体的には(1)相手先PEに対するスレッドの終了通知(終了通知を意味する所定の値)、および(2)終了されたスレッドからの出力データ(処理結果)、の二つからなる。   Thereafter, when the processing by the thread # 1 is completed, the execution unit 501a creates transmission data to the PE # 0 side according to an instruction from the thread # 1, and stores it in the storage unit 501d (step S606). Specifically, the transmission data includes (1) a thread end notification (predetermined value indicating end notification) to the partner PE, and (2) output data (processing result) from the terminated thread. It consists of one.

記憶部501d内の送信データはスレッド起動/終了部501eを経由して、実行部501aからの指示を受けた送信部501bによりPE#0側に送信され(ステップS607)、スレッド#1が終了される(ステップS608)。このときスレッド起動/終了部500eが上記データ中にスレッドの終了通知を検出するのを待って、検出すると(ステップS609:Yes)、スレッド起動/終了部500eからの指示を受けた実行部500aによりスレッド#0が終了される(ステップS610)。   The transmission data in the storage unit 501d is transmitted to the PE # 0 side via the thread activation / termination unit 501e by the transmission unit 501b that receives an instruction from the execution unit 501a (step S607), and the thread # 1 is terminated. (Step S608). At this time, the thread activation / termination unit 500e waits for detection of the thread termination notification in the data and, if detected (step S609: Yes), the execution unit 500a that has received an instruction from the thread activation / termination unit 500e. Thread # 0 is terminated (step S610).

以上説明したように、この発明にかかるプログラム実行方法およびプログラム実行装置によれば、データを転送するだけでスレッドを起動もしくは終了できるので、データ転送前に相手先のスレッドの起動(起動用APIの呼び出し)、データ転送後に相手先のスレッドの終了(終了用APIの呼び出し)がそれぞれ必要であった従来技術より、処理の高速化および効率化を図ることが可能である。   As described above, according to the program execution method and the program execution device according to the present invention, the thread can be activated or terminated simply by transferring the data. Call) and the prior art that required termination of the partner thread after the data transfer (calling of the termination API), respectively, can increase the processing speed and efficiency.

なお、上述した実施の形態では、メモリ内の検出回路から割り込みをかけることでスレッドの実行制御をおこなったが、あるいは特定の値の検出時にメモリの特定領域にフラグを立てておき、プロセッサに定期的にこのフラグをチェックさせることで、スレッドの起動/終了を実現させるようにしてもよい。   In the above-described embodiment, thread execution control is performed by issuing an interrupt from the detection circuit in the memory. Alternatively, when a specific value is detected, a flag is set in a specific area of the memory and the processor is periodically set. Alternatively, the thread activation / termination may be realized by checking this flag.

(付記1)第1のPE(Processing Element)で実行中の第1のプログラムから第2のPEに第2のプログラムを実行させるプログラム実行方法において、
前記第1のプログラムから前記第2のPEに前記第2のプログラムの起動を意味する情報および前記第2のプログラムに引き渡す情報の少なくともいずれかを送信する送信工程と、
前記送信工程で送信された情報を受信する受信工程と、
前記受信工程で受信された情報中に前記第2のプログラムの起動を意味する情報が含まれているか否かを判定する判定工程と、
前記判定工程で、前記受信工程で受信された情報中に前記第2のプログラムの起動を意味する情報が含まれていると判定された場合に、前記第2のPEで前記第2のプログラムを起動する起動工程と、
を含むことを特徴とするプログラム実行方法。
(Supplementary Note 1) In a program execution method for causing a second PE to execute a second program from a first program being executed in a first PE (Processing Element),
A transmission step of transmitting at least one of information meaning activation of the second program and information handed over to the second program from the first program to the second PE;
A receiving step for receiving the information transmitted in the transmitting step;
A determination step of determining whether or not information indicating activation of the second program is included in the information received in the reception step;
In the determination step, when it is determined that the information received in the reception step includes information meaning the start of the second program, the second PE executes the second program. An activation process to be activated; and
A program execution method comprising:

(付記2)前記起動工程で起動された前記第2のプログラムから前記第1のプログラムに前記第2のプログラムの終了を意味する情報および前記第1のプログラムに引き渡す情報の少なくともいずれかを送信する第2の送信工程と、
前記第2の送信工程で送信された情報中に前記第2のプログラムの終了を意味する情報が含まれているか否かを判定する第2の判定工程と、
前記第2の判定工程で、前記第2の送信工程で送信された情報中に前記第2のプログラムの終了を意味する情報が含まれていると判定された場合に、前記第2のPEで前記第2のプログラムを終了する終了工程と、
を含むことを特徴とする前記付記1に記載のプログラム実行方法。
(Appendix 2) At least one of the information indicating the end of the second program and the information handed over to the first program is transmitted from the second program activated in the activation process to the first program. A second transmission step;
A second determination step of determining whether or not the information transmitted in the second transmission step includes information indicating the end of the second program;
In the second determination step, when it is determined that the information transmitted in the second transmission step includes information indicating the end of the second program, the second PE An ending step of ending the second program;
The program execution method according to appendix 1, wherein:

(付記3)前記判定工程および前記第2の判定工程では、前記情報中に前記第2のプログラムの起動もしくは終了を意味する情報が含まれているか否かを前記第2のPEのメモリに具備された検出回路により判定することを特徴とする前記付記1または付記2に記載のプログラム実行方法。 (Supplementary Note 3) In the determination step and the second determination step, the information of the second PE is included in the information indicating whether the information includes activation or termination of the second program. The program execution method according to the above supplementary note 1 or supplementary note 2, wherein the determination is made by the detected circuit.

(付記4)第1のPEで実行中の第1のプログラムから第2のPEに第2のプログラムを実行させるプログラム実行装置において、
前記第2のPEに前記第2のプログラムの起動を意味する情報および前記第2のプログラムに引き渡す情報の少なくともいずれかを送信する送信手段と、
前記送信手段により送信された情報を受信する受信手段と、
前記受信手段により受信された情報中に前記第2のプログラムの起動を意味する情報が含まれているか否かを判定する判定手段と、
前記判定手段により、前記受信手段により受信された情報中に前記第2のプログラムの起動を意味する情報が含まれていると判定された場合に、前記第2のプログラムを起動する起動手段と、
を備えることを特徴とするプログラム実行装置。
(Supplementary Note 4) In a program execution device for causing a second PE to execute a second program from a first program being executed in the first PE,
Transmitting means for transmitting to the second PE at least one of information meaning activation of the second program and information delivered to the second program;
Receiving means for receiving information transmitted by the transmitting means;
Determining means for determining whether or not the information received by the receiving means includes information indicating activation of the second program;
An activation unit that activates the second program when the determination unit determines that the information received by the reception unit includes information indicating the activation of the second program;
A program execution device comprising:

(付記5)前記起動手段により起動された前記第2のプログラムの終了を意味する情報および前記第1のプログラムに引き渡す情報の少なくともいずれかを送信する第2の送信手段と、
前記第2の送信手段により送信された情報中に前記第2のプログラムの終了を意味する情報が含まれているか否かを判定する第2の判定手段と、
前記第2の判定手段により、前記第2の送信手段により送信された情報中に前記第2のプログラムの終了を意味する情報が含まれていると判定された場合に、前記第2のプログラムを終了する終了手段と、
を備えることを特徴とする前記付記4に記載のプログラム実行装置。
(Additional remark 5) The 2nd transmission means which transmits at least any one of the information which means the end of the 2nd program started by the starting means, and the information handed over to the 1st program,
Second determination means for determining whether or not information indicating the end of the second program is included in the information transmitted by the second transmission means;
When the second determination means determines that the information transmitted by the second transmission means includes information indicating the end of the second program, the second program is Ending means for ending;
The program execution device according to appendix 4, wherein the program execution device is provided.

(付記6)前記判定手段および前記第2の判定手段は、前記第2のPEのメモリに具備された検出回路により実現されることを特徴とする前記付記4または付記5に記載のプログラム実行装置。 (Supplementary note 6) The program execution device according to supplementary note 4 or supplementary note 5, wherein the determination unit and the second determination unit are realized by a detection circuit provided in a memory of the second PE. .

本発明にかかるプログラム実行方法およびプログラム実行装置は、複数のPEにより連携して処理をおこなう計算機システムに有用であり、特に、各PE間の通信をMPI呼び出しによりおこなう計算機システムに適している。   The program execution method and the program execution apparatus according to the present invention are useful for a computer system that performs processing in cooperation with a plurality of PEs, and is particularly suitable for a computer system that performs communication between PEs by MPI calls.

この発明にかかるプログラム実行装置における、複数PEによる並列処理の手順(特にスレッドの起動手順)を模式的に示す説明図である。It is explanatory drawing which shows typically the procedure (especially thread | sled starting procedure) of the parallel processing by multiple PE in the program execution apparatus concerning this invention. この発明にかかるプログラム実行装置における、複数PEによる並列処理の手順(特にスレッドの終了手順)を模式的に示す説明図である。It is explanatory drawing which shows typically the procedure (especially completion | finish procedure of a thread | sled) of the parallel processing by multiple PE in the program execution apparatus concerning this invention. 図1のようにして複数PEによる並列処理を実現する場合の各PEの稼働状況を示す説明図である。It is explanatory drawing which shows the operation condition of each PE in the case of implement | achieving parallel processing by multiple PE like FIG. 図1のような複数PEによる並列処理を従来技術のMPIを利用して実現する具体例を示す説明図である。It is explanatory drawing which shows the specific example which implement | achieves parallel processing by multiple PE like FIG. 1 using MPI of a prior art. この発明にかかるプログラム実行装置の機能構成を示す説明図である。It is explanatory drawing which shows the function structure of the program execution apparatus concerning this invention. この発明にかかるプログラム実行装置における、複数PEによる並列処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the parallel processing by multiple PE in the program execution apparatus concerning this invention. 従来技術によるSPMDプログラムの一例を示す説明図である。It is explanatory drawing which shows an example of the SPMD program by a prior art. 従来技術によるMPMDプログラム(PE#0用)の一例を示す説明図である。It is explanatory drawing which shows an example of the MPMD program (for PE # 0) by a prior art. 従来技術によるMPMDプログラム(PE#1用)の一例を示す説明図である。It is explanatory drawing which shows an example of the MPMD program (for PE # 1) by a prior art. 従来技術によるMPMDプログラム(PE#2用)の一例を示す説明図である。It is explanatory drawing which shows an example of the MPMD program (for PE # 2) by a prior art. 従来技術によるMPMDプログラム(PE#3用)の一例を示す説明図である。It is explanatory drawing which shows an example of the MPMD program (for PE # 3) by a prior art. 従来技術におけるPE間でのスレッドの起動/終了を概念的に示す説明図である。It is explanatory drawing which shows notionally the start / end of the thread | sled between PE in a prior art. 従来技術におけるPE間でのデータ転送を概念的に示す説明図である。It is explanatory drawing which shows notionally the data transfer between PE in a prior art.

符号の説明Explanation of symbols

500a,501a 実行部
500b,501b 送信部
500c,501c 受信部
500d,501d 記憶部
500e,501e スレッド起動/終了部

500a, 501a execution unit 500b, 501b transmission unit 500c, 501c reception unit 500d, 501d storage unit 500e, 501e thread start / end unit

Claims (5)

第1のPE(プロセッサエレメント)で実行中の第1のプログラムから第2のPEに第2のプログラムを実行させるプログラム実行方法において、
前記第1のプログラムから前記第2のPEに前記第2のプログラムの起動を意味する情報および前記第2のプログラムに引き渡す情報の少なくともいずれかを送信する送信工程と、
前記送信工程で送信された情報を受信する受信工程と、
前記受信工程で受信された情報中に前記第2のプログラムの起動を意味する情報が含まれているか否かを判定する判定工程と、
前記判定工程で、前記受信工程で受信された情報中に前記第2のプログラムの起動を意味する情報が含まれていると判定された場合に、前記第2のPEで前記第2のプログラムを起動する起動工程と、
を含むことを特徴とするプログラム実行方法。
In a program execution method for causing a second PE to execute a second program from a first program being executed by a first PE (processor element),
A transmission step of transmitting at least one of information meaning activation of the second program and information handed over to the second program from the first program to the second PE;
A receiving step for receiving the information transmitted in the transmitting step;
A determination step of determining whether or not information indicating activation of the second program is included in the information received in the reception step;
In the determination step, when it is determined that the information received in the reception step includes information meaning the start of the second program, the second PE executes the second program. An activation process to be activated; and
A program execution method comprising:
前記起動工程で起動された前記第2のプログラムから前記第1のプログラムに前記第2のプログラムの終了を意味する情報および前記第1のプログラムに引き渡す情報の少なくともいずれかを送信する第2の送信工程と、
前記第2の送信工程で送信された情報中に前記第2のプログラムの終了を意味する情報が含まれているか否かを判定する第2の判定工程と、
前記第2の判定工程で、前記第2の送信工程で送信された情報中に前記第2のプログラムの終了を意味する情報が含まれていると判定された場合に、前記第2のPEで前記第2のプログラムを終了する終了工程と、
を含むことを特徴とする前記請求項1に記載のプログラム実行方法。
A second transmission that transmits at least one of information indicating the end of the second program and information delivered to the first program from the second program activated in the activation step to the first program. Process,
A second determination step of determining whether or not the information transmitted in the second transmission step includes information indicating the end of the second program;
In the second determination step, when it is determined that the information transmitted in the second transmission step includes information indicating the end of the second program, the second PE An ending step of ending the second program;
The program execution method according to claim 1, further comprising:
前記判定工程および前記第2の判定工程では、前記情報中に前記第2のプログラムの起動もしくは終了を意味する情報が含まれているか否かを前記第2のPEのメモリに具備された検出回路により判定することを特徴とする前記請求項1または請求項2に記載のプログラム実行方法。   In the determination step and the second determination step, a detection circuit provided in the memory of the second PE as to whether or not the information includes information indicating activation or termination of the second program. The program execution method according to claim 1, wherein the determination is made by the following method. 第1のPEで実行中の第1のプログラムから第2のPEに第2のプログラムを実行させるプログラム実行装置において、
前記第2のPEに前記第2のプログラムの起動を意味する情報および前記第2のプログラムに引き渡す情報の少なくともいずれかを送信する送信手段と、
前記送信手段により送信された情報を受信する受信手段と、
前記受信手段により受信された情報中に前記第2のプログラムの起動を意味する情報が含まれているか否かを判定する判定手段と、
前記判定手段により、前記受信手段により受信された情報中に前記第2のプログラムの起動を意味する情報が含まれていると判定された場合に、前記第2のプログラムを起動する起動手段と、
を備えることを特徴とするプログラム実行装置。
In a program execution device for causing a second PE to execute a second program from a first program being executed on the first PE,
Transmitting means for transmitting to the second PE at least one of information meaning activation of the second program and information delivered to the second program;
Receiving means for receiving information transmitted by the transmitting means;
Determining means for determining whether or not the information received by the receiving means includes information indicating activation of the second program;
An activation unit that activates the second program when the determination unit determines that the information received by the reception unit includes information indicating the activation of the second program;
A program execution device comprising:
前記起動手段により起動された前記第2のプログラムの終了を意味する情報および前記第1のプログラムに引き渡す情報の少なくともいずれかを送信する第2の送信手段と、
前記第2の送信手段により送信された情報中に前記第2のプログラムの終了を意味する情報が含まれているか否かを判定する第2の判定手段と、
前記第2の判定手段により、前記第2の送信手段により送信された情報中に前記第2のプログラムの終了を意味する情報が含まれていると判定された場合に、前記第2のプログラムを終了する終了手段と、
を備えることを特徴とする前記請求項4に記載のプログラム実行装置。
Second transmitting means for transmitting at least one of information indicating the end of the second program started by the starting means and information delivered to the first program;
Second determination means for determining whether or not information indicating the end of the second program is included in the information transmitted by the second transmission means;
When the second determination means determines that the information transmitted by the second transmission means includes information indicating the end of the second program, the second program is Ending means for ending;
The program execution device according to claim 4, further comprising:
JP2003305958A 2003-08-29 2003-08-29 Program execution method and program performing device Pending JP2005078244A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003305958A JP2005078244A (en) 2003-08-29 2003-08-29 Program execution method and program performing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003305958A JP2005078244A (en) 2003-08-29 2003-08-29 Program execution method and program performing device

Publications (1)

Publication Number Publication Date
JP2005078244A true JP2005078244A (en) 2005-03-24

Family

ID=34409165

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003305958A Pending JP2005078244A (en) 2003-08-29 2003-08-29 Program execution method and program performing device

Country Status (1)

Country Link
JP (1) JP2005078244A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009090964A1 (en) * 2008-01-17 2009-07-23 Nec Corporation Synchronization control method and information processing device
WO2010073313A1 (en) * 2008-12-22 2010-07-01 トヨタ自動車株式会社 Electronic control system for vehicle, electronic control unit for vehicle, and control synchronization method for vehicle

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009090964A1 (en) * 2008-01-17 2009-07-23 Nec Corporation Synchronization control method and information processing device
JP5246603B2 (en) * 2008-01-17 2013-07-24 日本電気株式会社 Synchronization control method and information processing apparatus
US8555291B2 (en) 2008-01-17 2013-10-08 Nec Corporation Synchronization control method and information processing device
WO2010073313A1 (en) * 2008-12-22 2010-07-01 トヨタ自動車株式会社 Electronic control system for vehicle, electronic control unit for vehicle, and control synchronization method for vehicle
US8290663B2 (en) 2008-12-22 2012-10-16 Toyota Jidosha Kabushiki Kaisha Vehicle electronic control system, vehicle electronic control unit, and vehicle control synchronization method

Similar Documents

Publication Publication Date Title
JP3636871B2 (en) Parallel processor system
US10592298B2 (en) Method for distributing load in a multi-core system
CN108647104B (en) Request processing method, server and computer readable storage medium
US5131085A (en) High performance shared main storage interface
JP2010272076A (en) Multiprocessor system
US5278975A (en) Synchronization control system in a parallel computer
CN110365786A (en) Job processing system, asynchronous operation dispatching method and computer equipment
JP2002024195A (en) Parallel processor and parallel process method
JP2005078244A (en) Program execution method and program performing device
US20120191772A1 (en) Processing a unit of work
CN110955461B (en) Processing method, device, system, server and storage medium for computing task
JPS62172840A (en) Transferring system for data
JPH1196108A (en) Computer system and bus control device
JP2003058515A (en) Inter-processor command processor, loose coupled multi- processor device, and command processing method
JPS5844266B2 (en) Multiprocessor parallel operation execution processing method
JP2008287562A (en) Processor and device control unit
JPH04274524A (en) System for controlling inter-process communication
JPH03210654A (en) Distributed control processor
JPH09218859A (en) Multiprocessor control system
JPH0573507A (en) Reliefing device in message communication between electronic computers
JPH02210567A (en) Input/output control system
JPS5856011A (en) Common bus using system
JP2879854B2 (en) Address conversion value setting processing method
JPH09212471A (en) Device and method for parallel processing program execution
JPH01292559A (en) Message processing system and data transfer system for parallel computers

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060802

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080307

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080318

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080519

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20080708