JP3686261B2 - Computer, program conversion device, and program recording medium - Google Patents
Computer, program conversion device, and program recording medium Download PDFInfo
- Publication number
- JP3686261B2 JP3686261B2 JP20495398A JP20495398A JP3686261B2 JP 3686261 B2 JP3686261 B2 JP 3686261B2 JP 20495398 A JP20495398 A JP 20495398A JP 20495398 A JP20495398 A JP 20495398A JP 3686261 B2 JP3686261 B2 JP 3686261B2
- Authority
- JP
- Japan
- Prior art keywords
- index
- calculation
- array
- work
- calculation formula
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Devices For Executing Special Programs (AREA)
Description
【0001】
【発明の属する技術分野】
本発明は、リストに配列されるインデックスの指すメモリバンクにアクセスすることで規定の算出式の計算処理を実行する計算機と、その計算処理を行うプログラムを生成するプログラム変換装置と、その計算機の実現に用いられるプログラムが格納されるプログラム記録媒体とに関し、特に、算出式の計算処理を高速に実行できるようにする計算機と、その計算処理を行うプログラムを生成するプログラム変換装置と、その計算機の実現に用いられるプログラムが格納されるプログラム記録媒体とに関する。
【0002】
科学技術計算では反復計算が多く現れる。ここでは、リスト参照によるメモリアクセスがネックとなり、十分な性能を発揮できない場合が多い。これは、一度アクセスされたメモリバンクは規定時間の間ビジー状態となることで、このバンク内のデータに対してアクセスできない状態となるからである。また、反復計算中に同一リストが再現する計算(回帰参照)では、ベクトル処理ができないために、ベクトル計算機での処理性能を大きく低下させることになる。これから、これらの問題点の解決を図る技術の構築が叫ばれている。
【0003】
【従来の技術】
リストに配列されるインデックスの指すメモリバンクにアクセスすることで規定の算出式の計算処理を実行することが行われている。
【0004】
この場合、従来では、リストの指定に従って、そのままメモリバンクにアクセスすることで算出式の計算処理を実行するという構成を採っている。
すなわち、例えば、
do j=1,n
a(index(j))=a(index(j))+b(index(j))*c(j)
end do
という算出式に対して、図35(a)に示すようなインデックス「index(j)」の配列順序を持つリストが与えられる場合にあって、メモリバンク数が8であるときには、計算順序「j」の指すメモリバンクとともに、図35(b)に示すようなインデックス「index(j)」の指すメモリバンクを使用する。そして、リストの指定に従って、図36に示すような計算順序により、これらのメモリバンクを用いて算出式の計算処理を実行するという構成を採っている。
【0005】
なお、計算順序「j」やインデックス「index(j)」の指すメモリバンクは、それらの値のメモリバンク数に対する剰余で定義されている。
また、図37に示すようなメモリバンク数に収まるインデックス「index(j)」の配列順序を持つリストが与えられる場合には、計算順序「j」の指すメモリバンクと、「index(j)」の指すメモリバンクとを使用して、図38に示すような計算順序により算出式の計算処理を実行するという構成を採っている。
【0006】
【発明が解決しようとする課題】
しかしながら、このような従来技術に従っていると、リストに配列されるインデックスの指すメモリバンクにアクセスすることで規定の算出式の計算処理を実行するときに、メモリビジーによるアイドル時間が発生することで、計算処理を高速に実行できないという問題点がある。
【0007】
すなわち、一度アクセスされたメモリバンクは規定時間の間ビジー状態となるので、同一のメモリバンクへのアクセスが続く場合には、メモリビジーによるアイドル時間が発生することで、その計算処理を高速に実行できないという問題点がある。
【0008】
上述の具体例において、メモリバス数として4(メモリバンク1,5にメモリバス1、メモリバンク2,6にメモリバス2、メモリバンク3,7にメモリバス3、メモリバンク4,8にメモリバス4を割り付ける)を想定し、一度アクセスされたメモリバンクは2クロックの間ビジー状態になることを想定すると、図36の算出式の計算処理は具体的には図39に示すような演算形態で実行され、図38の算出式の計算処理は具体的には図40に示すような演算形態で実行され、その演算密度が非常に低いことが分かる。
【0009】
本発明はかかる事情に鑑みてなされたものであって、リストに配列されるインデックスの指すメモリバンクにアクセスすることで規定の算出式の計算処理を実行するときにあって、算出式の計算処理を高速に実行できるようにする新たな計算機の提供と、その計算処理を行うプログラムを生成する新たなプログラム変換装置の提供と、その計算機の実現に用いられるプログラムが格納される新たなプログラム記録媒体の提供とを目的とする。
【0010】
【課題を解決するための手段】
図1及び図2に本発明の原理構成を図示する。
図中、1は本発明を具備する計算機であって、リストに配列されるインデックスの指すメモリバンクにアクセスすることで、規定の算出式の計算処理を実行するもの、2は本発明を具備するプログラム変換装置であって、リストに配列されるインデックスの指すメモリバンクにアクセスすることで、規定の算出式の計算処理を実行するプログラムをコンパイル又は変換して計算機1に展開するものである。
【0011】
ここで、本発明の計算機1や本発明のプログラム変換装置2の持つ機能は具体的にはプログラムで実現されるものであり、このプログラムはメモリ上で動作することで、本発明を実現することになる。
【0012】
図1(a)に原理構成を図示する計算機1は、作成手段10aと、計算手段11aとを備え、プログラム変換装置2は、第1の生成手段20aと、第2の生成手段21aとを備える。
【0013】
この作成手段10aは、インデックスの基数に対する剰余を求めて、インデックスとその剰余の規定する数値との対応関係を管理する作業配列を作成するとともに、インデックスとインデックスのリスト配列順序との対応関係を管理する作業配列を作成する。
【0014】
計算手段11aは、計算対象となる算出式の演算を、剰余系を内側ループとし、剰余の規定する数値の出現回数を外側ループとする形式で再構成して、作成手段10aの作成する作業配列の配列データに基づいてメモリバンクにアクセスすることで、その算出式を計算する。
【0015】
第1の生成手段20aは、作成手段10aを実現するプログラムを生成して、計算機1に展開する。
第2の生成手段21aは、計算対象となる算出式に応じて計算手段11aを実現するプログラムを生成して、計算機1に展開する。
【0016】
このように構成される図1(a)に原理構成を図示する計算機1では、基数としてメモリバンク数を用いる例で説明するならば、作成手段10aは、図35(a)に示したリストが与えられると、インデックスとインデックスの基数に対する剰余の規定する数値との対応関係を管理する図3(a)に示すような作業配列を作成するとともに、インデックスとインデックスのリスト配列順序との対応関係を管理する図3(b)に示すような作業配列を作成する。
【0017】
この図3(a)に示す作業配列は、図35(a)に示したリストでは、例えば、4番目のメモリバンクを指すインデックスは、「60→68→76」という順序で出現することを示し、この図3(b)に示す作業配列は、その60/68/76というインデックスは、リストの21/26/29番目に出現することを示している。
【0018】
この作業配列を受けて、計算手段11aは、例えば、
do j=1,n
a(index(j))=a(index(j))+b(index(j))*c(j)
end do
という算出式の演算を、
do j=1,kmax-v
!ocl novrec
do i=1,maxcnt
if(kkxx-v(i,j).gt.0)then
a(kkxx-v(i,j))=a(kkxx-v(i,j))+b(kkxx-v(i,j))*c(llxx-v(i,j))
end if
end do
end do
kmax-v:作業配列の行数 maxcnt:メモリバンク数
kkxx-v(i,j) :図3(a)の作業配列の値
llxx-v(i,j) :図3(b)の作業配列の値
というように、剰余系を内側ループとし、剰余の規定する数値の出現回数を外側ループとする形式で再構成して、作成手段10aの作成する作業配列の指定する計算順序に従ってメモリバンクにアクセスすることで、その算出式を計算する。
【0019】
すなわち、図35(a)に示したリストを図4に示すようなインデックスの並びに変換し、それに従って、図5に示すような計算順序により算出式の計算処理を実行する。これにより、図6に示すような演算形態で実行され、図36の従来技術に従う場合に比べて非常に高い演算密度を実現できるようになる。
【0020】
このようにして、図1(a)に原理構成を図示する計算機1によれば、リストに配列されるインデックスの指すメモリバンクにアクセスすることで、規定の算出式の計算処理を実行するときにあって、同一のメモリバンクに対するアクセスが連続しないようにとリストのインデックスの並びを変更するので、メモリビジーが回避され、その計算処理を高速に実行できるようになる。
【0021】
図1(b)に原理構成を図示する計算機1は、作成手段10bと、計算手段11bとを備え、プログラム変換装置2は、第1の生成手段20bと、第2の生成手段21bとを備える。
【0022】
この作成手段10bは、インデックスとインデックスの出現回数との対応関係を管理する作業配列を作成するとともに、インデックスとインデックスのリスト配列順序との対応関係を管理する作業配列を作成する。
【0023】
計算手段11bは、計算対象となる算出式の演算を、インデックスの出現回数を内側ループとし、インデックス系を外側ループとするとともに、スカラー演算を用いる形式で再構成して、作成手段10bの作成する作業配列の配列データに基づいてそのスカラー演算を繰り返すことで、その算出式を計算する。
【0024】
第1の生成手段20bは、作成手段10bを実現するプログラムを生成して、計算機1に展開する。
第2の生成手段21bは、計算対象となる算出式に応じて計算手段11bを実現するプログラムを生成して、計算機1に展開する。
【0025】
このように構成される図1(b)に原理構成を図示する計算機1では、作成手段10bは、図37に示したリストが与えられると、インデックスとインデックスの出現回数との対応関係を管理する図7(a)に示すような作業配列を作成するとともに、インデックスとインデックスのリスト配列順序との対応関係を管理する図7(b)に示すような作業配列を作成する。
【0026】
この図7(a)に示す作業配列は、図37に示したリストでは、インデックスの1が11回出現し、インデックスの2が8回出現し、インデックスの3が8回出現し、インデックス4の4が4回出現することを示し、この図7(b)に示す作業配列は、例えば、その1というインデックスは、リストの1/2/3/4/5/6/7/29/30/31番目に出現することを示している。
【0027】
この作業配列を受けて、計算手段11bは、例えば、
do j=1,n
a(index(j))=a(index(j))+b(index(j))*c(j)
end do
という算出式の演算を、
n=0
do n1=1,kxmax
akkx1n=a(index(n1))
bkkx1n=b(index(n1))
do n2=1,index-new(n1)
if(index-new(n1).ne.0)then
n=n+1
a(n1)=akkx1n+bkkx1n*c(llx(n))
end if
end do
kxmax :作業配列の行数
llxx:図7(b)の作業配列の値
index-new :各インデックス毎の出現回数
akkx1n:変数 bkkx1n:変数
というように、インデックスの出現回数を内側ループとし、インデックス系を外側ループとするとともに、インデックスの指すメモリバンクのデータを定数とするスカラー演算を用いる形式で再構成して、作成手段10bの作成する作業配列の指定する出現回数に従ってそのスカラー演算を繰り返すことで、その算出式を計算する。
【0028】
すなわち、図37に示したリストを図8に示すようなインデックスの並びに変換し、それに従って、図9に示すような計算順序により算出式の計算処理を実行するイメージに従い、この計算処理を、同一のインデックスの指すメモリバンクのデータを定数として設定しつつスカラー演算に従って実行する。これにより、図10に示すような演算形態で実行され、図39の従来技術に従う場合に比べて非常に高い演算密度を実現できるようになる。ここで、図10では、1クロックの間に、「a(n1)=akkx1n+bkkx1n*c(llx(n)) 」の計算処理を4回実行することを想定している。
【0029】
このようにして、図1(b)に原理構成を図示する計算機1によれば、リストに配列されるインデックスの指すメモリバンクにアクセスすることで、規定の算出式の計算処理を実行するときにあって、同一のインデックスの指すメモリバンクのデータを定数として設定しつつスカラー演算に従って実行するので、ベクトルメモリアクセスが減少し、その計算処理を高速に実行できるようになる。
【0030】
図2(a)に原理構成を図示する計算機1は、第1の作成手段12bと、第2の作成手段12aと、第1の計算手段13bと、第2の計算手段13aと、起動手段14とを備える。
【0031】
この第1の作成手段12bは、図1(b)に原理構成を図示する計算機1の備える作成手段10bに相当し、第2の作成手段12aは、図1(a)に原理構成を図示する計算機1の備える作成手段10aに相当し、第1の計算手段13bは、図1(b)に原理構成を図示する計算機1の備える計算手段11bに相当し、第2の計算手段13aは、図1(a)に原理構成を図示する計算機1の備える計算手段11aに相当する。
【0032】
起動手段14は、第1の作成手段12bの作成する作業配列の配列形式に従って、第1の計算手段13bか第2の計算手段13aのいずれか一方を選択して起動する。
【0033】
このように構成される図2(a)に原理構成を図示する計算機1では、第1の作成手段12bは、リストが与えられると、インデックスとインデックスの出現回数との対応関係を管理する作業配列を作成するとともに、インデックスとインデックスのリスト配列順序との対応関係を管理する作業配列を作成する。
【0034】
一方、第2の作成手段12aは、無条件に起動されたり、起動手段14が第2の計算手段13aを起動する条件が成立するときに起動されて、リストが与えられると、インデックスの基数に対する剰余を求めて、インデックスとその剰余の規定する数値との対応関係を管理する作業配列を作成するとともに、インデックスとインデックスのリスト配列順序との対応関係を管理する作業配列を作成する。
【0035】
この第1の作成手段12bの作成する作業配列を受けて、起動手段14は、この作業配列が同一のインデックスの出現回数が多い配列形式(配列データの形式)を示すときには、第1の計算手段13bを起動し、そうでないときには、第2の計算手段13aを起動する。
【0036】
このようにして起動されると、第1の計算手段13bは、計算対象となる算出式の演算を、インデックスの出現回数を内側ループとし、インデックス系を外側ループとするとともに、スカラー演算を用いる形式で再構成して、第1の作成手段12bの作成する作業配列の指定する出現回数に従ってそのスカラー演算を繰り返すことで、その算出式を計算する。
【0037】
一方、このようにして起動されると、第2の計算手段13aは、計算対象となる算出式の演算を、剰余系を内側ループとし、剰余の規定する数値の出現回数を外側ループとする形式で再構成して、第2の作成手段12aの作成する作業配列の指定する計算順序に従ってメモリバンクにアクセスすることで、その算出式を計算する。
【0038】
このようにして、図2(a)に原理構成を図示する計算機1によれば、リストに配列されるインデックスの指すメモリバンクにアクセスすることで、規定の算出式の計算処理を実行するときにあって、同一のインデックスの出現回数が多いときには、同一のインデックスの指すメモリバンクのデータを定数として設定しつつスカラー演算に従って実行することで、ベクトルメモリアクセスが減少し、その計算処理を高速に実行できるようになるとともに、同一のインデックスの出現頻回数が多くないときには、同一のメモリバンクに対するアクセスが連続しないようにとリストのインデックスの並びを変更することで、メモリビジーが回避され、その計算処理を高速に実行できるようになる。
【0039】
図2(b)に原理構成を図示する計算機1は、第1の作成手段15bと、第2の作成手段15aと、第1の計算手段16bと、第2の計算手段16aとを備える。
【0040】
この第1の作成手段15bは、図1(b)に原理構成を図示する計算機1の備える作成手段10bに相当し、第2の作成手段15aは、第1の作成手段15bの作成する作業配列に管理されるインデックス以外のインデックスを管理対象とする点を除き、図1(a)に原理構成を図示する計算機1の備える作成手段10aに相当し、第1の計算手段16bは、図1(b)に原理構成を図示する計算機1の備える計算手段11bに相当し、第2の計算手段16aは、図1(a)に原理構成を図示する計算機1の備える計算手段11aに相当する。
【0041】
このように構成される図2(b)に原理構成を図示する計算機1では、第1の作成手段15bは、リストが与えられると、出現回数の多いインデックスを管理対象として、インデックスとインデックスの出現回数との対応関係を管理する作業配列を作成するとともに、インデックスとインデックスのリスト配列順序との対応関係を管理する作業配列を作成する。
【0042】
一方、第2の作成手段15aは、リストが与えられると、第1の作成手段15bの作成する作業配列に管理されるインデックス以外のインデックスを管理対象としつつ、インデックスの基数に対する剰余を求めて、インデックスとその剰余の規定する数値との対応関係を管理する作業配列を作成するとともに、インデックスとインデックスのリスト配列順序との対応関係を管理する作業配列を作成する。
【0043】
この第1の作成手段15bの作成する作業配列の作成を受けて、第1の計算手段16bは、その作業配列に管理されるインデックスを処理対象として、計算対象となる算出式の演算を、インデックスの出現回数を内側ループとし、インデックス系を外側ループとするとともに、スカラー演算を用いる形式で再構成して、その作業配列の指定する出現回数に従ってスカラー演算を繰り返すことで、その算出式を計算する。
【0044】
一方、この第2の作成手段15aの作成する作業配列の作成を受けて、第2の計算手段16aは、その作業配列に管理されるインデックスを処理対象として、計算対象となる算出式の演算を、剰余系を内側ループとし、剰余の規定する数値の出現回数を外側ループとする形式で再構成して、その作業配列の指定する計算順序に従ってメモリバンクにアクセスすることで、その算出式を計算する。
【0045】
このようにして、図2(b)に原理構成を図示する計算機1によれば、リストに配列されるインデックスの指すメモリバンクにアクセスすることで、規定の算出式の計算処理を実行するときにあって、出現回数の多いインデックスについては、同一のインデックスの指すメモリバンクのデータを定数として設定しつつスカラー演算に従って実行することで、ベクトルメモリアクセスが減少し、その計算処理を高速に実行できるようになるとともに、出現回数の少ないインデックスについては、同一のメモリバンクに対するアクセスが連続しないようにとリストのインデックスの並びを変更することで、メモリビジーが回避され、その計算処理を高速に実行できるようになる。
【0046】
【発明の実施の形態】
以下、実施の形態に従って本発明を詳細に説明する。
図11に、本発明を具備する計算機1の一実施例を図示する。
【0047】
この実施例に従う本発明の計算機1は、図1に原理構成を図示した本発明の計算機1を実現するものであって、計算対象となる算出式の計算処理に必要となる作業配列を作成する作業配列作成プログラム20と、計算対象となる算出式のプログラム形式を変更する計算変更プログラム21と、計算変更プログラム21により作成される計算実行プログラム22と、作業配列作成プログラム20により作成されるインデックス用作業配列23と、作業配列作成プログラム20により作成されるオーダ用作業配列24とを備える。
【0048】
ここで、計算実行プログラム22は、計算変更プログラム21により作成されることになるが、このとき、それに合わせて、図示しないプログラムが、作業配列作成プログラム20を作成することになる。
【0049】
この作業配列作成プログラム20を作成する機能を持つプログラムや計算変更プログラム21は、プログラム変換ツールやコンパイラの機能により実現されることになるが、プログラマが手作業によりコーディングしていくこともある。
【0050】
図12に、図1(a)に原理構成を図示する本発明の計算機1を実現するために作業配列作成プログラム20が実行する処理フローの一実施例、図13に、図1(a)に原理構成を図示する本発明の計算機1を実現するために計算変更プログラム21が実行する処理フローの一実施例を図示する。
【0051】
次に、この処理フローに従って、図11のように構成される本発明の計算機1の処理について説明する。
作業配列作成プログラム20は、起動されると、図12の処理フローに示すように、先ず最初に、ステップ1で、インデックス用作業配列23及びオーダ用作業配列24を定義する。この作業配列の定義は、「メモリバンク数×十分なサイズ」の大きさを持つ作業配列を定義することで行う。
【0052】
続いて、ステップ2で、定義した作業配列を0クリアする。続いて、ステップ3で、リストに配列されるインデックスから次のインデックス(最初に処理に入るときには先頭のインデックス)を取り出す。すなわち、図35(a)に示したようなリストの持つインデックスの中から、配列の順番に従って未処理のインデックスを1つ取り出すのである。
【0053】
続いて、ステップ4で、全てのインデックスを取り出したのか否かを判断して、全てのインデックスを取り出していないことを判断するときには、ステップ5に進んで、ステップ3で取り出したインデックスのメモリバンク数に対する剰余を求めることで、ステップ3で取り出したインデックスの指すメモリバンクを特定する。
【0054】
続いて、ステップ6で、ステップ3で取り出したインデックスのリストにおける配列順序を特定する。続いて、ステップ7で、ステップ5で特定したメモリバンクの指すインデックス用作業配列23の領域に、ステップ3で取り出したインデックスを出現順に格納するとともに、ステップ6で特定したリスト配列順序を対応するオーダ用作業配列24の領域に格納してから、ステップ3に戻る。
【0055】
一方、ステップ4で、全てのインデックスを取り出したことを判断するときには、ステップ8に進んで、最もインデックスの出現したメモリバンクを探して出し、その出現回数を特定してから処理を終了する。
【0056】
このように、作業配列作成プログラム20は、リストから配列の順番に従ってインデックスindex(i)を取り出すと、そのインデックスindex(i)のメモリバンク数bに対する剰余mod-b を求めることで、そのインデックスindex(i)の指すメモリバンクを求めるとともに、そのメモリバンクの出現回数cnt-b を求めて、図14(a)に示すように、そのメモリバンク/出現回数の指すインデックス用作業配列23の領域に、そのインデックスindex(i)を格納するとともに、図14(b)に示すように、そのメモリバンク/出現回数の指すオーダ用作業配列24の領域に、そのインデックスindex(i)のリスト配列順序iを格納する処理を実行する。
【0057】
なお、この処理にあたって、フォートランでは1次元配列が1から始まることを考慮して、作業配列作成プログラム20は、「mod b=0」のときには、それを「mod b=n(n:メモリバンク数)」に置き換えるように処理している。
【0058】
このようにして、作業配列作成プログラム20は、図35(a)に示したリストが与えられると、インデックスとインデックスの指すメモリバンクとの対応関係を管理する図3(a)に示すようなインデックス用作業配列23を作成するとともに、インデックスとインデックスのリスト配列順序との対応関係を管理する図3(b)に示すようなオーダ用作業配列24を作成するのである。
【0059】
この図3(a)に示すインデックス用作業配列23は、図35(a)に示したリストでは、例えば、4番目のメモリバンクを指すインデックスが、「60→68→76」という順序で出現することを示し、この図3(b)に示すオーダ用作業配列24は、その60/68/76というインデックスが、リストの21/26/29番目に出現することを示している。
【0060】
一方、計算変更プログラム21は、起動されると、図13の処理フローに示すように、先ず最初に、ステップ1で、計算対象となる算出式のループを、内側をメモリバンク数、外側を全メモリバンクでのインデックスの最大出現回数に従って分割する。
【0061】
続いて、ステップ2で、インデックス用作業配列23(オーダ用作業配列24)の空白部の計算を回避するIF文を挿入し、続くステップ3で、使用するインデックス及び添え字を変更し、最後に、ステップ4で、内側ループのベクトル化のためにベクトル化指示行(!ocl novrec)を挿入することで、計算実行プログラム22を作成する。
【0062】
例えば、
do j=1,n
a(index(j))=a(index(j))+b(index(j))*c(j)
end do
という計算対象の算出式の演算を、
do j=1,kmax-v
!ocl novrec
do i=1,maxcnt
if(kkxx-v(i,j).gt.0)then
a(kkxx-v(i,j))=a(kkxx-v(i,j))+b(kkxx-v(i,j))*c(llxx-v(i,j))
end if
end do
end do
kmax-v:作業配列の行数 maxcnt:メモリバンク数
kkxx-v(i,j) :インデックス用作業配列23の値
llxx-v(i,j) :オーダ用作業配列24の値
というように変更することで、計算対象の算出式のプログラム形式を変更した形で定義される計算実行プログラム22を作成するのである。
【0063】
これから、計算実行プログラム22は、計算対象となる算出式の演算を、剰余系を内側ループとし、剰余の規定する数値の出現回数を外側ループとする形式で再構成されて、インデックス用作業配列23(オーダ用作業配列24)の指定する計算順序に従ってメモリバンクにアクセスすることで、その算出式を計算する。
【0064】
例えば、図35(a)に示したリストを図4に示すようなインデックスの並びに変換し、それに従って、図5に示すような計算順序により算出式の計算処理を実行するのである。
【0065】
このようにして、図12及び図13の処理フローに従う場合、本発明の計算機1では、リストに配列されるインデックスの指すメモリバンクにアクセスすることで、規定の算出式の計算処理を実行するときにあって、同一のメモリバンクに対するアクセスが連続しないようにとリストのインデックスの並びを変更する構成を採る。これにより、メモリビジーが回避され、その計算処理を高速に実行できるようになる。
図12の処理フローでは、作業配列作成プログラム20は、インデックスのメモリバンク数に対する剰余を求めることでインデックス用作業配列23を作成する構成を採ったが、メモリバンク数よりも小さな2の巾乗の値を基数として設定して、インデックスのその基数に対する剰余を求めることで、インデックス用作業配列23を作成する構成を採ることも可能である。
【0066】
例えば、図35(a)に示したリストが与えられるときに、4を基数として設定して、インデックスのその基数に対する剰余を求めることで、インデックス用作業配列23を作成すると、図3(a)に示したインデックス用作業配列23の代わりに、図15に示すインデックス用作業配列23が作成されることになるが、このインデックス用作業配列23を用いても、図3(a)に示したインデックス用作業配列23を用いる場合と同様に、図4に示したインデックスの並びに変換できることになるからである。
【0067】
また、図12の処理フローでは剰余の求めた方について特に説明しなかったが、基数として2の巾乗の値を用いると、インデックスのその基数に対する剰余をビットシフト処理やビットマスク処理により求めることができるので、簡単に剰余を求めることができるようになる。
【0068】
例えば、29というインデックスは2進表示で「00011101」と表されることになるが、この29の8に対する剰余は、その下位3ビットである「101」となるので、この下位3ビットを抽出するビットシフト処理やビットマスク処理を用いることで、簡単に剰余を求めることができるのである。
【0069】
また、図13の処理フローでは、インデックス用作業配列23(オーダ用作業配列24)の空白部の計算を回避するIF文を挿入する構成を採ったが、この空白部を詰める形で計算を行うようにすれば、このIF文を省略することができる。すなわち、図4に示したインデックスの並びに変更するときに、それが持つ空白部を詰める形で計算を行うようにすれば、このIF文を省略することができるのである。
【0070】
また、図12の処理フローでは、「メモリバンク数(剰余の数)×十分なサイズ」という方法でインデックス用作業配列23及びオーダ用作業配列24を定義する構成を採ったが、基数を設定してから、各剰余毎にインデックスの出現回数を求めるとともに、出現回数が0とならない剰余の数を求めて、「出現回数が0とならない剰余の数×最大の出現回数」という方法でインデックス用作業配列23及びオーダ用作業配列24を定義する構成を採ると、必要最小限のメモリ容量でインデックス用作業配列23及びオーダ用作業配列24を定義できるようになる。
【0071】
また、図12の処理フローでは説明しなかったが、長い科学計算を行う場合、計算実行プログラム22で記述する算出式が何回も呼び出されて計算されるということが起こる。
【0072】
このようなときには、作業配列作成プログラム20は、その都度、インデックス用作業配列23及びオーダ用作業配列24を生成する構成を採るのではなくて、前回の計算のときに指定されたリストが変更されているのか否かをチェックして、変更されているときのみ、その変更に合わせてインデックス用作業配列23及びオーダ用作業配列24を生成するように処理することが好ましい。
【0073】
図16に、図1(b)に原理構成を図示する本発明の計算機1を実現するために作業配列作成プログラム20が実行する処理フローの一実施例、図17に、図1(b)に原理構成を図示する本発明の計算機1を実現するために計算変更プログラム21が実行する処理フローの一実施例を図示する。
【0074】
次に、この処理フローに従って、図11のように構成される本発明の計算機1の処理について説明する。
作業配列作成プログラム20は、起動されると、図16の処理フローに示すように、先ず最初に、ステップ1で、リストに出現する最大のインデックスを特定する。続いて、ステップ2で、インデックス用作業配列23及びオーダ用作業配列24を定義する。この作業配列の定義は、「最大のインデックス値×十分なサイズ」の大きさを持つ作業配列を定義することで行う。
【0075】
続いて、ステップ3で、定義した作業配列を0クリアする。続いて、ステップ4で、リストに配列されるインデックスから次のインデックス(最初に処理に入るときには先頭のインデックス)を取り出す。すなわち、図37に示したようなリストの持つインデックスの中から、配列の順番に従って未処理のインデックスを1つ取り出すのである。
【0076】
続いて、ステップ5で、全てのインデックスを取り出したのか否かを判断して、全てのインデックスを取り出していないことを判断するときには、ステップ6に進んで、ステップ4で取り出したインデックスのリストにおける配列順序を特定する。続いて、ステップ7で、ステップ4で取り出したインデックスの指すインデックス用作業配列23の領域に、ステップ4で取り出したインデックスを格納するとともに、ステップ6で特定したリスト配列順序を対応するオーダ用作業配列24の領域に格納してから、ステップ4に戻る。
【0077】
一方、ステップ4で、全てのインデックスを取り出したことを判断するときには、ステップ8に進んで、最も出現したインデックスを探して出して、その出現回数を特定してから処理を終了する。
【0078】
このように、作業配列作成プログラム20は、リストから配列の順番に従ってインデックスindex(i)を取り出すと、図18(a)に示すように、そのインデックスindex(i)とそのインデックスindex(i)の出現回数cnt-m の指すインデックス用作業配列23の領域に、そのインデックスindex(i)を格納するとともに、図18(b)に示すように、そのインデックスindex(i)とそのインデックスindex(i)の出現回数cnt-m の指すオーダ用作業配列24の領域に、そのインデックスindex(i)のリスト配列順序iを格納する処理を実行する。
【0079】
このようにして、作業配列作成プログラム20は、図37に示したリストが与えられると、インデックスとインデックスの出現回数との対応関係を管理する図7(a)に示すようなインデックス用作業配列23を作成するとともに、インデックスとインデックスのリスト配列順序との対応関係を管理する図7(b)に示すようなオーダ用作業配列24を作成するのである。
【0080】
この図7(a)に示す作業配列は、図37に示したリストでは、インデックスの1が11回出現し、インデックスの2が8回出現し、インデックスの3が8回出現し、インデックス4の4が4回出現することを示し、この図7(b)に示す作業配列は、例えば、その1というインデックスは、リストの1/2/3/4/5/6/7/29/30/31番目に出現することを示している。
【0081】
一方、計算変更プログラム21は、起動されると、図17の処理フローに示すように、先ず最初に、ステップ1で、計算対象となる算出式のループを、内側をインデックス数、外側を各インデックスの出現回数に従って分割する。
【0082】
続いて、ステップ2で、インデックス用作業配列23(オーダ用作業配列24)の空白部の計算を回避するIF文を挿入し、続くステップ3で、使用するインデックス及び添え字を変更することで、スカラー演算の形態に従う計算実行プログラム22を作成する。
【0083】
例えば、
do j=1,n
a(index(j))=a(index(j))+b(index(j))*c(j)
end do
という計算対象の算出式の演算を、
n=0
do n1=1,kxmax
akkx1n=a(index(n1))
bkkx1n=b(index(n1))
do n2=1,index-new(n1)
if(index-new(n1).ne.0)then
n=n+1
a(n1)=akkx1n+bkkx1n*c(llx(n))
end if
end do
kxmax :作業配列の行数
llxx:図7(b)の作業配列の値
index-new :各インデックス毎の出現回数
akkx1n:変数 bkkx1n:変数
というように変更することで、計算対象の算出式のプログラム形式を変更した形で定義される計算実行プログラム22を作成するのである。
【0084】
これから、計算実行プログラム22は、計算対象となるインデックスの出現回数を内側ループとし、インデックス系を外側ループとするとともに、インデックスの指すメモリバンクのデータを定数とするスカラー演算を用いる形式で再構成されて、インデックス用作業配列23(オーダ用作業配列24)の指定する出現回数に従ってそのスカラー演算を繰り返すことで、その算出式を計算する。
【0085】
例えば、図37に示したリストを図8に示すようなインデックスの並びに変換し、それに従って、図9に示すような計算順序により算出式の計算処理を実行するのである。
【0086】
このようにして、図16及び図17の処理フローに従う場合、本発明の計算機1では、リストに配列されるインデックスの指すメモリバンクにアクセスすることで、規定の算出式の計算処理を実行するときにあって、同一のインデックスの指すメモリバンクのデータを定数として設定しつつスカラー演算に従って実行する構成を採る。これにより、ベクトルメモリアクセスが減少し、その計算処理を高速に実行できるようになる。
【0087】
図16の処理フローで作成するインデックス用作業配列23については、リスト中の各インデックスを前に位置するインデックスと比較する構成を採って、小さい場合にはその順序を前に移動させていくという公知のソーティング手法(ダイヤモンドソート手法)を用いることで作成することも可能である。
【0089】
また、図16の処理フローでは、「最大のインデックス値×十分なサイズ」という方法でインデックス用作業配列23及びオーダ用作業配列24を定義する構成を採ったが、各インデックスの出現回数を求めて、「出現回数が0とならないインデックスの数×最大の出現回数」という方法でインデックス用作業配列23及びオーダ用作業配列24を定義する構成を採ると、必要最小限のメモリ容量でインデックス用作業配列23及びオーダ用作業配列24を定義できるようになる。
【0090】
また、図16の処理フローでは説明しなかったが、長い科学計算を行う場合、計算実行プログラム22で記述する算出式が何回も呼び出されて計算されるということが起こる。
【0091】
このようなときは、作業配列作成プログラム20は、その都度、インデックス用作業配列23及びオーダ用作業配列24を生成する構成を採るのではなくて、前回の計算のときに指定されたリストが変更されているのか否かをチェックして、変更されているときのみ、その変更に合わせてインデックス用作業配列23及びオーダ用作業配列24を生成するように処理することが好ましい。
【0092】
図19に、本発明を具備する計算機1の他の実施例を図示する。
この実施例に従う本発明の計算機1は、図2に原理構成を図示した本発明の計算機1を実現するものであって、計算対象となる算出式の計算処理に必要となる作業配列を作成する作業配列作成プログラム30と、計算対象となる算出式のプログラム形式を変更する計算変更プログラム31と、計算実行プログラム22a,bを起動する起動プログラム32と、計算変更プログラム31により作成される計算実行プログラム22a,bと、作業配列作成プログラム30により作成されるインデックス用作業配列23a,bと、作業配列作成プログラム30により作成されるオーダ用作業配列24a,bとを備える。
【0093】
ここで、計算実行プログラム22a,bは、計算変更プログラム31により作成されることになるが、このとき、それに合わせて、図示しないプログラムが、作業配列作成プログラム30を作成することになる。
【0094】
この作業配列作成プログラム30を作成する機能を持つプログラムや計算変更プログラム31は、プログラム変換ツールやコンパイラの機能により実現されることになるが、プログラマが手作業によりコーディングしていくこともある。
【0095】
図20に、図2(a)に原理構成を図示する本発明の計算機1を実現するために作業配列作成プログラム30が実行する処理フローの一実施例、図21に、図2(a)に原理構成を図示する本発明の計算機1を実現するために計算変更プログラム31が実行する処理フローの一実施例、図22に、図2(a)に原理構成を図示する本発明の計算機1を実現するために起動プログラム32が実行する処理フローの一実施例を図示する。
【0096】
次に、この処理フローに従って、図19のように構成される本発明の計算機1の処理について説明する。
作業配列作成プログラム30は、起動されると、図20の処理フローに示すように、先ず最初に、ステップ1で、図12の処理フローに従って、リストから配列の順番に従ってインデックスindex(i)を取り出すと、そのインデックスindex(i)のメモリバンク数bに対する剰余mod-b を求めることで、そのインデックスindex(i)の指すメモリバンクを求めるとともに、そのメモリバンクの出現回数cnt-b を求めて、図14(a)に示すように、そのメモリバンク/出現回数の指すインデックス用作業配列23の領域に、そのインデックスindex(i)を格納するとともに、図14(b)に示すように、そのメモリバンク/出現回数の指すオーダ用作業配列24の領域に、そのインデックスindex(i)のリスト配列順序iを格納することで、インデックス用作業配列23a及びオーダ用作業配列24aを作成する。
【0097】
続いて、ステップ2で、図16の処理フローに従って、リストから配列の順番に従ってインデックスindex(i)を取り出すと、図18(a)に示すように、そのインデックスindex(i)とそのインデックスindex(i)の出現回数cnt-m の指すインデックス用作業配列23の領域に、そのインデックスindex(i)を格納するとともに、図18(b)に示すように、そのインデックスindex(i)とそのインデックスindex(i)の出現回数cnt-m の指すオーダ用作業配列24の領域に、そのインデックスindex(i)のリスト配列順序iを格納することで、インデックス用作業配列23b及びオーダ用作業配列24bを作成する。
【0098】
一方、計算変更プログラム31は、図21の処理フローに示すように、先ず最初に、ステップ1で、図13の処理フローに従って、例えば、
do j=1,n
a(index(j))=a(index(j))+b(index(j))*c(j)
end do
という計算対象の算出式の演算を、
do j=1,kmax-v
!ocl novrec
do i=1,maxcnt
if(kkxx-v(i,j).gt.0)then
a(kkxx-v(i,j))=a(kkxx-v(i,j))+b(kkxx-v(i,j))*c(llxx-v(i,j))
end if
end do
end do
kmax-v:作業配列の行数 maxcnt:メモリバンク数
kkxx-v(i,j) :インデックス用作業配列23aの値
llxx-v(i,j) :オーダ用作業配列24aの値
というように変更することで、計算対象の算出式のプログラム形式を変更した形で定義される計算実行プログラム22aを作成する。
【0099】
続いて、ステップ2で、図13の処理フローに従って、例えば、
do j=1,n
a(index(j))=a(index(j))+b(index(j))*c(j)
end do
という計算対象の算出式の演算を、
n=0
do n1=1,kxmax
akkx1n=a(index(n1))
bkkx1n=b(index(n1))
do n2=1,index-new(n1)
if(index-new(n1).ne.0)then
n=n+1
a(n1)=akkx1n+bkkx1n*c(llx(n))
end if
end do
kxmax :作業配列の行数
llxx:図7(b)の作業配列の値
index-new :各インデックス毎の出現回数
akkx1n:変数 bkkx1n:変数
というように変更することで、計算対象の算出式のプログラム形式を変更した形で定義される計算実行プログラム22bを作成する。
【0100】
一方、起動プログラム32は、起動されると、図22の処理フローに示すように、先ず最初に、ステップ1で、作業配列作成プログラム30により作成されたインデックス用作業配列23bが同一のインデックスの出現回数の多い配列形式を示しているのか否かを判断する。
【0101】
この判断処理は、例えば、図23に示すように、インデックス用作業配列23bに登録されるインデックス数mと、インデックス用作業配列23bに登録されるインデックスの最大出現回数nとを比較して、「n>m」のときには、インデックス用作業配列23bが同一のインデックスの出現回数の多い配列形式を示していると判断し、「m>n」のときには、そうでないと判断することで行う。
【0102】
このステップ1で、インデックス用作業配列23bが同一のインデックスの出現回数の多い配列形式を示していることを判断するときには、ステップ2に進んで、計算実行プログラム22bを起動する。
【0103】
このようにして起動されると、計算実行プログラム22bは、計算対象となるインデックスの出現回数を内側ループとし、インデックス系を外側ループとするとともに、インデックスの指すメモリバンクのデータを定数とするスカラー演算を用いる形式で再構成されて、インデックス用作業配列23b(オーダ用作業配列24b)の指定する出現回数に従ってそのスカラー演算を繰り返すことで、その算出式を計算する。
【0104】
例えば、図37に示したリストを図8に示すようなインデックスの並びに変換し、それに従って、図9に示すような計算順序により算出式の計算処理を実行するのである。
【0105】
これに対して、ステップ1で、インデックス用作業配列23bが同一のインデックスの出現回数の多い配列形式を示していないことを判断するときには、ステップ3に進んで、計算実行プログラム22aを起動する。
【0106】
このようにして起動されると、計算実行プログラム22aは、計算対象となる算出式の演算を、剰余系を内側ループとし、剰余の規定する数値の出現回数を外側ループとする形式で再構成されて、インデックス用作業配列23a(オーダ用作業配列24a)の指定する計算順序に従ってメモリバンクにアクセスすることで、その算出式を計算する。
【0107】
例えば、図35(a)に示したリストを図4に示すようなインデックスの並びに変換し、それに従って、図5に示すような計算順序により算出式の計算処理を実行するのである。
【0108】
このようにして、図19に示す本発明を具備する計算機1では、同一のインデックスが多く出現するリストである場合には、インデックス用作業配列23b及びオーダ用作業配列24bを使って算出式の計算処理を実行し、同一のインデックスが多く出現しないリストである場合には、インデックス用作業配列23a及びオーダ用作業配列24aを使って算出式の計算処理を実行することで、算出式を高速に算出するように処理するのである。
【0109】
図19の実施例では、予めインデックス用作業配列23a,b及びオーダ用作業配列24a,bを作成するという構成を採ったが、先ず最初に、インデックス用作業配列23b及びオーダ用作業配列24bを作成し、その作成した配列形式に従って、インデックス用作業配列23a及びオーダ用作業配列24aを作成するのか否かを決定するという方法を採ることも可能である。
【0110】
この方法に従うと、インデックス用作業配列23a及びオーダ用作業配列24aを作成する必要がないときには、それを作成しないで済むようになる。
図24に、この方法を実現するための本発明を具備する計算機1の実施例を図示する。
【0111】
この方法を実現するためには、図19の実施例で用意した起動プログラム32を省略するとともに、作業配列作成プログラム30が図25に示す処理フローを実行する構成を採る。
【0112】
すなわち、作業配列作成プログラム30は、この方法を実現するために、図25の処理フローに示すように、先ず最初に、ステップ1で、図16の処理フローに従って、インデックス用作業配列23b及びオーダ用作業配列24bを作成し、続いて、ステップ2で、作成したインデックス用作業配列23bが同一のインデックスの出現回数の多い配列形式を示しているのか否かを判断する。
【0113】
そして、この判断処理で、同一のインデックスの出現回数の多い配列形式を示していないことを判断するときには、ステップ3に進んで、図12の処理フローに従って、インデックス用作業配列23a及びオーダ用作業配列24aを作成し、続くステップ4で、計算実行プログラム22aを起動し、これに対して、同一のインデックスの出現回数の多い配列形式を示していることを判断するときには、ステップ5に進んで、インデックス用作業配列23a及びオーダ用作業配列24aを作成することなく、計算実行プログラム22bを起動していくように処理することになる。
【0114】
上述した図19及び図24の実施例では、計算実行プログラム22aか計算実行プログラム22bのいずれか一方を起動していくという構成を採ったが、リストに配列されるインデックスを出現回数の多いものと少ないものとに分け、出現回数の多いインデックスを管理対象としてインデックス用作業配列23b及びオーダ用作業配列24bを作成し、出現回数の少ないインデックスを管理対象としてインデックス用作業配列23a及びオーダ用作業配列24aを作成する構成を採って、出現回数の少ないインデックスについては、計算実行プログラム22aがインデックス用作業配列23a及びオーダ用作業配列24aに従って算出式の計算処理を実行し、出現回数の多いインデックスについては、計算実行プログラム22bがインデックス用作業配列23b及びオーダ用作業配列24bに従って算出式の計算処理を実行するという、図2(b)に原理構成を図示する方法を採ることも可能である。
【0115】
この方法に従うと、出現回数の多いインデックスと出現回数の少ないインデックスとが混在している場合に、算出式の計算処理を高速に実行できるようになる。
【0116】
図26に、この方法を実現するために作業配列作成プログラム30が実行する処理フローの一実施例を図示する。
作業配列作成プログラム30は、この方法を実現する場合には、図26の処理フローに示すように、先ず最初に、ステップ1で、図16の処理フローに従って、インデックス用作業配列23b及びオーダ用作業配列24bを作成する。
【0117】
続いて、ステップ2で、作成したインデックス用作業配列23bに従って、出現回数の少ないインデックスを特定して、作成したインデックス用作業配列23b及びオーダ用作業配列24bから、その特定したインデックスのデータを削除することで、出現回数の多いインデックスについてのインデックス用作業配列23b及びオーダ用作業配列24bを作成する。
【0118】
続いて、ステップ3で、削除したインデックスを管理対象として、図12の処理フローに従って、インデックス用作業配列23a及びオーダ用作業配列24aを作成することで、出現回数の少ないインデックスについてのインデックス用作業配列23a及びオーダ用作業配列24aを作成する。
【0119】
このようにして、図26の処理フローに従う場合、作業配列作成プログラム30は、例えば、図27に示すようなリストが与えられると、出現回数の多いインデックスについては、図28(a)に示すように、図7(a)に示した配列形式に従うインデックス用作業配列23bを作成するとともに、図7(b)に示した配列形式に従うオーダ用作業配列24bを作成し、出現回数の少ないインデックスについては、図28(b)に示すように、図3(a)に示した配列形式に従うインデックス用作業配列23aを作成するとともに、図3(b)に示した配列形式に従うオーダ用作業配列24aを作成するのである。
【0120】
この作業配列作成プログラム30の作成する作業配列を受けて、例えば、
というように記述される計算実行プログラム22aは、出現回数の少ないインデックスについてのインデックス用作業配列23a及びオーダ用作業配列24aに従って算出式の計算処理を実行する。
【0121】
そして、この作業配列作成プログラム30の作成する作業配列を受けて、例えば、
n=0
do n1=1,kxmax
akkx1n=a(index(n1))
bkkx1n=b(index(n1))
do n2=1,index-new(n1)
if(index-new(n1).ne.0)then
n=n+1
a(n1)=akkx1n+bkkx1n*c(llx(n))
end if
end do
kxmax :作業配列の行数
llxx:図7(b)の作業配列の値
index-new :各インデックス毎の出現回数
akkx1n:変数 bkkx1n:変数
というように記述される計算実行プログラム22bは、出現回数の多いインデックスについてのインデックス用作業配列23b及びオーダ用作業配列24bに従って算出式の計算処理を実行する。
【0122】
最終的には、この2つの算出式の計算処理の処理結果を加算することで、算出式の計算結果を得ることになる。
最後に、並列システムへの適用について説明する。
【0123】
本発明は、単一プロセッサ構成の計算機にその適用が限られるものではなく、並列プロセッサ構成の計算機にもそのまま適用できる。
並列システムには、図29(a)に示す構成を採る分散メモリ方式のものと、図29(b)に示す構成を採る共用メモリ方式のものとがあるが、本発明は、そのいずれに対しても適用可能である。
【0124】
但し、本発明を分散メモリ方式の並列システムに適用する場合、例えば、プロセッサi(i=0〜n)の実バンクアドレスが「0〜m−1」で説明するならば、プロセッサ0には「0〜m−1」、プロセッサ1には「m〜2×m−1」、プロセッサ2には「2×m〜3×m−1」というように、システム全体に対するアドレスを設定することになる。
【0125】
本発明を並列システムに適用する場合、図3に示すインデックス用作業配列23及びオーダ用作業配列24の例で説明するならば、図30に示すように、インデックス用作業配列23及びオーダ用作業配列24をプロセッサ数に応じて分割して、それを各プロセッサに配分する構成を採ることになる。また、図31に示すリストを受けて、図32に示すようなインデックス用作業配列23及びオーダ用作業配列24を作成するときの例で説明するならば、この図32に示すように、インデックス用作業配列23及びオーダ用作業配列24をプロセッサ数に応じて分割して、それを各プロセッサに配分する構成を採ることになる。
【0126】
このとき、各プロセッサの負荷の均等化を図るために、図33に示すように、各プロセッサに配分するインデックスの数が概略均等になるようにと、インデックス用作業配列23及びオーダ用作業配列24を分割することが好ましい。ここで、この図33では、図34に示すインデックスの並びを持つリストを想定している。
【0127】
図示実施例に従って本発明を説明したが、本発明はこれに限定されるものではない。例えば、実施例では、
do j=1,n
a(index(j))=a(index(j))+b(index(j))*c(j)
end do
という算出式を具体例にして本発明を説明したが、本発明の適用対象となる算出式は如何なるものであってもよい。
【0128】
【発明の効果】
以上説明したように、本発明によれば、リストに配列されるインデックスの指すメモリバンクにアクセスすることで、規定の算出式の計算処理を実行するときにあって、同一のメモリバンクに対するアクセスが連続しないようにとリストのインデックスの並びを変更することで、メモリビジーが回避され、その計算処理を高速に実行できるようになる。
【0129】
そして、本発明によれば、リストに配列されるインデックスの指すメモリバンクにアクセスすることで、規定の算出式の計算処理を実行するときにあって、同一のインデックスの指すメモリバンクのデータを定数として設定しつつスカラー演算に従って実行することで、ベクトルメモリアクセスが減少し、その計算処理を高速に実行できるようになる。
【0130】
そして、本発明によれば、リストに配列されるインデックスの指すメモリバンクにアクセスすることで、規定の算出式の計算処理を実行するときにあって、同一のインデックスの出現回数が多いときには、同一のインデックスの指すメモリバンクのデータを定数として設定しつつスカラー演算に従って実行することで、ベクトルメモリアクセスが減少し、その計算処理を高速に実行できるようになるとともに、同一のインデックスの出現回数が多くないときには、同一のメモリバンクに対するアクセスが連続しないようにとリストのインデックスの並びを変更することで、メモリビジーが回避され、その計算処理を高速に実行できるようになる。
【0131】
そして、本発明によれば、リストに配列されるインデックスの指すメモリバンクにアクセスすることで、規定の算出式の計算処理を実行するときにあって、出現回数の多いインデックスについては、同一のインデックスの指すメモリバンクのデータを定数として設定しつつスカラー演算に従って実行することで、ベクトルメモリアクセスが減少し、その計算処理を高速に実行できるようになるとともに、出現回数の少ないインデックスについては、同一のメモリバンクに対するアクセスが連続しないようにとリストのインデックスの並びを変更することで、メモリビジーが回避され、その計算処理を高速に実行できるようになる。
【図面の簡単な説明】
【図1】本発明の原理構成図である。
【図2】本発明の原理構成図である。
【図3】本発明の説明図である。
【図4】本発明の説明図である。
【図5】本発明の説明図である。
【図6】本発明の説明図である。
【図7】本発明の説明図である。
【図8】本発明の説明図である。
【図9】本発明の説明図である。
【図10】本発明の説明図である。
【図11】本発明の一実施例である。
【図12】作業配列作成プログラムの処理フローである。
【図13】計算変更プログラムの処理フローである。
【図14】作業配列作成プログラムの処理説明図である。
【図15】作業配列作成プログラムの処理説明図である。
【図16】作業配列作成プログラムの処理フローである。
【図17】計算変更プログラムの処理フローである。
【図18】作業配列作成プログラムの処理説明図である。
【図19】本発明の他の実施例である。
【図20】作業配列作成プログラムの処理フローである。
【図21】計算変更プログラムの処理フローである。
【図22】起動プログラムの処理フローである。
【図23】起動プログラムの処理説明図である。
【図24】本発明の他の実施例である。
【図25】作業配列作成プログラムの処理フローである。
【図26】作業配列作成プログラムの処理フローである。
【図27】リストの説明図である。
【図28】作業配列の説明図である。
【図29】並列システムの説明図である。
【図30】並列システムへの適用説明図である。
【図31】リストの説明図である。
【図32】並列システムへの適用説明図である。
【図33】並列システムへの適用説明図である。
【図34】リストの説明図である。
【図35】従来技術の説明図である。
【図36】従来技術の説明図である。
【図37】従来技術の説明図である。
【図38】従来技術の説明図である。
【図39】従来技術の説明図である。
【図40】従来技術の説明図である。
【符号の説明】
1 計算機
2 プログラム変換装置
10a 作成手段
11a 計算手段
20a 第1の生成手段
21a 第2の生成手段
10b 作成手段
11b 計算手段
20b 第1の生成手段
21b 第2の生成手段
12b 第1の作成手段
12a 第2の作成手段
13b 第1の計算手段
13a 第2の計算手段
14 起動手段
15b 第1の作成手段
15a 第2の作成手段
16b 第1の計算手段
16a 第2の計算手段[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a computer that executes calculation processing of a prescribed calculation formula by accessing a memory bank pointed to by an index arranged in a list, a program conversion device that generates a program that performs the calculation processing, and realization of the computer In particular, a computer that can execute a calculation process of a calculation formula at high speed, a program conversion device that generates a program that performs the calculation process, and an implementation of the computer The present invention relates to a program recording medium in which a program used for the program is stored.
[0002]
Many iterative calculations appear in science and technology calculations. Here, memory access by reference to the list becomes a bottleneck, and in many cases, sufficient performance cannot be exhibited. This is because the memory bank once accessed is in a busy state for a specified time, and thus the data in the bank cannot be accessed. In addition, since a vector process cannot be performed in a calculation (refer to regression) in which the same list is reproduced during an iterative calculation, the processing performance of the vector computer is greatly reduced. From now on, the construction of technology to solve these problems has been called out.
[0003]
[Prior art]
A calculation process of a specified calculation formula is executed by accessing a memory bank indicated by an index arranged in a list.
[0004]
In this case, conventionally, the calculation formula calculation process is executed by accessing the memory bank as it is according to the designation of the list.
That is, for example,
do j = 1, n
a (index (j)) = a (index (j)) + b (index (j)) * c (j)
end do
As shown in FIG. 35A, an index “ind”eIn the case where a list having an arrangement order of “x (j)” is given and the number of memory banks is 8, an index “as shown in FIG. indeThe memory bank indicated by “x (j)” is used. Then, according to the designation of the list, the calculation formula calculation process is executed using these memory banks in the calculation order as shown in FIG.
[0005]
The calculation order “j” and the index “ind”eThe memory bank pointed to by “x (j)” is defined as a remainder with respect to the number of memory banks of those values.
Also, an index “ind that fits in the number of memory banks as shown in FIG.eWhen a list having an arrangement order of “x (j)” is given, a memory bank indicated by the calculation order “j” and “ind”eThe configuration is such that the calculation processing of the calculation formula is executed in the calculation order as shown in FIG. 38 using the memory bank indicated by “x (j)”.
[0006]
[Problems to be solved by the invention]
However, according to such conventional technology, when the calculation process of the prescribed calculation formula is executed by accessing the memory bank pointed to by the index arranged in the list, idle time due to memory busy occurs, There is a problem that calculation processing cannot be executed at high speed.
[0007]
In other words, once accessed, the memory bank is in a busy state for a specified time, so if access to the same memory bank continues, idle time due to memory busy occurs, and the calculation process is executed at high speed. There is a problem that it is not possible.
[0008]
In the above example, the number of memory buses is 4 (
[0009]
The present invention has been made in view of such circumstances, and is for performing calculation processing of a prescribed calculation formula by accessing a memory bank pointed to by an index arranged in a list. Is provided at a high speed, a new program conversion device for generating a program for performing the calculation process, and a new program recording medium storing a program used to realize the computer For the purpose of providing.
[0010]
[Means for Solving the Problems]
1 and 2 illustrate the basic configuration of the present invention.
In the figure,
[0011]
Here, the functions of the
[0012]
The
[0013]
The creation means 10a obtains a remainder with respect to the index radix, creates a work array for managing the correspondence between the index and the numerical value defined by the remainder, and manages the correspondence between the index and the index list order. Create a working array to do.
[0014]
The calculation means 11a uses the calculation of the calculation formula to be calculated as the inner loop and the appearance of a numerical value defined by the remainder.TimesIs reconstructed in the form of an outer loopdo it, Work arrangement created by the creation means 10aBased on the array dataThe calculation formula is calculated by accessing the memory bank.
[0015]
The
The
[0016]
In the
[0017]
The work arrangement shown in FIG. 3A indicates that, for example, in the list shown in FIG. 35A, the index indicating the fourth memory bank appears in the order of “60 → 68 → 76”. The working arrangement shown in FIG. 3 (b) has an index of 60/68/76, which is 21/26 / of the list.2It shows that it appears 9th.
[0018]
Upon receiving this work arrangement, the calculation means 11a, for example,
do j = 1, n
a (index (j)) = a (index (j)) + b (index (j)) * c (j)
end do
The calculation formula
do j = 1, kmax-v
! ocl novrec
do i = 1, maxcnt
if (kkxx-v (i, j) .gt.0) then
a (kkxx-v (i, j)) = a (kkxx-v (i, j)) + b (kkxx-v (i, j)) * c (llxx-v (i, j))
end if
end do
end do
kmax-v: Number of rows in the work array maxcnt: Number of memory banks
kkxx-v (i, j): Value of work array in Fig. 3 (a)
llxx-v (i, j): Value of work array in Fig. 3 (b)
In this way, the remainder system is the inner loop, and the numerical value specified by the remainder appears.TimesIs reconstructed in the form of an outer loopdo itThen, the calculation formula is calculated by accessing the memory bank in accordance with the calculation order designated by the work array created by the creation means 10a.
[0019]
That is, the list shown in FIG. 35 (a) is converted into a sequence of indexes as shown in FIG. 4, and the calculation formula calculation process is executed according to the calculation order shown in FIG. Thereby, it is executed in the calculation form as shown in FIG. 6, and a very high calculation density can be realized as compared with the case of following the prior art of FIG.
[0020]
In this way, according to the
[0021]
The
[0022]
This creation means 10b uses an index and the appearance of an index.TimesA work array for managing the correspondence relationship between the index and the list arrangement order of the index is created.
[0023]
The calculation means 11b calculates the calculation formula to be calculated as the occurrence of an index.TimesIs the inner loop, the index system is the outer loop, and is reconstructed using a scalar operationdo it, Work arrangement created by the creation means 10bBased on the array dataThe calculation formula is calculated by repeating the scalar calculation.
[0024]
The first generation unit 20 b generates a program that implements the
The
[0025]
In the
[0026]
In the work array shown in FIG. 7A, in the list shown in FIG. 37,
[0027]
Upon receiving this work arrangement, the calculation means 11b, for example,
do j = 1, n
a (index (j)) = a (index (j)) + b (index (j)) * c (j)
end do
The calculation formula
n = 0
do n1 = 1, kxmax
akkx1n = a (index (n1))
bkkx1n = b (index (n1))
do n2 = 1, index-new (n1)
if (index-new (n1) .ne.0) then
n = n + 1
a (n1) = akkx1n + bkkx1n * c (llx (n))
end if
end do
kxmax: Number of rows in the work array
llxx: Value of work array in Fig. 7 (b)
index-new: Appearance for each indexTimes
akkx1n: Variable bkkx1n: Variable
The appearance of the indexTimesIs the inner loop, the index system is the outer loop, and is reconfigured using a scalar operation that uses the data in the memory bank indicated by the index as a constant.do it, The specified appearance of the work array created by the creation means 10bTimesThe calculation formula is calculated by repeating the scalar calculation according to.
[0028]
That is, the list shown in FIG. 37 is converted into a sequence of indexes as shown in FIG. 8, and this calculation process is the same according to the image of executing the calculation process of the calculation formula in the calculation order as shown in FIG. The data in the memory bank pointed to by the index is set as a constant and executed according to a scalar operation. Thereby, it is executed in the calculation form as shown in FIG. 10, and a very high calculation density can be realized as compared with the case of following the prior art of FIG. Here, in FIG. 10, it is assumed that the calculation process of “a (n1) = akkx1n + bkkx1n * c (llx (n))” is executed four times during one clock.
[0029]
In this way, according to the
[0030]
The
[0031]
The first creation means 12b corresponds to the creation means 10b included in the
[0032]
The activation means 14 selects and activates either the first calculation means 13b or the second calculation means 13a according to the arrangement format of the work arrangement created by the first creation means 12b.
[0033]
In the
[0034]
On the other hand, when the second creation unit 12a is activated unconditionally or when the
[0035]
In response to the work sequence created by the first creation means 12b, the activation means 14 causes the appearance of an index with the same work layout.TimesArray format with many(Format of array data)Is displayed, the first calculation means 13b is activated. Otherwise, the second calculation means 13a is activated.
[0036]
When activated in this way, the first calculation means 13b calculates the calculation formula to be calculated as the occurrence of an index.TimesIs the inner loop, the index system is the outer loop, and is reconstructed using a scalar operationdo it, The specified appearance of the work sequence created by the first creation means 12bTimesThe calculation formula is calculated by repeating the scalar calculation according to.
[0037]
On the other hand, when activated in this way, the second calculation means 13a uses the calculation of the calculation formula to be calculated as the inner loop and the appearance of a numerical value defined by the remainder.TimesIs reconstructed in the form of an outer loopdo itThe calculation formula is calculated by accessing the memory bank in accordance with the calculation order designated by the work array created by the second creation means 12a.
[0038]
In this way, according to the
[0039]
The
[0040]
The first creation means 15b corresponds to the creation means 10b included in the
[0041]
In the
[0042]
On the other hand, when the list is given, the second creating unit 15a obtains a remainder with respect to the radix of the index while managing an index other than the index managed in the work array created by the first creating unit 15b, A work array for managing the correspondence between the index and the numerical value defined by the remainder is created, and a work array for managing the correspondence between the index and the list arrangement order of the index is created.
[0043]
In response to the creation of the work array created by the first creation means 15b, the first calculation means 16b uses the index managed by the work array as a processing target and calculates the calculation formula to be calculated as an index. The appearance ofTimesIs the inner loop, the index system is the outer loop, and is reconstructed using a scalar operationdo itThe specified occurrence of that working arrayTimesThe calculation formula is calculated by repeating the scalar calculation according to.
[0044]
On the other hand, in response to the creation of the work array created by the second creation means 15a, the second calculation means 16a uses the index managed by the work array as a processing target to calculate the calculation formula to be calculated. , The remainder system is the inner loop, and the numerical value specified by the remainder appearsTimesIs reconstructed in the form of an outer loopdo itThen, the calculation formula is calculated by accessing the memory bank according to the calculation order designated by the work array.
[0045]
In this way, according to the
[0046]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, the present invention will be described in detail according to embodiments.
FIG. 11 shows an embodiment of a
[0047]
The
[0048]
Here, the
[0049]
The program having the function of creating the work
[0050]
FIG. 12 shows an example of a processing flow executed by the work
[0051]
Next, processing of the
When the work
[0052]
Subsequently, in
[0053]
Subsequently, in
[0054]
Subsequently, in
[0055]
On the other hand, when it is determined in
[0056]
In this way, the work
[0057]
In this process, in consideration of the fact that the one-dimensional array starts from 1 in the Fortran, the work
[0058]
In this manner, when the list shown in FIG. 35A is given, the work
[0059]
In the
[0060]
On the other hand, when the
[0061]
Subsequently, in
[0062]
For example,
do j = 1, n
a (index (j)) = a (index (j)) + b (index (j)) * c (j)
end do
The operation of the calculation formula
do j = 1, kmax-v
! ocl novrec
do i = 1, maxcnt
if (kkxx-v (i, j) .gt.0) then
a (kkxx-v (i, j)) = a (kkxx-v (i, j)) + b (kkxx-v (i, j)) * c (llxx-v (i, j))
end if
end do
end do
kmax-v: Number of rows in the work array maxcnt: Number of memory banks
kkxx-v (i, j): Value of
llxx-v (i, j): value of
Thus, the
[0063]
From this point, the
[0064]
For example, the list shown in FIG. 35A is converted into a sequence of indexes as shown in FIG. 4, and the calculation processing of the calculation formula is executed according to the calculation order shown in FIG.
[0065]
In this way, when following the processing flow of FIG. 12 and FIG. 13, the
In the processing flow of FIG. 12, the work
[0066]
For example, when the list shown in FIG. 35A is given, if the
[0067]
In the processing flow of FIG. 12, the method for obtaining the remainder is not particularly described. However, when a power of 2 is used as the radix, the remainder of the index with respect to the radix is obtained by bit shift processing or bit mask processing. Therefore, the remainder can be easily obtained.
[0068]
For example, an index of 29 is expressed as “00011101” in binary notation, but the remainder for 29 of 8 is “101”, which is the lower 3 bits, so the lower 3 bits are extracted. By using bit shift processing or bit mask processing, the remainder can be easily obtained.
[0069]
In addition, in the processing flow of FIG. 13, a configuration is adopted in which an IF statement that avoids the calculation of the blank part of the index work array 23 (order work array 24) is employed, but the calculation is performed by filling the blank part. By doing so, this IF statement can be omitted. In other words, if the index shown in FIG. 4 is changed, the IF statement can be omitted if the calculation is performed in such a way that the blank portion of the index is filled.
[0070]
In the processing flow of FIG. 12, the
[0071]
Although not described in the processing flow of FIG. 12, when a long scientific calculation is performed, a calculation formula described by the
[0072]
In such a case, the work
[0073]
FIG. 16 shows an example of a processing flow executed by the work
[0074]
Next, processing of the
When the work
[0075]
Subsequently, in
[0076]
Subsequently, in
[0077]
On the other hand, when it is determined in
[0078]
In this way, the work
[0079]
In this way, when the list shown in FIG. 37 is given, the work
[0080]
In the work array shown in FIG. 7A, in the list shown in FIG. 37,
[0081]
On the other hand, when the
[0082]
Subsequently, in
[0083]
For example,
do j = 1, n
a (index (j)) = a (index (j)) + b (index (j)) * c (j)
end do
The operation of the calculation formula
n = 0
do n1 = 1, kxmax
akkx1n = a (index (n1))
bkkx1n = b (index (n1))
do n2 = 1, index-new (n1)
if (index-new (n1) .ne.0) then
n = n + 1
a (n1) = akkx1n + bkkx1n * c (llx (n))
end if
end do
kxmax: Number of rows in the work array
llxx: Value of work array in Fig. 7 (b)
index-new: Appearance for each indexTimes
akkx1n: Variable bkkx1n: Variable
Thus, the
[0084]
Thus, the
[0085]
For example, the list shown in FIG. 37 is converted into a sequence of indexes as shown in FIG. 8, and the calculation processing of the calculation formula is executed in accordance with the calculation order shown in FIG.
[0086]
In this way, when following the processing flow of FIG. 16 and FIG. 17, the
[0087]
The
[0089]
Further, in the processing flow of FIG. 16, the
[0090]
Further, although not described in the processing flow of FIG. 16, when a long scientific calculation is performed, a calculation formula described in the
[0091]
In such a case, the work
[0092]
FIG. 19 shows another embodiment of the
The
[0093]
Here, the
[0094]
The program having the function of creating the work
[0095]
FIG. 20 shows an example of a processing flow executed by the work
[0096]
Next, processing of the
When the work
[0097]
Subsequently, in
[0098]
On the other hand, as shown in the processing flow of FIG. 21, the
do j = 1, n
a (index (j)) = a (index (j)) + b (index (j)) * c (j)
end do
The operation of the calculation formula
do j = 1, kmax-v
! ocl novrec
do i = 1, maxcnt
if (kkxx-v (i, j) .gt.0) then
a (kkxx-v (i, j)) = a (kkxx-v (i, j)) + b (kkxx-v (i, j)) * c (llxx-v (i, j))
end if
end do
end do
kmax-v: Number of rows in the work array maxcnt: Number of memory banks
kkxx-v (i, j): value of the index work array 23a
llxx-v (i, j): value of the work array for order 24a
In this way, the calculation execution program 22a is created that is defined by changing the program format of the calculation formula to be calculated.
[0099]
Subsequently, in
do j = 1, n
a (index (j)) = a (index (j)) + b (index (j)) * c (j)
end do
The operation of the calculation formula
n = 0
do n1 = 1, kxmax
akkx1n = a (index (n1))
bkkx1n = b (index (n1))
do n2 = 1, index-new (n1)
if (index-new (n1) .ne.0) then
n = n + 1
a (n1) = akkx1n + bkkx1n * c (llx (n))
end if
end do
kxmax: Number of rows in the work array
llxx: Value of work array in Fig. 7 (b)
index-new: Appearance for each indexTimes
akkx1n: Variable bkkx1n: Variable
Thus, the
[0100]
On the other hand, when the
[0101]
For example, as shown in FIG. 23, this determination process compares the number of indexes m registered in the
[0102]
When it is determined in
[0103]
When started in this way, the
[0104]
For example, the list shown in FIG. 37 is converted into a sequence of indexes as shown in FIG. 8, and the calculation processing of the calculation formula is executed in accordance with the calculation order shown in FIG.
[0105]
On the other hand, when it is determined in
[0106]
When started in this way, the calculation execution program 22a is reconfigured so that the calculation formula to be calculated is calculated with the remainder system as the inner loop and the number of occurrences of the numerical value defined by the remainder as the outer loop. Thus, the calculation formula is calculated by accessing the memory bank in accordance with the calculation order designated by the index work array 23a (order work array 24a).
[0107]
For example, the list shown in FIG. 35A is converted into a sequence of indexes as shown in FIG. 4, and the calculation processing of the calculation formula is executed according to the calculation order shown in FIG.
[0108]
In this way, in the
[0109]
In the embodiment shown in FIG. 19, the index work array 23a and b and the order work array 24a and b are created in advance. First, the
[0110]
According to this method, when it is not necessary to create the index work array 23a and the order work array 24a, it is not necessary to create them.
FIG. 24 shows an embodiment of the
[0111]
In order to realize this method, the
[0112]
That is, in order to realize this method, the work
[0113]
When it is determined in this determination process that the array format in which the same index appears frequently is not indicated, the process proceeds to step 3 and the index work array 23a and the order work array are performed according to the processing flow of FIG. 24a is created, and in the
[0114]
In the above-described embodiments of FIG. 19 and FIG. 24, the configuration is such that either the calculation execution program 22a or the
[0115]
According to this method, when an index with a large number of appearances and an index with a small number of appearances coexist, the calculation process of the calculation formula can be executed at high speed.
[0116]
FIG. 26 shows an example of a processing flow executed by the work
When realizing this method, the work
[0117]
Subsequently, in
[0118]
Subsequently, in
[0119]
In this way, in the case of following the processing flow of FIG. 26, the work
[0120]
In response to the work sequence created by the work
The calculation execution program 22a described as described above executes the calculation processing of the calculation formula according to the index work array 23a and the order work array 24a for the index with a small number of appearances.
[0121]
In response to the work sequence created by the work
n = 0
do n1 = 1, kxmax
akkx1n = a (index (n1))
bkkx1n = b (index (n1))
do n2 = 1, index-new (n1)
if (index-new (n1) .ne.0) then
n = n + 1
a (n1) = akkx1n + bkkx1n * c (llx (n))
end if
end do
kxmax: Number of rows in the work array
llxx: Value of work array in Fig. 7 (b)
index-new: Appearance for each indexTimes
akkx1n: Variable bkkx1n: Variable
The
[0122]
Ultimately, the calculation results of the calculation formulas are obtained by adding the processing results of the calculation processes of the two calculation formulas.
Finally, application to a parallel system will be described.
[0123]
The application of the present invention is not limited to a computer having a single processor configuration, but can be applied to a computer having a parallel processor configuration as it is.
There are two types of parallel systems: a distributed memory system adopting the configuration shown in FIG. 29 (a) and a shared memory system adopting the configuration shown in FIG. 29 (b). Is applicable.
[0124]
However, when the present invention is applied to a distributed memory parallel system, for example, if the real bank address of the processor i (i = 0 to n) is described as “0 to m−1”, the
[0125]
When the present invention is applied to a parallel system, the example of the
[0126]
At this time, in order to equalize the load on each processor, as shown in FIG. 33, the
[0127]
Although the present invention has been described with reference to the illustrated embodiments, the present invention is not limited thereto. For example, in the example:
do j = 1, n
a (index (j)) = a (index (j)) + b (index (j)) * c (j)
end do
Although the present invention has been described using the calculation formula as a specific example, any calculation formula to which the present invention is applied may be used.
[0128]
【The invention's effect】
As described above, according to the present invention, by accessing the memory bank indicated by the index arranged in the list, access to the same memory bank can be performed when executing the calculation process of the prescribed calculation formula. By changing the list order of the list so that it is not continuous, memory busy is avoided and the calculation process can be executed at high speed.
[0129]
According to the present invention, when the calculation processing of the prescribed calculation formula is executed by accessing the memory bank indicated by the index arranged in the list, the data of the memory bank indicated by the same index is constant. By executing according to the scalar operation while setting as, vector memory access is reduced, and the calculation process can be executed at high speed.
[0130]
According to the present invention, the access to the memory bank pointed to by the index arranged in the list is performed when the calculation process of the prescribed calculation formula is executed, and the appearance of the same indexTimesWhen there is a lot of data, the data in the memory bank pointed to by the same index is set as a constant and executed according to a scalar operation. Appearance ofTimesWhen there is not a large number, the list of indexes in the list is changed so that accesses to the same memory bank do not continue, so that memory busy is avoided and the calculation process can be executed at high speed.
[0131]
Then, according to the present invention, when the calculation process of the prescribed calculation formula is executed by accessing the memory bank indicated by the index arranged in the list,TimesFor an index with a large number of indexes, the memory bank data pointed to by the same index is set as a constant and executed according to a scalar operation, thereby reducing vector memory access and allowing the calculation process to be executed at high speed.TimesFor an index with a small number of addresses, memory busy is avoided and the calculation process can be executed at high speed by changing the arrangement of the index in the list so that accesses to the same memory bank do not continue.
[Brief description of the drawings]
FIG. 1 is a principle configuration diagram of the present invention.
FIG. 2 is a principle configuration diagram of the present invention.
FIG. 3 is an explanatory diagram of the present invention.
FIG. 4 is an explanatory diagram of the present invention.
FIG. 5 is an explanatory diagram of the present invention.
FIG. 6 is an explanatory diagram of the present invention.
FIG. 7 is an explanatory diagram of the present invention.
FIG. 8 is an explanatory diagram of the present invention.
FIG. 9 is an explanatory diagram of the present invention.
FIG. 10 is an explanatory diagram of the present invention.
FIG. 11 shows an embodiment of the present invention.
FIG. 12 is a processing flow of a work array creation program.
FIG. 13 is a processing flow of a calculation change program.
FIG. 14 is a process explanatory diagram of a work array creation program.
FIG. 15 is a process explanatory diagram of a work array creation program.
FIG. 16 is a processing flow of a work array creation program.
FIG. 17 is a processing flow of a calculation change program.
FIG. 18 is a process explanatory diagram of a work array creation program.
FIG. 19 is another embodiment of the present invention.
FIG. 20 is a processing flow of a work array creation program.
FIG. 21 is a processing flow of a calculation change program.
FIG. 22 is a processing flow of an activation program.
FIG. 23 is an explanatory diagram of processing of a startup program.
FIG. 24 is another embodiment of the present invention.
FIG. 25 is a processing flow of a work array creation program.
FIG. 26 is a processing flow of a work array creation program.
FIG. 27 is an explanatory diagram of a list.
FIG. 28 is an explanatory diagram of a work arrangement.
FIG. 29 is an explanatory diagram of a parallel system.
FIG. 30 is an explanatory diagram of application to a parallel system.
FIG. 31 is an explanatory diagram of a list.
FIG. 32 is an explanatory diagram of application to a parallel system.
FIG. 33 is an explanatory diagram of application to a parallel system.
FIG. 34 is an explanatory diagram of a list.
FIG. 35 is an explanatory diagram of a prior art.
FIG. 36 is an explanatory diagram of the prior art.
FIG. 37 is an explanatory diagram of the prior art.
FIG. 38 is an explanatory diagram of a prior art.
FIG. 39 is an explanatory diagram of the prior art.
FIG. 40 is an explanatory diagram of the prior art.
[Explanation of symbols]
1 computer
2 Program converter
10a Creation means
11a Calculation means
20a First generation means
21a Second generation means
10b Creation means
11b Calculation means
20b First generation means
21b Second generation means
12b First creation means
12a Second creation means
13b First calculation means
13a Second calculation means
14 Starting means
15b First creation means
15a Second creation means
16b First calculation means
16a Second calculation means
Claims (16)
インデックスの基数に対する剰余を求めて、インデックスと該剰余の規定する数値との対応関係を管理する第1の作業配列を作成するとともに、インデックスとインデックスのリスト配列順序との対応関係を管理する第2の作業配列を作成する作成手段と、
上記算出式の演算を、剰余系を内側ループとし、剰余の規定する数値の出現回数を外側ループとする形式で再構成して、上記作成手段の作成する上記第1及び第2の作業配列の配列データに基づいてメモリバンクにアクセスすることで上記算出式を計算する計算手段とを備えることを、
特徴とする計算機。In the computer that executes the calculation process of the specified calculation formula by accessing the memory bank pointed to by the index arranged in the list,
A first work array for obtaining a remainder with respect to the radix of the index and managing a correspondence between the index and a numerical value defined by the remainder is created, and a second for managing the correspondence between the index and the list arrangement order of the index and creating means for creating a work array,
The operation of the above calculation formula, the coset is the inner loop, the number of occurrences of the numbers defining the remainder was reconstituted in the form of an outer loop, the first and second working sequence to create the creating means Comprising calculating means for calculating the calculation formula by accessing the memory bank based on the array data ,
A featured calculator.
上記作成手段は、メモリバンク数を基数として用いるか、メモリバンク数よりも小さな2の巾乗の値を基数として用いることを、
特徴とする計算機。The computer according to claim 1, wherein
The creation means uses the number of memory banks as a radix, or uses a value of a power of 2 smaller than the number of memory banks as a radix.
A featured calculator.
上記作成手段は、論理演算に従って、インデックスの基数に対する剰余を求めることを、
特徴とする計算機。The computer according to claim 1 or 2,
The creation means obtains a remainder for the index radix according to a logical operation.
A featured calculator.
上記計算手段は、上記作成手段の作成する上記第1及び第2の作業配列の持つ空白部分を飛ばしつつ計算処理を実行することを、
特徴とする計算機。In the computer in any one of Claims 1-3 ,
It said computing means to perform the calculation processing while skipping the blank portion with the said first and second working sequence to create the creation means,
A featured calculator.
インデックスとインデックスの出現回数との対応関係を管理する第1の作業配列を作成するとともに、インデックスとインデックスのリスト配列順序との対応関係を管理する第2の作業配列を作成する作成手段と、
上記算出式の演算を、インデックスの出現回数を内側ループとし、インデックス系を外側ループとするとともに、スカラー演算を用いる形式で再構成して、上記作成手段の作成する上記第1及び第2の作業配列の配列データに基づいて該スカラー演算を繰り返すことで上記算出式を計算する計算手段とを備えることを、
特徴とする計算機。In the computer that executes the calculation process of the specified calculation formula by accessing the memory bank pointed to by the index arranged in the list,
Creating means for creating a first work array for managing the correspondence between the index and the number of occurrences of the index, and creating a second work array for managing the correspondence between the index and the list arrangement order of the index;
The operation of the above calculation formula, and the number of occurrences of the index and the inner loop, as well as an index based outer loop, and reconstituted in a format using a scalar operations, the first and second work of creating the creation means Comprising calculating means for calculating the calculation formula by repeating the scalar calculation based on the array data of the array ,
A featured calculator.
上記作成手段は、ソーティング手法を用いて、インデックスとインデックスの出現回数との対応関係を管理する上記第1の作業配列を作成することを、
特徴とする計算機。The computer according to claim 5 , wherein
The creation means creates the first work array for managing the correspondence between the index and the number of appearances of the index using a sorting method.
A featured calculator.
上記作成手段は、上記算出式が反復計算されるときにあって、リストに変更がない場合には、既作成の上記第1及び第2の作業配列を有効なものと扱って該作業配列を作成しないように処理することを、
特徴とする計算機。In the computer in any one of Claims 1-6,
Said creating means, in the case where the calculation formula is iterative calculation, when there is no change in the list, the task sequence dealing with the first and second work array already prepared to be effective That you do n’t want to create
A featured calculator.
上記作成手段は、上記第1及び第2の作業配列の作成に先立って、該作業配列の大きさを求めて、それに応じて該作業配列の領域を確保することを、
特徴とする計算機。In the computer in any one of Claims 1-7,
It said creating means, prior to creation of the first and second working sequence, that seek the magnitude of the working sequences, which secures an area of the working sequence in response,
A featured calculator.
計算機が複数のプロセッサで構成されるときに、上記作成手段の作成する上記第1及び第2の作業配列が各プロセッサに分割されて配分されるように構成されることを、
特徴とする計算機。In the computer in any one of Claims 1-8,
When the computer is composed of a plurality of processors, to be configured to create the first and second working sequence of the creation means are distributed is divided into each processor,
A featured calculator.
インデックスとインデックスの出現回数との対応関係を管理する第1の作業配列を作成するとともに、インデックスとインデックスのリスト配列順序との対応関係を管理する第2の作業配列を作成する第1の作成手段と、
インデックスの基数に対する剰余を求めて、インデックスと該剰余の規定する数値との対応関係を管理する第3の作業配列を作成するとともに、インデックスとインデックスのリスト配列順序との対応関係を管理する第4の作業配列を作成する第2の作成手段と、
上記第1の作成手段の作成する上記第1及び第2の作業配列に対応付けて設けられて、上記算出式の演算を、インデックスの出現回数を内側ループとし、インデックス系を外側ループとするとともに、スカラー演算を用いる形式で再構成して、該作業配列の配列データに基づいて該スカラー演算を繰り返すことで上記算出式を計算する第1の計算手段と、
上記第2の作成手段の作成する上記第3及び第4の作業配列に対応付けて設けられて、上記算出式の演算を、剰余系を内側ループとし、剰余の規定する数値の出現回数を外側ループとする形式で再構成して、該作業配列の配列データに基づいてメモリバンクにアクセスすることで上記算出式を計算する第2の計算手段と、
上記第1の作成手段の作成する上記第1の作業配列の配列データに従って、上記第1の計算手段か上記第2の計算手段のいずれか一方を選択して起動する起動手段とを備えることを、
特徴とする計算機。In the computer that executes the calculation process of the specified calculation formula by accessing the memory bank pointed to by the index arranged in the list,
First creation means for creating a first work array for managing the correspondence between the index and the number of occurrences of the index and creating a second work array for managing the correspondence between the index and the list array order of the index When,
A fourth work sequence for managing the correspondence between the index and the list arrangement order of the index is created while obtaining a remainder with respect to the radix of the index and creating a third work array for managing the correspondence between the index and the numerical value defined by the remainder . A second creation means for creating a work array of
Provided in association with the first and second work arrangements created by the first creation means, and the calculation formula is operated with the number of occurrences of the index as an inner loop and the index system as an outer loop. reconfigures the format using a scalar operations, and a first calculating means for calculating the calculation formula by repeating the scalar operations on the basis of the sequence data the working sequence,
Provided in correspondence to the third and fourth working sequence to create the second creating means, the calculation of the calculation formula, the residue system with inner loop, the outer the number of occurrences of the numbers defining the remainder It was reconstituted in the form of a loop, and the second calculating means for calculating the calculation formula by accessing the memory bank based on the sequence data of the working sequence,
Starting means for selecting and activating either the first calculation means or the second calculation means in accordance with the array data of the first work sequence created by the first creation means. ,
A featured calculator.
上記第2の作成手段は、上記第2の計算手段が上記起動手段により起動される条件が成立するときに、上記第3及び第4の作業配列を作成するように処理することを、
特徴とする計算機。The computer according to claim 10, wherein
It said second creating means, when the condition that the second calculation means is activated by said activation means is established, that the process to create the third and fourth work sequences,
A featured calculator.
出現回数の多いインデックスを管理対象として、インデックスとインデックスの出現回数との対応関係を管理する第1の作業配列を作成するとともに、インデックスとインデックスのリスト配列順序との対応関係を管理する第2の作業配列を作成する第1の作成手段と、
上記第1の作成手段の作成する上記第1及び第2の作業配列に管理されるインデックス以外のインデックスを管理対象として、インデックスの基数に対する剰余を求めて、インデックスと該剰余の規定する数値との対応関係を管理する第3の作業配列を作成するとともに、インデックスとインデックスのリスト配列順序との対応関係を管理する第4の作業配列を作成する第2の作成手段と、
上記第1の作成手段の作成する上記第1及び第2の作業配列に管理されるインデックスを処理対象として、上記算出式の演算を、インデックスの出現回数を内側ループとし、インデックス系を外側ループとするとともに、スカラー演算を用いる形式で再構成して、該作業配列の配列データに基づいて該スカラー演算を繰り返すことで上記算出式を計算する第1の計算手段と、
上記第2の作成手段の作成する上記第3及び第4の作業配列に管理されるインデックスを処理対象として、上記算出式の演算を、剰余系を内側ループとし、剰余の規定する数値の出現回数を外側ループとする形式で再構成して、該作業配列の配列データに基づいてメモリバンクにアクセスすることで上記算出式を計算する第2の計算手段とを備えることを、
特徴とする計算機。In the computer that executes the calculation process of the specified calculation formula by accessing the memory bank pointed to by the index arranged in the list,
More index of appearance times as managed, index and thereby create a first working sequence for managing the correspondence between the number of occurrences of the index, the index and the second managing the correspondence between the list sequence order of the indexes A first creation means for creating a work array;
Using an index other than the index managed by the first and second work arrays created by the first creating means as a management target, a remainder with respect to the radix of the index is obtained, and an index and a numerical value defined by the remainder thereby creating a third work array for managing a correspondence relationship, and second generation means for generating a fourth work array for managing the correspondence between the list sequence order of the indexes and index,
With the index managed by the first and second work arrays created by the first creation means as a processing target, the calculation formula is calculated with the number of occurrences of the index as the inner loop, and the index system as the outer loop. as well as a first calculation means by reconstructing a format using a scalar operation, for calculating the calculation formula by repeating the scalar operations on the basis of the sequence data the working sequence,
As a processing index object to be managed in the third and fourth working sequence to create the second creating means, the calculation of the calculation formula, the residue system with inner loop, the number of occurrences of the numbers defining the remainder the was reconstituted in the form of an outer loop, further comprising a second calculating means for calculating the calculation formula by accessing the memory bank based on the sequence data of the working sequence,
A featured calculator.
インデックスの基数に対する剰余を求めて、インデックスと該剰余の規定する数値との対応関係を管理する第1の作業配列を作成するとともに、インデックスとインデックスのリスト配列順序との対応関係を管理する第2の作業配列を作成する処理を行うプログラムを生成する第1の生成手段と、
上記算出式の演算を、剰余系を内側ループとし、剰余の規定する数値の出現回数を外側ループとする形式で再構成して、上記作成手段の作成する上記第1及び第2の作業配列の配列データに基づいてメモリバンクにアクセスすることで上記算出式を計算する処理を行うプログラムを生成する第2の生成手段とを備えることを、
特徴とするプログラム変換装置。A program conversion device that compiles or converts a program that executes a calculation process of a specified calculation formula by accessing a memory bank indicated by an index arranged in a list,
A first work array for obtaining a remainder with respect to the radix of the index and managing a correspondence between the index and a numerical value defined by the remainder is created, and a second for managing the correspondence between the index and the list arrangement order of the index First generation means for generating a program for performing a process of creating the work array;
The operation of the above calculation formula, the coset is the inner loop, the number of occurrences of the numbers defining the remainder was reconstituted in the form of an outer loop, the first and second working sequence to create the creating means Comprising a second generation means for generating a program for performing a process of calculating the calculation formula by accessing the memory bank based on the array data .
A program conversion device.
インデックスとインデックスの出現回数との対応関係を管理する第1の作業配列を作成するとともに、インデックスとインデックスのリスト配列順序との対応関係を管理する第2の作業配列を作成する処理を行うプログラムを生成する第1の生成手段と、
上記算出式の演算を、インデックスの出現回数を内側ループとし、インデックス系を外側ループとするとともに、スカラー演算を用いる形式で再構成して、上記作成手段の作成する上記第1及び第2の作業配列の配列データに基づいて該スカラー演算を繰り返すことで上記算出式を計算する処理を行うプログラムを生成する第2の生成手段とを備えることを、
特徴とするプログラム変換装置。A program conversion device that compiles or converts a program that executes a calculation process of a specified calculation formula by accessing a memory bank indicated by an index arranged in a list,
A program that creates a first work array that manages the correspondence between an index and the number of occurrences of the index, and that creates a second work array that manages the correspondence between the index and the list array order of the index. First generating means for generating;
The operation of the above calculation formula, and the number of occurrences of the index and the inner loop, as well as an index based outer loop, and reconstituted in a format using a scalar operations, the first and second work of creating the creation means Second generation means for generating a program for performing processing for calculating the calculation formula by repeating the scalar calculation based on the array data of the array ,
A program conversion device.
インデックスの基数に対する剰余を求めて、インデックスと該剰余の規定する数値との対応関係を管理する第1の作業配列を作成するとともに、インデックスとインデックスのリスト配列順序との対応関係を管理する第2の作業配列を作成する作成処理と、
上記算出式の演算を、剰余系を内側ループとし、剰余の規定する数値の出現回数を外側ループとする形式で再構成して、上記作成処理の作成する上記第1及び第2の作業配列の配列データに基づいてメモリバンクにアクセスすることで上記算出式を計算する計算処理とをコンピュータに実行させるプログラムが格納されることを、
特徴とするプログラム記録媒体。A program recording medium storing a program used to realize a computer that executes a calculation process of a specified calculation formula by accessing a memory bank indicated by an index arranged in a list,
A first work array for obtaining a remainder with respect to the radix of the index and managing a correspondence between the index and a numerical value defined by the remainder is created, and a second for managing the correspondence between the index and the list arrangement order of the index and the creation process of creating a work array,
The operation of the above calculation formula, the coset is the inner loop, the number of occurrences of the numbers defining the remainder was reconstituted in the form of an outer loop, the first and second working sequence to create the creation process A program for causing a computer to execute a calculation process for calculating the above calculation formula by accessing a memory bank based on array data is stored.
A program recording medium.
インデックスとインデックスの出現回数との対応関係を管理する第1の作業配列を作成するとともに、インデックスとインデックスのリスト配列順序との対応関係を管理する第2の作業配列を作成する作成処理と、
上記算出式の演算を、インデックスの出現回数を内側ループとし、インデックス系を外側ループとするとともに、スカラー演算を用いる形式で再構成して、上記作成処理の作成する上記第1及び第2の作業配列の配列データに基づいて該スカラー演算を繰り返すことで上記算出式を計算する計算処理とをコンピュータに実行させるプログラムが格納されることを、
特徴とするプログラム記録媒体。A program recording medium storing a program used to realize a computer that executes a calculation process of a specified calculation formula by accessing a memory bank indicated by an index arranged in a list,
Creating a first work array that manages the correspondence between the index and the number of occurrences of the index, and creating a second work array that manages the correspondence between the index and the list array order of the index;
The first and second operations of creating the creation process are performed by reconstructing the calculation formula using the index appearance count as an inner loop and the index system as an outer loop and using a scalar calculation. Storing a program for causing a computer to execute a calculation process for calculating the calculation formula by repeating the scalar calculation based on the array data of the array ,
A program recording medium.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP20495398A JP3686261B2 (en) | 1998-07-21 | 1998-07-21 | Computer, program conversion device, and program recording medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP20495398A JP3686261B2 (en) | 1998-07-21 | 1998-07-21 | Computer, program conversion device, and program recording medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2000035892A JP2000035892A (en) | 2000-02-02 |
| JP3686261B2 true JP3686261B2 (en) | 2005-08-24 |
Family
ID=16499058
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP20495398A Expired - Fee Related JP3686261B2 (en) | 1998-07-21 | 1998-07-21 | Computer, program conversion device, and program recording medium |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3686261B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2012131820A1 (en) * | 2011-03-31 | 2012-10-04 | 日本電気株式会社 | Information processing method, non-temporary computer-readable medium on which program is stored, and information processing device |
-
1998
- 1998-07-21 JP JP20495398A patent/JP3686261B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2000035892A (en) | 2000-02-02 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| KR100997024B1 (en) | Systems, methods and computer readable recording media for performing scan operations | |
| JP3033203B2 (en) | Wiring route searching device and wiring route searching method | |
| Parsons et al. | A++/P++ array classes for architecture independent finite difference computations | |
| CN113313247B (en) | Operation method of sparse neural network based on data flow architecture | |
| CN116822422A (en) | Analysis optimization method of digital logic circuit and related equipment | |
| US8959309B2 (en) | Skip list generation | |
| US20100325083A1 (en) | Skip list generation | |
| US7143272B2 (en) | Using computation histories to make predictions | |
| Memik et al. | Analysis and FPGA implementation of image restoration under resource constraints | |
| US11226798B2 (en) | Information processing device and information processing method | |
| WO2016024508A1 (en) | Multiprocessor device | |
| JP3686261B2 (en) | Computer, program conversion device, and program recording medium | |
| JP3413344B2 (en) | Image processing apparatus and operation method thereof | |
| CN120596097A (en) | In-memory computing architecture compilation method, device, electronic device and system on chip | |
| CN120218241A (en) | Reasoning method, device, electronic device and medium for large language model | |
| Höreth | Implementation of a multiple-domain decision diagram package | |
| CN117540669B (en) | Method and device for processing structured data of digital circuit | |
| CN114661430A (en) | Data processing method and device, electronic equipment and storage medium | |
| Stergiou et al. | Dynamically resizable binary decision diagrams | |
| JP6961950B2 (en) | Storage method, storage device and storage program | |
| JPH06214803A (en) | Virtual space block arranging system | |
| US5870603A (en) | Method and system for storing exponent codes in a multi-processor computer to produce putputs according to an execution schedule | |
| JP7622563B2 (en) | DATA PLACEMENT PROGRAM, PROCESSOR, AND DATA PLACEMENT METHOD | |
| US20250348330A1 (en) | Information processing apparatus and information processing method | |
| JP7168731B1 (en) | MEMORY ACCESS CONTROL DEVICE, MEMORY ACCESS CONTROL METHOD, AND MEMORY ACCESS CONTROL PROGRAM |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20041222 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20050118 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20050322 |
|
| TRDD | Decision of grant or rejection written | ||
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20050531 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20050602 |
|
| R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090610 Year of fee payment: 4 |
|
| LAPS | Cancellation because of no payment of annual fees |