JPWO2008155852A1 - Method and apparatus for aggregating tabular data in a shared memory parallel processing system - Google Patents
Method and apparatus for aggregating tabular data in a shared memory parallel processing system Download PDFInfo
- Publication number
- JPWO2008155852A1 JPWO2008155852A1 JP2009520206A JP2009520206A JPWO2008155852A1 JP WO2008155852 A1 JPWO2008155852 A1 JP WO2008155852A1 JP 2009520206 A JP2009520206 A JP 2009520206A JP 2009520206 A JP2009520206 A JP 2009520206A JP WO2008155852 A1 JPWO2008155852 A1 JP WO2008155852A1
- Authority
- JP
- Japan
- Prior art keywords
- array
- item
- item value
- parallel
- record
- 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.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2455—Query execution
- G06F16/24553—Query execution of query operations
- G06F16/24554—Unary operations; Data partitioning operations
- G06F16/24556—Aggregation; Duplicate elimination
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/28—Databases characterised by their database models, e.g. relational or object models
- G06F16/283—Multi-dimensional databases or data warehouses, e.g. MOLAP or ROLAP
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Multi Processors (AREA)
Abstract
メモリ共有型マルチプロセッサシステムにおいて、所定の項目の組に関する一意の項目値の組を抽出するために、所定の項目の組に関する項目値の組に対応する項目値番号の組の出現回数を並列的に数え上げ、出現回数の累積度数分布を表現する累積度数分布配列を共有メモリに生成し、レコード番号配列の要素の値を添字として使って項目値番号の組を並列的に読み出し、項目値番号の組を添字として使って累積度数分布配列の要素を並列的に読み出し、累積度数分布配列の要素をインデックスポインタとして利用してレコード番号配列の要素の値をソートされたレコード番号配列に並列的に格納し、インデックスポインタとして利用された累積度数分布配列の要素の値に従ってソートされたレコード番号配列を一意の項目値の組を有するレコードのレコード番号のグループに区分し、区分されたレコード番号の各グループから1個のレコード番号を抽出する。In a shared memory multiprocessor system, in order to extract a unique set of item values related to a set of predetermined items, the number of occurrences of a set of item value numbers corresponding to the set of item values related to the set of predetermined items is calculated in parallel. Generate a cumulative frequency distribution array that expresses the cumulative frequency distribution of the number of occurrences in the shared memory, read the item value number pairs in parallel using the element value of the record number array as a subscript, Reads the elements of the cumulative frequency distribution array in parallel using the tuple as a subscript, and stores the values of the elements of the record number array in parallel in the sorted record number array using the elements of the cumulative frequency distribution array as the index pointer And the record number array sorted according to the value of the element of the cumulative frequency distribution array used as the index pointer has a unique set of field values Divided into groups of record number code, and extracts one record number from the group of segmented record number.
Description
本発明は、メモリ共有型並列処理システム、特に、対称型マルチプロセッサ(Symmetric Multiple Processor)システムにおいて、表形式データから一意の項目値の組を抽出する方法及び装置に関係する。また、本発明は、共有メモリにアクセスする複数台のプロセッサを備えるコンピュータに、表形式データから一意の項目値の組を抽出するコードを実行させるプログラムに関係する。また、本発明は、上記方法を共有メモリにアクセスする複数台のプロセッサを備えるコンピュータに実行させるためのコンピュータプログラムプロダクト、及び、コンピュータプログラムが記録された記録媒体に関係する。 The present invention relates to a method and apparatus for extracting a unique set of item values from tabular data in a memory-sharing parallel processing system, particularly, a symmetric multiprocessor system. The present invention also relates to a program for causing a computer including a plurality of processors accessing a shared memory to execute a code for extracting a unique set of item values from tabular data. The present invention also relates to a computer program product for causing a computer including a plurality of processors that access a shared memory to execute the above method, and a recording medium on which the computer program is recorded.
本発明は、さらに、メモリ共有型並列処理システム、特に、対称型マルチプロセッサシステムにおいて、表形式データを多次元で集計する方法及び装置に関係する。また、本発明は、共有メモリにアクセスする複数台のプロセッサを備えるコンピュータに、表形式データを多次元で集計するコードを実行させるプログラムに関係する。また、本発明は、上記方法を共有メモリにアクセスする複数台のプロセッサを備えるコンピュータに実行させるためのコンピュータプログラムプロダクト、及び、コンピュータプログラムが記録された記録媒体に関係する。 The present invention further relates to a method and apparatus for tabulating tabular data in a multi-dimensional manner in a memory-sharing parallel processing system, particularly a symmetric multiprocessor system. The present invention also relates to a program for causing a computer including a plurality of processors that access a shared memory to execute a code for tabulating tabular data in a multidimensional manner. The present invention also relates to a computer program product for causing a computer including a plurality of processors that access a shared memory to execute the above method, and a recording medium on which the computer program is recorded.
従来、産業上の様々な分野において、大規模データを高速に処理することが求められている。大規模データの処理は、キャッシュやプリフェッチなどによるメモリアクセスの高速化、メモリ自体の高速化、及び、プロセッサの並列化のような演算処理の高速化、といったハードウェア技術の開発、ならびに、データ処理アルゴリズムの開発によって、高速化され続けている。たとえば、本発明者は、大規模データを高速に処理するため、特許文献1に記載されているような、「オンメモリデータ処理アルゴリズム」を提案している。
Conventionally, it is required to process large-scale data at high speed in various industrial fields. For large-scale data processing, development of hardware technologies such as high-speed memory access by cache and prefetch, high-speed memory, and high-speed arithmetic processing such as parallel processing of processors, and data processing The development of algorithms continues to speed up. For example, the present inventor has proposed an “on-memory data processing algorithm” as described in
また、大規模データを処理するために、効率の良いアルゴリズムが開発されている。大規模データ、特に、大規模な表形式データを処理する際に頻出する処理はソートである。効率的なソートアルゴリズムとして、基数(RADIX)ソートとカウンティング(COUNTING)ソート(計数ソート、分布数え上げソートとも称される)が知られている。カウンティングソートは基数ソートの各桁のソートに利用されることがあり、効率の良いアルゴリズムである。 In addition, efficient algorithms have been developed for processing large-scale data. Sorting is a process that occurs frequently when processing large-scale data, particularly large-scale tabular data. As an efficient sorting algorithm, a radix (RADIX) sort and a counting (COUNTING) sort (also called a count sort or a distribution counting sort) are known. The counting sort is sometimes used for sorting each digit of the radix sort and is an efficient algorithm.
近年、複数個のプロセッサが並列に動作するマルチプロセッサや、1チップ上に複数個のCPUコアが搭載されたマルチコアプロセッサ、特に、複数個のCPUが同等に処理を分担する対称型マルチプロセッサのようなメモリ共有型並列処理システムが設計されている。大規模データの検索・集計・ソート等の処理は、多くの場合に大規模データに同じ演算を適用するので、特に、対称型マルチプロセッサは大規模データの高速処理に適していると考えられる。これに関して、本発明者は、特許文献2に記載されているように、大規模な表形式データを処理するために、効率的なソートアルゴリズムと組み合わされたメモリ共有型マルチプロセッサシステムを提案している。
In recent years, a multiprocessor in which a plurality of processors operate in parallel, a multicore processor in which a plurality of CPU cores are mounted on one chip, in particular, a symmetric multiprocessor in which a plurality of CPUs share processing equally. A shared memory parallel processing system has been designed. Since processing such as retrieval, aggregation, and sorting of large-scale data often applies the same operation to large-scale data, it is considered that a symmetric multiprocessor is particularly suitable for high-speed processing of large-scale data. In this regard, the inventor has proposed a memory-shared multiprocessor system combined with an efficient sorting algorithm to process large-scale tabular data as described in
特許文献2に記載されたメモリ共有型マルチプロセッサシステムでは、最初に、処理対象のレコードが分割されて複数台のプロセッサへ割り当てられる。次に、各プロセッサが処理対象のレコードに関連付けられた項目値番号のローカルな出現回数をカウントする。次に、各プロセッサでカウントされた項目値番号のローカルな出現回数を、項目値番号のグローバルな累計数、すなわち、複数台のプロセッサ間で共通に用いられる累計数に変換する。最後に、各プロセッサは、このグローバルな累計数をポインタとして利用することにより、割り当てられたレコードの順序を入れ替える。処理対象のレコードの複数台のプロセッサへの割り当て、ローカルな出現回数のカウント、及び、割り当てられたレコードの順序の入れ替えは、複数台のプロセッサが並列に処理可能である。また、グローバルな累計数の算出は、複数台のプロセッサの並列処理を利用してもよいが、メモリにシーケンシャルにアクセスできるためキャッシュへのヒット率が高いので、1台又は一部のプロセッサだけが担当して高速性を維持できる。
In the memory shared multiprocessor system described in
このように、特許文献2には、メモリ共有型並列ソート技術が開示されているが、メモリ共有型並列集計技術は記載されていない。また、本発明者は、特許文献3に記載されているように、メモリ分散型並列集計技術を既に提案している。メモリ共有型とメモリ分散型とを問わず、集計とは、例えば、情報の項目に対応した項目値を含むレコードの配列として表される表形式データから、ある項目(次元)のある項目値(次元値)毎に、別の項目の項目値に基づく数量(測度)を算出することである。測度の算出とは、測度の個数をカウントしたり、測度の総和を算出したり、測度の平均値を算出したりすることである。また、次元数は、2次元以上でも構わない。例えば、年齢という項目と、身長という項目と、体重という項目を含む表形式データである場合に、年齢・身長別に体重の平均値を求める処理は、年齢と身長を次元とし、体重の平均値を測度とする集計処理である。
Thus,
このような集計処理では、最初に、次元を設定し、次元値毎にレコードを分類することが必要である。次元値毎にレコードを分類するために、次元値に関してレコードをソートする処理を利用することが可能である。特に、多次元集計においては、レコードを次元値の組毎にグループ化し、同一のグループに属するレコードに含まれる項目値に基づく測度を算出することによって、表形式データ全体の集計が達成される。よって、メモリ共有型マルチプロセッサシステムにおいて、大規模な表形式データを高速集計するためには、集計のための、特に、多次元集計のための次元を高速に作成する技術が必要である。
本発明の目的は、上記の従来技術の問題点に鑑みて、メモリ共有型並列処理システムにおいて、表形式データから、多次元集計のための次元を表現する一意の項目値の組を効率的に抽出する方法を提供することである。 In view of the above-described problems of the prior art, an object of the present invention is to efficiently generate a set of unique item values representing a dimension for multidimensional aggregation from tabular data in a memory shared parallel processing system. It is to provide a method of extraction.
本発明のさらなる目的は、上記の従来技術の問題点に鑑みて、メモリ共有型並列処理システムにおいて、表形式データから、多次元集計のための次元を表現する一意の項目値の組を効率的に抽出する装置を提供することである。 In view of the above-described problems of the conventional technology, a further object of the present invention is to efficiently generate a set of unique item values representing a dimension for multidimensional aggregation from tabular data in a memory shared parallel processing system. It is to provide a device for extraction.
本発明は、さらに、メモリ共有型並列処理システムにおいて、表形式データの多次元集計を効率的に実行する方法及び装置の提供を目的とする。 It is another object of the present invention to provide a method and apparatus for efficiently executing multidimensional aggregation of tabular data in a memory shared parallel processing system.
上記本発明の目的を達成するため、本発明の一態様によれば、表形式データのレコードのレコード番号が所定のレコード順に従って格納されたレコード番号配列、上記表形式データの上記レコードの所定の項目の項目値に対応する項目値番号がレコード番号に従って格納された項目値番号配列、及び、上記表形式データの項目値が当該項目値に対応する項目値番号の順序に従って格納された項目値配列を記憶する共有メモリと、
上記共有メモリにアクセス可能である複数台のプロセッサと、
を備えたメモリ共有型マルチプロセッサシステムにおいて、
所定の項目の組に関する一意の項目値の組を抽出する方法であって、
(a)上記複数台のプロセッサを用いて、上記所定の項目の組に関する項目値の組に対応する項目値番号の組の出現回数を並列的に数え上げ、上記出現回数の累積度数分布を表現する累積度数分布配列を上記共有メモリに生成するステップと、
(b)上記複数台のプロセッサを用いて、上記レコード番号配列の要素の値を添字として使って上記項目値番号の組を並列的に読み出し、上記項目値番号の組より計算された値を添字として使って上記累積度数分布配列の要素を並列的に読み出し、上記累積度数分布配列の要素をインデックスポインタとして利用して上記レコード番号配列の要素の値をソートバージョンのレコード番号配列(すなわち、ソートされたレコード番号配列)に並列的に格納するステップと、
(c)上記インデックスポインタとして利用された上記累積度数分布配列の要素の値に従って上記ソートされたレコード番号配列を上記一意の項目値の組を有するレコードのレコード番号のグループに区分するステップと、
(d)上記区分されたレコード番号の各グループから1個のレコード番号を抽出することにより、上記一意の項目値の組を特定するステップと、
を備える方法が提供される。In order to achieve the object of the present invention, according to one aspect of the present invention, a record number array in which record numbers of records of tabular data are stored in a predetermined record order, a predetermined number of records of the tabular data An item value number array in which item value numbers corresponding to item values of items are stored according to record numbers, and an item value array in which the item values of the above-mentioned tabular data are stored in the order of item value numbers corresponding to the item values A shared memory for storing
A plurality of processors capable of accessing the shared memory;
In a shared memory multiprocessor system with
A method for extracting a unique set of item values for a given set of items, comprising:
(A) Using the plurality of processors, the number of occurrences of item value number pairs corresponding to the item value pairs relating to the predetermined item set is counted in parallel to express the cumulative frequency distribution of the appearance times. Generating a cumulative frequency distribution array in the shared memory;
(B) Using the plurality of processors, using the values of the elements of the record number array as subscripts, the item value number pairs are read in parallel, and the values calculated from the item value number pairs are subscripted. Are used to read the elements of the cumulative frequency distribution array in parallel, and use the elements of the cumulative frequency distribution array as index pointers to convert the values of the elements of the record number array into the record number arrays of sorted versions (ie, sorted Stored in parallel in the record number array),
(C) partitioning the sorted record number array according to the value of the element of the cumulative frequency distribution array used as the index pointer into a group of record numbers of records having the set of unique item values;
(D) identifying one set of unique item values by extracting one record number from each group of the segmented record numbers;
A method comprising:
さらに、本発明の方法は、上記累積度数分布配列を上記共有メモリに並列的に生成するステップ(a)が、上記複数台のプロセッサを用いて、上記レコード番号配列に格納された上記レコード番号毎に、上記所定の項目の組に関する項目値の組に対応する項目値番号の組に含まれる上記項目値番号の範囲に応じて基数を設定することにより、上記項目値番号の組を、上記項目値番号の組に含まれる各項目値番号が各桁を表現する基数形式の仮想項目値番号に変換するステップを備えることを特徴とする。 Further, in the method of the present invention, the step (a) of generating the cumulative frequency distribution array in parallel in the shared memory is performed for each record number stored in the record number array using the plurality of processors. In addition, by setting the radix according to the range of the item value numbers included in the set of item value numbers corresponding to the set of item values related to the set of predetermined items, the set of item value numbers is A step of converting each item value number included in the set of value numbers into a virtual item value number in a radix format expressing each digit is provided.
さらに、本発明の方法は、上記所定の項目の組に含まれる項目毎に上記累積度数分布配列を上記共有メモリに並列的に生成するステップ(i)と、上記所定の項目の組に含まれる項目毎に上記レコード番号配列の要素の値を上記ソートされたレコード番号配列に並列的に格納するステップ(ii)と、上記所定の項目の組に含まれる項目毎に上記ソートされたレコード番号配列を上記一意の項目値の組を有するレコードのレコード番号のグループに区分するステップ(iii)とを備え、
上記累積度数分布配列を上記共有メモリに並列的に生成するステップ(i)が、上記複数台のプロセッサを用いて、上記項目に関する項目値に対応する項目値番号の出現回数を並列的に数え上げ、上記出現回数の累積度数分布を表現する累積度数分布配列を上記共有メモリに並列的に生成するステップを備え、
上記レコード番号配列の要素を上記ソートされたレコード番号配列に並列的に格納するステップ(ii)が、上記複数台のプロセッサを用いて、上記項目値番号配列の要素の値を添字として使って上記項目値番号を並列的に読み出し、上記項目値番号を添字として使って上記累積度数分布配列の要素を並列的に読み出し、上記累積度数分布配列の要素をインデックスポインタとして利用して上記レコード番号配列の要素の値を上記ソートされたレコード番号配列に並列的に格納するステップを備えることを特徴とする。Further, the method of the present invention includes the step (i) of generating the cumulative frequency distribution array in parallel in the shared memory for each item included in the predetermined item set, and the predetermined item set. (Ii) storing the values of the elements of the record number array in parallel in the sorted record number array for each item, and the sorted record number array for each item included in the predetermined set of items And (iii) dividing the record into groups of record numbers of records having the unique field value pairs,
The step (i) of generating the cumulative frequency distribution array in the shared memory in parallel uses the plurality of processors to count in parallel the number of occurrences of the item value number corresponding to the item value related to the item, Generating a cumulative frequency distribution array representing the cumulative frequency distribution of the occurrence counts in parallel in the shared memory,
The step (ii) of storing the elements of the record number array in parallel in the sorted record number array is performed using the plurality of processors and the values of the element of the item value number array as subscripts. Read the item value number in parallel, read the element of the cumulative frequency distribution array in parallel using the item value number as a subscript, and use the element of the cumulative frequency distribution array as an index pointer in the record number array A step of storing the element values in parallel in the sorted record number array is provided.
さらに、本発明の方法は、(e)上記複数台のプロセッサを用いて、上記所定の項目値の組毎に別の項目に関する項目値を並列的に集計するステップをさらに備えることを特徴とする。 Furthermore, the method of the present invention further includes the step of (e) totalizing item values related to different items for each set of the predetermined item values in parallel using the plurality of processors. .
さらに、本発明の方法は、(f)上記複数台のプロセッサを用いて、上記ソートされたレコード番号配列中のレコード番号及び前記レコード番号に対応するグループのグループ番号を、前記レコード番号を添字として使って、補助的なレコード番号配列及び補助的なグループ番号配列に並列的に格納するステップと、
(g)上記複数台のプロセッサを用いて、上記補助的なレコード番号配列の要素を添字として使って上記別の項目に関する項目値番号配列から並列的に要素を読み出し、前記項目値番号配列の要素を添字として使って上記別の項目に関する項目値配列から並列的に項目値を読み出し、上記補助的なレコード番号配列の要素を添字として使って上記補助的なグループ番号配列の要素を読み出し、上記補助的なグループ番号配列の要素を集計配列の添字として使って上記読み出された項目値の集計結果を上記集計配列に格納するステップと、
をさらに備えることを特徴とする。Further, according to the method of the present invention, (f) using the plurality of processors, the record number in the sorted record number array and the group number of the group corresponding to the record number are used as the subscript. And storing in parallel in an auxiliary record number array and an auxiliary group number array;
(G) Using the plurality of processors, elements in the item value number array are read out in parallel from the item value number array relating to the other item using the elements in the auxiliary record number array as subscripts. Is used as a subscript to read the item value in parallel from the item value array for the other item, and the auxiliary record number array element is used as a subscript to read the auxiliary group number array element. Storing the aggregation result of the read item value in the aggregation array using an element of a typical group number array as a subscript of the aggregation array;
Is further provided.
さらに、本発明の方法は、(h)上記複数台のプロセッサを用いて、上記ソートされたレコード番号配列の要素を添字として使って上記別の項目に関する項目値番号配列から並列的に要素を読み出し、前記項目値番号配列の要素を添字として使って上記別の項目に関する項目値配列から並列的に項目値を読み出し、上記ソートされたレコード番号配列の要素に対応するグループのグループ番号を集計配列の添字として使って上記読み出された項目値の集計結果を上記集計配列に格納するステップをさらに備えることを特徴とする。 Furthermore, the method of the present invention includes (h) using the plurality of processors to read elements in parallel from the item value number array relating to the other item using the elements of the sorted record number array as subscripts. , Reading the item value in parallel from the item value array relating to the other item using the element of the item value number array as a subscript, and the group number of the group corresponding to the element of the sorted record number array is The method further comprises the step of storing the totaled result of the read item values in the totaling array using the subscript as a subscript.
上記本発明のさらなる目的を達成するため、本発明の一態様によれば、表形式データのレコードのレコード番号が所定のレコード順に従って格納されたレコード番号配列、上記表形式データの上記レコードの所定の項目の項目値に対応する項目値番号がレコード番号に従って格納された項目値番号配列、及び、上記表形式データの項目値が当該項目値に対応する項目値番号の順序に従って格納された項目値配列を記憶する共有メモリと、
上記共有メモリにアクセス可能である複数台のプロセッサと、
を備えたメモリ共有型マルチプロセッサシステムにおいて、
所定の項目の組に関する一意の項目値の組を抽出する装置であって、
(a)上記複数台のプロセッサを用いて、上記所定の項目の組に関する項目値の組に対応する項目値番号の組の出現回数を並列的に数え上げ、上記出現回数の累積度数分布を表現する累積度数分布配列を上記共有メモリに生成する手段と、
(b)上記複数台のプロセッサを用いて、上記レコード番号配列の要素の値を添字として使って上記項目値番号の組を並列的に読み出し、上記項目値番号の組より計算された値を添字として使って上記累積度数分布配列の要素を並列的に読み出し、上記累積度数分布配列の要素をインデックスポインタとして利用して上記レコード番号配列の要素の値をソートバージョンのレコード番号配列(すなわち、ソートされたレコード番号配列)に並列的に格納する手段と、
(c)上記インデックスポインタとして利用された上記累積度数分布配列の要素の値に従って上記ソートされたレコード番号配列を上記一意の項目値の組を有するレコードのレコード番号のグループに区分する手段と、
(d)上記区分されたレコード番号の各グループから1個のレコード番号を抽出することにより、上記一意の項目値の組を特定する手段と、
を備える装置が提供される。In order to achieve the further object of the present invention, according to one aspect of the present invention, a record number array in which record numbers of records in tabular data are stored in a predetermined record order, a predetermined number of records in the tabular data, An item value number array in which item value numbers corresponding to item values of items in the table are stored according to the record number, and an item value in which the item values of the tabular data are stored in the order of the item value numbers corresponding to the item values A shared memory for storing the array;
A plurality of processors capable of accessing the shared memory;
In a shared memory multiprocessor system with
A device that extracts a unique set of item values for a given set of items,
(A) Using the plurality of processors, the number of occurrences of a set of item value numbers corresponding to the set of item values relating to the set of predetermined items is counted in parallel, and the cumulative frequency distribution of the number of appearances is expressed. Means for generating a cumulative frequency distribution array in the shared memory;
(B) Using the plurality of processors, using the values of the elements of the record number array as subscripts, the item value number pairs are read in parallel, and the values calculated from the item value number pairs are subscripted. Are used to read the elements of the cumulative frequency distribution array in parallel, and use the elements of the cumulative frequency distribution array as index pointers to change the values of the elements of the record number array to the sorted version of the record number array (i.e., sorted A record number array) in parallel,
(C) means for dividing the sorted record number array into record number groups of records having the unique item value pairs according to the values of the elements of the cumulative frequency distribution array used as the index pointer;
(D) means for identifying the set of unique item values by extracting one record number from each group of the divided record numbers;
An apparatus comprising:
さらに本発明の一態様によれば、表形式データのレコードのレコード番号が所定のレコード順に従って格納されたレコード番号配列、上記表形式データの上記レコードの所定の項目の項目値に対応する項目値番号がレコード番号に従って格納された項目値番号配列、及び、上記表形式データの項目値が当該項目値に対応する項目値番号の順序に従って格納された項目値配列を記憶する共有メモリと、
上記共有メモリにアクセス可能である複数台のプロセッサと、
を備えたコンピュータにロードされ、所定の項目の組に関する一意の項目値の組を抽出するコードを上記コンピュータに実行させるコンピュータ読み取り可能なプログラムであって、
(a)上記複数台のプロセッサを用いて、上記所定の項目の組に関する項目値の組に対応する項目値番号の組の出現回数を並列的に数え上げ、上記出現回数の累積度数分布を表現する累積度数分布配列を上記共有メモリに生成するコードと、
(b)上記複数台のプロセッサを用いて、上記レコード番号配列の要素の値を添字として使って上記項目値番号の組を並列的に読み出し、上記項目値番号の組より計算された値を添字として使って上記累積度数分布配列の要素を並列的に読み出し、上記累積度数分布配列の要素をインデックスポインタとして利用して上記レコード番号配列の要素の値をソートバージョンのレコード番号配列(すなわち、ソートされたレコード番号配列)に並列的に格納するコードと、
(c)上記インデックスポインタとして利用された上記累積度数分布配列の要素の値に従って上記ソートされたレコード番号配列を上記一意の項目値の組を有するレコードのレコード番号のグループに区分するコードと、
(d)上記区分されたレコード番号の各グループから1個のレコード番号を抽出することにより、上記一意の項目値の組を特定するコードと、
を含むプログラムが提供される。Furthermore, according to one aspect of the present invention, a record number array in which the record numbers of the records in the tabular data are stored according to a predetermined record order, and the item values corresponding to the item values of the predetermined items in the records of the tabular data An item value number array in which numbers are stored according to record numbers, and a shared memory for storing item value arrays in which the item values of the tabular data are stored in accordance with the order of the item value numbers corresponding to the item values
A plurality of processors capable of accessing the shared memory;
A computer-readable program that causes a computer to execute code for extracting a unique set of item values for a predetermined set of items, loaded on a computer comprising:
(A) Using the plurality of processors, the number of occurrences of item value number pairs corresponding to the item value pairs relating to the predetermined item set is counted in parallel to express the cumulative frequency distribution of the appearance times. Code for generating a cumulative frequency distribution array in the shared memory;
(B) Using the plurality of processors, using the values of the elements of the record number array as subscripts, the item value number pairs are read in parallel, and the values calculated from the item value number pairs are subscripted. Are used to read the elements of the cumulative frequency distribution array in parallel, and use the elements of the cumulative frequency distribution array as index pointers to convert the values of the elements of the record number array into the record number arrays of sorted versions (ie, sorted Code stored in parallel in the record number array)
(C) a code that divides the sorted record number array according to the value of the element of the cumulative frequency distribution array used as the index pointer into a group of record numbers of records having the unique item value pairs;
(D) a code for identifying a set of unique item values by extracting one record number from each group of the record numbers that are classified;
Is provided.
さらに本発明の一態様によれば、表形式データのレコードのレコード番号が所定のレコード順に従って格納されたレコード番号配列、上記表形式データの上記レコードの所定の項目の項目値に対応する項目値番号がレコード番号に従って格納された項目値番号配列、及び、上記表形式データの項目値が当該項目値に対応する項目値番号の順序に従って格納された項目値配列を記憶する共有メモリと、上記共有メモリにアクセス可能である複数台のプロセッサと、を備えたコンピュータにロードされ、所定の項目の組に関する一意の項目値の組を抽出する本発明の方法を上記コンピュータに実行させるためのコンピュータプログラムプロダクトが提供される。 Furthermore, according to one aspect of the present invention, a record number array in which the record numbers of the records in the tabular data are stored according to a predetermined record order, and the item values corresponding to the item values of the predetermined items in the records of the tabular data A shared memory for storing an item value number array in which numbers are stored according to record numbers, and an item value array in which the item values of the tabular data are stored in accordance with the order of the item value numbers corresponding to the item values; A computer program product for causing a computer to execute the method of the present invention for extracting a set of unique item values relating to a predetermined set of items, loaded on a computer comprising a plurality of processors capable of accessing a memory Is provided.
さらに本発明の一態様によれば、表形式データのレコードのレコード番号が所定のレコード順に従って格納されたレコード番号配列、上記表形式データの上記レコードの所定の項目の項目値に対応する項目値番号がレコード番号に従って格納された項目値番号配列、及び、上記表形式データの項目値が当該項目値に対応する項目値番号の順序に従って格納された項目値配列を記憶する共有メモリと、上記共有メモリにアクセス可能である複数台のプロセッサと、を備えたコンピュータにロードされ、所定の項目の組に関する一意の項目値の組を抽出する本発明の方法を上記コンピュータに実行させるためのコンピュータプログラムが記録された記憶媒体が提供される。 Furthermore, according to one aspect of the present invention, a record number array in which the record numbers of the records in the tabular data are stored according to a predetermined record order, and the item values corresponding to the item values of the predetermined items in the records of the tabular data A shared memory for storing an item value number array in which numbers are stored according to record numbers, and an item value array in which the item values of the tabular data are stored in accordance with the order of the item value numbers corresponding to the item values; A computer program for causing a computer to execute the method of the present invention, which is loaded into a computer having a plurality of processors capable of accessing a memory and extracts a set of unique item values relating to a predetermined set of items. A recorded storage medium is provided.
本発明によれば、大規模な表形式データの多次元集計処理を高速に実現することが可能になる。 According to the present invention, it is possible to realize multidimensional tabulation processing of large-scale tabular data at high speed.
10 コンピュータシステム
12−1,12−2,・・・,12−p CPU
14 共有メモリ
16 ROM
18 固定記憶装置
20 CD−ROMドライバ
22 I/F
24 入力装置
26 表示装置10 Computer system 12-1, 12-2, ..., 12-p CPU
14
18
24
以下、本発明を実施するための種々の形態を図面と共に詳細に説明する。 Hereinafter, various embodiments for carrying out the present invention will be described in detail with reference to the drawings.
[コンピュータシステム構成]
図1は、本発明の一実施形態による表形式データの集計処理を実施するコンピュータシステム10の概略図である。図1に示すように、このコンピュータシステム10は、プログラムを実行することによりシステム全体および個々の構成部分を制御するp台のプロセッサ(CPU)12−1、12−2、...12−pと、ワークデータ等を記憶する、たとえば、RAM(Random Access Memory)のような共有メモリ14と、プログラム等を記憶するROM(Read Only Memory)16と、ハードディスク等の固定記憶媒体18と、CD−ROM19をアクセスするためのCD−ROMドライバ20と、CD−ROMドライバ20及び外部ネットワーク等(図示せず)へ繋がれた外部端子に接続されているインタフェース(I/F)22と、キーボード及びマウス等のような入力装置24と、コンピュータモニターのような表示装置26とを備えている。CPU12、RAM14、ROM16、外部記憶媒体18、I/F22、入力装置24及び表示装置26は、バス28を介して相互に接続されている。図示されていないが、各CPUは固有のローカルメモリを備え、ローカルメモリにはキャッシュメモリが搭載されている。[Computer system configuration]
FIG. 1 is a schematic diagram of a
本実施形態による方法をコンピュータシステム10に実行させるプログラムは、CD−ROM19に収容され、CD−ROMドライバ20に読取られても良いし、ROM16に予め記憶されていても良い。また、いったんCD−ROM19から読み出したものを、外部記憶媒体18の所定の領域に記憶しておいても良い。或いは、上記プログラムは、ネットワーク(図示せず)、外部端子、及び、I/F22を介して、外部から供給されるものであっても良い。
A program for causing the
また、本発明の一実施形態によるメモリ共有型マルチプロセッサシステムは、コンピュータシステム10に表形式データを集計するプログラムを実行させることにより実現される。
In addition, the memory sharing multiprocessor system according to the embodiment of the present invention is realized by causing the
[情報ブロックに基づくデータ管理機構]
図2はデータ管理機構を説明するための表形式データの一例を表す図である。この表形式データは、上述の国際公開第WO00/10103号に提案したデータ管理機構を用いることにより、コンピュータ内では図3に示されるようなデータ構造として記憶される。このデータ構造は、市販されているコンピュータ、たとえば、パーソナルコンピュータのハードウェア資源、特に、プロセッサ及びメモリを使用して大規模な表形式データの検索、ソート、集計等を実現するために提案された、コンピュータのメモリ上に置かれる表形式データのデータ構造であることに注意すべきである。[Data management mechanism based on information blocks]
FIG. 2 is a diagram illustrating an example of tabular data for explaining the data management mechanism. This tabular data is stored in the computer as a data structure as shown in FIG. 3 by using the data management mechanism proposed in the above-mentioned International Publication No. WO00 / 10103. This data structure has been proposed to realize retrieval, sorting, aggregation, etc. of large-scale tabular data using hardware resources of commercially available computers, for example, personal computers, in particular, processors and memories. It should be noted that the data structure of tabular data placed on the computer memory.
図3に示すように、表形式データの各レコードの並び順の番号と、内部データの並び順の番号を対応付けるレコード番号配列301(以下、この配列を「OrdSet」のように略記する。)には、表形式のレコード毎に内部データの並び順番号が値として配置される。この例では、すべての表形式データが内部データとして表されるため、表形式データのレコード番号と内部データの並び順番号とは一致する。 As shown in FIG. 3, a record number array 301 (hereinafter, this array is abbreviated as “OrdSet”) that associates the order number of the records in the tabular data with the order number of the internal data. In the table format, the order number of the internal data is arranged as a value for each record in the table format. In this example, since all tabular data is represented as internal data, the record number of the tabular data matches the arrangement order number of the internal data.
ここで、本明細書中での配列の記法について説明する。一般に、配列Aは、添字をiとすると、配列の要素がA[i]のように表記できるが、図面中では、配列は、配列の要素A[i]は、実線で囲まれた領域内に示され、要素A[i]と要素A[i+1]の境界は点線で示されている。また、要素A[i]の添字iが要素A[i]の左側に示されている。また、配列の添字iは0から始まる整数で表されている。 Here, the notation of the arrangement | sequence in this specification is demonstrated. In general, an array element A can be expressed as A [i], where i is a subscript. However, in the drawing, an array element A [i] is within a region surrounded by a solid line. The boundary between the element A [i] and the element A [i + 1] is indicated by a dotted line. The subscript i of element A [i] is shown on the left side of element A [i]. Further, the subscript i of the array is represented by an integer starting from 0.
もう一度図3に戻ると、性別に関しては、表形式データのレコード0に対応する内部データの並び順番号は、配列OrdSet301から「0」であることがわかる。並び順番号が「0」であるレコードに関する実際の性別の値、即ち、「男」又は「女」は、実際の値が所定の順序に従ってソートされた値リストである項目値配列303(以下、項目値配列、すなわち、値リストを「VL」のように略記する。)へのポインタ配列である項目値番号配列302(以下、項目値番号配列、すなわち、ポインタ配列を「VNo」のように略記する。)を参照することによって取得できる。ポインタ配列302は、配列OrdSet301に格納されている並び順番号の順に従って、実際の値リスト303中の要素を指し示すポインタを格納している。これにより、表形式データのレコード「0」に対応する性別の項目値は、(1)配列OrdSet301からレコード「0」に対応する並び順番号「0」を取り出し、(2)値リストへのポインタ配列302から並び順番号「0」に対応する要素「1」を取り出し、(3)値リスト303から、値リストへのポインタ配列302から取り出された要素「1」によって指し示される要素「女」を取り出すことにより取得できる。
Returning to FIG. 3 again, regarding gender, it can be seen that the arrangement order number of the internal data corresponding to the
他のレコードに対しても、また、年齢及び身長に関しても同様に項目値を取得することができる。 The item values can be acquired in the same manner for other records and also for age and height.
このように表形式データは、値リストVLと、値リストへのポインタ配列VNoの組合せにより表現され、この組合せを、特に、「情報ブロック」と称する。図3には、性別、年齢及び身長に関する情報ブロックがそれぞれ情報ブロック308、309及び310として示されている。 In this way, the tabular data is expressed by a combination of the value list VL and the pointer array VNo to the value list, and this combination is particularly referred to as an “information block”. In FIG. 3, information blocks regarding gender, age, and height are shown as information blocks 308, 309, and 310, respectively.
単一のコンピュータが、単一のメモリ(物理的には複数であっても良いが、単一のアドレス空間に配置されアクセスされるという意味で単一のメモリ)であれば、当該メモリに、順序集合の配列OrdSet、各情報ブロックを構成する値リストVLおよびポインタ配列VNoとを記憶しておけばよい。しかしながら、大量のレコードを保持するためには、その大きさに伴ってメモリ容量も大きくなるため、これらの大量のレコードを並列処理できるのが望ましい。 If a single computer is a single memory (which can be physically multiple, but a single memory in the sense that it is located and accessed in a single address space) An ordered set array OrdSet, a value list VL constituting each information block, and a pointer array VNo may be stored. However, in order to hold a large number of records, the memory capacity increases with the size, so it is desirable that these large numbers of records can be processed in parallel.
そこで、本実施形態においては、複数台のプロセッサが共有メモリに記憶されたレコードのデータにアクセスし、複数台のプロセッサの並列処理により、高速な集計を実現している。 Therefore, in this embodiment, a plurality of processors access the record data stored in the shared memory, and high-speed aggregation is realized by parallel processing of the plurality of processors.
[多次元集計処理]
次に、本実施形態によるメモリ共有型マルチプロセッサシステムにおける多次元集計処理を説明する。本実施形態による集計処理は、本質的に複数台のプロセッサが同じ処理を実行することによって達成される。すなわち、この集計処理は、単一の集計処理命令を複数台のプロセッサへ与えることにより、複数台のプロセッサが並列に動作して集計処理を実行できるように構成されている。複数台のプロセッサは、同じ動作を実行するので、一つのプログラムを作成するだけで、並列処理を実現できる。[Multidimensional aggregation processing]
Next, multidimensional tabulation processing in the memory shared multiprocessor system according to the present embodiment will be described. The aggregation process according to the present embodiment is achieved essentially by a plurality of processors executing the same process. In other words, this aggregation process is configured so that a plurality of processors can operate in parallel and execute the aggregation process by giving a single aggregation processing instruction to a plurality of processors. Since a plurality of processors execute the same operation, parallel processing can be realized only by creating one program.
図4は本発明の一実施形態による表形式データの多次元集計処理のフローチャートである。この多次元集計処理は、図1に示されるようなコンピュータシステム10によって実行される。コンピュータシステム10の共有メモリ14は、表形式データのレコードのレコード番号が所定のレコード順に従って格納されたレコード番号配列、上記表形式データの上記レコードの所定の項目の項目値に対応する項目値番号がレコード番号に従って格納された項目値番号配列、及び、上記表形式データの項目値が当該項目値に対応する項目値番号の順序に従って格納された項目値配列を記憶する。複数台のプロセッサ12−1,・・・,12−pは共有メモリ14にアクセス可能である。
FIG. 4 is a flowchart of multi-dimensional tabulation processing of tabular data according to an embodiment of the present invention. This multidimensional tabulation process is executed by a
各プロセッサは、上記所定の項目の組に関する項目値の組に対応する項目値番号の組の出現回数を並列的に数え上げ(ステップ401)、上記出現回数の累積度数分布を表現する累積度数分布配列を上記共有メモリに生成する(ステップ402)。所定の項目の組とは、多次元集計の際に用いられる次元の組に相当し、項目値の組は次元値の組に相当する。 Each processor enumerates in parallel the number of occurrences of the set of item value numbers corresponding to the set of item values relating to the set of predetermined items (step 401), and a cumulative frequency distribution array expressing the cumulative frequency distribution of the number of appearances Is generated in the shared memory (step 402). The predetermined item set corresponds to a dimension set used in multi-dimensional aggregation, and the item value set corresponds to a dimension value set.
次に、各プロセッサは、上記レコード番号配列の要素の値を添字として使って上記項目値番号の組を並列的に読み出し、上記項目値番号の組によって計算された値を添字として使って上記累積度数分布配列の要素を並列的に読み出し、上記累積度数分布配列の要素をインデックスポインタとして利用して上記レコード番号配列の要素の値をソートバージョンのレコード番号配列(すなわち、ソートされたレコード番号配列)に並列的に格納する(ステップ403)。たとえば、項目値番号の組は、各項目値番号が各桁に対応するように基数表現された値に変換することが可能である。この基数表現への変換は、乗算の代わりにビットシフト演算を用いることによって高速化される。しかし、項目値番号の組から値への変換は、基数表現に限定されることはなく、変換後の値から元の項目値番号の組へ逆変換できる演算であれば、どのような変換でも構わない。これにより、元のレコード番号配列の要素は、項目値の組に対応する項目値番号の組に関してソートされ、ソートされた要素が格納されたソートバージョンのレコード番号配列が生成される。 Next, each processor reads the item value number set in parallel using the element value of the record number array as a subscript, and uses the value calculated by the item value number set as a subscript to perform the accumulation. Reads the elements of the frequency distribution array in parallel and uses the elements of the cumulative frequency distribution array as an index pointer to convert the values of the elements of the record number array into a sorted version of the record number array (ie, the sorted record number array) (Step 403). For example, a set of item value numbers can be converted to a value expressed in a radix so that each item value number corresponds to each digit. The conversion to the radix representation is accelerated by using a bit shift operation instead of multiplication. However, the conversion from a pair of item value numbers to a value is not limited to the radix representation, and any conversion can be used as long as it can be converted back from the converted value to the original set of item value numbers. I do not care. As a result, the elements of the original record number array are sorted with respect to the set of item value numbers corresponding to the set of item values, and a sorted version of the record number array in which the sorted elements are stored is generated.
さらに、少なくとも1台のプロセッサが、上記インデックスポインタとして利用された上記累積度数分布配列の要素の値に従って上記ソートバージョンのレコード番号配列を上記一意の項目値の組を有するレコードのレコード番号のグループに区分する(ステップ404)。これにより、レコードは、同じ項目値の組、すなわち、同じ次元値の組を有するレコードのグループに分類される。 Further, at least one processor converts the record number array of the sorted version into the record number group of the record having the unique item value pair according to the value of the element of the cumulative frequency distribution array used as the index pointer. Partition (step 404). As a result, the records are classified into groups of records having the same set of field values, that is, the same set of dimension values.
少なくとも1台のプロセッサが、上記区分されたレコード番号の各グループから1個のレコード番号を抽出することにより、上記一意の項目値の組を特定する(ステップ405)。これにより、多次元集計の際に利用される一意の次元値の組が特定される。 At least one processor identifies one set of the unique item values by extracting one record number from each group of the divided record numbers (step 405). Thereby, a unique set of dimension values used in multidimensional aggregation is specified.
最後に、各プロセッサは、上記所定の項目値の組毎に別の項目に関する項目値を並列的に集計する(ステップ406)。 Finally, each processor totals item values related to different items for each set of the predetermined item values in parallel (step 406).
以下では、多次元並列集計処理において用いられる多次元並列ソート処理(多項目一括ソート処理又は多項目逐次ソート処理)、ユニーク行抽出処理、及び、測度並列算出処理(レコード番号昇順集計処理又はグループ番号昇順集計処理)について詳述する。 In the following, multidimensional parallel sort processing (multi-item batch sort processing or multi-item sequential sort processing), unique row extraction processing, and measure parallel calculation processing (record number ascending order summarization processing or group number) used in multidimensional parallel tabulation processing (Ascending process) will be described in detail.
さらに、本発明の種々の実施形態では、対称型マルチプロセッサシステムの特長を十分に発揮させるため、種々の配列に適用される処理は、各配列を複数台のプロセッサにほぼ均等に割り当てることにより、複数台のプロセッサによって並列処理される。以下では、発明の理解を助けるために、プロセッサの台数nが4であるとして説明するが、プロセッサの台数が4台に限定されないことは当業者に明白であろう。 Furthermore, in various embodiments of the present invention, in order to fully demonstrate the features of the symmetric multiprocessor system, the processing applied to the various arrays is performed by assigning each array to a plurality of processors substantially evenly. Parallel processing is performed by a plurality of processors. In the following, in order to help the understanding of the invention, it is assumed that the number of processors n is four, but it will be apparent to those skilled in the art that the number of processors is not limited to four.
[多項目一括ソート処理]
多項目一括ソート処理とは、表形式データの複数の項目に関するソートを一括に行う処理であり、(i)ソート処理が高速化される、(ii)プログラムの記述が容易化される、(iii)同一の項目値の組を有するレコードの抽出が簡単化される、という利点がある。[Multi-item batch sort processing]
The multi-item batch sort process is a process that batch-sorts a plurality of items of tabular data, and (i) the sort process is accelerated, (ii) the program description is simplified, (iii) ) There is an advantage that the extraction of records having the same set of field values is simplified.
図5は、本発明の一実施形態による多項目一括ソート処理の説明図である。同図に示された表形式データ501は、レコード番号が0から15で表される16個のレコードを含み、各レコードには、「年齢」という項目Ageと「クラス」という項目Classが含まれている。項目「年齢」は多次元集計の第1の次元Dim−1に対応し、項目「クラス」は多次元集計の第2の次元Dim−2に対応している。この表形式データは、本実施形態では、レコード番号配列503と、第1の次元に関する項目値番号配列511及び項目値配列512と、第2の次元に関する項目値番号配列521及び項目値配列522というデータ構造502の形で共有メモリ14上に構築されている。
FIG. 5 is an explanatory diagram of multi-item batch sort processing according to an embodiment of the present invention. The
このような表形式データは、「クラス」を下位次元とし、「年齢」を上位次元として、「クラス」及び「年齢」の2次元に関してソートすると、同図の矢印の右側に示されるような表形式データに変換される。ソート順は、各項目の項目値配列に格納されている項目値の順番と一致する。よって、同図の例では、「年齢」は昇順にソートされ、「クラス」はアルファベット順にソートされている。しかし、実際のソートは、項目値自体ではなく、項目値に対応する項目値番号に関して行われるので、本実施形態は実データのデータ形式とは無関係に適用できるという利点がある。 Such a tabular data is a table such as that shown on the right side of the arrow in the figure when “Class” is the lower dimension, “Age” is the upper dimension, and the “Class” and “Age” dimensions are sorted. Converted to format data. The sort order matches the order of the item values stored in the item value array of each item. Therefore, in the example of FIG. 3, “Age” is sorted in ascending order, and “Class” is sorted in alphabetical order. However, since the actual sorting is performed not on the item value itself but on the item value number corresponding to the item value, this embodiment has an advantage that it can be applied regardless of the data format of the actual data.
表形式データ551は、多項目一括ソートの結果に従って表形式データの行の順序を入れ替えたものである。このソート結果は、本実施形態では、レコード番号配列503からレコード番号配列553への要素の順序の入れ替えによって表現されている。尚、本実施形態の説明において、多項目一括ソート処理の次元数は2として説明しているが、次数が2に限定されないことは当業者に明白であろう。
The
次に、図5に示された表形式データの例を用いて、多項目一括ソート処理を詳細に説明する。 Next, the multi-item batch sort process will be described in detail using an example of the tabular data shown in FIG.
多項目一括ソート処理は、複数の項目のそれぞれに関する各項目値を組み合わせて新たな仮想的な項目値番号(以下では、仮想項目値番号と称する)を生成し、この仮想項目値番号に基づいてレコード番号を一度にソートする処理である。項目値番号の組み合わせは、上位次元の項目値番号が上位の桁、下位次元の項目値番号が下位の桁となるように、項目値番号の組を基数形式で表現することによって仮想項目値番号に変換される。基数は、各項目値番号が取り得る値の範囲に応じて決められる。たとえば、図5の例のように、第1の次元の項目値番号が0から2までの値を取り、第2の次元の項目値番号が0から3の値を取るならば、基数として4以上の整数を設定することにより、項目値番号の組み合わせが、4を基数とする基数形式で表現された仮想項目値番号に変換できる。 The multi-item batch sort process generates a new virtual item value number (hereinafter referred to as a virtual item value number) by combining each item value related to each of a plurality of items, and based on this virtual item value number This process sorts record numbers at a time. The combination of field value numbers is a virtual field value number by expressing the field value number pair in radix format so that the field value number of the higher dimension is the upper digit and the field value number of the lower dimension is the lower digit. Is converted to The radix is determined according to the range of values that each item value number can take. For example, if the item value number of the first dimension takes a value from 0 to 2 and the item value number of the second dimension takes a value from 0 to 3, as in the example of FIG. By setting the above integers, the combination of item value numbers can be converted into virtual item value numbers expressed in a radix format with a base of 4.
図6は本発明の一実施形態による仮想項目値番号の計算を説明する図である。本実施形態では、4台のプロセッサCPU−0、CPU−1、CPU−2、CPU−3のそれぞれは、レコード番号の個数と一致するサイズを有する項目値番号配列のそれぞれの部分を受け持ち、第1の次元の項目値番号と第2の次元の項目値番号を組み合わせて仮想項目値番号を生成する。 FIG. 6 is a diagram for explaining calculation of a virtual item value number according to an embodiment of the present invention. In the present embodiment, each of the four processors CPU-0, CPU-1, CPU-2, and CPU-3 is responsible for each part of the item value number array having a size that matches the number of record numbers. A virtual item value number is generated by combining the item value number of the first dimension and the item value number of the second dimension.
具体的には、iがレコード番号を表し(本例では、i=0,1,2,・・・,15)、第1の次元の項目値番号配列をVNo_1(図5及び6において511で示されている)、第2の次元の項目値番号配列VNo_2(図5及び6において521で示されている)、仮想項目値番号配列をV_VNo(図6において601で示されている)とすると、
CPU−0が、受け持ち範囲602、すなわち、i=0,1,2,3に対して、
V_VNo[i]=VNo_1[i]*4+VNo_2[i]
を計算し、同様に、CPU−1が、受け持ち範囲603、すなわち、i=4,5,6,7に対して、
V_VNo[i]=VNo_1[i]*4+VNo_2[i]
を計算し、CPU−2が、受け持ち範囲604、すなわち、i=8,9,10,11に対して、
V_VNo[i]=VNo_1[i]*4+VNo_2[i]
を計算し、CPU−3が、受け持ち範囲605、すなわち、i=12,13,14,15に対して、
V_VNo[i]=VNo_1[i]*4+VNo_2[i]
を計算する。Specifically, i represents a record number (in this example, i = 0, 1, 2,..., 15), and an item value number array of the first dimension is designated as VNo_1 (511 in FIGS. 5 and 6). The second dimension item value number array VNo_2 (indicated by 521 in FIGS. 5 and 6), and the virtual item value number array V_VNo (indicated by 601 in FIG. 6). ,
CPU-0 is in
V_VNo [i] = VNo_1 [i] * 4 + VNo_2 [i]
Similarly, CPU-1 is in
V_VNo [i] = VNo_1 [i] * 4 + VNo_2 [i]
CPU-2 calculates the range of
V_VNo [i] = VNo_1 [i] * 4 + VNo_2 [i]
CPU-3 calculates the range of
V_VNo [i] = VNo_1 [i] * 4 + VNo_2 [i]
Calculate
上記の説明では、仮想項目値番号配列の計算は、乗算と加算によって実現されているが、計算を高速化するため、好ましくは、乗算の代わりにビットシフト演算が採用される。 In the above description, the calculation of the virtual item value number array is realized by multiplication and addition. However, in order to speed up the calculation, a bit shift operation is preferably employed instead of multiplication.
次に、各プロセッサは、それぞれの受け持つレコード番号配列の範囲内の要素に関して、仮想項目値番号の出現回数を数え上げる。図7は本発明の一実施形態による仮想項目値番号を数え上げる処理の説明図である。この数え上げ処理もまた、プロセッサが受け持ち範囲を分担する。本例では、レコード番号配列503は、4台のプロセッサのそれぞれの受け持ち範囲701、702、703及び704に分割される。
Next, each processor counts up the number of occurrences of the virtual item value number with respect to the elements within the range of the record number array that it handles. FIG. 7 is an explanatory diagram of processing for counting up virtual item value numbers according to an embodiment of the present invention. This counting process is also shared by the processor. In this example, the
レコード番号をi、レコード番号配列をOrdSet、仮想項目値番号配列をV_VNo、プロセッサ番号をj(j=0,1,2,3)としてプロセッサjが数え上げた仮想項目値番号の個数を格納するカウント配列をCount[j]とすると、本実施形態による数え上げ処理は、たとえば、C言語スタイルでは、
for (i=0;i<4;i++) {
for (j=0;j<4;j++) {
Count[j][V_VNo[OrdSet[j*4+i]]]++;
}
}
と記述される。図7の例では、初期化されたカウント配列710、711、712及び713は、仮想項目値番号の数え上げ処理によって、カウント配列720、721、722及び723となる。尚、本例において、第1の項目値配列をVL_1、第2の項目値配列をVL_2とすると、カウント配列Countのサイズは、(VL_1のサイズ)×(VL_2)のサイズに一致する。Count that stores the number of virtual item value numbers counted by processor j, with record number i, record number array OrdSet, virtual item value number array V_VNo, processor number j (j = 0, 1, 2, 3) When the array is Count [j], the counting process according to the present embodiment is, for example, in C language style.
for (i = 0; i <4; i ++) {
for (j = 0; j <4; j ++) {
Count [j] [V_VNo [OrdSet [j * 4 + i]]] ++;
}
}
Is described. In the example of FIG. 7, the initialized
この数え上げ処理の結果は、たとえば、CPU−0の受け持ち範囲内では、仮想順位番号=0、2、5及び9がそれぞれ1個ずつ存在し、CPU−1の受け持ち範囲内では、仮想順位番号=6、7、10及び11がそれぞれ1個ずつ存在し、CPU−2の受け持ち範囲内では、仮想順位番号0、3、4及び5がそれぞれ1個ずつ存在し、CPU−3の受け持ち範囲内では、仮想順位番号=2、5、10及び11がそれぞれ1個ずつ存在することを表している。
As a result of the counting process, for example, one virtual rank number = 0, 2, 5, and 9 exists in the CPU-0 range, and in the CPU-1 range, the virtual rank number = There is one each of 6, 7, 10 and 11, and within the CPU-2 range, there is one
続いて、本発明の一実施形態では、コンピュータシステム10は、仮想項目値番号配列の各要素を累計数化して、仮想項目値番号の出現回数の累積度数分布配列を生成する。図8は、本発明の一実施形態による累積度数分布配列を生成する処理の説明図である。プロセッサjの受け持ち範囲内のカウント配列をCount[j]、累積度数分布配列をAggr[j]とすると、累積度数分布は、
Aggr[0][0]=0
Aggr[1][0]=Aggr[0][0]+Count[0][0]
Aggr[2][0]=Aggr[1][0]+Count[1][0]
Aggr[3][0]=Aggr[2][0]+Count[2][0]
Aggr[0][1]=Aggr[3][0]+Count[3][0]
Aggr[1][1]=Aggr[0][1]+Count[0][1]
Aggr[2][1]=Aggr[1][1]+Count[1][1]
Aggr[3][1]=Aggr[2][1]+Count[2][1]
Aggr[0][2]=Aggr[3][1]+Count[3][1]
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
途中省略
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
Aggr[3][10]=Aggr[2][10]+Count[2][10]
Aggr[0][11]=Aggr[3][10]+Count[3][10]
Aggr[1][11]=Aggr[0][11]+Count[0][11]
Aggr[2][11]=Aggr[1][11]+Count[1][11]
Aggr[3][11]=Aggr[2][11]+Count[2][11]
として計算される。この計算は、4台のプロセッサのうちのいずれか1台のプロセッサが単独で行ってもよいが、4台のプロセッサに仮想項目値番号の範囲を割り当てて、4台のプロセッサによって並列に行ってもよい。Subsequently, in one embodiment of the present invention, the
Aggr [0] [0] = 0
Aggr [1] [0] = Aggr [0] [0] + Count [0] [0]
Aggr [2] [0] = Aggr [1] [0] + Count [1] [0]
Aggr [3] [0] = Aggr [2] [0] + Count [2] [0]
Aggr [0] [1] = Aggr [3] [0] + Count [3] [0]
Aggr [1] [1] = Aggr [0] [1] + Count [0] [1]
Aggr [2] [1] = Aggr [1] [1] + Count [1] [1]
Aggr [3] [1] = Aggr [2] [1] + Count [2] [1]
Aggr [0] [2] = Aggr [3] [1] + Count [3] [1]
・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・
Omitted along the way ...
Aggr [3] [10] = Aggr [2] [10] + Count [2] [10]
Aggr [0] [11] = Aggr [3] [10] + Count [3] [10]
Aggr [1] [11] = Aggr [0] [11] + Count [0] [11]
Aggr [2] [11] = Aggr [1] [11] + Count [1] [11]
Aggr [3] [11] = Aggr [2] [11] + Count [2] [11]
Is calculated as This calculation may be performed by any one of the four processors alone, but the range of virtual item value numbers is assigned to the four processors and performed in parallel by the four processors. Also good.
4台のプロセッサによって並列的に累積度数分布を計算する場合には、最初に、各仮想項目値番号iの出現回数の合計値Sum[i]を、たとえば、
for(i=0;i<12;i++) {
for(j=0;j<4;j++) {
Sum[i]=Count[j][i];
}
}
によって、並列的に計算する。本実施形態では、たとえば、CPU−0がi=0,1,2のループを担当し、CPU−1がi=3,4,5のループを担当し、CPU−2がi=6,7,8のループを担当し、CPU−3がi=9,10,11のループを担当する。When the cumulative frequency distribution is calculated in parallel by four processors, first, the total value Sum [i] of the number of occurrences of each virtual item value number i is, for example,
for (i = 0; i <12; i ++) {
for (j = 0; j <4; j ++) {
Sum [i] = Count [j] [i];
}
}
To calculate in parallel. In this embodiment, for example, CPU-0 is in charge of a loop of i = 0, 1, 2, CPU-1 is in charge of a loop of i = 3, 4, 5, and CPU-2 is i = 6, 7 , 8 and CPU-3 is responsible for i = 9, 10, 11 loops.
続いて、たとえば、4台のプロセッサが並列的に、
Aggr[0][0]=0
Aggr[1][0]=Aggr[0][0]+Count[0][0]
Aggr[2][0]=Aggr[1][0]+Count[1][0]
Aggr[3][0]=Aggr[2][0]+Count[2][0]
Aggr[0][1]=Sum[0]
Aggr[1][1]=Aggr[0][1]+Count[0][1]
Aggr[2][1]=Aggr[1][1]+Count[1][1]
Aggr[3][1]=Aggr[2][1]+Count[2][1]
Aggr[0][2]=Sum[1]
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
途中省略
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
Aggr[3][10]=Aggr[2][10]+Count[2][10]
Aggr[0][11]=Sum[10]
Aggr[1][11]=Aggr[0][11]+Count[0][11]
Aggr[2][11]=Aggr[1][11]+Count[1][11]
Aggr[3][11]=Aggr[2][11]+Count[2][11]
を実行することによって、累積度数分布配列が得られる。Subsequently, for example, four processors are connected in parallel,
Aggr [0] [0] = 0
Aggr [1] [0] = Aggr [0] [0] + Count [0] [0]
Aggr [2] [0] = Aggr [1] [0] + Count [1] [0]
Aggr [3] [0] = Aggr [2] [0] + Count [2] [0]
Aggr [0] [1] = Sum [0]
Aggr [1] [1] = Aggr [0] [1] + Count [0] [1]
Aggr [2] [1] = Aggr [1] [1] + Count [1] [1]
Aggr [3] [1] = Aggr [2] [1] + Count [2] [1]
Aggr [0] [2] = Sum [1]
・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・
Omitted along the way ...
Aggr [3] [10] = Aggr [2] [10] + Count [2] [10]
Aggr [0] [11] = Sum [10]
Aggr [1] [11] = Aggr [0] [11] + Count [0] [11]
Aggr [2] [11] = Aggr [1] [11] + Count [1] [11]
Aggr [3] [11] = Aggr [2] [11] + Count [2] [11]
To obtain a cumulative frequency distribution array.
図8には、最終的な累積度数分布配列801、802、803及び804が示されている。
FIG. 8 shows final cumulative
本発明の一実施形態による多項目一括ソート処理では、最後に、元のレコード番号配列の要素をソート後のレコード番号配列に転送する。図9は、本発明の一実施形態によるレコード番号配列の要素を並べ替える処理の説明図である。この処理では、レコード番号配列503は、図7と同様に、4台のプロセッサの受け持ち範囲701、702、703及び704に分割され、4台のプロセッサが並列処理を実行する。元のレコード番号配列をOrdSet、ソート後のレコード番号配列をOrdSet’、仮想項目値番号配列をV_VNo、累積度数分布配列をAggr[j](jはプロセッサ番号)とすると、プロセッサ0番、すなわち、CPU−0による並べ替え処理は、
for (i=0;i<4;i++) {
OrdSet’[Aggr[0][V_VNo[OrdSet[i]]]]=OrdSet[i];
Aggr[0][V_VNo[OrdSet[i]]]++;
}
と記述できる。ここで、Aggr[0][V_VNo[OrdSet[i]]]++から、累積度数分布配列の要素がインデックスポインタとして利用されていることがわかる。たとえば、図8では、レコード番号0に対して、
OrdSet[0]=0
V_VNo[OrdSet[0]]=V_VNo[0]=5
Aggr[0][V_VNo[OrdSet[0]]]=Aggr[0][5]=6
OrdSet’[Aggr[0][V_VNo[OrdSet[0]]]]=OrdSet’[6]
となり、したがって、
OrdSet’[6]=0
Aggr[0][5]=7
となることが示されている。In the multi-item batch sort process according to the embodiment of the present invention, finally, the elements of the original record number array are transferred to the sorted record number array. FIG. 9 is an explanatory diagram of the process of rearranging the elements of the record number array according to one embodiment of the present invention. In this process, the
for (i = 0; i <4; i ++) {
OrdSet ′ [Aggr [0] [V_VNo [OrdSet [i]]]] = OrdSet [i];
Aggr [0] [V_VNo [OrdSet [i]]] ++;
}
Can be described. Here, Aggr [0] [V_VNo [OrdSet [i]]] ++ indicates that the elements of the cumulative frequency distribution array are used as index pointers. For example, in FIG. 8, for
OrdSet [0] = 0
V_VNo [OrdSet [0]] = V_VNo [0] = 5
Aggr [0] [V_VNo [OrdSet [0]]] = Aggr [0] [5] = 6
OrdSet ′ [Aggr [0] [V_VNo [OrdSet [0]]]] = OrdSet ′ [6]
And therefore
OrdSet ′ [6] = 0
Aggr [0] [5] = 7
It has been shown that
さらに、プロセッサ番号jをループ変数とすると、本実施形態によるレコード番号配列の要素を並べ替える処理は、
for (j=0;j<4;j++) {
for (i=0;i<4;i++) {
OrdSet’[Aggr[j][V_VNo[OrdSet[j*4+i]]]]=OrdSet[j*4+i];
Aggr[j][V_VNo[OrdSet[j*4+i]]]++;
}
}
と記述できる。Furthermore, assuming that the processor number j is a loop variable, the process of rearranging the elements of the record number array according to this embodiment is as follows:
for (j = 0; j <4; j ++) {
for (i = 0; i <4; i ++) {
OrdSet ′ [Aggr [j] [V_VNo [OrdSet [j * 4 + i]]]] = OrdSet [j * 4 + i];
Aggr [j] [V_VNo [OrdSet [j * 4 + i]]] ++;
}
}
Can be described.
図10は、本発明の一実施形態によるレコード番号配列の要素を並べ替える処理の結果を説明する図である。累積度数分布配列1001、1002、1003及び1004は、ソート後の累積度数分布配列を表し、ソートバージョンのレコード番号配列1005はソート後のレコード番号配列を表している。このように、本発明の一実施形態によるレコード番号配列の要素を並べ替える処理により、元のレコード番号配列503の要素は、第1の次元と第2の次元の二つの次元に関して一括的にソートされ、ソートバージョンのレコード番号配列1005に格納されている。
FIG. 10 is a diagram for explaining the result of the process of rearranging the elements of the record number array according to an embodiment of the present invention. Cumulative
[ユニーク行抽出処理]
多項目一括ソート処理によって、多次元集計の対象となるレコードは複数の次元に関して所定の順序でソートされている。多次元集計を行うためには、次元値を特定する必要がある。そのため、本発明の一実施形態では、同一の次元値を有するレコードの中から代表となるレコードを抽出する。本明細書では、このようなレコードを抽出する処理をユニーク行抽出処理とも称する。[Unique row extraction processing]
By the multi-item batch sort process, the records to be subjected to multi-dimensional aggregation are sorted in a predetermined order with respect to a plurality of dimensions. In order to perform multidimensional aggregation, it is necessary to specify a dimension value. Therefore, in one embodiment of the present invention, a representative record is extracted from records having the same dimension value. In this specification, the process of extracting such a record is also referred to as a unique row extraction process.
ユニーク行抽出処理では、複数台のプロセッサのうちの何れかのプロセッサが、インデックスポインタとして利用された累積度数分布配列の要素の値に従ってソートバージョンのレコード番号配列を一意の項目値の組を有するレコードのレコード番号のグループに区分し、区分されたレコード番号の各グループから1個のレコード番号を抽出することにより、一意の項目値の組を特定する。 In the unique row extraction process, a record in which any one of a plurality of processors has a set version of a record number array of a sorted version according to the value of an element of a cumulative frequency distribution array used as an index pointer. Are grouped into groups of record numbers, and one record number is extracted from each group of the segmented record numbers, thereby identifying a unique set of item values.
レコード番号をレコード番号配列に格納する際に、累積度数分布配列の要素をインデックスポインタとして使用すると、レコード番号を格納する毎に累積度数分布配列の要素がインクリメントされる。その結果、累積度数分布配列の要素は、レコード番号がレコード番号配列中に格納されている位置を表現している。よって、ソートバージョンのレコード番号配列の完成後に、累積度数分布配列の要素の値はソートバージョンのレコード番号配列中のレコード番号のグループの境界を指している。 When an element of the cumulative frequency distribution array is used as an index pointer when storing the record number in the record number array, the element of the cumulative frequency distribution array is incremented each time the record number is stored. As a result, the element of the cumulative frequency distribution array represents the position where the record number is stored in the record number array. Thus, after completion of the sorted version record number array, the value of the element of the cumulative frequency distribution array points to the boundary of the group of record numbers in the sorted version record number array.
図11は、本発明の一実施形態によるユニーク行抽出処理の説明図である。ソート後の累積度数分布配列の要素、本例では、出現回数の数え上げを行う際に、レコード番号配列の最後の範囲を担当したCPU−4が生成したカウント配列に基づく累積度数分布配列1004の要素は、レコード番号をグループに区分するため利用できる。より具体的に説明すると、累積度数分布配列がインデックスポインタとして利用されたという事実から、最終的な累積度数分布配列1004の各要素が指し示しているソートバージョンのレコード番号配列1005の要素、すなわち、
OrdSet’[Aggr[3][0]]=OrdSet’[2]
OrdSet’[Aggr[3][1]]=OrdSet’[2]
OrdSet’[Aggr[3][2]]=OrdSet’[4]
OrdSet’[Aggr[3][3]]=OrdSet’[5]
OrdSet’[Aggr[3][4]]=OrdSet’[6]
OrdSet’[Aggr[3][5]]=OrdSet’[9]
OrdSet’[Aggr[3][6]]=OrdSet’[10]
OrdSet’[Aggr[3][7]]=OrdSet’[11]
OrdSet’[Aggr[3][8]]=OrdSet’[11]
OrdSet’[Aggr[3][9]]=OrdSet’[12]
OrdSet’[Aggr[3][10]]=OrdSet’[14]
OrdSet’[Aggr[3][11]]=OrdSet’[16]
は、一意の項目値の組を有するレコードのグループの境界を表していることがわかる。FIG. 11 is an explanatory diagram of unique row extraction processing according to an embodiment of the present invention. Elements of the cumulative frequency distribution array after sorting, in this example, the elements of the cumulative
OrdSet ′ [Aggr [3] [0]] = OrdSet ′ [2]
OrdSet ′ [Aggr [3] [1]] = OrdSet ′ [2]
OrdSet ′ [Aggr [3] [2]] = OrdSet ′ [4]
OrdSet ′ [Aggr [3] [3]] = OrdSet ′ [5]
OrdSet ′ [Aggr [3] [4]] = OrdSet ′ [6]
OrdSet ′ [Aggr [3] [5]] = OrdSet ′ [9]
OrdSet ′ [Aggr [3] [6]] = OrdSet ′ [10]
OrdSet ′ [Aggr [3] [7]] = OrdSet ′ [11]
OrdSet ′ [Aggr [3] [8]] = OrdSet ′ [11]
OrdSet ′ [Aggr [3] [9]] = OrdSet ′ [12]
OrdSet ′ [Aggr [3] [10]] = OrdSet ′ [14]
OrdSet ′ [Aggr [3] [11]] = OrdSet ′ [16]
Represents the boundary of a group of records having a unique set of field values.
これにより、図11の例では、レコード番号は、
グループ0={1,9} (同図では、1101を参照)
グループ1={3,15} (同図では、1102を参照)
グループ2={11} (同図では、1103を参照)
グループ3={8} (同図では、1104を参照)
グループ4={0,10,14} (同図では、1105を参照)
グループ5={5} (同図では、1106を参照)
グループ6={4} (同図では、1107を参照)
グループ7={2} (同図では、1108を参照)
グループ8={6,12} (同図では、1109を参照)
グループ9={7,13} (同図では、1110を参照)
の10個のグループに分類されることがわかる。Thus, in the example of FIG. 11, the record number is
It can be seen that it is classified into 10 groups.
このようにグループは10個しかないので、グループ毎に1個ずつのレコード番号、すなわち、全部で10個のレコード番号を代表レコード番号として抽出することにより、一意の項目値の組を抽出することができる。 Since there are only 10 groups in this way, a unique set of item values is extracted by extracting one record number per group, that is, a total of 10 record numbers as representative record numbers. Can do.
図11では、抽出された代表レコード番号を含む代表レコード番号配列OrdSet’’が1120として示されている。 In FIG. 11, a representative record number array OrdSet ″ including the extracted representative record number is shown as 1120.
次に、iをループ変数、VL_1及びVNo_1を第1の次元の項目値配列及び項目値番号配列、VL_2及びVNo_2を第2の次元の項目値配列及び項目値番号配列とし、集計の第1の次元の次元値配列をDim−1、第2の次元の次元値配列をDim−2とすると、たとえば、
for (i=0;i<10;i++) {
Dim−1[i]=VL_1[VNo_1[OrdSet’’[i]]];
Dim−2[i]=VL_2[VNo_2[OrdSet’’[i]]];
}
を複数台のプロセッサで並列に実行することによって、集計の次元1130が作成される。Next, i is a loop variable, VL_1 and VNo_1 are the first dimension item value array and item value number array, VL_2 and VNo_2 are the second dimension item value array and item value number array, If the dimension value array of the dimension is Dim-1, and the dimension value array of the second dimension is Dim-2, for example,
for (i = 0; i <10; i ++) {
Dim-1 [i] = VL_1 [VNo_1 [OrdSet ''[i]]];
Dim-2 [i] = VL_2 [VNo_2 [OrdSet ''[i]]];
}
Is executed in parallel by a plurality of processors to create a
上記のユニーク行抽出処理において、一意の項目値の組は、項目値に関してソートされた順番に抽出されている。たとえば、一意の項目値の組を、元のレコード番号配列OrdSetに出現した順序で抽出するには、代表レコード番号配列の要素を元のレコード番号配列に出現した順序で並べ替えればよい。図12及び13は、本発明の一実施形態によるユニーク行抽出処理によって抽出された一意の項目値の組を元のレコード番号配列に出現した順序に並べ替える処理の説明図である。 In the above unique row extraction process, unique item value pairs are extracted in the order in which the item values are sorted. For example, in order to extract unique item value pairs in the order of appearance in the original record number array OrdSet, the elements of the representative record number array may be rearranged in the order of appearance in the original record number array. FIGS. 12 and 13 are explanatory diagrams of processing for rearranging the sets of unique item values extracted by the unique row extraction processing according to the embodiment of the present invention in the order of appearance in the original record number array.
この処理は、代表レコード番号配列に格納されたレコード番号に対応するビットマップフラグを作成するステップと、元のレコード番号の順にビットマップフラグをチェックし、フラグがセットされているレコード番号を元のレコード番号配列に格納されたレコード番号の順序で抽出するステップとを含む。これらのステップは、代表レコード番号配列及び元のレコード番号配列を複数台(本例では、4台)のCPUに割り当てることによって並列処理可能である。 In this process, a bitmap flag corresponding to the record number stored in the representative record number array is created, and the bitmap flag is checked in the order of the original record number, and the record number in which the flag is set is changed to the original number. Extracting in the order of the record numbers stored in the record number array. These steps can be processed in parallel by assigning the representative record number array and the original record number array to a plurality of (four in this example) CPUs.
図12を参照すると、代表レコード番号配列OrdSet’’1120は、CPU−0の受け持ち範囲1200と、CPU−1の受け持ち範囲1201と、CPU−2の受け持ち範囲1202と、CPU−3の受け持ち範囲1203とに分割されている。各プロセッサは、代表レコード番号配列1120からそのプロセッサ自体の受け持ち範囲内の要素、すなわち、レコード番号を読み出し、それぞれのビットマップフラグ配列1210、1211、1212及び1213の中で、読み出されたレコード番号に対応するビットをセットする。たとえば、CPU−0は、OrdSet’’[0]=1、OrdSet’’[1]=3及びOrdSet’’[2]=11の3個のレコード番号を読み出し、ビットマップフラグ配列中の3個のフラグをセットする。すなわち、Flag_0[1]=1、Flag_0[3]=1、及び、Flag_0[11]=1である。ビットマップフラグ配列Flag_0のその他の要素は0のままである。CPU−1、CPU−2及びCPU−3も同様に、それぞれ、ビットマップフラグ配列Flag_1、Flag_2及びFlag_3を設定する。これらの処理は、複数台のプロセッサによって並列に実行される。
Referring to FIG. 12, the representative record number array OrdSet ″ 1120 includes a CPU-0
次に、ビットマップフラグ配列1210、1211、1212及び1213のそれぞれが、先頭から順番に、CPU−0、CPU−1、CPU−2及びCPU−3の4台のプロセッサに割り当てられ、全体的なビットマップフラグ配列Flagが作成される。具体的には、各プロセッサがそれぞれの受け持ち範囲1220、1221、1222、1223に関して、論理和演算を並列に実行することにより、全体として、
for (i=0;i<16;i++) {
Flag[i]=Flag_1[i] OR Flag_2[i] OR Flag_3[i] OR Flag_4[i];
}
が実行される。これにより、図12の全体的なビットマップフラグ配列1230が得られる。Next, each of the
for (i = 0; i <16; i ++) {
Flag [i] = Flag_1 [i] OR Flag_2 [i] OR Flag_3 [i] OR Flag_4 [i];
}
Is executed. As a result, the overall
図13を参照すると、各プロセッサは、全体的な元のレコード番号配列503の受け持ち範囲701、702、703、704の中の要素の順に、全体的なビットマップフラグ配列1230の要素のフラグがセットされているか否かをチェックし、フラグがセットされているレコード番号をチェック順に作業配列1300に格納し、最後に作業配列をさらなる代表レコード番号配列1310に格納する。さらなる代表レコード番号配列1310は、代表レコード番号が元のレコード番号配列に格納されたレコード番号の順序で格納されている配列である。
Referring to FIG. 13, each processor sets the flags of the elements of the overall
次に、iをループ変数、VL_1及びVNo_1を第1の次元の項目値配列及び項目値番号配列、VL_2及びVNo_2を第2の次元の項目値配列及び項目値番号配列とし、集計の第1の次元の次元値配列をDim−1、第2の次元の次元値配列をDim−2とすると、たとえば、
for (i=0;i<10;i++) {
Dim−1[i]=VL_1[VNo_1[OrdSet’’’[i]]];
Dim−2[i]=VL_2[VNo_2[OrdSet’’’[i]]];
}
を複数台のプロセッサで並列に実行することによって、集計の次元1320が作成される。Next, i is a loop variable, VL_1 and VNo_1 are the first dimension item value array and item value number array, VL_2 and VNo_2 are the second dimension item value array and item value number array, If the dimension value array of the dimension is Dim-1, and the dimension value array of the second dimension is Dim-2, for example,
for (i = 0; i <10; i ++) {
Dim-1 [i] = VL_1 [VNo_1 [OrdSet '''[i]]];
Dim-2 [i] = VL_2 [VNo_2 [OrdSet '''[i]]];
}
Is executed in parallel by a plurality of processors, thereby creating a
[多項目逐次ソート処理]
多項目並列ソート処理には、上述の多項目一括ソート処理の他に、これから説明する多項目逐次ソート処理がある。たとえば、仮想項目値番号のビット数がコンピュータ上で処理できる整数の範囲を超える場合、上記の多項目一括ソート処理を適用できなくなるので、この多項目逐次ソート処理が適用される。以下では、図5の表形式データを用いて、本発明の一実施形態による多項目逐次ソート処理を説明する。以下の例では、次元数を2として説明しているが、次元数2の多項目逐次ソート処理を多段階化することにより任意の次数の多項目逐次ソート処理を実現可能であることは当業者に明白であろう。[Multi-item sequential sorting]
The multi-item parallel sort process includes a multi-item sequential sort process described below in addition to the above-described multi-item batch sort process. For example, when the number of bits of the virtual item value number exceeds the range of integers that can be processed on the computer, the multi-item batch sort process cannot be applied, so this multi-item sequential sort process is applied. Hereinafter, the multi-item sequential sorting process according to the embodiment of the present invention will be described using the tabular data in FIG. In the following example, the number of dimensions is described as 2. However, it is understood by those skilled in the art that multi-item sequential sort processing of any order can be realized by multi-stage multi-item sequential sort processing of
多項目逐次ソート処理は、上位次元の項目に関するソートより下位次元の項目に関するソートを先に実行する。上位次元と下位次元の考え方は、多項目一括ソート処理に関して説明した通りである。そして、ユニーク行抽出処理に関して説明したグループ番号の考え方を下位次元のソートと上位次元のソートのそれぞれにおいて導入することにより、比較演算を行うことなくグループ分けを行っている。下位次元のソートによって得られたグループ番号を上位次元のソートの際にレコード番号と共にソートすることにより、上位次元のグループ化が簡単化される。尚、項目値番号が0から連続的に使用されることが保証されるならば、項目値番号をグループ番号として使用することも可能であるが、一般には、データの追加・削除により実際に使用されている項目値番号が飛び飛びの値となることもあるので、好ましくは、項目値番号とは別個にグループ番号が使用される。 In the multi-item sequential sort process, the sort related to the items in the lower dimension is executed first than the sort related to the items in the higher dimension. The concept of the upper dimension and the lower dimension is as described for the multi-item batch sort process. Then, by introducing the concept of the group number described for the unique row extraction process in each of the lower dimension sort and the upper dimension sort, the grouping is performed without performing the comparison operation. By sorting the group numbers obtained by sorting the lower dimensions together with the record numbers when sorting the upper dimensions, the grouping of the upper dimensions is simplified. If it is guaranteed that the item value number is used continuously from 0, it is possible to use the item value number as a group number. However, in general, it is actually used by adding / deleting data. Since the item value number being used may become a skipped value, the group number is preferably used separately from the item value number.
図14は、本発明の一実施形態による多項目逐次ソート処理の概要説明図である。ソート処理前の表形式データ501は、図5に示されているデータと同じである。下位次元である項目「クラス」に関して「クラス」の項目値の昇順(たとえば、アルファベット順)に表形式データをソートすると、下位次元でソートされた表形式データ1400が得られる。このとき、「クラス」の項目値に基づく第1のグループ番号配列1401を表形式データ1400に付与する。
FIG. 14 is a schematic explanatory diagram of multi-item sequential sorting processing according to an embodiment of the present invention. The
次に、表形式データ1400と第1のグループ番号配列1401を、上位次元である項目「年齢」の項目値の昇順にソートすると、ソートされた表形式データ1410と、ソーとされた第1のグループ番号配列1411とが得られる。このとき、ソート結果に基づいて新たな第2のグループ番号配列1412を表形式データ1410に付与する。
Next, when the
最後に、第2のグループ番号配列1412を参照して、表形式データ1410からユニーク行を抽出すると、多項目一括ソート処理で作成された集計の次元と同じ集計の次元1130が得られる。
Finally, referring to the second
以下では、図面を参照して、本発明の一実施形態による多項目逐次ソート処理をより詳細に説明する。図15は、本発明の一実施形態による多項目逐次ソート処理の下位次元ソート処理における並列カウントアップ処理の説明図である。下位次元ソート処理は、下位次元の項目に関する項目値番号の昇順にレコード番号配列に格納されたレコード番号を並べ替える処理である。この処理は、多項目一括ソート処理における仮想項目値番号の昇順にレコード番号を並べ替える処理と類似している。図15の例では、下位次元の項目の項目値に対応する項目値番号の出現回数を数え上げる。この数え上げ処理もまた、プロセッサが受け持ち範囲を分担する。本例では、レコード番号配列503は、4台のプロセッサのそれぞれの受け持ち範囲1501、1502、1503及び1504に分割される。
Hereinafter, the multi-item sequential sorting process according to an embodiment of the present invention will be described in more detail with reference to the drawings. FIG. 15 is an explanatory diagram of the parallel count-up process in the low-order sort process of the multi-item sequential sort process according to an embodiment of the present invention. The lower dimension sorting process is a process of rearranging the record numbers stored in the record number array in ascending order of the item value numbers related to the lower dimension items. This process is similar to the process of rearranging record numbers in ascending order of virtual item value numbers in the multi-item batch sort process. In the example of FIG. 15, the number of occurrences of the item value number corresponding to the item value of the item of the lower dimension is counted. This counting process is also shared by the processor. In this example, the
レコード番号をi、レコード番号配列をOrdSet、項目値番号配列をVNo_2、プロセッサ番号をj(j=0,1,2,3)としてプロセッサjが数え上げた項目値番号の個数を格納するカウント配列をCount[j]とすると、本実施形態による数え上げ処理は、たとえば、C言語スタイルでは、
for (i=0;i<4;i++) {
for (j=0;j<4;j++) {
Count[j][V_VNo[OrdSet[j*4+i]]]++;
}
}
と記述される。図15の例では、初期化されたカウント配列1510、1511、1512及び1513は、項目値番号の数え上げ処理によって、カウント配列1520、1521、1522及び1523となる。尚、本例において、カウント配列Countのサイズは、対象としている項目の項目値番号配列をVLとし、プロセッサの台数をNとすると、(VLのサイズ)×Nに一致する。A count array for storing the number of item value numbers counted by the processor j, where the record number is i, the record number array is OrdSet, the item value number array is VNo_2, and the processor number is j (j = 0, 1, 2, 3). If Count [j], the counting process according to the present embodiment is, for example, in C language style.
for (i = 0; i <4; i ++) {
for (j = 0; j <4; j ++) {
Count [j] [V_VNo [OrdSet [j * 4 + i]]] ++;
}
}
Is described. In the example of FIG. 15, the initialized
続いて、本発明の一実施形態では、コンピュータシステム10は、項目値番号配列の各要素を累計数化して、項目値番号の出現回数の累積度数分布配列を生成する。図16は、本発明の一実施形態による多項目逐次ソート処理の下位次元ソート処理における累積度数分布配列を生成する処理の説明図である。プロセッサjの受け持ち範囲内のカウント配列をCount[j]、累積度数分布配列をAggr[j]とすると、累積度数分布は、
Aggr[0][0]=0
Aggr[1][0]=Aggr[0][0]+Count[0][0]
Aggr[2][0]=Aggr[1][0]+Count[1][0]
Aggr[3][0]=Aggr[2][0]+Count[2][0]
Aggr[0][1]=Aggr[3][0]+Count[3][0]
Aggr[1][1]=Aggr[0][1]+Count[0][1]
Aggr[2][1]=Aggr[1][1]+Count[1][1]
Aggr[3][1]=Aggr[2][1]+Count[2][1]
Aggr[0][2]=Aggr[3][1]+Count[3][1]
Aggr[1][2]=Aggr[0][2]+Count[0][2]
Aggr[2][2]=Aggr[1][2]+Count[1][2]
Aggr[3][2]=Aggr[2][2]+Count[2][2]
Aggr[0][3]=Aggr[3][2]+Count[3][2]
Aggr[1][3]=Aggr[0][3]+Count[0][3]
Aggr[2][3]=Aggr[1][3]+Count[1][3]
Aggr[3][3]=Aggr[2][3]+Count[2][3]
として計算される。この計算は、4台のプロセッサのうちのいずれか1台のプロセッサが単独で行ってもよいが、4台のプロセッサに仮想項目値番号の範囲を割り当てて、4台のプロセッサによって並列に行ってもよい。Subsequently, in one embodiment of the present invention, the
Aggr [0] [0] = 0
Aggr [1] [0] = Aggr [0] [0] + Count [0] [0]
Aggr [2] [0] = Aggr [1] [0] + Count [1] [0]
Aggr [3] [0] = Aggr [2] [0] + Count [2] [0]
Aggr [0] [1] = Aggr [3] [0] + Count [3] [0]
Aggr [1] [1] = Aggr [0] [1] + Count [0] [1]
Aggr [2] [1] = Aggr [1] [1] + Count [1] [1]
Aggr [3] [1] = Aggr [2] [1] + Count [2] [1]
Aggr [0] [2] = Aggr [3] [1] + Count [3] [1]
Aggr [1] [2] = Aggr [0] [2] + Count [0] [2]
Aggr [2] [2] = Aggr [1] [2] + Count [1] [2]
Aggr [3] [2] = Aggr [2] [2] + Count [2] [2]
Aggr [0] [3] = Aggr [3] [2] + Count [3] [2]
Aggr [1] [3] = Aggr [0] [3] + Count [0] [3]
Aggr [2] [3] = Aggr [1] [3] + Count [1] [3]
Aggr [3] [3] = Aggr [2] [3] + Count [2] [3]
Is calculated as This calculation may be performed by any one of the four processors alone, but the range of virtual item value numbers is assigned to the four processors and performed in parallel by the four processors. Also good.
4台のプロセッサによって並列的に累積度数分布を計算する場合には、最初に、各仮想項目値番号iの出現回数の合計値Sum[i]を、たとえば、
for(i=0;i<4;i++) {
for(j=0;j<4;j++) {
Sum[i]=Count[j][i];
}
}
によって、並列的に計算する。本実施形態では、たとえば、CPU−0がi=0のループを担当し、CPU−1がi=1のループを担当し、CPU−2がi=2のループを担当し、CPU−3がi=3のループを担当する。When the cumulative frequency distribution is calculated in parallel by four processors, first, the total value Sum [i] of the number of occurrences of each virtual item value number i is, for example,
for (i = 0; i <4; i ++) {
for (j = 0; j <4; j ++) {
Sum [i] = Count [j] [i];
}
}
To calculate in parallel. In this embodiment, for example, CPU-0 is in charge of the i = 0 loop, CPU-1 is in charge of the i = 1 loop, CPU-2 is in charge of the i = 2 loop, and CPU-3 is in charge of the loop. Take charge of the loop of i = 3.
続いて、たとえば、4台のプロセッサが並列的に、
Aggr[0][0]=0
Aggr[1][0]=Aggr[0][0]+Count[0][0]
Aggr[2][0]=Aggr[1][0]+Count[1][0]
Aggr[3][0]=Aggr[2][0]+Count[2][0]
Aggr[0][1]=Sum[0]
Aggr[1][1]=Aggr[0][1]+Count[0][1]
Aggr[2][1]=Aggr[1][1]+Count[1][1]
Aggr[3][1]=Aggr[2][1]+Count[2][1]
Aggr[0][2]=Sum[1]
Aggr[1][2]=Aggr[0][2]+Count[0][2]
Aggr[2][2]=Aggr[1][2]+Count[1][2]
Aggr[3][2]=Aggr[2][2]+Count[2][2]
Aggr[0][3]=Sum[2]
Aggr[1][3]=Aggr[0][3]+Count[0][3]
Aggr[2][3]=Aggr[1][3]+Count[1][3]
Aggr[3][3]=Aggr[2][3]+Count[2][3]
を実行することによって、累積度数分布配列が得られる。Subsequently, for example, four processors are connected in parallel,
Aggr [0] [0] = 0
Aggr [1] [0] = Aggr [0] [0] + Count [0] [0]
Aggr [2] [0] = Aggr [1] [0] + Count [1] [0]
Aggr [3] [0] = Aggr [2] [0] + Count [2] [0]
Aggr [0] [1] = Sum [0]
Aggr [1] [1] = Aggr [0] [1] + Count [0] [1]
Aggr [2] [1] = Aggr [1] [1] + Count [1] [1]
Aggr [3] [1] = Aggr [2] [1] + Count [2] [1]
Aggr [0] [2] = Sum [1]
Aggr [1] [2] = Aggr [0] [2] + Count [0] [2]
Aggr [2] [2] = Aggr [1] [2] + Count [1] [2]
Aggr [3] [2] = Aggr [2] [2] + Count [2] [2]
Aggr [0] [3] = Sum [2]
Aggr [1] [3] = Aggr [0] [3] + Count [0] [3]
Aggr [2] [3] = Aggr [1] [3] + Count [1] [3]
Aggr [3] [3] = Aggr [2] [3] + Count [2] [3]
To obtain a cumulative frequency distribution array.
図16には、最終的な累積度数分布配列1600、1601、1602及び1603が示されている。
FIG. 16 shows final cumulative
次に、本発明の一実施形態による多項目逐次ソート処理の下位次元ソートでは、元のレコード番号配列の要素をソート後のレコード番号配列に転送する。図17は、本発明の一実施形態によるレコード番号配列の要素を並べ替える処理の説明図である。この処理では、レコード番号配列503は、図15と同様に、4台のプロセッサの受け持ち範囲1501、1502、1503及び1504に分割され、4台のプロセッサが並列処理を実行する。元のレコード番号配列をOrdSet、ソート後のレコード番号配列をOrdSet’、項目値番号配列をVNo_2、累積度数分布配列をAggr[j](jはプロセッサ番号)とすると、プロセッサ0番、すなわち、CPU−0による並べ替え処理は、
for (i=0;i<4;i++) {
OrdSet’[Aggr[0][VNo_2[OrdSet[i]]]]=OrdSet[i];
Aggr[0][VNo_2[OrdSet[i]]]++;
}
と記述できる。ここで、Aggr[0][VNo_2[OrdSet[i]]]++から、累積度数分布配列の要素がインデックスポインタとして利用されていることがわかる。Next, in the low-order sort of the multi-item sequential sort process according to the embodiment of the present invention, the elements of the original record number array are transferred to the sorted record number array. FIG. 17 is an explanatory diagram of processing for rearranging elements of a record number array according to an embodiment of the present invention. In this processing, the
for (i = 0; i <4; i ++) {
OrdSet ′ [Aggr [0] [VNo — 2 [OrdSet [i]]]] = OrdSet [i];
Aggr [0] [VNo_2 [OrdSet [i]]] ++;
}
Can be described. Here, Aggr [0] [VNo_2 [OrdSet [i]]] ++ indicates that the elements of the cumulative frequency distribution array are used as index pointers.
さらに、プロセッサ番号jをループ変数とすると、本実施形態によるレコード番号配列の要素を並べ替える処理は、
for (j=0;j<4;j++) {
for (i=0;i<4;i++) {
OrdSet’[Aggr[j][VNo_2[OrdSet[j*4+i]]]]=OrdSet[j*4+i];
Aggr[j][VNo_2[OrdSet[j*4+i]]]++;
}
}
と記述できる。Furthermore, assuming that the processor number j is a loop variable, the process of rearranging the elements of the record number array according to this embodiment is as follows:
for (j = 0; j <4; j ++) {
for (i = 0; i <4; i ++) {
OrdSet ′ [Aggr [j] [VNo — 2 [OrdSet [j * 4 + i]]]] = OrdSet [j * 4 + i];
Aggr [j] [VNo_2 [OrdSet [j * 4 + i]]] ++;
}
}
Can be described.
レコード番号配列の要素を並べ替える処理が完了すると、累積度数分布配列1700、1701、1702及び1703は、ソート後の累積度数分布配列を表し、ソートバージョンのレコード番号配列1710はソート後のレコード番号配列を表している。このように、本発明の一実施形態によるレコード番号配列の要素を並べ替える処理により、元のレコード番号配列503の要素は、下位次元に関してソートされ、ソートバージョンのレコード番号配列1710に格納されている。表形式データ1400は下位次元に関してソートされた表形式データを示している。
When the process of rearranging the elements of the record number array is completed, the cumulative
さらに、ソート完了時の累積度数分布配列1703の値を用いることにより、グループ番号配列1720に示されるように、レコード番号をグループ分けすることができる。このグループ番号は、後で上位次元に関してレコード番号をソートするときに、レコード番号と共にソートされる。
Furthermore, the record numbers can be grouped as shown in the
本発明の一実施形態による多次元逐次ソート処理では、下位次元に関するソートに続いて、上位次元に関するソートが行われる。上位次元に関するソートは下位次元に関するソートに類似しているので簡単に説明する。図18は、本発明の一実施形態による多項目逐次ソート処理の上位次元ソート処理における並列カウントアップ処理の説明図である。ここでも、上位次元の項目値番号配列VNo_1中の要素の出現回数を4台のプロセッサで並列的にカウントアップする。カウントアップ結果がカウント配列1820、1821、1822、1823に示されている。
In the multi-dimensional sequential sorting process according to the embodiment of the present invention, the sorting for the upper dimension is performed following the sorting for the lower dimension. Since the sort related to the upper dimension is similar to the sort related to the lower dimension, it will be briefly described. FIG. 18 is an explanatory diagram of the parallel count-up process in the higher-order sort process of the multi-item sequential sort process according to an embodiment of the present invention. Again, the number of appearances of elements in the higher-order item value number array VNo_1 is counted up in parallel by four processors. The count up results are shown in
図19は、本発明の一実施形態による多項目逐次ソート処理の上位次元ソート処理における累積度数分布配列生成処理の説明図である。上位次元ソート処理の場合も、下位次元ソート処理と同様に、複数台のプロセッサを用いて並列的に累積度数分布配列1900、1901、1902、1903が生成される。
FIG. 19 is an explanatory diagram of the cumulative frequency distribution array generation process in the higher-order sort process of the multi-item sequential sort process according to an embodiment of the present invention. Also in the case of the higher-order sort processing, cumulative
図20は、本発明の一実施形態による多項目逐次ソート処理の上位次元ソート処理におけるレコード番号配列の要素を並べ替える処理の説明図である。上位次元ソート処理の場合も、下位次元ソート処理と同様に、複数台のプロセッサを用いて、レコード番号配列1710がレコード番号配列2010へ並列的に並べ替えられる。このとき、同時に、グループ番号配列1720もグループ番号配列2020へ並列的に並べ替えられる。表形式データ1410は下位次元に続いて上位次元に関してソートされた表形式データを示している。
FIG. 20 is an explanatory diagram of the process of rearranging the elements of the record number array in the higher-order sort process of the multi-item sequential sort process according to an embodiment of the present invention. Also in the case of the higher-order sort process, the
レコード番号配列2010は、図10を参照して説明した多項目一括ソート処理によって得られたレコード番号配列1005と同一であり、多項目一括ソート処理と多項目逐次ソート処理のどちらでも同じ結果が得られることが確かめられた。
The
グループ番号配列2020は、最終的な累積度数分布配列2003の要素によって示されているように、Group2[0]からGroup2[4]の第1区間と、Group2[5]からGroup2[10]までの第2区間と、Group2[11]からGroup2[15]までの第3区間の3区間にグループ化される。さらに、第1区間は、要素の値によって、0、2、3の3個に分割され、第2区間は0、1、2、3の4個に分割され、第3区間は1、2、3の3個に分割されている。よって、グループ番号配列2020を先頭から順次比較することにより、たとえば、forループを使ってカウントアップすることにより、完全なグループ番号配列2030を得ることが可能である。尚、このようなシーケンシャルなアクセスは、キャッシュのプリフェッチが有効であることに注意すべきである。
As shown by the elements of the final cumulative
以上の通り、多項目逐次ソート処理によって得られたレコード番号配列2010に上記のユニーク行抽出処理を適用することによって、一意の固有値の組、すなわち、集計の次元を作成することができる。
As described above, by applying the above-described unique row extraction process to the
[測度並列算出処理]
最後に、ユニーク行抽出処理によって得られた集計の次元に基づいて測度を算出することにより多次元集計処理が実現される。以下、この測度の算出について説明する。集計処理の結果は、グループ番号を行とし、次元及び測度を列とする集計結果テーブルによって表現される。ここでは、集計結果テーブルのサイズ、すなわち、行数と、キャッシュメモリのサイズの関係に応じて、2通りの測度算出方法が提案される。ユニーク行抽出処理によって得られた最終的なレコード番号配列とグループ番号配列について検討すると、グループ番号配列は要素が昇順に並んでいる。一方、レコード番号配列は要素がランダムに配置されている。そのため、測度の算出を実施する際に、集計結果テーブルの行数が小さい場合には、できるだけキャッシュヒット率を高めるために、レコード番号配列中の要素をシーケンシャルに並べ替える(レコード番号昇順タイプ)これによって、レコード番号配列へのアクセスがシーケンシャルアクセスになるため、キャッシュのプリフェッチ機構によりキャッシュヒット率が高くなる。一方、グループ番号配列は、配列中の要素の値の変動が比較的小さいのでキャッシュヒット率が高い。逆に、集計結果テーブルの行数が比較的大きい場合には、処理手順の簡略化と作業用メモリの使用量の削減化のため、レコード番号配列の並べ替えは行わない(グループ番号昇順タイプ)。[Measure parallel calculation processing]
Finally, a multi-dimensional tabulation process is realized by calculating a measure based on the tabulation dimension obtained by the unique row extraction process. Hereinafter, calculation of this measure will be described. The result of the tabulation process is expressed by a tabulation result table with group numbers as rows and dimensions and measures as columns. Here, two types of measure calculation methods are proposed depending on the size of the tabulation result table, that is, the relationship between the number of rows and the size of the cache memory. Considering the final record number array and group number array obtained by the unique row extraction process, elements are arranged in ascending order in the group number array. On the other hand, elements are randomly arranged in the record number array. Therefore, when the calculation of the measure is performed, if the number of rows in the aggregation result table is small, the elements in the record number array are rearranged sequentially (record number ascending order type) in order to increase the cache hit rate as much as possible. As a result, the access to the record number array becomes sequential access, and the cache prefetch mechanism increases the cache hit rate. On the other hand, the group number array has a high cache hit rate because fluctuations in the values of elements in the array are relatively small. Conversely, when the number of rows in the tabulation result table is relatively large, the record number array is not rearranged (group number ascending order type) to simplify the processing procedure and reduce the amount of work memory used. .
[レコード番号昇順タイプの測度並列算出処理]
以下、レコード番号昇順タイプの測度並列算出処理について説明する。この処理は、キャッシュヒット率が高くなるという利点がある。レコード番号配列の要素は、一意であるが、レコード番号昇順の形に変換することにより、シーケンシャルアクセスになるため、プリフェッチ機構によりキャッシュヒット率が高くなる。また、グループ番号配列は変動が小さいので、高いキャッシュヒット率が維持できる。この処理では、各プロセッサがグループ番号配列の全体にアクセスする可能性があるので、プロセッサ毎に集計作業領域を用意し、各プロセッサの集計結果をまとめて最終的な集計結果を作成する。尚、多数の測度が存在する場合には、測度1つ当たりのレコード番号配列の並べ替えのコストが低下すること、項目値番号配列から項目値配列へのアクセスはランダムアクセスであることに注意すべきである。[Measure number parallel calculation process of record number ascending order type]
Hereinafter, the measure parallel calculation processing of the record number ascending order type will be described. This process has the advantage of a high cache hit rate. The elements of the record number array are unique, but the cache hit rate is increased by the prefetch mechanism because sequential access is performed by converting the elements into the ascending order of the record numbers. In addition, since the group number array has a small fluctuation, a high cache hit rate can be maintained. In this process, since each processor may access the entire group number array, a totaling work area is prepared for each processor, and the totaling result of each processor is collected to create a final counting result. Note that when there are a large number of measures, the cost of rearranging the record number array per measure is reduced, and access from the item value number array to the item value array is random access. Should.
レコード番号昇順タイプの測度並列算出処理は、複数台のプロセッサを用いて、レコード番号配列の要素及びグループ番号配列の要素を、レコード番号配列の要素が昇順となるように並べ替えるステップと、複数台のプロセッサを用いて、測度を並列的に集計し、各プロセッサで算出された測度を合成するステップとを備える。 Ascending record number order type measure parallel calculation processing uses a plurality of processors to rearrange the elements of the record number array and the elements of the group number array so that the elements of the record number array are in ascending order, Using the above-mentioned processors, the measures are aggregated in parallel, and the measures calculated by the processors are synthesized.
図21は、本発明の一実施形態によるレコード番号昇順タイプの測度並列算出処理における並べ替え処理の説明図である。 FIG. 21 is an explanatory diagram of the rearrangement process in the measure number ascending order type measure parallel calculation process according to an embodiment of the present invention.
並べ替え前のレコード番号配列をOrdSet’’、グループ番号配列をGroup3とし、並べ替え後のレコード番号配列をOrdSet’’、グループ番号配列をGroup4とし、ループ変数をiとすると、この並べ替え処理は、
for (i=0;i<16;i++) {
OrdSet’’’[OrdSet’’[i]]=OrdSet’’[i];
Group4[OrdSet’’[i]]=Group4[i];
}
と記述することができる。この処理は、レコード番号配列2010を図21に示されるようにプロセッサ毎の受け持ち範囲2100、2101、2102、2103のように分割することによって、複数台のプロセッサによって並列に実行される。If the record number array before sorting is OrdSet ″, the group number array is Group3, the sorted record number array is OrdSet ″, the group number array is Group4, and the loop variable is i, this sorting process is ,
for (i = 0; i <16; i ++) {
OrdSet ′ ″ [OrdSet ″ [i]] = OrdSet ″ [i];
Group4 [OrdSet '' [i]] = Group4 [i];
}
Can be described. This processing is executed in parallel by a plurality of processors by dividing the
図22は、本発明の一実施形態によるレコード番号昇順タイプの測度並列算出処理における集計処理の説明図である。レコード番号配列2110をプロセッサ毎の受け持ち範囲2200、2201、2202、2203のように4分割することによって、測度並列算出処理は4台のプロセッサによって並列に実行される。図22には、測度算出の対象となる項目「ポイント」の項目値番号配列VNo_3と項目値配列VL_3がそれぞれ示されている。本例では、測度は「ポイント」の合計値である。よって、既に求められた集計の次元1130に関して、「ポイント」の合計値を算出する。
FIG. 22 is an explanatory diagram of the aggregation process in the measure parallel calculation process of the record number ascending order type according to one embodiment of the present invention. By dividing the
4台のプロセッサが用いられるので、共有メモリ上には4個の中間結果格納配列Sum_0、Sum_1、Sum_2、Sum_3と、最終的な結果格納配列Sumが確保され、要素の値が0に初期化される。たとえば、CPU−0の処理は、iをループ変数として、
for (i=0;i<4;i++) {
Sum_0[Group4[OrdSet’’’[i]]=+VL_3[VNo_3[OrdSet’’’[i]]];
}
として記述される。CPU−1、CPU−2、CPU−3についても同様である。Since four processors are used, four intermediate result storage arrays Sum_0, Sum_1, Sum_2, Sum_3 and a final result storage array Sum are secured on the shared memory, and the element value is initialized to 0. The For example, the process of CPU-0 uses i as a loop variable.
for (i = 0; i <4; i ++) {
Sum_0 [Group4 [OrdSet ′ ″ [i]] = + VL_3 [VNo — 3 [OrdSet ′ ″ [i]]];
}
Is described as The same applies to CPU-1, CPU-2, and CPU-3.
次に、最終的な結果格納配列Sumを4分割して、各プロセッサが受け持ち範囲について、
Sum[i]=Sum_0[i]+Sum_1[i]+Sum_2[i]+Sum_3[i]
として記述される演算を実行することにより、同図に示されるような最終的な結果格納配列2240が得られる。この最終的な結果格納配列の要素が算出された測度であり、対応する次元が次元1130として図22に示されている。Next, the final result storage array Sum is divided into four, and each processor has a responsibility range.
Sum [i] = Sum_0 [i] + Sum_1 [i] + Sum_2 [i] + Sum_3 [i]
As a result, the final
[グループ番号昇順タイプの測度並列算出処理]
次に、グループ番号昇順タイプの測度並列算出処理について説明する。この処理は、上記のSum_0、Sum_1、Sum_2、Sum_3のような中間的な結果格納配列を確保しなくてもよいので、集計結果テーブルの行数が大きくても使用されるメモリ量が増加しないという利点がある。また、この処理は、レコード番号配列の並べ替えを必要としないので、処理時間が短縮されるという利点がある。一方、レコード番号配列の要素を添字として用いる項目値番号配列へのアクセスはランダムアクセスになることに注意する必要がある。また、項目値番号配列から項目値配列へのアクセスもランダムアクセスである。[Group number ascending type measure parallel calculation processing]
Next, group number ascending type measure parallel calculation processing will be described. This process does not require an intermediate result storage array such as Sum_0, Sum_1, Sum_2, and Sum_3, so that the amount of memory used does not increase even if the number of rows in the aggregation result table is large. There are advantages. Further, since this process does not require rearrangement of the record number array, there is an advantage that the processing time is shortened. On the other hand, it should be noted that access to the item value number array using the elements of the record number array as subscripts is random access. Access from the item value number array to the item value array is also random access.
図23は、本発明の一実施形態によるグループ番号昇順タイプの測度並列算出処理における集計処理の説明図である。レコード番号配列2010を4台のプロセッサ毎の受け持ち範囲2300、2301、2302、2303に分割する。ここで、注意すべきことは、同じグループに属するレコード番号が別々のプロセッサに割り当てられることがないように、かつ、各プロセッサの受け持ち範囲ができるだけ均等になるように受け持ち範囲2300、2301、2302、2303を決定しなければならない。たとえば、受け持ち範囲は、たとえば、何れか1台のプロセッサが、1台当たりの受け持ち範囲の限界を設定し、グループ番号配列2030を先頭から順に走査し、同一のグループに属するレコード番号が同一のプロセッサに割り当てられるように、受け持ち範囲の限界内で境界を選択することによって決定される。各プロセッサの受け持ち範囲が決定されると、測度並列算出処理は4台のプロセッサによって並列に実行される。図23には、測度算出の対象となる項目「ポイント」の項目値番号配列VNo_3と項目値配列VL_3がそれぞれ示されている。本例では、測度は「ポイント」の合計値である。よって、既に求められた集計の次元1130に関して、「ポイント」の合計値を算出する。
FIG. 23 is an explanatory diagram of a counting process in the group number ascending type measure parallel calculation process according to an embodiment of the present invention. The
レコード番号配列をOrdSet’’、グループ番号配列をGroup3、結果格納配列をSum(初期値は0)とし、ループ変数をiとすると、測度算出処理の全体は、
for (i=0;i<16;i++) {
Sum[Group3[OrdSet’’[i]]]=+VL_3[VNo_3[OrdSet’’[i]]];
}
として記述される。実際には、このループ中の命令は、各プロセッサの処理に展開されて並列に実行される。If the record number array is OrdSet ″, the group number array is Group3, the result storage array is Sum (initial value is 0), and the loop variable is i, the entire measure calculation process is as follows:
for (i = 0; i <16; i ++) {
Sum [Group3 [OrdSet ″ [i]]] = + VL — 3 [VNo — 3 [OrdSet ″ [i]]];
}
Is described as In practice, the instructions in this loop are expanded into the processing of each processor and executed in parallel.
本発明は、以上の実施の形態に限定されることなく、特許請求の範囲に記載された発明の範囲内で、種々の変更が可能であり、それらも本発明の範囲内に包含されるものであることは言うまでもない。 The present invention is not limited to the above embodiments, and various modifications can be made within the scope of the invention described in the claims, and these are also included in the scope of the present invention. Needless to say.
[多段階並列ソート]
ここでは、特許文献3に記載されているような、カウンティングソートに基づく並列ソートと基数ソートの考え方とを組み合わせることにより実現される多段階並列ソートの実施例を説明する。この多段階並列ソートは、上述の多項目一括ソート処理及び多項目逐次ソート処理の基礎となる記述である。[Multi-stage parallel sort]
Here, an embodiment of multi-stage parallel sorting realized by combining parallel sorting based on counting sort and the concept of radix sort as described in
項目値配列VLのサイズが大きいとき、すなわち、項目値番号の個数が多数であるときには、項目値番号を基数で表現し、桁ごとに並列ソートを実施することにより、効率的なソートを実現することが可能である。本例の多段階並列ソートは、最下位の桁から始めて順番に現在の桁に関するソート処理を行い、最後に最上位の桁に関するソート処理を行うことによって最終的なソートを完了する。 When the size of the item value array VL is large, that is, when there are a large number of item value numbers, the item value numbers are expressed in radixes, and parallel sorting is performed for each digit to achieve efficient sorting. It is possible. In the multi-stage parallel sort of this example, the sorting process for the current digit is sequentially performed starting from the least significant digit, and the final sorting is completed by finally performing the sorting process for the most significant digit.
多段階並列ソート方法の一例では、図24のデータ構造を利用する。本実施の形態では、CPUの台数は4台とし、すべてのCPUが並列に動作する例を考える。システム内のCPUの総数、及び、並列に動作するCPUの台数はこの例に限定されないことに注意すべきである。また、以下では、説明の便宜上、年齢の項目に関して、年齢の昇順にソートする場合を考える。また、年齢の項目値配列の要素は年齢の昇順に並べられている。図4のデータ構造では、年齢に関する項目値番号VNoは0から4までの値を取り得るので、基数=4として項目値番号を分解すると、項目値番号は下の桁と上の桁の2桁に分解される。具体的には、項目値番号のモジュロ(4)の値が下の桁の値であり、項目値番号を4で割った商が上の桁の値である。 In an example of the multistage parallel sorting method, the data structure of FIG. 24 is used. In the present embodiment, the number of CPUs is four, and an example in which all CPUs operate in parallel is considered. It should be noted that the total number of CPUs in the system and the number of CPUs operating in parallel are not limited to this example. In the following, for convenience of explanation, consider a case where the items of age are sorted in ascending order of age. The elements of the item value array for age are arranged in ascending order of age. In the data structure of FIG. 4, the item value number VNo relating to age can take a value from 0 to 4. Therefore, when the item value number is decomposed with the radix = 4, the item value number has two digits, the lower digit and the upper digit. Is broken down into Specifically, the modulo (4) value of the item value number is the lower digit value, and the quotient obtained by dividing the item value number by 4 is the upper digit value.
図25は、本実施例にかかる多段階並列ソート方法のフローチャートである。多段階並列ソート方法は、ステップ2501からステップ2505の5ステップにより構成される。
FIG. 25 is a flowchart of the multi-stage parallel sorting method according to the present embodiment. The multi-stage parallel sorting method includes five steps from
ステップ2501:項目値番号の範囲に応じて項目値番号の基数(本例では基数=4)を選択し、初期のレコード番号配列OrdSetを現在のレコード番号配列に設定し、項目値番号の最下位の桁(本例では項目値番号のモジュロ(4)の値)を現在の桁に設定する。 Step 2501: Select the radix of the item value number (in this example, radix = 4) according to the range of the item value number, set the initial record number array OrdSet to the current record number array, and set the lowest item value number (In this example, the modulo (4) value of the item value number) is set to the current digit.
ステップ2502:現在のレコード番号配列を分割して4台のプロセッサに割り当てる。 Step 2502: The current record number array is divided and assigned to four processors.
ステップ2503:4台のプロセッサのうちの各プロセッサにおいて、割り当てられたレコード番号配列の部分に含まれるレコードに対応した項目値番号の現在の桁の値の出現回数をカウントする。 Step 2503: In each of the four processors, the number of occurrences of the current digit value of the item value number corresponding to the record included in the allocated record number array portion is counted.
ステップ2504:項目値番号の現在の桁の値の範囲を分割して4台のプロセッサに割り当てる。 Step 2504: The range of the current digit value of the item value number is divided and assigned to four processors.
ステップ2505:4台のプロセッサのうちの各プロセッサにおいて、項目値番号の現在の桁の値の順番に、項目値番号の現在の桁の値が一致する範囲内ではレコード番号配列の部分の順番に従って、割り当てられた項目値番号の現在の桁の値のそれぞれの出現回数を累計数に変換する。 Step 2505: In each of the four processors, the order of the current digit value of the item value number is in accordance with the order of the part of the record number array within the range where the current digit value of the item value number matches. The number of occurrences of the current digit value of the assigned item value number is converted into a cumulative number.
ステップ2506:4台のプロセッサのうちの各プロセッサにおいて、割り当てられたレコード番号配列の部分に含まれるレコードに対応した項目値番号の現在の桁の値の出現回数の累計数をポインタとして利用して、割り当てられたレコード番号配列の部分に含まれるレコード番号をさらなるレコード番号配列に格納する。 Step 2506: In each of the four processors, the cumulative number of occurrences of the current digit value of the item value number corresponding to the record included in the assigned record number array portion is used as a pointer. The record number included in the allocated record number array portion is stored in a further record number array.
ステップ2507:基数で表現された項目値番号の最上位桁までソート処理が行われたかどうかを判定し、最上位桁までソートされているならば、多段階並列ソート処理を終了する。 Step 2507: It is determined whether or not the sorting process has been performed up to the most significant digit of the item value number expressed in the radix. If the sorting process has been performed up to the most significant digit, the multistage parallel sorting process is terminated.
ステップ2508:未処理の桁が残っているならば、その桁を現在の桁に設定し、さらなるレコード番号配列を現在のレコード番号配列として、ステップ2502へ戻る。 Step 2508: If an unprocessed digit remains, the digit is set to the current digit, the further record number array is set as the current record number array, and the process returns to Step 2502.
上記の本実施例による多段階並列ソート方法において、ステップ2502からステップ2506までのソート処理は、上記の本発明の並列ソート方法と同様の処理であり、項目値番号の代わりに項目値番号の現在の桁の値が使用される点だけが異なっている。
In the multi-stage parallel sorting method according to the above-described embodiment, the sorting processing from
次に、本実施例による多段階並列ソート方法を具体的に説明する。本例では、図24に示されたデータを、4台のCPUを使用し、年齢の昇順でソートする。初期化ステップ2501は、1段階目のソート処理として、年齢の項目値番号のモジュロー4(MOD 4)の値(下位の桁の値)に関するソート処理を設定し、2段階目のソート処理として、年齢の項目値番号の4で割った商(DIV 4)の値に関するソート処理を設定する。
Next, the multi-stage parallel sorting method according to the present embodiment will be specifically described. In this example, the data shown in FIG. 24 is sorted in ascending order of age using four CPUs. The
初期化ステップ2501では、項目値番号の現在の桁の値の出現回数をカウントする配列が準備される。
In an
図26A乃至28Bは、多段階並列ソート方法の第1段階のカウントステップ2503の説明図である。図26Aのサブステップ1では、たとえば、CPU−0は、OrdSet[0]の値0を読み出し、読み出された値0を添字として、VNo[0]の値1を読み出し、この値1のモジュロー4(MOD4)の値1を添字として、Count−0[1]の値0を1にインクリメントする。同様に、CPU−1は、OrdSet[5]の値5を読み出し、この値5を添字として、VNo[5]の値2を読み出し、この値2のMOD4の値2を添字として、Count−1[2]の値0を1にインクリメントする。以下、図26Bのサブステップ2、図27Aのサブステップ3、図27Bのサブステップ4及び図28Aのサブステップ5を実行することにより、図28Bに示されるようなカウントアップ結果が得られる。図28Bの配列Count−0の要素Count−0[i]は、CPU−0が担当した配列OrdSetのOrdSet[0]からOrdSet[4]の範囲内の各レコードに対応する年齢の項目値番号の下位の桁の値iの出現回数を表わしている。たとえば、Count−0[0]は、CPU−0の担当範囲内の項目値番号の下位の桁の値0の出現回数が2回であることを表し、Count−3[1]はCPU−3の担当範囲内の項目値番号の下位の桁の値1の出現回数が2回であることを表す。
FIGS. 26A to 28B are explanatory diagrams of the
図29A、Bは多段階並列ソート方法の第1段階の累計数化ステップの説明図である。本例では、昇順ソートに対応して、項目値番号の下位の桁の値の昇順に累計数化を行う。CPU−0は、配列Countの1行目(すなわち、項目値番号の下位の桁の値0)の累計数化を担当し、CPU−1乃至CPU−3は、それぞれ、配列Countの2乃至4行目(すなわち、項目値番号の下位の桁の値1乃至3)の累計数化を担当する。図29Aに示されるように、累計数化は配列Countの横方向(すなわち、添字が一致する行)を優先して行われ、次に、先行する行の累計数を後続する行の累計数に加算することにより、全体の累計数が決まる。尚、横方向の累計数化は、既に説明したように各CPUが並列に実行可能であるが、単一のCPUが担当してもよい。
FIGS. 29A and 29B are explanatory diagrams of the cumulative number step in the first stage of the multi-stage parallel sorting method. In this example, in accordance with the ascending order sort, the cumulative number is performed in ascending order of the value of the lower digit of the item value number. CPU-0 is in charge of accumulating the first row of the array count (that is, the
図30A乃至32Bは多段階並列ソート方法の第1段階においてレコード番号をさらなるレコード番号配列に格納する転送ステップの説明図である。転送ステップでは、各CPUは、レコード番号配列OrdSetから自分が担当する範囲内のレコード番号を読み出し、次に、そのレコード番号を添字として、ポインタ配列VNoから項目値番号の下位の桁の値を読み出し、さらに、この項目値番号の下位の桁の値を添字として、自プロセッサに関連付けられた累計数化されたCount配列から累計数値を読み出し、この読み出された累計数値をポイントしてさらなるレコード番号配列OrdSet’にレコード番号を格納すると共に、Count配列の累計数値を1ずつインクリメントする。図32Bはこのような転送ステップの結果として第1段階で得られたレコード番号配列OrdSet’を表す。 30A to 32B are explanatory diagrams of a transfer step of storing record numbers in a further record number array in the first stage of the multistage parallel sort method. In the transfer step, each CPU reads the record number within the range that it is in charge of from the record number array OrdSet, and then reads the value of the lower digit of the item value number from the pointer array VNo using the record number as a subscript. Further, using the value of the lower digit of this item value number as a subscript, the cumulative numerical value is read from the accumulated count array associated with the processor, and the further cumulative record number is pointed to the read cumulative numerical value. The record number is stored in the array OrdSet ′, and the cumulative value of the Count array is incremented by one. FIG. 32B shows the record number array OrdSet 'obtained in the first stage as a result of such a transfer step.
第2段階では、第1段階で得られたレコード番号配列OrdSet’を初期条件として、年齢の項目値番号の上位の桁の値(DIV 4の値)に関する昇順ソートを実行する。 In the second stage, with the record number array OrdSet 'obtained in the first stage as an initial condition, ascending order sorting is performed on the value of the upper digit (value of DIV 4) of the item value number of age.
図33は、本実施例による多段階並列ソート方法の第2段階のステップ2502において、現在のレコード番号配列OrdSet’を4台のCPUに割り当て、それぞれのCount配列を準備した状態を示す図である。
FIG. 33 is a diagram showing a state in which the current record number array OrdSet ′ is assigned to four CPUs and the respective Count arrays are prepared in
図34A乃至36Bは、多段階並列ソート方法の第2段階のカウントステップの説明図である。図34Aのサブステップ1では、たとえば、CPU−0は、OrdSet’[0]の値2を読み出し、読み出された値2を添字として、VNo[2]の値4を読み出し、この値1の4で割った商(DIV4)の値1を添字として、Count−0[1]の値0を1にインクリメントする。同様に、CPU−1は、OrdSet’[5]の値12を読み出し、この値12を添字として、VNo[12]の値4を読み出し、この値4のDIV4の値1を添字として、Count−1[1]の値0を1にインクリメントする。以下、図34Bのサブステップ2、図35Aのサブステップ3、図35Bのサブステップ4及び図36Aのサブステップ5を実行することにより、図36Bに示されるような第2段階のカウントアップ結果が得られる。図36Bの配列Count−0の要素Count−0[i]は、CPU−0が担当した配列OrdSet’のOrdSet’[0]からOrdSet[4]の範囲内の各レコードに対応する年齢の項目値番号の上位の桁の値iの出現回数を表わしている。たとえば、Count−0[0]は、CPU−0の担当範囲内の項目値番号の上位の桁の値0の出現回数が4回であることを表し、Count−3[1]はCPU−3の担当範囲内の項目値番号の上位の桁の値1の出現回数が0回であることを表す。
FIG. 34A thru | or 36B is explanatory drawing of the count step of the 2nd step of a multistep parallel sort method. In
図37は多段階並列ソート方法の第2段階の累計数化ステップの説明図である。本例では、昇順ソートに対応して、項目値番号の上位の桁の値の昇順に累計数化を行う。多段階化によって項目値番号の上位の桁の値の個数は2個に削減されているので、本例では、たとえば、CPU−0がすべての値の累計数化を担当する。図37に示されるように、CPU−0は、Count−0[0]、Count−1[0]、Count−2[0]、Count−3[0]、Count−0[1]、Count−1[1]、Count−2[1]、及び、Count−3[1]の順に累計数化を行う。勿論、本例の場合に、CPU−0とCPU−1の2台のCPUに項目値番号の上位の桁の値0と1を割り当て、2台のCPUが累計数化演算を行ってもよい。
FIG. 37 is an explanatory diagram of the cumulative number step in the second stage of the multi-stage parallel sorting method. In this example, corresponding to the ascending sort, the cumulative number is performed in ascending order of the value of the upper digit of the item value number. Since the number of the upper digits of the item value number is reduced to two by multi-stepping, in this example, for example, CPU-0 is in charge of accumulating all values. As shown in FIG. 37, the CPU-0 counts Count-0 [0], Count-1 [0], Count-2 [0], Count-3 [0], Count-0 [1], Count- Accumulation is performed in the order of 1 [1], Count-2 [1], and Count-3 [1]. Of course, in the case of this example, the
図38A乃至40Bは多段階並列ソート方法の第2段階においてレコード番号をさらなるレコード番号配列に格納する転送ステップの説明図である。転送ステップでは、各CPUは、レコード番号配列OrdSetから自分が担当する範囲内のレコード番号を読み出し、次に、そのレコード番号を添字として、ポインタ配列VNoから項目値番号の上位の桁の値を読み出し、さらに、この項目値番号の上位の桁の値を添字として、自プロセッサに関連付けられた累計数化されたCount配列から累計数値を読み出し、この読み出された累計数値をポイントしてさらなるレコード番号配列OrdSet”にレコード番号を格納すると共に、Count配列の累計数値を1ずつインクリメントする。図40Bはこのような転送ステップの結果として第2段階で得られたレコード番号配列OrdSet”を表す。 FIGS. 38A to 40B are explanatory diagrams of a transfer step of storing record numbers in a further record number array in the second stage of the multistage parallel sort method. In the transfer step, each CPU reads the record number within the range that it is in charge of from the record number array OrdSet, and then reads the value of the upper digit of the item value number from the pointer array VNo using the record number as a subscript. Further, using the value of the upper digit of this item value number as a subscript, the cumulative numerical value is read from the accumulated count array associated with the processor, and the further cumulative record number is pointed to the read cumulative numerical value. The record number is stored in the array OrdSet ″, and the cumulative value of the Count array is incremented by 1. FIG. 40B shows the record number array OrdSet ″ obtained in the second stage as a result of such a transfer step.
本実施例の多段階並列ソート方法は項目値番号の下位の桁と上位の桁の2段階により構成されているので、これ以上のソート処理は行われない。したがって、第2段階で得られたレコード番号配列OrdSet”が最初のレコード番号配列OrdSetを年齢に関して昇順にソートを行った結果である。 Since the multi-stage parallel sorting method of the present embodiment is composed of two stages of the lower digit and the upper digit of the item value number, no further sort processing is performed. Therefore, the record number array OrdSet "obtained in the second stage is the result of sorting the first record number array OrdSet in ascending order with respect to age.
図41A及び42Bは、図4に示されたデータ構造に対して本発明の実施の形態にかかる昇順の多段階並列ソート方法を適用した結果を示す図である。本例では、年齢に関する昇順ソートを行ったので、結果のレコード番号配列OrdSet”には、年齢の項目値として16歳、18歳、20歳、21歳及び23歳を有するレコードが年齢順に並んでいることがわかる。また、年齢が一致するレコードの順番は、元のレコード番号配列OrdSet中の順番が保存されている。 41A and 42B are diagrams showing the results of applying the ascending multi-stage parallel sorting method according to the embodiment of the present invention to the data structure shown in FIG. In this example, since the ascending order regarding age is performed, records having the age item values of 16, 18, 20, 21, and 23 are arranged in order of age in the resulting record number array OrdSet ”. In addition, the order of records having the same age is stored in the original record number array OrdSet.
また、上記の多段階並列ソート方法は昇順ソートであるが、本実施例による多段階並列ソートは降順ソートでも同様に動作する。さらに、多段階並列ソートの各段階における累計数化演算は、複数台のプロセッサで並列処理してもよく、或いは、少なくとも1台、好ましくは、1台のプロセッサが単独で処理してもよい。 Although the above-described multi-stage parallel sorting method is ascending order sorting, the multi-stage parallel sorting according to the present embodiment operates similarly in descending order sorting. Further, the cumulative number calculation in each stage of the multi-stage parallel sort may be processed in parallel by a plurality of processors, or may be processed by at least one, preferably one processor alone.
[多段階ソート]
上記の多段階並列ソートは、最下位の桁から始めて順番に現在の桁に関するソート処理を行い、最後に最上位の桁に関するソート処理を行うことによって最終的なソートを完了している。これに対して、最上位の桁から始めて順番に現在の桁に関するソート処理を行い、最後に最下位の桁に関するソート処理を行うことによって最終的なソートを完了することも可能である。以下では、このような最上位から最下位の順にソート処理を多段化する方法を簡単に説明する。この多段化手法は、上述の多項目逐次ソート処理に同様に適用される。[Multi-level sorting]
In the above multi-stage parallel sort, the final sort is completed by performing the sort process for the current digit in order starting from the least significant digit and finally the sort process for the most significant digit. On the other hand, it is also possible to complete the final sorting by performing the sorting process for the current digit in order starting from the most significant digit and finally the sorting process for the least significant digit. In the following, a method of performing multi-stage sort processing in order from the highest level to the lowest level will be briefly described. This multi-stage technique is similarly applied to the above-described multi-item sequential sorting process.
本例では、図43に示されるようなデータ構造を利用する。また、本例では、CPUの台数は1台とする。また、以下では、年齢の項目に関して、年齢の昇順にソートする場合を考える。レコードの総数はレコード番号0からレコード番号19までの20個であり、項目値番号は0から8までの9個である。すなわち、実際の年齢の値は、15、16、18、19、20、21、23、25及び28の9通りである。図43のデータ構造では、年齢に関する項目値番号VNoは0から8までの値を取り得るので、基数=4として項目値番号を分解すると、項目値番号を4で割った商が上の桁の値であり、項目値番号のモジュロ(4)の値が下の桁の値である。項目値番号の上の桁は0、1及び2の3通りの値を取り、下の桁は0、1、2及び3の4通りの値を取り得る。
In this example, a data structure as shown in FIG. 43 is used. In this example, the number of CPUs is one. In the following description, it is assumed that the items of age are sorted in ascending order of age. The total number of records is 20 from
最初に、第1段階において、上の桁の値0、1及び2の出現回数をカウントするための配列Count−1を準備し、要素を0で初期化する。たとえば、Count−1[0]は、項目値番号の上位の桁の値が0であるレコードの個数をカウントするための領域である。
First, in the first stage, an array Count-1 for counting the number of occurrences of the
次に、レコード番号配列OrdSetの先頭の要素(すなわち、レコード)から順番に、その要素に対応する項目値番号を配列VNoから読み出し、その項目値番号を4で割った商の値をポインタとして用いて、配列Count−1の要素の値をインクリメントする。図44A乃至Dは、OrdSet[0]=0、OrdSet[7]=7、及び、OrdSet[19]=19の3個のレコード番号について、項目値番号の上位の桁の値を算出し、該当するカウンタをカウントアップし、次に累計数化する例の説明図である。図44Cからわかるように、この第1段階のカウントアップ処理により、項目値番号の上位の桁の値が0であるレコードの個数は12個、上位の桁の値が1であるレコードの個数は7個、上位の桁の値が2であるレコードの個数は1個である。さらに、図44Dに示されるように、このカウント値を累計数化する。 Next, in order from the first element (that is, record) of the record number array OrdSet, the item value number corresponding to the element is read from the array VNo, and the quotient value obtained by dividing the item value number by 4 is used as a pointer. Then, the value of the element of the array Count-1 is incremented. 44A to 44D calculate the values of the upper digits of the item value numbers for the three record numbers of OrdSet [0] = 0, OrdSet [7] = 7, and OrdSet [19] = 19. It is explanatory drawing of the example which counts up the counter to perform, and makes it a cumulative number next. As can be seen from FIG. 44C, by this first-stage count-up process, the number of records in which the upper digit value of the item value number is 0 is 12, and the number of records in which the upper digit value is 1 is The number of records having 7 and the value of the upper digit is 2 is 1. Further, as shown in FIG. 44D, this count value is accumulated.
次に、項目値番号の上位の桁の値の出現回数が累計数化された配列Aggr−1を用いて、レコード番号配列OrdSetをさらなるレコード番号配列OrdSet’に変換する。具体的には、OrdSet[i]=jであるならば、VNo[j]を読み出し、このVNo[j]を4で割った商(VNo[j] DIV 4)をkとすると、Aggr−1[k]の値を読み出し、OrdSet[Aggr−1[k]]にレコード番号jを設定し、Aggr−1[k]をインクリメントする。図45A、Bは、このような多段階ソートにおけるレコード番号転送処理の説明図であり、図45AはOrdSet[0]の転送を、図45BはOrdSet[19]の転送を表している。図46は、第1段階のレコード番号転送の結果のレコード番号配列OrdSet’と、上位の桁の値が分布する範囲とを表している。たとえば、上位の桁の値が0であるレコードはレコード番号配列OrdSet’のOrdSet’[0]からOrdSet’[11]の範囲(区間0)に分布し、上位の桁の値が1であるレコードはレコード番号配列OrdSet’のOrdSet’[12]からOrdSet’[18]の範囲(区間1)に分布し、上位の桁の値が2であるレコードはレコード番号配列OrdSet’のOrdSet’[19](区間2)に存在する。 Next, the record number array OrdSet is converted into a further record number array OrdSet 'using the array Aggr-1 in which the number of appearances of the upper digits of the item value number is accumulated. Specifically, if OrdSet [i] = j, VNo [j] is read, and if the quotient (VNo [j] DIV 4) obtained by dividing VNo [j] by 4 is k, Aggr-1 The value of [k] is read, record number j is set in OrdSet [Aggr-1 [k]], and Aggr-1 [k] is incremented. 45A and 45B are explanatory diagrams of record number transfer processing in such a multi-stage sort. FIG. 45A shows transfer of OrdSet [0], and FIG. 45B shows transfer of OrdSet [19]. FIG. 46 shows a record number array OrdSet 'as a result of the first-stage record number transfer and a range in which the upper digit values are distributed. For example, records whose upper digit value is 0 are distributed in the range (Section 0) from OrdSet ′ [0] to OrdSet ′ [11] of the record number array OrdSet ′, and the value of the upper digit is 1. Are distributed in the range (Section 1) from OrdSet ′ [12] to OrdSet ′ [18] of the record number array OrdSet ′, and the record whose upper digit value is 2 is OrdSet ′ [19] of the record number array OrdSet ′. It exists in (Section 2).
次に、多段階ソートの第2段階では、各区間内で、項目値番号の下位の桁の値によってレコード番号をソートする。たとえば、OrdSet’の区間1は、OrdSet”の対応した区間1へ転送される。第2段階のソートでは、既に上位の桁で区間が定められているので、レコード番号が区間外に転送されることはない。
Next, in the second stage of multi-stage sorting, the record numbers are sorted by the value of the lower digit of the item value number within each section. For example,
図47は、多段階ソートの第2段階の初期状態を表す図である。以下の説明では、OrdSet’の区間1について説明する。たとえば、複数台のプロセッサが存在する場合には、区間ごとにプロセッサを割り当てることにより、以下の処理を並列化することも可能である。Count−2は区間1内で項目値番号の下位の桁の値(0,1,2,3)の出現回数をカウントするための配列である。
FIG. 47 is a diagram illustrating an initial state of the second stage of the multistage sorting. In the following description,
図48A乃至Cは、多段階ソートの第2段階のカウントアップ及び累計数化の説明図である。図48Aから始めて順番にカウントアップすることにより、図48Bに示されるようなカウントアップ配列が得られる。このカウントアップ配列は、図48Cに示されるように累計数化される。 FIGS. 48A to 48C are explanatory diagrams of the second stage count-up and accumulation in the multi-stage sort. By counting up sequentially starting from FIG. 48A, a count-up sequence as shown in FIG. 48B is obtained. This count-up array is accumulated as shown in FIG. 48C.
最後に、第2の累計数配列Aggr−2をポインタとして利用して、レコード番号配列OrdSet’の区間1をレコード番号配列OrdSet”の区間1へ転送することにより、多段階ソートが完了する。図49A、Bは、多段階ソートの第2段階のレコード番号転送の説明図である。具体的には、OrdSet’[i]=jであるならば、VNo[j]を読み出し、このVNo[j]を4で割った余り(VNo[j] MOD 4)をkとすると、Aggr−2[k]の値を読み出し、OrdSet”[Aggr−2[k]]にレコード番号jを設定し、Aggr−2[k]をインクリメントする。図49AはOrdSet’[14]の転送を、図49BはOrdSet’[18]の転送を表している。図49BのOrdSet”の区間1は、区間1の最終的なソート結果を表している。
Finally, using the second cumulative number array Aggr-2 as a pointer, the
区間1と同様に、その他の区間0、区間2についても第2段階のカウントアップ、累計数化、及び、レコード番号転送を適用することにより、レコード番号配列OrdSetの全体がレコード番号配列OrdSet”へ転送され、ソートが完了する。
Similar to the
実施例3では、100万行(1M)、500万行(5M)、1000万行(10M)、5000万行(50M)及び1億行(100M)の3次元表形式テーブルをソートし、一意の項目値の組を抽出し、各項目値の組の出現回数をカウントする集計処理を以下の5通りの方式、すなわち、
(1)多段階並列ソート方式(旧方式)
(2)本発明による多項目逐次ソートとレコード番号昇順形式を組み合わせた方式(OrdSet昇順方式)
(3)本発明による多項目一括ソートとレコード番号昇順形式を組み合わせた方式(OrdSet昇順方式(3次元一括ソート))
(4)本発明による多項目逐次ソートとグループ番号昇順形式を組み合わせた方式(次元昇順方式)
(5)本発明による多項目一括ソートとグループ番号昇順形式を組み合わせた方式(次元昇順方式(3次元一括ソート))
を用いて実施した。そして、各方式の処理時間を計測し、本発明による方式が旧方式に対してどの程度高速化されたかを表す高速化倍率を算出した。本実施例の測定環境は次の通りである。
コンピュータ機種:Dell PowerEdgeTM 6800
CPU: Intel(登録商標)デュアルコアプロセッサ×2
クロック数: 3.16GHz
メモリサイズ: 32GB
L2キャッシュ: 1MB×4
OS: SuSE 2.6.5−7−191−smp
図50A乃至Cは実施例3における集計処理の内容を説明する図である。図50Aは出力される集計結果テーブルを表し、図50Bは100万行からなる集計元テーブルを表し、図50Cは632334個のレコードからなる集計結果テーブルを表している。In the third embodiment, the three-dimensional tabular table of 1 million rows (1M), 5 million rows (5M), 10 million rows (10M), 50 million rows (50M) and 100 million rows (100M) is sorted and unique. The following five methods, that is, a totaling process for extracting a set of item values and counting the number of occurrences of each set of item values, are as follows:
(1) Multi-stage parallel sort method (old method)
(2) A method combining multi-item sequential sorting and record number ascending order according to the present invention (OrdSet ascending order method)
(3) A method combining multi-item batch sorting and record number ascending order according to the present invention (OrdSet ascending order method (three-dimensional batch sorting))
(4) Method combining multi-item sequential sorting and group number ascending order according to the present invention (dimensional ascending order method)
(5) Method combining multi-item batch sorting and group number ascending order according to the present invention (dimensional ascending order method (three-dimensional batch sorting))
It carried out using. Then, the processing time of each method was measured, and a speed-up magnification representing how fast the method according to the present invention was compared with the old method was calculated. The measurement environment of this example is as follows.
Computer model: Dell PowerEdge ™ 6800
CPU: Intel (registered trademark) dual-
Number of clocks: 3.16 GHz
Memory size: 32GB
L2 cache: 1MB x 4
OS: SuSE 2.6.5-7-191-smp
50A to 50C are diagrams for explaining the contents of the aggregation process in the third embodiment. FIG. 50A shows an output totaling result table, FIG. 50B shows a totaling source table consisting of 1 million rows, and FIG. 50C shows a totaling result table consisting of 632334 records.
図51A乃至Cは実施例3の測定結果を示す図である。図51Aは、上記の5方式による処理の所要時間(ミリ秒)を表し、図51Bは本発明による上記の(2)から(5)の方式が旧方式(1)に対して高速化された倍率を表し、図51Cは図51Bと同じ高速化倍率をグラフ化したものである。 51A to 51C are diagrams showing measurement results of Example 3. FIG. FIG. 51A shows the required time (milliseconds) of processing by the above five methods, and FIG. 51B shows that the above methods (2) to (5) according to the present invention are faster than the old method (1). FIG. 51C is a graph showing the same high speed magnification as FIG. 51B.
(5)次元昇順方式(3次元一括ソート)、(3)OrdSet昇順方式(3次元一括ソート)、(4)次元昇順方式、(2)OrdSet昇順方式の順に高速化され、高速化倍率は、状況によっては、旧方式の10倍に達している。 (5) Dimension ascending order method (3D batch sort), (3) OrdSet ascending order method (3D batch sort), (4) Dimension ascending order method, (2) OrdSet ascending order method. Depending on the situation, it has reached 10 times the old method.
実施例4では、実施例3と同じ測定環境において、100万行(1M)、500万行(5M)、1000万行(10M)、5000万行(50M)及び1億行(100M)の3次元表形式テーブルをソートし、一意の項目値の組を抽出し、測度の合計を算出する集計処理を実施例2と同様に上記の5通りの方式を用いて実施した。そして、各方式の処理時間を計測し、本発明による方式が旧方式に対してどの程度高速化されたかを表す高速化倍率を算出した。 In Example 4, in the same measurement environment as Example 3, 3 million lines (1M), 5 million lines (5M), 10 million lines (10M), 50 million lines (50M), and 100 million lines (100M) A tabulation process for sorting the dimension table format table, extracting a set of unique item values, and calculating the total of the measures was performed using the above five methods in the same manner as in the second embodiment. Then, the processing time of each method was measured, and a speed-up magnification representing how fast the method according to the present invention was compared with the old method was calculated.
図52A乃至Cは実施例4における集計処理の内容を説明する図である。図52Aは出力される集計結果テーブルを表し、図52Bは100万行からなる集計元テーブルを表し、図52Cは632334個のレコードからなる集計結果テーブルを表している。 52A to 52C are diagrams for explaining the contents of the aggregation process in the fourth embodiment. FIG. 52A shows an output totaling result table, FIG. 52B shows a totaling source table consisting of 1 million rows, and FIG. 52C shows a totaling result table consisting of 632334 records.
図53A乃至Cは実施例4の測定結果を示す図である。図53Aは、上記の5方式による処理の所要時間(ミリ秒)を表し、図53Bは本発明による上記の(2)から(5)の方式が旧方式(1)に対して高速化された倍率を表し、図53Cは図53Bと同じ高速化倍率をグラフ化したものである。 53A to 53C are diagrams showing measurement results of Example 4. FIG. FIG. 53A shows the required time (milliseconds) of processing by the above five methods, and FIG. 53B shows that the above methods (2) to (5) according to the present invention are faster than the old method (1). FIG. 53C is a graph showing the same high speed magnification as FIG. 53B.
集計結果テーブルのサイズにかかわらず、3次元一括ソート方式が逐次ソート方式より高速に集計処理を実現している。さらに、集計結果テーブルのサイズが比較的小さい場合(500万行未満の場合)、次元昇順方式がOrdSet昇順方式より高速化されているが、集計結果テーブルのサイズが大きくなると、OrdSet昇順方式が次元昇順方式より高速化されることがわかった。 Regardless of the size of the tabulation result table, the three-dimensional batch sort method realizes tabulation processing faster than the sequential sort method. Furthermore, when the size of the aggregation result table is relatively small (less than 5 million rows), the dimension ascending method is faster than the OrdSet ascending method, but when the size of the aggregation result table is increased, the OrdSet ascending method is dimensioned. It was found that it was faster than the ascending method.
実施例3及び実施例4から、本発明の方式は、(2)から(5)の何れの方式であっても、大規模な表形式データの多次元集計処理を従来技術より高速に実現することが実証された。 From Example 3 and Example 4, the method of the present invention realizes multi-dimensional tabulation processing of large-scale tabular data at higher speed than the prior art, regardless of which method is (2) to (5). It was proved.
【0020】
理は、たとえば、C言語スタイルでは、
for (i=0;i<4;i++) {
for (j=0;j<4;j++) {
Count[j][V_VNo[OrdSet[j*4+i]]]++;
}
}
と記述される。図7の例では、初期化されたカウント配列710、711、712及び713は、仮想項目値番号の数え上げ処理によって、カウント配列720、721、722及び723となる。尚、本例において、第1の項目値配列をVL_1、第2の項目値配列をVL_2とすると、カウント配列Countのサイズは、(VL_1のサイズ)×(VL_2)のサイズに一致する。
[0057]
この数え上げ処理の結果は、たとえば、CPU−0の受け持ち範囲内では、仮想項目値番号=0、2、5及び9がそれぞれ1個ずつ存在し、CPU−1の受け持ち範囲内では、仮想項目値番号=6、7、10及び11がそれぞれ1個ずつ存在し、CPU−2の受け持ち範囲内では、仮想項目値番号0、3、4及び5がそれぞれ1個ずつ存在し、CPU−3の受け持ち範囲内では、仮想項目値番号=2、5、10及び11がそれぞれ1個ずつ存在することを表している。
[0058]
続いて、本発明の一実施形態では、コンピュータシステム10は、仮想項目値番号配列の各要素を累計数化して、仮想項目値番号の出現回数の累積度数分布配列を生成する。図8は、本発明の一実施形態による累積度数分布配列を生成する処理の説明図である。プロセッサjの受け持ち範囲内のカウント配列をCount[j]、累積度数分布配列をAggr[j]とすると、累積度数分布は、
Aggr[0][0]=0
Aggr[1][0]=Aggr[0][0]+Count[0][0]
Aggr[2][0]=Aggr[1][0]+Count[1][0]
Aggr[3][0]=Aggr[2][0]+Count[2][0]
Aggr[0][1]=Aggr[3][0]+Count[3][0]
Aggr[1][1]=Aggr[0][1]+Count[0][1][0020]
For example, in C language style,
for (i = 0; i <4; i ++) {
for (j = 0; j <4; j ++) {
Count [j] [V_VNo [OrdSet [j * 4 + i]]] ++;
}
}
Is described. In the example of FIG. 7, the initialized
[0057]
As a result of the counting process, for example, one virtual item value number = 0, 2, 5, and 9 exists in the CPU-0 range, and a virtual item value exists in the CPU-1 range. Number = 6, 7, 10 and 11 respectively, and within the CPU-2 range, there is one virtual
[0058]
Subsequently, in one embodiment of the present invention, the
Aggr [0] [0] = 0
Aggr [1] [0] = Aggr [0] [0] + Count [0] [0]
Aggr [2] [0] = Aggr [1] [0] + Count [1] [0]
Aggr [3] [0] = Aggr [2] [0] + Count [2] [0]
Aggr [0] [1] = Aggr [3] [0] + Count [3] [0]
Aggr [1] [1] = Aggr [0] [1] + Count [0] [1]
【0030】
び1523となる。尚、本例において、カウント配列Countのサイズは、対象としている項目の項目値番号配列をVLとし、プロセッサの台数をNとすると、(VLのサイズ)×Nに一致する。
[0086]
続いて、本発明の一実施形態では、コンピュータシステム10は、項目値番号配列の各要素を累計数化して、項目値番号の出現回数の累積度数分布配列を生成する。図16は、本発明の一実施形態による多項目逐次ソート処理の下位次元ソート処理における累積度数分布配列を生成する処理の説明図である。プロセッサjの受け持ち範囲内のカウント配列をCount[j]、累積度数分布配列をAggr[j]とすると、累積度数分布は、
Aggr[0][0]=0
Aggr[1][0]=Aggr[0][0]+Count[0][0]
Aggr[2][0]=Aggr[1][0]+Count[1][0]
Aggr[3][0]=Aggr[2][0]+Count[2][0]
Aggr[0][1]=Aggr[3][0]+Count[3][0]
Aggr[1][1]=Aggr[0][1]+Count[0][1]
Aggr[2][1]=Aggr[1][1]+Count[1][1]
Aggr[3][1]=Aggr[2][1]+Count[2][1]
Aggr[0][2]=Aggr[3][1]+Count[3][1]
Aggr[1][2]=Aggr[0][2]+Count[0][2]
Aggr[2][2]=Aggr[1][2]+Count[1][2]
Aggr[3][2]=Aggr[2][2]+Count[2][2]
Aggr[0][3]=Aggr[3][2]+Count[3][2]
Aggr[1][3]=Aggr[0][3]+Count[0][3]
Aggr[2][3]=Aggr[1][3]+Count[1][3]
Aggr[3][3]=Aggr[2][3]+Count[2][3]
として計算される。この計算は、4台のプロセッサのうちのいずれか1台のプロセッサが単独で行ってもよいが、4台のプロセッサに項目値番号の範囲を割り当てて、4台のプロセッサによって並列に行ってもよい。[0030]
1523. In this example, the size of the count array Count is equal to (VL size) × N, where the item value number array of the target item is VL and the number of processors is N.
[0086]
Subsequently, in one embodiment of the present invention, the
Aggr [0] [0] = 0
Aggr [1] [0] = Aggr [0] [0] + Count [0] [0]
Aggr [2] [0] = Aggr [1] [0] + Count [1] [0]
Aggr [3] [0] = Aggr [2] [0] + Count [2] [0]
Aggr [0] [1] = Aggr [3] [0] + Count [3] [0]
Aggr [1] [1] = Aggr [0] [1] + Count [0] [1]
Aggr [2] [1] = Aggr [1] [1] + Count [1] [1]
Aggr [3] [1] = Aggr [2] [1] + Count [2] [1]
Aggr [0] [2] = Aggr [3] [1] + Count [3] [1]
Aggr [1] [2] = Aggr [0] [2] + Count [0] [2]
Aggr [2] [2] = Aggr [1] [2] + Count [1] [2]
Aggr [3] [2] = Aggr [2] [2] + Count [2] [2]
Aggr [0] [3] = Aggr [3] [2] + Count [3] [2]
Aggr [1] [3] = Aggr [0] [3] + Count [0] [3]
Aggr [2] [3] = Aggr [1] [3] + Count [1] [3]
Aggr [3] [3] = Aggr [2] [3] + Count [2] [3]
Is calculated as This calculation may be performed by any one of the four processors alone, or may be performed in parallel by four processors by assigning a range of item value numbers to the four processors. Good.
【0031】
[0087]
4台のプロセッサによって並列的に累積度数分布を計算する場合には、最初に、各項目値番号iの出現回数の合計値Sum[i]を、たとえば、
for(i=0;i<4:i++) {
for(j=0;j<4;j++) {
Sum[i]=Count[j][i];
}
}
によって、並列的に計算する。本実施形態では、たとえば、CPU−0がi=0のループを担当し、CPU−1がi=1のループを担当し、CPU−2がi=2のループを担当し、CPU−3がi=3のループを担当する。
[0088]
続いて、たとえば、4台のプロセッサが並列的に、
Aggr[0][0]=0
Aggr[1][0]=Aggr[0][0]+Count[0][0]
Aggr[2][0]=Aggr[1][0]+Count[1][0]
Aggr[3][0]=Aggr[2][0]+Count[2][0]
Aggr[0][1]=Sum[0]
Aggr[1]「1]=Aggr[0][1]+Count[0][1]
Aggr[2][1]=Aggr[1][1]+Count[1][1]
Aggr[3][1]=Aggr[2][1]+Count[2][1]
Aggr[0][2]=Sum[1]
Aggr[1][2]=Aggr[0][2]+Count[0][2]
Aggr[2][2]=Aggr[1][2]+Count[1][2]
Aggr[3][2]=Aggr[2][2]+Count[2][2]
Aggr[0][3]=Sum[2]
Aggr[1][3]=Aggr[0][3]+Count[0][3]
Aggr[2][3]=Aggr[1][3]+Count[1][3]
Aggr[3][3]=Aggr[2][3]+Count[2][3]
を実行することによって、累積度数分布配列が得られる。[0031]
[0087]
When the cumulative frequency distribution is calculated in parallel by four processors, first, the total value Sum [i] of the number of occurrences of each item value number i is, for example,
for (i = 0; i <4: i ++) {
for (j = 0; j <4; j ++) {
Sum [i] = Count [j] [i];
}
}
To calculate in parallel. In this embodiment, for example, CPU-0 is in charge of the i = 0 loop, CPU-1 is in charge of the i = 1 loop, CPU-2 is in charge of the i = 2 loop, and CPU-3 is in charge of the loop. Take charge of the loop of i = 3.
[0088]
Subsequently, for example, four processors are connected in parallel,
Aggr [0] [0] = 0
Aggr [1] [0] = Aggr [0] [0] + Count [0] [0]
Aggr [2] [0] = Aggr [1] [0] + Count [1] [0]
Aggr [3] [0] = Aggr [2] [0] + Count [2] [0]
Aggr [0] [1] = Sum [0]
Aggr [1] “1” = Aggr [0] [1] + Count [0] [1]
Aggr [2] [1] = Aggr [1] [1] + Count [1] [1]
Aggr [3] [1] = Aggr [2] [1] + Count [2] [1]
Aggr [0] [2] = Sum [1]
Aggr [1] [2] = Aggr [0] [2] + Count [0] [2]
Aggr [2] [2] = Aggr [1] [2] + Count [1] [2]
Aggr [3] [2] = Aggr [2] [2] + Count [2] [2]
Aggr [0] [3] = Sum [2]
Aggr [1] [3] = Aggr [0] [3] + Count [0] [3]
Aggr [2] [3] = Aggr [1] [3] + Count [1] [3]
Aggr [3] [3] = Aggr [2] [3] + Count [2] [3]
To obtain a cumulative frequency distribution array.
【0038】
ここでは、特許文献3に記載されているような、カウンティングソートに基づく並列ソートと基数ソートの考え方とを組み合わせることにより実現される多段階並列ソートの実施例を説明する。この多段階並列ソートは、上述の多項目一括ソート処理及び多項目逐次ソート処理の基礎となる技術である。
[0113]
項目値配列VLのサイズが大きいとき、すなわち、項目値番号の個数が多数であるときには、項目値番号を基数で表現し、桁ごとに並列ソートを実施することにより、効率的なソートを実現することが可能である。本例の多段階並列ソートは、最下位の桁から始めて順番に現在の桁に関するソート処理を行い、最後に最上位の桁に関するソート処理を行うことによって最終的なソートを完了する。
[0114]
多段階並列ソート方法の一例では、図24のデータ構造を利用する。本実施の形態では、CPUの台数は4台とし、すべてのCPUが並列に動作する例を考える。システム内のCPUの総数、及び、並列に動作するCPUの台数はこの例に限定されないことに注意すべきである。また、以下では、説明の便宜上、年齢の項目に関して、年齢の昇順にソートする場合を考える。また、年齢の項目値配列の要素は年齢の昇順に並べられている。図4のデータ構造では、年齢に関する項目値番号VNoは0から4までの値を取り得るので、基数=4として項目値番号を分解すると、項目値番号は下の桁と上の桁の2桁に分解される。具体的には、項目値番号のモジュロ(4)の値が下の桁の値であり、項目値番号を4で割った商が上の桁の値である。
[0115]
図25は、本実施例にかかる多段階並列ソート方法のフローチャートである。多段階並列ソート方法は、ステップ2501からステップ2505の5ステップにより構成される。
[0116]
ステップ2501:項目値番号の範囲に応じて項目値番号の基数(本例では基数=4)を選択し、初期のレコード番号配列OrdSetを現在のレコード番号配列に設定し、項目値番号の最下位の桁(本例では項目値番号のモジュロ(4)の値)を現在の桁に設定する。
[0117]
ステップ2502:現在のレコード番号配列を分割して4台のプロセッサに割り当てる。
[0118]
ステップ2503:4台のプロセッサのうちの各プロセッサにおいて、割り当てられたレコード番号配列の部分に含まれるレコードに対応した項目値番号の現在の桁の値の出現回数をカウントする。[0038]
Here, an embodiment of multi-stage parallel sorting realized by combining parallel sorting based on counting sort and the concept of radix sort as described in
[0113]
When the size of the item value array VL is large, that is, when there are a large number of item value numbers, the item value numbers are expressed in radixes, and parallel sorting is performed for each digit to achieve efficient sorting. It is possible. In the multi-stage parallel sort of this example, the sorting process for the current digit is sequentially performed starting from the least significant digit, and the final sorting is completed by finally performing the sorting process for the most significant digit.
[0114]
In an example of the multistage parallel sorting method, the data structure of FIG. 24 is used. In the present embodiment, the number of CPUs is four, and an example in which all CPUs operate in parallel is considered. It should be noted that the total number of CPUs in the system and the number of CPUs operating in parallel are not limited to this example. Further, in the following, for convenience of explanation, consider a case where the items of age are sorted in ascending order of age. The elements of the item value array for age are arranged in ascending order of age. In the data structure of FIG. 4, the item value number VNo relating to age can take a value from 0 to 4. Therefore, when the item value number is decomposed with the radix = 4, the item value number has two digits, the lower digit and the upper digit. Is broken down into Specifically, the modulo (4) value of the item value number is the lower digit value, and the quotient obtained by dividing the item value number by 4 is the upper digit value.
[0115]
FIG. 25 is a flowchart of the multi-stage parallel sorting method according to the present embodiment. The multi-stage parallel sorting method includes five steps from
[0116]
Step 2501: Select the radix of the item value number (in this example, radix = 4) according to the range of the item value number, set the initial record number array OrdSet to the current record number array, and set the lowest item value number (In this example, the modulo (4) value of the item value number) is set to the current digit.
[0117]
Step 2502: The current record number array is divided and assigned to four processors.
[0118]
Step 2503: In each of the four processors, the number of occurrences of the current digit value of the item value number corresponding to the record included in the allocated record number array portion is counted.
Claims (20)
上記共有メモリにアクセス可能である複数台のプロセッサと、
を備えたメモリ共有型マルチプロセッサシステムにおいて、
所定の項目の組に関する一意の項目値の組を抽出する方法であって、
上記複数台のプロセッサを用いて、上記所定の項目の組に関する項目値の組に対応する項目値番号の組の出現回数を並列的に数え上げ、上記出現回数の累積度数分布を表現する累積度数分布配列を上記共有メモリに生成するステップと、
上記複数台のプロセッサを用いて、上記レコード番号配列の要素の値を添字として使って上記項目値番号の組を並列的に読み出し、上記項目値番号の組より計算された値を添字として使って上記累積度数分布配列の要素を並列的に読み出し、上記累積度数分布配列の要素をインデックスポインタとして利用して上記レコード番号配列の要素の値をソートされたレコード番号配列に並列的に格納するステップと、
上記インデックスポインタとして利用された上記累積度数分布配列の要素の値に従って上記ソートされたレコード番号配列を上記一意の項目値の組を有するレコードのレコード番号のグループに区分するステップと、
上記区分されたレコード番号の各グループから1個のレコード番号を抽出することにより、上記一意の項目値の組を特定するステップと、
を備える方法。Record number array in which record numbers of records in tabular data are stored according to a predetermined record order A shared memory that stores a number array and an item value array in which the item values of the tabular data are stored according to the order of the item value numbers corresponding to the item values;
A plurality of processors capable of accessing the shared memory;
In a shared memory multiprocessor system with
A method for extracting a unique set of item values for a given set of items, comprising:
Cumulative frequency distribution that uses the plurality of processors to count in parallel the number of occurrences of a set of item value numbers corresponding to a set of item values relating to the set of predetermined items, and expresses the cumulative frequency distribution of the number of appearances Generating an array in the shared memory;
Using the plurality of processors, reading the item value number pairs in parallel using the element value of the record number array as a subscript, and using the value calculated from the item value number set as a subscript Reading the elements of the cumulative frequency distribution array in parallel, and storing the values of the elements of the record number array in parallel in the sorted record number array using the elements of the cumulative frequency distribution array as an index pointer; ,
Dividing the sorted record number array according to the value of the element of the cumulative frequency distribution array used as the index pointer into a group of record numbers of records having the unique field value pairs;
Identifying the unique set of field values by extracting one record number from each group of the segmented record numbers;
A method comprising:
請求項1記載の方法。The step of generating the cumulative frequency distribution array in parallel in the shared memory is performed by using the plurality of processors, and for each record number stored in the record number array, an item value related to the predetermined item set By setting the radix according to the range of the item value numbers included in the set of item value numbers corresponding to the set of item values, the set of item value numbers is changed to each item value number included in the set of item value numbers. Converting to a virtual field value number in a radix format representing each digit,
The method of claim 1.
上記累積度数分布配列を上記共有メモリに並列的に生成するステップ(i)が、上記複数台のプロセッサを用いて、上記項目に関する項目値に対応する項目値番号の出現回数を並列的に数え上げ、上記出現回数の累積度数分布を表現する累積度数分布配列を上記共有メモリに並列的に生成するステップを備え、
上記レコード番号配列の要素を上記ソートされたレコード番号配列に並列的に格納するステップ(ii)が、上記複数台のプロセッサを用いて、上記項目値番号配列の要素の値を添字として使って上記項目値番号を並列的に読み出し、上記項目値番号を添字として使って上記累積度数分布配列の要素を並列的に読み出し、上記累積度数分布配列の要素をインデックスポインタとして利用して上記レコード番号配列の要素の値を上記ソートされたレコード番号配列に並列的に格納するステップを備える、
請求項1記載の方法。(I) generating the cumulative frequency distribution array in parallel in the shared memory for each item included in the set of predetermined items, and the record number array for each item included in the set of predetermined items. A step (ii) of storing element values in parallel in the sorted record number array, and the sorted record number array for each item included in the predetermined set of items, Performing the step (iii) of classifying records into groups of record numbers of records having
The step (i) of generating the cumulative frequency distribution array in the shared memory in parallel uses the plurality of processors to count in parallel the number of occurrences of the item value number corresponding to the item value related to the item, Generating a cumulative frequency distribution array representing the cumulative frequency distribution of the occurrence counts in parallel in the shared memory,
The step (ii) of storing the elements of the record number array in parallel in the sorted record number array is performed using the plurality of processors and the values of the element of the item value number array as subscripts. Read the item value number in parallel, read the element of the cumulative frequency distribution array in parallel using the item value number as a subscript, and use the element of the cumulative frequency distribution array as an index pointer in the record number array Storing element values in parallel in the sorted record number array;
The method of claim 1.
上記複数台のプロセッサを用いて、上記補助的なレコード番号配列の要素を添字として使って上記別の項目に関する項目値番号配列から並列的に要素を読み出し、前記項目値番号配列の要素を添字として使って上記別の項目に関する項目値配列から並列的に項目値を読み出し、上記補助的なレコード番号配列の要素を添字として使って上記補助的なグループ番号配列の要素を読み出し、上記補助的なグループ番号配列の要素を集計配列の添字として使って上記読み出された項目値の集計結果を上記集計配列に格納するステップと、
をさらに備える、請求項1記載の方法。Using the plurality of processors, the record number in the sorted record number array and the group number of the group corresponding to the record number are used as an auxiliary record number array and auxiliary number using the record number as a subscript. Storing in parallel group number arrays;
Using the plurality of processors, the elements of the auxiliary record number array are used as subscripts to read out elements in parallel from the item value number array relating to the other item, and the elements of the item value number array are used as subscripts. To read the item value in parallel from the item value array for the other item, to read the element of the auxiliary group number array using the element of the auxiliary record number array as a subscript, and to Storing the aggregation result of the read item values in the aggregation array using the elements of the number array as a subscript of the aggregation array;
The method of claim 1, further comprising:
上記共有メモリにアクセス可能である複数台のプロセッサと、
を備えたメモリ共有型マルチプロセッサシステムにおいて、
所定の項目の組に関する一意の項目値の組を抽出する装置であって、
上記複数台のプロセッサを用いて、上記所定の項目の組に関する項目値の組に対応する項目値番号の組の出現回数を並列的に数え上げ、上記出現回数の累積度数分布を表現する累積度数分布配列を上記共有メモリに生成する手段と、
上記複数台のプロセッサを用いて、上記レコード番号配列の要素の値を添字として使って上記項目値番号の組を並列的に読み出し、上記項目値番号の組より計算された値を添字として使って上記累積度数分布配列の要素を並列的に読み出し、上記累積度数分布配列の要素をインデックスポインタとして利用して上記レコード番号配列の要素の値をソートされたレコード番号配列に並列的に格納する手段と、
上記インデックスポインタとして利用された上記累積度数分布配列の要素の値に従って上記ソートされたレコード番号配列を上記一意の項目値の組を有するレコードのレコード番号のグループに区分する手段と、
上記区分されたレコード番号の各グループから1個のレコード番号を抽出することにより、上記一意の項目値の組を特定する手段と、
を備える装置。Record number array in which record numbers of records in tabular data are stored according to a predetermined record order A shared memory that stores a number array and an item value array in which the item values of the tabular data are stored according to the order of the item value numbers corresponding to the item values;
A plurality of processors capable of accessing the shared memory;
In a shared memory multiprocessor system with
A device that extracts a unique set of item values for a given set of items,
Cumulative frequency distribution that uses the plurality of processors to count in parallel the number of occurrences of the set of item value numbers corresponding to the set of item values related to the set of predetermined items, and express the cumulative frequency distribution of the number of appearances Means for generating an array in the shared memory;
Using the plurality of processors, the item value number pairs are read in parallel using the element value of the record number array as a subscript, and the value calculated from the item value number set is used as a subscript. Means for reading the elements of the cumulative frequency distribution array in parallel, and storing the values of the elements of the record number array in parallel in the sorted record number array using the elements of the cumulative frequency distribution array as an index pointer; ,
Means for dividing the record number array sorted according to the element value of the cumulative frequency distribution array used as the index pointer into a group of record numbers of records having the unique item value pairs;
Means for identifying the set of unique item values by extracting one record number from each group of the record numbers that are classified;
A device comprising:
請求項7記載の装置。The means for generating the cumulative frequency distribution array in parallel in the shared memory, using the plurality of processors, for each record number stored in the record number array, an item value relating to the predetermined set of items By setting the radix according to the range of the item value numbers included in the set of item value numbers corresponding to the set of item values, each item value number included in the set of item value numbers Comprises means for converting to a virtual item value number in a radix format representing each digit,
The apparatus of claim 7.
上記レコード番号配列の要素を上記ソートされたレコード番号配列に並列的に格納する手段が、上記所定の項目の組に含まれる項目毎に、上記複数台のプロセッサを用いて、上記項目値番号配列の要素の値を添字として使って上記項目値番号を並列的に読み出し、上記項目値番号を添字として使って上記累積度数分布配列の要素を並列的に読み出し、上記累積度数分布配列の要素をインデックスポインタとして利用して上記レコード番号配列の要素の値を上記ソートされたレコード番号配列に並列的に格納する手段を備える、
請求項7記載の装置。The means for generating the cumulative frequency distribution array in parallel in the shared memory uses the plurality of processors for each item included in the predetermined item set, and the item value corresponding to the item value related to the item Means for counting up the number of appearances of the number in parallel, and generating a cumulative frequency distribution array expressing the cumulative frequency distribution of the number of appearances in the shared memory in parallel;
The means for storing the elements of the record number array in parallel in the sorted record number array uses the plurality of processors for each item included in the set of the predetermined items, and the item value number array The item value number is read in parallel using the value of the element in the subscript, the element of the cumulative frequency distribution array is read in parallel using the item value number as the subscript, and the element of the cumulative frequency distribution array is indexed Means for storing the values of the elements of the record number array in parallel in the sorted record number array by using as pointers;
The apparatus of claim 7.
上記複数台のプロセッサを用いて、上記補助的なレコード番号配列の要素を添字として使って上記別の項目に関する項目値番号配列から並列的に要素を読み出し、前記項目値番号配列の要素を添字として使って上記別の項目に関する項目値配列から並列的に項目値を読み出し、上記補助的なレコード番号配列の要素を添字として使って上記補助的なグループ番号配列の要素を読み出し、上記補助的なグループ番号配列の要素を集計配列の添字として使って上記読み出された項目値の集計結果を上記集計配列に格納する手段と、
をさらに備える、請求項7記載の装置。Using the plurality of processors, the record number in the sorted record number array and the group number of the group corresponding to the record number are used as an auxiliary record number array and auxiliary number using the record number as a subscript. Means for storing in parallel group number arrays;
Using the plurality of processors, the elements of the auxiliary record number array are used as subscripts to read out elements in parallel from the item value number array relating to the other item, and the elements of the item value number array are used as subscripts. To read the item value in parallel from the item value array for the other item, to read the element of the auxiliary group number array using the element of the auxiliary record number array as a subscript, and to Means for storing the aggregation result of the read item value in the aggregation array using an element of the number array as a subscript of the aggregation array;
The apparatus of claim 7, further comprising:
上記共有メモリにアクセス可能である複数台のプロセッサと、
を備えたコンピュータにロードされ、所定の項目の組に関する一意の項目値の組を抽出するコードを上記コンピュータに実行させるコンピュータ読み取り可能なプログラムであって、
上記複数台のプロセッサを用いて、上記所定の項目の組に関する項目値の組に対応する項目値番号の組の出現回数を並列的に数え上げ、上記出現回数の累積度数分布を表現する累積度数分布配列を上記共有メモリに生成するコードと、
上記複数台のプロセッサを用いて、上記レコード番号配列の要素の値を添字として使って上記項目値番号の組を並列的に読み出し、上記項目値番号の組より計算された値を添字として使って上記累積度数分布配列の要素を並列的に読み出し、上記累積度数分布配列の要素をインデックスポインタとして利用して上記レコード番号配列の要素の値をソートされたレコード番号配列に並列的に格納するコードと、
上記インデックスポインタとして利用された上記累積度数分布配列の要素の値に従って上記ソートされたレコード番号配列を上記一意の項目値の組を有するレコードのレコード番号のグループに区分するコードと、
上記区分されたレコード番号の各グループから1個のレコード番号を抽出することにより、上記一意の項目値の組を特定するコードと、
を含むプログラム。Record number array in which record numbers of records in tabular data are stored according to a predetermined record order A shared memory that stores a number array and an item value array in which the item values of the tabular data are stored according to the order of the item value numbers corresponding to the item values;
A plurality of processors capable of accessing the shared memory;
A computer-readable program that causes a computer to execute code for extracting a unique set of item values for a predetermined set of items, loaded on a computer comprising:
Cumulative frequency distribution that uses the plurality of processors to count in parallel the number of occurrences of the set of item value numbers corresponding to the set of item values related to the set of predetermined items, and express the cumulative frequency distribution of the number of appearances Code for generating an array in the shared memory;
Using the plurality of processors, the item value number pairs are read in parallel using the element value of the record number array as a subscript, and the value calculated from the item value number set is used as a subscript. A code for reading the elements of the cumulative frequency distribution array in parallel, and storing the values of the elements of the record number array in parallel in the sorted record number array using the elements of the cumulative frequency distribution array as an index pointer; ,
A code for classifying the sorted record number array according to the value of the element of the cumulative frequency distribution array used as the index pointer into a group of record numbers of records having the unique set of field values;
A code that identifies the unique set of field values by extracting one record number from each group of the record numbers that are segmented;
Including programs.
請求項13記載のプログラム。The code for generating the cumulative frequency distribution array in parallel in the shared memory is an item value related to the predetermined set of items for each record number stored in the record number array using the plurality of processors. By setting the radix according to the range of the item value numbers included in the set of item value numbers corresponding to the set of item values, the set of item value numbers is changed to each item value number included in the set of item value numbers. Comprises a code that converts to a virtual field value number in radix format representing each digit,
The program according to claim 13.
上記累積度数分布配列を上記共有メモリに並列的に生成するコード(i)が、上記複数台のプロセッサを用いて、上記項目に関する項目値に対応する項目値番号の出現回数を並列的に数え上げ、上記出現回数の累積度数分布を表現する累積度数分布配列を上記共有メモリに並列的に生成するコードを備え、
上記レコード番号配列の要素を上記ソートされたレコード番号配列に並列的に格納するコード(ii)が、上記複数台のプロセッサを用いて、上記項目値番号配列の要素の値を添字として使って上記項目値番号を並列的に読み出し、上記項目値番号を添字として使って上記累積度数分布配列の要素を並列的に読み出し、上記累積度数分布配列の要素をインデックスポインタとして利用して上記レコード番号配列の要素の値を上記ソートされたレコード番号配列に並列的に格納するコードを備える、
請求項13記載のプログラム。Code (i) for generating the cumulative frequency distribution array in parallel in the shared memory for each item included in the predetermined item set, and the record number array for each item included in the predetermined item set A code (ii) for storing element values in parallel in the sorted record number array, and the sorted record number array for each item included in the predetermined set of items A code (iii) for executing a code for dividing the record into groups of record numbers of records having
The code (i) for generating the cumulative frequency distribution array in parallel in the shared memory counts in parallel the number of occurrences of the item value number corresponding to the item value related to the item using the plurality of processors, A code for generating a cumulative frequency distribution array expressing the cumulative frequency distribution of the appearance frequency in the shared memory in parallel;
A code (ii) for storing the elements of the record number array in parallel in the sorted record number array, using the plurality of processors, the value of the element of the item value number array as a subscript Read the item value number in parallel, read the element of the cumulative frequency distribution array in parallel using the item value number as a subscript, and use the element of the cumulative frequency distribution array as an index pointer in the record number array Comprising code for storing element values in parallel in the sorted record number array;
The program according to claim 13.
上記複数台のプロセッサを用いて、上記補助的なレコード番号配列の要素を添字として使って上記別の項目に関する項目値番号配列から並列的に要素を読み出し、前記項目値番号配列の要素を添字として使って上記別の項目に関する項目値配列から並列的に項目値を読み出し、上記補助的なレコード番号配列の要素を添字として使って上記補助的なグループ番号配列の要素を読み出し、上記補助的なグループ番号配列の要素を集計配列の添字として使って上記読み出された項目値の集計結果を上記集計配列に格納するコードと、
をさらに備える、請求項13記載のプログラム。Using the plurality of processors, the record number in the sorted record number array and the group number of the group corresponding to the record number are used as an auxiliary record number array and auxiliary number using the record number as a subscript. Code to store in parallel group number array,
Using the plurality of processors, the elements of the auxiliary record number array are used as subscripts to read the elements in parallel from the item value number array related to the other item, and the elements of the item value number array are used as subscripts. To read the item value in parallel from the item value array relating to the other item, to read the element of the auxiliary group number array using the element of the auxiliary record number array as a subscript, and to A code for storing the aggregation result of the read item value in the aggregation array using an element of the number array as a subscript of the aggregation array;
The program according to claim 13, further comprising:
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/JP2007/062481 WO2008155852A1 (en) | 2007-06-21 | 2007-06-21 | Method and device for tallying tabular form data in memory shared parallel processing system |
Publications (2)
Publication Number | Publication Date |
---|---|
JPWO2008155852A1 true JPWO2008155852A1 (en) | 2010-08-26 |
JP4881435B2 JP4881435B2 (en) | 2012-02-22 |
Family
ID=40156018
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2009520206A Expired - Fee Related JP4881435B2 (en) | 2007-06-21 | 2007-06-21 | Method and apparatus for aggregating tabular data in a shared memory parallel processing system |
Country Status (2)
Country | Link |
---|---|
JP (1) | JP4881435B2 (en) |
WO (1) | WO2008155852A1 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5598279B2 (en) * | 2010-11-16 | 2014-10-01 | 日本電気株式会社 | Distributed memory database system, front database server, data processing method and program |
JP2015207026A (en) * | 2012-08-29 | 2015-11-19 | 株式会社ターボデータラボラトリー | Information processor, record position information specification method and information processing program |
CN113407484A (en) * | 2021-06-16 | 2021-09-17 | 杭州加速科技有限公司 | Array sorting method and system based on FPGA and data compression method |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7849289B2 (en) * | 2003-10-27 | 2010-12-07 | Turbo Data Laboratories, Inc. | Distributed memory type information processing system |
US7801903B2 (en) * | 2005-05-24 | 2010-09-21 | Turbo Data Laboratories, Inc. | Shared-memory multiprocessor system and method for processing information |
JP2007034878A (en) * | 2005-07-29 | 2007-02-08 | Turbo Data Laboratory:Kk | Information processing method, information processor, and information processing program |
WO2007020849A1 (en) * | 2005-08-15 | 2007-02-22 | Turbo Data Laboratories Inc. | Shared memory type multiprocessor system and information processing method thereof |
-
2007
- 2007-06-21 WO PCT/JP2007/062481 patent/WO2008155852A1/en active Application Filing
- 2007-06-21 JP JP2009520206A patent/JP4881435B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
WO2008155852A1 (en) | 2008-12-24 |
JP4881435B2 (en) | 2012-02-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4339381B2 (en) | Shared memory multiprocessor system and information processing method thereof | |
JP2017517082A (en) | Parallel decision tree processor architecture | |
Baker et al. | An architecture for efficient hardware data mining using reconfigurable computing systems | |
Komarov et al. | Fast k-NNG construction with GPU-based quick multi-select | |
US20200090051A1 (en) | Optimization problem operation method and apparatus | |
Beliakov et al. | Improving the speed and stability of the k-nearest neighbors method | |
US8996436B1 (en) | Decision tree classification for big data | |
JP4758429B2 (en) | Shared memory multiprocessor system and information processing method thereof | |
CN110795469B (en) | Spark-based high-dimensional sequence data similarity query method and system | |
CN106599122B (en) | Parallel frequent closed sequence mining method based on vertical decomposition | |
JP4881435B2 (en) | Method and apparatus for aggregating tabular data in a shared memory parallel processing system | |
EP4276623A1 (en) | Sorting device and method | |
JP4511469B2 (en) | Information processing method and information processing system | |
Demirci et al. | Cartesian partitioning models for 2d and 3d parallel spgemm algorithms | |
Chen et al. | BALS: Blocked alternating least squares for parallel sparse matrix factorization on GPUs | |
US20180068005A1 (en) | Distributed computation of percentile statistics for multidimensional data sets | |
Salah et al. | Lazy-Merge: A Novel Implementation for Indexed Parallel $ K $-Way In-Place Merging | |
JPWO2009044486A1 (en) | Method for sorting tabular data, multi-core type apparatus, and program | |
Lee et al. | Row-Wise Product-Based Sparse Matrix Multiplication Hardware Accelerator With Optimal Load Balancing | |
WO2010013320A1 (en) | Method for operating tabular form data, distributed memory multiprocessor, and program | |
Pantaleoni | A massively parallel algorithm for constructing the BWT of large string sets | |
JP4772506B2 (en) | Information processing method, information processing system, and program | |
JP6336302B2 (en) | Information processing apparatus, information processing method, and program | |
CN108280461B (en) | Rapid global K-means clustering method accelerated by OpenCL | |
Bandyopadhyay et al. | Sorting large multifield records on a GPU |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20100614 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20100614 |
|
RD02 | Notification of acceptance of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7422 Effective date: 20110815 |
|
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: 20111129 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20111202 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 4881435 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20141209 Year of fee payment: 3 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
LAPS | Cancellation because of no payment of annual fees | ||
R371 | Transfer withdrawn |
Free format text: JAPANESE INTERMEDIATE CODE: R371 |