JP3027388B2 - Program code generation method - Google Patents
Program code generation methodInfo
- Publication number
- JP3027388B2 JP3027388B2 JP7159890A JP7159890A JP3027388B2 JP 3027388 B2 JP3027388 B2 JP 3027388B2 JP 7159890 A JP7159890 A JP 7159890A JP 7159890 A JP7159890 A JP 7159890A JP 3027388 B2 JP3027388 B2 JP 3027388B2
- Authority
- JP
- Japan
- Prior art keywords
- area
- index table
- program code
- calculation
- grid
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Lifetime
Links
Landscapes
- Devices For Executing Special Programs (AREA)
- Stored Programmes (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Complex Calculations (AREA)
Description
【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、プログラムコード生成方法に関し、更に詳
しくは、物理現象の数値シミュレーションを行う数値計
算プログラムをベクトル計算機に適した形式で自動生成
するプログラムコード生成方法に関するものである。Description: BACKGROUND OF THE INVENTION The present invention relates to a program code generation method, and more particularly, to a program for automatically generating a numerical calculation program for performing a numerical simulation of a physical phenomenon in a format suitable for a vector computer. It relates to a code generation method.
従来、数値計算プログラムは、物理現象が起っている
領域に対して、領域内の物理現象の数値シミュレーショ
ンを行う場合に利用される。この種の数値計算プログラ
ムを自動生成するプログラムコード生成方法では、物理
現象を解析する領域の形状,該領域を格子状に分割して
領域内に解析点とする格子点を設定する格子分割情報,
領域内の物理現象を表現する偏微分方程式,および領域
の境界条件からなる領域解析条件を入力し、領域を格子
状に分割して領域内に解析点とする格子点を設定し、領
域内の格子点に対して解析を行う離散式の計算を全ての
格子点で行うプログラムコードを生成する。この場合、
解析する領域を小領域に分割し、その小領域のインデク
ス範囲から計算順序の制御を行う計算ループを生成す
る。解析対象の領域が2方向以上にインデクス範囲を持
つ場合には、各々のインデクス範囲の各々の方向の次元
の数に対応して、計算順序を制御するための多重の離散
式計算ループが生成され、各々の格子点の離散式の計算
を行うプログラムコードが自動生成される。2. Description of the Related Art Conventionally, a numerical calculation program is used to perform a numerical simulation of a physical phenomenon in a region where the physical phenomenon occurs. In a program code generation method for automatically generating a numerical calculation program of this type, a shape of an area for analyzing a physical phenomenon, grid division information for setting the grid points to be analyzed in the area by dividing the area into a grid,
A partial differential equation expressing the physical phenomena in the region and a region analysis condition consisting of the boundary conditions of the region are input, and the region is divided into a grid and grid points are set as analysis points in the region. Generates a program code for performing calculation of a discrete expression for performing analysis on grid points at all grid points. in this case,
The region to be analyzed is divided into small regions, and a calculation loop for controlling the calculation order is generated from the index range of the small region. If the region to be analyzed has an index range in two or more directions, multiple discrete formula calculation loops for controlling the calculation order are generated corresponding to the number of dimensions in each direction of each index range. , A program code for calculating the discrete expression of each grid point is automatically generated.
ところで、上述した従来の技術のプログラムコード生
成方法では、例えば、次に示すような問題点がある。す
なわち、 第1の問題点は、領域の形状,境界条件の情報によっ
て分割した各小領域に対して、離散式計算のための計算
ループを自動生成する場合、小領域のインデクス範囲の
各方向の次元数分の多重の計算ループが、計算順序の制
御を行うために生成される。このため、多重の計算ルー
プにおける最大ループ長が、小領域の一辺の分割数とな
る。したがって、このように生成された数値計算プログ
ラムでは、問題の規模に比べて、ベクトル化して処理で
きるループ長が短かく、ベクトル計算機による処理の高
速化の妨げとなっている。Incidentally, the above-described conventional method of generating a program code has, for example, the following problems. That is, the first problem is that when a calculation loop for a discrete expression calculation is automatically generated for each small area divided based on information on the shape and boundary conditions of the area, the index range in each direction of the small area index range is changed. Multiple calculation loops for the number of dimensions are generated to control the calculation order. Therefore, the maximum loop length in the multiple calculation loops is the number of divisions of one side of the small area. Therefore, in the numerical calculation program generated in this way, the loop length that can be vectorized and processed is shorter than the scale of the problem, which hinders the speeding up of the processing by the vector computer.
第2の問題点は、各小領域に対応する離散式の情報か
ら、同じ離散式を持つ小領域同志は統合して計算を行う
プログラムを自動生成することができるが、それぞれの
小領域毎に多重の計算ループのプログラムが生成される
ため、計算順序の制御を行うインデクスの次元数および
各方向のインデクス範囲を合わせる必要がある。この場
合、統合後の領域形状が矩形になる場合しか統合が許容
されていない。したがって、領域形状が矩形でない場
合、同じ離散式の計算ループの複数組が生成されること
になり、生成されたプログラムコードが冗長なものとな
っている。The second problem is that, from information of discrete equations corresponding to each small area, a program that integrates small areas having the same discrete equation and performs calculation can be automatically generated. Since a program for a multiple calculation loop is generated, it is necessary to match the number of dimensions of the index for controlling the calculation order and the index range in each direction. In this case, integration is permitted only when the area shape after integration is rectangular. Therefore, if the region shape is not rectangular, a plurality of sets of the same discrete calculation loop are generated, and the generated program code is redundant.
本発明は、上記問題点を解決するためになされたもの
である。The present invention has been made to solve the above problems.
本発明の目的は、離散式の計算ループを一重化して、
計算ループ長を長くし、ベクトル計算機向きに効率のよ
いプログラムコードを生成するプログラムコード生成方
法を提供することにある。An object of the present invention is to unify a discrete calculation loop,
It is an object of the present invention to provide a program code generating method for increasing a calculation loop length and generating an efficient program code for a vector computer.
上記目的を達成するため、本発明のプログラムコード
生成方法は、物理現象を解析する領域の形状,該領域を
格子状に分割して領域内に解析点とする格子点を設定す
る格子分割情報,領域内の物理現象を表現する偏微分方
程式,および領域の境界条件からなる領域解析条件を入
力し、領域を領域解析条件が同じとなる小領域に分割
し、分割した小領域の格子点に対して離散式の計算順序
を指定するインデクステーブルを作成し、各々の格子点
に対する解析を行う離散式の計算を行う計算順序の流れ
を前記インデクステーブルを用いて制御する一重の計算
ループのプログラムコードを生成することを特徴とす
る。In order to achieve the above object, a program code generating method according to the present invention comprises: a shape of an area for analyzing a physical phenomenon; grid division information for setting the grid points to be analyzed in the area by dividing the area into a grid; Input the partial differential equation expressing the physical phenomena in the area and the area analysis conditions consisting of the boundary conditions of the area, divide the area into small areas with the same area analysis conditions, and Create an index table that specifies the order of calculation of the discrete expression, the program code of a single calculation loop that uses the index table to control the flow of the calculation order that performs the calculation of the discrete expression for analyzing each grid point It is characterized by generating.
これによれば、プログラムコード生成方法において
は、まず、物理現象を解析する領域の形状,該領域を格
子状に分割して領域内に解析点とする格子点を設定する
格子分割情報,領域内の物理現象を表現する偏微分方程
式,および領域の境界条件からなる領域解析条件を入力
する。この領域解析条件により、解析対象の領域を解析
する条件が同じとなる小領域に分割する。次に、分割し
た小領域の格子点に対して離散式の計算順序を指定する
インデクステーブルを作成する。そして、各々の格子点
に対する解析を行う離散式の計算を行う計算順序の流れ
を前記インデクステーブルを用いて制御する一重の計算
ループのプログラムコードを生成する。これにより、離
散式の計算ループでは、各々の小領域の離散式を計算す
る順序が常にインデクステーブルの参照により指示され
るので、小領域の次元数に依存しないで各々の格子点の
計算順序を制御できる。このため、離散式の計算ループ
は、常に一重の計算ループでの生成可能になる。したが
って、生成されるプログラムコードは、計算ループ長が
長くなり、計算順序を変更する制御が少なくなり、パイ
プライン制御によるベクトル計算機に適した数値計算用
のプログラムコードとなっている。According to this, in the method of generating a program code, first, the shape of an area for analyzing a physical phenomenon, grid division information for dividing the area into a grid and setting grid points to be analyzed points in the area, Input the partial differential equations expressing the physical phenomena of and the region analysis conditions consisting of the boundary conditions of the regions. According to the area analysis conditions, the area to be analyzed is divided into small areas having the same analysis conditions. Next, an index table is created that specifies the calculation order of the discrete equations for the grid points of the divided small areas. Then, a program code of a single calculation loop for controlling a flow of a calculation order for performing a calculation of a discrete expression for performing an analysis on each grid point by using the index table is generated. Thus, in the discrete expression calculation loop, the order of calculating the discrete expression of each small area is always instructed by referring to the index table, so that the calculation order of each grid point is independent of the number of dimensions of the small area. Can control. For this reason, a discrete calculation loop can always be generated by a single calculation loop. Therefore, the generated program code has a longer calculation loop length, less control for changing the calculation order, and is a program code for numerical calculation suitable for a vector computer by pipeline control.
すなわち、ここで特徴的なことは、解析対象の領域に
対して、領誠の各方向のインデクス範囲を求め、領域の
離散式を計算する計算順序を指示するインデクステーブ
ルを作成し、このインデクステーブルにより計算順序を
制御することにより一重の計算ループで計算を行うプロ
グラムコードを生成する。That is, what is characteristic here is that, for the analysis target area, an index range in each direction of the region is determined, and an index table indicating the calculation order for calculating the discrete expression of the area is created. To generate a program code for performing calculations in a single calculation loop by controlling the calculation order.
また、インデクステーブルは、離散式を同じくする格
子点を含んで分割した小領域に対してそれぞれに作成す
るので、インデクステーブルの統合により離散式が等し
い複数の小領域をまとめ、一重の計算ループとしてプロ
グラムコードが生成できる。これにより、更に、計算ル
ープ長が長くすることができ、パイプライン制御による
ベクトル計算機に適したプログラムコードの生成ができ
る。In addition, since the index table is created for each of the divided small areas including the grid points having the same discrete formula, a plurality of small areas having the same discrete formula are collected by integrating the index tables, and a single calculation loop is formed. Program code can be generated. As a result, the length of the calculation loop can be further increased, and a program code suitable for a vector computer can be generated by pipeline control.
このように、小領域の離散式を計算する順序を示すイ
ンデクステーブルを作成し、インデクステーブルを用い
て離散式の計算順序を制御する計算ループを生成するの
で、小領域の次元数に依存しないで、常に一重の計算ル
ープでのプログラムコードの生成が可能になる。これに
より、計算ループのループ長は、従来、領域の辺の分割
数であったものが、小領域の格子点数になるため、ルー
プ長が長くなり、計算順序の変更の制御が少なくなり、
パイプライン制御によるベクトル計算機上で生成したプ
ログラムの実行速度が高速化できる。As described above, since the index table indicating the order of calculating the discrete expressions of the small area is created and the calculation loop for controlling the calculation order of the discrete expressions using the index table is generated, the index does not depend on the number of dimensions of the small area. Thus, it is possible to always generate a program code in a single calculation loop. Thereby, the loop length of the calculation loop is conventionally the number of divisions of the side of the region, but becomes the number of grid points of the small region, so the loop length becomes longer, and the control of the change of the calculation order is reduced,
The execution speed of a program generated on a vector computer by pipeline control can be increased.
また、同じ離散式が成り立つ小領域は、その各々の小
領域が持つインデクステーブルをまとめて1つのインデ
クステーブルを作成し、1つの離散式ループにして、プ
ラグラムコードを生成するので、同じ離散式の計算ルー
プが複数生成されることなく、プログラムが冗長になら
ないプラグラムコードが生成できる。In addition, in the small area where the same discrete expression holds, the index table of each small area is put together to create one index table, and a discrete loop is used to generate a program code. A program code that does not make a program redundant can be generated without generating a plurality of calculation loops.
以下、本発明の一実施例を図面を用いて具体的に説明
する。Hereinafter, an embodiment of the present invention will be specifically described with reference to the drawings.
第1図は、本発明のプログラムコード生成方法を一実
施態様で実施するプログラムコード生成システムの要部
の構成を示すブロック図である。FIG. 1 is a block diagram showing a configuration of a main part of a program code generation system for implementing a program code generation method according to an embodiment of the present invention.
第1図において、10はプログラムコード生成システム
である。プログラムコード生成システム10は、解析領域
の領域形状,格子分割情報,偏微分方程式,および境界
条件からなる領域解析条件の入力データ11を入力し、離
散式計算プログラム12を生成して出力するプログラムコ
ード自動生成処理システムとなっている。In FIG. 1, reference numeral 10 denotes a program code generation system. A program code generation system 10 receives input data 11 of an area analysis condition including an area shape of an analysis area, grid division information, partial differential equations, and boundary conditions, generates a discrete equation calculation program 12, and outputs the generated program code. It is an automatic generation processing system.
プログラムコード生成システム10は、領域分割処理部
13と、インデクステーブル作成処理部14と、プログラム
生成処理部18とから構成される。領域分割処理部13は、
解析領域の領域形状,格子分割情報,偏微分方程式,お
よび境界条件の領域解析条件から、領域を同じ離散式で
解析できる小領域に分割し領域分割情報19を生成する。
インデクステーブル作成処理部14では、領域分割情報19
から各格子点の離散式を計算する順序を示すインデクス
テーブルを生成する。また、プログラム生成処理部18
は、インデクステーブル作成処理部14で生成されたイン
デクステーブルと領域解析条件の入力データ11から離散
式計算プログラム12を生成する。The program code generation system 10 includes a region division processing unit.
13, an index table creation processing unit 14, and a program generation processing unit 18. The area division processing unit 13
The region is divided into small regions that can be analyzed by the same discrete formula based on the region shape of the analysis region, the lattice division information, the partial differential equation, and the region analysis conditions of the boundary condition, and the region division information 19 is generated.
In the index table creation processing unit 14, the area division information 19
, An index table indicating the order in which the discrete expression of each grid point is calculated is generated. Also, the program generation processing unit 18
Generates a discrete expression calculation program 12 from the index table generated by the index table creation processing unit 14 and the input data 11 of the area analysis conditions.
インデクステーブル生成処理部14は、各々の小領域に
対するインデクステーブルを生成するインデクステーブ
ル生成処理部15と、同じ離散式を持つ複数の小領域を検
出する判定処理部16と、同じ離散式を持つ複数の小領域
が検出された場合に、当該小領域のインデクステーブル
を1つにまとめるインデクステーブル統合処理部17から
構成される。The index table generation processing unit 14 includes: an index table generation processing unit 15 that generates an index table for each small area; a determination processing unit 16 that detects a plurality of small areas having the same discrete formula; When the small area is detected, an index table integration processing unit 17 that combines the index tables of the small area into one is configured.
このように構成されている処理部の動作を、具体例に
より説明する。The operation of the processing unit configured as described above will be described using a specific example.
第2a図,第2b図,および第2c図は、領域解析条件の入
力データの一例を示す図である。2a, 2b, and 2c are diagrams showing examples of input data of the area analysis condition.
解析する対象の物理現象が起こっている領域に対し
て、その領域形状と、それをどのように格子分割するか
を示す格子分割情報と、物理現象を表わす偏微分方程式
と、境界条件とを入力データとして入力する。この例で
は、第2a図に示すように、流体が左から右に流れている
領域20に対して、解析対象となる矩形ABCDの領域形状21
と、格子点24および格子線25などの格子分割情報とが入
力される。この領域の物理現象を表わす離散式の偏微分
方程式としては、例えば、流体のx方向の速度uと、流
体のy方向の速度vと、圧力Pと、レイノズル数Reとす
るとき、非圧縮性の粘性流体の運動現象を示すナビエ・
ストークス方程式が、第2b図に示すように、入力データ
の偏微分方程式22として入力される。また、この場合の
境界条件としては、第2c図に示すように、領域ABCDの辺
ABにおいては、流体のx方向の速度u=1.0とy方向の
速度v=0.0との境界条件が与えられ、また、辺ADおよ
び辺BCにおいては、それぞれx方向の速度u=0.0とy
方向の速度v=0.0との境界条件が与えられる。領域ABC
Dの辺DCにおいては、流体のx方向の速度uおよびy方
向の速度vのそれぞれの変化分(∂u/∂x=0.0,∂v/∂
x=0.0)の境界条件が与えられる。For the area where the physical phenomenon to be analyzed is occurring, input the area shape, grid division information indicating how to divide the area, partial differential equations representing the physical phenomenon, and boundary conditions. Input as data. In this example, as shown in FIG. 2a, a region 20 where a fluid is flowing from left to right corresponds to a region shape 21 of a rectangular ABCD to be analyzed.
And grid division information such as grid points 24 and grid lines 25 are input. The discrete partial differential equations representing the physical phenomena in this region include, for example, the velocity u of the fluid in the x direction, the velocity v of the fluid in the y direction, the pressure P, and the Reynolds number Re. Navier showing the motion phenomenon of viscous fluid
The Stokes equation is input as the partial differential equation 22 of the input data, as shown in FIG. 2b. The boundary condition in this case is, as shown in FIG.
In AB, a boundary condition between the velocity u = 1.0 in the x direction of the fluid and the velocity v = 0.0 in the y direction is given. On the sides AD and BC, the velocities u = 0.0 and y in the x direction are given, respectively.
A boundary condition with a velocity in the direction v = 0.0 is given. Area ABC
On the side DC of D, respective changes in the velocity u in the x direction u and the velocity v in the y direction (∂u / ∂x = 0.0, ∂v / ∂
x = 0.0).
このように与えられた領域解析条件の入力データによ
り、領域分割処理部13が、領域を同じ離散式で解析でき
る小領域に分割し、領域分割情報を生成する。Based on the input data of the area analysis conditions given in this way, the area division processing unit 13 divides the area into small areas that can be analyzed by the same discrete formula, and generates area division information.
第3図は、解析対象領域を領域解析条件により小領域
に分割した分割例を示す図である。ここでの解析対象領
域は、第3図に示すように、9個の小領域に分割され
る。すなわち、境界AB上の境界条件を取り込む小領域3
9,境界BC上の境界条件を取り込む小領域33,境界DC上の
境界条件を取り込む小領域35,境界AD上の境界条件を取
り込む小領域37,境界ABおよび境界BCの境界上の境界条
件を取り込む小領域32,境界BCおよび境界CDの境界上の
境界条件を取り込む小領域34,境界CDおよび境界ADの境
界上の境界条件を取り込む小領域36,境界ABおよび境界A
Dの境界上の境界条件を取り込む小領域38,そして、どの
境界条件も取り込まない小領域31の各々の小領域に分け
たものである。領域分割情報19としては、この9個の小
領域のインデクス範囲,どの方向に境界を接しているか
を示す境界情報がテーブルデータにより格納される。FIG. 3 is a diagram showing a division example in which the analysis target region is divided into small regions according to region analysis conditions. The analysis target area here is divided into nine small areas as shown in FIG. That is, the small area 3 that captures the boundary conditions on the boundary AB
9, A small area 33 that captures the boundary conditions on the boundary BC, a small area 35 that captures the boundary conditions on the boundary DC, a small area 37 that captures the boundary conditions on the boundary AD, and a boundary condition on the boundary between the boundary AB and the boundary BC. The small area 32 to take in, the small area 34 to take in the boundary condition on the boundary between the boundary BC and the boundary CD, the small area 36 to take in the boundary condition on the boundary between the boundary CD and the boundary AD, the boundary AB and the boundary A
This is divided into small areas 38 for taking in boundary conditions on the boundary of D and small areas 31 not taking in any boundary conditions. As the area division information 19, the index range of these nine small areas and boundary information indicating in which direction the boundaries are in contact are stored as table data.
領域分割情報19のテーブルデータは、各々のの小領域
について、2方向以上にインデクス範囲を持つ場合に
は、小領域内に存在する全ての格子点の各方向インデク
スの組合せを格納したインデクステーブルが生成され
る。If the table data of the area division information 19 has an index range in two or more directions for each small area, an index table that stores a combination of indexes in each direction of all grid points existing in the small area is Generated.
第4図は、第3図に示した境界条件を取り込まない小
領域31(斜線部分)に対応して生成されたインデクステ
ーブルの例を示す図である。この小領域31は、x方向お
よびy方向の2方向にインデクス範囲を持つため、第4
図に示すように、x方向インデクスIおよびy方向イン
デクスJにより当該両域内に存在する全ての格子点の各
方向インデクスの組合せが格納されたインデクステーブ
ル41となっている。ここでは、このインデクステーブル
41に格納した各方向インデクスの組合せの個数を離散式
の計算ループのループ範囲とし、一重の離散式計算ルー
プのプログラムコードが自動生成される。FIG. 4 is a diagram showing an example of an index table generated corresponding to the small area 31 (shaded area) not taking in the boundary conditions shown in FIG. Since this small area 31 has index ranges in two directions of the x direction and the y direction, the fourth area
As shown in the figure, an index table 41 is stored in which the combinations of the respective directional indexes of all the grid points existing in both areas are stored by the x-direction index I and the y-direction index J. Here, this index table
The number of combinations of each direction index stored in 41 is set as the loop range of the discrete calculation loop, and the program code of the single discrete calculation loop is automatically generated.
第5図は、インデクステーブルを用いて計算順序の制
御を行う一重の離散式計算ループとして生成されたプロ
グラムコードの一例を示す図である。第5図のプログラ
ムコードおいて、51は離散式計算ループを構成するDOル
ープのプログラムコードであり、52は各方向のインデク
スデータが格納されているインデクステーブルITBLから
各方向のインデクスを検出する処理を行うプログラムコ
ードである。また、53は偏微分方程式の離散式のプログ
ラムコードである。この偏微分方程式の離散式のプログ
ラムコード53の部分は、周知の自動プログラム生成手法
により生成されたプログラムコードが挿入される。この
内容は、ここでは特に関係しないので、詳細には示して
いない。FIG. 5 is a diagram showing an example of a program code generated as a single discrete-type calculation loop for controlling the calculation order using an index table. In the program code of FIG. 5, reference numeral 51 denotes a program code of a DO loop constituting a discrete formula calculation loop, and 52 denotes a process of detecting an index in each direction from an index table ITBL storing index data in each direction. This is the program code that performs 53 is a program code of a discrete equation of the partial differential equation. A program code generated by a well-known automatic program generation method is inserted into a part of the program code 53 of the discrete equation of the partial differential equation. This content is not shown here in detail because it is not particularly relevant here.
この例に示すように、解析対象の領域に対して、境界
条件が同じとなる小領域に分割し、各々の小領域に対し
て小領域内の各格子点の各方向のインデクスを指示する
インデクステーブルを生成し、当該インデクステーブル
を用いて一重の計算ループとなるプログラムコードを自
動生成する。これにより、複数方向にインデクス範囲を
持つ小領域に対する離散式計算ループを、格子点分の一
重の計算ループとしてプログラムコードを生成できるの
で、計算順序を変更する処理を少なくし、1つの計算ル
ープ長を長くできる。このため、生成プログラムは、ベ
クトル計算機上での実行性能が向上する。As shown in this example, the area to be analyzed is divided into small areas having the same boundary conditions, and an index indicating the index of each grid point in each direction in the small area for each small area A table is generated, and a program code that forms a single calculation loop is automatically generated using the index table. This makes it possible to generate a program code as a single calculation loop for a grid point with a discrete calculation loop for a small area having an index range in a plurality of directions, thereby reducing the processing for changing the calculation order and reducing the length of one calculation loop. Can be lengthened. Therefore, the execution performance of the generation program on the vector computer is improved.
次に、解析対象の領域形状が矩形の形状でない場合の
応用例について説明する。Next, an application example in a case where the region shape to be analyzed is not a rectangular shape will be described.
ところで、物理現象が起っている領域の形状が、第6
図に示すような形状である場合、領域の境界条件が領域
の各辺AB,BC,CD,DE,EF,AFの上で与えられることにな
る。この場合、解析領域60は、領域の各辺の境界条件に
よる領域分割処理部13の処理において、第7図に示すよ
うに、14個の小領域(61,62,…,74)に分割される。こ
のように分割された各領域の分割情報は、領域分割情報
19として、テーブルデータが作成され格納される。この
14個の小領域のうち、小領域61と小領域62(斜線部分)
は、x方向とy方向との両方向にインデクス範囲を持つ
ため、インデクステーブル作成処理15により、小領域62
に対しては、第8a図に示すようなインデクステーブル81
が作成され、また、小領域61に対しては、第8b図に示す
ようなインデクステーブル82が作成される。ここで更
に、領域分割情報19の各々の小領域のテーブルデータの
各領域情報から、この2つの小領域61,62が接している
境界の境界条件を判定する。この場合、小領域61および
小領域62は、辺AB,BC,CD,DE,EF,AFのどの辺の境界とも
接していない判定されるので、対応する離散式が等しい
と判定され、インデクステーブル統合処理16を行う。こ
のインデクステーブル統合処理16では、小領域62および
小領域61に対応して作成されているインデクステーブル
81およびインデクステーブル82のインデクステーブルを
統合して、第9図に示すような1つの統合インデクステ
ーブル91を生成する。そして、この統合インデクステー
ブル91を用いて、例えば、第5図に示したような1つの
一重の計算ループによるプログラムコードを生成する。By the way, the shape of the region where the physical phenomenon occurs is the sixth shape.
In the case of the shape as shown in the figure, the boundary condition of the region is given on each side AB, BC, CD, DE, EF, AF of the region. In this case, the analysis area 60 is divided into 14 small areas (61, 62,..., 74) as shown in FIG. 7 in the processing of the area division processing unit 13 based on the boundary conditions of each side of the area. You. The division information of each of the divided regions is the region division information.
As 19, table data is created and stored. this
Of the 14 small areas, small area 61 and small area 62 (shaded area)
Has an index range in both the x-direction and the y-direction.
For the index table 81 as shown in FIG. 8a.
Is created, and for the small area 61, an index table 82 as shown in FIG. 8b is created. Here, the boundary condition of the boundary where the two small regions 61 and 62 are in contact is determined from each region information of the table data of each small region of the region division information 19. In this case, since the small area 61 and the small area 62 are determined not to be in contact with any of the boundaries of the sides AB, BC, CD, DE, EF, and AF, the corresponding discrete expressions are determined to be equal, and the index table is determined. The integration processing 16 is performed. In the index table integration process 16, the index table created for the small area 62 and the small area 61 is created.
The index table 81 and the index table 82 are integrated to generate one integrated index table 91 as shown in FIG. Then, by using the integrated index table 91, for example, a program code by one single calculation loop as shown in FIG. 5 is generated.
このようにして、同じ離散式を持つ複数の小領域のイ
ンデクステーブルを統合して、離散式計算ループを1つ
の計算ループにまとめることが可能となる。この場合、
小領域の離散式を計算する順序を示すインデクステーブ
ルがまとめられ、まとめられたインデクステーブルを用
いて離散式の計算順序を制御する計算ループを生成する
ので、小領域の次元数に依存しないで、常に一重の計算
ループでのプログラムコードの生成が可能になる。これ
により、計算ループのループ長は、従来、領域の辺の分
割数であったものが、小領域の格子点数になるため、ル
ープ長が長くなり、計算順序の変更の制御が少なくな
り、例えば、パイプライン制御によるベクトル計算機上
で生成されたプログラムの実行速度が高速化できる。ま
た、境界条件により同じ離散式が成り立つ小領域は、そ
の各々の小領域が持つインデクステーブルをまとめて1
つのインデクステーブルを作成し、1つの離散式ループ
にして、プラグラムコードを生成するので、同じ離散式
の計算ループが複数生成されることなく、プログラムが
冗長にならないプラグラムコードが生成できる。In this way, it is possible to integrate the index tables of a plurality of small areas having the same discrete formula and to combine the discrete formula calculation loop into one calculation loop. in this case,
An index table indicating the order of calculating the discrete expressions of the small area is summarized, and a calculation loop for controlling the calculation order of the discrete expressions is generated using the combined index table, so that it does not depend on the number of dimensions of the small area, It is always possible to generate a program code in a single calculation loop. Thereby, the loop length of the calculation loop is conventionally the number of divisions of the side of the region, but becomes the number of grid points of the small region, so the loop length becomes longer, and the control of the change of the calculation order is reduced. In addition, the execution speed of a program generated on a vector computer by pipeline control can be increased. In addition, a small area in which the same discrete expression is satisfied by the boundary condition is obtained by combining the index tables of the respective small areas into one.
Since one index table is created, and one discrete loop is used to generate a program code, a program code that does not make the program redundant can be generated without generating a plurality of calculation loops of the same discrete formula.
以上、本発明を実施例にもとづき具体的に説明した
が、本発明は前記実施例に限定されるものではなく、そ
の要旨を逸脱しない範囲において種々変更可能であるこ
とは言うまでもない。As described above, the present invention has been specifically described based on the embodiments. However, it is needless to say that the present invention is not limited to the above-described embodiments, and can be variously modified without departing from the gist thereof.
以上、説明したように、本発明によれば、解析対象の
領域に対して、領域の各方向のインデクス範囲を求め、
領域の離散式を計算する計算順序を指示するインデック
テーブルを作成し、このインデクステーブルにより計算
順序を制御することにより一重の計算ループで計算を行
うプログラムコードを生成する。インデクステーブル
は、離散式を同じくする格子点を含んで分割した小領域
に対してそれぞれに作成するので、離散式が等しい複数
の小領域をインデクステーブルの統合によりまとめ、一
重の計算ループとしてプログラムコードを生成する。こ
れにより、更に、計算ループ長が長くすることができ、
パイプライン制御によるベクトル計算機に適したプログ
ラムコードの生成が可能となる。As described above, according to the present invention, for the analysis target region, the index range in each direction of the region is obtained,
An index table indicating the calculation order for calculating the discrete expression of the region is created, and a program code for performing the calculation in a single calculation loop is generated by controlling the calculation order using the index table. Since the index table is created for each of the divided small regions including the grid points having the same discrete formula, a plurality of small regions having the same discrete formula are integrated by integrating the index tables, and the program code is formed as a single calculation loop. Generate Thereby, the calculation loop length can be further increased,
Program code suitable for a vector computer can be generated by pipeline control.
第1図は、本発明のプログラムコード生成方法を一実施
態様で実施するプログラムコード生成システムの要部の
構成を示すブロック図、 第2a図,第2b図,および第2c図は、領域解析条件の入力
データの一例を示す図、 第3図は、解析対象領域を領域解析条件により小領域に
分割した分割例を示す図、 第4図は、第3図に示した境界条件を取り込まない小領
域(斜線部分)に対応して生成されたインデクステーブ
ルの例を示す図、 第5図は、インデクステーブルを用いて計算順序の制御
を行う一重の離散式計算ループとして生成されたプログ
ラムコードの一例を示す図、 第6図は、領域解析条件として入力する領域形状の他の
例を示す図、 第7図は、第6図の領域形状を領域解析条件により小領
域に分割した分割例を示す図、 第8a図および第8b図は、第7図の2つの小領域に対応し
て、それぞれに生成されたインデクステーブルの例を示
す図、 第9図は、小領域を統合した統合インデクステーブルの
例を示す図である。 図中、10……プログラムコード生成システム、11……入
力データ、12……離散式計算プログラム、13……領域分
割処理部、14……インデクステーブル作成処理部、15…
…インデクステーブル生成処理部、16……判定処理部、
17……インデクステーブル統合処理部、18……プログラ
ム生成処理部、19……領域分割情報、31〜39,61〜74…
…分割した小領域、41,81,82……インデクステーブル、
91……統合インデクステーブル。FIG. 1 is a block diagram showing a configuration of a main part of a program code generation system for implementing a program code generation method according to an embodiment of the present invention. FIGS. 2a, 2b, and 2c show area analysis conditions. FIG. 3 is a diagram showing an example of division of an analysis target region into small regions according to region analysis conditions, and FIG. 4 is a diagram showing a small region which does not take in the boundary conditions shown in FIG. FIG. 5 is a diagram showing an example of an index table generated corresponding to a region (hatched portion). FIG. 5 is an example of a program code generated as a single discrete formula calculation loop for controlling the calculation order using the index table. FIG. 6 is a diagram showing another example of a region shape input as a region analysis condition. FIG. 7 is a diagram showing an example of dividing the region shape of FIG. 6 into small regions according to the region analysis condition. Figure, Figure 8a and Figure 8 Fig. b is a diagram showing an example of an index table generated for each of the two small regions in Fig. 7, and Fig. 9 is a diagram showing an example of an integrated index table in which the small regions are integrated. . In the figure, 10: a program code generation system, 11: input data, 12: a discrete expression calculation program, 13: a region division processing unit, 14: an index table creation processing unit, 15 ...
... Index table generation processing unit, 16 ... Judgment processing unit,
17: Index table integration processing unit, 18: Program generation processing unit, 19: Area division information, 31 to 39, 61 to 74
… Divided small area, 41,81,82 …… index table,
91 …… Integrated index table.
───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 昭62−208166(JP,A) 特開 昭62−212771(JP,A) 特開 平1−145723(JP,A) 特開 平1−307826(JP,A) 「Communications o f ACM」Vol.29,No.12 (1986−12)P.1196−1198 (58)調査した分野(Int.Cl.7,DB名) G06F 9/06,9/44 ──────────────────────────────────────────────────続 き Continuation of the front page (56) References JP-A-62-208166 (JP, A) JP-A-62-212771 (JP, A) JP-A-1-145723 (JP, A) JP-A-1 307826 (JP, A) "Communications of ACM" Vol. 29, No. 12 (1986-12) p. 1196-1198 (58) Field surveyed (Int. Cl. 7 , DB name) G06F 9/06, 9/44
Claims (2)
格子状に分割して領域内に解析点とする格子点を設定す
る格子分割情報、領域内の物理現象を表現する偏微分方
程式、および領域の境界条件からなる領域解析条件を入
力する入力手段と、インデックステーブル格納手段とを
備え、領域内の格子点の解析を行う離散式の計算を全て
の格子点に対して行うプログラムコードを生成するプロ
グラムコード生成システムにおけるプログラムコード生
成方法であって、 前記入力手段によって入力された領域解析条件を基にし
て、領域を領域解析条件が同じとなる小領域に分割する
第1のステップと、 分割した小領域の格子点に対して離散式の計算順序を指
定するインデクステーブルを生成し、前記インデックス
テーブル格納手段に格納する第2のステップと、 分割した各々の小領域に対して同じ離散式で格子点を解
析する計算を行える他の小領域が存在するか否かを検出
する第3のステップと、 同じ離散式で格子点を計算する小領域に対する前記イン
デックステーブル格納手段内の各々のインデックテーブ
ルを順序付けて1つのインデックテーブルに統合する第
4のステップと、 統合したインデックテーブルを用いて、各々の格子点の
解析を行う離散式の計算を行う計算順序の流れを制御す
る一重の計算ループのプログラムコードを生成する第5
のステップと を有することを特徴とするプログラムコード生成方法。1. A shape of an area for analyzing a physical phenomenon, grid division information for dividing the area into a grid and setting grid points to be analyzed points in the area, and a partial differential equation for expressing a physical phenomenon in the area And an input means for inputting an area analysis condition comprising a boundary condition of the area, and an index table storage means, and a program code for performing calculation of a discrete expression for analyzing grid points in the area for all grid points A program code generation method in a program code generation system that generates a region, based on a region analysis condition input by the input unit, dividing the region into small regions having the same region analysis condition; Generating an index table for designating the calculation order of the discrete expression for the grid points of the divided small areas, and storing the index table in the index table storage means; And a third step of detecting whether or not there is another small area in which calculation for analyzing a grid point can be performed with the same discrete expression for each divided small area. A fourth step of ordering each index table in the index table storage means for the small area to be calculated and integrating them into one index table; and a discrete expression for analyzing each grid point using the integrated index table. Generating a program code for a single calculation loop that controls the flow of the calculation sequence for calculating
And a program code generating method.
格子状に分割して領域内に解析点とする格子点を設定す
る格子分割情報、領域内の物理現象を表現する偏微分方
程式、および領域の境界条件からなる領域解析条件を基
にして、領域内の格子点の解析を行う離散式の計算を全
ての格子点に対して行うプログラムコードを生成するプ
ログラムコード生成システムであって、領域を領域解析
条件が同じとなる小領域に分割する領域分割手段と、分
割した小領域の各方向のインデクス範囲を求め、格子点
を解析する離散式を計算する計算順序のインデクステー
ブルを生成するインデクステーブル生成処理手段と、各
々の格子点に対する解析を行う離散式の計算を行う計算
順序の流れを前記インデクステーブルを用いて制御する
一重の計算ループのプログラムコードを生成するプログ
ラム生成処理手段とを備え、 前記インデクステーブル生成処理手段は、更に、解析す
る離散式が同じとなる小領域を検出する手段と、解析す
る離散式が同じとなる小領域のインデクステーブルを統
合するインデクス統合手段とを備えることを特徴とする
プログラムコード生成システム。2. A shape of an area for analyzing a physical phenomenon, grid division information for setting the grid point to be an analysis point in the area by dividing the area into a grid, and a partial differential equation for expressing a physical phenomenon in the area. And a program code generation system for generating a program code for performing calculation of a discrete expression for analyzing grid points in the area for all grid points based on an area analysis condition including a boundary condition of the area. , An area dividing means for dividing an area into small areas having the same area analysis condition, and an index table in a calculation order for calculating an index range in each direction of the divided small area and calculating a discrete expression for analyzing a grid point Index table generation processing means, and a single calculation loop for controlling a flow of a calculation order for calculating a discrete expression for performing an analysis for each grid point by using the index table A program generation processing means for generating a program code, wherein the index table generation processing means further includes means for detecting a small area in which the discrete expression to be analyzed is the same, and a small area in which the discrete expression to be analyzed is the same. A program code generation system, comprising: index integrating means for integrating index tables.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP7159890A JP3027388B2 (en) | 1990-03-20 | 1990-03-20 | Program code generation method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP7159890A JP3027388B2 (en) | 1990-03-20 | 1990-03-20 | Program code generation method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH03271863A JPH03271863A (en) | 1991-12-03 |
| JP3027388B2 true JP3027388B2 (en) | 2000-04-04 |
Family
ID=13465259
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP7159890A Expired - Lifetime JP3027388B2 (en) | 1990-03-20 | 1990-03-20 | Program code generation method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3027388B2 (en) |
-
1990
- 1990-03-20 JP JP7159890A patent/JP3027388B2/en not_active Expired - Lifetime
Non-Patent Citations (1)
| Title |
|---|
| 「Communications of ACM」Vol.29,No.12(1986−12)P.1196−1198 |
Also Published As
| Publication number | Publication date |
|---|---|
| JPH03271863A (en) | 1991-12-03 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US4841479A (en) | Method for preparing a simulation program | |
| CN109359349A (en) | Power plant steam turbine power house ventilation modular simulation calculation method and system | |
| JP3027388B2 (en) | Program code generation method | |
| JP3337608B2 (en) | Analysis simulation device | |
| Mir et al. | Analytic annealing for macrocell placement optimization | |
| JP3427566B2 (en) | Control program creation device | |
| TWI716127B (en) | Robot and system for generating path interpolation command thereof | |
| Santos et al. | Simulation based optimization package for periodic review Inventory Control | |
| JPH11219349A (en) | Fluid analysis device | |
| Mielke et al. | Modeling and optimum time performance for concurrent processing | |
| JP4219706B2 (en) | System LSI design support apparatus and design support method | |
| JP2902006B2 (en) | Information presentation device | |
| JP3144785B2 (en) | Signal delay time calculation method | |
| JP2911915B2 (en) | Wiring design method for integrated circuits | |
| JP2567985B2 (en) | Digital circuit path automatic selection method and digital circuit path automatic selection device | |
| JP4078666B2 (en) | Numerical analysis mesh generator | |
| JP2752853B2 (en) | Numerical simulation method for parallel computer | |
| JP2768302B2 (en) | Computational fluid analysis method using two types of time integration methods | |
| Zapletina | Solving the FPGA Routing Problem Using the Model of an Extended Mixed Routing Graph | |
| Vidwans et al. | Unified parallel algorithm for grid adaptation on a multiple-instruction multiple-data architecture | |
| Chheda | CAM, a computer-aided modelling program for systems dynamics models | |
| JP2612063B2 (en) | How to display mask layout data | |
| JP2815364B2 (en) | CAD equipment | |
| JPH0334349A (en) | Designing system for layout of integrated circuit | |
| Reinert et al. | Combining Divide-and-Conquer, the A*-Algorithm, and Successive Realignment Approaches to Speed Multiple Sequence Alignment. |