JP2004086760A - Numerical calculation program generation system, numerical calculation program generation method, and numerical calculation program generation program - Google Patents

Numerical calculation program generation system, numerical calculation program generation method, and numerical calculation program generation program Download PDF

Info

Publication number
JP2004086760A
JP2004086760A JP2002249462A JP2002249462A JP2004086760A JP 2004086760 A JP2004086760 A JP 2004086760A JP 2002249462 A JP2002249462 A JP 2002249462A JP 2002249462 A JP2002249462 A JP 2002249462A JP 2004086760 A JP2004086760 A JP 2004086760A
Authority
JP
Japan
Prior art keywords
program
numerical calculation
information
algorithm
storage device
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.)
Withdrawn
Application number
JP2002249462A
Other languages
Japanese (ja)
Inventor
Hidehiro Fujio
藤尾 秀洋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP2002249462A priority Critical patent/JP2004086760A/en
Publication of JP2004086760A publication Critical patent/JP2004086760A/en
Withdrawn legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To realize a numerical calculation program generation system capable of efficiently expanding a generated numerical calculation algorithm. <P>SOLUTION: A syntax analysis device 20 prepares syntax analysis information 21 based on definition information 11 taken in by a problem definition input device 10 and program format information 12. An algorithm storage device 40 stores the algorithm information 41 expressed by the ordering row of the pseudo codes of the numerical calculation algorithm. A format template program storage device 50 stores format template program information 51 for the pseudo codes, a calculation generating device 60 generates calculation expression information 61 necessary for the numerical calculation program based on the syntax analysis information 21, and a program generating control device 30 generates a generation program 70 based on the syntax analysis information 21, algorithm information 41, format template program information 51, and calculation expression information 61. <P>COPYRIGHT: (C)2004,JPO

Description

