JP4299228B2 - Library conversion program - Google Patents
Library conversion program Download PDFInfo
- Publication number
- JP4299228B2 JP4299228B2 JP2004358144A JP2004358144A JP4299228B2 JP 4299228 B2 JP4299228 B2 JP 4299228B2 JP 2004358144 A JP2004358144 A JP 2004358144A JP 2004358144 A JP2004358144 A JP 2004358144A JP 4299228 B2 JP4299228 B2 JP 4299228B2
- Authority
- JP
- Japan
- Prior art keywords
- library
- function
- parallel
- sequential
- link structure
- 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
- Devices For Executing Special Programs (AREA)
Description
この発明は、プログラム上のライブラリに含まれる関数を異なるライブラリの関数に変換するライブラリ変換プログラムに関し、特に変換前のライブラリ中の関数にかかる関数名と変換対象のライブラリ中の関数にかかる関数名が一致しなくとも関数を容易に変換可能とするライブラリ変換プログラムに関するものである。 The present invention relates to a library conversion program for converting a function included in a library on a program into a function of a different library, and in particular, a function name related to a function in a library before conversion and a function name related to a function in a library to be converted are The present invention relates to a library conversion program that can easily convert functions even if they do not match.
従来、プログラム上で使用されるライブラリ中の関数を、異なるライブラリの関数に変換し、プログラムを効率よく実行させるライブラリ変換装置が利用されている。 2. Description of the Related Art Conventionally, a library conversion apparatus that converts a function in a library used on a program into a function of a different library and efficiently executes the program has been used.
具体的に、このライブラリ変換装置は、変換前のライブラリ中の関数に対する関数名や機能が変換対象となるライブラリ中の関数の関数名や機能と同様である場合に、変換前のライブラリに対するリンク先を変換対象となるライブラリに変更することによって、ライブラリ中の関数を異なるライブラリの関数に変換している(例えば非特許文献1参照)。 Specifically, this library conversion device links to the library before conversion when the function name and function for the function in the library before conversion are the same as the function name and function of the function in the library to be converted. Is changed to a library to be converted, so that functions in the library are converted into functions of different libraries (see, for example, Non-Patent Document 1).
しかしながら、かかる従来の技術では、変換前のライブラリ中の関数に対する関数名が変換対象となるライブラリ中の関数の関数名と異なる場合には、容易に変換前のライブラリ中の関数を変換対象となるライブラリ中の関数に変換することができないという問題があった。 However, in the conventional technique, when the function name for the function in the library before conversion is different from the function name of the function in the library to be converted, the function in the library before conversion is easily converted. There was a problem that it could not be converted to a function in the library.
すなわち、変換前のライブラリ中の関数に対する関数名と変換対象となるライブラリ中の関数の関数名が異なる場合には、ユーザが変換前のライブラリ中の関数の関数名を変換対象となるライブラリの関数に対応するようにわざわざプログラムを修正する必要があった。 In other words, if the function name for the function in the library before conversion differs from the function name of the function in the library to be converted, the function name of the function in the library to be converted by the user is changed. It was necessary to modify the program to cope with this.
この発明は、上述した従来技術による問題点を解消するためになされたものであり、変換前のライブラリ中の関数にかかる関数名と変換対象のライブラリ中の関数にかかる関数名とが一致しなくとも関数を容易に変換可能とするライブラリ変換プログラムを提供することを目的とする。 The present invention has been made to solve the above-described problems caused by the prior art, and the function name applied to the function in the library before conversion does not match the function name applied to the function in the library to be converted. It is an object of the present invention to provide a library conversion program capable of easily converting functions.
上述した課題を解決し、目的を達成するため、請求項1の発明に係るライブラリ変換プログラムは、プログラム上のライブラリに含まれる関数を異なるライブラリの関数に変換するライブラリ変換プログラムであって、ライブラリに含まれる関数と該ライブラリと異なるライブラリに含まれる関数とを関連付けた情報であるライブラリリンク構造情報を生成するリンク構造情報生成手順と、前記ライブラリリンク構造情報を基にして、ライブラリに含まれる関数を異なるライブラリで同等の機能を有する関数に変換する変換処理手順と、をコンピュータに実行させることを特徴とする。
In order to solve the above-described problems and achieve the object, a library conversion program according to the invention of
この請求項1の発明によれば、ライブラリ変換プログラムは、ライブラリに含まれる関数と該ライブラリと異なるライブラリに含まれる関数とを関連付けた情報であるライブラリリンク構造情報を生成し、生成したライブラリリンク構造情報を基にして、ライブラリに含まれる関数を異なるライブラリで同等の機能を有する関数に変換する。 According to the first aspect of the present invention, the library conversion program generates library link structure information, which is information associating a function included in a library with a function included in a library different from the library, and generates the generated library link structure Based on the information, a function included in the library is converted into a function having an equivalent function in a different library.
また、請求項2の発明に係るライブラリ変換プログラムは、請求項1の発明において、前記リンク構造情報生成手順は、逐次ライブラリに含まれる関数と並列ライブラリに含まれる関数とを関連付けたライブラリリンク構造情報を生成し、前記変換処理手順は、前記ライブラリリンク構造情報を基にして、逐次ライブラリに含まれる関数を並列ライブラリで同等の機能を有する関数に変換することを特徴とする。 According to a second aspect of the present invention, there is provided the library conversion program according to the first aspect, wherein the link structure information generation procedure associates a function included in the sequential library with a function included in the parallel library. And the conversion processing procedure converts a function included in the sequential library into a function having an equivalent function in a parallel library based on the library link structure information.
この請求項2の発明によれば、ライブラリ変換プログラムは、逐次ライブラリに含まれる関数と並列ライブラリに含まれる関数とを関連付けたライブラリリンク構造情報を生成し、生成したライブラリリンク構造情報を基にして、逐次ライブラリに含まれる関数を並列ライブラリで同等の機能を有する関数に変換する。
According to the invention of
また、請求項3の発明に係るライブラリ変換プログラムは、請求項2の発明において、前記リンク構造情報生成手順は、前記逐次ライブラリに含まれる関数と関連付ける並列ライブラリの関数の精度および性能の情報を含んだ関連付先情報を取得する関連付先情報取得手順と、前記関連付先情報を基にして、前記逐次ライブラリの関数と並列ライブラリの関数とが1対1または多対1に関連付けられた情報であるライブラリリンク構造情報を生成するリンク生成手順とをさらにコンピュータに実行させることを特徴とする。 According to a third aspect of the present invention, in the library conversion program according to the second aspect of the invention, the link structure information generation procedure includes information on accuracy and performance of the functions of the parallel library associated with the functions included in the sequential library. Information on the association destination information acquisition procedure for acquiring association destination information, and information in which the functions of the sequential library and the functions of the parallel library are associated one-to-one or many-to-one based on the association destination information. And a link generation procedure for generating the library link structure information as described above.
この請求項3の発明によれば、ライブラリ変換プログラムは、逐次ライブラリに含まれる関数と関連付ける並列ライブラリの関数の精度および性能の情報を含んだ関連付先情報を取得し、該関連付先情報を基にして、逐次ライブラリの関数と並列ライブラリの関数とが1対1または多対1に関連付けられた情報であるライブラリリンク構造情報を生成し、生成したライブラリリンク構造情報を基にして、逐次ライブラリに含まれる関数を並列ライブラリで同等の機能を有する関数に変換する。 According to the invention of claim 3, the library conversion program obtains related destination information including accuracy and performance information of the functions of the parallel library associated with the functions included in the sequential library, and the related destination information is obtained. Based on the generated library link structure information, the library link structure information that is a one-to-one or many-to-one association between the function of the sequential library and the function of the parallel library is generated. Are converted into functions having equivalent functions in the parallel library.
また、請求項4の発明に係るライブラリ変換プログラムは、請求項2または3に記載の発明において、前記逐次ライブラリの関数に関連付けられる並列ライブラリの関数に対する入力データのデータ分割形式を解読し、前記並列ライブラリの関数の並列プロセスに利用されるデータを分割分配する分割関数を生成すると共に、該分割関数を前記プログラムに追加する分割関数生成手順をさらにコンピュータに実行させることを特徴とする。 According to a fourth aspect of the present invention, there is provided a library conversion program according to the second or third aspect of the present invention, wherein the data partition format of input data for a function of a parallel library associated with a function of the sequential library is decoded. A split function for splitting and distributing data used for a parallel process of library functions is generated, and a split function generating procedure for adding the split function to the program is further executed by the computer.
この請求項4の発明によれば、ライブラリ変換プログラムは、逐次ライブラリ関数に関連付けられる並列ライブラリの関数に対する入力データのデータ分割形式を解読し、並列ライブラリの関数の並列プロセスに利用されるデータを分割分配する分割関数を生成すると共に、分割関数をプログラムに追加する。
According to the invention of
また、請求項5の発明に係るライブラリ変換プログラムは、請求項2、3または4に記載の発明において、前記逐次ライブラリの関数に関連付けられる並列ライブラリの関数に対する出力データのデータ分割形式を解読し、前記並列ライブラリの関数の並列プロセスから分割されたデータを収集し結合する収集関数を生成すると共に、該収集関数を前記プログラムに追加する収集関数生成手順をさらにコンピュータに実行させることを特徴とする。
Further, the library conversion program according to the invention of
この請求項5の発明によれば、ライブラリ変換プログラムは、逐次ライブラリの関数に関連付けられる並列ライブラリの関数に対する出力データのデータ分割形式を解読し、並列ライブラリの関数の並列プロセスから分割されたデータを収集し結合する収集関数を生成すると共に、収集関数をプログラムに追加する。
According to the invention of
請求項1の発明によれば、ライブラリ変換プログラムは、ライブラリに含まれる関数と該ライブラリと異なるライブラリに含まれる関数とを関連付けた情報であるライブラリリンク構造情報を生成し、生成したライブラリリンク構造情報を基にして、ライブラリに含まれる関数を異なるライブラリで同等の機能を有する関数に変換するので、変換前のライブラリの関数と、変換後のライブラリの関数との関数名が異なっていても効率よく関数を変換することができる。 According to the first aspect of the present invention, the library conversion program generates library link structure information which is information associating a function included in a library with a function included in a library different from the library, and generates the generated library link structure information. Since the functions included in the library are converted into functions having equivalent functions in different libraries, it is efficient even if the function names of the library functions before conversion and the functions of the library after conversion are different. Function can be converted.
また、請求項2の発明によれば、ライブラリ変換プログラムは、逐次ライブラリに含まれる関数と並列ライブラリに含まれる関数とを関連付けたライブラリリンク構造情報を生成し、生成したライブラリリンク構造情報を基にして、逐次ライブラリに含まれる関数を並列ライブラリで同等の機能を有する関数に変換するので、変換前の逐次ライブラリの関数と、変換後の並列ライブラリの関数との関数名が異なっていても効率よく関数を変換することができる。
According to the invention of
また、請求項3の発明によれば、ライブラリ変換プログラムは、逐次ライブラリに含まれる関数と関連付ける並列ライブラリの関数の精度および性能の情報を含んだ関連付先情報を取得し、該関連付先情報を基にして、逐次ライブラリの関数と並列ライブラリの関数とが1対1または多対1に関連付けられた情報であるライブラリリンク構造情報を生成し、生成したライブラリリンク構造情報を基にして、逐次ライブラリに含まれる関数を並列ライブラリで同等の機能を有する関数に変換するので、変換前の逐次ライブラリの関数と、変換後の並列ライブラリの関数との機能が異なっていても効率よく関数を変換することができる。 According to the invention of claim 3, the library conversion program obtains related destination information including accuracy and performance information of the functions of the parallel library to be associated with the functions included in the sequential library, and the related destination information Based on the above, library link structure information that is a one-to-one or many-to-one association between the functions of the sequential library and the parallel library is generated, and the library link structure information is sequentially generated based on the generated library link structure information. Since the functions included in the library are converted into functions having equivalent functions in the parallel library, even if the functions of the sequential library function before conversion and the functions of the parallel library after conversion are different, the function is efficiently converted. be able to.
また、請求項4の発明によれば、ライブラリ変換プログラムは、逐次ライブラリ関数に関連付けられる並列ライブラリの関数に対する入力データのデータ分割形式を解読し、並列ライブラリの関数の並列プロセスに利用されるデータを分割分配する分割関数を生成すると共に、分割関数をプログラムに追加するので、ユーザは、並列プログラムのノウハウを知らなくとも容易に並列プログラムを作成することができる。
According to the invention of
また、請求項5の発明によれば、ライブラリ変換プログラムは、逐次ライブラリの関数に関連付けられる並列ライブラリの関数に対する出力データのデータ分割形式を解読し、並列ライブラリの関数の並列プロセスから分割されたデータを収集し結合する収集関数を生成すると共に、収集関数をプログラムに追加するので、ユーザは、並列プログラムのノウハウを知らなくとも容易に並列プログラムを作成することができる。
According to the invention of
以下に添付図面を参照して、この発明に係るライブラリ変換プログラムの好適な実施の形態を詳細に説明する。 Exemplary embodiments of a library conversion program according to the present invention will be described below in detail with reference to the accompanying drawings.
まず、本実施例にかかるライブラリ変換の概念について説明する。本実施例に示すライブラリ変換装置は、プログラム上に存在する逐次ライブラリの関数(以下、逐次ライブラリ関数)の変換対象となる並列ライブラリの関数(以下、並列ライブラリ関数)を選択/変換すると共に、変換後の並列ライブラリ関数の前後に分割データを分割/収集する関数を追加する。 First, the concept of library conversion according to this embodiment will be described. The library conversion apparatus shown in the present embodiment selects / converts and converts a parallel library function (hereinafter referred to as a parallel library function) to be converted into a sequential library function (hereinafter referred to as a sequential library function) existing in the program. A function for dividing / collecting the divided data is added before and after the later parallel library function.
なお、本実施例では一例として、逐次ライブラリ関数を並列ライブラリ関数に変換する場合を示すが、これに限定されるものではなく、例えば、逐次ライブラリ関数を異なる逐次ライブラリ関数に変換することができる。 In this embodiment, as an example, a case where a sequential library function is converted into a parallel library function is shown. However, the present invention is not limited to this. For example, a sequential library function can be converted into a different sequential library function.
次に、本実施例に示すライブラリ変換装置の構成について説明する。図1は、本実施例に示すライブラリ変換装置の構成を示す機能ブロック図である。同図に示すように、このライブラリ変換装置100は、キーボードやマウスなどの入力装置40およびディスプレイなどの表示装置50に接続されている。
Next, the configuration of the library conversion apparatus shown in the present embodiment will be described. FIG. 1 is a functional block diagram showing the configuration of the library conversion apparatus shown in this embodiment. As shown in the figure, the
また、ライブラリ変換装置100は、前処理部200と、記憶部300と、後処理部400とを有する。前処理部200は、逐次ライブラリ関数の関数名や引数などの関係を示す逐次ライブラリテーブルと、並列ライブラリ関数の関数名、引数、精度、特性などの関係を示す並列ライブラリテーブルとを生成する処理部である(並列ライブラリテーブルは、入力装置40から入力される並列ライブラリ関数の精度や特性などの情報を基にして生成される)。
The
さらに、前処理部200は、生成した逐次ライブラリテーブルと並列ライブラリテーブルとを表示装置50に表示し、各ライブラリ間で機能の等しい関数の情報を入力装置40から取得する(ユーザが表示装置50に表示された情報を基にして、各ライブラリ間で機能の等しい関数の情報を入力装置40から入力する)。
Further, the preprocessing
そして、前処理部200は、取得した情報を基に逐次ライブラリテーブルの逐次ライブラリ関数と並列ライブラリテーブルの並列ライブラリ関数とを関連付け、関連付けた情報を逐次/並列ライブラリリンク構造情報300aとして記憶部300に記憶させる。
The preprocessing
記憶部300は、逐次/並列ライブラリリンク構造情報300aおよびライブラリ関数の変換対象となるプログラム300bとを記憶する記憶部である。
The
後処理部400は、プログラム300bに含まれる逐次ライブラリ関数を並列ライブラリ関数に変換する処理部である。具体的に、この後処理部400は、プログラム300bの逐次ライブラリ関数に関連付けられた並列ライブラリ関数を逐次/並列ライブラリリンク構造情報300aから検索し、検索した並列ライブラリ関数と、対応する逐次ライブラリ関数とを置換する。なお、後処理部400は、並列ライブラリ関数に対応する分割データが存在する場合には、分割データを分散/収集する関数を並列ライブラリ関数の前後に追加する。
The
次に、図1に示した前処理部200の構成について説明する。図2は、図1に示した前処理部200の構成を示す機能ブロック図である。同図に示すように、前処理部200は、逐次ライブラリ情報記憶部210と、逐次ライブラリテーブル生成部220と、逐次ライブラリテーブル記憶部230と、並列ライブラリ情報記憶部240と、並列ライブラリテーブル生成部250と、並列ライブラリテーブル記憶部260と、逐次/並列ライブラリ初期リンク生成部270とを有する。
Next, the configuration of the
逐次ライブラリ情報記憶部210は、逐次ライブラリ関数の関数名や引数の情報を記憶する記憶部であり、逐次ライブラリテーブル生成部220は、逐次ライブラリ情報記憶部210に記憶された逐次ライブラリ関数の関数名や引数の情報を基にして、逐次ライブラリテーブルを作成する処理部である。
The sequential library
図3は、逐次ライブラリテーブルの一例を示す図である。同図に示すように、この逐次ライブラリテーブルは、「関数名」、「引数の数」および「引数1〜6」から構成される。ここで、「関数名」には逐次ライブラリ関数の名前が登録され、「引数の数」には逐次ライブラリ関数で利用される引数の数が登録され、「引数1〜6」には各引数の型、サイズ、入力データまたは出力データかを識別するための情報(inの場合は入力データであることを示し、outの場合は出力データであることを示す)が登録される。
FIG. 3 is a diagram illustrating an example of a sequential library table. As shown in the figure, this sequential library table is composed of “function name”, “number of arguments”, and “
なお、逐次ライブラリテーブル生成部220は、生成した逐次ライブラリテーブルを表示装置50に表示させると共に、逐次ライブラリテーブルを逐次ライブラリテーブル記憶部230に記憶させる。逐次ライブラリテーブル記憶部230は、逐次ライブラリテーブルを記憶する記憶部である。
The sequential library
並列ライブラリ情報記憶部240は、並列ライブラリ関数の関数名や引数の情報を記憶する記憶部であり、並列ライブラリテーブル生成部250は、並列ライブラリ情報記憶部240に記憶された並列ライブラリ関数の関数名や引数の情報と、入力装置60から入力される情報とを基にして並列ライブラリテーブルを生成する処理部である。
The parallel library
入力装置60から並列ライブラリ生成部250に入力される情報は、並列ライブラリ関数の精度、性能および使用するメモリ量の情報を有する。また、並列ライブラリ関数が、プロセス並列用の関数であり、かつ使用されるデータを各プロセスに分割する必要のある関数である場合には、ユーザは、各プロセスに対応するように分割したデータ(以下、分割データ)と分割データの分割形式とを入力装置60から並列ライブラリ生成部250に入力する。
The information input from the
図4は、並列ライブラリテーブルの一例を示す図である。同図に示すように、この並列ライブラリテーブルは、「関数名」、「引数の数」、「引数1〜6」、「精度」、「性能」、「メモリ量」および「分割データ」から構成される。
FIG. 4 is a diagram illustrating an example of a parallel library table. As shown in the figure, this parallel library table is composed of “function name”, “number of arguments”, “
ここで、「関数名」には並列ライブラリ関数の名前が登録され、「引数の数」には並列ライブラリ関数で利用される引数の数が登録され、「引数1〜6」には各引数の型、サイズ、入力データまたは出力データかを識別するための情報(inの場合は入力データであることを示し、outの場合は出力データであることを示す)が登録される。
Here, the name of the parallel library function is registered in “Function Name”, the number of arguments used in the parallel library function is registered in “Number of Arguments”, and each argument is registered in “
また、「精度」には並列ライブラリ関数の精度が登録され(*の数が少ないほど精度が高い)、「性能」には並列ライブラリ関数の性能が登録され(*の数が少ないほど性能が高い)、「メモリ量」には並列ライブラリ関数で使用されるメモリの量が登録され(*の数が少ないほどメモリ使用量が少ない)、「分割データ」には分割変数と分割形式とが登録される。なお、“*”は、入力装置のユーザインターフェースとして使用される表示形態である。 In addition, the accuracy of the parallel library function is registered in “Accuracy” (the smaller the number of *, the higher the accuracy), and the performance of the parallel library function is registered in “Performance” (the smaller the number of *, the higher the performance) ), The amount of memory used by the parallel library function is registered in the “memory amount” (the smaller the number of *, the smaller the memory usage), and the partition variable and partition format are registered in the “partition data” The Note that “*” is a display form used as a user interface of the input device.
なお、並列ライブラリテーブル生成部250は、生成した並列ライブラリテーブルを表示装置50に表示させると共に、並列ライブラリテーブルを並列ライブラリテーブル記憶部260に記憶させる。並列ライブラリテーブル記憶部260は、並列ライブラリテーブルを記憶する記憶部である。
The parallel library
逐次/並列ライブラリ初期リンク生成部270は、逐次ライブラリテーブル記憶部210に記憶された逐次ライブラリテーブルと、並列ライブラリテーブル記憶部240に記憶された並列ライブラリテーブルと、入力装置40から入力される逐次ライブラリ関数および並列ライブラリ関数の結合情報とを基にして、逐次ライブラリ関数と並列ライブラリ関数とをリンク付け(関連付け)した逐次/並列ライブラリリンク構造情報300aを生成し、生成した逐次/並列ライブラリリンク構造情報300aを記憶部300に記憶させる処理部である。
The sequential / parallel library initial
なお、逐次/並列ライブラリ初期リンク生成部270は、逐次ライブラリテーブルおよび並列ライブラリテーブルを表示装置50に出力させ、ユーザが入力装置50を介して機能の等しい逐次ライブラリ関数と並列ライブラリ関数とを関連付けることによって結合情報をえることになる。
The serial / parallel library initial
図5は、逐次/並列ライブラリ初期リンク生成部270によって生成される逐次/並列ライブラリリンク構造情報300aの一例を示す図である。(なお、この図5に示される表示内容は、表示装置50に表示されるものとする。)同図に示すように、この逐次/並列ライブラリリンク構造情報300aは、機能の等しい逐次ライブラリ関数と並列ライブラリ関数とが関連付けられている。
FIG. 5 is a diagram illustrating an example of the sequential / parallel library
具体的には、逐次ライブラリテーブルの「dsyevx」が並列ライブラリテーブルの「dsyevx」「dsyevd」および「dsyevr」に関連付けられ、逐次ライブラリテーブルの「dsyevd」が並列ライブラリテーブルの「dsyevx」、「dsyevd」および「dsyevr」に関連付けられ、逐次ライブラリテーブルの「dsyevr」が、並列ライブラリテーブルの「dsyevx」、「dsyevd」および「dsyevr」に関連付けられ、逐次ライブラリテーブルの「dgemm」が並列ライブラリテーブルの「dgemm」に関連付けられている。 Specifically, "dsyevx" in the sequential library table is associated with "dsyevx", "dsyevd", and "dsyevr" in the parallel library table, and "dsyevd" in the sequential library table is "dsyevx", "dsyevd" in the parallel library table And "dsyevr" in the sequential library table is associated with "dsyevx", "dsyevd", and "dsyevr" in the parallel library table, and "dgemm" in the sequential library table is "dgemm" in the parallel library table. ".
次に、図1に示した後処理部400の構成について説明する。図6は、図1に示した後処理部400の構成を示す機能ブロック図である。同図に示すように、この後処理部4000は、コマンド受付部410と、リンク再構成処理部420と、ライブラリ置換処理部430と、ライブラリ関数検索部440とオブジェクトコード変換部450とを有する。
Next, the configuration of the
コマンド受付部410は、プログラム300bのコンパイルを行うコマンド(以下、コンパイルコマンドと表記する)を入力装置40から取得し、取得したコンパイルコマンドの指示内容を解析すると共に、解析した指示内容をリンク再構成処理部420に渡す処理部である。
The
例えば、コマンド受付部410がコンパイルコマンド「ffc-mxxx.c-laaa-lbbb-lccc-linktable link.lf」を取得した場合には、このコンパイルコマンドの指示内容は「ffc」○○社製Cコンパリラを使用し、「-m」ライブラリ関数の優先要素はメモリ量を優先し、「laaa-lbbb-lccc」リンクするライブラリをlaaaとlbbbとlcccとに指定し、「linktablle link.lf」利用するリンクテーブルを逐次/並列ライブラリリンク構造情報330aに指定する旨を示している。
For example, when the
なお、コンパイルコマンドにかかる優先要素が「p」の場合には精度を優先する旨を示し、優先要素が「m」の場合には使用メモリを優先する(使用メモリ量の最も少ないライブラリ関数を優先する)旨を示し、優先要素が「s」の場合には処理速度を優先する旨を示す。 If the priority element for the compile command is “p”, it indicates that priority is given to accuracy. If the priority element is “m”, priority is given to the memory used (priority is given to the library function with the smallest memory usage). If the priority element is “s”, the processing speed is prioritized.
また、優先要素が「ms」の場合には、使用メモリ量を第一優先とし、メモリ使用量が最小の関数を検索する。メモリ使用量が最小の関数が複数存在する場合には、第二優先として、メモリ使用量が最小の関数の内、最も処理速度が速い関数を選択する旨を示す。その他、優先要素は「pm」、「pms」および「mp」などのように「p」、「m」、「s」を組み合わせて、ユーザが所望する関数を選択することができる。 When the priority element is “ms”, the used memory amount is given the first priority, and a function having the smallest memory use amount is searched. When there are a plurality of functions having the smallest memory usage, the function having the fastest processing speed among the functions having the smallest memory usage is selected as the second priority. In addition, as the priority element, a function desired by the user can be selected by combining “p”, “m”, and “s” such as “pm”, “pms”, and “mp”.
さらに、優先要素は「m0.4s0.5p0.1」と指定することもできる(本実施例では一例を示す)。この場合、使用メモリ量を40%の割合、処理速度を50%の割合、精度を10%の割合で優先することを示す。 Furthermore, the priority element can be specified as “m0.4s0.5p0.1” (an example is shown in this embodiment). In this case, priority is given to the used memory amount at a rate of 40%, the processing speed at a rate of 50%, and the accuracy at a rate of 10%.
リンク再構成処理部420は、逐次/並列ライブラリリンク構造情報300aをコマンド受付部410から渡される指示内容を基にして再構成する処理部であり、リンク構造排除処理部420aと、N(多)対1リンク構造生成部420bとを有する。
The link
リンク構造排除処理部420aは、コマンド受付部410からリンクするライブラリにかかる情報(以下、リンクライブラリ情報)を取得し、取得したリンクライブラリ情報を基にして逐次/並列ライブラリリンク構造情報300aの初期リンク構造にある不要なライブラリテーブルやリンク構造を削除する。
The link structure
図7は、初期リンク構造にある不要なライブラリテーブルやリンク構造の削除を説明するための説明図である。同図に示すように、初期リンク構造では、逐次ライブラリテーブル1が並列ライブラリ4にリンクされ、逐次ライブラリテーブル2が並列ライブラリテーブル5、6にリンクされ、逐次ライブラリテーブル3が並列ライブラリテーブル4〜8にリンクされている。
FIG. 7 is an explanatory diagram for explaining deletion of unnecessary library tables and link structures in the initial link structure. As shown in the figure, in the initial link structure, the sequential library table 1 is linked to the
そして、リンク構造排除処理部420aが、逐次ライブラリテーブル3と並列ライブラリテーブル4〜7をリンクする旨のリンクライブラリ情報を取得した場合には、逐次ライブラリテーブル1,2を削除すると共に、逐次ライブラリテーブル1と並列ライブラリテーブル4とのリンク、逐次ライブラリテーブル2と並列ライブラリテーブル5,6とのリンク、逐次ライブラリテーブル3と並列ライブラリテーブル8とのリンクを削除する。
When the link structure
N対1リンク構造生成部420bは、コマンド受付部410からコンパイルコマンドの優先要素にかかる情報(以下、優先要素情報)を取得し、取得した優先要素情報を基にして、逐次/並列ライブラリリンク構造情報300aでリンクされている複数の並列ライブラリ関数の内、最適な並列ライブラリ関数を選択し、「1対1またはN(多)対1」のリンク構造に再構成する処理部である。
The N-to-1 link structure generation unit 420b acquires information (hereinafter referred to as priority element information) related to the priority element of the compile command from the
図8は、メモリ量を優先した場合に、再構成される逐次/並列ライブラリリンク構造情報300aを示す図である。元々、逐次/並列ライブラリリンク構造情報300aは、図5に示したように、逐次ライブラリ関数「dsyevx」が並列ライブラリ関数「dsyevx」、「dsyevd」および「dsyevr」に関連付けれ、逐次ライブラリ関数「dsyevd」が並列ライブラリ関数「dsyevx」、「dsyevd」および「dsyevr」に関連付けれ、逐次ライブラリ関数「dsyevr」が並列ライブラリ関数「dsyevx」、「dsyevd」および「dsyevr」に関連付けれ、逐次ライブラリ関数「dgemm」が並列ライブラリ関数「dgemm」に関連付けられていた。
FIG. 8 is a diagram showing the sequential / parallel library
しかし、メモリ量を優先する場合には、図8に示すように、関連付けられた並列ライブラリ関数の内、使用されるメモリ量が最も少ない並列ライブラリ関数以外の関連付けを解除する。具体的には、逐次ライブラリ関数「dsyevx」を並列ライブラリ関数「dsyevr」のみに関連付け、逐次ライブラリ関数「dsyevd」を並列ライブラリ関数「dsyevr」のみに関連付け、逐次ライブラリ関数「dsyevr」を並列ライブラリ関数「dsyevr」のみに関連付ける。なお、逐次ライブラリ関数「dgemm」に関しては、一つの並列ライブラリ関数「dgemm」のみに関連付けられているため、関連付けに変更はない。 However, when priority is given to the amount of memory, as shown in FIG. 8, associations other than the parallel library function that uses the least amount of memory among the associated parallel library functions are canceled. Specifically, the sequential library function “dsyevx” is associated only with the parallel library function “dsyevr”, the sequential library function “dsyevd” is associated only with the parallel library function “dsyevr”, and the sequential library function “dsyevr” is associated with the parallel library function “ dsyevr "only. Since the sequential library function “dgemm” is associated with only one parallel library function “dgemm”, the association is not changed.
なお、図8に示した各関数の関連付けは、実際には関連付け先となる並列ライブラリ関数のポインタを利用することになる。図9は、ポインタによって関連付けられた逐次/並列ライブラリリンク構造情報300aの一例を示す図である。
The association of each function shown in FIG. 8 actually uses the pointer of the parallel library function that is the association destination. FIG. 9 is a diagram illustrating an example of the sequential / parallel library
同図に示すように、各逐次ライブラリ関数はそれぞれ関連付け先となる並列ライブラリ関数のポインタを有し、このポインタによって、関連付けられる並列ライブラリ関数が特定される。また、並列ライブラリテーブルの精度、性能およびメモリ量は、「*」ではなく、実際には数字によって登録される。また、並列ライブラリテーブルのポインタ領域は「null」に設定され使用されない。 As shown in the figure, each sequential library function has a pointer to a parallel library function to be associated with, and the associated parallel library function is specified by this pointer. In addition, the accuracy, performance, and amount of memory of the parallel library table are actually registered by numbers, not “*”. The pointer area of the parallel library table is set to “null” and is not used.
ライブラリ置換処理部430は、逐次/並列ライブラリリンク構造情報300aを基にして、プログラム上の逐次ライブラリ関数を並列ライブラリ関数に置換する処理部であり、整合性調整処理部430aと、分割データ生成部430bと、収集データ生成部430cと、並列ライブラリ結合部430dとを有する。
The library
整合性調整処理部430aは、引数コンバータライブラリを保持し、関連付けられた逐次ライブラリ関数と並列ライブラリ関数との引数の並び順が異なる場合に、引数コンバータライブラリに含まれる引数コンバータライブラリ関数を利用して、逐次ライブラリ関数の引数の並び順と等しい並列ライブラリ関数を新たに生成し、生成した並列ライブラリ関数と逐次ライブラリ関数とを新たに関連付ける処理部である。
The consistency
図10は、整合性調整処理部430aの処理を説明するための説明図である。同図に示すように、整合性調整処理部430aは、逐次ライブラリ関数10の引数の並びが並列ライブラリ関数11の引数の並びと異なる場合に、並列ライブラリ関数11の前に、引数コンバータライブラリ関数「argv_converter」を設定することによって、逐次ライブラリ関数10の引数の並びと同様の引数の並びを有する並列ライブラリ関数12を生成し、逐次ライブラリ関数10と並列ライブラリ関数12とを新たにリンク付ける。なお、整合性調整処理部430aは、逐次ライブラリ関数10と並列ライブラリ関数11とのリンク付けは解除する。
FIG. 10 is an explanatory diagram for explaining the processing of the consistency
分割データ生成部430bは、データ分割/収集ライブラリを保持し、置換対象となる並列ライブラリ関数に分割データの指定があり、かつ分割データが入力データに対応する場合に、分割データを各プロセスに分配する機能を有する関数をデータ分割/収集ライブラリから検索し、検索した関数と分割データとで分割関数を生成し、生成した分割関数を並列ライブラリ結合部430dに渡す処理部である。 The divided data generation unit 430b holds the data dividing / collecting library, and when the divided data is specified in the parallel library function to be replaced and the divided data corresponds to the input data, the divided data is distributed to each process. This is a processing unit that searches the data partition / collection library for a function having the function to generate, generates a split function from the searched function and split data, and passes the generated split function to the parallel library combining unit 430d.
例えば、変換対象となる並列ライブラリ関数が、図2に示す「dsyevr」であり、dsyevrに対する分割変数が「A,B,C」であり、この分割変数の内、「A,B」が入力データである場合には、分割データ生成部430bは、分割関数「div_data(a…)」、「div_data(b…)」を生成し、生成した分割関数を、並列ライブラリ結合部430に渡す。
For example, the parallel library function to be converted is “dsyevr” shown in FIG. 2, and the partitioning variable for dsyevr is “A, B, C”, and among these partitioning variables, “A, B” is input data. In this case, the divided data generation unit 430b generates divided functions “div_data (a...)” And “div_data (b...)” And passes the generated divided functions to the parallel
収集データ生成部430cは、データ分割/収集ライブラリを保持し、置換対象となる並列ライブラリ関数に分割データの指定があり、かつ分割データが出力データに対応する場合に、各プロセスから出力されるデータを収集する機能を有する関数をデータ分割/収集ライブラリから検索し、検索した関数と分割データとで収集関数を生成し、生成した収集関数を並列ライブラリ結合部430dに渡す処理部である。
The collection
例えば、変換対象となる並列ライブラリ関数が、図2に示す「dsyevr」であり、dsyevrに対する分割変数が「A,B,C」であり、この分割変数の内、「C」が出力データである場合には、収集データ生成部430bは、収集関数「gather_data(c…)」を生成し、生成した収集関数を、並列ライブラリ結合部430dに渡す。 For example, the parallel library function to be converted is “dsyevr” shown in FIG. 2, and the partition variables for dsyevr are “A, B, C”, and among these partition variables, “C” is the output data. In this case, the collected data generation unit 430b generates a collection function “gather_data (c...)” And passes the generated collection function to the parallel library combination unit 430d.
並列ライブラリ結合部430dは、プログラム300bに含まれる逐次ライブラリ関数を、並列ライブラリ関数に置換する処理部である。具体的に、並列ライブラリ結合部430dは、並列ライブラリ関数に置換する場合に、並列ライブラリ関数の情報を整合性調整処理部430、分割データ生成部430bおよび収集データ生成部430cに通知する。
The parallel library coupling unit 430d is a processing unit that replaces a sequential library function included in the
そして、整合性調整処理部430aによって逐次ライブラリ関数と並列ライブラリ関数との引数の順番を調整され、分割データ生成部430bが分割関数を生成し、収集データ生成部430cが収集関数を生成し、並列ライブラリ結合部430dが変換対象となる並列ライブラリ関数と分割関数と収集関数とを結合し、結合した並列ライブラリ関数とプログラム上の逐次ライブラリ関数とを置換する。
Then, the order of arguments of the sequential library function and the parallel library function is adjusted by the consistency
図11は、並列ライブラリ結合部430dが行う処理を説明するための説明図である。同図に示すように、並列ライブラリ結合部430dは、並列ライブラリテーブルの並列ライブラリ関数「dsyevr」と、分割関数「div_data(a…)」、「div_data(b…)」と、収集関数「gather_data(c…)」とを結合し、各関数を結合した並列ライブラリ関数と、プログラム上の逐次ライブラリ関数とを置換する。 FIG. 11 is an explanatory diagram for explaining processing performed by the parallel library combining unit 430d. As shown in the figure, the parallel library combining unit 430d includes the parallel library function “dsyevr” of the parallel library table, the division functions “div_data (a ...)”, “div_data (b ...)”, and the collection function “gather_data ( c ...) ", and the parallel library function obtained by combining the functions is replaced with the sequential library function on the program.
なお、プログラム上にプラグマ(コンパイラへ特別な指示をするように開発プログラム中に書き込む指示文)が存在する場合は、並列ライブラリ結合部430dは、プラグマを解読し、プラグマによって指定された逐次ライブラリ関数を関連付けられた並列ライブラリ関数に変換する。 If there is a pragma (an instruction sentence written in the development program so as to give a special instruction to the compiler) on the program, the parallel library coupling unit 430d decodes the pragma and the sequential library function designated by the pragma. To the associated parallel library function.
ライブラリ関数検索部440は、プログラム300b中のライブラリ関数のコールを検索し、コールされている逐次ライブラリ関数の情報を並列ライブラリ結合部430に通知する処理部である。並列ライブラリ結合部430dは、通知を受けた逐次ライブラリ関数のポインタを検索し、逐次ライブラリ関数が関連付けられている場合に(ポインタがnull以外の場合に)、逐次ライブラリ関数を並列ライブラリ関数に置換することになる。
The library
また、ライブラリ関数検索部440は、プログラム中からプラグマを検出した場合には、プラグマを検出した旨と、対応する逐次ライブラリ関数の情報とを並列ライブラリ結合部430dに通知する。さらに、ライブラリ関数検索部440は、プログラム中からライブラリ関数のコールおよびプラグマを検索し終わった場合に、検索が終了した旨をオブジェクトコード変換部450に通知する。
Further, when the pragma is detected in the program, the library
オブジェクトコード変換処理部450は、ライブラリ関数検索部440からプログラム300b上のライブラリ関数のコールおよびプラグマを検索し終わった旨の通知を取得した場合に、プログラム300bをオブジェクトコードに変換する処理部である。
The object code conversion processing unit 450 is a processing unit that converts the
次に、図6に示した後処理部400の処理について説明する。図12は、図6に示した後処理部400の処理手順を示すフローチャートである。同図に示すように、後処理部400は、コマンド受付部410がコンパイルコマンドを取得して、コンパイルコマンドの指示内容をリンク再編成処理部420に通知し(ステップS101)、リンク再編成処理部420が逐次/並列ライブラリリンク構造情報300aを取得する(ステップS102)。
Next, processing of the
そして、リンク構造排除処理部420aが不要なライブラリとそのリンク構造を排除し(ステップS103)、N対1リンク構造生成部420bがコンパイルコマンドの指示内容に対するリンク構造を生成し(ステップS104)、ライブラリ関数検索部440がプログラム中にライブラリ関数コールがあるか否かを判定する(ステップS105)。
Then, the link structure
プログラム中にライブラリ関数のコールがない場合には(ステップS105,No)、処理を終了し、プログラム中にライブラリ関数のコールがある場合には(ステップS105,Yes)、並列ライブラリ結合部430dが、リンクされている関数があるか否かを判定する(ステップS106)。 If there is no library function call in the program (step S105, No), the process is terminated. If there is a library function call in the program (step S105, Yes), the parallel library combining unit 430d It is determined whether there is a linked function (step S106).
リンクされている関数がない場合には(ステップS106,No)、処理を終了し、リンクされている関数がある場合には(ステップS106,Yes)、並列ライブラリ結合部430dがライブラリ関数の置換を行い(ステップS107)、整合性調整処理部430aがリンクされた関数どうしの引数が一致するか否かを判定する(ステップS108)。
If there is no linked function (step S106, No), the process ends. If there is a linked function (step S106, Yes), the parallel library combining unit 430d replaces the library function. In step S107, the consistency
リンクされた関数どうしの引数が一致しない場合には(ステップS108,No)、整合性調整処理部430aが引数並びの同じ関数を生成し、新たなリンク付けを行い(ステップS109)、分割データ生成部430bおよび収集データ生成部430cが変換後の関数に分割データがあるか否かを判定する(ステップS110)。一方、リンクされた関数どうしの引数が一致する場合には(ステップS108,Yes)、そのままステップS110に移行する。
If the arguments of the linked functions do not match (No in step S108), the consistency
関数に分割データがない場合には(ステップS110,No)、処理を終了し、関数に分割データがある場合には(ステップS110,Yes)、分割データ生成部430bが分割関数を生成し、収集データ生成部430cが収集関数を生成し、並列ライブラリ結合部430dが、分割関数または収集関数をプログラムに挿入する(ステップS111)。
If there is no divided data in the function (step S110, No), the process ends. If the function has divided data (step S110, Yes), the divided data generation unit 430b generates a divided function and collects it. The
このように、プログラム中のライブラリ関数にコールがあり、且つコールされた関数がリンクされている場合には、並列ライブラリ結合部430が、プログラム中の逐次ライブラリ関数を、並列ライブラリ関数に置換し、分割関数または収集関数をプログラムに挿入するので、置換対象となる逐次ライブラリ関数の機能などが、置換元の並列ライブラリ関数の機能などと異なっていてもユーザが元プログラム修正することなくライブラリ関数を置換することができる。
As described above, when there is a call in the library function in the program and the called function is linked, the parallel
次に、プログラム中のプラグマを考慮した後処理部400bの処理について説明する。図13は、プログラム中のプラグマを考慮した後処理部400bの処理手順を示すフローチャートである。同図に示すように、後処理部400は、コマンド受付部410がコンパイルコマンドを取得して、コンパイルコマンドの指示内容をリンク再編成処理部420に通知し(ステップS201)、リンク再編成処理部420が逐次/並列ライブラリリンク構造情報300aを取得する(ステップS202)。
Next, processing of the post-processing unit 400b in consideration of pragmas in the program will be described. FIG. 13 is a flowchart showing the processing procedure of the post-processing unit 400b in consideration of the pragma in the program. As shown in the figure, in the
そして、リンク構造排除処理部420aが不要なライブラリとそのリンク構造を排除し(ステップS203)、ライブラリ関数検索部440がプログラム中にプラグマ指定があるか否かを判定し(ステップS204)、プログラム中にプラグマ指定がある場合には(ステップS204,Yes)、ライブラリ置換処理部430がプラグマ処理を行い(ステップS205)、N対1リンク構造生成部420bがコンパイルコマンドの指示内容に対するリンク構造を生成する(ステップS206)。一方、プログラム中にプラグマ指定がない場合には(ステップS204,No)、そのままステップS206に移行する。
Then, the link structure
続いて、ライブラリ関数検索部440がプログラム中にライブラリ関数(プラグマ指定以外)コールがあるか否かを判定し(ステップS207)、プログラム中にライブラリ関数コールがない場合には(ステップS207,No)、処理を終了し、プログラム中にライブラリ関数コールがある場合には(ステップS207,Yes)、並列ライブラリ結合部430dが、リンクされている関数があるか否かを判定する(ステップS208)。
Subsequently, the library
リンクされている関数がない場合には(ステップS208,No)、処理を終了し、リンクされている関数がある場合には(ステップS208,Yes)、並列ライブラリ結合部430dがライブラリ関数の置換を行い(ステップS209)、整合性調整処理部430aがリンクされた関数どうしの引数が一致するか否かを判定する(ステップS210)。
If there is no linked function (step S208, No), the process ends. If there is a linked function (step S208, Yes), the parallel library combining unit 430d replaces the library function. In step S209, the consistency
リンクされた関数どうしの引数が一致しない場合には(ステップS210,No)、整合性調整処理部430aが引数並びの同じ関数を生成し、新たなリンク付けを行い(ステップS211)、分割データ生成部430bおよび収集データ生成部430cが変換後の関数に分割データがあるか否かを判定する(ステップS212)。一方、リンクされた関数どうしの引数が一致する場合には(ステップS210,Yes)、そのままステップS212に移行する。
If the arguments of the linked functions do not match (No in step S210), the consistency
変換後の関数に分割データがない場合には(ステップS212,No)、処理を終了し、変換後の関数に分割データがある場合には(ステップS212,Yes)、分割データ生成部430bが分割関数を生成し、収集データ生成部430cが収集関数を生成し、並列ライブラリ結合部430dが分割関数または収集関数をプログラムに挿入する(ステップS213)。
When there is no divided data in the function after conversion (No at Step S212), the process ends, and when there is divided data in the function after conversion (Yes at Step S212), the divided data generation unit 430b performs division. The collected
次に、図13のステップS205に示したプラグマ処理について説明する。図14は、図13のステップS205に示したプラグマ処理を示すフローチャートである。同図に示すように、後処理部400は、並列ライブラリ結合部430dが使用するライブラリ関数を決定し、ライブラリ関数を置換する(ステップS301)。
Next, the pragma process shown in step S205 of FIG. 13 will be described. FIG. 14 is a flowchart showing the pragma process shown in step S205 of FIG. As shown in the figure, the
そして、整合性調整部430aがリンクされている関数どうしの引数が一致するか否かを判定し(ステップS302)、リンクされた関数どうしの引数が一致しない場合には(ステップS302,No)、整合性調整処理部430aが引数並びの同じ関数を生成し、新たなリンク付けを行い(ステップS303)、分割データ生成部430bおよび収集データ生成部430cが変換後の関数に分割データがあるか否かを判定する(ステップS304)。一方、リンクされた関数どうしの引数が一致する場合には(ステップS302,Yes)、そのままステップS304に移行する。
Then, the
変換後の関数に分割データがない場合には(ステップS304,No)、プラグマ処理を終了し、変換後の関数に分割データがある場合には(ステップS304,Yes)、分割データ生成部430bが分割関数を生成し、収集データ生成部430cが収集関数を生成し、並列ライブラリ結合部430dが分割関数または収集関数をプログラムに挿入する(ステップS305)。
If there is no divided data in the converted function (step S304, No), the pragma process is terminated. If the converted function has divided data (step S304, Yes), the divided data generation unit 430b The division function is generated, the collection
このように、プログラム中にプラグマが存在する場合であっても、並列ライブラリ結合部430dがプラグマ指定されたライブラリ関数を、置換対象となるライブラリ関数に変換し、分割関数および収集関数を、置換したライブラリ関数の前後に追加するので、効率よくライブラリ関数を置換することができる。 As described above, even if a pragma exists in the program, the parallel library coupling unit 430d converts the library function designated by the pragma into a library function to be replaced, and replaces the dividing function and the collection function. Since it is added before and after the library function, the library function can be replaced efficiently.
上述してきたように、本実施例にかかるライブラリ変換装置100は、予め、前処理部200が、逐次/並列ライブラリリンク構造情報300aを生成する。そして、コンパイルコマンドをコマンド受付部410が受け取った場合に、コマンド受付部410が指示内容を解析し、リンク再構成処理部420がコンパイルコマンドの指示内容を基に、逐次/並列ライブラリリンク構造情報300aを変換し、ライブラリ置換処理部430が、変換された逐次/並列ライブラリリンク情報300aを基にして、プログラム中の逐次ライブラリ関数を、並列ライブラリ関数に置換するので、置換元の逐次ライブラリ関数関数名と置換対象となる並列ライブラリ関数関数名とが異なっていてもユーザが元プログラムを修正することなくライブラリ関数を置換することができる。
As described above, in the
また、元プログラムを修正することなく、逐次ライブラリ関数を並列ライブラリ関数に変換することができるので、ユーザは並列プログラムのノウハウを知らなくとも容易に並列プログラムを作成することができ、並列プログラム開発を短縮化することが出来る。 In addition, since it is possible to convert a sequential library function into a parallel library function without modifying the original program, a user can easily create a parallel program without knowing the know-how of the parallel program. It can be shortened.
ところで、上記の実施例で説明した各種の処理は、予め用意されたプログラムをコンピュータで実行することによって実現することができる。そこで、以下では、図15を用いて、上記の実施例と同様の機能を有するライブラリ変換プログラムを実行するコンピュータの一例を説明する。図15は、ライブラリ変換プログラムを実行するコンピュータを示す図である。 By the way, the various processes described in the above embodiments can be realized by executing a program prepared in advance on a computer. In the following, an example of a computer that executes a library conversion program having the same function as that of the above embodiment will be described with reference to FIG. FIG. 15 is a diagram illustrating a computer that executes a library conversion program.
同図に示すように、ライブラリ変換装置としてのコンピュータ30は、入力装置31、表示装置32、RAM33、HDD34、ROM35およびCPU36をバス37で接続して構成される。ここで、入力装置31および表示装置32は、図1に示した入力装置40および表示装置50にそれぞれ対応する。
As shown in the figure, a
そして、ROM35には、上記の実施例と同様の機能を発揮するライブラリ変換プログラム、つまり、図15に示すように、逐次/並列ライブラリリンク生成プログラム35a、並列ライブラリ結合処理プログラム35b、が予め記憶されている。
The
そして、CPU35が、これらのプログラム35a,35bをROM35から読み出して実行することで、図15に示すように、各プログラム35a,35bは、逐次/並列ライブラリリンク生成プロセス36a、並列ライブラリ結合処理プロセス36bとして機能するようになる。逐次/並列ライブラリリンク生成プロセス36aは、図1に示した前処理部200に対応し、並列ライブラリ結合処理プロセス36bは、図1に示した後処理部400に対応する。
Then, the
また、HDD34には、図15に示すように、変換対象プログラム34aとライブラリ情報34bが記録される。なお、変換対象プログラム34aは、図1に示したプログラム300bに対応し、ライブラリ情報34bは、図2に示した逐次ライブラリ情報記憶部210および並列ライブラリ情報記憶部240に対応する。そして、CPU36は、変換対象プログラム34aおよびライブラリ情報34bを読み出して、RAM33に格納する。また、CPU36は、逐次/並列ライブラリリンク構造情報33cを作成し、作成した逐次/並列ライブラリリンク構造情報33cを基にして、変換対象プログラム33aのライブラリ関数を置換する。ここで、逐次/並列ライブラリリンク構造情報33cは、図1に示した逐次/並列ライブラリリンク構造情報300aに対応する。
Also, as shown in FIG. 15, the
ところで、上記したプログラム35a、35bについては、必ずしも最初からROM35に記憶させておく必要はなく、例えば、コンピュータに挿入されるフレキシブルディスク(FD)、CD−ROM、MOディスク、DVDディスク、光磁気ディスク、ICカードなどの「可搬用の物理媒体」、または、コンピュータ30の内外に備えられるハードディスクドライブ(HDD)などの「固定用の物理媒体」、さらには、公衆回線、インターネット、LAN、WANなどを介してコンピュータ30に接続される。「他のコンピュータ(またはサーバ)」などに各プログラムを記憶させておき、コンピュータ30がこれらから各プログラムを読み出して実行するようにしてもよい。
By the way, the above-described
(付記1)プログラム上のライブラリに含まれる関数を異なるライブラリの関数に変換するライブラリ変換プログラムであって、
ライブラリに含まれる関数と該ライブラリと異なるライブラリに含まれる関数とを関連付けた情報であるライブラリリンク構造情報を生成するリンク構造情報生成手順と、
前記ライブラリリンク構造情報を基にして、ライブラリに含まれる関数を異なるライブラリで同等の機能を有する関数に変換する変換処理手順と、
をコンピュータに実行させることを特徴とするライブラリ変換プログラム。
(Appendix 1) A library conversion program for converting a function included in a library on a program into a function of a different library,
A link structure information generation procedure for generating library link structure information, which is information relating a function included in a library and a function included in a library different from the library;
A conversion processing procedure for converting a function included in the library into a function having an equivalent function in a different library based on the library link structure information;
A library conversion program characterized in that a computer is executed.
(付記2)前記リンク構造情報生成手順は、逐次ライブラリに含まれる関数と並列ライブラリに含まれる関数とを関連付けたライブラリリンク構造情報を生成し、前記変換処理手順は、前記ライブラリリンク構造情報を基にして、逐次ライブラリに含まれる関数を並列ライブラリで同等の機能を有する関数に変換することを特徴とする付記1に記載のライブラリ変換プログラム。
(Supplementary Note 2) The link structure information generation procedure generates library link structure information in which a function included in the sequential library and a function included in the parallel library are associated with each other, and the conversion processing procedure is based on the library link structure information. The library conversion program according to
(付記3)前記リンク構造情報生成手順は、前記逐次ライブラリに含まれる関数と関連付ける並列ライブラリの関数の精度および性能の情報を含んだ関連付先情報を取得する関連付先情報取得手順と、前記関連付先情報を基にして、前記逐次ライブラリの関数と並列ライブラリの関数とが1対1または多対1に関連付けられた情報であるライブラリリンク構造情報を生成するリンク生成手順とをさらにコンピュータに実行させることを特徴とする付記2に記載のライブラリ変換プログラム。
(Supplementary Note 3) The link structure information generation procedure includes a related destination information acquisition procedure for acquiring related destination information including accuracy and performance information of a function of a parallel library to be associated with a function included in the sequential library, A link generation procedure for generating library link structure information, which is information in which the function of the sequential library and the function of the parallel library are associated one-to-one or many-to-one based on the association destination information, is further stored in the computer. The library conversion program according to
(付記4)前記逐次ライブラリの関数に関連付けられる並列ライブラリの関数に対する入力データのデータ分割形式を解読し、前記並列ライブラリの関数の並列プロセスに利用されるデータを分割分配する分割関数を生成すると共に、該分割関数を前記プログラムに追加する分割関数生成手順をさらにコンピュータに実行させることを特徴とする付記2または3に記載のライブラリ変換プログラム。
(Supplementary Note 4) Deciphering the data division format of the input data for the function of the parallel library associated with the function of the sequential library, and generating a division function for dividing and distributing the data used for the parallel process of the function of the parallel library The library conversion program according to
(付記5)前記逐次ライブラリの関数に関連付けられる並列ライブラリの関数に対する出力データのデータ分割形式を解読し、前記並列ライブラリの関数の並列プロセスから分割されたデータを収集し結合する収集関数を生成すると共に、該収集関数を前記プログラムに追加する収集関数生成手順をさらにコンピュータに実行させることを特徴とする付記2、3または4に記載のライブラリ変換プログラム。
(Additional remark 5) The data division | segmentation format of the output data with respect to the function of the parallel library linked | related with the function of the said sequential library is decoded, The collection function which collects the data divided | segmented from the parallel process of the function of the said parallel library, and produces | generates it is produced | generated. The library conversion program according to
(付記6)プログラムに含まれるプラグマを検索し、プラグマに対応する逐次ライブラリの関数を同等の機能を有する並列ライブラリの関数に変換するプラグマ処理手順をさらにコンピュータに実行させることを特徴とする付記1〜5のいずれか一つに記載のライブラリ変換プログラム。 (Additional remark 6) The pragma contained in a program is searched, The pragma processing procedure which converts the function of the sequential library corresponding to a pragma into the function of the parallel library which has an equivalent function is further made to perform by a computer The library conversion program as described in any one of -5.
(付記7)プログラム上のライブラリに含まれる関数を異なるライブラリの関数に変換するライブラリ変換方法であって、
ライブラリに含まれる関数と該ライブラリと異なるライブラリに含まれる関数とを関連付けた情報であるライブラリリンク構造情報を生成するリンク構造情報生成工程と、
前記ライブラリリンク構造情報を基にして、ライブラリに含まれる関数を異なるライブラリで同等の機能を有する関数に変換する変換処理工程と、
を含んだことを特徴とするライブラリ変換方法。
(Appendix 7) A library conversion method for converting a function included in a library on a program into a function of a different library,
A link structure information generating step for generating library link structure information, which is information relating a function included in a library and a function included in a library different from the library;
Based on the library link structure information, a conversion process step of converting a function included in the library into a function having an equivalent function in a different library;
A library conversion method characterized by including:
(付記8)前記リンク構造情報生成工程は、逐次ライブラリに含まれる関数と並列ライブラリに含まれる関数とを関連付けたライブラリリンク構造情報を生成し、前記変換処理工程は、前記ライブラリリンク構造情報を基にして、逐次ライブラリに含まれる関数を並列ライブラリで同等の機能を有する関数に変換することを特徴とする付記7に記載のライブラリ変換方法。
(Supplementary Note 8) The link structure information generation step generates library link structure information in which a function included in the sequential library and a function included in the parallel library are associated with each other, and the conversion processing step is based on the library link structure information. The library conversion method according to
(付記9)前記リンク構造情報生成工程は、前記逐次ライブラリに含まれる関数と関連付ける並列ライブラリの関数の精度および性能の情報を含んだ関連付先情報を取得する関連付先情報取得工程と、前記関連付先情報を基にして、前記逐次ライブラリの関数と並列ライブラリの関数とが1対1または多対1に関連付けられた情報であるライブラリリンク構造情報を生成するリンク生成工程とをさらに含んだことを特徴とする付記8に記載のライブラリ変換方法。
(Supplementary note 9) The link structure information generation step includes a related destination information acquisition step of acquiring related destination information including information on accuracy and performance of a function of a parallel library associated with a function included in the sequential library, And a link generation step of generating library link structure information that is a one-to-one or many-to-one association between the function of the sequential library and the function of the parallel library based on the association destination information. The library conversion method according to
(付記10)前記逐次ライブラリの関数に関連付けられる並列ライブラリの関数に対する入力データのデータ分割形式を解読し、前記並列ライブラリの関数の並列プロセスに利用されるデータを分割分配する分割関数を生成すると共に、該分割関数を前記プログラムに追加する分割関数生成工程をさらに含んだことを特徴とする付記8または9に記載のライブラリ変換方法。
(Supplementary Note 10) Decipher the data division format of the input data for the function of the parallel library associated with the function of the sequential library, and generate a division function for dividing and distributing the data used for the parallel process of the function of the parallel library The library conversion method according to
(付記11)前記逐次ライブラリの関数に関連付けられる並列ライブラリの関数に対する出力データのデータ分割形式を解読し、前記並列ライブラリの関数の並列プロセスから分割されたデータを収集し結合する収集関数を生成すると共に、該収集関数を前記プログラムに追加する収集関数生成工程をさらに含んだことを特徴とする付記8、9または10に記載のライブラリ変換方法。
(Supplementary Note 11) Decodes the data division format of the output data for the function of the parallel library associated with the function of the sequential library, and generates a collection function that collects and combines the divided data from the parallel process of the function of the parallel library The library conversion method according to
(付記12)プログラムに含まれるプラグマを検索し、プラグマに対応する逐次ライブラリの関数を同等の機能を有する並列ライブラリの関数に変換するプラグマ処理工程をさらに含んだことを特徴とする付記7〜11のいずれか一つに記載のライブラリ変換方法。 (Additional remark 12) The pragma processing step which searches for the pragma included in the program and converts the function of the sequential library corresponding to the pragma into the function of the parallel library having an equivalent function is further included. The library conversion method according to any one of the above.
以上のように、本発明にかかるライブラリ変換プログラムは、置換前のライブラリ関数と、置換後のライブラリ関数との関数名が異なる場合であっても、ライブラリ関数を容易に置換する必要のあるライブラリ変換装置などに対して有用である。 As described above, the library conversion program according to the present invention is a library conversion that needs to be easily replaced even if the function names of the library function before replacement and the library function after replacement are different. Useful for devices and the like.
40 入力装置
50 表示装置
100 ライブラリ変換装置
200 前処理部
210 逐次ライブラリ情報記憶部
220 逐次ライブラリテーブル生成部
230 逐次ライブラリテーブル記憶部
240 並列ライブラリ情報記憶部
250 並列ライブラリテーブル生成部
260 並列ライブラリテーブル記憶部
270 逐次/並列ライブラリ初期リンク生成部
300 記憶部
300a 逐次/並列ライブラリリンク構造情報
300b プログラム
400 後処理部
410 コマンド受付部
420 リンク再構成処理部
420a リンク構造排除処理部
420b N対1リンク構造生成部
430 ライブラリ置換処理部
430a 整合性調整処理部
430b 分割データ生成部
430c 収集データ生成部
430d 並列ライブラリ結合部
440 ライブラリ関数検索処理部
450 オブジェクトコード変換部
40
Claims (5)
ライブラリに含まれる関数と該ライブラリと異なるライブラリに含まれる関数とを関連付けた情報であるライブラリリンク構造情報を生成するリンク構造情報生成手順と、
前記ライブラリリンク構造情報を基にして、ライブラリに含まれる関数を異なるライブラリで同等の機能を有する関数に変換する変換処理手順と、
をコンピュータに実行させることを特徴とするライブラリ変換プログラム。 A library conversion program for converting a function included in a library on a program into a function of a different library,
A link structure information generation procedure for generating library link structure information, which is information relating a function included in a library and a function included in a library different from the library;
A conversion processing procedure for converting a function included in the library into a function having an equivalent function in a different library based on the library link structure information;
A library conversion program characterized in that a computer is executed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004358144A JP4299228B2 (en) | 2004-12-10 | 2004-12-10 | Library conversion program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004358144A JP4299228B2 (en) | 2004-12-10 | 2004-12-10 | Library conversion program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2006164142A JP2006164142A (en) | 2006-06-22 |
JP4299228B2 true JP4299228B2 (en) | 2009-07-22 |
Family
ID=36666064
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2004358144A Expired - Fee Related JP4299228B2 (en) | 2004-12-10 | 2004-12-10 | Library conversion program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4299228B2 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5167897B2 (en) * | 2007-04-27 | 2013-03-21 | 株式会社リコー | Electronic device, information processing method, and information processing program |
US8448193B2 (en) | 2007-04-27 | 2013-05-21 | Ricoh Company, Ltd. | Image forming device, information processing method, and information processing program |
-
2004
- 2004-12-10 JP JP2004358144A patent/JP4299228B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2006164142A (en) | 2006-06-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5950285B2 (en) | A method for searching a tree using an instruction that operates on data having a plurality of predetermined bit widths, a computer for searching a tree using the instruction, and a computer thereof program | |
JP2003067185A (en) | Application editing device and data processing method and program | |
US10191832B2 (en) | Multi-language playback framework | |
JP4919825B2 (en) | Program development apparatus, program development method and program | |
KR101535813B1 (en) | System and method for dynamic updating of event composition rule for complex event processing | |
JP6222225B2 (en) | Virtual machine placement determination apparatus, virtual machine placement determination method, and virtual machine placement determination program | |
CN110580189A (en) | method and device for generating front-end page, computer equipment and storage medium | |
JP6996629B2 (en) | Verification automation equipment, verification automation methods, and programs | |
JP4001286B2 (en) | Program maintenance support apparatus, program maintenance support method, and program | |
JP2004341671A (en) | Information processing system, control method, control program and recording medium | |
JP2015230582A (en) | Program visualization device, program visualization method, and program visualization program | |
JP5398213B2 (en) | Generating device, program, and generating method | |
JP6206865B2 (en) | A method for converting a set of input character strings into at least one pattern expression that represents the set of input character strings as a character string, a method for extracting the conversion pattern as an approximate pattern expression, and a computer and a computer program thereof | |
CN103984554B (en) | The generation method and device of Software for Design document | |
JP4299228B2 (en) | Library conversion program | |
JP2006301989A (en) | Method, apparatus and program for automatically generating program in computer language from block diagram | |
JP5354981B2 (en) | Document management apparatus, document management method, and program | |
JP4686117B2 (en) | Source code conversion apparatus, source code conversion method, and program | |
JP7260150B2 (en) | WEBSITE DESIGN SUPPORT DEVICE, WEBSITE DESIGN SUPPORT METHOD, AND PROGRAM | |
JP2017010123A (en) | Computer performing compilation, compiler method, and compiler program | |
JPH11143753A (en) | Data converting device and method therefor and recording medium | |
JP6649584B2 (en) | Parameterization method, information processing apparatus, and parameterization program | |
JP5596517B2 (en) | Internationalized screen generation system and program | |
KR101894752B1 (en) | Virtual Architecture Producing Apparatus, Runtime System, Multi Core System and Method thereof | |
JP2005202507A (en) | Data compression device, data restoration device, template generation device, and data compression system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20080801 |
|
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: 20090414 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20090416 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120424 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120424 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130424 Year of fee payment: 4 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140424 Year of fee payment: 5 |
|
LAPS | Cancellation because of no payment of annual fees |