JP5265886B2 - Arithmetic processing system, arithmetic processing method, program, and computer-readable recording medium recording the program - Google Patents
Arithmetic processing system, arithmetic processing method, program, and computer-readable recording medium recording the program Download PDFInfo
- Publication number
- JP5265886B2 JP5265886B2 JP2007161627A JP2007161627A JP5265886B2 JP 5265886 B2 JP5265886 B2 JP 5265886B2 JP 2007161627 A JP2007161627 A JP 2007161627A JP 2007161627 A JP2007161627 A JP 2007161627A JP 5265886 B2 JP5265886 B2 JP 5265886B2
- Authority
- JP
- Japan
- Prior art keywords
- processing
- program system
- library
- calculation
- library program
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Executing Machine-Instructions (AREA)
- Devices For Executing Special Programs (AREA)
Abstract
Description
本発明は、ユーザプログラムを実行するユーザプログラムシステムと、上記ユーザプログラムにおいて利用されるライブラリプログラムを実行するライブラリプログラムシステムとを備えた演算処理システムに関するものである。 The present invention relates to an arithmetic processing system including a user program system that executes a user program and a library program system that executes a library program used in the user program.
従来、科学技術計算等の複雑かつ膨大な演算を行う場合などに、汎用の数値計算ライブラリの利用が広く行われている。汎用の数値計算ライブラリとは、例えば連立一次方程式を解く、行列の固有値を求める、スプライン補間する、微分方程式を解くなど、数値計算法のサブルーチン集のことである。 Conventionally, a general-purpose numerical calculation library has been widely used when performing complicated and enormous operations such as scientific and technical calculations. A general-purpose numerical calculation library is a collection of subroutines of numerical calculation methods such as solving simultaneous linear equations, obtaining eigenvalues of matrices, performing spline interpolation, and solving differential equations.
数値計算ライブラリを利用した演算は、基本的には、ユーザが生成し、利用するユーザプログラムが実行されるユーザプログラムシステムと、ライブラリプログラムが実行されるライブラリプログラムシステムとからなる演算処理システムによって実現される。ユーザは、ユーザプログラム中に、ライブラリプログラムの実行に関する命令を含めることにより、ライブラリプログラムを利用することになる。 The calculation using the numerical calculation library is basically realized by an arithmetic processing system including a user program system in which a user program generated and used by a user is executed and a library program system in which the library program is executed. The The user uses the library program by including an instruction related to the execution of the library program in the user program.
以上のように、数値計算ライブラリを利用することによって、ユーザは、複雑な数値解析プログラムを自分で作成する必要がなくなる。よって、科学技術計算を行う上でのユーザのプログラミングの負担を軽減することができる。 As described above, by using the numerical calculation library, the user does not need to create a complicated numerical analysis program himself. Therefore, it is possible to reduce the user's programming burden when performing scientific and technical calculations.
次に、従来の演算処理システムを用いて、例えば連立1次方程式Ax=bを解く場合について説明する。この場合、ユーザプログラムは次のような命令列となる。
REAL *8 A(LDA,N),B(N)
(データ生成)
計算:ライブラリコール
CALL LU(LDA,N,A,IERR)
CALL SOLVE(LDA,N,A,B,IERR)
(結果の利用)
END
ここで、Aは2次元配列Aに格納された行列であり、bは1次元配列Bに格納されたベクトルであるものとしている。
Next, a case where a simultaneous linear equation Ax = b is solved using a conventional arithmetic processing system will be described. In this case, the user program has the following instruction sequence.
REAL * 8 A (LDA, N), B (N)
(Data generation)
Calculation: Library call
CALL LU (LDA, N, A, IERR)
CALL SOLVE (LDA, N, A, B, IERR)
(Use of results)
END
Here, A is a matrix stored in the two-dimensional array A, and b is a vector stored in the one-dimensional array B.
上記のように、ユーザプログラムは、ライブラリプログラムの実行命令ごとにデータを指定するようになっている。すなわち、ライブラリプログラムの選択、使用する順番、データ形式の選択、および中間結果などのデータの管理のすべてについてユーザプログラムが責任を負わなければならない。 As described above, the user program designates data for each execution instruction of the library program. In other words, the user program must be responsible for the selection of the library program, the order of use, the selection of the data format, and the management of data such as intermediate results.
また、ライブラリプログラムシステムにおけるライブラリプログラムが改良されたり新たに追加されたりした場合、ユーザプログラムのユーザは、これを考慮して、ユーザプログラムの内容を変更する必要が生じる。 When a library program in the library program system is improved or newly added, the user of the user program needs to change the content of the user program in consideration of this.
また、ライブラリプログラムの実行命令には、データの形式についての指定も含まれているので、入力値を変更したい場合には、入力値を変更するだけでなく、データの形式に応じて実行命令自体も変更する必要が生じる。 In addition, the execution instruction of the library program includes specification of the data format, so if you want to change the input value, not only change the input value but also the execution instruction itself according to the data format Need to be changed.
そこで、ユーザプログラムのユーザが、ライブラリプログラムシステムにおける具体的な処理を意識することなく、より容易にライブラリプログラムを利用することを可能とする演算処理システムおよび演算手法が開示されている(特許文献4参照)。 Therefore, an arithmetic processing system and an arithmetic method are disclosed that allow a user of a user program to use the library program more easily without being aware of specific processing in the library program system (Patent Document 4). reference).
特許文献4に開示されている演算処理システムについて、図6に基づいて概略を説明すると以下の通りである。 An outline of the arithmetic processing system disclosed in Patent Document 4 will be described with reference to FIG.
図6は、上記開示されている演算処理システム101の概略構成を示すブロック図である。同図に示すように、演算処理システム101は、ユーザプログラムシステム102、およびライブラリプログラムシステム103を備えた構成となっている。
FIG. 6 is a block diagram showing a schematic configuration of the arithmetic processing system 101 disclosed above. As shown in the figure, the arithmetic processing system 101 includes a
ユーザプログラムシステム102は、ユーザが作成し、利用するユーザプログラムを実行するシステムである。このユーザプログラムシステム102は、入出力部111、転送処理部112、演算処理部113、および記憶部114を備えている。
The
入出力部111は、ユーザからの入力を受け付けるとともに、演算処理部113による演算結果をユーザに対して表示・出力するものである。転送処理部112は、ライブラリプログラムシステム103との間でのデータの送受信を行うものである。
The input / output unit 111 receives input from the user and displays / outputs the calculation result of the
演算処理部113は、ユーザプログラムの演算処理を行うものである。この演算処理部113は、ユーザプログラム実行部121、および転送制御部122を備えている。
The
ユーザプログラム実行部121は、記憶部114に記憶されているユーザプログラムを読み出して実行するものである。転送制御部122は、ユーザプログラム実行部121において実行されているユーザプログラムが、ライブラリプログラムシステム103に格納されているライブラリプログラムを利用する場合に、ライブラリプログラムシステム103に対してのデータの送受信に関する制御処理を行うものである。この転送制御部122は、数値データ転送部122A、演算依頼部122B、および演算結果受信部122Cを備えている。
The user
数値データ転送部122Aは、ライブラリプログラムシステム103に演算処理を実行させる際に、演算の入力値となる数値データおよびそのデータ形式をライブラリプログラムシステム103に転送する処理を行う。演算依頼部122Bは、ライブラリプログラムシステム103において行わせる演算内容の情報をライブラリプログラムシステム103に転送する処理を行う。この演算依頼情報は、特定のライブラリプログラムの実行命令ではなく、数学の演算式そのものを表す文字列を含んでいる。演算結果受信部122Cは、ライブラリプログラムシステム103におけるライブラリプログラムの実行結果をライブラリプログラムシステム103に対して要求するとともに、該実行結果をライブラリプログラムシステム103から受信する処理を行う。
The numerical
記憶部114は、演算処理部113における演算処理で用いられるデータを格納するとともに、演算処理部113のワークメモリとして機能する記憶手段である。この記憶部14は、ユーザプログラム格納部14A、数値データ格納部14B、および演算結果データ格納部14Cを備えている。ユーザプログラム格納部14Aは、演算処理部13において実行されるユーザプログラムを格納する領域である。数値データ格納部14Bは、数値データ転送部22Aによって転送される数値データおよびそのデータ形式を格納する領域である。演算結果データ格納部14Cは、演算結果受信部22Cによって受信された実行結果を格納する領域である。なお、実際のメモリの利用に際しては、数値データ格納部14Bおよび演算結果データ格納部14Cは、両者が区別されることなく、変数や配列として記憶部14に記憶される。また、ライブラリプログラム演算に関係しないその他の演算に必要とされる数値データなども記憶部14に格納される。
The
一方、ライブラリプログラムシステム103は、ユーザプログラムシステム102からの依頼に応じて、ライブラリプログラムを実行するシステムである。このライブラリプログラムシステム103は、転送処理部131、演算処理部132、および記憶部133を備えている。
On the other hand, the
転送処理部131は、ユーザプログラムシステム102との間でのデータの送受信を行うものである。
The
演算処理部132は、ライブラリプログラムの演算処理を行う。この演算処理部132は、ライブラリプログラム実行部142、および転送制御部141を備えている。
The
ライブラリプログラム実行部142は、記憶部133に記憶されているライブラリプログラムを読み出して実行する。転送制御部141は、ユーザプログラムシステム102において実行されているユーザプログラムが、ライブラリプログラムシステム103による処理を利用するものである場合に、ユーザプログラムシステム102からの要求に応じて、該ユーザプログラムシステム102に対してのデータの送受信に関する制御処理を行う。この転送制御部141は、数値データ受信部141A、演算方法決定部141B、および演算結果送信部141Cを備えている。
The library
数値データ受信部141Aは、ユーザプログラムシステム102から、例えばライブラリプログラムの実行時に用いられる演算の入力値となる数値データおよびそのデータ形式を受信する処理を行う。
The numerical
演算方法決定部141Bは、ユーザプログラムシステム102から送られてきた演算依頼情報を解析することによって、利用するライブラリプログラム、およびその実行順序を決定する処理を行う。演算結果送信部141Cは、ライブラリプログラム実行部142におけるライブラリプログラムの実行結果を、ユーザプログラムシステム102からの要求に応じてユーザプログラムシステム102へ送信する処理を行う。
The calculation
記憶部133は、演算処理部132における演算処理で用いられるデータを格納するとともに、演算処理部132のワークメモリとして機能する記憶手段である。
The
この記憶部33は、ライブラリプログラム格納部33A、数値データ格納部33B、および演算結果データ格納部33Cを備えている。ライブラリプログラム格納部33Aは、演算処理部32において実行されるライブラリプログラムを格納する領域である。数値データ格納部33Bは、数値データ転送部41Aによって受信された数値データおよびそのデータ形式を格納する領域である。演算結果データ格納部33Cは、ライブラリプログラム実行部42によるライブラリプログラムの実行結果を格納する領域である。なお、実際のメモリの利用に際しては、数値データ格納部33Bおよび演算結果データ格納部33Cは、両者が区別されることなく、変数や配列として記憶部33に記憶される。また、ライブラリプログラム演算において一時的に用いられる中間データとしての変数や、数値データに対するディレクトリ構造を示す管理情報なども記憶部33に格納される。
The
次に、演算処理システム101における動作例について説明する。ここでは、ユーザプログラムシステム102におけるユーザプログラムにおいて、連立1次方程式Ax=bを解くという命令が含まれており、この連立1次方程式Ax=bの演算がライブラリプログラムシステム103において行われる例を挙げて説明する。
Next, an operation example in the arithmetic processing system 101 will be described. Here, the user program in the
ここで、Aは係数行列であり、倍精度実数型の2次元配列に格納されるものとする。また、bはベクトルであり、倍精度実数型の1次元配列に格納されるものとする。また、xは解ベクトルであり、倍精度実数型の1次元配列に格納されるものとする。そして、係数行列Aおよびベクトルbは、ユーザプログラムの実行過程においてユーザプログラム実行部121により生成され、数値データ格納部114Bに配列A1および配列b1として格納されるものとする。
Here, A is a coefficient matrix, and is assumed to be stored in a double-precision real type two-dimensional array. Also, b is a vector and is stored in a one-dimensional array of double precision real numbers. Further, x is a solution vector, and is stored in a one-dimensional array of double precision real type. The coefficient matrix A and the vector b are generated by the user
まず、ユーザプログラムがユーザからの指示入力などに基づいて実行され、ユーザプログラム実行部121が、ユーザプログラムにおける次のステートメントを実行するものとする。
SILC_PUT('A',&A1)
SILC_PUT('b',&b1)
上記ステートメントは、ライブラリプログラムシステム103に対して、係数行列Aが格納された配列A1、および、ベクトルbが格納された配列b1を送信する、という命令を示している。上記のステートメントがユーザプログラム実行部121によって実行されると、数値データ転送部122Aは、配列A1および配列b1を、ライブラリプログラムシステム103に対して転送するように転送処理部112を制御する。これにより、配列A1および配列b1が、転送処理部112によってライブラリプログラムシステム103へ転送される。ライブラリプログラムシステム103では、数値データ受信部141Aが配列A1および配列b1を受信し、これを係数行列Aおよびベクトルbとして数値データ格納部133Bに格納する。
First, it is assumed that the user program is executed based on an instruction input from the user, and the user
SILC_PUT ('A', & A1)
SILC_PUT ('b', & b1)
The above statement indicates an instruction to transmit the array A1 storing the coefficient matrix A and the array b1 storing the vector b to the
次に、ユーザプログラム実行部121は、ユーザプログラムにおける次のステートメントを実行するものとする。
SILC_EXEC('x=A\b')
上記のステートメントは、ライブラリプログラムシステム103に対して、演算依頼情報として、連立1次方程式Ax=bを解くことを指示する命令を示している。この命令によって、ライブラリプログラムシステム3において演算が実行される。
Next, it is assumed that the user
SILC_EXEC ('x = A \ b')
The above statement indicates an instruction that instructs the
その後、ユーザプログラム実行部121は、ユーザプログラムにおける次のステートメントを実行するものとする。
SILC_GET(&x,'x')
上記のステートメントは、ライブラリプログラムシステム103から、演算結果としての解ベクトルxを受信する命令を示している。
Thereafter, the user
SILC_GET (& x, 'x')
The above statement indicates an instruction for receiving the solution vector x as the operation result from the
上記のステートメントが実行されると、演算結果受信部122Cは、結果要求情報としての上記ステートメントを、ライブラリプログラムシステム103に対して転送するように転送処理部112を制御する。これにより、結果要求情報が、転送処理部112によってライブラリプログラムシステム103へ転送される。演算結果受信部122Cが、演算結果データをライブラリプログラムシステム103から受信すると、演算結果データとしての解ベクトルxを演算結果データ格納部114Cに格納する。これにより、ライブラリプログラムシステム103を利用した演算が完了する。
When the above statement is executed, the calculation result receiving unit 122C controls the
以上のように、特許文献4に開示されている演算処理システムによれば、入力値情報の転送処理、演算内容の情報の転送処理、および演算結果の転送処理がそれぞれ別々に行われるので、ユーザプログラムを、各処理に関する命令をそれぞれ分離した状態で構成することができる。したがって、ユーザプログラムを細分化することが可能となるので、入力値の変更や演算内容の変更などをより容易に行うことが可能となる。 As described above, according to the arithmetic processing system disclosed in Patent Literature 4, input value information transfer processing, calculation content information transfer processing, and calculation result transfer processing are performed separately. The program can be configured in a state where instructions related to each process are separated from each other. Therefore, since the user program can be subdivided, it is possible to change the input value, change the calculation content, and the like more easily.
さらに、上記演算処理システムによれば、ユーザプログラムシステム側では、数学の演算式そのものを表す文字列をライブラリプログラムシステムに対して転送すればよいので、演算式をどのように解くべきかなどを考慮する必要がない。 Furthermore, according to the above arithmetic processing system, the user program system only has to transfer a character string representing the mathematical arithmetic expression itself to the library program system, and therefore consider how the arithmetic expression should be solved. There is no need to do.
さらに、上記演算処理システムによれば、ライブラリプログラムシステムにおいて実行される演算に関しては、ユーザプログラムシステムは関与する必要がないので、ユーザプログラムシステムにおけるユーザプログラムのサイズを小さくすることが可能となるとともに、ユーザプログラムシステムにおけるメモリ使用量も小さくすることが可能となる。
しかしながら、特許文献4に開示されている演算処理システムまたは演算処理手法において、条件分岐や反復などの制御構文を処理する場合は、ユーザプログラムを作成するユーザが、あらかじめ上記制御を含む処理が記述された関数を定義し、該定義された関数をライブラリプログラムシステムに渡しておく必要があった。そのため、ユーザプログラムを作成するユーザが、上記制御構文を含む任意の計算処理をユーザプログラムにて記述することができないという問題があった。 However, in the arithmetic processing system or arithmetic processing method disclosed in Patent Document 4, when processing a control syntax such as conditional branching and iteration, a user who creates a user program describes processing including the above control in advance. It is necessary to define a defined function and to pass the defined function to the library program system. Therefore, there is a problem that the user who creates the user program cannot describe any calculation process including the control syntax in the user program.
本発明は、上記の問題点に鑑みてなされたものであり、その目的は、ユーザが、制御処理を含む任意の計算処理を、計算環境に依存しないユーザプログラムに記述することを可能とし、より容易にライブラリプログラムを利用することができる演算処理システム、演算処理方法、ユーザプログラムシステム、ライブラリプログラムシステム、プログラム、および、プログラムを記録したコンピュータ読み取り可能な記録媒体を提供することにある。 The present invention has been made in view of the above-described problems, and its purpose is to allow a user to describe arbitrary calculation processing including control processing in a user program that does not depend on a calculation environment. An object of the present invention is to provide an arithmetic processing system, an arithmetic processing method, a user program system, a library program system, a program, and a computer-readable recording medium on which the program is recorded, in which a library program can be easily used.
上記課題を解決するために、本発明に係る演算処理システムは、ユーザプログラムを実行するユーザプログラムシステムと、上記ユーザプログラムにおいて利用されるライブラリプログラムを実行するライブラリプログラムシステムとを備えた演算処理システムにおいて、上記ユーザプログラムシステムが、上記ライブラリプログラムシステムを利用して実行する演算処理および上記ユーザプログラムシステムにて実行する制御処理を含む上記ユーザプログラムを解析し、上記演算処理を表す演算文字列および上記制御処理を表す制御文字列を抽出する演算制御処理抽出手段と、上記抽出した演算文字列に基づいて、上記演算処理における演算の入力値に関する入力値情報を上記ライブラリプログラムシステムに転送する処理を行う入力値転送手段と、上記抽出した演算文字列に基づいて、上記演算処理における演算の内容に関する演算依頼情報を該ライブラリプログラムシステムに転送する処理を行う演算依頼手段と、上記抽出した演算文字列に基づいて、上記ライブラリプログラムシステムにおけるライブラリプログラムの実行結果を該ライブラリプログラムシステムから受信する処理を行う演算結果受信手段と、上記抽出した制御文字列に基づいて、上記制御処理を実行する制御処理実行手段とを備え、上記ライブラリプログラムシステムが、上記ユーザプログラムシステムから送られた、上記入力値情報を受信する処理を行う入力値受信手段と、上記ユーザプログラムシステムから送られた、上記演算依頼情報を解析することによって、利用するライブラリプログラムの種類、およびその実行順序を決定する処理を行う演算方法決定手段と、上記ライブラリプログラムの実行結果を上記ユーザプログラムシステムへ送信する処理を行う演算結果送信手段とを備えていることを特徴としている。 In order to solve the above problems, an arithmetic processing system according to the present invention is an arithmetic processing system including a user program system that executes a user program and a library program system that executes a library program used in the user program. The user program system analyzes the user program including arithmetic processing executed using the library program system and control processing executed by the user program system, and an arithmetic character string representing the arithmetic processing and the control An arithmetic control processing extraction means for extracting a control character string representing processing, and an input for performing processing for transferring input value information related to an input value of the arithmetic operation in the arithmetic processing to the library program system based on the extracted arithmetic character string Price change Based on the extracted calculation character string, on the basis of the extracted calculation character string, on the basis of the extracted calculation character string, the calculation request means for performing processing for transferring calculation request information related to the contents of the calculation in the calculation processing to the library program system, Computation result receiving means for performing processing for receiving the execution result of the library program in the library program system from the library program system, and control processing executing means for executing the control processing based on the extracted control character string The library program system analyzes input value receiving means for receiving the input value information sent from the user program system and the calculation request information sent from the user program system. , Type of library program to use , And a computing method determining means for performing a process of determining the order of execution is an execution result of said library program is characterized in that an arithmetic result transmitting means for performing a process of transmitting to the user program system.
また、本発明に係る演算処理方法は、ユーザプログラムを実行するユーザプログラムシステムと、上記ユーザプログラムにおいて利用されるライブラリプログラムを実行するライブラリプログラムシステムとを備えた演算処理システムにおける演算処理方法において、上記ユーザプログラムシステムにおける、上記ライブラリプログラムシステムを利用して実行する演算処理および上記ユーザプログラムシステムにて実行する制御処理を含む上記ユーザプログラムを解析し、上記演算処理を表す演算文字列および上記制御処理を表す制御文字列を抽出する演算制御処理抽出ステップと、上記抽出した演算文字列に基づいて、上記演算処理における演算の入力値に関する入力値情報を上記ライブラリプログラムシステムに転送する処理を行う入力値転送ステップと、上記抽出した演算文字列に基づいて、上記演算処理における演算の内容に関する演算依頼情報を該ライブラリプログラムシステムに転送する処理を行う演算依頼ステップと、上記抽出した演算文字列に基づいて、上記ライブラリプログラムシステムにおけるライブラリプログラムの実行結果を該ライブラリプログラムシステムから受信する処理を行う演算結果受信ステップと、上記抽出した制御文字列に基づいて、上記制御処理を実行する制御処理実行ステップと、上記ライブラリプログラムシステムにおける、上記ユーザプログラムシステムから送られた、上記入力値情報を受信する処理を行う入力値受信ステップと、上記ユーザプログラムシステムから送られた、上記演算依頼情報を解析することによって、利用するライブラリプログラムの種類、およびその実行順序を決定する処理を行う演算方法決定ステップと、上記ライブラリプログラムの実行結果を上記ユーザプログラムシステムへ送信する処理を行う演算結果送信ステップとを含むことを特徴としている。 An arithmetic processing method according to the present invention is an arithmetic processing method in an arithmetic processing system including a user program system that executes a user program and a library program system that executes a library program used in the user program. In the user program system, the user program including the arithmetic processing executed using the library program system and the control processing executed in the user program system is analyzed, and the arithmetic character string representing the arithmetic processing and the control processing are analyzed. An operation control process extraction step for extracting a control character string to be represented, and an input process for transferring input value information related to the input value of the operation in the operation process to the library program system based on the extracted operation character string. Based on the value transfer step, the calculation request step for performing processing for transferring calculation request information relating to the calculation contents in the calculation processing to the library program system based on the extracted calculation character string, and the extracted calculation character string A calculation result receiving step for performing processing for receiving the execution result of the library program in the library program system from the library program system, and a control processing execution step for executing the control processing based on the extracted control character string. In the library program system, an input value receiving step for receiving the input value information sent from the user program system and analyzing the calculation request information sent from the user program system , Use It includes an operation method determining step for performing processing for determining the type of library program and its execution order, and an operation result transmitting step for performing processing for transmitting the execution result of the library program to the user program system. .
上記の構成および方法によれば、ユーザプログラムシステムにおいてユーザプログラムを実行するとき、ライブラリプログラムシステムを利用して実行する演算処理と、ユーザプログラムシステムにて実行する条件分岐や反復などの制御処理とをそれぞれ分離して抽出することができる。 According to the above configuration and method, when a user program is executed in the user program system, arithmetic processing executed using the library program system and control processing such as conditional branching and iteration executed in the user program system are performed. Each can be separated and extracted.
そして、1)上記抽出した演算処理をライブラリプログラムを利用して実行するために、次の処理が行われる。すなわち、ます、演算の入力値に関する入力値情報がユーザプログラムシステムからライブラリプログラムシステムへ転送される。次に、演算内容の情報がユーザプログラムシステムからライブラリプログラムシステムへ転送され、ライブラリプログラムシステムにおいて利用するライブラリプログラムの種類、およびその実行順序が決定される。そして、ユーザプログラムシステムからの要求に応じて、実行結果がライブラリプログラムシステムからユーザプログラムシステムへ転送される。 1) In order to execute the extracted arithmetic processing using a library program, the following processing is performed. That is, the input value information related to the input value of the operation is transferred from the user program system to the library program system. Next, information on the calculation contents is transferred from the user program system to the library program system, and the type of library program used in the library program system and its execution order are determined. Then, the execution result is transferred from the library program system to the user program system in response to a request from the user program system.
そして、2)上記抽出した制御処理は、上記演算処理とは独立して、ユーザプログラムシステムにて実行することができる。 2) The extracted control process can be executed by the user program system independently of the arithmetic process.
よって、演算処理と制御処理とをユーザが明示的に分離して演算処理システムに与える必要がなく、制御処理と演算処理とが混在したユーザプログラムを実行することが可能となる。特に、ユーザが、あらかじめ上記制御を含む処理が記述された関数を定義し、該定義された関数をライブラリプログラムシステムに渡しておく必要がなくなる。 Therefore, it is not necessary for the user to explicitly separate the arithmetic processing and the control processing and give them to the arithmetic processing system, and a user program in which the control processing and the arithmetic processing are mixed can be executed. In particular, it is not necessary for the user to define a function in which processing including the above control is described in advance and to pass the defined function to the library program system.
したがって、ユーザにとって、ライブラリプログラムシステムに渡しておく関数に関する知識が不要となり、ユーザプログラムに制御処理を記述することができるため、より容易にライブラリプログラムを利用することが可能となるという効果を奏する。 Therefore, it is unnecessary for the user to know the function to be passed to the library program system, and the control process can be described in the user program, so that the library program can be used more easily.
さらに、従来個別のライブラリで完結する処理しか実行できなかった分散環境向けライブラリ呼び出しシステムにおいても、制御処理を含む演算処理を記述したユーザプログラムを実行することができることから、演算処理システムがチューリングマシンと等価な記述力を与えることができるという効果を奏する。 Furthermore, even in a distributed environment library calling system that can only execute processing that has been completed with an individual library, a user program describing arithmetic processing including control processing can be executed. There is an effect that equivalent descriptive power can be given.
そのため、任意の計算処理を計算環境に依存せず実行することが可能となるという効果を奏する。 Therefore, there is an effect that any calculation process can be executed without depending on the calculation environment.
さらに、本発明に係る演算処理システムは、上記の構成において、上記ユーザプログラムシステムが、上記ライブラリプログラムシステムを利用して実行する入出力処理を含む上記ユーザプログラムを解析し、上記入出力処理を表す入出力文字列を抽出しする入出力処理抽出手段と、上記入出力処理における入出力値に関する情報を上記ライブラリプログラムシステムにて処理可能な形式に変換する入出力処理変換手段とをさらに備え、上記入力値転送手段が、上記変換後の上記入出力値に関する情報を上記入力値情報として上記ライブラリプログラムシステムに転送する処理を行う構成としてもよい。 Furthermore, the arithmetic processing system according to the present invention, in the above configuration, represents the input / output process by analyzing the user program including the input / output process executed by the user program system using the library program system. Input / output processing extraction means for extracting an input / output character string; and input / output processing conversion means for converting information on input / output values in the input / output processing into a format that can be processed by the library program system, The input value transfer means may be configured to perform processing for transferring information on the input / output values after the conversion to the library program system as the input value information.
上記の構成によれば、さらに、ユーザプログラムシステムにおいてユーザプログラムを実行するとき、入出力処理を他の処理と分離して抽出することができる。そして、上記抽出した入出力処理において入力したデータを、ライブラリプログラムシステムにて処理可能な形式に変換して、ライブラリプログラムシステムに渡すことができる。 According to the above configuration, when the user program is executed in the user program system, the input / output process can be extracted separately from the other processes. Then, the data input in the extracted input / output process can be converted into a format that can be processed by the library program system and passed to the library program system.
よって、あらかじめライブラリプログラムシステムにて処理可能な形式でユーザプログラムを記述する必要が無いため記述を簡潔にすることができ、また、ユーザプログラムが使用するメモリ空間を使用することなく入力処理を行うことができる。 Therefore, it is not necessary to describe the user program in a format that can be processed in advance by the library program system, so that the description can be simplified and input processing can be performed without using the memory space used by the user program. Can do.
したがって、行列やベクトルなどのデータ量が多いデータを演算の入力とする場合であっても、ユーザプログラムのメモリ使用量を小さくすることができるという効果を奏する。 Therefore, even when data having a large amount of data such as a matrix or a vector is used as an input for calculation, the memory usage of the user program can be reduced.
さらに、本発明に係る演算処理システムは、上記の構成において、上記演算結果送信手段が、上記ライブラリプログラムシステムを利用して実行する入出力処理における出力値に関する出力値情報を上記実行結果として送信する処理を行い、上記演算結果受信手段が、上記ライブラリプログラムシステムから上記出力値情報を上記実行結果として受信する処理を行う構成としてもよい。 Furthermore, in the arithmetic processing system according to the present invention, in the above configuration, the arithmetic result transmitting means transmits, as the execution result, output value information relating to an output value in an input / output process executed using the library program system. It is good also as a structure which performs a process and the said calculation result receiving means performs the process which receives the said output value information as the said execution result from the said library program system.
上記の構成によれば、さらに、上記抽出した入出力処理において出力すべきデータをライブラリプログラムシステムから受信することができる。 According to the above configuration, the data to be output in the extracted input / output process can be received from the library program system.
よって、ユーザプログラムのメモリ空間を使用することなく出力処理を実行することができる。 Therefore, the output process can be executed without using the memory space of the user program.
したがって、演算処理の結果が、多くのメモリ空間を使用する行列データやベクトルデータなどであったとしても、ユーザプログラムのメモリ使用量を小さくすることができるという効果を奏する。 Therefore, even if the result of the arithmetic processing is matrix data or vector data using a large amount of memory space, the memory usage of the user program can be reduced.
さらに、本発明に係る演算処理システムは、上記の構成において、上記入力値転送手段が、上記入力値情報として、数値データおよびそのデータ形式を転送する構成としてもよい。 Furthermore, the arithmetic processing system according to the present invention may be configured such that, in the above configuration, the input value transfer means transfers numerical data and its data format as the input value information.
上記の構成によれば、演算処理および入力処理の入力値情報として数値データおよびそのデータ形式がライブラリプログラムシステムに転送されることになる。よって、演算処理や入出力処理にて異なったデータ形式を扱うユーザプログラムを組み合わせたりすることが容易に可能となる。 According to the above configuration, numerical data and its data format are transferred to the library program system as input value information for the arithmetic processing and input processing. Therefore, it is possible to easily combine user programs that handle different data formats in arithmetic processing and input / output processing.
さらに、本発明に係る演算処理システムは、上記の構成において、上記入力値受信手段が、受信した上記入力値情報を記憶部に格納するとともに、上記演算方法決定手段が、ライブラリプログラムの実行の際に、上記記憶部に格納されている入力値情報のいずれを用いるかを決定する構成としてもよい。 Furthermore, the arithmetic processing system according to the present invention has the above-described configuration, wherein the input value receiving means stores the received input value information in a storage unit, and the arithmetic method determining means is adapted to execute the library program. In addition, it may be configured to determine which of the input value information stored in the storage unit is to be used.
上記の構成によれば、演算処理および入力処理の入力値情報の転送処理と演算内容の情報の転送処理とが分離していても、両者の関係を適切に組み合わせてライブラリプログラムでの演算を行うことが可能となる。 According to the above configuration, even if the input value information transfer process and the calculation content information transfer process of the calculation process and the input process are separated, the calculation in the library program is performed by appropriately combining the relationship between the two. It becomes possible.
さらに、本発明に係る演算処理システムは、上記の構成において、上記演算依頼手段が、上記演算依頼情報として、数学の演算式そのものを表す文字列を転送する構成としてもよい。 Furthermore, the arithmetic processing system according to the present invention may be configured such that, in the above-described configuration, the calculation request means transfers a character string representing a mathematical arithmetic expression itself as the calculation request information.
上記の構成によれば、ユーザプログラムシステム側では、数学の演算式そのものを表す文字列をライブラリプログラムシステムに対して転送すればよいので、演算処理および入力処理にて入力する値をどのように演算式で解くべきかなどを考慮する必要がない。よって、ユーザプログラムのユーザは、一般的な数学の演算式を考慮するだけで演算を行うプログラミングを記述することが可能となる。 According to the above configuration, the user program system only has to transfer a character string representing the mathematical arithmetic expression itself to the library program system. There is no need to consider whether to solve the equation. Therefore, the user of the user program can describe programming for performing calculations only by considering general mathematical arithmetic expressions.
さらに、本発明に係る演算処理システムは、上記の構成において、上記ユーザプログラムシステム、および上記ライブラリプログラムシステムが、同一のコンピュータにおいて動作する構成としてもよい。 Furthermore, the arithmetic processing system according to the present invention may be configured such that, in the above configuration, the user program system and the library program system operate on the same computer.
上記の構成によれば、1つのコンピュータにおいてユーザプログラムシステムとライブラリプログラムシステムとを構築することによって、上記のような演算処理システムを実現することができる。なお、1つのコンピュータが複数の演算処理装置(例えばCPUなど)を備え、メモリを共有している構成であってもよい。 According to said structure, the above arithmetic processing systems are realizable by building a user program system and a library program system in one computer. Note that one computer may include a plurality of arithmetic processing devices (for example, CPUs) and share a memory.
さらに、本発明に係る演算処理システムは、上記の構成において、上記ユーザプログラムシステムが第1のコンピュータにおいて動作するとともに、上記ライブラリプログラムシステムが、上記第1のコンピュータと通信接続された別のコンピュータにおいて動作する構成としてもよい。 Furthermore, the arithmetic processing system according to the present invention is the above configuration, wherein the user program system operates on the first computer, and the library program system is connected to the first computer in another computer. It may be configured to operate.
上記の構成によれば、ユーザプログラムシステムが動作するコンピュータと、ライブラリプログラムシステムが動作するコンピュータとを別々に構築することによって、上記のような演算処理システムを実現することができる。したがって、ユーザプログラムの実行とライブラリプログラムの実行とを並列に行うことが可能となる。 According to said structure, the above arithmetic processing systems are realizable by building separately the computer in which a user program system operate | moves, and the computer in which a library program system operates. Therefore, it is possible to execute the user program and the library program in parallel.
なお、上記ユーザプログラムシステムおよび上記ライブラリプログラムシステムは、コンピュータによって実現してもよく、この場合には、コンピュータを上記各手段として動作させることにより、上記ユーザプログラムシステムおよび上記ライブラリプログラムシステムをコンピュータにて実現させる上記ユーザプログラムシステムおよび上記ライブラリプログラムシステムの制御プログラム、およびそれを記録したコンピュータ読み取り可能な記録媒体も、本発明の範疇に入る。 The user program system and the library program system may be realized by a computer. In this case, the user program system and the library program system are operated on the computer by causing the computer to operate as the respective means. The user program system and the control program for the library program system to be realized and a computer-readable recording medium on which the control program is recorded also fall within the scope of the present invention.
以上のように、本発明に係る演算処理システムは、ユーザプログラムを実行するユーザプログラムシステムと、上記ユーザプログラムにおいて利用されるライブラリプログラムを実行するライブラリプログラムシステムとを備えた演算処理システムにおいて、上記ユーザプログラムシステムが、上記ライブラリプログラムシステムを利用して実行する演算処理および上記ユーザプログラムシステムにて実行する制御処理を含む上記ユーザプログラムを解析し、上記演算処理を表す演算文字列および上記制御処理を表す制御文字列を抽出する演算制御処理抽出手段と、上記抽出した演算文字列に基づいて、上記演算処理における演算の入力値に関する入力値情報を上記ライブラリプログラムシステムに転送する処理を行う入力値転送手段と、上記抽出した演算文字列に基づいて、上記演算処理における演算の内容に関する演算依頼情報を該ライブラリプログラムシステムに転送する処理を行う演算依頼手段と、上記抽出した演算文字列に基づいて、上記ライブラリプログラムシステムにおけるライブラリプログラムの実行結果を該ライブラリプログラムシステムから受信する処理を行う演算結果受信手段と、上記抽出した制御文字列に基づいて、上記制御処理を実行する制御処理実行手段とを備え、上記ライブラリプログラムシステムが、上記ユーザプログラムシステムから送られた、上記入力値情報を受信する処理を行う入力値受信手段と、上記ユーザプログラムシステムから送られた、上記演算依頼情報を解析することによって、利用するライブラリプログラムの種類、およびその実行順序を決定する処理を行う演算方法決定手段と、上記ライブラリプログラムの実行結果を上記ユーザプログラムシステムへ送信する処理を行う演算結果送信手段とを備えている。 As described above, the arithmetic processing system according to the present invention includes a user program system that executes a user program and a library program system that executes a library program used in the user program. The program system analyzes the user program including arithmetic processing executed using the library program system and control processing executed by the user program system, and represents an arithmetic character string representing the arithmetic processing and the control processing. Calculation control processing extraction means for extracting a control character string, and input value transfer means for performing processing for transferring input value information relating to the input value of the calculation in the calculation processing to the library program system based on the extracted calculation character string And above Based on the extracted calculation character string, calculation request means for performing processing to transfer calculation request information regarding the contents of the calculation in the calculation processing to the library program system, and based on the extracted calculation character string, the library program system The library program comprises: calculation result receiving means for performing processing for receiving the execution result of the library program from the library program system; and control processing execution means for executing the control processing based on the extracted control character string. An input value receiving means for performing processing for receiving the input value information sent from the user program system, and a library to be used by analyzing the calculation request information sent from the user program system Program type and And calculating method determining means for performing a process of determining the execution order, the execution result of the library program and a calculation result transmitting unit that performs a process of transmitting to the user program system.
また、本発明に係る演算処理方法は、ユーザプログラムを実行するユーザプログラムシステムと、上記ユーザプログラムにおいて利用されるライブラリプログラムを実行するライブラリプログラムシステムとを備えた演算処理システムにおける演算処理方法において、上記ユーザプログラムシステムにおける、上記ライブラリプログラムシステムを利用して実行する演算処理および上記ユーザプログラムシステムにて実行する制御処理を含む上記ユーザプログラムを解析し、上記演算処理を表す演算文字列および上記制御処理を表す制御文字列を抽出する演算制御処理抽出ステップと、上記抽出した演算文字列に基づいて、上記演算処理における演算の入力値に関する入力値情報を上記ライブラリプログラムシステムに転送する処理を行う入力値転送ステップと、上記抽出した演算文字列に基づいて、上記演算処理における演算の内容に関する演算依頼情報を該ライブラリプログラムシステムに転送する処理を行う演算依頼ステップと、上記抽出した演算文字列に基づいて、上記ライブラリプログラムシステムにおけるライブラリプログラムの実行結果を該ライブラリプログラムシステムから受信する処理を行う演算結果受信ステップと、上記抽出した制御文字列に基づいて、上記制御処理を実行する制御処理実行ステップと、上記ライブラリプログラムシステムにおける、上記ユーザプログラムシステムから送られた、上記入力値情報を受信する処理を行う入力値受信ステップと、上記ユーザプログラムシステムから送られた、上記演算依頼情報を解析することによって、利用するライブラリプログラムの種類、およびその実行順序を決定する処理を行う演算方法決定ステップと、上記ライブラリプログラムの実行結果を上記ユーザプログラムシステムへ送信する処理を行う演算結果送信ステップとを含んでいる。 An arithmetic processing method according to the present invention is an arithmetic processing method in an arithmetic processing system including a user program system that executes a user program and a library program system that executes a library program used in the user program. In the user program system, the user program including the arithmetic processing executed using the library program system and the control processing executed in the user program system is analyzed, and the arithmetic character string representing the arithmetic processing and the control processing are analyzed. An operation control process extraction step for extracting a control character string to be represented, and an input process for transferring input value information related to the input value of the operation in the operation process to the library program system based on the extracted operation character string. Based on the value transfer step, the calculation request step for performing processing for transferring calculation request information relating to the calculation contents in the calculation processing to the library program system based on the extracted calculation character string, and the extracted calculation character string A calculation result receiving step for performing processing for receiving the execution result of the library program in the library program system from the library program system, and a control processing execution step for executing the control processing based on the extracted control character string. In the library program system, an input value receiving step for receiving the input value information sent from the user program system and analyzing the calculation request information sent from the user program system , Use Type of library program, and a calculating method determining step for performing a process for determining the execution order, the execution result of the library program and a calculation result transmitting step of performing a process of transmitting to the user program system.
よって、演算処理と制御処理とをユーザが明示的に分離して演算処理システムに与える必要がなく、制御処理と演算処理とが混在したユーザプログラムを実行することが可能となる。特に、ユーザが、あらかじめ上記制御を含む処理が記述された関数を定義し、該定義された関数をライブラリプログラムシステムに渡しておく必要がなくなる。 Therefore, it is not necessary for the user to explicitly separate the arithmetic processing and the control processing and give them to the arithmetic processing system, and a user program in which the control processing and the arithmetic processing are mixed can be executed. In particular, it is not necessary for the user to define a function in which processing including the above control is described in advance and to pass the defined function to the library program system.
したがって、ユーザにとって、ライブラリプログラムシステムに渡しておく関数に関する知識が不要となり、ユーザプログラムに制御処理を記述することができるため、より容易にライブラリプログラムを利用することが可能となるという効果を奏する。 Therefore, it is unnecessary for the user to know the function to be passed to the library program system, and the control process can be described in the user program, so that the library program can be used more easily.
本発明の一実施形態について図1から図5に基づいて説明すると以下の通りである。 An embodiment of the present invention will be described below with reference to FIGS.
(演算処理システムの構成)
図1を参照しながら、演算処理システム1の構成について説明する。図1は、本実施形態に係る演算処理システム1の概略構成を示すブロック図である。図1に示すように、演算処理システム1は、ユーザプログラムシステム2、およびライブラリプログラムシステム3を備えて構成される。また、図1に示すように、ユーザプログラムシステム2とライブラリプログラムシステム3とは通信可能に接続されている。
(Configuration of processing system)
The configuration of the arithmetic processing system 1 will be described with reference to FIG. FIG. 1 is a block diagram showing a schematic configuration of an arithmetic processing system 1 according to the present embodiment. As shown in FIG. 1, the arithmetic processing system 1 includes a
(ユーザプログラムシステム)
ユーザプログラムシステム2は、ユーザが作成し、利用するユーザプログラムを実行するシステムである。ここで、上記ユーザプログラムは、演算処理を表す文字列(以下、演算文字列と称する)(例えば”+”などの四則演算や、”=”などの代入)を含んでいる。また、上記ユーザプログラムは、条件分岐や反復などの制御処理を表す文字列(以下、制御文字列と称する)(例えば”if”や”while”など)を含んでいる。また、上記ユーザプログラムは、所定ファイルからの行列やベクトルなどのデータ読み込み、および、行列やベクトルなどのデータの所定ファイルへの保存といった入出力処理を表す文字列(以下、入出力文字列と称する)を含んでいる。
(User program system)
The
なお、制御文字列、演算文字列、入出力文字列はあらかじめ定義されている文字列であり、他の文字列とそれぞれ識別可能である。 The control character string, the operation character string, and the input / output character string are character strings that are defined in advance and can be distinguished from other character strings.
また、上記演算処理および上記入出力処理は、ライブラリプログラムシステム3を利用して行われるものであり、上記制御処理はユーザプログラムシステム2で行われるものである。
The arithmetic processing and the input / output processing are performed using the
ユーザプログラムシステム2は、上記ユーザプログラムを実行するために、入出力部11、転送処理部12、制御部13、および記憶部14を備えて構成される。
The
入出力部11は、ユーザからの入力を受け付けるとともに、制御部13による演算結果または入出力処理をユーザに対して表示・出力するものである。転送処理部12は、ライブラリプログラムシステム3との間でのデータの送受信を行うものである。
The input / output unit 11 receives input from the user and displays / outputs the calculation result or input / output processing by the
制御部13は、上述した演算処理、制御処理、入出力処理を行うものである。そのために、制御部13は、ユーザプログラム実行部21、インタープリタ部22、および転送制御部23を備えている。
The
ユーザプログラム実行部21は、記憶部14に記憶されているユーザプログラムを読み出して実行するものである。
The user
インタープリタ部22は、ユーザプログラム実行部21において実行されているユーザプログラムを読み込み、制御処理と演算処理とをそれぞれ抽出する。そして、該制御処理を行うとともに、該演算処理を行うために、転送制御部23を制御する。また、インタープリタ部22は、上記読み込んだユーザプログラムから入出力処理を抽出し、該入出力処理を行うために、転送制御部23を制御してもよい。
The
そのために、インタープリタ部22は、演算処理・制御処理抽出部22A、制御処理部22B、入出力処理抽出部22C、入出力処理部22Dを備えて構成される。なお、ライブラリプログラムシステム3を利用した入出力処理を行わない場合は、入出力処理抽出部22C、入出力処理部22Dを備えなくてもよい。
For this purpose, the
演算処理・制御処理抽出部22A(演算制御処理抽出手段)は、上記読み込んだユーザプログラムを解析し、あらかじめ記憶部14に記憶されている演算文字列または制御文字列を検出する。そして、該検出された演算文字列により実行される演算処理と、該検出された制御文字列により実行される制御処理とをそれぞれ分けて抽出する。
The arithmetic processing / control
そして、該抽出した演算処理をライブラリプログラムシステム3に格納されているライブラリプログラムを利用して行うために、転送制御部23に対し、数値データの転送、演算内容の情報の転送を指示し、また、転送制御部23から演算結果の受信を行う。また、該抽出した制御処理の内容を制御処理部22Bに転送する。
In order to perform the extracted arithmetic processing by using a library program stored in the
制御処理部22B(制御処理実行手段)は、演算処理・制御処理抽出部22Aが抽出した制御処理の内容を実行するものである。
The
入出力処理抽出部22C(入出力処理抽出手段)は、上記読み込んだユーザプログラムを解析し、あらかじめ記憶部14に記憶されている入出力文字列を検出する。そして、該検出された入出力文字列により実行される入出力処理を抽出する。また、該抽出した入出力処理の内容を入出力処理部22Dに転送する。
The input / output process extraction unit 22C (input / output process extraction means) analyzes the read user program and detects input / output character strings stored in the
入出力処理部22D(入出力処理変換手段)は、入出力処理抽出部22Cが抽出した入出力処理の内容を実行するものである。このとき、入出力処理部22Dは、所定ファイルから読み込んだ行列やベクトルなどのデータを、転送制御部23を介してライブラリプログラムシステム3に転送する。また、ライブラリプログラムシステム3で演算処理された行列やベクトルなどのデータを転送制御部23を介して受信し、所定ファイルに保存する。
The input /
そのため、入出力処理部22Dは、所定ファイルから読み込んだ行列やベクトルなどを転送制御部23が処理可能な数値データおよびそのデータ形式に変換し、転送制御部23に対して該変換後のデータを転送する。また、入出力処理部22Dは、ライブラリプログラムシステム3で演算処理された行列やベクトルなどのデータをライブラリプログラムシステム3に対して要求することを転送制御部23に対して指示し、該要求に応じてライブラリプログラムシステム3から送信された行列やベクトルなどのデータを受信する。
Therefore, the input /
なお、入出力処理部22Dは、ライブラリプログラムシステム3から受信したデータを、ユーザプログラム実行部21を介して入出力部11に転送し、ユーザに対して表示・出力してもよい。
The input /
転送制御部23は、演算処理・制御処理抽出部22Aが抽出した演算処理、および、入出力処理抽出部22Cが抽出した入出力処理を、ライブラリプログラムシステム3に格納されているライブラリプログラムを利用して行うために、ライブラリプログラムシステム3に対してのデータの送受信に関する制御処理を行うものである。そのために、転送制御部23は、数値データ転送部23A、演算依頼部23B、および演算結果受信部23Cを備えている。
The
数値データ転送部23A(入力値転送手段)は、ライブラリプログラムシステム3に演算処理を実行させる際に、演算の入力値となる数値データおよびそのデータ形式をライブラリプログラムシステム3に転送する処理を行う。ここで、転送されるデータには、入出力処理部22Dから送信される、数値データおよびそのデータ形式が含まれる。
The numerical
演算依頼部23B(演算依頼手段)は、ライブラリプログラムシステム3において行わせる演算内容の情報(演算依頼情報)をライブラリプログラムシステム3に転送する処理を行う。この演算依頼情報は、特定のライブラリプログラムの実行命令ではなく、数学の演算式そのものを表す文字列を含んでいる。
The
演算結果受信部23C(演算結果受信手段)は、ライブラリプログラムシステム3におけるライブラリプログラムの実行結果をライブラリプログラムシステム3に対して要求するとともに、該実行結果をライブラリプログラムシステム3から受信する処理を行う。該実行結果には行列やベクトルなどのデータが含まれる。そして、該実行結果をインタープリタ部22に送信する。
The calculation
記憶部14は、制御部13における演算処理、制御処理、入出力処理で用いられるデータを格納するとともに、制御部13のワークメモリとして機能する記憶手段である。なお、記憶部14は、主記憶機能に加えて、補助記憶機能を有するものであってもよい。また、記憶部14は、必ずしもユーザプログラムシステム2に備えられる必要はなく、外部記憶装置として、書き込み可能かつ読み取り可能な状態でユーザプログラムシステム2に接続される構成でもよい。
The
この記憶部14は、ユーザプログラム格納部14A、数値データ格納部14B、および演算結果データ格納部14C、文字列格納部14Dを備えている。
The
ユーザプログラム格納部14Aは、制御部13において実行されるユーザプログラムを格納する領域である。数値データ格納部14Bは、数値データ転送部23Aによって転送される数値データおよびそのデータ形式を格納する領域である。演算結果データ格納部14Cは、演算結果受信部23Cによって受信された実行結果を格納する領域である。文字列格納部14Dは、ユーザプログラムにおいて記述される制御文字列、演算文字列、入出力文字列を含む、あらかじめ定義される文字列を格納する領域である。
The user
なお、実際のメモリの利用に際しては、数値データ格納部14Bおよび演算結果データ格納部14Cは、両者が区別されることなく、変数や配列として記憶部14に記憶される。また、ライブラリプログラム演算に関係しないその他の演算に必要とされる数値データなども記憶部14に格納される。
In actual use of the memory, the numerical
(ライブラリプログラムシステム)
一方、ライブラリプログラムシステム3は、ユーザプログラムシステム2からの依頼に応じて、ライブラリプログラムを実行するシステムである。そのために、ライブラリプログラムシステム3は、転送処理部31、制御部32、および記憶部33を備えている。
(Library program system)
On the other hand, the
転送処理部31は、ユーザプログラムシステム2との間でのデータの送受信を行うものである。
The
制御部32は、ライブラリプログラムの演算処理を行う。そのために、制御部32は、ライブラリプログラム実行部42、および転送制御部41を備えている。
The
ライブラリプログラム実行部42は、記憶部33に記憶されているライブラリプログラムを読み出して実行する。転送制御部41は、ユーザプログラムシステム2において実行されているユーザプログラムが、ライブラリプログラムシステム3による処理を利用するものである場合に、ユーザプログラムシステム2からの要求に応じて、該ユーザプログラムシステム2に対してのデータの送受信に関する制御処理を行う。この転送制御部41は、数値データ受信部41A、演算方法決定部41B、および演算結果送信部41Cを備えている。
The library
数値データ受信部41A(入力値受信手段)は、ユーザプログラムシステム2から、例えばライブラリプログラムの実行時に用いられる演算の入力値となる数値データおよびそのデータ形式を受信する処理を行う。
The numerical
なお、数値データ受信部41Aは、ライブラリプログラムの実行に用いないデータをユーザプログラムシステム2から受信してもよい。
The numerical
演算方法決定部41B(演算方法決定手段)は、ユーザプログラムシステム2から送られてきた演算依頼情報を解析することによって、利用するライブラリプログラム、およびその実行順序を決定する処理を行う。
The calculation
演算結果送信部41C(演算結果送信手段)は、ライブラリプログラム実行部42におけるライブラリプログラムの実行結果を、ユーザプログラムシステム2からの要求に応じてユーザプログラムシステム2へ送信する処理を行う。
The calculation result transmission unit 41C (calculation result transmission means) performs processing for transmitting the execution result of the library program in the library
記憶部33は、制御部32における演算処理で用いられるデータを格納するとともに、制御部32のワークメモリとして機能する記憶手段である。なお、記憶部33は、主記憶機能に加えて、補助記憶機能を有するものであってもよい。また、記憶部33は、必ずしもライブラリプログラムシステム3に備えられる必要はなく、外部記憶装置として、書き込み可能かつ読み取り可能な状態でライブラリプログラムシステム3に接続される構成でもよい。
The
この記憶部33は、ライブラリプログラム格納部33A、数値データ格納部33B、および演算結果データ格納部33Cを備えている。
The
ライブラリプログラム格納部33Aは、制御部32において実行されるライブラリプログラムを格納する領域である。数値データ格納部33Bは、数値データ受信部41Aによって受信された数値データおよびそのデータ形式を格納する領域である。演算結果データ格納部33Cは、ライブラリプログラム実行部42によるライブラリプログラムの実行結果を格納する領域である。
The library
なお、実際のメモリの利用に際しては、数値データ格納部33Bおよび演算結果データ格納部33Cは、両者が区別されることなく、変数や配列として記憶部33に記憶される。また、ライブラリプログラム演算において一時的に用いられる中間データとしての変数や、数値データに対するディレクトリ構造を示す管理情報なども記憶部33に格納される。
In actual use of the memory, the numerical
(演算処理システムにおける処理の流れ)
次に、上記した演算処理システム1における処理の流れについて、図2および図3を参照しながら以下に説明する。図2は、ユーザプログラムシステム2における処理の流れを示すフローチャートであり、図3は、ライブラリプログラムシステム3における処理の流れを示すフローチャートである。
(Processing flow in the arithmetic processing system)
Next, the flow of processing in the above-described arithmetic processing system 1 will be described below with reference to FIGS. FIG. 2 is a flowchart showing the flow of processing in the
(ユーザプログラムシステムにおける処理の流れ)
まず、図2を参照しながら、ユーザプログラムシステム2における処理の流れについて説明する。まずステップ1(以降、S1のように称する)において、ユーザプログラムシステム2において、ユーザプログラム実行部21がユーザプログラムの実行を開始する。すなわち、例えば入出力部11においてユーザからの所定のユーザプログラムの実行指示が受け付けられると、この情報がユーザプログラム実行部21に伝達される。そして、ユーザプログラム実行部21は、指定されたユーザプログラムを、記憶部14のユーザプログラム格納部14Aから読み出し、該ユーザプログラムの実行を開始する。そして、インタープリタ部22が該ユーザプログラムの読み込みを行い、該ユーザプログラムに記載されている文字列を一般的な手法で解析する。
(Processing flow in user program system)
First, the flow of processing in the
そして、演算処理・制御処理抽出部22Aが、演算文字列を検出した場合において(S2においてYES)、上記検出した演算文字列が、ライブラリプログラムシステム3に対して数値データおよびそのデータ形式を転送することを示すものである場合(S3においてYES)には、数値データ転送部23Aが、該数値データおよびそのデータ形式に関する情報を、ライブラリプログラムシステム3に対して転送するように転送処理部12を制御する。この数値データおよびそのデータ形式に関する情報は、入出力部11によってユーザから入力されるものであってもよいし、実行されているユーザプログラムによって生成されるものであってもよい。これにより、数値データおよびそのデータ形式に関する情報が、転送処理部12によってライブラリプログラムシステム3へ転送される(S4)。また、数値データ転送部23Aは、記憶部14における数値データ格納部14Bに、転送した数値データおよびそのデータ形式に関する情報を格納する。
When the arithmetic processing / control
また、上記検出した演算文字列が、ライブラリプログラムシステム3に演算処理を行わせることを示すものである場合(S5においてYES)には、演算依頼部23Bが、演算依頼内容を示す演算依頼情報をライブラリプログラムシステム3に対して転送するように転送処理部12を制御する。この演算依頼情報は、入出力部11によってユーザから入力されるものであってもよいし、実行されているユーザプログラムによって生成されるものであってもよい。これにより、演算依頼情報が、転送処理部12によってライブラリプログラムシステム3へ転送される(S6)。
If the detected calculation character string indicates that the
また、上記検出した演算文字列が、ライブラリプログラムシステム3において演算処理が行われた結果を要求することを示すものである場合(S7においてYES)には、演算結果受信部23Cは、結果要求情報を、ライブラリプログラムシステム3に対して転送するように転送処理部12を制御する。なお、転送されただけで演算が行われていない数値データ格納部33Bに格納されている数値データの転送を要求してもよい。この結果要求情報は、入出力部11によってユーザから入力されるものであってもよいし、実行されているユーザプログラムによって生成されるものであってもよい。これにより、結果要求情報が、転送処理部12によってライブラリプログラムシステム3へ転送される。その後、ライブラリプログラムシステム3から演算結果が転送処理部12において受信されると、演算結果受信部23Cは、受信した演算結果を、記憶部14における演算結果データ格納部14Cに格納する(S8)。
If the detected operation character string indicates that the result of operation processing performed in the
次に、演算処理・制御処理抽出部22Aが、制御文字列を検出した場合(S9においてYES)には、ライブラリプログラムシステム3に処理を依頼せず、制御処理部22Bが上記検出した制御文字列に応じた制御処理(条件分岐、反復など)を実行する(S10)。
Next, when the arithmetic processing / control
次に、入出力処理抽出部22Cが、入出力文字列を検出した場合において(S11においてYES)、上記検出した入出力文字列が、行列やベクトルなどのデータをファイルから読み込む入力処理を示すものである場合(S12においてYES)には、上記検出した入出力文字列を数値データ転送部23Aが扱えるコードに変換し(S13)、その後、数値データ転送部23Aが、該数値データおよびそのデータ形式に関する情報を、ライブラリプログラムシステム3に対して転送するように転送処理部12を制御する。
Next, when the input / output process extraction unit 22C detects an input / output character string (YES in S11), the detected input / output character string indicates an input process for reading data such as a matrix or a vector from a file. (YES in S12), the detected input / output character string is converted into a code that can be handled by the numerical
これにより、行列やベクトルなどの入力データに関する情報が、転送処理部12によってライブラリプログラムシステム3へ転送される(S14)。また、数値データ転送部23Aは、記憶部14における数値データ格納部14Bに、転送した数値データおよびそのデータ形式に関する情報を格納する。
As a result, information relating to input data such as a matrix or a vector is transferred to the
一方、上記検出した入出力文字列が、演算した結果である行列やベクトルなどのデータをファイルに保存する処理を示すものである場合(S15においてYES)には、上記検出した入出力文字列を演算結果受信部23Cが扱えるコードに変換し(S16)、その後、演算結果受信部23Cが、結果要求情報を、ライブラリプログラムシステム3に対して転送するように転送処理部12を制御する。なお、転送されただけで演算が行われていない数値データ格納部33Bに格納されている数値データの転送を要求してもよい。
On the other hand, when the detected input / output character string indicates a process of storing data such as a matrix or a vector as a result of the operation (YES in S15), the detected input / output character string is The code is converted into a code that can be handled by the calculation
これにより、結果要求情報が、転送処理部12によってライブラリプログラムシステム3へ転送される。その後、ライブラリプログラムシステム3から演算結果が転送処理部12において受信されると、演算結果受信部23Cは、受信した演算結果を、記憶部14における演算結果データ格納部14Cに格納する(S17)。なお、受信した演算結果を、ユーザプログラム実行部21を介して入出力部11に転送し、ユーザに対して表示・出力してもよい。
As a result, the result request information is transferred to the
以上のS2、S9、およびS11のいずれの場合においてもNOである場合には、ユーザプログラム実行部21は、ユーザ定義処理、すなわち、ユーザプログラムにおけるその他の処理を行う(S18)。そして、S19において、ユーザプログラム実行部21は、該ユーザプログラムの実行を完了したか否かを判定する。ユーザプログラムの実行が完了していない場合(S18においてNO)には、S2からの処理に戻る。一方、ユーザプログラムの実行が完了したと判定された場合(S18においてYES)には、ユーザプログラムの処理が終了する。
If NO in any of the above S2, S9, and S11, the user
なお、S2、S9、およびS11の処理は、上記の順で行われることに限定されるものではなく、どの順序で行われてもよい。すなわち、S4〜S8、S10、S13およびS14、S16およびS17の処理は、該当するコードが実行される順序で行われればよい。 Note that the processes of S2, S9, and S11 are not limited to being performed in the above order, and may be performed in any order. That is, the processes of S4 to S8, S10, S13 and S14, S16 and S17 may be performed in the order in which the corresponding code is executed.
なお、以上のようにユーザプログラムシステム2における処理が進むので、ユーザプログラムシステム2における処理は、ライブラリプログラムシステム3における処理とは非同期に進行する。
Since the processing in the
(ライブラリプログラムシステムにおける処理の流れ)
次に、図3を参照しながら、ライブラリプログラムシステム3における処理の流れについて説明する。まずS21において、数値データ受信部41Aが、ユーザプログラムシステム2から数値データおよびそのデータ形式に関する情報を転送処理部31を介して受信したか否かを判定する。そして、数値データおよびそのデータ形式に関する情報が受信されたと判定された(S21においてYES)場合には、数値データ受信部41Aは、受信した数値データおよびそのデータ形式に関する情報を記憶部33における数値データ格納部33Bに格納する(S22)。
(Processing flow in the library program system)
Next, the flow of processing in the
次に、演算方法決定部41Bが、ユーザプログラムシステム2から演算依頼情報を転送処理部31を介して受信したか否かを判定する(S23)。そして、演算依頼情報が受信されたと判定された場合(S23においてYES)には、演算方法決定部41Bは、受信した演算依頼情報を解析することによって、利用するライブラリプログラムの種類、およびその実行順序を決定する処理を行う(S24)。
Next, the calculation
次に、ライブラリプログラム実行部42は、演算方法決定部41Bによって決定されたライブラリプログラムの種類およびその実行順序に基づいて、ライブラリプログラムによる演算を実行する(S25)。ここで、ライブラリプログラム実行部42は、記憶部33におけるライブラリプログラム格納部33Aから必要とするライブラリプログラムを読み出すとともに、記憶部33における数値データ格納部33Bから入力値としての数値データおよびそのデータ形式に関する情報を読み出して、演算を実行する。その後、ライブラリプログラム実行部42は、演算結果データを記憶部33における演算結果データ格納部33Cに格納する(S26)。
Next, the library
また、演算結果送信部41Cが、ユーザプログラムシステム2から演算結果の送信要求を転送処理部31を介して受信したか否かを判定する(S27)。そして、演算結果の送信要求が受信されたと判定された場合(S27においてYES)には、演算結果送信部41Cは、記憶部33における演算結果データ格納部33Cから演算結果データを読み出し、これを転送処理部31からユーザプログラムシステム2に対して送信する制御を行う。これにより、演算結果がライブラリプログラムシステム3からユーザプログラムシステム2に対して送信される(S28)。なお、数値データ格納部33Bに格納されている数値データに対する送信要求だった場合、演算結果送信部41Cは、記憶部33における数値データ格納部33Bから数値データおよびそのデータ形式を読み出し、これを転送処理部31からユーザプログラムシステム2に対して送信する制御を行うようになっていてもよい。
In addition, the calculation result transmission unit 41C determines whether or not the calculation result transmission request is received from the
以上のS21、S23、およびS27のいずれの場合においてもNOである場合には、S21からの処理に戻る。 If NO in any of the above S21, S23, and S27, the process returns to S21.
なお、S21、S23、およびS27の処理は、上記の順で行われることに限定されるものではなく、どの順序で行われてもよい。すなわち、S22、S24〜S26、およびS28の処理は、該当するコードが実行された順序で行われればよい。 Note that the processing of S21, S23, and S27 is not limited to being performed in the above order, and may be performed in any order. That is, the processing of S22, S24 to S26, and S28 may be performed in the order in which the corresponding code is executed.
なお、以上のようにライブラリプログラムシステム3における処理が進むので、ライブラリプログラムシステム3における処理は、ユーザプログラムシステム2における処理とは非同期に進行する。
Since the processing in the
(システム構成例1)
次に、図4を参照しながら、を演算処理システム1の具体的構成例について説明する。このシステム構成例1は、図4に示すように、ユーザプログラムシステム2およびライブラリプログラムシステム3の両方が、1つのコンピュータ1Aにおいて実行されるものとなっている。
(System configuration example 1)
Next, a specific configuration example of the arithmetic processing system 1 will be described with reference to FIG. In the system configuration example 1, as shown in FIG. 4, both the
コンピュータ1Aは、演算手段としてのCPU(Central Processing Unit)、主記憶手段としてのRAM(Random Access Memory)、および、不揮発性記憶装置としてのROM(Read Only Memory)やハードディスクなどを備えた一般的なコンピュータである。そして、ユーザプログラムシステム2における制御部13の各機能ブロック、および、ライブラリプログラムシステム3における制御部32の各機能ブロックは、CPUがRAMに該当プログラムをハードディスクなどから読み出して実行することによって実現される。また、記憶部14は、RAM、およびハードディスクなどによって実現される。
The computer 1A is generally equipped with a CPU (Central Processing Unit) as arithmetic means, a RAM (Random Access Memory) as main storage means, a ROM (Read Only Memory) as a nonvolatile storage device, a hard disk, and the like. It is a computer. Each functional block of the
また、ユーザプログラムシステム2における転送処理部12、および、ライブラリプログラムシステム3における転送処理部31は、制御部13によるプログラムと、制御部32によるプログラムとの間でデータの転送処理、すなわちプロセス間通信を行う。また、入出力部11は、コンピュータ1Aが備えるキーボードやマウスなどの入力手段、および、表示手段としてのディスプレイ、印刷手段としてのプリンタなどによって実現される。
Further, the
なお、コンピュータ1Aが複数のプロセッサを有し、並列演算を行うことが可能な構成であってもよい。 Note that the computer 1A may have a plurality of processors and be capable of performing parallel operations.
(システム構成例1における具体的動作例)
次に、システム構成例1における具体的動作例について説明する。ここでの動作例は、次のようなものである。ユーザプログラムシステム2におけるユーザプログラムにおいて、連立1次方程式Ax=bをCG(Conjugate Gradient)法により解くという命令が含まれており、この連立1次方程式Ax=bの演算がライブラリプログラムシステム3において行われる。詳しく説明すると、第1の行列データファイルに係数行列Aが格納され、同様に第2の行列データファイルにベクトルbが格納されている。そして、連立1次方程式Ax=bの解ベクトルxは、第3の行列データファイルに格納されるものとする。なお、上記第1の行列データファイル、第2の行列データファイル、第3の行列データファイルの格納形式は、それぞれ例えばMatrixMarket形式などであるが、これに限定されるものではない。
(Specific operation example in system configuration example 1)
Next, a specific operation example in the system configuration example 1 will be described. The operation example here is as follows. The user program in the
以上の動作例における処理の流れは次のとおりである。まず、ライブラリプログラムシステム3における制御部32が動作可能状態に設定される。次に、ユーザプログラムシステム2における制御部13が、ユーザからの指示入力などに基づいて特定のユーザプログラムの実行を開始する。
The flow of processing in the above operation example is as follows. First, the
その後、ユーザプログラムの実行過程において、演算処理の入力値として用いられる数値データおよびそのデータ形式が生成される。本動作例では、数値データおよびそのデータ形式として、上記の係数行列Aおよびベクトルbが生成される。生成された係数行列Aおよびベクトルbは、数値データ格納部14Bに行列データファイルAおよび行列データファイルBとして格納される。
Thereafter, in the execution process of the user program, numerical data used as an input value for the arithmetic processing and its data format are generated. In this operation example, the coefficient matrix A and the vector b are generated as numerical data and its data format. The generated coefficient matrix A and vector b are stored as a matrix data file A and a matrix data file B in the numerical
その後、ユーザプログラムを読み込んだインタープリタ部22の入出力処理抽出部22Cがユーザプログラムから次のステートメントを抽出する。
load “A”, A
load “B”, b
上記ステートメントは、係数行列Aが格納された行列データファイルA、および、ベクトルbが格納された行列データファイルBを読み込む、という入力処理を示している。なお、「load」という命令は、特にこの文字列に限定されるものではなく、他の文字列によってこの命令を示すようになっていてもよい。
Thereafter, the input / output processing extraction unit 22C of the
load “A”, A
load “B”, b
The above statement shows an input process of reading a matrix data file A in which a coefficient matrix A is stored and a matrix data file B in which a vector b is stored. The instruction “load” is not particularly limited to this character string, and may be indicated by another character string.
上記のステートメントが入出力処理抽出部22Cによって抽出されると、入出力処理部22Dが、読み込んだ行列データファイルAおよび行列データファイルBを転送制御部23が処理可能な数値データおよびそのデータ形式に変換し、転送制御部23に対して該変換後のデータを転送する。
When the above statement is extracted by the input / output processing extraction unit 22C, the input /
そして、数値データ転送部23Aが、入出力処理部22Dから転送された数値データおよびそのデータ形式を、ライブラリプログラムシステム3に対して転送するように転送処理部12を制御する。これにより、行列データファイルAおよび行列データファイルBが、転送処理部12によってライブラリプログラムシステム3へ転送される。
Then, the numerical
ライブラリプログラムシステム3では、数値データ受信部41Aが行列データファイルAおよび行列データファイルBを受信し、これを係数行列Aおよびベクトルbとして数値データ格納部33Bに格納する。
In the
次に、インタープリタ部22の演算処理・制御処理抽出部22Aが、ユーザプログラム中の、四則演算などの示す演算文字列を抽出すると、転送制御部23に対し、該抽出した演算文字列により演算される数値データおよび演算内容の情報の転送を指示する。
Next, when the arithmetic processing / control
そして、数値データ転送部23Aおよび演算依頼部23Bが、演算処理・制御処理抽出部22Aから転送された数値データおよび演算依頼内容の情報を、ライブラリプログラムシステム3に対して転送するように転送処理部12を制御する。これにより、演算処理を構成する数値データおよび演算依頼内容が、転送処理部12によってライブラリプログラムシステム3へ転送される。
Then, the numerical
なお、ライブラリプログラムシステム3では、演算方法決定部41Bが、上記の演算依頼内容を受信し、受信した演算依頼内容の情報を解析することによって、利用するライブラリプログラムの種類、およびその実行順序を決定する処理を行う。具体的には、演算方法決定部41Bは、受信した演算依頼内容に基づいて、LU分解処理、前進後退代入処理などを行う。そして、演算方法決定部41Bは、例えば、定義されたAをプログラムに合う形に変換したA1(実際にはAをA1にコピー)を割り当てたり、中間変数としてx、IPを割り当てたりする処理を行う。なお、A1、IP、xはライブラリプログラムシステム3においてのみ用いられる変数である。そして、ライブラリプログラム実行部42は、演算方法決定部41Bによって決定された演算に基づいてライブラリプログラムを実行し、解xを導出する。導出された解は演算結果データとして、演算結果データ格納部33Cに格納される。
In the
次に、インタープリタ部22の演算処理・制御処理抽出部22Aが、ユーザプログラム中の、条件分岐、反復などなどの示す制御文字列を抽出すると、転送制御部23に対し、該抽出した制御文字列により制御処理の内容を制御処理部22Bに転送する。そして、制御処理部22Bは、上記制御処理の内容に従い、制御処理を実行する。
Next, when the arithmetic processing / control
例えば、インタープリタ部22の演算処理・制御処理抽出部22Aは、ユーザプログラムから次のステートメントを抽出する。
if (cond_expr1) {
stmt1;
} else if (cond_expr2) [
stmt2;
} else {
stmt3;
}
上記のステートメントは、条件分岐の制御処理を示している。ここで、cond_expr1およびcond_expr2は、比較演算子から成る条件式を表すものとする。また、stmt1およびstmt2およびstmt3は、任意の文字列とする。上記のステートメントにより、制御処理部22Bは、1)cond_expr1の条件式が満たされている場合はstmt1を実行し、2)cond_expr1の条件式が満たされておらず、かつ、cond_expr2の条件式が満たされている場合はstmt2を実行し、3)cond_expr1の条件式が満たされておらず、かつ、cond_expr2の条件式が満たされていない場合は、stmt3を実行する。なお、「if」という制御文字列は、特にこの文字列に限定されるものではなく、他の文字列によってこの制御を示すようになっていてもよい。
For example, the arithmetic processing / control
if (cond_expr1) {
stmt1;
} else if (cond_expr2) [
stmt2;
} else {
stmt3;
}
The above statement shows the conditional branch control process. Here, cond_expr1 and cond_expr2 are assumed to represent conditional expressions composed of comparison operators. Also, stmt1, stmt2, and stmt3 are arbitrary character strings. With the above statement, the
また、例えば、インタープリタ部22の演算処理・制御処理抽出部22Aは、ユーザプログラムから次のステートメントを抽出する。
where (cond_expr){
stmt;
}
上記のステートメントは、反復の制御処理を示している。ここで、cond_exprは比較演算子から成る条件式を表すものとする。また、stmtは任意の文字列とする。上記のステートメントにより、制御処理部22Bは、cond_exprの条件式が満たされている限りstmtを実行する。
For example, the arithmetic processing / control
where (cond_expr) {
stmt;
}
The above statement shows the iterative control process. Here, cond_expr represents a conditional expression composed of comparison operators. Stmt is an arbitrary character string. With the above statement, the
さらに、インタープリタ部22の演算処理・制御処理抽出部22Aは、ユーザプログラムから次のステートメントを抽出してもよい。
continue
上記のステートメントにより、制御処理部22Bは、反復の制御処理を続行する。
Further, the arithmetic processing / control
continue
With the above statement, the
さらに、インタープリタ部22の演算処理・制御処理抽出部22Aは、ユーザプログラムから次のステートメントを抽出してもよい。
break
上記のステートメントにより、制御処理部22Bは、反復の制御処理を中断する。
Further, the arithmetic processing / control
break
With the above statement, the
なお、「while」、「break」、「continue」という制御文字列は、特にこの文字列に限定されるものではなく、他の文字列によってこの制御を示すようになっていてもよい。 The control character strings “while”, “break”, and “continue” are not particularly limited to this character string, and this control may be indicated by other character strings.
次に、インタープリタ部22の入出力処理抽出部22Cがユーザプログラムから次のステートメントを抽出する。
save “X”, x
上記のステートメントは、ライブラリプログラムシステム3から、演算結果としての解xを受信し、この解xを行列データファイルXに格納する命令を示している。なお、「save」という命令は、特にこの文字列に限定されるものではなく、他の文字列によってこの命令を示すようになっていてもよい。
Next, the input / output processing extraction unit 22C of the
save “X”, x
The above statement indicates an instruction for receiving a solution x as a calculation result from the
なお、インタープリタ部22の入出力処理抽出部22Cは次のステートメントを抽出してもよい。
pprint a
上記のステートメントは、ライブラリプログラムシステム3から、演算結果としての式aの値を受信する命令を示している。なお、「pprint」という命令は、特にこの文字列に限定されるものではなく、他の文字列によってこの命令を示すようになっていてもよい。また、上記受信した値は入出力部11に表示・出力されてもよい。
Note that the input / output processing extraction unit 22C of the
pprint a
The above statement indicates an instruction for receiving the value of the expression a as the operation result from the
上記のステートメントが入出力処理抽出部22Cによって抽出されると、入出力処理部22Dが、転送制御部23が処理可能な命令に変換し、転送制御部23に対して該変換後の命令を転送する。
When the above statement is extracted by the input / output processing extraction unit 22C, the input /
そして、演算結果受信部23Cが、結果要求情報としての上記変換後の命令を、ライブラリプログラムシステム3に対して転送するように転送処理部12を制御する。これにより、結果要求情報が、転送処理部12によってライブラリプログラムシステム3へ転送される。
Then, the calculation
ライブラリプログラムシステム3では、演算結果送信部41Cが上記結果要求情報を受信し、該結果要求情報によって要求された演算結果データを演算結果データ格納部33Cから読み出す。そして、演算結果送信部41Cは、読み出した演算結果データを転送処理部31からユーザプログラムシステム2に対して送信する制御を行う。これにより、演算結果がライブラリプログラムシステム3からユーザプログラムシステム2に対して送信される。なお、結果要求情報が受信された時点で、ライブラリプログラムシステム3において演算が完了していない場合には、演算が完了するまで演算結果データの送信は行われない。
In the
ユーザプログラムシステム2では、演算結果受信部23Cが、演算結果データをライブラリプログラムシステム3から受信すると、演算結果データとしての解xを行列データファイルとして演算結果データ格納部14Cに格納する。これにより、ライブラリプログラムシステム3を利用した演算が完了することになる。
In the
その後、ユーザプログラムの実行が完了すると、ライブラリプログラムシステム3において、数値データ格納部33Bおよび演算結果データ格納部33Cに格納されているデータがクリアされ、制御部32の動作が停止する。なお、ライブラリプログラムシステム3におけるデータのクリアおよび制御部32における動作の停止は、ユーザプログラムがライブラリプログラムシステム3を利用する必要がなくなった時点で行われてもよい。
Thereafter, when the execution of the user program is completed, the data stored in the numerical
また、新たなユーザプログラムがユーザプログラムシステム2において実行されてもよい。このとき、ライブラリプログラムシステム3を経由して、前回のユーザプログラムから新たなユーザプログラムにデータの受け渡しが行われてもよい。
A new user program may be executed in the
(システム構成例2)
次に、図5を参照しながら、演算処理システム1の他の具体的構成例について説明する。このシステム構成例2は、図5に示すように、ユーザプログラムシステム2が実行されるコンピュータ1Bと、ライブラリプログラムシステム3が実行されるコンピュータ1Cとが通信ネットワークNを介して接続された構成となっている。
(System configuration example 2)
Next, another specific configuration example of the arithmetic processing system 1 will be described with reference to FIG. In the system configuration example 2, as shown in FIG. 5, a computer 1B on which the
コンピュータ1Bおよびコンピュータ1Cは、演算手段としてのCPU、主記憶手段としてのRAM、および、不揮発性記憶装置としてのROMやハードディスクなどを備えた一般的なコンピュータである。そして、ユーザプログラムシステム2における制御部13の各機能ブロック、および、ライブラリプログラムシステム3における制御部32の各機能ブロックは、CPUがRAMに該当プログラムをハードディスクなどから読み出して実行することによって実現される。また、記憶部14は、RAM、およびハードディスクなどによって実現される。
The computer 1B and the computer 1C are general computers including a CPU as a calculation unit, a RAM as a main storage unit, and a ROM or a hard disk as a nonvolatile storage device. Each functional block of the
また、ユーザプログラムシステム2における転送処理部12、および、ライブラリプログラムシステム3における転送処理部31は、通信ネットワークNを介しての通信を行う際の通信インターフェースとして機能することになる。また、入出力部11は、コンピュータ1Bが備えるキーボードやマウスなどの入力手段、および、表示手段としてのディスプレイ、印刷手段としてのプリンタなどによって実現される。
Further, the
なお、コンピュータ1Bおよびコンピュータ1Cがそれぞれ複数のプロセッサを有し、並列演算を行うことが可能な構成であってもよい。 The computer 1B and the computer 1C may each have a plurality of processors and can perform parallel operations.
(システム構成例2における具体的動作例)
システム構成例2は、システム構成例1と比較して、ユーザプログラムシステム2とライブラリプログラムシステム3とがそれぞれ異なるコンピュータ上で動作する点が異なっているのみであり、基本的な動作はほぼ同様となっている。すなわち、システム構成例2における具体的動作例としては、上記したシステム構成例1における具体的動作例とほぼ同様である。異なる点としては、転送処理部12と転送処理部31との間のデータ転送が、通信ネットワークNを介して行われる点である。
(Specific operation example in system configuration example 2)
The system configuration example 2 is different from the system configuration example 1 only in that the
なお、ライブラリプログラムシステム3が実行されるコンピュータは1台に限られない。2台以上のコンピュータにてライブラリプログラムシステム3が実行されてもよい。
The number of computers on which the
また、上記では、基本的に、ユーザプログラムシステム2において実行されるユーザプログラムは、逐次型のプログラム、すなわち、シリアルに処理が行われるプログラムである場合を想定しているが、ユーザプログラムが並列型のプログラムであっても構わない。
In the above description, it is basically assumed that the user program executed in the
(付記事項)
本発明は上述した実施形態に限定されるものではなく、請求項に示した範囲で種々の変更が可能であり、異なる実施形態にそれぞれ開示された技術的手段を適宜組み合わせて得られる実施形態についても本発明の技術的範囲に含まれる。
(Additional notes)
The present invention is not limited to the above-described embodiments, and various modifications can be made within the scope shown in the claims, and embodiments obtained by appropriately combining technical means disclosed in different embodiments. Is also included in the technical scope of the present invention.
本発明に係る演算処理システムは、例えば科学技術計算を行う際に、既存のライブラリプログラムを利用した演算を行うなどの用途に適用することが可能である。 The arithmetic processing system according to the present invention can be applied to uses such as performing arithmetic operations using existing library programs when performing scientific and technical calculations, for example.
1 演算処理システム
2 ユーザプログラムシステム
3 ライブラリプログラムシステム
13 制御部
14 記憶部
14A ユーザプログラム格納部
14B 数値データ格納部
14C 演算結果データ格納部
14D 文字列格納部
21 ユーザプログラム実行部
22 インタープリタ部
22A 演算処理・制御処理抽出部(演算制御処理抽出手段)
22B 制御処理部(制御処理実行手段)
22C 入出力処理抽出部(入出力処理抽出手段)
22D 入出力処理部(入出力処理変換手段)
23 転送制御部
23A 数値データ転送部(入力値転送手段)
23B 演算依頼部(演算依頼手段)
23C 演算結果受信部(演算結果受信手段)
32 制御部
33 記憶部
33A ライブラリプログラム格納部
33B 数値データ格納部
33C 演算結果データ格納部
41 転送制御部
41A 数値データ受信部(入力値受信手段)
41B 演算方法決定部(演算方法決定手段)
41C 演算結果送信部(演算結果送信手段)
42 ライブラリプログラム実行部
DESCRIPTION OF SYMBOLS 1
22B Control processing unit (control processing execution means)
22C Input / output processing extraction unit (input / output processing extraction means)
22D input / output processing unit (input / output processing conversion means)
23
23B Calculation request section (calculation request means)
23C calculation result receiving unit (calculation result receiving means)
32
41B Calculation method determination unit (calculation method determination means)
41C calculation result transmission part (calculation result transmission means)
42 Library program execution section
Claims (11)
上記ユーザプログラムシステムが、
上記ライブラリプログラムシステムを利用して実行する演算処理および上記ユーザプログラムシステムにて上記演算処理の実行を制御する制御処理を含む上記ユーザプログラムを解析し、上記演算処理を表す演算文字列および上記演算処理の実行を制御するための分岐命令を表す制御文字列を抽出する、インタープリタの一部である演算制御処理抽出手段と、
上記抽出した演算文字列に基づいて、上記演算処理における演算の入力値に関する入力値情報を上記ライブラリプログラムシステムに転送する処理を行う入力値転送手段と、
上記抽出した演算文字列に基づいて、上記演算処理における演算の内容に関する演算依頼情報を該ライブラリプログラムシステムに転送する処理を行う演算依頼手段と、
上記抽出した演算文字列に基づいて、上記ライブラリプログラムシステムにおけるライブラリプログラムの実行結果を該ライブラリプログラムシステムから受信する処理を行う演算結果受信手段と、
上記抽出した制御文字列に基づいて、上記ライブラリプログラムを利用することなく上記制御処理を実行する、上記インタープリタの一部である制御処理実行手段と、
上記ライブラリプログラムシステムを利用して実行する入出力処理を含む上記ユーザプログラムを解析し、上記入出力処理を表す入出力文字列を抽出する入出力処理抽出手段と、
上記入出力処理における入出力値に関する情報を上記ライブラリプログラムシステムにて処理可能な形式に変換する入出力処理変換手段とを備え、
上記入力値転送手段が、上記変換後の上記入出力値に関する情報を上記入力値情報として上記ライブラリプログラムシステムに転送する処理を行い、
上記ライブラリプログラムシステムが、
上記ユーザプログラムシステムから送られた、上記入力値情報を受信する処理を行う入力値受信手段と、
上記ユーザプログラムシステムから送られた、上記演算依頼情報を解析することによって、利用するライブラリプログラムの種類、およびその実行順序を決定する処理を行う演算方法決定手段と、
上記ライブラリプログラムの実行結果を上記ユーザプログラムシステムへ送信する処理を行う演算結果送信手段とを備えていることを特徴とする演算処理システム。 In an arithmetic processing system comprising a user program system for executing a user program and a library program system for executing a library program used in the user program,
The user program system is
Analyzing the user program including arithmetic processing executed using the library program system and control processing for controlling execution of the arithmetic processing in the user program system, an arithmetic character string representing the arithmetic processing and the arithmetic processing extracting the control string of representing the branch instruction for controlling the execution, and the arithmetic control processor extracting means is part of the interpreter,
An input value transfer means for performing a process of transferring input value information related to an input value of an operation in the operation processing to the library program system based on the extracted operation character string;
Calculation request means for performing a process of transferring calculation request information regarding the contents of the calculation in the calculation process to the library program system based on the extracted calculation character string;
Based on the extracted calculation character string, calculation result receiving means for performing processing for receiving the execution result of the library program in the library program system from the library program system;
Based on the control string that the extracted, Ku executes control written above process utilizing the library program, and a control process execution means which is part of the interpreter,
Input / output processing extraction means for analyzing the user program including input / output processing to be executed using the library program system and extracting an input / output character string representing the input / output processing;
Input / output processing conversion means for converting information on input / output values in the input / output processing into a format that can be processed by the library program system;
The input value transfer means performs a process of transferring information on the input / output value after the conversion to the library program system as the input value information.
The library program system is
Input value receiving means for performing processing for receiving the input value information sent from the user program system;
An arithmetic method determining means for performing processing for determining the type of library program to be used and its execution order by analyzing the arithmetic request information sent from the user program system,
An arithmetic processing system comprising: arithmetic result transmitting means for performing processing for transmitting the execution result of the library program to the user program system.
上記演算結果受信手段が、上記ライブラリプログラムシステムから上記出力値情報を上記実行結果として受信する処理を行うことを特徴とする請求項1に記載の演算処理システム。 The calculation result transmitting means performs a process of transmitting output value information related to an output value in an input / output process executed using the library program system as the execution result,
The arithmetic processing system according to claim 1, wherein the arithmetic result receiving means performs processing for receiving the output value information as the execution result from the library program system.
上記演算方法決定手段が、ライブラリプログラムの実行の際に、上記記憶部に格納されている入力値情報のいずれを用いるかを決定することを特徴とする請求項1に記載の演算処理システム。 The input value receiving means stores the received input value information in a storage unit,
2. The arithmetic processing system according to claim 1, wherein the arithmetic method determining means determines which of the input value information stored in the storage unit is to be used when executing the library program.
上記ユーザプログラムシステムにおける、
上記ライブラリプログラムシステムを利用して実行する演算処理および上記ユーザプログラムシステムにて上記演算処理の実行を制御する制御処理を含む上記ユーザプログラムを解析し、上記演算処理を表す演算文字列および上記演算処理の実行を制御するための分岐命令を表す制御文字列を抽出する、インタープリタにより実行される演算制御処理抽出ステップと、
上記抽出した演算文字列に基づいて、上記演算処理における演算の入力値に関する入力値情報を上記ライブラリプログラムシステムに転送する処理を行う入力値転送ステップと、
上記抽出した演算文字列に基づいて、上記演算処理における演算の内容に関する演算依頼情報を該ライブラリプログラムシステムに転送する処理を行う演算依頼ステップと、
上記抽出した演算文字列に基づいて、上記ライブラリプログラムシステムにおけるライブラリプログラムの実行結果を該ライブラリプログラムシステムから受信する処理を行う演算結果受信ステップと、
上記抽出した制御文字列に基づいて、上記ライブラリプログラムを利用することなく上記制御処理を実行する、上記インタープリタにより実行される制御処理実行ステップと、
上記ライブラリプログラムシステムを利用して実行する入出力処理を含む上記ユーザプログラムを解析し、上記入出力処理を表す入出力文字列を抽出する入出力処理抽出ステップと、
上記入出力処理における入出力値に関する情報を上記ライブラリプログラムシステムにて処理可能な形式に変換する入出力処理変換ステップとを含み、
上記入力値転送ステップにて、上記変換後の上記入出力値に関する情報を上記入力値情報として上記ライブラリプログラムシステムに転送する処理を行い、
上記ライブラリプログラムシステムにおける、
上記ユーザプログラムシステムから送られた、上記入力値情報を受信する処理を行う入力値受信ステップと、
上記ユーザプログラムシステムから送られた、上記演算依頼情報を解析することによって、利用するライブラリプログラムの種類、およびその実行順序を決定する処理を行う演算方法決定ステップと、
上記ライブラリプログラムの実行結果を上記ユーザプログラムシステムへ送信する処理を行う演算結果送信ステップとを含んでいることを特徴とする演算処理方法。 In an arithmetic processing method in an arithmetic processing system comprising a user program system for executing a user program and a library program system for executing a library program used in the user program,
In the above user program system,
Analyzing the user program including arithmetic processing executed using the library program system and control processing for controlling execution of the arithmetic processing in the user program system, an arithmetic character string representing the arithmetic processing and the arithmetic processing An arithmetic control processing extraction step executed by an interpreter for extracting a control character string representing a branch instruction for controlling the execution of
Based on the extracted calculation character string, an input value transfer step for performing a process of transferring input value information related to the input value of the calculation in the calculation process to the library program system;
A calculation request step for performing a process of transferring calculation request information regarding the contents of the calculation in the calculation process to the library program system based on the extracted calculation character string;
An operation result receiving step for performing a process of receiving an execution result of the library program in the library program system from the library program system based on the extracted operation character string;
Based on the control string that the extracted, run the Ku control written above process utilizing the library program, and a control process execution steps performed by the interpreter,
An input / output process extraction step of analyzing the user program including an input / output process executed using the library program system and extracting an input / output character string representing the input / output process;
An input / output processing conversion step for converting information on input / output values in the input / output processing into a format that can be processed by the library program system,
In the input value transfer step, a process of transferring information on the input / output value after the conversion to the library program system as the input value information is performed.
In the above library program system,
An input value receiving step for performing processing for receiving the input value information sent from the user program system;
A calculation method determination step for performing processing for determining the type of library program to be used and the execution order thereof by analyzing the calculation request information sent from the user program system;
An arithmetic processing method comprising: an arithmetic result transmitting step for performing processing for transmitting the execution result of the library program to the user program system.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007161627A JP5265886B2 (en) | 2007-06-19 | 2007-06-19 | Arithmetic processing system, arithmetic processing method, program, and computer-readable recording medium recording the program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007161627A JP5265886B2 (en) | 2007-06-19 | 2007-06-19 | Arithmetic processing system, arithmetic processing method, program, and computer-readable recording medium recording the program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2009003555A JP2009003555A (en) | 2009-01-08 |
JP5265886B2 true JP5265886B2 (en) | 2013-08-14 |
Family
ID=40319901
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2007161627A Expired - Fee Related JP5265886B2 (en) | 2007-06-19 | 2007-06-19 | Arithmetic processing system, arithmetic processing method, program, and computer-readable recording medium recording the program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5265886B2 (en) |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH07129400A (en) * | 1993-11-01 | 1995-05-19 | Just Syst Corp | Method and loading environment for object oriented programming and device loading the environment |
JPH10222487A (en) * | 1997-02-04 | 1998-08-21 | Hitachi Ltd | Method for executing program on parallel computers |
JP2001005666A (en) * | 1999-06-25 | 2001-01-12 | Nec Software Kobe Ltd | Remote procedure execution system |
JP2004086760A (en) * | 2002-08-28 | 2004-03-18 | Nec Corp | Numerical calculation program generation system, numerical calculation program generation method, and numerical calculation program generation program |
JP4224430B2 (en) * | 2003-07-07 | 2009-02-12 | 株式会社ルネサステクノロジ | Information processing device |
GB2434897B (en) * | 2004-11-11 | 2009-04-22 | Japan Science & Tech Agency | Computing system, computing method, user program system, library program system, program, and storage medium containing program |
-
2007
- 2007-06-19 JP JP2007161627A patent/JP5265886B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2009003555A (en) | 2009-01-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20180341483A1 (en) | Tensor Register Files | |
US20180341484A1 (en) | Tensor Processor Instruction Set Architecture | |
US5881288A (en) | Debugging information generation system | |
US10997116B2 (en) | Tensor-based hardware accelerator including a scalar-processing unit | |
US20120079257A1 (en) | Methods and systems that defer exception handling | |
JP2003323463A5 (en) | ||
KR101842307B1 (en) | Map transformation in data parallel code | |
JP5265886B2 (en) | Arithmetic processing system, arithmetic processing method, program, and computer-readable recording medium recording the program | |
JP4444293B2 (en) | Arithmetic processing system, arithmetic processing method, user program system, library program system, program, and recording medium recording program | |
JP2009289162A (en) | Apparatus for automatically creating control program and testing method plan | |
JP4946323B2 (en) | Parallelization program generation method, parallelization program generation apparatus, and parallelization program generation program | |
US8752075B1 (en) | Method for data transport | |
EP0817049B1 (en) | A program development system | |
CN111158898B (en) | BIM data processing method and device aiming at power transmission and transformation project site arrangement standardization | |
JP4371000B2 (en) | IDL compiling device, IDL compiling method, and IDL compiler | |
JP7306724B2 (en) | Conversion device, conversion method and program | |
US20240311440A1 (en) | Optimization apparatus, optimization method and program | |
JP5509694B2 (en) | Compiling method, program execution method, and program | |
Aspinall et al. | Proof general meets isawin | |
JP2006277560A (en) | Software development support device, design document generation program and design document generating method | |
JPH04268928A (en) | Emulation device and semiconductor device | |
JP6433410B2 (en) | Console display device | |
CN115269007A (en) | Instruction execution method and device, electronic equipment and storage medium | |
JP4201206B2 (en) | CGI program creation method, recording medium recording program according to the method, and CGI program creation device | |
JP2001337915A (en) | Calculation service providing system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20100310 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20120116 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20120124 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20120316 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20121016 |
|
A711 | Notification of change in applicant |
Free format text: JAPANESE INTERMEDIATE CODE: A711 Effective date: 20121227 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20130115 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A821 Effective date: 20121227 |
|
A911 | Transfer of reconsideration by examiner before appeal (zenchi) |
Free format text: JAPANESE INTERMEDIATE CODE: A911 Effective date: 20130131 |
|
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: 20130402 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20130502 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 Ref document number: 5265886 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
LAPS | Cancellation because of no payment of annual fees |