【0001】
【発明の属する技術分野】
本発明は、数値計算プログラム生成システム、数値計算プログラム生成方法、および、数値計算プログラム生成プログラムに関し、特に生成できる数値計算アルゴリズムの拡張の容易性を有し、生成されるプログラムが対応する計算機アーキテクチャに柔軟性を有する数値計算プログラム生成システム、数値計算プログラム生成方法、および、数値計算プログラム生成プログラムに関する。
【0002】
【従来の技術】
従来の数値計算プログラム生成システムでは、偏微分方程式などをテキストで表現した入力情報から、数学的手法に従ってコンピュータ上で作成した偏微分方程式の数値計算プログラムに必要となる計算式を、あらかじめ用意されている決まった形式のテンプレートプログラムに穴埋め的に埋め込んだり、インタープリタ的に解釈したりすることにより数値計算プログラムを生成、または、インタープリタ的に実行していた(たとえば、特許文献1、特許文献2)。
【0003】
また、この例として、米国におけるソフトウェアであるELLPACK(エルパック)、PDE/PROTRAN(ピーディーイープロトラン)などがある。
【0004】
[特許文献1]
特開平6−180644号公報
[特許文献2]
特開平6−59868号公報
【0005】
【発明が解決しようとする課題】
第1の問題点は、数値計算プログラム生成システムに、新たに生成できる計算アルゴリズムを追加することに手間がかかることである。
【0006】
その理由は、従来の数値計算プログラム生成方法では、数学的手続きに従ってコンピュータ上で作成した計算式部品を、アルゴリズムの細部の構造を考慮せずに、用意された穴空きプログラムへの穴埋め処理的に生成するだけだからである。生成されるプログラムの内部構造を考慮しないプログラム生成方法では、入力される偏微分方程式などに現れる式の係数の違いしか扱うことが出来なかった。
【0007】
そのため、生成する計算アルゴリズムを増やすには、穴うめ的なプログラム生成に用いる新たなテンプレートプログラムを用意する必要があり、多くの手間を要していた。
【0008】
第2の問題点は、数値計算プログラム生成システムが生成するプログラムの対象となる計算機アーキテクチャや行列のデータ構造などを増やす場合、数値計算プログラム生成システムを拡張するのに手間がかかるということである。
【0009】
その理由は、第1の問題点と同じく、生成されるプログラムのデータ構造の変化を考慮しない穴埋め的なプログラム生成手法では、数学的な計算アルゴリズムが同一であっても、従来のプログラム生成方法では、プログラム生成の際に穴埋め的に用いるプログラムのテンプレートをまた新たに用意する必要があるからである。たとえば、スカラー計算機向けのプログラム生成システムに並列計算機向けのプログラム生成機能を加える場合、数学的な計算アルゴリズムは同一でも生成すべきプログラムが扱うデータ構造などが異なるため、従来の数値計算プログラム生成システムの穴埋め的なプログラム生成方法では対応できなかった。
【0010】
本発明の目的は、数値計算プログラム生成システムが生成できる数値計算アルゴリズムの拡張が効率的に行える数値計算プログラム生成システムを実現することである。
【0011】
本発明の他の目的は、一つの数学的な数値計算アルゴリズムの情報から、計算機アーキテクチャや行列構造の違いなどの複数のプログラム様式にそった数値計算プログラムの生成を可能にして、数値計算プログラム生成システムの拡張を容易にすることである。
【0012】
【課題を解決するための手段】
本発明の第1の数値計算プログラム生成システムは、数値計算アルゴリズムに関する問題定義情報、プログラム様式情報を第1の記憶装置から入力し、生成する数値計算プログラムの数値計算アルゴリズムを疑似コードの順序列で表現したものからプログラム生成を行うことにより、既に定義されている疑似コードを利用して新たな数値計算アルゴリズムに対応する疑似コードの順序列を作り、数値計算プログラム生成システムが生成する数値計算アルゴリズムを増やし、数値計算プログラムを第2の記憶装置に生成する手段を有することを特徴とする。
【0013】
本発明の第2の数値計算プログラム生成システムは、前記第1の数値計算プログラム生成システムであって、前記第1の記憶装置に入力されたプログラム様式情報の指定に従って各疑似コードに対応している様式別テンプレートプログラム情報を選択して数値計算プログラムを生成することにより、同じ疑似コードの順序列から複数のプログラム様式情報の組み合わせの数値計算プログラムを前記第2の記憶装置に生成する手段を有することを特徴とする。
【0014】
本発明の第3の数値計算プログラム生成システムは、前記第2の数値計算プログラム生成システムであって、前記第1の入力装置に入力された問題定義情報から生成された構文解析情報に基づき、問題定義情報で指定されている各数値計算アルゴリズムのそれぞれに対し、そのアルゴリズムを表現している疑似コードの順序集合データを第3の記憶装置に格納されるアルゴリズム情報から呼び出し、さらに、疑似コードごとにプログラム様式情報で指定された様式に従って、各疑似コードに対応しているプログラム生成のための様式別テンプレートプログラム情報を第4の記憶装置から呼び出し、すべての擬似コードに対し第5の記憶装置に格納される計算式情報とともに各数値計算アルゴリズムのプログラム部品を生成し、数値計算プログラムを前記第2の記憶装置に生成する手段を有することを特徴とする。
【0015】
本発明の第1の数値計算プログラム生成方法は、数値計算アルゴリズムに関する問題定義情報、プログラム様式情報を第1の記憶装置から入力し、生成する数値計算プログラムの数値計算アルゴリズムを疑似コードの順序列で表現したものからプログラム生成を行うことにより、既に定義されている疑似コードを利用して新たな数値計算アルゴリズムに対応する疑似コードの順序列を作り、数値計算プログラム生成システムが生成する数値計算アルゴリズムを増やし、数値計算プログラムを第2の記憶装置に生成する手順を含むことを特徴とする。
【0016】
本発明の第2の数値計算プログラム生成方法は、前記第1の数値計算プログラム生成方法であって、前記第1の記憶装置に入力されたプログラム様式情報の指定に従って各疑似コードに対応している様式別テンプレートプログラム情報を選択して数値計算プログラムを生成することにより、同じ疑似コードの順序列から複数のプログラム様式情報の組み合わせの数値計算プログラムを前記第2の記憶装置に生成する手順を含むことを特徴とする。
【0017】
本発明の第3の数値計算プログラム生成方法は、前記第2の数値計算プログラム生成方法であって、前記第1の入力装置に入力された問題定義情報から生成された構文解析情報に基づき、問題定義情報で指定されている各数値計算アルゴリズムのそれぞれに対し、そのアルゴリズムを表現している疑似コードの順序集合データを第3の記憶装置に格納されるアルゴリズム情報から呼び出し、さらに、疑似コードごとにプログラム様式情報で指定された様式に従って、各疑似コードに対応しているプログラム生成のための様式別テンプレートプログラム情報を第4の記憶装置から呼び出し、すべての擬似コードに対し第5の記憶装置に格納される計算式情報とともに各数値計算アルゴリズムのプログラム部品を生成し、数値計算プログラムを前記第2の記憶装置に生成する手順を含むことを特徴とする。
【0018】
本発明の第1の数値計算プログラム生成プログラムは、数値計算アルゴリズムに関する問題定義情報、プログラム様式情報を第1の記憶装置から入力し、生成する数値計算プログラムの数値計算アルゴリズムを疑似コードの順序列で表現したものからプログラム生成を行うことにより、既に定義されている疑似コードを利用して新たな数値計算アルゴリズムに対応する疑似コードの順序列を作り、数値計算プログラム生成システムが生成する数値計算アルゴリズムを増やし、数値計算プログラムを第2の記憶装置に生成する手順をコンピュータに実行させることを特徴とする。
【0019】
本発明の第2の数値計算プログラム生成プログラムは、前記第1の数値計算プログラム生成プログラムであって、前記第1の記憶装置に入力されたプログラム様式情報の指定に従って各疑似コードに対応している様式別テンプレートプログラム情報を選択して数値計算プログラムを生成することにより、同じ疑似コードの順序列から複数のプログラム様式情報の組み合わせの数値計算プログラムを前記第2の記憶装置に生成する手順をコンピュータに実行させることを特徴とする。
【0020】
本発明の第3の数値計算プログラム生成プログラムは、前記第2の数値計算プログラム生成プログラムであって、前記第1の入力装置に入力された問題定義情報から生成された構文解析情報に基づき、問題定義情報で指定されている各数値計算アルゴリズムのそれぞれに対し、そのアルゴリズムを表現している疑似コードの順序集合データを第3の記憶装置に格納されるアルゴリズム情報から呼び出し、さらに、疑似コードごとにプログラム様式情報で指定された様式に従って、各疑似コードに対応しているプログラム生成のための様式別テンプレートプログラム情報を第4の記憶装置から呼び出し、すべての擬似コードに対し第5の記憶装置に格納される計算式情報とともに各数値計算アルゴリズムのプログラム部品を生成し、数値計算プログラムを前記第2の記憶装置に生成する手順をコンピュータに実行させることを特徴とする。
【0021】
【発明の実施の形態】
次に、本発明の第1の実施の形態について図面を参照して詳細に説明する。
【0022】
図1は、本発明の第1の実施の形態の構成を示すブロック図である。
【0023】
図1を参照すると、本発明の第1の実施の形態は、キーボードや外部記憶装置などから構成される問題定義入力装置10と、プログラム制御により動作し構文解析情報21を作成する構文解析装置20と、構文解析情報21を元にプログラム生成の制御を行うプログラム生成制御装置30と、数値計算アルゴリズムを疑似コードで表現したアルゴリズム情報41を格納するメモリ等で構成されるアルゴリズム格納装置40と、様式別に疑似コードに対応するテンプレートプログラム情報である様式別テンプレートプログラム情報51を格納するメモリ等で構成される様式別テンプレートプログラム格納装置50と、問題定義情報11で与えられた偏微分方程式を離散化して得られる計算式など、個別の数値計算プログラムのデータとなる計算式を生成する計算式生成装置60と、記憶装置等に生成される生成プログラム70とを含む。
【0024】
問題定義入力装置10、アルゴリズム格納装置40、様式別テンプレートプログラム格納装置50は、1つの記憶装置であってよい。また、構文解析装置20、プログラム生成制御装置30、計算式生成装置60も、1つの情報処理装置であってよい。
【0025】
問題定義入力装置10は、ユーザーが与える問題定義情報11、プログラム様式情報12を格納している。問題定義情報11は、数値計算に現れるアルゴリズムの指定、アルゴリズムに付随するパラメータ、および計算式などの数学的アルゴリズムから構成されるデータである。このようなデータで表されるアルゴリズムとしては、代入処理としての補間、線形偏微分方程式の求解、非線型方程式のニュートン法、可視化ライブラリの呼び出しなどである。一般に、問題定義情報11は、複数の数値計算アルゴリズムの集合である。プログラム様式情報12は、生成するプログラムに用いるプログラミング言語名、生成される数値計算プログラムでのデータ表現の扱い方を指定する識別名、行列、特に、疎行列のデータ表現形式名、線形ソルバーや可視化プログラムの名称など、数値計算アルゴリズムを実際にプログラミング言語によってインプリメントする際に必要な属性情報である。
【0026】
構文解析装置20は、問題定義情報11、プログラム様式情報12からプログラム生成制御装置30の処理のための構文解析情報21を作成し、プログラム生成制御装置30に与える。
【0027】
アルゴリズム格納装置40は、疑似コードの順序集合で表現されたアルゴリズム情報41を格納する。疑似コードとは、抽象的な数値計算アルゴリズムを、プログラミング言語でインプリメンテーションする場合に現れる、具体的なプログラムの様式の要因によって細分化されたアルゴリズムのステップのことである。
【0028】
様式別テンプレートプログラム格納装置50には、アルゴリズム情報41で用いられる各疑似コードに対して、様式ごとのプログラムを生成するためのテンプレートプログラム情報が、様式別テンプレートプログラム情報51として格納される。各疑似コードには様式別にプログラム生成を行うためのテンプレートプログラム情報が複数存在可能である。これらの様式の例として、プログラミング言語様式、プログラム構造・データ表現様式、行列構造様式、ライブラリ呼び出し様式などがある。
【0029】
計算式生成装置60は、プログラム生成制御装置30から起動され、各数値計算アルゴリズムに対応する数値計算プログラムの生成に必要な計算式や変数名リストなどを数式処理などのデータ処理によって作成し、計算式情報61としてプログラム生成制御装置30に供給する。計算式情報61は、アルゴリズムに現れる変数リスト、座標変換の関数形、数値積分点での計算式など、個別のアルゴリズムの属性となる計算式である。生成するプログラムにより必ずしも計算式生成装置60が必要ではない。
【0030】
プログラム生成制御装置30は、構文解析装置20が解析した構文解析情報21に基づき、問題定義情報11で指定されている各数値計算アルゴリズムのそれぞれに対し、そのアルゴリズムを表現している疑似コードの順序集合データをアルゴリズム情報41から呼び出し、さらに、疑似コードごとにプログラム様式情報12で指定された様式に従って、各疑似コードに対応しているプログラム生成のための様式別テンプレートプログラム情報51を呼び出し、必要な場合には、計算式情報61とともに各数値計算アルゴリズムのプログラム部品を生成する。この操作を指定されたアルゴリズムを構成する疑似コード全てについて行う。以上の処理を問題定義情報11、プログラム様式情報12で指定されている全ての数値計算アルゴリズムに対して行うことにより生成プログラム70を生成する。
【0031】
次に、本発明の第1の実施の形態の動作について図面を参照して説明する。
【0032】
図2は、ユーザーの有限要素法を利用した数値計算問題を記述する問題定義情報11、および、プログラム様式情報12の具体例を示す説明図である。
【0033】
図2を参照すると、204の補間を伴う代入処理、205の線形偏微分方程式の求解処理、206の可視化処理という3つの数値計算アルゴリズムに関する処理が問題定義情報11のアルゴリズムに関する指定として表現されている。
【0034】
また、S201、S202は問題記述に用いる変数に関する問題定義情報11である。S201では変数uは補間関数名T1で補間すること、S202では変数rhoはtet3で定義される数値積分法の積分点で値を有することが指定されている。
【0035】
S203はプログラム様式情報12の指定の一例で、プログラム様式としてfeelfem90という様式名の有限要素法のプログラム様式が指定されている。
【0036】
この例では、プログラミング言語としてFORTRAN90、有限要素法のデータ表現・プログラム形式としてfeelfem90と呼ばれる形式が指定されたことになる。線形偏微分方程式の指定S205の内部では、未知変数と試験関数シンボルの指定S205a、領域の数値積分法の指定S205b、線形ソルバーの指定S205c、変分方程式の指定S205d、ディリクレ型境界条件の指定S205e、ノイマン型境界条件の指定S205fが記述されている。S205cのソルバーの指定はプログラム様式情報12に属している。
【0037】
図3は、問題定義情報11の例を示す説明図である。
【0038】
図4は、問題定義情報11の例を示す説明図である。
【0039】
図5は、プログラム生成制御装置30の基本動作を示すフローチャートである。
【0040】
図5を参照すると、問題定義入力装置10に入力された、問題定義情報11のテキストデータは、構文解析装置20に供給される。構文解析装置20は、問題定義情報11、および、プログラム様式情報12の構文解析情報21をプログラム生成制御装置30に供給する。プログラム生成制御装置30は、構文解析情報21から、個々の数値計算アルゴリズムに関するデータを取り出す(図5ステップA01)。プログラム生成制御装置30は、取り出した数値計算アルゴリズムに対応する数値計算プログラム部品を生成する(図5ステップA02)。この個々の数値計算アルゴリズムプログラム部品の生成を問題定義情報11とプログラム様式情報12とに記述された全ての数値計算アルゴリズムに対して繰り返す(図5ステップA03)。次に、ステップA02で生成した数値計算アルゴリズムプログラム部品をつなぎ合わせて完全な生成プログラム70を生成する(図5ステップA04)。
【0041】
図6は、図5のステップA02の詳細を示すフローチャートである。
【0042】
図5のステップA01で取り出された一つの数値計算アルゴリズム(以後、処理する数値計算アルゴリズムと記述)に対して計算式生成装置60により作成された必要となる計算式、変数名リストなどの計算式情報61を取り出す(図6ステップB01)。処理する数値計算アルゴリズムに対し、対応する疑似コードの順序集合によって表現されるアルゴリズム情報41を、アルゴリズム格納装置40から取り出す(図6ステップB02)。
【0043】
アルゴリズム情報41から取り出した数値計算アルゴリズムを表現する擬似コードの順序集合から擬似コードを一つずつ順に取り出す(図6ステップB03)。
次に、ステップB03で取り出した擬似コードと、構文解析情報21のその擬似コードに指定されているプログラム様式情報12から、対応する様式別テンプレートプログラム情報51を様式別テンプレートプログラム格納装置50より取り出す(図6ステップB04)。
【0044】
この取り出した様式別テンプレートプログラム情報51と計算式情報61とから、取り出した疑似コードに対応した数値計算プログラム対応部分を生成する(図6ステップB05)。処理する計算アルゴリズムを表現する全ての疑似コードに対して繰り返す(図6ステップB06)。
【0045】
このようにして、疑似コードの順序集合の形で格納されている各数値計算アルゴリズムに対応するプログラムの生成は、アルゴリズムを構成する疑似コードごとに、ユーザーの入力情報で指定されるプログラム様式情報12から、その疑似コードに対して指定されたプログラム様式の様式別テンプレートプログラム情報51と、プログラム様式に依存しない計算式情報61とから生成される。
【0046】
このため、プログラム生成の対象となる数値計算アルゴリズムを新たに増やす場合、既にシステムに登録されているアルゴリズム情報41を構成する疑似コードを再利用して、新たに増やす数値計算アルゴリズムの疑似コードの順序集合表現を構成することができる。その場合、再利用した疑似コードの部分に関しては新規にシステムを拡張する必要がないため、新たな数値計算アルゴリズムを増やすことが少ない手間で可能となる。
【0047】
また、システムが既にプログラム生成機能を有する数値計算アルゴリズムに対し、新たなプログラム様式によるプログラム生成機能を追加しようとする場合、システムの拡張作業は、新たに追加しようとするプログラム様式に関連する疑似コードにだけ、その疑似コードに対応する様式別テンプレートプログラム情報51を個別に追加することによって実現される。
【0048】
そのため、一つの数値計算アルゴリズムに対して複数のプログラム様式の属性を持つ数値計算プログラム生成が少ない手間で可能となり、システムの拡張管理も容易となる。
【0049】
次に、本発明の第1の実施例について図面を参照して説明する。
【0050】
第1の実施例は、問題定義入力装置10としてキーボードを、構文解析装置20、プログラム生成制御装置30、計算式生成装置60としてパーソナル・コンピュータを、アルゴリズム格納装置40、様式別テンプレートプログラム格納装置50として磁気ディスク装置を備えている。
【0051】
パーソナル・コンピュータは、構文解析装置20、プログラム生成制御装置30、計算式生成装置60としての論理的処理を行う中央演算装置を有しており、また各磁気ディスク記憶装置には、それぞれ、アルゴリズム情報41と、様式別テンプレートプログラム情報51が格納されている。
【0052】
第1の実施例では生成する生成プログラム70の例として、有限要素法による線形偏微分方程式の数値計算法を扱う。この時、未知関数はある補間関数の線形結合によって近似され、変分問題として数値的に解を求める。その際、近似に用いる補間関数の形、変分問題を扱うための数値積分法、ディリクレ型およびノイマン型の境界条件が、問題定義情報11となる。これらは特定のインプリメンテーションに依存しない数学的なものである。この他の特定のインプリメンテーションを行うのに必要な入力情報を、プログラム様式情報12とよぶ。
【0053】
図2は、問題定義情報11およびプログラム様式情報12の例を示す説明図である。
【0054】
図3は、問題定義情報11およびプログラム様式情報12の例を示す説明図である。
【0055】
図4は、問題定義情報11およびプログラム様式情報12の例を示す説明図である。
【0056】
図2を参照すると、数値計算アルゴリズムを伴う計算処理としては、補間を伴う代入処理に関するもの(図2S204)、線形偏微分方程式の求解処理に関するもの(図2S205)、可視化処理に関するもの(図2S206)が指定されている。プログラム様式情報12(図2S203、S205c)以外の、その他の記述は問題定義情報11に属している。
【0057】
S201では、変数uがT1という名称を持つ補間関数によって補間される関数変数であることが指定されている。S202では、変数rhoはtet3という名称で定義される数値積分法の各積分点で値を有する関数変数であることが指定されている。S203では、プログラム様式情報12としてfeelfem90という名称のプログラム様式が指定されている。この例では、プログラミング言語としてFORTRAN90、有限要素法のデータ表現・プログラム形式としてfeelfem90と呼ばれる形式が指定されている。
【0058】
S205は、線形偏微分方程式の問題定義情報11である。S205aでは、solveによって偏微分方程式問題であること、未知変数を表すシンボルがu、試験関数を表すシンボルがtuとそれぞれ指定されている。S205bでは、この偏微分方程式を解く際に用いる数値積分法がtet3という名称で定義される数値積分法であることが指定されている。
【0059】
S205cでは、離散化によって現れる連立一次方程式を解くソルバーにamgという名称で定義されているソルバーを使用することを指定している。S205cはプログラム様式情報12で、用いるソルバーのライブラリの種別と、それに従属して連立一次方程式の行列のデータ構造が陰的に指定されている。S205dでは、線形偏微分方程式の変分問題形式が積分の形で指定されている。integral(被積分関数)によって指定されている項が領域積分項で、要素剛性行列、および要素荷重ベクトルの計算式情報61が指定されている。bintegral(被積分関数)によって指定される項は境界積分項で、ノイマン型境界条件に関する計算式情報61が指定されている。S205eではディリクレ型境界条件の計算式情報61であるu=1000と条件を課す境界の名称ab,bcが指定されている。
【0060】
S205fでは、ノイマン型境界条件の計算式情報61であるg=u−100と、この条件を課す境界の名称egが指定されている。S206では、関数量u*100に対し、コンター図を出力することが指定されている。
【0061】
図3を参照すると、S201で用いられている補間法T1に関する補間関数が、名称T1、要素形状tetra(四面体)、および参照要素における座標とその補間関数が、r,s,tの多項式との組で指定されている。また、別の補間法T2もT1に続いて指定されている。
【0062】
図4を参照すると、S202で用いられている数値積分法の名前tet3に関する情報が、参照要素における数値積分点とその重みの組として指定されている。
【0063】
これらの入力情報は、構文解析装置20によって解析され、構文解析情報21が作成される。
【0064】
図7は、図2、図3、図4に対する構文解析情報21の例を示す説明図である。
【0065】
701は、S203のProgramModel文で指定される基本プログラム様式情報12である。711、712、721、722は、それぞれ、図3、図4、S201、S202の入力情報から作られ、数値計算プログラム生成の際の、離散化の数学的な属性情報として利用される。711aと712aはそれぞれ図3、図4のうち、座標や数式がなどの数式情報リストの内部表現が格納されている。
【0066】
図2のschemeブロックのS204、S205、S206がそれぞれ独立の数値計算処理を指定した入力情報で、それぞれの構文解析情報21は、730、740、750として、計算処理単位ごとにまとめられている。各計算処理単位は一つまたは複数の、数値計算アルゴリズムを含む。
【0067】
説明を明瞭にするため、S205の有限要素法による線形偏微分方程式の数値解法処理をsolveブロックと名づける。このsolveブロックは第1の実施例での数値計算アルゴリズムという点からは、3つのサブ処理とそのサブ処理を統括するsolveブロックの制御の処理の、合わせて4つの数値計算アルゴリズムから構成されている。一つ目のサブ処理の数値計算アルゴリズムは有限要素法の要素剛性行列と要素荷重ベクトルを計算して全体行列と全体荷重ベクトルに足しこむ処理で、構文解析情報21の745に対応する。二つめのサブ処理はノイマン型境界条件を処理する数値計算アルゴリズムで構文解析情報21の746に対応する。三つ目のサブ処理はディリクレ型境界条件を処理する数値計算アルゴリズムで構文解析情報21の747に対応する。solveブロックの制御の処理は構文解析情報21の740から生成される。
【0068】
プログラム生成制御装置30は、図5のフローチャートに従って、構文解析情報21から数値計算アルゴリズムの種別情報のリストである731、741、745a、746a、747a、751を取り出し、順に数値計算プログラムの部品を生成する。この個別の数値計算アルゴリズムに対応する数値計算プログラムの生成処理は図6のフローチャートに従ってプログラム生成制御装置30が実行する。
【0069】
ここで、図6のフローチャートの処理を詳細に説明する例として、この前記のsolveブロックの制御に関する処理の数値計算アルゴリズムをとりあげて説明する。
【0070】
第1の実施例の処理方法である数値計算アルゴリズムを疑似コードの順序列で表現し、各疑似コードに様式別テンプレートプログラム情報51を作成してプログラム生成を行う処理は他の3つの数値計算アルゴリズムにも同様に適用できる。
【0071】
図6のフローチャートの動作を説明するに先立ち、第1の実施例でのsolveブロックの制御に関する数値計算アルゴリズムの、アルゴリズム情報41での実装方法の一例について具体的に説明する。
【0072】
図8は、S205に関するsolveブロックの制御に関する数値計算アルゴリズムの内容を示すフローチャートである。
【0073】
このsolveブロックの制御に関するアルゴリズムは、実装するプログラミング言語や計算機のアーキテクチャなどのプログラム様式には依存しない抽象的なものである。
【0074】
図8を参照すると、微分方程式を離散化することによって現れる疎行列のデータ構造を、要素と節点の結合関係や各節点での自由度から求める(図8ステップD01)。D01によって構造が確定してメモリにアロケーションされた全体行列を格納する配列に、要素毎に計算された要素剛性行列、要素荷重ベクトルを足し合わせる(図8ステップD02)。ノイマン型の境界条件によって規定される境界積分の評価量からの寄与を全体行列に足しこむ(図8ステップD03)。
【0075】
ディレクレ条件によって値が指定される自由度に対しての処理を行う(図8ステップD04)。構成した連立一次方程式をソルバーによって解く。ステップD06では、選られた解を物理量別に分ける等の後処理を行う(図8ステップD05)。
【0076】
図8のフローチャートで表される抽象的なアルゴリズムの各ステップを、プログラム様式のレベルへの依存関係によって細分化した小ステップに分割し、その分割された各ステップを一つの疑似コードと呼ぶ。そして、プログラム生成の対象となる数値計算アルゴリズムを、疑似コードの順序列で作られるリストによって表現する。
【0077】
図9は、図8のフローチャートの疑似コードへの分解の一例を表す疑似コードレベルのフローチャートである。
【0078】
図9の説明に先立ち、疑似コードを具体例で説明する。図8に現れるような抽象的アルゴリズムの各ステップを実際にコンピュータ言語でインプリメントする場合、実際のインプリメンテーションを確定するためには、色々なレベルに対してそのプログラム様式を決定しなければいけない。
【0079】
たとえば、用いるコンピュータのプログラミング言語や、各種のデータ構造である。第1の実施例ではこのプログラム様式のクラスのレベルとして、FORTRAN77やC++など、生成する数値計算プログラムで用いるプログラミング言語の第一のレベル、生成する数値計算プログラムで扱うデータ構造やその表現に関するProgramModelと呼ぶ第2のレベル、データ構造のうち特に行列成分の格納形式に関するデータ構造の表現を扱う第3のレベル、連立一次方程式を解くソルバーなど汎用ライブラリルーチンの呼び出し方法の違いを扱う第4のレベルの、以上4つのレベルを考える。
【0080】
この時、第4のレベルは第3レベル、第3は第2、第2は第1のレベルにも依存することに注意を要する。このプログラム様式の階層構造に注目し、以後これをインプリメンテーションのレベルと言う。実際のインプリメンテーションは、これら4つのレベルそれぞれに対してプログラム様式がそれぞれ指定されて可能となる。
【0081】
具体的な例で説明すると、図8のステップD01の「自由度の計算から疎行列を格納する配列を割り当てる」という処理は、「自由度を計算する」という第二のプログラム様式のレベルと、「疎行列を格納する配列を割り当てる」という第三のプログラム様式のレベルに分けることが可能である。このように分けると、ステップD01に対する数値計算プログラムの生成処理を、第二のレベルに依存する部分と、第三のレベルに依存する部分に分離して細分化することができる。そして、この細分化されたプログラム生成処理は、そのレベルに指定されるプログラム様式の個別様式によって定まる。このプログラム様式のレベルによって細分化された、プログラム生成の最小処理単位が本発明で言う疑似コードである。また、本発明では、プログラムソースコードの構造的な構成部品となる、「サブルーチン宣言を行う」や「変数宣言を行う」などのプログラムの宣言文にあたる単位も、プログラム様式のレベル別に分離してそれぞれを疑似コードとしてとり扱う。
【0082】
アルゴリズムのステップの疑似コードへの分割には任意性があるが、抽象的なアルゴリズムのステップを、なるべくレベルの低いプログラム様式に依存する部分を切り分けて疑似コード分離することが効果的である。なぜなら、たとえば、線形ソルバーの例でいうと、ソルバーの呼び出しという第4のレベルと、第3のレベルの行列格納方法を疑似コードで完全に分離しておけば、同じ行列格納方法を用いるソルバーの取り替えであれば、生成する数値計算プログラムの変更は第4のレベルに関する疑似コードだけに局在化されるからである。
【0083】
第1の実施例では、4つのレベルに分けたもので説明するが、レベルの数が変わっても同様である。たとえば、メッシュデータなどの入出力データファイルフォーマットは数値計算アルゴリズムとは独立なので、このレベルを追加して5つのレベルにすることも可能である。その場合、ファイル入出力方法が異なるプログラムを生成するシステムを作ることが容易になる。
【0084】
図9を参照すると、図8のアルゴリズムの疑似コードによる表現は、ステップE01〜E15の15個のステップから構成される。このプログラム様式のレベルに従って分けられた、E01〜E15の疑似コードのステップはプログラム様式の具体的な指定には依存しないことが重要である。次に、このステップを説明する。以後用語として、E01からE15のステップに対応して生成されるプログラムのモジュールをsolveサブルーチンと言う。
【0085】
ステップE01は、図8のアルゴリズムが実現されるsolveサブルーチンを書き出すソースファイルを作成することに対応する疑似コードである。ステップE02は、宣言手続き文など、solveサブルーチンのヘッダー部を生成することに対応する疑似コードである。
【0086】
ステップE03は、問題依存のパラメータなどの実行前に定まる定数などの宣言文を生成することに対応する疑似コードである。ステップE04は、solveサブルーチン内で用いるローカル変数を宣言することに対応する疑似コードである。ステップE05は、solveサブルーチンで変数の初期化を行うことに対応する疑似コードである。
【0087】
ステップE06は、行列構造を決定するために必要な未知変数の自由度・方程式番号を計算することに対応する疑似コードである。ステップE07は、境界条件のデータを用意することに対応する疑似コードである。ステップE08は、solveサブルーチンの処理に必要になる行列やベクトルを格納するメモリを割り当てることに対応する疑似コードである。ステップE09は、有限要素法による微分方程式の数値解法で要素行列・要素荷重の計算とそのアセンブルの処理を呼び出すことに対応する疑似コードである。
【0088】
ステップE10は、ノイマン型境界条件を処理するサブルーチンを呼び出すことに対応する疑似コードである。ステップE11は、ディリクレ型境界条件を処理するサブルーチンを呼び出すことに対応する疑似コードである。ステップE12は、微分方程式を離散化して選られる連立一次方程式を解くソルバーライブラリを呼び出すことに対応する疑似コードである。ステップE13は、ソルバーライブラリを呼び出した後の後処理を呼び出すことに対応する疑似コードである。ステップE14は、solveサブルーチンを終了するにあたっての処理を行うことに対応する疑似コードである。ステップE15は、solveサブルーチンを書き出したファイルを閉じることに対応した疑似コードである。
【0089】
図10は、図9の各疑似コードをC++の仮想関数とし、それらを順番に呼び出す関数手続きとして図9のフローチャートを実装した図1のアルゴリズム情報41の実現方法の一例を示す説明図である。
【0090】
図10では関数手続きとして実装しているが、リスト・データで表現してインタープリタ的処理により扱うことも可能である。
【0091】
図9のフローチャートは、クラスSolveSchemeのメンバ関数NormalLinearProblemによって表現されている。図9のフローチャートを表す疑似コードの順序列は、図10を参照すると、NormalLinearProblem関数の中の、仮想関数の呼び出し手続き1001として実現されている。
【0092】
1001の呼び出し関数のリストは図9のE01〜E15の各ステップに一対一に対応している。つまり、E01はRoutineInitialize(solvePtr)、E02はRoutineHeader(solvePtr)の順にE15のRoutineTerminate(solvePtr)まで、図9の15の擬似コードに対応するステップは、それぞれ1001の各仮想関数に対応する。
【0093】
次に、プログラム生成制御装置30による動作について図面を参照して、さらに詳細に説明する。
【0094】
図11は、数値計算アルゴリズム処理関数テーブルの内容を示す説明図である。
【0095】
前記の例では、図7の構文解析情報21のうち、図7の740のテーブルが選択されて、図5のステップA02の処理、つまり図6のステップB01〜B06が開始される。ステップB01では、計算処理種別情報741のSOLVEから、出現変数テーブル742が計算式生成装置60に渡され、計算式情報61が生成される。solveブロックの制御の数値計算アルゴリズムの場合、計算式情報61はリスト742がそのまま計算式情報61となる。計算式情報61の数式処理などによる生成は、構文解析情報21の745のASSEMBLEの数値計算アルゴリズムに対応する数値計算プログラムを生成する場合に必要であるが、本発明の本質には無関係である。この計算式生成処理に関しては、たとえば、「特開平06−180644」に記載がある。
【0096】
図6ステップB02の処理は、741の計算処理種別情報から、数値計算アルゴリズム処理関数テーブル(図11)を参照して、対応する数値計算アルゴリズム処理関数が呼び出すことによって実行される。Solveブロックの制御のアルゴリズムの場合、処理種別名SOLVEからSolveScheme::NormalLinearProblemが呼び出される。また、ステップB03の擬似コードを順に取り出す処理は、SolveScheme::NormalLinearProblemの実行文1001が順に実行されることによって実現される。つまり、擬似コードによるアルゴリズム表現は1001の呼び出し関数のリストに相当する。
【0097】
図6ステップB04およびステップB05の実現方法は、第1の実施例ではC++の仮想関数とポリモーフィズムのメカニズムによる。
【0098】
まず、ポリモーフィズムの前提となる、仮想関数とその実体関数の実装の構成を、図面を参照して説明する。
【0099】
図12は、擬似コード・プログラム様式レベル依存テーブルの内容を示す説明図である。
【0100】
図13は、プログラム様式のレベルのグループ分けに対応する仮想関数を示す説明図である。
【0101】
図14は、プログラム様式レベル間の依存関係テーブルの内容を示す説明図である。
【0102】
図15は、実体関数のクラス分けを示す説明図である。
【0103】
図16は、第1の実施例のC++のクラス宣言に関する実装例を示した説明図である。
【0104】
図17は、様式別テンプレートプログラム情報の実装例を示す説明図である。
【0105】
図10の関数NormalLinearProblem内で呼び出される1001の各関数は、クラスSolveSchemeの仮想関数として宣言される。これらの仮想関数は、擬似コードとしては、図12に示す擬似コード・プログラム様式存在テーブルに示すような4つのプログラム様式(Language、ProgramModel、MatrixModel、Library)のレベルにグループ分けされる。図13に示す仮想関数のグループ分けと同じく、実体関数は、1つのグループが一つのクラスとして実装される。
【0106】
図2の入力例でのプログラム様式の指定は、図2S205cで第4のライブラリのプログラム様式のレベルにamgという名称のソルバーライブラリ、図2S203で第2のプログラム様式のレベルにはfeelfem90という名称の2つのプログラム様式が陽に指定されている。第3のレベルの行列構造と、第1のレベルのプログラミング言語のレベルは、それぞれ第4、第2のレベルから決定されるため、図14に示すプログラム様式レベル間の依存関係テーブルから、行列構造のプログラム様式としてCRSという名称が、プログラミング言語の様式としてFortran90が決定されている。
【0107】
これから、図2の具体例では、仮想関数に対応する実体関数は、図15に示されるように、class Fortran90(図15G01)、class feelfem90(図15G02)、class CRS(図15G03)、class amg(図15G04)の四つのクラスに実装される。
【0108】
上記の構成から、図6ステップB04の機構を実現することができる。それを示すものが、図16である。図10の1001の関数手続きは、クラスSolveScheme内の仮想関数として宣言されているが、対応する実体関数は、図16H01のパブリック宣言によって、テンプレート宣言されるクラスL1,L2、L3、L4内に実装することが可能になる。このL1、L2、L3、L4の組み合わせを指定することによって、プログラム様式情報12から実体関数の選択が可能になる。たとえば、図2の指定されている例が、図15と図16H03とであり、テンプレート宣言のL1、L2、L3、L4、それぞれがFortran90、feelfem90、CRS、amgと指定されることにより、図6ステップB04の選択の処理が実現される。
【0109】
第1の実施例では、上記の通り図6ステップB04の「疑似コードに対応する様式別テンプレートプログラム情報51」は、プログラム様式のレベル別に宣言されるクラスごとにまとめられた仮想関数に対応する実体関数の実行文という形で格納されている。これは具体的には、図17で表されるようなC++の実行文である。図17J01のリストは、行列構造のプログラム様式にCRS形式が指定された時に呼び出される、図9ステップE08に対応するテンプレートプログラム情報である。このように、第1の実施例では様式別テンプレートプログラム情報51は、C++のprintf文の形で実現されている。
【0110】
図6ステップB02〜ステップB06の処理を示すのが、図15、図16のリストである。つまり、図6ステップB02の疑似コードによるアルゴリズム情報41をアルゴリズム格納装置40から取り出す処理は、図16H04に相当する。図16H04の、NormalLinearProblem関数が実行されると、図10の1001が実行されるため、図6ステップB03の疑似コードを順に取り出す処理が実現できる。図6ステップB04のプログラム様式情報12から様式別テンプレートプログラム情報51を取り出す処理は、実行文である図16H03のC++での仮想関数のポリモーフィズムの機構によって実現される。図6ステップB05の数値計算プログラム対応部分を生成する処理は、各仮想関数の実体関数(図17J01、J02など)が実行され、printf文によってディスク装置などに生成プログラム70の部分が順に書き出されることにより、生成プログラム70の生成が実現される。
【0111】
図18は、上記の手順によって出力された、生成プログラム70の一例である。図18に示されるように、疑似コードに対応する図10の関数NormalLinearProblemが呼び出されて1001の仮想関数が順に実行されると、図15で示されている実体関数がポリモーフィズムの機構によって指定されたプログラム様式に従って順に呼ばれてプログラムの部品を順にファイル等に書き出すことによって、生成プログラム70のソースファイルが生成される。
【0112】
偏微分方程式の数値解法は主として連立一次方程式を解くことに帰着して解く。一般にこの計算に現れる行列は次元の大きい疎行列になるので行列を効率的に記憶することが必要であるが、偏微分方程式の性質や計算を行う計算機のアーキテクチャ、または連立一次方程式を解く線形ソルバーによって効果的な行列の記憶の仕方に違いがある。そのため、特に新たに考案された行列のデータ構造に対応した計算プログラムを生成することが、数値計算プログラム生成システムにとって産業上有用である。
【0113】
本発明の第1の実施の形態でのプログラム生成の処理単位は、インプリメンテーション上のプログラム様式別の基本単位に細分化され、それぞれが一つの疑似コードとして表現されている。すなわち、行列構造のレベルに関する疑似コードに対してのみ、新たな行列構造様式、つまり、新たなプログラム様式に対応したテンプレートプログラム情報を用意すれば、新たな行列構造に対応した数値計算プログラム生成システムに拡張できる。
【0114】
図19は、テンプレートプログラム情報を拡張する方法を示す説明図である。
【0115】
図19を参照すると、第3の行列構造のレベルに属する図9E08の擬似コードに対し、CRS形式に加えてSkyline形式のプログラム様式である様式別テンプレートプログラム情報が付け加えられている。この操作を残りの同じく第3の行列構造のレベルに属する擬似コード図9E09、E10、E11に行えば、第1のプログラミング言語レベルに属する擬似コード図9E01、E05、E15、及び、第2のProgramModelレベルに属する擬似コード図9E02、E03、E04、E06、E07、E13、E14に関する数値計算プログラム生成システムの変更は不要で、関数SolveScheme::NormalLinearProblemを呼ぶことによって、図2の入力情報S205cに対する行列構造がSkyline形式の生成プログラム70が生成可能となり、数値計算プログラム生成システムの拡張が容易になる。具体的には、図17のJ01に、J02を付け加えるだけでよい。
【0116】
以上、行列構造レベルに関する拡張について述べたが、プログラミング言語レベル、ProgramModelレベル、ライブラリレベルでも同様で、プログラム様式を拡張する場合、第1の実施例のように必要最小限の追加によって数値計算プログラム生成システムの拡張が実現される。
【0117】
本発明では、ある数値計算アルゴリズムに対応する数値計算プログラムは、擬似コードの順序列からなる制御情報から生成される。この方式の数値計算プログラム生成システムに、新たな数値計算アルゴリズムに対応する数値計算プログラムの生成機能を加える場合、既に実装された擬似コードを使って数値計算アルゴリズムを追加することが可能である。例として、線形偏微分方程式の制御アルゴリズム(図9)の数値計算プログラムを生成する機能を利用して、Newton法を用いて非線形偏微分方程式を数値的に解く制御アルゴリズムの数値計算プログラムを生成する機能を付け加える場合を説明する。
【0118】
図20は、非線形問題を扱う擬似コードの順序列が線形問題の擬似コードを使って表現されることを示す説明図である。
【0119】
非線形方程式をNewton法で解く場合、方程式を線形化し、繰り返し線形問題を解くことによって解を求める。図9で示される線形問題の制御プログラムのフローチャートを非線型問題に拡張する際に必要なものは、図9E08と図9E09との間に非線型問題の初期化とループに関する制御を入れることと、図9E13のソルバーの後処理を非線型問題の際のソルバーの後処理に変更するだけで、残りの図9E01〜E08、E10〜E12、E14〜E15の処理はまったく同じでよい。つまり、図20に示すように、非線型問題特有の疑似コード(図20K01、K02)を新たに用意して、それに対応するプログラム部品生成機能を付け加えればよい。
【0120】
このように、既存の擬似コードを再利用することによって、必要な擬似コードの追加だけでプログラム生成システムで扱える数値計算アルゴリズムの拡張が可能となり、数値計算プログラム生成システムが扱えるアルゴリズムの追加が容易に行うことができる。本実施例では有限要素法の場合について述べたが、差分法や有限体積法でも同様な手法でプログラム生成システムを作成することができる。
【0121】
次に、本発明の第2の実施の形態について図面を参照して詳細に説明する。
【0122】
本発明の第2の実施の形態は、本発明の第1の実施の形態の各処理のステップ(たとえば、図5、図6、図8、図9の各ステップ)を含む方法である。
【0123】
次に、本発明の第3の実施の形態について図面を参照して詳細に説明する。
【0124】
本発明の第3の実施の形態は、本発明の第2の実施の形態の各処理のステップ(たとえば、図5、図6、図8、図9の各ステップ)をコンピュータ(たとえば、構文解析装置20、計算式生成装置60、プログラム生成制御装置30)に実施させるプログラムである。
【0125】
【発明の効果】
第1の効果は、既に実装されている数値計算アルゴリズムの数値計算プログラム生成システムに、新たなプログラム様式を持った数値計算プログラムの生成機能を付け加えることが容易なことである。
【0126】
その理由は、ある数値計算アルゴリズムに対応する数値計算プログラムの生成は、擬似コードの順序列によって制御されているが、新たなプログラム様式を追加する場合そのプログラム様式が関連する擬似コードに対してのみ、対応するテンプレートプログラム情報を追加するだけでよいからである。つまり、擬似コードの順序列という数学的なアルゴリズムを反映する数値計算プログラムの制御構造は、個別のプログラム様式に依存せずそのまま使うことができるからである。
【0127】
また、プログラム様式の追加は、関連する擬似コードだけに追加の必要性が局在化することもプログラム生成システムの構築に有用である。
【0128】
第2の効果は、プログラム生成可能な数値計算アルゴリズムの追加が容易なことである。
【0129】
その理由は、数値計算アルゴリズムに対応する数値計算プログラムの生成が、インプリメンテーションのレベルを考慮した擬似コードの順序列によって表現されているため、新しい数値計算アルゴリズムを表現する擬似コードの順序列を作る際に、既に定義されている擬似コードを再利用して使えるからである。
【図面の簡単な説明】
【図1】本発明の第1の実施の形態の構成を示すブロック図である。
【図2】ユーザーの有限要素法を利用した数値計算問題を記述する問題定義情報、および、プログラム様式情報の具体例を示す説明図である。
【図3】図3は、補間法T1に関するデータを示す説明図である。
【図4】図4は、数値積分法tet3に関するデータの一部を示す説明図である。
【図5】図5は、プログラム生成制御装置の基本動作を示すフローチャートである。
【図6】図5のステップA02の詳細を示すフローチャートである。
【図7】図2、図3、図4に対する構文解析情報の例を示す説明図である。
【図8】solveブロックの制御に関する数値計算アルゴリズムの内容を示すフローチャートである。
【図9】図8のフローチャートの疑似コードへの分解の一例を表す疑似コードレベルのフローチャートである。
【図10】図9のフローチャートを実装した図1のアルゴリズム情報の実現方法の一例を示す説明図である。
【図11】数値計算アルゴリズム処理関数テーブルの内容を示す説明図である。
【図12】擬似コード・プログラム様式レベル依存テーブルの内容を示す説明図である。
【図13】プログラム様式のレベルのグループ分けに対応する仮想関数を示す説明図である。
【図14】プログラム様式レベル間の依存関係テーブルの内容を示す説明図である。
【図15】実体関数のクラス分けを示す説明図である。
【図16】実施例1のC++のクラス宣言に関する実装例を示した説明図である。
【図17】様式別テンプレートプログラム情報の実装例を示す説明図である。
【図18】生成プログラムの例を示す説明図である。
【図19】テンプレートプログラム情報を拡張する方法を示す説明図である。
【図20】非線形問題を扱う擬似コードの順序列が線形問題の擬似コードを使って表現されることを示す説明図である。
【符号の説明】
10  問題定義入力装置
11  問題定義情報
12  プログラム様式情報
20  構文解析装置
21  構文解析情報
30  プログラム生成制御装置
40  アルゴリズム格納装置
41  アルゴリズム情報
50  様式別テンプレートプログラム格納装置
51  様式別テンプレートプログラム情報
60  計算式生成装置
61  計算式情報
70  生成プログラム
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a numerical calculation program generation system, a numerical calculation program generation method, and a numerical calculation program generation program, and particularly to a computer architecture that has easy scalability of a numerical calculation algorithm that can be generated, and that the generated program corresponds to The present invention relates to a numerical calculation program generation system, a numerical calculation program generation method, and a numerical calculation program generation program having flexibility.
[0002]
[Prior art]
In conventional numerical calculation program generation systems, from the input information that expresses PDEs etc. in text, the calculation formulas necessary for the numerical calculation program of PDEs created on a computer according to a mathematical method are prepared in advance. Numerical calculation programs have been generated or interpreted by embedding them in a fixed format template program or interpreting them in an interpreted manner (for example, Patent Documents 1 and 2).
[0003]
Examples of such software include software in the United States, ELLPACK, PDE / PROTRAN, and the like.
[0004]
[Patent Document 1]
JP-A-6-180644
[Patent Document 2]
JP-A-6-59868
[0005]
[Problems to be solved by the invention]
The first problem is that it takes time and effort to add a newly generated calculation algorithm to the numerical calculation program generation system.
[0006]
The reason is that in the conventional numerical calculation program generation method, calculation formula parts created on a computer in accordance with a mathematical procedure can be filled in a prepared hole program without considering the detailed structure of the algorithm. Because it only generates. In a program generation method that does not consider the internal structure of a generated program, only the difference in the coefficients of the equations appearing in an input partial differential equation or the like can be handled.
[0007]
Therefore, in order to increase the number of calculation algorithms to be generated, it is necessary to prepare a new template program to be used for generating an artificial program, which requires much labor.
[0008]
The second problem is that it is troublesome to expand the numerical calculation program generation system when increasing the computer architecture, matrix data structure, etc., which are the targets of the program generated by the numerical calculation program generation system.
[0009]
The reason is that, similarly to the first problem, in a fill-in-the-blank program generation method that does not consider a change in the data structure of a generated program, even if the mathematical calculation algorithm is the same, the conventional program generation method does not. This is because it is necessary to prepare a new template of the program to be used for filling in the generation of the program. For example, if a program generation function for a parallel computer is added to a program generation system for a scalar computer, the mathematical calculation algorithm is the same, but the data structure handled by the program to be generated is different. A fill-in-the-blank program generation method could not cope.
[0010]
An object of the present invention is to realize a numerical calculation program generation system capable of efficiently expanding a numerical calculation algorithm that can be generated by the numerical calculation program generation system.
[0011]
Another object of the present invention is to make it possible to generate a numerical calculation program in accordance with a plurality of program formats such as a difference in computer architecture and matrix structure from information of one mathematical numerical calculation algorithm, and to generate a numerical calculation program. It is to facilitate the expansion of the system.
[0012]
[Means for Solving the Problems]
A first numerical calculation program generation system according to the present invention inputs problem definition information and program format information relating to a numerical calculation algorithm from a first storage device, and generates a numerical calculation algorithm of a numerical calculation program to be generated in a sequence of pseudo codes. By generating a program from the representation, a sequence of pseudo codes corresponding to the new numerical calculation algorithm is created using the already defined pseudo code, and the numerical calculation algorithm generated by the numerical calculation program generation system is created. And a means for generating a numerical calculation program in the second storage device.
[0013]
A second numerical calculation program generation system according to the present invention is the first numerical calculation program generation system, and corresponds to each pseudo code in accordance with designation of program format information input to the first storage device. Means for generating, in the second storage device, a numerical calculation program of a combination of a plurality of program format information from the same sequence of pseudo-codes by selecting template program information for each style and generating a numerical calculation program It is characterized by.
[0014]
A third numerical calculation program generation system according to the present invention is the second numerical calculation program generation system, wherein a problem is determined based on syntax analysis information generated from the problem definition information input to the first input device. For each numerical calculation algorithm specified by the definition information, the ordered set data of the pseudo code expressing the algorithm is called from the algorithm information stored in the third storage device. In accordance with the format specified by the program format information, the style-specific template program information for generating a program corresponding to each pseudo code is called from the fourth storage device, and all the pseudo codes are stored in the fifth storage device. Generates program parts for each numerical algorithm along with the calculation formula information to be Characterized in that it comprises means for generating a beam in the second storage device.
[0015]
According to a first numerical calculation program generation method of the present invention, problem definition information and program format information relating to a numerical calculation algorithm are input from a first storage device, and a numerical calculation algorithm of a numerical calculation program to be generated is represented by a pseudo code sequence. By generating a program from the representation, a sequence of pseudo codes corresponding to the new numerical calculation algorithm is created using the already defined pseudo code, and the numerical calculation algorithm generated by the numerical calculation program generation system is created. And a step of generating a numerical calculation program in the second storage device.
[0016]
A second numerical calculation program generation method according to the present invention is the first numerical calculation program generation method, and corresponds to each pseudo code in accordance with designation of program format information input to the first storage device. Generating a numerical calculation program by selecting template-specific template program information to generate a numerical calculation program of a combination of a plurality of program format information from the same pseudo-code sequence in the second storage device. It is characterized by.
[0017]
A third numerical calculation program generating method according to the present invention is the second numerical calculation program generating method, wherein a problem is solved based on syntax analysis information generated from the problem definition information input to the first input device. For each numerical calculation algorithm specified by the definition information, the ordered set data of the pseudo code expressing the algorithm is called from the algorithm information stored in the third storage device. In accordance with the format specified by the program format information, the style-specific template program information for generating a program corresponding to each pseudo code is called from the fourth storage device, and all the pseudo codes are stored in the fifth storage device. Generates program parts for each numerical calculation algorithm along with the calculation formula information to be Characterized in that it comprises a step of generating the second storage device.
[0018]
A first numerical calculation program generation program according to the present invention inputs problem definition information and program format information relating to a numerical calculation algorithm from a first storage device, and generates a numerical calculation algorithm of a numerical calculation program to be generated in a pseudo code sequence. By generating a program from the representation, a sequence of pseudo codes corresponding to the new numerical calculation algorithm is created using the already defined pseudo code, and the numerical calculation algorithm generated by the numerical calculation program generation system is created. And causing the computer to execute a procedure for generating a numerical calculation program in the second storage device.
[0019]
A second numerical calculation program generation program according to the present invention is the first numerical calculation program generation program, and corresponds to each pseudo code in accordance with the specification of the program format information input to the first storage device. By selecting the style-specific template program information and generating a numerical calculation program, the computer is provided with a procedure for generating a numerical calculation program of a combination of a plurality of program format information in the second storage device from the same pseudo code sequence. It is characterized by being executed.
[0020]
A third numerical calculation program generation program according to the present invention is the second numerical calculation program generation program, wherein a problem is calculated based on syntax analysis information generated from the problem definition information input to the first input device. For each numerical calculation algorithm specified by the definition information, the ordered set data of the pseudo code expressing the algorithm is called from the algorithm information stored in the third storage device. In accordance with the format specified by the program format information, the style-specific template program information for generating a program corresponding to each pseudo code is called from the fourth storage device, and all the pseudo codes are stored in the fifth storage device. Generates program parts for each numerical calculation algorithm along with the Characterized in that to execute a procedure for generating grams in the second storage device to the computer.
[0021]
BEST MODE FOR CARRYING OUT THE INVENTION
Next, a first embodiment of the present invention will be described in detail with reference to the drawings.
[0022]
FIG. 1 is a block diagram showing a configuration of the first exemplary embodiment of the present invention.
[0023]
Referring to FIG. 1, a first embodiment of the present invention includes a problem definition input device 10 including a keyboard and an external storage device, and a syntax analysis device 20 that operates under program control and generates syntax analysis information 21. A program generation control device 30 for controlling program generation based on the syntax analysis information 21, an algorithm storage device 40 including a memory or the like for storing algorithm information 41 representing a numerical calculation algorithm in pseudo code, Separately, the style-specific template program storage device 50 including a memory for storing the style-specific template program information 51, which is the template program information corresponding to the pseudo code, and the partial differential equation given by the problem definition information 11 are discretized. Calculations that become the data of individual numerical calculation programs, such as obtained calculation formulas A calculation formula generation apparatus 60 for generating comprises a generator 70 which is generated in the storage device.
[0024]
The problem definition input device 10, the algorithm storage device 40, and the style-specific template program storage device 50 may be one storage device. Further, the syntax analysis device 20, the program generation control device 30, and the calculation expression generation device 60 may be one information processing device.
[0025]
The problem definition input device 10 stores problem definition information 11 and program format information 12 given by a user. The problem definition information 11 is data composed of a mathematical algorithm such as designation of an algorithm appearing in numerical calculation, parameters associated with the algorithm, and a calculation formula. Algorithms represented by such data include interpolation as a substitution process, solving for a linear partial differential equation, Newton's method for a nonlinear equation, and calling a visualization library. Generally, the problem definition information 11 is a set of a plurality of numerical calculation algorithms. The program format information 12 includes a programming language name used for a program to be generated, an identification name for specifying how to handle data representation in a generated numerical calculation program, a matrix, particularly a data representation format name of a sparse matrix, a linear solver and visualization. This is attribute information such as the name of a program, which is necessary when a numerical calculation algorithm is actually implemented in a programming language.
[0026]
The syntax analysis device 20 creates syntax analysis information 21 for processing by the program generation control device 30 from the problem definition information 11 and the program format information 12 and provides the syntax analysis information 21 to the program generation control device 30.
[0027]
The algorithm storage device 40 stores the algorithm information 41 represented by an ordered set of pseudo codes. Pseudocode is an algorithm step that appears when implementing an abstract numerical algorithm in a programming language and is subdivided by factors in a specific program style.
[0028]
For each pseudo code used in the algorithm information 41, template program information for generating a program for each style is stored in the style-specific template program storage device 50 as style-specific template program information 51. Each pseudo code can include a plurality of template program information for generating a program for each format. Examples of these formats include a programming language format, a program structure / data representation format, a matrix structure format, and a library call format.
[0029]
The calculation formula generation device 60 is started from the program generation control device 30 and creates calculation formulas and variable name lists necessary for generating a numerical calculation program corresponding to each numerical calculation algorithm by data processing such as numerical formula processing. It is supplied to the program generation control device 30 as formula information 61. The calculation formula information 61 is a calculation formula serving as an attribute of an individual algorithm, such as a variable list appearing in the algorithm, a function form of coordinate transformation, a calculation formula at a numerical integration point, and the like. The calculation formula generation device 60 is not necessarily required depending on the program to be generated.
[0030]
Based on the syntax analysis information 21 analyzed by the syntax analysis device 20, the program generation control device 30 determines, for each of the numerical calculation algorithms specified in the problem definition information 11, the order of the pseudo code expressing that algorithm. The set data is called from the algorithm information 41, and further, the style-specific template program information 51 for generating a program corresponding to each pseudo code is called in accordance with the style specified by the program format information 12 for each pseudo code, and the necessary In this case, a program component of each numerical calculation algorithm is generated together with the calculation formula information 61. This operation is performed for all the pseudo codes constituting the specified algorithm. The generation program 70 is generated by performing the above processing for all the numerical calculation algorithms specified by the problem definition information 11 and the program format information 12.
[0031]
Next, the operation of the first exemplary embodiment of the present invention will be described with reference to the drawings.
[0032]
FIG. 2 is an explanatory diagram showing a specific example of problem definition information 11 describing a numerical calculation problem using a finite element method of a user and program format information 12.
[0033]
Referring to FIG. 2, processing relating to three numerical calculation algorithms, ie, substitution processing involving interpolation at 204, solution processing of a linear partial differential equation at 205, and visualization processing at 206 are expressed as specifications relating to the algorithm of the problem definition information 11. .
[0034]
S201 and S202 are the problem definition information 11 on variables used for problem description. In S201, the variable u is specified to be interpolated by the interpolation function name T1, and in S202, the variable rho is specified to have a value at the integration point of the numerical integration method defined by tet3.
[0035]
S203 is an example of the specification of the program format information 12, in which the program format of the finite element method with a format name of feelfem90 is specified as the program format.
[0036]
In this example, FORTRAN 90 is specified as a programming language, and a field called feelfem 90 is specified as a data expression / program format of the finite element method. Within the specification of the linear partial differential equation S205, the specification of an unknown variable and a test function symbol S205a, the specification of a numerical integration method of a region S205b, the specification of a linear solver S205c, the specification of a variational equation S205d, and the specification of a Dirichlet-type boundary condition S205e , The designation S205f of the Neumann-type boundary condition is described. The designation of the solver in S205c belongs to the program format information 12.
[0037]
FIG. 3 is an explanatory diagram illustrating an example of the problem definition information 11.
[0038]
FIG. 4 is an explanatory diagram illustrating an example of the problem definition information 11.
[0039]
FIG. 5 is a flowchart showing the basic operation of the program generation control device 30.
[0040]
Referring to FIG. 5, the text data of the problem definition information 11 input to the problem definition input device 10 is supplied to the syntax analysis device 20. The syntax analysis device 20 supplies the problem definition information 11 and the syntax analysis information 21 of the program format information 12 to the program generation control device 30. The program generation control device 30 extracts data on each numerical calculation algorithm from the syntax analysis information 21 (step A01 in FIG. 5). The program generation control device 30 generates a numerical calculation program component corresponding to the extracted numerical calculation algorithm (step A02 in FIG. 5). The generation of the individual numerical calculation algorithm program parts is repeated for all the numerical calculation algorithms described in the problem definition information 11 and the program format information 12 (step A03 in FIG. 5). Next, the numerical calculation algorithm program parts generated in step A02 are connected to generate a complete generation program 70 (step A04 in FIG. 5).
[0041]
FIG. 6 is a flowchart showing details of step A02 in FIG.
[0042]
For one numerical calculation algorithm (hereinafter referred to as a numerical calculation algorithm to be processed) extracted in step A01 in FIG. 5, a necessary calculation formula created by the calculation formula generation device 60, a calculation formula such as a variable name list, etc. The information 61 is extracted (step B01 in FIG. 6). The algorithm information 41 represented by the ordered set of the corresponding pseudo code for the numerical calculation algorithm to be processed is extracted from the algorithm storage device 40 (step B02 in FIG. 6).
[0043]
Pseudocodes are sequentially extracted one by one from the ordered set of pseudocodes representing the numerical calculation algorithms extracted from the algorithm information 41 (step B03 in FIG. 6).
Next, from the pseudo code extracted in step B03 and the program format information 12 specified in the pseudo code of the syntax analysis information 21, the corresponding format-specific template program information 51 is extracted from the format-specific template program storage device 50 ( (Step B04 in FIG. 6).
[0044]
Based on the extracted style-specific template program information 51 and calculation formula information 61, a portion corresponding to the extracted pseudo code is generated (step B05 in FIG. 6). The process is repeated for all pseudo codes representing the calculation algorithm to be processed (step B06 in FIG. 6).
[0045]
In this way, the generation of a program corresponding to each numerical calculation algorithm stored in the form of an ordered set of pseudo codes is performed for each pseudo code constituting the algorithm by using program format information 12 specified by user input information. Is generated from the style-specific template program information 51 of the program format specified for the pseudo code and the calculation formula information 61 independent of the program format.
[0046]
For this reason, when newly increasing the numerical calculation algorithm to be generated, the pseudo code constituting the algorithm information 41 already registered in the system is reused, and the pseudo code order of the newly increased numerical calculation algorithm is changed. A set expression can be constructed. In this case, it is not necessary to newly extend the system with respect to the portion of the pseudo code that has been reused, so that it is possible to increase the number of new numerical calculation algorithms with little effort.
[0047]
Further, when the system attempts to add a program generation function using a new program format to a numerical calculation algorithm that already has a program generation function, the system expansion work includes pseudo code related to the program format to be newly added. Only by individually adding style-specific template program information 51 corresponding to the pseudo code.
[0048]
Therefore, it is possible to generate a numerical calculation program having attributes of a plurality of program formats for one numerical calculation algorithm with a small amount of trouble, and it is easy to expand and manage the system.
[0049]
Next, a first embodiment of the present invention will be described with reference to the drawings.
[0050]
In the first embodiment, a keyboard is used as the problem definition input device 10, a personal computer is used as the syntax analysis device 20, the program generation control device 30, and the calculation formula generation device 60, an algorithm storage device 40, and a template program storage device 50 for each style. As a magnetic disk drive.
[0051]
The personal computer has a central processing unit that performs logical processing as a syntax analysis device 20, a program generation control device 30, and a calculation formula generation device 60, and each magnetic disk storage device has algorithm information. 41, and template program information 51 for each style.
[0052]
In the first embodiment, a numerical calculation method of a linear partial differential equation by the finite element method is used as an example of the generation program 70 to be generated. At this time, the unknown function is approximated by a linear combination of certain interpolation functions, and a numerical solution is obtained as a variational problem. At this time, the problem definition information 11 includes the shape of the interpolation function used for approximation, the numerical integration method for dealing with variational problems, and the boundary conditions of Dirichlet type and Neumann type. These are mathematical things that do not depend on a particular implementation. The input information necessary for performing other specific implementation is called program format information 12.
[0053]
FIG. 2 is an explanatory diagram showing an example of the problem definition information 11 and the program format information 12.
[0054]
FIG. 3 is an explanatory diagram showing an example of the problem definition information 11 and the program format information 12.
[0055]
FIG. 4 is an explanatory diagram showing an example of the problem definition information 11 and the program format information 12.
[0056]
Referring to FIG. 2, the calculation processing involving the numerical calculation algorithm relates to substitution processing involving interpolation (S204 in FIG. 2), processing relating to solution of a linear partial differential equation (S205 in FIG. 2), and processing relating to visualization processing (FIG. 2 S206). Is specified. Other descriptions other than the program format information 12 (S203, S205c in FIG. 2) belong to the problem definition information 11.
[0057]
In S201, it is specified that the variable u is a function variable to be interpolated by an interpolation function having the name T1. In S202, it is specified that the variable rho is a function variable having a value at each integration point of the numerical integration method defined by the name tet3. In S203, a program style named feelfem90 is designated as the program style information 12. In this example, FORTRAN 90 is designated as a programming language, and a field called feelfem 90 is designated as a data expression / program format of the finite element method.
[0058]
S205 is the problem definition information 11 of the linear partial differential equation. In S205a, the solve specifies a partial differential equation problem, a symbol representing an unknown variable is designated as u, and a symbol representing a test function is designated as tu. In S205b, it is specified that the numerical integration method used when solving this partial differential equation is the numerical integration method defined by the name tet3.
[0059]
In S205c, it is specified that a solver defined by the name amg is used as a solver for solving a system of linear equations appearing by discretization. In step S205c, the program format information 12 implicitly specifies the type of the solver library to be used and the data structure of the matrix of the simultaneous linear equations dependent on the type. In S205d, the variational problem form of the linear partial differential equation is specified in the form of integral. The term specified by integral (integrated function) is the area integral term, and the element stiffness matrix and the calculation formula information 61 of the element load vector are specified. The term specified by bintegral (the integrand) is a boundary integral term, and calculation formula information 61 on the Neumann-type boundary condition is specified. In S205e, u = 1000 which is the calculation formula information 61 of the Dirichlet type boundary condition and the names ab and bc of the boundaries imposing the condition are specified.
[0060]
In S205f, g = u-100, which is the calculation formula information 61 of the Neumann-type boundary condition, and the name eg of the boundary imposing this condition are specified. In S206, it is specified to output a contour diagram for the function amount u * 100.
[0061]
Referring to FIG. 3, the interpolation function relating to the interpolation method T1 used in S201 is a name T1, an element shape tetra (tetrahedron), and coordinates in the reference element and the interpolation function are represented by r, s, t polynomials. Is specified in the set. Further, another interpolation method T2 is specified following T1.
[0062]
Referring to FIG. 4, information on the name tet3 of the numerical integration method used in S202 is designated as a set of a numerical integration point and its weight in the reference element.
[0063]
These pieces of input information are analyzed by the syntax analysis device 20, and syntax analysis information 21 is created.
[0064]
FIG. 7 is an explanatory diagram showing an example of the syntax analysis information 21 for FIGS. 2, 3, and 4.
[0065]
701 is the basic program format information 12 specified by the ProgramModel statement in S203. Reference numerals 711, 712, 721, and 722 are created from the input information of FIGS. 3 and 4 and S201 and S202, respectively, and are used as mathematical attribute information of discretization when generating a numerical calculation program. Each of 711a and 712a stores an internal expression of a mathematical expression information list such as coordinates and mathematical expressions in FIGS.
[0066]
S204, S205, and S206 of the schema block in FIG. 2 are input information specifying independent numerical calculation processing, and the respective pieces of syntax analysis information 730, 740, and 750 are collected for each calculation processing unit. Each calculation processing unit includes one or more numerical calculation algorithms.
[0067]
For simplicity, the numerical solution processing of the linear partial differential equation by the finite element method in S205 will be referred to as a solve block. In view of the numerical calculation algorithm in the first embodiment, this solve block is composed of four numerical calculation algorithms, that is, three sub-processes and a process of controlling a solve block that controls the sub-processes. . The numerical calculation algorithm of the first sub-process is a process of calculating an element stiffness matrix and an element load vector of the finite element method and adding them to the entire matrix and the entire load vector, and corresponds to 745 of the parsing information 21. The second sub-processing is a numerical calculation algorithm for processing Neumann-type boundary conditions, and corresponds to 746 of the parsing information 21. The third sub-processing is a numerical calculation algorithm for processing Dirichlet-type boundary conditions, and corresponds to 747 of the parsing information 21. The process of controlling the solve block is generated from 740 of the syntax analysis information 21.
[0068]
In accordance with the flowchart of FIG. 5, the program generation control device 30 extracts the list of the type information of the numerical calculation algorithm 731, 741, 745 a, 746 a, 747 a, and 751 from the syntax analysis information 21 and sequentially generates the components of the numerical calculation program. I do. The generation processing of the numerical calculation program corresponding to the individual numerical calculation algorithm is executed by the program generation control device 30 according to the flowchart of FIG.
[0069]
Here, as an example for explaining the processing of the flowchart of FIG. 6 in detail, a numerical calculation algorithm of the processing related to the control of the above solve block will be described.
[0070]
The numerical calculation algorithm, which is the processing method of the first embodiment, is represented by a sequence of pseudo codes, and the process of generating template-specific information 51 for each pseudo code to generate a program is performed by the other three numerical calculation algorithms. The same can be applied to
[0071]
Prior to describing the operation of the flowchart in FIG. 6, an example of a mounting method of the numerical calculation algorithm related to the control of the solve block in the first embodiment using the algorithm information 41 will be specifically described.
[0072]
FIG. 8 is a flowchart showing the contents of a numerical calculation algorithm relating to control of the solve block in S205.
[0073]
The algorithm relating to the control of the solve block is an abstract one that does not depend on a program style such as a programming language to be implemented or a computer architecture.
[0074]
Referring to FIG. 8, a data structure of a sparse matrix appearing by discretizing a differential equation is obtained from the connection relationship between elements and nodes and the degrees of freedom at each node (step D01 in FIG. 8). The element stiffness matrix and element load vector calculated for each element are added to the array storing the entire matrix allocated to the memory with the structure determined by D01 (step D02 in FIG. 8). The contribution from the evaluation amount of the boundary integral defined by the Neumann-type boundary condition is added to the overall matrix (step D03 in FIG. 8).
[0075]
Processing is performed for the degree of freedom whose value is specified by the directory condition (step D04 in FIG. 8). Solve the constructed system of linear equations with a solver. In step D06, post-processing such as dividing the selected solution into physical quantities is performed (step D05 in FIG. 8).
[0076]
Each step of the abstract algorithm represented by the flowchart of FIG. 8 is divided into small steps subdivided according to the dependence on the level of the program style, and each divided step is referred to as one pseudo code. Then, the numerical calculation algorithm for which the program is to be generated is represented by a list formed by a sequence of pseudo codes.
[0077]
FIG. 9 is a pseudo-code level flowchart illustrating an example of the decomposition of the flowchart of FIG. 8 into pseudo code.
[0078]
Prior to the description of FIG. 9, the pseudo code will be described with a specific example. When each step of the abstract algorithm as shown in FIG. 8 is actually implemented in a computer language, the program style must be determined for various levels in order to determine the actual implementation.
[0079]
For example, a programming language of a computer to be used and various data structures. In the first embodiment, the first level of the programming language used in the generated numerical calculation program, such as FORTRAN77 or C ++, the ProgramModel relating to the data structure handled by the generated numerical calculation program and its expression, as the level of this program style class. A second level to be called, a third level to deal with the representation of a data structure in particular of a matrix component storage format among data structures, and a fourth level to deal with a difference in a method of calling a general library routine such as a solver for solving simultaneous linear equations. Consider the above four levels.
[0080]
At this time, it should be noted that the fourth level depends on the third level, the third level also depends on the second level, and the second level also depends on the first level. We focus on the hierarchical structure of this program style, and hereafter it is called the implementation level. An actual implementation is possible with the program style specified for each of these four levels.
[0081]
Explaining with a specific example, the process of “allocating an array for storing a sparse matrix from the calculation of the degrees of freedom” in step D01 in FIG. 8 includes the level of the second program style of “calculating the degrees of freedom” and It can be divided into a third program style level of "allocating an array for storing a sparse matrix". When divided in this way, the generation processing of the numerical calculation program for step D01 can be subdivided into a part dependent on the second level and a part dependent on the third level. The subdivided program generation processing is determined by the individual program format specified at that level. The minimum processing unit of program generation, which is subdivided according to the level of the program style, is the pseudo code referred to in the present invention. Also, in the present invention, units that are structural components of the program source code, such as "declare a subroutine" or "declare a variable", which is a statement of a program, are also separated for each level of the program style. Is treated as pseudo code.
[0082]
Although the division of the algorithm steps into pseudo code is arbitrary, it is effective to separate the pseudo algorithm code by separating the steps of the abstract algorithm that depend on the lowest possible program style. Because, for example, in the case of the linear solver, if the fourth-level of calling the solver and the third-level matrix storage method are completely separated by pseudo code, the solver using the same matrix storage method can be used. This is because, in the case of replacement, the change of the numerical calculation program to be generated is localized only in the pseudo code for the fourth level.
[0083]
In the first embodiment, a description will be given of a case where the level is divided into four levels, but the same applies even if the number of levels changes. For example, since the input / output data file format such as mesh data is independent of the numerical calculation algorithm, it is possible to add this level to five levels. In this case, it is easy to create a system that generates programs with different file input / output methods.
[0084]
Referring to FIG. 9, the pseudo code expression of the algorithm in FIG. 8 is composed of 15 steps E01 to E15. It is important that the pseudo code steps E01 to E15 divided according to the program style level do not depend on the specific specification of the program style. Next, this step will be described. Hereinafter, as a term, a module of a program generated corresponding to steps E01 to E15 is referred to as a solve subroutine.
[0085]
Step E01 is pseudo code corresponding to creating a source file for writing a solve subroutine in which the algorithm of FIG. 8 is realized. Step E02 is a pseudo code corresponding to generating a header part of a solve subroutine, such as a declaration procedure statement.
[0086]
Step E03 is pseudo code corresponding to generating a declaration statement such as a constant determined before execution of a problem-dependent parameter or the like. Step E04 is pseudo code corresponding to declaring a local variable used in the solve subroutine. Step E05 is pseudo code corresponding to the initialization of variables in the solve subroutine.
[0087]
Step E06 is a pseudo code corresponding to calculating the degrees of freedom and equation numbers of unknown variables necessary for determining the matrix structure. Step E07 is a pseudo code corresponding to preparing the data of the boundary condition. Step E08 is a pseudo code corresponding to allocating a memory for storing a matrix or a vector required for the process of the solve subroutine. Step E09 is a pseudo code corresponding to calling the calculation of the element matrix / element weight and the processing of assembling the element matrix by the numerical solution of the differential equation by the finite element method.
[0088]
Step E10 is pseudo code corresponding to calling a subroutine for processing the Neumann-type boundary condition. Step E11 is pseudo code corresponding to calling a subroutine for processing a Dirichlet-type boundary condition. Step E12 is pseudo code corresponding to calling a solver library that solves a simultaneous linear equation selected by discretizing the differential equation. Step E13 is pseudo code corresponding to calling the post-processing after calling the solver library. Step E14 is a pseudo code corresponding to performing processing for ending the solve subroutine. Step E15 is a pseudo code corresponding to closing the file in which the solve subroutine has been written.
[0089]
FIG. 10 is an explanatory diagram showing an example of a method for realizing the algorithm information 41 of FIG. 1 in which each pseudo code of FIG. 9 is a C ++ virtual function, and the flowchart of FIG. 9 is implemented as a function procedure for sequentially calling them.
[0090]
Although it is implemented as a function procedure in FIG. 10, it can be represented by list data and handled by interpretive processing.
[0091]
The flowchart of FIG. 9 is expressed by a member function NormalLinearProblem of the class SolveScheme. Referring to FIG. 10, the pseudo code sequence representing the flowchart of FIG. 9 is realized as a virtual function call procedure 1001 in the NormalLinearProblem function.
[0092]
The list of call functions 1001 corresponds to the steps E01 to E15 in FIG. 9 on a one-to-one basis. In other words, E01 represents RouteInitialize (solvePtr), and E02 represents RouteHeader (solvePtr) in the order of RouteTerminate (solvePtr) of E15, and the steps corresponding to the 15 pseudo codes in FIG.
[0093]
Next, the operation of the program generation control device 30 will be described in more detail with reference to the drawings.
[0094]
FIG. 11 is an explanatory diagram showing the contents of the numerical calculation algorithm processing function table.
[0095]
In the above example, the table of 740 of FIG. 7 is selected from the syntax analysis information 21 of FIG. 7, and the process of step A02 of FIG. 5, that is, steps B01 to B06 of FIG. 6 is started. In step B01, the appearance variable table 742 is passed to the calculation formula generation device 60 from SOLVE of the calculation process type information 741, and the calculation formula information 61 is generated. In the case of the numerical calculation algorithm for control of the solve block, the list 742 of the calculation formula information 61 becomes the calculation formula information 61 as it is. The generation of the calculation formula information 61 by mathematical processing or the like is necessary when generating a numerical calculation program corresponding to the ASSEMBLE numerical calculation algorithm of 745 of the syntax analysis information 21, but is not relevant to the essence of the present invention. This calculation formula generation processing is described in, for example, “Japanese Patent Application Laid-Open No. 06-180644”.
[0096]
The processing of step B02 in FIG. 6 is executed by referring to the numerical calculation algorithm processing function table (FIG. 11) from the calculation processing type information of 741 and calling the corresponding numerical calculation algorithm processing function. In the case of the control algorithm of the Solve block, SolveScheme :: NormalLinearProblem is called from the processing type name SOLVE. The process of sequentially extracting the pseudo code in step B03 is realized by sequentially executing the execution statement 1001 of SolveScheme :: NormalLinearProblem. That is, the algorithm expression by the pseudo code corresponds to a list of 1001 calling functions.
[0097]
In the first embodiment, the realization method of step B04 and step B05 in FIG. 6 is based on the virtual function of C ++ and the mechanism of polymorphism.
[0098]
First, the configuration of the implementation of a virtual function and its real function, which is the premise of polymorphism, will be described with reference to the drawings.
[0099]
FIG. 12 is an explanatory diagram showing the contents of the pseudo code / program format level dependency table.
[0100]
FIG. 13 is an explanatory diagram showing virtual functions corresponding to grouping of levels in the program format.
[0101]
FIG. 14 is an explanatory diagram showing the contents of the dependency relationship table between program style levels.
[0102]
FIG. 15 is an explanatory diagram showing the classification of the substantive functions.
[0103]
FIG. 16 is an explanatory diagram showing an implementation example regarding the C ++ class declaration of the first embodiment.
[0104]
FIG. 17 is an explanatory diagram showing an implementation example of the template program information for each style.
[0105]
Each function 1001 called in the function NormalLinearProblem of FIG. 10 is declared as a virtual function of the class SolveScheme. These virtual functions are grouped as pseudo code into four program styles (Language, ProgramModel, MatrixModel, Library) as shown in the pseudo code / program style existence table shown in FIG. As in the virtual function grouping shown in FIG. 13, one group of the real functions is implemented as one class.
[0106]
The designation of the program format in the input example of FIG. 2 is performed by specifying a solver library named amg at the level of the program format of the fourth library in FIG. 2S205c, and specifying a program name of feelf90 at the level of the second program format in FIG. Two program styles are explicitly specified. Since the third-level matrix structure and the first-level programming language level are determined from the fourth and second levels, respectively, the matrix structure is obtained from the dependency table between the program style levels shown in FIG. Has been determined as a program format, and Fortran 90 has been determined as a programming language format.
[0107]
From this, in the specific example of FIG. 2, the real functions corresponding to the virtual functions are, as shown in FIG. 15, class Fortran 90 (FIG. 15G01), class field90 (FIG. 15G02), class CRS (FIG. 15G03), and class amg (FIG. 15G02). 15G04) are implemented in the four classes.
[0108]
From the above configuration, the mechanism of step B04 in FIG. 6 can be realized. FIG. 16 shows this. Although the function procedure 1001 in FIG. 10 is declared as a virtual function in the class SolveScheme, the corresponding substantial function is implemented in the classes L1, L2, L3, and L4 declared as templates by the public declaration in FIG. 16H01. It becomes possible to do. By specifying the combination of L1, L2, L3, and L4, it is possible to select a substantial function from the program format information 12. For example, FIG. 15 and FIG. 16H03 show the specified examples of FIG. 2, and L1, L2, L3, and L4 of the template declaration are designated as Fortran 90, feelfem90, CRS, and amg, respectively. The selection process in step B04 is realized.
[0109]
In the first embodiment, as described above, the “format-specific template program information 51 corresponding to the pseudo code” in step B04 in FIG. 6 is the entity corresponding to the virtual function grouped for each class declared for each level of the program format. It is stored in the form of a function execution statement. Specifically, this is a C ++ executable statement as shown in FIG. The list in FIG. 17J01 is template program information corresponding to step E08 in FIG. 9 that is called when the CRS format is designated as the matrix format program format. As described above, in the first embodiment, the style-specific template program information 51 is realized in the form of a C ++ printf statement.
[0110]
The processing of steps B02 to B06 in FIG. 6 is shown in the lists of FIGS. That is, the process of extracting the algorithm information 41 by the pseudo code from the algorithm storage device 40 in step B02 in FIG. 6 corresponds to FIG. 16H04. When the NormalLinearProblem function in FIG. 16H04 is executed, 1001 in FIG. 10 is executed, so that the process of sequentially extracting the pseudo code in step B03 in FIG. 6 can be realized. The process of extracting the template program information for each format 51 from the program format information 12 in step B04 in FIG. 6 is realized by the polymorphism mechanism of the virtual function in C ++ in FIG. In the process of generating the portion corresponding to the numerical calculation program in step B05 in FIG. 6, the actual functions of each virtual function (J01, J02, etc. in FIG. 17) are executed, and the portion of the generation program 70 is sequentially written to a disk device or the like by a printf statement. Thus, the generation of the generation program 70 is realized.
[0111]
FIG. 18 is an example of the generation program 70 output according to the above procedure. As shown in FIG. 18, when the function NormalLinearProblem of FIG. 10 corresponding to the pseudo code is called and the virtual functions of 1001 are sequentially executed, the real function shown in FIG. 15 is designated by the polymorphism mechanism. The source files of the generation program 70 are generated by sequentially calling the components of the program in a file or the like according to the program format.
[0112]
The numerical solution of partial differential equations is mainly solved by solving simultaneous linear equations. Generally, the matrix that appears in this calculation is a sparse matrix with a large dimension, so it is necessary to store the matrix efficiently.However, the properties of the PDE, the architecture of the computer that performs the calculation, or the linear solver that solves simultaneous linear equations There is a difference in the effective way of storing the matrix. Therefore, it is industrially useful for a numerical calculation program generation system to generate a calculation program corresponding to the data structure of a newly devised matrix.
[0113]
The processing unit of program generation according to the first embodiment of the present invention is subdivided into basic units for each program format in the implementation, and each is expressed as one pseudo code. In other words, only for the pseudo code related to the matrix structure level, if a new matrix structure format, that is, template program information corresponding to the new program format is prepared, the numerical calculation program generation system corresponding to the new matrix structure can be provided. Can be extended.
[0114]
FIG. 19 is an explanatory diagram showing a method of extending template program information.
[0115]
Referring to FIG. 19, in addition to the CRS format, style-specific template program information, which is a Skyline format program format, is added to the pseudo code of FIG. 9E08 belonging to the third matrix structure level. If this operation is performed on the remaining pseudo code diagrams 9E09, E10, and E11 belonging to the third matrix structure level, the pseudo code diagrams 9E01, E05, E15 belonging to the first programming language level, and the second ProgramModel Pseudo-code belonging to level 9 The change of the numerical calculation program generation system relating to E02, E03, E04, E06, E07, E13, E14 is unnecessary, and by calling the function SolveScheme :: NormalLinearProblem, the matrix structure for the input information S205c of FIG. Can generate the generation program 70 in the Skyline format, which facilitates expansion of the numerical calculation program generation system. Specifically, it is only necessary to add J02 to J01 in FIG.
[0116]
Although the extension related to the matrix structure level has been described above, the same applies to the programming language level, the ProgramModel level, and the library level. When the program format is extended, a numerical calculation program is generated by adding a minimum necessary as in the first embodiment. System expansion is realized.
[0117]
In the present invention, a numerical calculation program corresponding to a certain numerical calculation algorithm is generated from control information consisting of a sequence of pseudo codes. When adding a function of generating a numerical calculation program corresponding to a new numerical calculation algorithm to the numerical calculation program generation system of this method, it is possible to add the numerical calculation algorithm by using already implemented pseudo code. As an example, using a function of generating a numerical calculation program of a control algorithm for linear partial differential equations (FIG. 9), a numerical calculation program of a control algorithm for numerically solving a nonlinear partial differential equation using the Newton method is generated. A case where a function is added will be described.
[0118]
FIG. 20 is an explanatory diagram showing that a sequence of pseudo codes dealing with a non-linear problem is expressed using pseudo codes of a linear problem.
[0119]
When a nonlinear equation is solved by the Newton method, a solution is obtained by linearizing the equation and repeatedly solving a linear problem. What is needed when extending the flow chart of the control program for the linear problem shown in FIG. 9 to the nonlinear problem is to insert control regarding the initialization and the loop of the nonlinear problem between FIGS. 9E08 and 9E09, Only the post-processing of the solver of FIG. 9E13 is changed to the post-processing of the solver in the case of the nonlinear problem, and the processing of the remaining FIGS. 9E01 to E08, E10 to E12, and E14 to E15 may be exactly the same. That is, as shown in FIG. 20, a pseudo code (K01, K02 in FIG. 20) specific to a nonlinear problem may be newly prepared, and a program component generation function corresponding thereto may be added.
[0120]
In this way, by reusing the existing pseudo code, it is possible to expand the numerical calculation algorithm that can be handled by the program generation system only by adding the necessary pseudo code, and it is easy to add the algorithm that can be handled by the numerical calculation program generation system It can be carried out. In this embodiment, the case of the finite element method has been described. However, a program generation system can be created by a similar method using the difference method or the finite volume method.
[0121]
Next, a second embodiment of the present invention will be described in detail with reference to the drawings.
[0122]
The second embodiment of the present invention is a method including the steps of each processing of the first embodiment of the present invention (for example, the steps of FIGS. 5, 6, 8, and 9).
[0123]
Next, a third embodiment of the present invention will be described in detail with reference to the drawings.
[0124]
According to the third embodiment of the present invention, each processing step (for example, each step of FIG. 5, FIG. 6, FIG. 8, and FIG. 9) of the second embodiment of the present invention is performed by a computer (for example, syntax analysis). This is a program to be executed by the device 20, the calculation formula generation device 60, and the program generation control device 30).
[0125]
【The invention's effect】
The first effect is that it is easy to add a function of generating a numerical calculation program having a new program format to a numerical calculation program generation system of a numerical calculation algorithm that has already been implemented.
[0126]
The reason is that the generation of a numerical calculation program corresponding to a certain numerical calculation algorithm is controlled by a sequence of pseudo codes, but when a new program form is added, only the pseudo code to which the program form is related is added. This is because it is only necessary to add the corresponding template program information. That is, the control structure of the numerical calculation program reflecting the mathematical algorithm of the pseudo code sequence can be used as it is without depending on the individual program style.
[0127]
Further, the addition of the program format is useful for constructing a program generation system in that the additional necessity is localized only in the relevant pseudo code.
[0128]
The second effect is that it is easy to add a numerical calculation algorithm that can generate a program.
[0129]
The reason is that the generation of the numerical calculation program corresponding to the numerical calculation algorithm is represented by the pseudo code sequence considering the implementation level. This is because the pseudo code already defined can be reused when making it.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration of a first exemplary embodiment of the present invention.
FIG. 2 is an explanatory diagram showing a specific example of problem definition information describing a numerical calculation problem using a finite element method of a user and program format information.
FIG. 3 is an explanatory diagram showing data relating to an interpolation method T1.
FIG. 4 is an explanatory diagram showing a part of data relating to a numerical integration method tet3.
FIG. 5 is a flowchart showing a basic operation of the program generation control device.
FIG. 6 is a flowchart showing details of step A02 in FIG. 5;
FIG. 7 is an explanatory diagram showing an example of syntax analysis information for FIGS. 2, 3, and 4;
FIG. 8 is a flowchart showing the contents of a numerical calculation algorithm relating to control of a solve block.
9 is a pseudo-code level flowchart illustrating an example of decomposition of the flowchart of FIG. 8 into pseudo code.
FIG. 10 is an explanatory diagram showing an example of a method for implementing the algorithm information of FIG. 1 implementing the flowchart of FIG. 9;
FIG. 11 is an explanatory diagram showing the contents of a numerical calculation algorithm processing function table.
FIG. 12 is an explanatory diagram showing the contents of a pseudo code / program format level dependency table.
FIG. 13 is an explanatory diagram showing virtual functions corresponding to grouping of levels in a program format.
FIG. 14 is an explanatory diagram showing the contents of a dependency relationship table between program style levels.
FIG. 15 is an explanatory diagram showing a classification of an entity function.
FIG. 16 is an explanatory diagram showing an implementation example regarding a C ++ class declaration in the first embodiment.
FIG. 17 is an explanatory diagram showing an implementation example of template program information for each style.
FIG. 18 is an explanatory diagram illustrating an example of a generation program.
FIG. 19 is an explanatory diagram showing a method of extending template program information.
FIG. 20 is an explanatory diagram showing that a sequence of pseudo codes dealing with a nonlinear problem is expressed using pseudo codes of a linear problem.
[Explanation of symbols]
10 Problem definition input device
11 Problem definition information
12 Program form information
20 syntax analyzer
21 Parsing information
30 Program generation control device
40 Algorithm storage device
41 Algorithm Information
50 Template program storage device by style
51 Template program information by style
60 Calculation formula generator
61 Calculation formula information
70 generation program

Claims (9)

数値計算アルゴリズムに関する問題定義情報、プログラム様式情報を第1の記憶装置から入力し、生成する数値計算プログラムの数値計算アルゴリズムを疑似コードの順序列で表現したものからプログラム生成を行うことにより、既に定義されている疑似コードを利用して新たな数値計算アルゴリズムに対応する疑似コードの順序列を作り、数値計算プログラム生成システムが生成する数値計算アルゴリズムを増やし、数値計算プログラムを第2の記憶装置に生成する手段を有することを特徴とする数値計算プログラム生成システム。The problem definition information and program format information relating to the numerical calculation algorithm are input from the first storage device, and the numerical calculation algorithm of the numerical calculation program to be generated is generated by expressing the numerical calculation algorithm in a sequence of pseudo-codes. A pseudo-code sequence corresponding to a new numerical calculation algorithm is created using the pseudo-code that has been set, the numerical calculation algorithm generated by the numerical calculation program generation system is increased, and the numerical calculation program is generated in the second storage device. A numerical calculation program generation system, comprising: 前記第1の記憶装置に入力されたプログラム様式情報の指定に従って各疑似コードに対応している様式別テンプレートプログラム情報を選択して数値計算プログラムを生成することにより、同じ疑似コードの順序列から複数のプログラム様式情報の組み合わせの数値計算プログラムを前記第2の記憶装置に生成する手段を有することを特徴とする請求項1記載の数値計算プログラム生成システム。By selecting the style-specific template program information corresponding to each pseudo code and generating a numerical calculation program in accordance with the specification of the program format information input to the first storage device, a plurality of sequence codes of the same pseudo code are generated. 2. The numerical calculation program generation system according to claim 1, further comprising means for generating a numerical calculation program of the combination of the program format information in the second storage device. 前記第1の入力装置に入力された問題定義情報から生成された構文解析情報に基づき、問題定義情報で指定されている各数値計算アルゴリズムのそれぞれに対し、そのアルゴリズムを表現している疑似コードの順序集合データを第3の記憶装置に格納されるアルゴリズム情報から呼び出し、さらに、疑似コードごとにプログラム様式情報で指定された様式に従って、各疑似コードに対応しているプログラム生成のための様式別テンプレートプログラム情報を第4の記憶装置から呼び出し、すべての擬似コードに対し第5の記憶装置に格納される計算式情報とともに各数値計算アルゴリズムのプログラム部品を生成し、数値計算プログラムを前記第2の記憶装置に生成する手段を有することを特徴とする請求項2記載の数値計算プログラム生成システム。Based on syntax analysis information generated from the problem definition information input to the first input device, for each of the numerical calculation algorithms specified in the problem definition information, a pseudo code expressing the algorithm is provided. An ordered set data is called from the algorithm information stored in the third storage device, and further, a format-specific template for generating a program corresponding to each pseudo code in accordance with the format specified by the program format information for each pseudo code The program information is called from the fourth storage device, and program parts of each numerical calculation algorithm are generated together with the calculation formula information stored in the fifth storage device for all the pseudo codes, and the numerical calculation program is stored in the second storage device. 3. A computer program according to claim 2, further comprising means for generating a numerical calculation program. Stem. 数値計算アルゴリズムに関する問題定義情報、プログラム様式情報を第1の記憶装置から入力し、生成する数値計算プログラムの数値計算アルゴリズムを疑似コードの順序列で表現したものからプログラム生成を行うことにより、既に定義されている疑似コードを利用して新たな数値計算アルゴリズムに対応する疑似コードの順序列を作り、数値計算プログラム生成システムが生成する数値計算アルゴリズムを増やし、数値計算プログラムを第2の記憶装置に生成する手順を含むことを特徴とする数値計算プログラム生成方法。The problem definition information and program format information relating to the numerical calculation algorithm are input from the first storage device, and the numerical calculation algorithm of the numerical calculation program to be generated is generated by expressing the numerical calculation algorithm in a sequence of pseudo-codes. A pseudo-code sequence corresponding to a new numerical calculation algorithm is created using the pseudo-code that has been set, the numerical calculation algorithm generated by the numerical calculation program generation system is increased, and the numerical calculation program is generated in the second storage device. A method for generating a numerical calculation program, comprising the steps of: 前記第1の記憶装置に入力されたプログラム様式情報の指定に従って各疑似コードに対応している様式別テンプレートプログラム情報を選択して数値計算プログラムを生成することにより、同じ疑似コードの順序列から複数のプログラム様式情報の組み合わせの数値計算プログラムを前記第2の記憶装置に生成する手順を含むことを特徴とする請求項4記載の数値計算プログラム生成方法。By selecting the style-specific template program information corresponding to each pseudo code and generating a numerical calculation program in accordance with the specification of the program format information input to the first storage device, a plurality of sequence codes of the same pseudo code are generated. 5. The method according to claim 4, further comprising the step of generating a numerical calculation program of the combination of the program format information in the second storage device. 前記第1の入力装置に入力された問題定義情報から生成された構文解析情報に基づき、問題定義情報で指定されている各数値計算アルゴリズムのそれぞれに対し、そのアルゴリズムを表現している疑似コードの順序集合データを第3の記憶装置に格納されるアルゴリズム情報から呼び出し、さらに、疑似コードごとにプログラム様式情報で指定された様式に従って、各疑似コードに対応しているプログラム生成のための様式別テンプレートプログラム情報を第4の記憶装置から呼び出し、すべての擬似コードに対し第5の記憶装置に格納される計算式情報とともに各数値計算アルゴリズムのプログラム部品を生成し、数値計算プログラムを前記第2の記憶装置に生成する手順を含むことを特徴とする請求項5記載の数値計算プログラム生成方法。Based on syntax analysis information generated from the problem definition information input to the first input device, for each of the numerical calculation algorithms specified in the problem definition information, a pseudo code expressing the algorithm is provided. An ordered set data is called from the algorithm information stored in the third storage device, and further, a format-specific template for generating a program corresponding to each pseudo code in accordance with the format specified by the program format information for each pseudo code The program information is called from the fourth storage device, and program parts of each numerical calculation algorithm are generated together with the calculation formula information stored in the fifth storage device for all the pseudo codes, and the numerical calculation program is stored in the second storage device. 6. The method according to claim 5, further comprising a step of generating the numerical calculation program in the apparatus. . 数値計算アルゴリズムに関する問題定義情報、プログラム様式情報を第1の記憶装置から入力し、生成する数値計算プログラムの数値計算アルゴリズムを疑似コードの順序列で表現したものからプログラム生成を行うことにより、既に定義されている疑似コードを利用して新たな数値計算アルゴリズムに対応する疑似コードの順序列を作り、数値計算プログラム生成システムが生成する数値計算アルゴリズムを増やし、数値計算プログラムを第2の記憶装置に生成する手順をコンピュータに実行させることを特徴とする数値計算プログラム生成プログラム。The problem definition information and program format information relating to the numerical calculation algorithm are input from the first storage device, and the numerical calculation algorithm of the numerical calculation program to be generated is generated by expressing the numerical calculation algorithm in a sequence of pseudo-codes. A pseudo-code sequence corresponding to a new numerical calculation algorithm is created using the pseudo-code that has been set, the numerical calculation algorithm generated by the numerical calculation program generation system is increased, and the numerical calculation program is generated in the second storage device. A program for generating a numerical calculation program, which causes a computer to execute a procedure for performing the calculation. 前記第1の記憶装置に入力されたプログラム様式情報の指定に従って各疑似コードに対応している様式別テンプレートプログラム情報を選択して数値計算プログラムを生成することにより、同じ疑似コードの順序列から複数のプログラム様式情報の組み合わせの数値計算プログラムを前記第2の記憶装置に生成する手順をコンピュータに実行させることを特徴とする請求項7記載の数値計算プログラム生成プログラム。By selecting the style-specific template program information corresponding to each pseudo code and generating a numerical calculation program in accordance with the specification of the program format information input to the first storage device, a plurality of sequence codes of the same pseudo code are generated. 8. The computer program according to claim 7, wherein the computer is caused to execute a procedure for generating a numerical calculation program of the combination of the program format information in the second storage device. 前記第1の入力装置に入力された問題定義情報から生成された構文解析情報に基づき、問題定義情報で指定されている各数値計算アルゴリズムのそれぞれに対し、そのアルゴリズムを表現している疑似コードの順序集合データを第3の記憶装置に格納されるアルゴリズム情報から呼び出し、さらに、疑似コードごとにプログラム様式情報で指定された様式に従って、各疑似コードに対応しているプログラム生成のための様式別テンプレートプログラム情報を第4の記憶装置から呼び出し、すべての擬似コードに対し第5の記憶装置に格納される計算式情報とともに各数値計算アルゴリズムのプログラム部品を生成し、数値計算プログラムを前記第2の記憶装置に生成する手順をコンピュータに実行させることを特徴とする請求項8記載の数値計算プログラム生成プログラム。Based on syntax analysis information generated from the problem definition information input to the first input device, for each of the numerical calculation algorithms specified in the problem definition information, a pseudo code expressing the algorithm is provided. An ordered set data is called from the algorithm information stored in the third storage device, and further, a format-specific template for generating a program corresponding to each pseudo code in accordance with the format specified by the program format information for each pseudo code The program information is called from the fourth storage device, and program parts of each numerical calculation algorithm are generated together with the calculation formula information stored in the fifth storage device for all the pseudo codes, and the numerical calculation program is stored in the second storage device. 9. The numerical value according to claim 8, wherein the computer is caused to execute a procedure for generating the data. Calculation program generation program.
JP2002249462A 2002-08-28 2002-08-28 Numerical calculation program generation system, numerical calculation program generation method, and numerical calculation program generation program Withdrawn JP2004086760A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002249462A JP2004086760A (en) 2002-08-28 2002-08-28 Numerical calculation program generation system, numerical calculation program generation method, and numerical calculation program generation program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002249462A JP2004086760A (en) 2002-08-28 2002-08-28 Numerical calculation program generation system, numerical calculation program generation method, and numerical calculation program generation program

Publications (1)

Publication Number Publication Date
JP2004086760A true JP2004086760A (en) 2004-03-18

Family

ID=32056567

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002249462A Withdrawn JP2004086760A (en) 2002-08-28 2002-08-28 Numerical calculation program generation system, numerical calculation program generation method, and numerical calculation program generation program

Country Status (1)

Country Link
JP (1) JP2004086760A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009003555A (en) * 2007-06-19 2009-01-08 Japan Science & Technology Agency Arithmetic processing system, arithmetic processing method, user program system, library program system, program and computer-readable recording medium recording program

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001296996A (en) * 2000-04-12 2001-10-26 Nec Corp Automatic generating device of component and expressing method

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001296996A (en) * 2000-04-12 2001-10-26 Nec Corp Automatic generating device of component and expressing method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009003555A (en) * 2007-06-19 2009-01-08 Japan Science & Technology Agency Arithmetic processing system, arithmetic processing method, user program system, library program system, program and computer-readable recording medium recording program

Similar Documents

Publication Publication Date Title
JP4482563B2 (en) Simplified data signal support for diagramming environment languages
US7882462B2 (en) Hardware definition language generation for frame-based processing
JP2017220268A (en) Managing data queries
Sarjoughian et al. CoSMoS: a visual environment for component-based modeling, experimental design, and simulation
US8046202B1 (en) Generation of intermediate representations based on user specified elements in a graphical model that enable simulation, propagation and code generation
Bruneel et al. Dynamic data folding with parameterizable FPGA configurations
JPH01237726A (en) Automatic generating system for software specification
Lu et al. Model-based incremental conformance checking to enable interactive product configuration
EP4115301A1 (en) Generation of optimized logic from a schema
US7490312B1 (en) Partition-based incremental implementation flow for use with a programmable logic device
CN113268227A (en) Zero-code visualization software development platform and development method
JP2009181446A (en) Program generating device and block diagram generating apparatus
US11354463B1 (en) Systems and methods for generating code for computer-based physical models
JP7131277B2 (en) System migration support device, system migration support method and program
Lu et al. Zen-CC: An automated and incremental conformance checking solution to support interactive product configuration
JP2004086760A (en) Numerical calculation program generation system, numerical calculation program generation method, and numerical calculation program generation program
Valderas et al. From web requirements to navigational design–A transformational approach
Rönkkö Introduction to matrixpls
Duggan Input and output data analysis for system dynamics modelling using the tidyverse libraries of R
JP5275087B2 (en) Program generating apparatus and block diagram generating apparatus
Saeedloei et al. Synthesizing clock-efficient timed automata
JP6802109B2 (en) Software specification analyzer and software specification analysis method
US20090106738A1 (en) Methods, systems, and computer program products for real time configuration and analysis of network based algorithmic service objectives
JP2001188673A (en) Software reuse assisting device
Tang et al. Matrix-Based Computational Concept Design with Ant Colony Optimization

Legal Events

Date Code Title Description
RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20050308

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050715

RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20070115

RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20080606

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080909

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20081107

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20081209

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090209

A911 Transfer to examiner for re-examination before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20090213

A912 Re-examination (zenchi) completed and case transferred to appeal board

Free format text: JAPANESE INTERMEDIATE CODE: A912

Effective date: 20090306

RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20090508

A761 Written withdrawal of application

Free format text: JAPANESE INTERMEDIATE CODE: A761

Effective date: 20100419