WO2010013320A1 - 表形式データを操作する方法、分散メモリ型マルチプロセッサ、及び、プログラム - Google Patents
表形式データを操作する方法、分散メモリ型マルチプロセッサ、及び、プログラム Download PDFInfo
- Publication number
- WO2010013320A1 WO2010013320A1 PCT/JP2008/063660 JP2008063660W WO2010013320A1 WO 2010013320 A1 WO2010013320 A1 WO 2010013320A1 JP 2008063660 W JP2008063660 W JP 2008063660W WO 2010013320 A1 WO2010013320 A1 WO 2010013320A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- array
- local
- item
- record
- data
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F15/00—Digital computers in general; Data processing equipment in general
- G06F15/16—Combinations of two or more digital computers each having at least an arithmetic unit, a program unit and a register, e.g. for a simultaneous processing of several programs
Definitions
- the disclosure of the present application is a method for sharing and manipulating tabular data represented as an array of records including item values corresponding to data items by a plurality of arithmetic units, in particular, tabular data is constructed and tabular data is constructed.
- This method is related to a method of sorting specific data from tabular data or tabulating tabular data.
- the disclosure of the present application is a distributed memory multiprocessor that operates by sharing tabular data represented as an array of records including item values corresponding to data items by a plurality of arithmetic units, in particular, tabular data. It also relates to a distributed memory multiprocessor that sorts tabular data, retrieves specific data from tabular data, or tabulates tabular data.
- the disclosure of the present application relates to a program for causing a distributed memory multiprocessor to execute the above method, a computer program product, and a recording medium on which the computer program is recorded.
- the present inventor has proposed a basic data processing algorithm for processing large-scale data at high speed, for example, an “on-memory data processing algorithm” as described in Patent Document 1.
- This technique is based on the idea that the tabular data is decomposed into items (ie, columns) instead of records (ie, rows) as in the prior art.
- the tabular data includes (1) an array representing the record order, (2) a value table in which unique item values belonging to the items are arranged in a predetermined order (for example, ascending order), and (3 )
- the item value corresponding to each record is represented by a data structure including an array representing position information stored in the value table.
- Patent Literature 2 describes a search / sort algorithm corresponding to a distributed memory type multiprocessor system
- Patent Literature 3 describes an aggregation algorithm
- Patent Document 4 describes an efficient sorting algorithm corresponding to a shared memory type multiprocessor system.
- Patent Documents 2 and 3 are specifically designed to be compatible with a massively parallel processor (MPP) architecture.
- MPP massively parallel processor
- a comparison operation may be performed with data stored in the module. Since the cost of the comparison operation is an order of the square of the number of processor modules, there is a relationship that the cost of the comparison operation increases as the degree of parallelization increases.
- the sort for the shared memory type multiprocessor system described in Patent Document 4 is specifically designed to be compatible with a symmetric multiprocessor (SMP) architecture.
- SMP symmetric multiprocessor
- Non-Patent Document 1 computer systems that employ a non-uniform memory access (NUMA) architecture as described in Non-Patent Document 1 are commercially available.
- NUMA type computer system is a distributed memory type multiprocessor system in that remote memory access is possible but no shared memory is provided.
- the techniques described in Patent Documents 2 and 3 can be directly applied to this NUMA type computer system if remote memory access is not used.
- the operation amount of each operation unit, the amount of data held in each operation unit, and the operation unit It is preferable that a method for processing data can be provided so that the amount of data communication between them can be reduced as much as possible.
- the calculation amount of each calculation unit, the amount of data held in each calculation unit, and the calculation unit It is preferable that a program for processing data, a computer program product, and a recording medium on which the computer program is recorded can be provided so that the amount of data communication can be reduced as much as possible.
- a plurality of arithmetic units including a dedicated local memory and a processor and connected to communicate with each other to transmit and receive data are provided, and a series of data is transmitted to the plurality of arithmetic units.
- a distributed memory that is divided into a plurality of associated blocks and is held in a dedicated local memory of each of the plurality of arithmetic units, and the series of data is manipulated by pipeline processing of the plurality of arithmetic units.
- Each arithmetic unit receives local data from one or more arithmetic units in the previous pipeline stage, converts the received at least two local data into one further local data, and converts the further local data into Including merging means for transmitting to one arithmetic unit in a later pipeline stage;
- the merging means of the plurality of arithmetic units can be dynamically connected in a tournament manner so that finally one global data is generated,
- At least one of the arithmetic units includes a distribution unit that divides the global data and allocates the global data to the plurality of arithmetic units based on block numbers corresponding to the plurality of blocks.
- a distributed memory multiprocessor is provided.
- the distributed memory type multiprocessor includes a dedicated local memory, and includes a plurality of arithmetic units connected to communicate with each other to transmit and receive data, and the plurality of arithmetic units are configured to realize pipeline processing. It is a device. An arithmetic unit is sometimes called a node.
- the processor in the arithmetic unit may be a single core processor or a multi-core processor including two or more processor cores.
- each block obtained from a series of data is associated with each arithmetic unit, that is, with a single core processor in the arithmetic unit.
- the local memory in the arithmetic unit is used as a shared memory between two or more processor cores.
- each block obtained from a series of data is preferably associated with each processor core in the arithmetic unit. Therefore, a plurality of blocks are associated with one arithmetic unit.
- the processor included in the arithmetic unit may be either a single core processor or a multicore processor.
- a series of data is divided into a plurality of blocks, and block numbers are assigned to the blocks.
- This block number is copied when certain data is merged by pipeline processing of a plurality of arithmetic units, and is associated with the merged data. Therefore, by referring to the block number corresponding to this data, it is possible to distribute the merged data to the arithmetic units associated with the original block.
- By associating block numbers with data in this way it is not necessary for each arithmetic processor to receive data from all other arithmetic processors. Therefore, even if the degree of parallelization increases, operations such as comparison operations can be performed.
- the merging means of each arithmetic unit is connected to the merging means of one or more arithmetic units on the input side, and is connected to the merging means of one arithmetic unit on the output side, and is input from at least one arithmetic unit.
- Two local data are merged into one local data and output to one arithmetic unit. Thereby, one local data is finally produced
- the merging means of each arithmetic unit may be configured to merge three or more local data from one or more arithmetic units into one local data. Further, in order to reduce the amount of data communication between the arithmetic units, one of the two arithmetic units on the input side and the arithmetic unit including the merging means for merging local data from the input side are the same arithmetic unit. It does not matter.
- the processor of the arithmetic unit is a multi-core processor
- the first layer merge processing in the tournament table may be performed between processor cores in the same arithmetic unit.
- the first-layer merge processing may be executed using local data from different arithmetic units.
- the series of data is tabular data expressed as an array of records including item values corresponding to data items.
- the record assigned to each arithmetic unit that is, the record in charge is separated into order information that depends on the order of the records and item information that depends on each data item. Has been. If tabular data is separated into order information and item information, when search or sort is applied to the tabular data, only the order information is affected, and the item information maintains the state before the search or sort is applied. Thereby, the calculation cost and the data communication cost are greatly reduced.
- the order information includes a record number for identifying the assigned record in the tabular data, that is, a record order of the assigned record in the block as a source record position number.
- the record order number array is stored in the order of the numbers
- the item value access information array is stored in the order of the record order numbers.
- the item value access information is used to access the item values included in the assigned record.
- the record sequence number array and the item value access information array are integer type arrays and have the same size. Each element of the record sequence number array represents the position of the record corresponding to this element in the entire tabular data, that is, the original record position number.
- Each element of the item value access information array is used as an index indicating a specific array in the item information, that is, a local item value number array to be described later, in order to combine the order information and the item information.
- the item information includes a local item value array in which unique item values included in the assigned record are stored in a predetermined order, and the item value included in the assigned record is stored in the local item value array.
- Local field value number array in which the local field value number specifying the position is stored in the order of the original record position number of the record in charge, and the entire tabular data based on the predetermined order
- the global item value sequence number array stores the sequence numbers assigned to the unique item values in the local item value array.
- the local field value number array has the same size as the number of records in the assigned record, and the elements in the local field value number array specify the field values included in a certain record in the assigned record.
- the local field value array is an array in which unique field values included in all records of the assigned record are arranged in a predetermined order (for example, ascending order or descending order). Since the local item value array is an array for storing the item value itself, it can take various data types such as an integer type, a floating point type, and a character string type.
- the global item value sequence number array stores the rank of each item value stored in the local item value array among the item values held in the entire tabular data in the local item value array. It is an array that stores in order of item value. The rank of each item value is determined based on a predetermined order such as ascending order or descending order.
- a distributed memory multiprocessor that constructs tabular data on a memory by combining the above-described concept of component decomposition, the concept of block numbers, and the concept of pipeline processing. Is done.
- the process of building tabular data on the memory of the distributed memory multiprocessor includes (i) an order set creation process for creating a record sequence number array and an item value access information array; The local item value number array and the intra-block compilation process for creating the local item value array, and (iii) the inter-block compilation process for creating the global item value sequence number array between the blocks.
- the record (a plurality or a plurality of) of the tabular data is divided into blocks identified by the block number.
- this block is initially associated with an arithmetic unit that is responsible for processing the records included in this block.
- the record that each arithmetic unit is responsible for is referred to as the charge record in this document.
- the assigned record defined as described above is transmitted from each external device to each arithmetic unit.
- the external device may be an external storage device, or may be an external arithmetic unit or an external computer.
- Each arithmetic unit generates a record sequence number array in which the record sequence number of the record in charge (initially matches the original record position number) is stored in order of the record sequence number in order to recognize the record in charge.
- the original record position number corresponds to a position where each record is accommodated in the original tabular data, for example, a line number.
- each arithmetic unit generates an item value access information array in which item value access information is stored in the order of record order numbers in order to access the item values included in the assigned record.
- the item values included in the record in charge of each arithmetic unit are stored in the local item value array for each arithmetic unit so that each arithmetic unit can access each data item using the item value access information array.
- the In the local item value array unique item values are stored in a predetermined order (ascending order or descending order) for each data item. Since each arithmetic unit uses the field value access information array to access the field value included in the assigned record, the local field value number that identifies the field value included in the assigned record is the source record position number for each data item. A local item value number array stored in the order is generated.
- the global field value included in the entire tabular data is A global item value sequence number array that specifies the position of the local item value in the virtual global item value array stored in a predetermined order is generated.
- the generated various arrays are stored in a dedicated local memory of the arithmetic unit.
- Each arithmetic unit is Means for receiving the assigned record assigned to the arithmetic unit from an external device connected to the distributed memory multiprocessor; Means for generating the record sequence number array and the item value access information array from the received record in charge and storing them in the dedicated local memory of the arithmetic unit; By sorting the item values in the assigned record for each item in the predetermined order, the local item value array and the local item value number array are generated and stored in the dedicated local memory of the arithmetic unit.
- Local compilation means to store; For each item, the local item value array, a local item in which the sequence number assigned to the unique item value included in the local item value array is stored based on the predetermined order within the range of the record in charge Pipeline after this arithmetic unit using the value sequence number array and the block number array including the block number indicating the assigned record related to the sequence number in the local item value sequence number array as the local data Means for transmitting to the computing unit in the stage; Including The merging means of each arithmetic unit merges the item values in the at least two local item value arrays included in the at least two local data from the previous pipeline stage in the predetermined order so that the at least Means for converting two local data into one local data formed by a further block number array, a further local item value sequence number array and a further local item value array; The distribution means associates a sequence number stored in the finally generated further local item value sequence number array with a block number stored in the corresponding finally generated further block number array. Including means for transmitting to the a
- the above-described concept of component decomposition, the concept of block numbers, and the concept of pipeline processing are combined, and tabular data is stored using item values included in predetermined items as keys.
- a distributed memory multiprocessor for sorting is provided.
- the sort processing of tabular data is a process of creating a sorted record sequence number array and a sorted item value access information array.
- a block that executes counting sort in the block creates a new item value access information array, and creates a global item value sequence number array and a record sequence number array used in later processing.
- An internal sort process (ii) an inter-block merge process in which the global item value sequence number array and the record sequence number array created in the previous process are merged together with the block number array by a tournament method, and (iii) merged blocks And an inter-block distribution process for creating a new record sequence number array from the number array.
- Each arithmetic unit is With respect to a predetermined item, for each block including the record in charge, sorting is applied to the record order number array, the item value access information array, and the global item value order number array, using the local item value number as a key.
- Local sort means for generating a locally sorted record sequence number array, a locally sorted field value access information array and a locally sorted global field value sequence number array; For the given item, the locally sorted global field value sequence number array, the locally sorted record sequence number array, and the block number indicating the responsible record associated with the locally sorted record sequence number array Means for transmitting the block number array including Including A combination of the locally sorted global item value sequence number array and the locally sorted record sequence number array included in at least two local data from the previous pipeline stage Means for converting the at least two local data into one local data formed by a further global item value sequence number array, a further record sequence number array, and a further block number array by merging in a predetermined order , A means for transmitting the sequence number in the further block number array of the block number included in the further generated block number array to the arithmetic unit associated with the block number; Including Each arithmetic unit further includes means for sequentially storing the transmitted sequence numbers in the record sequence number array.
- a distributed memory that searches a record satisfying a predetermined search condition from tabular data by combining the concept of component decomposition, the concept of a block number, and the concept of pipeline processing.
- a type multiprocessor is provided.
- the tabular data search process is a process of creating order information, that is, a new record order number array and a new item value access information array from the tabular data before the search.
- this search processing (i) it is determined whether the item value stored in the local item value array in the block matches the search condition, and the record order number and the item value corresponding to the item value matching the search condition Local processing for extracting access information; and (ii) a record sequence number array extracted in each block is merged together with a block number array in a predetermined order, and a final new record sequence number array is obtained according to the merged block number array
- Each arithmetic unit is For a predetermined item, for each block including the record in charge, a new record sequence number array and a new item value access information array corresponding to the record including the item value matching the search condition are generated, and the item value access information Local search means for replacing the array with the new item value access information array, and With respect to the predetermined item, a block number array including the new record sequence number array and the block number indicating the record in charge associated with the new record sequence number array is used as the local data.
- Means for transmitting to a computation unit in a later pipeline stage Including The merging means of each arithmetic unit merges a set of the new record order number array and the block number array included in at least two local data from the previous pipeline stage in a predetermined order.
- Each arithmetic unit further includes means for sequentially storing the transmitted sequence numbers in the new record sequence number array.
- a distributed memory type multiprocessor that tabulates tabular data by combining the concept of component decomposition, the concept of block numbers, and the concept of pipeline processing.
- tabular data as a tabulation result is newly generated from the tabular data of the tabulation source.
- the tabular data of the tabulation result is tabular data including items related to the tabulation dimension and items related to tabulation targets (items before tabulation, items in the middle of tabulation calculation, items of tabulation results, etc.).
- a process of calculating the size of tabular data of the tabulation result from the tabular data of the tabulation source, and (ii) tabular format of the tabulation result (Iii) a process of dividing data into blocks and assigning it to a plurality of arithmetic units; (iii) specifying a set of item values of items relating to the dimension of aggregation (one or more) and assigning to each arithmetic unit; iv) It is comprised by the process which specifies the item value of the item regarding a total object, and assigns it to several arithmetic units.
- the plurality of arithmetic units include a first charge record relating to the first tabular data used as the tabular data of the summation source, and item values relating to a predetermined set of items of the first tabular data. It is configured so that the second assigned record relating to the second tabular data representing the result of aggregation obtained by aggregating item values relating to at least one other aggregation item for each group is stored in each dedicated local memory. Has been.
- Each arithmetic unit is From the external device connected to the distributed memory type multiprocessor, the range information of the second assigned record divided into the calculation unit in the second tabular data, and the set of the predetermined items Means for receiving a set of the number of unique field values to which it belongs; Based on the range information of the second assigned record, a record sequence number array and an item value access information array of the second assigned record assigned to the operation unit are generated, and the dedicated local memory of the operation unit is generated.
- the merging means of each arithmetic unit generates a further local item value array by merging the local item value arrays included in the at least two local data from the previous pipeline stage in a predetermined order.
- Generating a further block number array and a further global item value sequence number array by merging the block number array and the global item value sequence number array contained in the at least two local data from the pipeline stage in a predetermined order; This includes means for converting the at least two local data into one local data formed by the further local item value array, the further block number array and the further global item value sequence number array.
- the distribution means corresponds to the item value stored in the finally generated further local item value array specified by the sequence number stored in the finally generated further global item value sequence number array.
- Each arithmetic unit further includes means for sequentially storing the transmitted item value in the local item value array of the second assigned record of the arithmetic unit.
- Each arithmetic unit includes a dimension value number array that includes a dimension value number that identifies a set of item values related to the predetermined set of items included in the first assigned record, and the at least one corresponding to the dimension value number. And a means for generating a local aggregate value array including the aggregate values of the item values related to the aggregate items, and transmitting the local aggregate value array to the arithmetic unit in the pipeline stage after the arithmetic unit as the local data.
- the merging means of each arithmetic unit is configured to merge the dimension value number array and the local aggregate value array included in at least two local data from the previous pipeline stage in a predetermined order, so that the at least two local data Means for converting the data into one local data formed by a further dimension value number array and a further local aggregate value array.
- the distribution means further includes means for transmitting the total value stored in the finally generated further local total value array to the arithmetic unit according to the range information of the second assigned record.
- Each arithmetic unit is By sorting the transmitted item values in a predetermined order for each of the at least one total item, a local item value array and a local item value number array relating to the total item are generated, and the dedicated local of this arithmetic unit is generated.
- Local compilation means to store in memory; For each of the at least one total item, an order number assigned to a unique item value included in the local item value array based on a predetermined order within the range of the local item value array and the second charge record This calculation is performed using the stored local item value sequence number array and the block number array including the block number indicating the assigned record related to the sequence number in the local item value sequence number array as the local data.
- the merging means of each arithmetic unit merges the item values in the at least two local item value arrays included in the at least two local data from the previous pipeline stage in the predetermined order, thereby Further comprising means for converting the two local data into one local data formed by the further block number array, the further local item value sequence number array and the further local item value array.
- the distribution means associates a sequence number stored in the finally generated further local item value sequence number array with a block number stored in the corresponding finally generated further block number array. Further comprising means for transmitting to the computing unit.
- Each arithmetic unit further includes means for sequentially storing the transmitted sequence number in a global item value sequence number array relating to the at least one total item provided in the dedicated local memory of the arithmetic unit.
- a plurality of arithmetic units including a dedicated local memory and a processor and connected to communicate with each other to transmit and receive data are provided.
- a series of data is divided into a plurality of blocks associated with the plurality of arithmetic units and held in a dedicated local memory of each of the plurality of arithmetic units, and the series of data is stored in the plurality of arithmetic units.
- Each computing unit receives respective local data from one or more computing units in the previous pipeline stage, converts at least two received local data into one further local data, and converts the further local data into A dynamic operation in a tournament manner to transmit to one computing unit in a later pipeline stage and finally generate one global data; At least one of the arithmetic units divides the global data and assigns the global data to the plurality of arithmetic units based on block numbers corresponding to the plurality of blocks; A tabular data manipulation method is provided.
- a computer comprising a plurality of arithmetic units including a dedicated local memory and a processor and connected to communicate with each other to send and receive data;
- a series of data is divided into a plurality of blocks associated with the plurality of arithmetic units and held in a dedicated local memory of each of the plurality of arithmetic units, and the series of data is stored in the plurality of arithmetic units.
- a computer-readable program for causing the computer to execute code operated by the pipeline processing of Each computing unit receives respective local data from one or more computing units in the previous pipeline stage, converts at least two received local data into one further local data, and converts the further local data into A code to be sent to one arithmetic unit in a later pipeline stage;
- a code that at least one of the arithmetic units divides the global data and assigns the global data to the plurality of arithmetic units based on block numbers corresponding to the plurality of blocks;
- a program is provided.
- a computer comprising a plurality of arithmetic units including a dedicated local memory and a processor and connected to communicate with each other to send and receive data;
- a series of data is divided into a plurality of blocks associated with the plurality of arithmetic units and held in a dedicated local memory of each of the plurality of arithmetic units, and the series of data is stored in the plurality of arithmetic units.
- a computer comprising a plurality of arithmetic units including a dedicated local memory and a processor and connected to communicate with each other to send and receive data;
- a series of data is divided into a plurality of blocks associated with the plurality of arithmetic units and held in a dedicated local memory of each of the plurality of arithmetic units, and the series of data is stored in the plurality of arithmetic units.
- a storage medium on which a computer program for causing the computer to execute the tabular data manipulation method operated by the pipeline processing is recorded.
- the calculation amount of each arithmetic unit of the distributed memory type multiprocessor, the data amount held in each arithmetic unit, and the data communication amount between the arithmetic units are reduced as much as possible. Therefore, it is possible to realize a distributed memory type multiprocessor capable of efficiently operating large-scale data.
- FIG. 1 is a schematic diagram of a distributed memory processor according to an embodiment of the present invention.
- FIG. 1 is a schematic diagram of a computer system according to an embodiment of the present invention. It is a figure showing an example of the tabular data for demonstrating the data management mechanism used as the foundation of one Embodiment of this invention. It is explanatory drawing of the basic data management mechanism used as the foundation of one Embodiment of this invention. It is explanatory drawing of the data structure for distributed memory type
- FIG. 5 is a schematic flowchart of a tabular data sorting method according to an embodiment of the present invention. It is explanatory drawing of the sort process in a block in the sort process of the tabular data by one Embodiment of this invention. It is explanatory drawing of the sort process in a block in the sort process of the tabular data by one Embodiment of this invention. It is explanatory drawing of the sort process in a block in the sort process of the tabular data by one Embodiment of this invention. It is explanatory drawing of the result of the sort process in a block in the sort process of the tabular data by one Embodiment of this invention.
- FIG. 1 is a schematic diagram of an embodiment of a distributed memory multiprocessor.
- the distributed memory multiprocessor 100 includes a plurality of arithmetic units 110, 120, 130, and 140 (for example, two, four, eight, etc., four in this example).
- Each arithmetic unit 110, 120, 130, 140 includes a processor 111, 121, 131, 141 for data processing and a dedicated local memory 112, 122, 132, 142 connected directly to the processor.
- the arithmetic units 110, 120, 130, and 140 are connected by an interconnect 150 that enables high-speed data communication between the arithmetic units.
- the arithmetic units 110, 120, 130, and 140 may include a cache memory.
- the arithmetic unit may be configured to allow access (remote access) to the local memory of another arithmetic unit. In that case, the arithmetic unit may further include a cache memory for remote access.
- the local memory of each arithmetic unit may be configured to appear as one logically continuous memory as a whole.
- the processor in the arithmetic unit may be a single core processor or a multi-core processor including two or more processor cores.
- the local memory in the arithmetic unit may be used as a shared memory between the processor cores.
- Each arithmetic unit can be configured such that a series of data such as tabular data is operated by pipeline processing of a plurality of arithmetic units.
- each arithmetic unit receives local data from one or more (eg, two) arithmetic units in the previous pipeline stage, and at least two (eg, two) received local data Merging means for converting the data into one further local data and sending the further local data to one arithmetic unit in a later pipeline stage.
- the merging means of these plural arithmetic units can be dynamically connected by a tournament method so as to finally generate one global data.
- “dynamic” means that the number of stages of the tournament table, the arrangement of each arithmetic unit in the tournament table, and the like are variable according to the objects to be merged. Furthermore, at least one of the arithmetic units is assigned to each block when a series of data is divided into a plurality of blocks, that is, the block number assigned to the arithmetic unit to which each block is assigned. Based on this, it includes distribution means for dividing the data generated by the merging and allocating the data to a plurality of arithmetic units.
- each block obtained from a series of data is associated with each arithmetic unit, that is, a single core processor in the arithmetic unit.
- each block obtained from a series of data is associated with each processor core in the arithmetic unit. Therefore, a plurality of blocks are associated with one arithmetic unit, and various processes related to the blocks are executed in units of processor cores in the arithmetic unit.
- the processor in the arithmetic unit may be either a single core processor or a multi-core processor.
- the embodiments of the invention are described in units of arithmetic units as if the arithmetic units are single-core processors. However, even if the processor in the arithmetic unit is a multi-core processor, if the processor of one arithmetic unit is considered to be compatible with one core processor, the following description can be similarly applied to this case. Cost.
- FIG. 2 is a schematic diagram of a computer system 200 for manipulating a large series of data according to an embodiment of the present invention.
- the computer system 200 includes a distributed memory type multiprocessor 202 as shown in FIG. 1, which operates a series of data in a shared manner by a plurality of arithmetic units.
- the computer system 200 further stores a CPU 210 that controls the entire system and individual components by executing a program, and stores work data, for example, RAM (Random Access Memory). ), A ROM (Read Only Memory) 214 for storing programs, a storage device 216 such as a hard disk, a CD-ROM driver 220 for accessing the CD-ROM 218, and a CD-ROM driver 220.
- RAM Random Access Memory
- a ROM Read Only Memory
- an interface (I / F) 222 connected to an external terminal connected to an external network or the like (not shown), an input device 224 such as a keyboard and a mouse, and a display device 226 such as a computer monitor It has.
- the processor 210, the RAM 212, the ROM 214, the storage device 216, the I / F 222, the input device 224, and the display device 226 are connected to each other via a bus 228.
- a program that causes the distributed memory multiprocessor 202 of the computer system 200 to execute a series of data operations may be stored in the CD-ROM 218 and read by the CD-ROM driver 220 or stored in advance in the ROM 214. good. Further, what is once read from the CD-ROM 218 may be stored in a predetermined area of the external storage medium 216. Alternatively, the program may be supplied from the outside via a network (not shown), an external terminal, and the I / F 222.
- the distributed memory type computer is realized by causing the computer system 200 to execute a program for operating a series of data.
- a CPU 210 is provided in addition to the distributed memory type multiprocessor 202 to control the entire system and individual components.
- the present invention is not limited to such an embodiment.
- an arithmetic unit included in the distributed memory multiprocessor 202 controls the entire system and individual components. .
- FIG. 3 is a diagram showing an example of tabular data for explaining the data management mechanism which is the basis of the present invention.
- This tabular data is stored as a data structure as shown in FIG. 4 in the computer 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.
- the source record position number is virtual information used for specifying individual records including item values corresponding to data items. For example, when normal tabular data is converted into tabular data based on an information block, the position where a record is accommodated in the original normal tabular data is represented by a source record position number. In general, in tabular data based on information blocks, records are not always arranged in the order of the original record position numbers.
- the sort order of the tabular data records after sorting is different from the sort order of the original tabular data records.
- records in tabular data based on information blocks immediately after conversion from normal tabular data may be arranged in the order of the source record position number. In this case, the source record position The number and the record sequence number initially match.
- the order number (record order number) of each record of the tabular data and the original record position number are abbreviated as a record order designation array 401 (hereinafter this array is abbreviated as “OrdSet”) .).
- the record order specification array 401 stores the original record position numbers in the order of the record order numbers. In the example of FIG. 4, the records are arranged in the order of the original record position numbers.
- the array A can be expressed as A [i], where the subscript i is an index, but in the drawing, the array is shown in a region surrounded by a solid line, and the element A [i] The boundary of 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.
- the actual gender value for the record whose source record position number is “0”, ie, “male” or “female” is a value list in which the actual values are sorted according to a predetermined order (eg, ascending or descending order).
- Item value number array 402 (hereinafter, item value number array, that is, pointer array) that is a pointer array to a certain item value array 403 (hereinafter, item value array, that is, a value list is abbreviated as “VL”). Is abbreviated as “VNo.”).
- the pointer array 402 stores pointers that point to elements in the actual value list 403 according to the order of the source record position numbers stored in the array OrdSet 401.
- Item values can be obtained for other records as well as for age and height.
- 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”.
- information blocks regarding gender, age, and height are shown as information blocks 408, 409, and 410, respectively.
- a single computer has a single memory (physically multiple, but a single memory in the sense that it is located and accessed in a single address space) May store the ordered set array OrdSet, the value list VL constituting each information block, and the pointer array VNo in the memory.
- the manipulation of tabular data is performed by a distributed memory multiprocessor composed of multiple arithmetic units with local memory. Therefore, a new mechanism for holding tabular data has been proposed in order to achieve efficient parallel processing.
- FIG. 5A shows an example of tabular data.
- the tabular data 500 shown in FIG. 5A includes item values corresponding to the data item 501 “School” (for example, “West”, “South”, “North”, “East”, and data items “Age”). It is represented as an array of records including item values (for example, “12”, “8”, “11”, “10”, etc.) corresponding to 502.
- Record 510 at the head of the array is a record to which record sequence number 0 is assigned.
- the item value of “School” is “West” and the item value of the data item “Age” is “12.”
- the data item “School” of the record 511 is displayed.
- the item value is “North”, and the item value of the data item “Age” is “9.”
- the record order given to each record Note that the numbers change.
- this tabular data record is identified by block numbers (in this example, eight block numbers from 0 to 7) blocks 520 and 521. ... 527. Initially, this block is associated with the arithmetic unit of the distributed memory type multiprocessor responsible for processing the records included in this block, more specifically, the processor of the arithmetic unit.
- the data structure for the distributed memory multiprocessor includes information (order information) relating to the order in which records are arranged (that is, record order numbers) and storage locations of field values in the data structure, and field values for each data field.
- Information (item information).
- the order information functionally corresponds to the record order designation array OrdSet in the data management mechanism that is the basis of the present invention, and the item information similarly corresponds to the information block. Both the order information and the item information are held in the global memory, and a part of them is transferred to the local memory of each arithmetic unit as necessary.
- FIG. 5B shows the order information 530
- FIGS. 5C and 5D show the item information 531 and 532 of the data item “School” and the data item “Age”, respectively.
- an arithmetic unit responsible for the operation of the record is determined for each record. Therefore, the record (s) is divided into records that each arithmetic unit is responsible for, that is, the records in charge, and a block number is assigned to each record in charge. If the block and the arithmetic unit correspond one-to-one as in the present embodiment, each arithmetic unit does not need to store the block number.
- a block number array BlkNo [i] indicates that the block number of the block to which the record having the record order number i belongs is BlkNo [i]. For example, in the example of FIG. 5A, records with record sequence numbers 0 to 3 are included in the block with block number 0, records with record sequence numbers 4 to 7 are included in the block with block number 1, and so on.
- the order information 530 includes record order number arrays 551-0, 551-1, 551-2,... 551 in which the record order numbers of the records in charge are stored in the order of the record order numbers for each block. 7 is included.
- the record order number array may be referred to as GOrd below.
- the record sequence numbers of the assigned records belonging to the block of block number 0 are 0, 1, 2, and 3
- the record sequence numbers of the assigned records belonging to the block of block number 1 are 4, 5, 6, 7 and so on.
- the record sequence number array is an integer type array having the same size as the number of records in charge belonging to each block and storing the record sequence numbers in ascending order.
- the record sequence number array is divided into sizes that can be accommodated in the local memory of each arithmetic unit, and stored in the local memory in each arithmetic unit.
- the block number array and the record sequence number arrays 551-0, 551-1, 551-2, ..., 551-7 can be converted to each other.
- the block number of the block to which the record having the record sequence number i belongs is expressed by BlkNo [i]
- the conversion from the block number array to the record sequence number array is as follows.
- J [BlkNo [i]] of the array J represents a subscript that designates an element of the record sequence number array GOrd [BlkNo [i]] belonging to the block whose block number is BlkNo [i]. Note that all elements of the array J are initialized to 0.
- the order information 530 includes the item value access information arrays 552-0 and 552 in which the item value access information of the assigned record is stored in the order of the record order number for each block. 1, 552-2,... 552-7.
- This item value access information array is an integer type array, and the size of the item value access information array matches the number of records in charge.
- the item value access information array may be called by the name LOrd. For example, in the example of FIG.
- the item value included in the record whose record sequence number is 0 included in the block of block number 0 can be accessed by the item value access information of 0 with respect to this block number 0.
- the item value included in the record having the record sequence number 5 included in the block 1 can be accessed by the item value access information 1 regarding the block number 1.
- item information is held as item information for each data item.
- the item information 531 regarding the data item “School” and the item information 532 regarding the data item “Age” are divided and stored in the local memory of each arithmetic unit.
- the item values included in the record in charge for each block are held in the local memory of each arithmetic unit so that each arithmetic unit can access each data item using the item value access information array.
- the item value itself is constructed on the local memory as a local item value array LVL in which unique item values are stored in a predetermined order (ascending order or descending order) for each data item. For example, in the examples of FIGS.
- the item values relating to the data item “School” are held in the local memory of each arithmetic unit as local item value arrays 562-0, 562-1,.
- Item values relating to the data item “Age” are held in the local memory of each arithmetic unit as local item value arrays 582-0, 582-1,. Since the local item value array is an array for storing the item value itself, it takes various data types such as an integer type, a floating point type, and a character string type.
- Item information is configured so that item values stored in the global item value array can be specified using item value access information related to the record in charge. Therefore, the item information includes, for each data item, a local item value number array in which local item value numbers that specify item values included in the assigned record are stored in the order of record order numbers (for example, ascending order or descending order); A global that specifies the location where the field value represented by the local field value number is stored in a unique field value array (hereinafter sometimes referred to as the global field value array) held in the entire tabular data Field value sequence number array. Note that the global item value array does not need to be actually constructed in memory.
- the local item value number array and the global item value sequence number array are provided for each block and are stored in the local memory of each arithmetic unit.
- the local item value number array is an integer type array having a size that matches the number of records of the assigned record, and is sometimes called by the name VNo.
- the global item value sequence number array is an integer type array having the same size as the number of unique item values included in the record in charge, and is sometimes referred to as GVOrd.
- the item information 531 includes local item value number arrays 561-0, 561-1,... 561-7 and local item value arrays 562-0, 562. 1,... 562-7 and global item value sequence number arrays 563-0, 563-1,.
- the local item value number array, the local item value array, and the global item value sequence number array are all divided into blocks.
- the value of the head element of the local item value number array VNo of Block-0 is “1”. This means that the item value number of the item value included in the record specified by the item value access information whose value is “0” is “1”.
- the item value whose item value number is “1” is found to be “West” by referring to the second element of the local item value array LVL, that is, LVL [1]. Furthermore, this item value is the third element of the virtual global item value array by referring to the second element of the global item value sequence number array, that is, GVOrd [1]. It can be seen that the order number of this item value in the entire format data is “3”. The same applies to other blocks and other data items.
- the item value included in the record belonging to each block is associated with the local item value number assigned to each item value in the block and the local item value number. And a local item value array that is displayed.
- FIG. 6 is a flowchart of a method for constructing a data structure for a distributed memory multiprocessor according to an embodiment of the present invention on a local memory of each arithmetic unit.
- a plurality of arithmetic units of the distributed memory type multiprocessor 202 operate in parallel to construct a tabular data structure for the distributed memory type multiprocessor in the local memory of the arithmetic unit.
- the receiving unit of the arithmetic unit operates in parallel, for example, from an external device such as a device on the network connected via the storage device 216 and the I / F 222 to each arithmetic unit of the tabular data.
- the assigned record in charge is received and stored in a dedicated local memory (step 602).
- the sequence information creation unit of the arithmetic unit operates in parallel to generate a record sequence number array and an item value access information array from the received assigned records, and stores them in a dedicated local memory (step 604).
- the local compiling unit of the arithmetic unit operates in parallel, and for each item, sorts the item values in the assigned record in a predetermined order (for example, ascending or descending order), whereby a local item value array, Then, a local item value number array is generated and stored in a local memory dedicated to the arithmetic unit (step 606).
- the transmission unit of the arithmetic unit operates in parallel to generate a unique item value included in the local item value array for each item based on a predetermined order within the range of the local item value array and the assigned record.
- the data is transmitted to the arithmetic unit in the pipeline stage after the arithmetic unit (step 608).
- the merge unit of the arithmetic unit operates in parallel to merge the item values in the two local item value arrays included in the two local data from the previous pipeline stage in a predetermined order.
- the distribution unit of any of the arithmetic units stores the sequence number stored in the finally generated further local item value sequence number array in the corresponding finally generated further block number array. It transmits to the arithmetic unit associated with the block number (step 612).
- the sequence number storage unit of the arithmetic unit operates in parallel and sequentially stores the transmitted sequence numbers in the global item value sequence number array secured in the dedicated local memory (step 614).
- FIG. 7 is a flowchart of an item value acquisition method according to an embodiment of the present invention.
- the item value is stored in the local memory of each arithmetic unit in the form of item information for each data item. Therefore, for example, the distributed memory multiprocessor can easily acquire the item value included in the designated record.
- the tabular data is divided into records in charge of the arithmetic units, and is held independently for each arithmetic unit.
- each arithmetic unit can acquire the item value held in the local memory of this arithmetic unit completely independently of the other arithmetic units.
- a situation is also considered in which item values included in a large number of records are acquired simultaneously by a large number of arithmetic units operating simultaneously. Even in such a situation, it will be understood that the basic operation of acquiring the item value is a process in which a specific arithmetic unit acquires an item value included in a certain record in the assigned record.
- each arithmetic unit determines whether or not the designated record sequence number exists in the record sequence number array held in the local memory. (Step 702). If the specified record sequence number does not exist (No in step 702), the process ends. If the specified record sequence number exists, the arithmetic unit specifies the position where the specified record sequence number is stored in the record sequence number array, and the item value access information specified by the specified position The item value access information in the array is read (step 704). Thereafter, the arithmetic unit reads the local item value number in the local item value number array designated by the read item value access information for each item (step 706).
- the arithmetic unit specifies an item value in the local item value array designated by the read local item value number for each item (step 708). Finally, the arithmetic unit determines whether there is an item whose item value has not yet been specified (step 710). If there is an item for which the item value has not yet been specified (Yes in Step 710), the process returns to Step 706 to continue the processing for the next item. If all item values have been identified (No at step 710), the process ends.
- FIGS. 5A to 5D An example of data acquisition according to the present embodiment will be described in more detail using the data structure shown in FIGS. 5A to 5D.
- FIGS. 5A to 5D consider obtaining the item value of the record indicated by the reference numeral 511.
- FIG. 8 is a schematic flowchart of the compiling process according to an embodiment of the present invention.
- Acquired record acquisition first, in the tabular data, the assigned record handled by each arithmetic unit is taken into the arithmetic unit (step 802).
- the assigned record handled by each arithmetic unit is taken into the arithmetic unit (step 802).
- a record in charge is fetched for each processor, and block unit processing is executed for each processor.
- Order information creation Next, order information including a record order number array and an item value access information array is created on the local memory of each arithmetic unit (step 804). As described above, the record sequence number array and the item value access information array are created in parallel by a plurality of arithmetic units.
- In-block compilation Next, multiple arithmetic units operate in parallel, and for each data item, local item value numbers are stored in the order of the original record position number of the assigned record contained in a single block.
- a local item value array is created, and at the same time, a plurality of arithmetic units also store a local item value array that stores unique values among the item values included in the assigned record in a predetermined order (for example, ascending or descending order). Create (step 806).
- Inter-block compilation 1 (merge): Next, a plurality of arithmetic units operate in parallel and hierarchically, and each data item is associated with at least two (in this embodiment, two) blocks.
- the block number array, local item value array, and virtual global item value array that stores unique item values included in the entire tabular data in a predetermined order.
- a block number array related to a block obtained by merging two blocks from a pair of global item value sequence number arrays in which pointers for specifying the stored positions are stored in the order of local item value numbers A merge process for creating a set of a local item value array and a global item value sequence number array is executed. The arithmetic unit repeatedly executes this merging process until it is finally merged into one block, the final block number array, the final local item value array, and the final global item value sequence number array. Is created (step 808).
- Inter-block compilation 2 (distribution): Finally, at least one arithmetic unit specifies, for each data item, an element in the final global item value sequence number array by the corresponding element in the final block number array By sequentially distributing the block numbers to the arithmetic units in charge of the respective blocks, a global item value sequence number array relating to the record in charge of each arithmetic unit is created on the local memory of each arithmetic unit (step 810). ).
- FIGS. 9A and 9B are explanatory diagrams of order information creation processing according to an embodiment of the present invention.
- the data shown in FIGS. 9A and 9B is the same as the data shown in FIGS. 5A and 5B, and the order information 530 in FIG. 9B is created from the tabular data 500 in FIG. 9A.
- the order information creation process is as described above.
- the row number of the original tabular data is set as it is in the record order number array GOrd, and a sequential number starting from 0 is set in the item value access information array LOrd.
- the order information creation process is executed in parallel by a plurality of arithmetic units.
- FIGS. 10A to 10C are schematic views of the in-block compilation processing according to the embodiment of the present invention.
- the item information includes a local item value number array VNo and a local item value array LVL.
- the intra-block compilation process is executed in parallel by each arithmetic unit for each block of Block-0, Block-1,..., Block-7.
- FIG. 11 is a schematic diagram of the intra-block compilation process according to an embodiment of the present invention.
- the local item value array LVL is a list of values in which unique item values extracted from the item values included in the item value array School are stored in a predetermined order (in this example, ascending alphabetical order).
- the following processing is executed by the arithmetic unit using the local memory of the arithmetic unit.
- FIG. 12A to 12E are explanatory diagrams of the in-block compilation processing according to the embodiment of the present invention.
- An item value array as shown in FIG. 12A is created in the local memory of the arithmetic unit.
- the elements of the item array A are sorted in ascending order of the item values using the item values as keys, and the elements of the position array B are also sorted at the same time.
- the item value array A and the position array B as shown in FIG. 12C are obtained.
- an item value number array C is generated by assigning item value numbers to unique item values in order from 0.
- the item value can be accessed without duplication using the item value number.
- a local item value array LVL is generated as shown in FIG. 12D.
- the local item value number array VNo and the local item value array LVL are generated in the local memory of the arithmetic unit.
- the inter-block compilation process is a process of merging a pair of local data until a plurality of arithmetic units operate in parallel and hierarchically and finally merge into one local data for each data item. Is repeated to generate the final block number array, the final global item value sequence number array, and the final local item value array, and the final global item value sequence number generated by the merge processing. Distribution processing for distributing the global item value sequence numbers in the array to the arithmetic units corresponding to the block numbers based on the block numbers stored in the corresponding block number arrays. Each arithmetic unit stores the distributed global item value sequence numbers in a global item value sequence number array secured in the respective local memory.
- each arithmetic unit merges information about a pair of blocks, that is, a pair of local data, and generates information about one block of the merged higher layer, that is, further local data. Therefore, the merge process is realized by a parallel operation of a plurality of arithmetic units. Each arithmetic unit also merges information about merged block pairs belonging to the same layer and generates information about one block of the merged higher layer. In this way, by repeating the merge processing in parallel and hierarchically, information on one block at the top layer is finally generated.
- One block in the uppermost layer is a block including the entire record.
- each arithmetic unit inputs information about two blocks, merges them, and outputs information about one block, each arithmetic unit
- an n-stage (layer) merge process is realized.
- the ratio of the communication performed by the arithmetic unit with the global memory is 1 / n.
- the communication volume between the arithmetic units is (n ⁇ 1) / n of the total data communication volume.
- the block 0 related to the arithmetic unit 0 and the block 1 related to the arithmetic unit 1 may be merged by an arithmetic unit other than the arithmetic unit 0 or the arithmetic unit 1, or either the arithmetic unit 1 or the arithmetic unit 1
- the calculation units may be merged. As described above, one arithmetic unit holding the original local data is responsible for the merge processing of the next pipeline stage, thereby reducing the data communication amount between the arithmetic units.
- FIG. 13 is an outline diagram of merge processing of inter-block compilation processing.
- PE-i represents the arithmetic unit i
- Block-i represents the block i.
- arithmetic unit 0 merges block 0 from arithmetic unit 0 and block 1 from arithmetic unit 1.
- the arithmetic unit 2 merges the block 2 from the arithmetic unit 2 and the block 3 from the arithmetic unit 3.
- the arithmetic unit 4 merges the block 4 from the arithmetic unit 4 and the block 5 from the arithmetic unit 5.
- the arithmetic unit 6 merges the block 6 from the arithmetic unit 6 and the block 7 from the arithmetic unit 7.
- the arithmetic unit 1 merges the blocks 0 to 1 from the arithmetic unit 0 and the blocks 2 to 3 from the arithmetic unit 2.
- the arithmetic unit 5 merges the blocks 4 to 5 from the arithmetic unit 4 and the blocks 6 to 7 from the arithmetic unit 6.
- the notation of blocks i to j means one block generated by merging blocks i to j.
- the arithmetic unit executes pipeline processing in the tournament method.
- the arithmetic unit 3 merges the blocks 0 to 3 from the arithmetic unit 1 and the blocks 4 to 7 from the arithmetic unit 5 into one Blocks 0-7 are generated.
- the arrangement of the arithmetic units in the tournament table that is, the correspondence between the blocks and the arithmetic units) is not limited to the arrangement shown in FIG.
- the blocks 0 to 7 generated by the arithmetic unit 3 are sequentially transmitted to the arithmetic unit 7 when values are obtained.
- the arithmetic unit 7 distributes the blocks 0 to 7 to the arithmetic unit 0, the arithmetic unit 1,..., The arithmetic unit 7 corresponding to the original block.
- the arrays handled (that is, the block number array, the global item value sequence number array, and the local item value array) cannot be accommodated in the local memory of one arithmetic unit. May reach the size of Therefore, when the pipelined arithmetic unit receives data from the arithmetic unit of the previous pipeline stage, it immediately processes the received data and transmits the processed data to the arithmetic unit of the subsequent pipeline stage. And The arithmetic unit in the subsequent pipeline stage receives data from the previous pipeline stage if the data can be stored in the local memory of the arithmetic unit, and the previous pipeline stage if the data cannot be stored. Wait for transmission from the stage.
- the arithmetic unit that has completed the data transmission can release the storage area in the local memory in which the transmitted data is stored.
- An arithmetic unit that has not completed data transmission receives and processes data from the previous pipeline stage as long as it can store data in the local memory of this arithmetic unit, but no more data can be stored in the local memory. If the processing unit in the previous pipeline stage waits for data transmission and the area for storing the data in the local memory is secured again, the data is sent to the arithmetic processor in the previous pipeline stage. Resume sending.
- the data reception side controls data communication between the arithmetic units by issuing a data transmission stop request and a data transmission restart request to the data transmission source. It should be noted that this data communication can be realized by any generally known flow control.
- the arithmetic unit creates a block number array BlkNo initialized on the local memory of the arithmetic unit.
- the block number array BlkNo has the same size as the already created local item value array LVL, and a block number for identifying the assigned record assigned to each arithmetic unit is set as an initial value.
- 0 is stored in the block number array of the arithmetic unit
- 1 is stored in the block number array of the arithmetic unit 1, and so on.
- the arithmetic unit further creates an initialized global item value sequence number array GVOrd on the local memory.
- the size of the global item value order number array GVOrd is the same size as the local item value array LVL, and a sequential number starting from 0 is set in order from the top as an initial value.
- FIGS. 15A, 15B, and 15C the first-stage merge process of the inter-block compilation process according to an embodiment of the present invention will be described.
- the arithmetic unit 0 merges the block 0 and the block 1 will be described.
- the pointers to both local item value arrays LVL ie, pointers specifying the elements to be compared are advanced.
- the pointers to both local item value arrays LVL ie, pointers specifying the elements to be compared
- the merge processing at the first stage of the inter-block compilation processing by PE-0 is completed.
- two sets of local data i.e., two sets of block number arrays, a global item value sequence number array, and a local item value array become one set of further local data, i.e., one set of further block numbers. It is converted to an array, a further global item value sequence number array and a further local item value array.
- the merge process at the first stage of the inter-block compilation process is executed only by sequential access to the local memory, so that the small size is independent of the sizes of the block number array, global item value sequence number array, and local item value array. Note that it can be implemented using only the working memory.
- block numbers stored in the further block number array BlkNo ′ are always in a predetermined order (in the ascending order in this example) as long as the values stored in the further global item value sequence number array GVOrd ′ are the same. Be careful.
- 16A to 16D are explanatory diagrams of the second-stage merge process in the inter-block compilation according to the embodiment of the present invention.
- the second-stage merge process is the same as the first-stage merge process except that the input information is information that has already been merged by another arithmetic unit.
- 16A, 16B, 16C and 16D show the process and the resulting further block number array BlkNo ′, further global item value sequence number array GVOrd ′, and further local item value array LVL ′. ing.
- FIG. 17 is a diagram illustrating the result of the third-stage merge process in the inter-block compilation process according to the embodiment of the present invention.
- FIG. 17 shows the result of merge processing by inter-block compilation for the data item “School”. It should be noted here that the final further local item value array LVL 'matches the virtual global item value array.
- FIG. 18A is an explanatory diagram of distribution processing in inter-block compilation processing according to an embodiment of the present invention.
- the distribution process is executed after the merge process.
- at least one arithmetic unit has, for each data item, an element of the final global item value sequence number array GVOrd ′ for each block number specified by a corresponding element of the final block number array BlkNo ′. And distributed to the arithmetic processors corresponding to this block number.
- the global item value order numbers distributed by the respective arithmetic processors are stored in a global item value order number array GVOrd that has been initially set in a predetermined order (for example, ascending order).
- the global item value sequence number array of the arithmetic unit i is set to GVord [i] [j ]
- the global item value sequence numbers are distributed to the global item value sequence number array GVOrd reserved in the local memory of each arithmetic unit according to the following procedure.
- the global item value sequence number array GVOrd [i] [j] is once created on the local memory of the arithmetic unit that is executing the distribution process, and this global item value sequence number array GVOrd [i] [j] As these elements are filled little by little, they may be sent to each arithmetic unit little by little, or a certain amount may be collectively sent to each arithmetic unit.
- FIG. 18B is a diagram showing a result of distribution processing in inter-block compilation processing according to an embodiment of the present invention.
- a distribution process is performed for each group after a plurality of blocks are grouped in order to improve the processing efficiency. For example, the block number is divided by 4 to separate the upper block number and the lower block number (grouping), and the distribution process is separately applied to the upper block number and the lower block number.
- the block number array BlkNo ′ for the higher block number and the global item value sequence number from the set of the block number array BlkNo ′ and the global item value sequence number array GVOLd ′ obtained by the merge processing in the inter-block compilation processing A set of the array GVOrd ′, a block number array BlkNo ′ for the lower block number, and a global item value order number array GVOrd ′ are generated. This processing can also be executed by a plurality of arithmetic units operating in parallel.
- 19A to 19C are diagrams for explaining the result of the compilation process according to the embodiment of the present invention.
- 19A, 19B and 19C are the same as FIGS. 5B, 5C and 5D, respectively.
- FIG. 20A and 20B are explanatory diagrams of the sort processing of tabular data according to an embodiment of the present invention.
- 20A shows tabular data before sorting processing
- FIG. 20B shows tabular data after sorting processing
- the tabular data before sorting processing is the same as the tabular data shown in FIG. 5A. is there.
- a sort process in which the order of two records having the same key value (that is, West) does not change before and after the sort process is called a “stable” sort process.
- FIGS. 21A to 21D are explanatory diagrams of tabular data obtained by applying the sort processing according to the embodiment of the present invention to the tabular data shown in FIGS. 5A to 5D.
- the result of the sorting process will be described with reference to FIGS. 21A to 21D.
- the storage position of the element GOrd [0] in the record sequence number array GOrd in which this record sequence number 0 is stored, that is, 0 is the rank (rank) of the target record in the record in charge of the arithmetic unit responsible for this block. ).
- the record order number array is an ascending order array, so that this storage position can be found efficiently by a well-known two-division method or the like.
- the order information that is, the record order number array and the item value access information array
- the item information is the sort process. It does not change before and after.
- the item information is configured by a local item value number array VNo, a local item value array LVL, and a global item value order number array GVord.
- FIG. 22 is a schematic flowchart of sort processing of tabular data according to an embodiment of the present invention.
- Step 2201 Sorting within a block Each arithmetic unit operates in parallel, and within each block, sorting is performed by applying a distribution counting sort to the item value access information array LOrd using the local item value number array VNo as a key. A global item value sequence number array GVOrd ′ and a record sequence number array GOrd ′ for the next step are generated so as to conform to the item value access information array LOrd.
- a plurality of processors are accommodated in one arithmetic unit, processing in units of blocks is executed for each processor.
- Step 2202 Inter-block sort 1 (merge) Each arithmetic unit operates in parallel and hierarchically, and adds a block number array BlkNo ′ to the global item value order number array GVOrd ′ and the record order number array GOrd ′ from the previous pipeline stage, and the global item value order Using the number array GVOrd 'and the record order number array GOrd' as a key, the global item value order number array GVOrd ', the record order number array GOrd' and the block number array BlkNo 'from each block are merged into a predetermined order by the tournament method. To do.
- This step is a sequential process.
- Step 2203 Inter-block sort 2 (distribution) At least one arithmetic unit, in order from the first element of the block number array BlkNo ′, the block designated by the element value, that is, the value of the position where the element is stored in the arithmetic unit associated with this block
- the record order number array GOrd is generated on the local memory of each arithmetic unit.
- the sorting process of the tabular data is realized by three steps of sorting within a block, sorting 1 between blocks (merge), and sorting 2 between blocks (distribution).
- the inter-block sort 1 (merge) is a sort process in the sense that data from a pair of blocks is rearranged in a predetermined order, and the data from the pair of blocks is integrated into a set of data. It is also a merge process in meaning.
- “merge in a predetermined order” refers to processing in block-to-block sort 1 (merge).
- FIGS. 23A to 23C are explanatory diagrams of the intra-block sorting process in the tabular data sorting process according to the embodiment of the present invention.
- the processing related to each block is executed by each arithmetic unit to which the block is assigned.
- an array operation may be expressed by a pseudo instruction similar to the C language.
- FIG. 23A is an explanatory diagram of the count-up process in the distribution counting sort process.
- FIG. 23A shows a record order number array GOrd, an item value access information array LOrd, a local item value number array VNo, a global item value order number array GVOrd, and a local item value used as a distribution counting sort key. The transition of the count array Count that counts the number of occurrences of the number is shown.
- FIG. 23B is an explanatory diagram of the cumulative number process in the distribution counting sort process.
- a cumulative frequency distribution array Aggr is obtained. Note that the head element of the cumulative frequency distribution array Aggr generated by this cumulative number processing is 0, and the actual cumulative frequency is stored after Aggr [1].
- FIG. 23C is an explanatory diagram of the transfer process in the distribution counting sort process.
- the transfer process not only the elements of the array LOrd are copied to the array LOrd ′, but also the global item value sequence number array GVOrd ′ and the record sequence number array GOrd ′ corresponding to the newly generated array LOrd ′ are generated.
- a process of copying LOrd [0] is shown at the top of FIG. 23C.
- the item value access information array LOrd 'obtained in this way matches the final item value access information array LOrd in the sorted block.
- the newly generated global item value order number array GVOrd 'and record order number array GOrd' correspond to records sorted in the block using item values as keys.
- the tabular data records sorted within the block by each arithmetic unit are then merged between the blocks.
- data sorted in each block is merged, and merged data sorted as a whole is generated. More specifically, a set of elements of the global item value sequence number array GVord 'and elements of the record sequence number array GOrd' is sorted. Since the elements of the record order number array GOrd 'have values that are uniquely determined for each record, the set of the elements of the global item value order number array GVOrd' and the elements of the record order number array GOrd 'is unique.
- the element of the global item value sequence number array GVOrd ′ relating to a certain data item indicates the position of the element of the virtual global item value array in which the item values relating to the data item are arranged in a predetermined order. Sorting in the order of the element values of the sequence number array GVOrd ′ is equivalent to sorting in the order of the item values.
- a block number array BlkNo ′ representing the block number to which the record in each block belongs is processed later. Added for.
- FIG. 24 is an explanatory diagram of the result of the intra-block sort process in the tabular data sort process according to the embodiment of the present invention obtained as described above.
- the item value access information array LOrd in each block is consistent with the final result, and thus is indicated without a prime symbol (') like LOrd.
- the global item value sequence number array GVOrd 'and the record sequence number array GOrd' are not final results but represent work arrays in the middle of processing, and therefore are indicated with a prime symbol (').
- an additionally generated block number array BlkNo ' is also shown.
- the inter-block sort process 1 (merge process) in the tabular data sort process can be realized by the same hierarchical structure as the hierarchical structure shown in FIG.
- the merge processing of the block 0 and the block 1 by the arithmetic unit 0 is performed as the first stage merge processing.
- the merge processing of block 2 and block 3 by unit 2 the merge processing of block 4 and block 5 by arithmetic unit 4, and the merge processing of block 6 and block 7 by arithmetic unit 6 are executed.
- the second stage merge processing is realized by the merge processing of blocks 0-1 and 2-3 by the arithmetic unit 1, and the merge processing of blocks 4-5 and 6-7 by the arithmetic unit 5.
- the operation block 3 executes the merge processing of block 0-3 and block 4-7.
- the arithmetic units in charge of the merge process in each pipeline stage are not limited to the above combinations.
- the distribution process is executed by the arithmetic unit 7, for example.
- each arithmetic unit merges information related to a pair of blocks, and generates information related to one block of the merged higher layer. Therefore, the merge process is realized by a parallel operation of a plurality of arithmetic units. Each arithmetic unit also merges information about merged block pairs belonging to the same layer and generates information about one block of the merged higher layer. In this way, by repeating the merge processing in parallel and hierarchically, information on one block at the top layer is finally generated.
- One block in the uppermost layer is a block including the entire record.
- inter-block sort process 1 in the tabular data sort process according to an embodiment of the present invention will be described in more detail.
- 25A to 25C are explanatory diagrams of the first-stage inter-block merge processing in the tabular data sort processing according to an embodiment of the present invention.
- PE-0 executes a merge process in a predetermined order between block Block-0 (hereinafter referred to as block 0) and block Block-1 (block 1).
- the inter-block merge process is an ascending list merge process in that one ascending list is generated from two ascending lists.
- FIG. 25A shows information on the first record in block 0 (represented as B0 (GVOrd ′, GOrd ′)) and information on the first record in block 1 (B1 (GVOrd ′, GOrd ′)).
- B0 GVOrd ′, GOrd ′
- B1 GVOrd ′, GOrd ′
- FIG. 25B shows a process of comparing the first record in block 0 where the read pointer is positioned at the head with the second record in block 1 where the read pointer is advanced one step forward.
- B0 (2,1) is compared with B1 (2,4), it is determined that B0 (2,1) is smaller, so the element set B0 (2,1) including the block number is determined.
- the read pointer on the block 0 side is advanced by one.
- FIG. 25C shows the global item value sequence number array GVOrd ', the record sequence number array GOrd', and the block number array BlkNo 'that are finally extracted.
- the retrieved global item value sequence number array GVOrd ′, record sequence number array GOrd ′, and block number array BlkNo ′ are sent to, for example, PE-1 in this example for the second stage merge processing.
- the extracted data is sent from PE-0 to PE-1 as necessary while proceeding with the comparison process on the block 0 side and the block 1 side. May be.
- inter-block sort process 1 (merge process) according to one embodiment of the present invention
- data access is limited to sequential access, and each arithmetic unit is connected in parallel.
- the sort processing 1 between blocks can be executed. Therefore, the performance of the multiprocessor type processing apparatus is fully utilized.
- 26A and 26B are explanatory diagrams of the second-stage merge processing in the tabular data sort processing according to the embodiment of the present invention.
- the second-stage merge process is the same as the first-stage merge process, except that input information is transferred from the local memory of another arithmetic unit. Briefly describing this processing, as shown in FIG.
- the global item value sequence number array GVOrd ′, the record sequence number array GOrd ′, and the block number array BlkNo ′ are read from the two blocks.
- the notations Ba to b represent data obtained as a result of the merge processing in a predetermined order from block a to block b.
- the retrieved global item value sequence number array GVOrd ′, record sequence number array GOrd ′, and block number array BlkNo ′ are sent to PE-3 in this example because of the third-stage merge process. Rather than sending the final result all at once, the extracted data may be sent from PE-1 to PE-3 as necessary while proceeding with the comparison process on the block 0 side and the block 1 side. Good.
- the second stage of the inter-block sort process 1 (merge process) according to an embodiment of the present invention, data access is limited to sequential access, and each arithmetic unit is The block sorting process 1 can be executed in parallel. Therefore, the performance of the multiprocessor type processing apparatus is fully utilized.
- the second stage merge processing is executed in parallel by PE-1 and PE-5 in this example.
- PE-1 outputs the result of the inter-block merge processing from block 0 to block 3 to PE-3 as blocks 0 to 3
- PE-5 outputs the result of the inter-block merge processing from block 4 to block 7 Output to PE-3 as blocks 4-7.
- the merge of data from all blocks is completed by the third-stage merge processing by PE-3, that is, all blocks
- the sort process considering the block ends.
- the number of blocks is 9 or more, for example, by increasing the number of stages of merge processing, finally, a sort processing result in which data from all blocks are merged is obtained. It is possible.
- FIG. 27 is an explanatory diagram of the third merging process in the tabular data sorting process according to the embodiment of the present invention.
- the third-stage merge process also includes B0-3 data B0-3 (GVOrd ', GOrd') and B4-7 data B0. ... 4 (GVOrd ′, GOrd ′) are compared in order from the head, the smaller element set is extracted, and the operation of advancing the read pointer of the data from which the element has been extracted is repeated.
- B0-3 data B0-3 B0-3
- GVOrd ′ GOrd ′
- This set of arrays represents the sorting result of all records. For example, referring to the global item value sequence number array GVOrd ', since the values are arranged in ascending order including the same value from the top, the records are sorted in the order of the item values in the virtual global item value array. You can see that It can also be seen that records having the same element value in the global item value sequence number array GVOrd 'are arranged in ascending order of the record sequence numbers before sorting by referring to the record sequence number array GOrd'. As described above, the reason why a stable sorting result with respect to the record sequence number is obtained is that when sorting between blocks, the records are rearranged based on the magnitude relation regarding the combination of the item value designation pointer and the record sequence number. Because it was broken.
- the inter-block sort process 1 (merge process) in the tabular data sort process according to the embodiment of the present invention.
- the record to which the record sequence number 0 is given after sorting is (I)
- the value of the global item value sequence number of the item value related to the data item that is the key for sorting is 0, (Ii)
- the record sequence number assigned before sorting is 8, (Iii) Belonging to block 2
- this inter-block sort process 1 (merge process) is expressed in a data structure for a distributed memory multiprocessor.
- the record sequence number of the record belonging to each block is finally determined.
- This process of determining the record sequence number is called inter-block sort process 2 (distribution process).
- at least one arithmetic unit or processor core sets the record sequence number corresponding to the subscript i of the block number array BlkNo ′ to the block number BlkNo. Distribution is performed for each block represented by [i], and the distributed record order numbers are arranged in a predetermined order (for example, ascending order) within the block.
- the k-th element of the record sequence number array of block j is GOrd [j] [k]
- the write pointer k for setting the record sequence number in the record sequence number array GOrd [j] is set.
- Offsets [j] it can be described as follows.
- the record sequence number arrays created by sharing by a plurality of arithmetic units are integrated into one record sequence number array for each block. If the block number array BlkNo ′ is continuously assigned to a plurality of arithmetic units, that is, if a part of the block number array BlkNo ′ in charge of each arithmetic unit is continuous, this integration processing Is greatly simplified. This is because it is not necessary to change the order of elements between record sequence number arrays created by different arithmetic units for the same block. That is, the integration process of the record sequence number arrays is achieved by simply concatenating the record sequence number arrays created separately.
- FIG. 29A is an explanatory diagram of an inter-block sort process according to an embodiment of the present invention.
- the field value access information array LOrd and the global field value sequence number array GVOLd ′ relating to the assigned record (that is, each block) are stored in the local memory of each arithmetic unit.
- a record sequence number array GOrd ′ and a block number array BlkNo ′ are created.
- FIG. 29A is an explanatory diagram of an inter-block sort process according to an embodiment of the present invention.
- the arithmetic unit 0 merges the local data from the arithmetic unit 0 and the arithmetic unit 1, and the arithmetic unit 2 from the arithmetic unit 2 and the arithmetic unit 3 ,
- the arithmetic unit 4 merges the local data from the arithmetic units 4 and 5
- the arithmetic unit 6 merges the local data from the arithmetic units 6 and 7.
- the arithmetic unit 1 merges the local data from the arithmetic units 0 and 2
- the arithmetic unit 5 Merge local data from unit 6.
- the arithmetic unit 3 merges the local data from the arithmetic units 1 and 5.
- the merge processing in the inter-block processing is performed hierarchically by the tournament method.
- the arithmetic unit 7 receives the block number array BlkNo ′ from the top of the final local data generated by the arithmetic unit 3, and the block number is the block number array.
- the position stored therein, that is, the record sequence number is distributed to the arithmetic unit associated with the block number.
- the arithmetic units to which the record order numbers are distributed sequentially store the distributed record order numbers in the record order number array GOrd on the respective local memories.
- 29D shows the global item value order number array GVOrd ′ and the record order number array GOrd ′ in addition to the block number array BlkNo ′ for convenience of explanation. Note that the result is the block number sequence BlkNo ′. Therefore, only the block number array BlkNo ′ needs to be generated at the final stage of the merge process. Note that the arithmetic processor 3 located at the third stage of the pipeline processing may further perform the distribution processing.
- FIG. 30 is an explanatory diagram of the order information generated by the sort processing of the tabular data according to the embodiment of the present invention. This is consistent with the sorted ordered set shown in FIG. 21B. It should be noted that the item information is not changed by the sorting process.
- the sort processing of tabular data is a sort processing related to predetermined data items. What is changed by this sort processing is the record sequence number array and the item value access information array. On the other hand, records belonging to each block and item information do not change. Therefore, the sorting process for a plurality of data items is realized by repeating the sorting process for the predetermined data item. According to a preferred embodiment of the distributed memory multiprocessor of the present invention, the multi-item sort process is realized by the control unit controlling the arithmetic unit to repeat the sort process for a plurality of data items.
- FIG. 31A and 31B are explanatory diagrams of tabular data search processing according to an embodiment of the present invention.
- FIG. 31A shows tabular data before search processing
- FIG. 31B shows tabular data after search processing
- tabular data before search processing is the same as the tabular data shown in FIG. 5A. is there.
- FIGS. 32A to 32D are explanatory diagrams of tabular data obtained by applying the search processing according to the embodiment of the present invention to the tabular data shown in FIGS. 5A to 5D.
- the results of the search process will be described with reference to FIGS. 32A to 32D.
- FIG. 32A shows the order information of the tabular data before the search (that is, the search source) corresponding to FIG. 31A.
- FIG. 32B shows the order information of the tabular data after the search corresponding to FIG. 31B
- FIG. 32C and FIG. 32D show the item information of the tabular data after the search corresponding to FIG. 32B. .
- the record (North, 6) that matches the search condition exists in the block 1 of the tabular data in FIG. 31A, the order information related to the block 1 of the tabular data in FIG.
- the item information includes a local item value number array VNo, a local item value array LVL, and a global item value sequence number array GVOrd.
- FIG. 33 is a schematic flowchart of a tabular data search process according to an embodiment of the present invention. As described above, only the order information changes in the search. Accordingly, the record sequence number array GOrd and the item value access information array LOrd are created by the search process.
- Step 3301 Local processing (hit flag array setting)
- Each arithmetic unit operates in parallel to determine whether each item value in the local item value array LVL matches the search condition for the item to be searched in each block, and matches the search condition Set the element of the hit flag array corresponding to the item value to be set.
- processing in units of blocks is executed for each processor.
- Step 3302 Local processing (record extraction) Each arithmetic unit operates in parallel to extract the record sequence number and item value access information corresponding to the item value for which the hit flag is set, and create the record sequence number array GOrd and the item value access information array LOrd. .
- Step 3303 Global processing (block number setting) Each arithmetic unit operates in parallel to create a block number array BlkNo having the same size as the created record sequence number array GOrd and set a block number.
- Step 3304 Global processing (merge processing) The merging means of each arithmetic unit merges the record order number array GOrd and the block number array BlkNo by a tournament method.
- Step 3305 Global processing (distribution processing)
- the distribution means of at least one arithmetic unit specifies, in order from the first element of the final block number array BlkNo, the value of the position where this element is stored, that is, the sequence number, is specified by the value of this element.
- the data is transmitted to the block, that is, the arithmetic unit associated with the block, and the sequence number transmitted by each arithmetic unit is sequentially stored in the respective record sequence number array GOrd.
- the tabular data search process includes a local process corresponding to a search process within a block, a merge process between blocks, and a distribution process between blocks.
- FIG. 34 is an explanatory diagram of hit flag array setting processing in tabular data search processing according to an embodiment of the present invention.
- an element corresponding to the item value that matches the search condition is marked (that is, a flag is set).
- 35A to 35C are explanatory diagrams of local processing in tabular data search processing according to an embodiment of the present invention.
- a record in which a flag in the hit flag array is set is extracted.
- the arithmetic unit creates an item value access information array LOrd 'and a record sequence number array GOrd' of a record in which a flag in the hit flag array is set on the local memory.
- the operation of the arithmetic unit 1 related to the block 1 will be described.
- the arithmetic unit 1 extracts the elements of the local item value number array of the record in charge, that is, the local item value numbers in order from the top of the array, and this local item value number. It is determined whether the element of the hit flag array specified by is set. If the hit flag is set, the record corresponding to this local field value number matches the search condition, so that the field value access information and record sequence number of this record are the field value access information array LOrd ′. And the record sequence number array GOrd ′. As shown in FIG. 35B, this record extraction processing is executed in parallel by a plurality of arithmetic units. Finally, as shown in FIG.
- an item value access information array LOrd 'and a record sequence number array GOrd' relating to records that match the search condition are constructed on the local memory of the arithmetic unit.
- the item value access information array LOrd 'constructed at this time matches the item value access information LOrd included in the order information generated as a search result.
- each arithmetic unit creates a block number array BlkNo ′ of the same size as the record sequence number array GOrd ′ created by the record extraction process in the local memory, and this block number indicates the record in charge of each arithmetic unit. Fill block number array.
- the record order number array GOrd 'and the block number array BlkNo' are empty.
- the tabular data records retrieved within the block by each arithmetic unit are then merged between the blocks.
- data searched in the respective blocks are merged to generate merged data searched as a whole.
- a set of elements of the record sequence number array GOrd 'and elements of the block number array BlkNo' are merged in ascending order of the record sequence numbers. Since the elements of the record sequence number array GOrd 'have values that are uniquely determined for each record, the set of elements is unique.
- the merge process in the tabular data search process according to the embodiment of the present invention can be realized by the same hierarchical structure as the hierarchical structure shown in FIG.
- the merge processing of the block 0 and the block 1 by the arithmetic unit 0 is performed as the first-stage merge processing.
- the merge process of block 2 and block 3 by 2 the merge process of block 4 and block 5 by the arithmetic unit 4, and the merge process of block 6 and block 7 by the arithmetic unit 6 are executed.
- the second stage merge processing is realized by the merge processing of blocks 0-1 and 2-3 by the arithmetic unit 1, and the merge processing of blocks 4-5 and 6-7 by the arithmetic unit 5.
- the operation block 3 executes the merge processing of block 0-3 and block 4-7.
- the arithmetic units in charge of the merge process in each pipeline stage are not limited to the above combinations.
- the distribution process may be executed by, for example, an arithmetic unit 7 different from the arithmetic unit 3.
- each arithmetic unit merges information related to a pair of blocks, and generates information related to one block of the merged higher layer. Therefore, the merge process is realized by a parallel operation of a plurality of arithmetic units. Each arithmetic unit also merges information about merged more block pairs belonging to the same layer and generates information about one block of the merged higher layer. In this way, by repeating the merge processing in parallel and hierarchically, information on one block at the top layer is finally generated.
- One block in the uppermost layer is a block including the entire record.
- the arithmetic unit 3 finally generates one record order number array GOrd 'and block number array BlkNo'.
- the elements of the record order number array GOrd 'are arranged in a predetermined order in this example, ascending order.
- the merge process in the tabular data search process according to the embodiment of the present invention can be realized in exactly the same manner as the inter-block sort process 1 (inter-block merge process) in the tabular data sort process. Not explained.
- the record sequence number of the record belonging to each block is finally determined.
- the process for determining the record sequence number is called a distribution process.
- at least one arithmetic unit or processor core sets the record sequence number corresponding to the subscript i of the block number array BlkNo ′ as the block number BlkNo [i]. Distribution is performed for each represented block, and the distributed record order numbers are arranged in a predetermined order (for example, ascending order) within the block.
- the k-th element of the record sequence number array of block j is GOrd [j] [k]
- the write pointer k for setting the record sequence number in the record sequence number array GOrd [j] is set.
- Offsets [j] it can be described as follows.
- a plurality of arithmetic units or processor cores may share the block number array BlkNo and perform the distribution process. Therefore, the record sequence number array GOrd [j] relating to a certain block is processed by being shared by a plurality of arithmetic units. Then, the record sequence number arrays created by sharing by a plurality of arithmetic units are integrated into one record sequence number array for each block. If the block number array BlkNo ′ is continuously assigned to a plurality of arithmetic units, that is, if a part of the block number array BlkNo ′ in charge of each arithmetic unit is continuous, this integration process Is greatly simplified. This is because it is not necessary to change the order of elements between record sequence number arrays created by different arithmetic units for the same block. That is, the integration process of the record sequence number arrays is achieved by simply concatenating the record sequence number arrays created separately.
- FIG. 37A and 37B are explanatory diagrams of tabulation processing for tabular data.
- FIG. 37A shows tabular data of the tabulation source
- FIG. 37B shows tabular data of tabulation results.
- the tabular data of the aggregation source is formed by three items, School, Class, and Age.
- the tabulation is for each item value (dimension value) of a certain item (dimension) in the tabular data. The quantity (measure) based on the item value of the item is calculated.
- Calculation of a measure means counting the number of measures, calculating the sum of measures, or calculating an average value of measures. Further, the number of dimensions may be two or more as in this example. For example, in the case of tabular data including an item “School”, an item “Cass”, and an item “Age”, the process of obtaining the average value of Age by School / Class is based on the values of “School” and “Class”. This is a tabulation process as a measure.
- FIG. 38A to 38D are explanatory diagrams of tabular data of the summation source expressed by the data structure according to the embodiment of the present invention, which is equivalent to FIG. 37A.
- FIG. 38A shows order information
- Record sequence numbers 0 to 3 are included in block 0
- record sequence numbers 4 to 7 are included in block 1
- record sequence numbers 8 to 11 are included in block 2
- record sequence numbers 12 to 15 are included in block 3.
- the record sequence numbers 16 to 19 are included in the block 4, the record sequence numbers 20 to 23 are included in the block 5, the record sequence numbers 24 to 27 are included in the block 6, and the record sequence numbers 28 to 31 are the block 7 Included in It is obvious that this tabular data can be built on the local memory of the arithmetic unit using the above-described compiling process of the present invention.
- or 39E are explanatory drawings of the tabular data of the total result represented by the data structure by one Embodiment of this invention equivalent to FIG. 37B.
- the tabular data of the tabulation result shown in FIG. 37B is divided into blocks different from the tabular data of the tabulation source shown in FIG. 37A.
- the tabular data of the tabulation source and the tabular data of the tabulation result are different in block division.
- 39A shows order information
- record sequence numbers 0 to 4 are included in block 0
- record sequence numbers 5 and 6 are included in block 1
- record sequence numbers 7 and 8 are included in block 2
- record sequence numbers 9 to 11 are included. It is included in block 3. If a method for dividing tabular data into blocks is defined in this way, it is obvious that the tabular data can be constructed on the local memory of the arithmetic unit using the above-described compiling process of the present invention.
- the size of the tabular data of the aggregation result can be estimated from the number of unique item values in each dimension. Specifically, for example, the number of records of tabular data as a result of aggregation is determined by a product of (the number of unique item values in each dimension). Note that the number of unique item values for each dimension is the value obtained by adding 1 to the maximum value of the global item value sequence number for the item corresponding to the dimension in the tabular table of the aggregation source. Rather, the size of the tabular data of the tabulation result can be determined. Furthermore, it should be noted that the division of the tabular data of the tabulation result can also be determined in advance based on the size of the tabular data of the tabulation result. By using such prior knowledge, tabular data can be tabulated more efficiently.
- FIG. 40 shows a flowchart of a tabular data tabulation method according to an embodiment of the present invention.
- the aggregation method is A step 4002 of expanding the tabular table of the summation source on the local memory of each arithmetic unit; A step 4004 for determining the size of the tabular table of the aggregation result and the block division definition; Step 4006 for creating order information of the tabular table of the aggregation results; Step 4008 for determining dimension division and creating dimension item information; Assigning measure item values to a dimensional space 4010; A step 4012 of counting the item values of the measure; Step 4014 for creating measure item information; Is provided.
- processors if a plurality of processors are accommodated in one arithmetic unit, processing in units of blocks is executed for each processor.
- the size of the virtual global item value array GVL that is, the number of unique item values is considered.
- the virtual global item value array GVL is an array generated by merging element values of the local item value array LVL without duplication.
- the size of this GVL is the maximum value +1 of the global item value sequence number for the dimension item in the tabular table of the tabulation source.
- the maximum value of the global item value sequence number is easily determined from the tabular data of the aggregation source.
- the size of the dimension space (that is, the number of unique item value pairs of the dimension items) is a product of the sizes of the GVL.
- the set of the dimension 1 item value number and the dimension 2 item value number (dimension 1 item value number, dimension 2 item value number) is (0,0), (0,1), (0, 2), (1,0), (1,1), (1,2), (2,0), (2,1), (2,2), (3,0), (3,1) , (3, 2).
- N the size of the dimensional space.
- the tabular data as a result of aggregation is divided into M blocks from the 0th to the (M ⁇ 1) th with reference to the size of the dimensional space.
- the size of each block is determined in consideration of the number of records that can be accommodated in the block.
- block k is in charge of R k rows to R k + 1 ⁇ 1 rows of tabular data as a total result.
- Block 0 0 to 4 rows
- Block 1 5 to 6 rows
- Block 2 7 to 8 rows
- Block 3 9 to 11 rows
- the block division definition is not limited to this example.
- the dimension value belonging to the p-th dimension of the block k can be specified as follows.
- the dimension value that is, the item value does not need to handle the dimension value itself, and each item value can be specified by the global item value sequence number assigned to each item value.
- the global item value sequence number it is possible to handle the dimension value using the integer type regardless of the data type of the item value.
- specifying the dimension value specifically corresponds to specifying the local item value number array VNo and the local item value array LVL.
- the calculation of the local item value number array VNo and the local item value array LVL of the p-th dimension block k can be considered by classifying into the following three cases.
- Case A In this case, the following relation: (R k + 1 ⁇ R k ) ⁇ CSize_high And all item values in the pth dimension are included in the block k.
- Case B In this case, the following relation: (R k + 1 ⁇ R k ) ⁇ CSize_high And ((R k mod CSize_high) div CSize_low) ⁇ ((R k + 1 ⁇ 1) mod CSize_high) div CSize_low)
- the block k is partially included in order from the smallest p-th dimension item value.
- Case C In this case, the following relational expression: (R k + 1 ⁇ R k ) ⁇ CSize_high And ((R k mod CSize_high) div CSize_low)> ((R k + 1 ⁇ 1) mod CSize_high) div CSize_low)
- a part of the item value of the p-th dimension is included in the block k, and changes from a small value to a large value instead of a constant order such as ascending or descending order (not changing monotonously).
- the item value is changed from a large value to a small value in the middle of the block k, and again changed from a small value to a large value.
- div represents integer division, and the fractional part of the quotient is rounded down.
- Mod represents an integer remainder.
- Block 0 assigned range 0 to 4 rows
- Block 1 assigned range 5 to 6 rows
- FIG. 41 shows the first-dimensional and second-dimensional classification results of all the blocks from block 0 to block 3.
- this block is classified as case A.
- case A generally speaking, all values in the pth dimension are present in block k. Since all of the values of the p-th dimension are assigned to the arithmetic processor in charge of the block k, by referring to the assigned values, the number of unique values of the p-th dimension (GVL) Of size). Therefore, the global item value sequence number array GVOrd can be created.
- the arithmetic processor in charge of the block k creates a local item value number array VNo for the pth dimension.
- the local item value number VNo (L mod CSize_high) div CSize_low Can be calculated by:
- VNo [i] ((i + R k ) mod CSize_high) div CSize_low; ⁇
- case C in general, the value of the p-th dimension of block k is separated into ascending part 1 in the first half and ascending part 2 in the second half in block k, and reaches the maximum value at the end of ascending part 1 in the first half, It returns to the minimum value at the beginning of the second ascending part 2.
- the next variable Gap is calculated.
- Gap ((R k mod CSize_high) div CSize_low) ⁇ (((R k + 1 ⁇ 1) mod CSize_high) div CSize_low) ⁇ 1
- the end of the intermediate section matches the end of the global item value sequence number array GVOrd.
- the arithmetic processor in charge of the block k creates a local item value number array VNo for the pth dimension.
- the item values included in the block k are all values between the minimum value and the first intermediate value, and between the second intermediate value and the maximum value among the entire item values. Is all the values.
- the block k does not include an item value between the first intermediate value and the second intermediate value among the entire item values.
- the local item value number array VNo includes, in order from the top, the item value number corresponding to the second intermediate value to the item value number corresponding to the maximum value continuously.
- the item value number corresponding to the minimum value to the item value number corresponding to the first intermediate value are stored.
- VNo [0] 1
- VNo [1] 0 It becomes.
- a general calculation method of the local item value number array VNo is as follows.
- block 2 is classified as case B.
- the p-th dimension value of block k generally appears in ascending order.
- the minimum value and the maximum value of the global item value sequence number may be determined.
- VNo [i] (((i + R k ) mod CSize_high) div CSize_low) ⁇ Min (GVOrd) ⁇
- the local item value number array VNo and the global item value order number array GVOrd are obtained for each block with respect to the second dimension.
- each arithmetic unit creates on the local memory a block number array BlkNo having the same size as the global item value sequence number array GVOrd created by the local item information creation processing of tabular data as a result of aggregation.
- This block number array is filled with the block number indicating the record in charge of the unit.
- each arithmetic unit prepares a local item value array LVL of tabular data of the aggregation source.
- Each arithmetic processing unit uses the local item value array LVL of the tabular data of the summation source, the block number array BlkNo of the tabular data of the tabulation result, and the global item value sequence number array GVOLd as local data, and merges the first stage. It is transmitted to the arithmetic unit that executes processing.
- the local data prepared in the block by each arithmetic unit is then merged between the blocks.
- merging between blocks data prepared in each block are merged, and new merged data is generated as a whole.
- the local item value array LVL of the tabular data of the summation source is merged in ascending order of the local item values, and the elements of the global item value sequence number array GVOrd of the tabular data of the tabulation result and the block number array A set of BlkNo elements is merged using the global item value sequence number as a key.
- the item information related to the tabular data of the tabulation source and the item value information related to the tabular data of the tabulation result are merged independently.
- the merge process in the tabular data search process according to the embodiment of the present invention can be realized by the same hierarchical structure as the hierarchical structure shown in FIG.
- the merge processing of the block 0 and the block 1 by the arithmetic unit 0 is performed as the first-stage merge processing.
- the merge process of block 2 and block 3 by 2 the merge process of block 4 and block 5 by the arithmetic unit 4, and the merge process of block 6 and block 7 by the arithmetic unit 6 are executed.
- the second stage merge processing is realized by the merge processing of blocks 0-1 and 2-3 by the arithmetic unit 1, and the merge processing of blocks 4-5 and 6-7 by the arithmetic unit 5.
- the operation block 3 executes the merge processing of block 0-3 and block 4-7.
- the arithmetic units in charge of the merge process in each pipeline stage are not limited to the above combinations.
- the distribution process may be executed by, for example, an arithmetic unit 7 different from the arithmetic unit 3.
- each arithmetic unit merges information related to a pair of blocks, and generates information related to one block of the merged higher layer. Therefore, the merge process is realized by a parallel operation of a plurality of arithmetic units. Each arithmetic unit also merges information about merged more block pairs belonging to the same layer and generates information about one block of the merged higher layer. In this way, by repeating the merge processing in parallel and hierarchically, information on one block at the top layer is finally generated.
- One block in the uppermost layer is a block including the entire record.
- Arithmetic unit 3 finally has a local item value number array (that is, a virtual global item value number array) related to the tabular data of the aggregation source, and one global item value order related to the tabular data of the aggregation result.
- a number array GVOrd and a block number array BlkNo are generated.
- the item information related to the tabular data of the total result is arranged in the order of global item value sequence numbers (in this example, ascending order).
- the merge process in the tabular data tabulation process according to the embodiment of the present invention can be realized in exactly the same manner as the inter-block sort process 1 (inter-block merge process) in the tabular data sort process. Not explained.
- a local item value array LVL included in each block is created.
- the process for generating the local item value array is also called a distribution process.
- at least one arithmetic unit for example, arithmetic unit PE-7 in this example
- arithmetic unit PE-7 virtually assigns the item value designated by the global item value sequence number corresponding to the subscript i of the block number array BlkNo. It is taken out from the global item value array LVL, and this item value is distributed to each block designated by the block number.
- the arithmetic unit that receives the distributed item value sequentially stores the received item value in the local item value array LVL on the local memory of the arithmetic unit.
- the kth element of the local item value array of block j is set to LVL [j] [k], and a write pointer for setting the item value in the local item value array LVL [j] [k] If k is Offsets [j] and the virtual global item value array is GVL (to distinguish it from the local item value array for each block), it can be described as follows.
- a plurality of arithmetic units may be in charge of distribution processing.
- the item information related to the dimension of aggregation that is, the local item value number array VNo, the global item value sequence number array GOrd, and the local item value array LVL, for example, are operations that share and hold tabular data of the aggregation results.
- the unit acquires the global item value sequence number array GVOrd and the local item value array VL of the tabular data of the tabulation source held by the other arithmetic units from the other arithmetic units, so that each arithmetic unit becomes independent. You may get it.
- a global item value array GVL is defined for the measure item.
- the global item value array GVL is a virtual item value array obtained by merging item values existing in each block without duplication.
- “virtual” means that it is not necessary to actually create it.
- the data type of the virtual global item value array GVL is the same as the data type of the local item value array LVL, and has various data types such as a character string type, an integer type, and a floating point type.
- the item values stored in the global item value array GVL are arranged in a predetermined order (for example, ascending order). As described above, the stored item values do not overlap. Further, the size of the global item value array GVL is the maximum value +1 of the stored values of the global item value sequence number array GVOLd existing in each block.
- Measure is created by aggregating values for each set of dimension values. Therefore, the measure creation process sorts a set of dimension values, that is, a set of item value numbers corresponding to the dimension values, in ascending order of the item values with respect to the tabular data of the aggregation source. The measure value is calculated, and item information is created for each item from the calculated measure value.
- 44A to 44J are explanatory diagrams of sorting processing of a set of dimension values for creating a measure.
- this sort processing first, the item value access information array LOrd is sorted with respect to the second dimension having a low priority, and then the item value access information array LOrd is sorted again with respect to the first dimension having a high priority.
- the example of the block 0 of the tabular data of a summation origin is demonstrated.
- the sorting process uses a well-known counting sort.
- 44A to 44D are explanatory diagrams of the process of counting up the local item value numbers.
- the count array Count generated by the count-up is accumulated and a cumulative number array Aggr is created.
- the array Aggr is created by shifting the elements of the Count array backward by one and making the total number.
- the element value access information array LOrd is transferred by transferring the elements of the item value access information array LOrd using the elements of the cumulative number array Aggr as pointers. 'Is created.
- FIG. 44H shows an item value access information array LOrd 'generated by the sort processing for the second dimension.
- the item value access information array LOrd ′ is sorted with respect to the first dimension having a high priority
- the item value access information array LOrd ′′ is obtained.
- the measure item value array storing the dimension number sequence number array CubeAdr and the measure value corresponding to the dimension space sequence number.
- the sequence number in the dimension space is a sequence number assigned to the set of dimension value item value numbers in the order of dimension value sorting.
- the dimension space order number is calculated by (the value of the first dimension GVOrd) ⁇ (the product of the sizes of the virtual global item value array of dimension 2) + (the value of the second dimension GVOrd).
- FIG. 45 shows the creation processing of the sequence number array in the dimensional space and the measure item value array.
- the computation unit calculates an aggregate value for each order number in the dimension space.
- the number of occurrences of the measure value Count and the sum Sum of the measure values are calculated.
- FIG. 46 shows a process of creating a measure appearance count array Count and a measure sum array Sum from the order number array CubAdr in the dimensional space and the measure item value array wVL. In this example, if the value of CubeAdr does not overlap, 1 is stored in the Count array, and the value of wVL is stored in Sum.
- the array Count and the array Sum are merged between a plurality of blocks using the value of CubeAdr ′ as a key.
- the merge process is realized by a pipeline process performed by a merge unit of a plurality of arithmetic units in a tournament manner.
- the order number array CubeAdr ′ in the dimension space, the appearance count array Count, and the sum array Sum are used as local data, and the appearance count and sum associated with the same order number in the dimension space are merged.
- the elements of the local data are arranged in ascending order of the sequence numbers in the dimension space.
- the appearance count array Count and the sum array Sum merged by the tournament method are converted into the tabular data item information of the tabulation result using the order information of the tabular data of the tabulation result already created.
- 48A shows the order information of the tabular data of the tabulation results
- FIG. 48B is an explanatory diagram of the compile process regarding the appearance count array Count
- FIG. 48C is an explanatory diagram of the compile process regarding the sum array Sum.
- the compilation process has already been described in this specification and will not be described in further detail.
- the tabulation data of the tabulation results shown in FIGS. 39D and 39E is created by the above tabulation processing.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Hardware Design (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Multi Processors (AREA)
Abstract
分散メモリ型マルチプロセッサは、専用のローカルメモリ及びプロセッサを含み、相互にデータを送受するため通信接続されている複数台の演算ユニットを備え、一連のデータが複数個のブロックに分割され、複数台の演算ユニットのパイプライン処理によって操作される。演算ユニットは、前のパイプライン段にある1台以上の演算ユニットからそれぞれのローカルデータを受信し、1つのさらなるローカルデータに変換し、後のパイプライン段にある1台の演算ユニットへ送信し、最終的に1つのグローバルデータを生成するようにトーナメント方式で動的に接続可能であり、少なくとも1台のいずれかの演算ユニットがブロックの番号に基づいてグローバルデータを複数台の演算ユニットへ割り当てる。
Description
本願の開示は、データ項目に対応した項目値を含むレコードの配列として表される表形式データを複数台の演算ユニットによって分担して操作する方法、特に、表形式データを構築し、表形式データをソートし、表形式データから特定のデータを検索し、又は、表形式データを集計する方法に関係する。
本願の開示は、データ項目に対応した項目値を含むレコードの配列として表される表形式データを複数台の演算ユニットによって分担して操作する分散メモリ型マルチプロセッサ、特に、表形式データを構築し、表形式データをソートし、表形式データから特定のデータを検索し、又は、表形式データを集計する分散メモリ型マルチプロセッサにも関係する。
さらに、本願の開示は、上記方法を分散メモリ型マルチプロセッサに実行させるためのプログラム、コンピュータプログラムプロダクト、及び、コンピュータプログラムが記録された記録媒体に関係する。
従来、産業上の様々な分野において、大規模データを高速に処理することが求められている。大規模データの処理は、キャッシュやプリフェッチなどによるメモリアクセスの高速化、メモリ自体の高速化、及び、プロセッサの並列化のような演算処理の高速化、といったハードウェア技術の開発、ならびに、データ処理アルゴリズムの開発によって、高速化され続けている。
本発明者は、大規模データを高速に処理するための基本的なデータ処理アルゴリズム、たとえば、特許文献1に記載されているような、「オンメモリデータ処理アルゴリズム」を提案している。この技術は、表形式データを、従来のようなレコード(すなわち、行)単位ではなく、項目(すなわち、列)単位に成分分解するという考え方に基づいている。より具体的には、表形式データが、(1)レコード順を表す配列と、(2)項目に属する一意の項目値が所定の順序(たとえば、昇順)に並べられた値テーブルと、(3)各レコードに対応する項目値が値テーブルに格納されている位置情報を表す配列とからなるデータ構造によって表現されている。このようなデータ構造を採用することにより、表形式データの検索、ソート、マージ、ジョイン等の処理が高速に実現されている。
さらに、本発明者は、分散メモリ型のマルチプロセッサシステム及び共有メモリ型のマルチプロセッサシステムのようなプロセッサの並列化に対応した種々のオンメモリデータ処理アルゴリズムを提案している。たとえば、分散メモリ型のマルチプロセッサシステムに対応した検索・ソートアルゴリズムが特許文献2に記載され、集計アルゴリズムが特許文献3に記載されている。さらに、共有メモリ型のマルチプロセッサシステムに対応した効率的なソートアルゴリズムが特許文献4に記載されている。
特許文献2及び3に記載されている分散メモリ型のマルチプロセッサシステム向けの検索・ソート及び集計は、特に、超並列プロセッサ(MPP)アーキテクチャに適合するように設計されている。特許文献2及び3に記載されている技術では、ある特定のプロセッサモジュールがある処理を行うとき、他のすべてのプロセッサモジュールによって保持されているデータを受信し、受信されたデータとこの特定のプロセッサモジュールに保持されているデータとの間で比較演算を行うことがある。この比較演算のコストは、プロセッサモジュールの台数の2乗のオーダーであるため、並列化の程度が高くなると比較演算のコストも増加するという関係にある。
一方、特許文献4に記載されている共有メモリ型のマルチプロセッサシステム向きのソートは、特に、対称型マルチプロセッサ(SMP)アーキテクチャに適合するように設計されている。共有メモリ型マルチプロセッサシステムでは、多数のプロセッサが同一のメモリ(共有メモリ)に同時にアクセスしようとすることが頻繁に発生し、共有メモリへのメモリアクセス性能がシステム全体の性能を左右することがある。
ところで、近年、たとえば、非特許文献1に記載されているような、不均一メモリアクセス(NUMA)アーキテクチャを採用するコンピュータシステムが市販されている。NUMAタイプのコンピュータシステムは、リモートメモリアクセスが可能ではあるが、共有メモリを具備していないという点で、分散メモリ型のマルチプロセッサシステムである。特許文献2及び3に記載されている技術は、リモートメモリアクセスを利用しなければ、そのままこのNUMAタイプのコンピュータシステムに適用可能である。勿論、プロセッサ間通信の一部をリモートメモリアクセスによって置き換えるように、特許文献2及び3に記載されている技術を拡張することも可能である。
このようなNUMAタイプのプロセッサを含む分散メモリ型マルチプロセッサでは、メモリアクセス性能がシステム全体の性能に与える影響は共有メモリ型コンピュータよりも小さいと考えられる。したがって、プロセッサ自体の演算処理能力の向上がメモリアクセス性能の向上を上回る、という状況においては、大規模なデータ、特に、大規模な表形式データの操作に、分散メモリ型マルチプロセッサを利用する利点がある。
W.H.Inmon、K.Rudin、C.K.Buss、R.Sousa著、鈴木健司、三船洋一、室住正晴訳、「データウェアハウス・パフォーマンス -システム構築・管理技法-」、共立出版、2002年6月15日、p.148-151 国際公開第00/10103号公報
国際公開第2005/041066号公報
国際公開第2005/041067号公報
国際公開第2006/126467号公報
W.H.Inmon、K.Rudin、C.K.Buss、R.Sousa著、鈴木健司、三船洋一、室住正晴訳、「データウェアハウス・パフォーマンス -システム構築・管理技法-」、共立出版、2002年6月15日、p.148-151
したがって、分散メモリ型マルチプロセッサを利用して大規模な表形式データを高速に処理するためには、並列化の程度と共にコストが増加するような演算を除去するか、又は、少なくともできる限り削減することが重要である。
また、分散メモリ型マルチプロセッサを構成する各演算ユニットの専用のローカルメモリの記憶容量は限定されているので、各演算ユニットのローカルメモリにデータが蓄積されることなく、各演算ユニットによって処理されたデータが次の処理のため別の演算ユニットへ受け渡されることが重要である。
さらに、分散メモリ型マルチプロセッサの演算ユニット間のデータ通信のコストを低下させるためには、各演算ユニットがある処理を実現するとき、他のすべての演算ユニットからのデータを使用することを必要とされず、限定された台数の他の演算ユニット、たとえば、2台の他の演算ユニットからのデータを使用するように構成されていることが好ましい。
したがって、各演算ユニットの演算量と、各演算ユニットに保持されるデータ量と、演算ユニット間のデータ通信量ができる限り削減されるように大規模データを操作する分散メモリ型マルチプロセッサを提供できることが好ましい。
また、大規模なデータを操作する分散メモリ型マルチプロセッサにおいて、分散メモリ型マルチプロセッサの性能を十分に活かすため、各演算ユニットの演算量と、各演算ユニットに保持されるデータ量と、演算ユニット間のデータ通信量ができる限り削減されるようにデータを処理する方法を提供できることが好ましい。
さらに、大規模データを操作する分散メモリ型マルチプロセッサにおいて、分散メモリ型マルチプロセッサの性能を十分に活かすため、各演算ユニットの演算量と、各演算ユニットに保持されるデータ量と、演算ユニット間のデータ通信量ができる限り削減されるようにデータを処理するプログラム、コンピュータプログラムプロダクト、及び、コンピュータプログラムが記録された記録媒体を提供できることが好ましい。
本発明の一実施形態によれば、専用のローカルメモリ及びプロセッサを含み、相互にデータを送受するため通信接続されている複数台の演算ユニットを備え、一連のデータが上記複数台の演算ユニットに関連付けられた複数個のブロックに分割されて上記複数台の演算ユニットのそれぞれの専用のローカルメモリに保持され、上記一連のデータが上記複数台の演算ユニットのパイプライン処理によって操作される、分散メモリ型マルチプロセッサであって、
各演算ユニットが、前のパイプライン段にある1台以上の演算ユニットからそれぞれのローカルデータを受信し、受信された少なくとも2つのローカルデータを1つのさらなるローカルデータに変換し、上記さらなるローカルデータを後のパイプライン段にある1台の演算ユニットへ送信するマージ手段を含み、
前記複数台の演算ユニットのマージ手段が最終的に1つのグローバルデータを生成するようにトーナメント方式で動的に接続可能であり、
少なくとも1台のいずれかの演算ユニットが、前記複数個のブロックに対応するブロック番号に基づいて、前記グローバルデータを分割し前記複数台の演算ユニットへ割り当てる分配手段を含む、
分散メモリ型マルチプロセッサが提供される。
各演算ユニットが、前のパイプライン段にある1台以上の演算ユニットからそれぞれのローカルデータを受信し、受信された少なくとも2つのローカルデータを1つのさらなるローカルデータに変換し、上記さらなるローカルデータを後のパイプライン段にある1台の演算ユニットへ送信するマージ手段を含み、
前記複数台の演算ユニットのマージ手段が最終的に1つのグローバルデータを生成するようにトーナメント方式で動的に接続可能であり、
少なくとも1台のいずれかの演算ユニットが、前記複数個のブロックに対応するブロック番号に基づいて、前記グローバルデータを分割し前記複数台の演算ユニットへ割り当てる分配手段を含む、
分散メモリ型マルチプロセッサが提供される。
分散メモリ型マルチプロセッサは、専用のローカルメモリを含み、相互にデータを送受するため通信接続されている複数台の演算ユニットを備え、複数台の演算ユニットがパイプライン処理を実現するように構成されている装置である。演算ユニットはノードと呼ばれることもある。
また、演算ユニット内のプロセッサは、シングルコアプロセッサでもよく、又は、2つ以上のプロセッサコアを含むマルチコアプロセッサでもよい。シングルコアプロセッサの場合、一連のデータから得られる各ブロックは演算ユニット毎に、すなわち、演算ユニット内のシングルコアプロセッサに対応付けられる。一方、マルチコアプロセッサの場合、演算ユニット内のローカルメモリは2つ以上のプロセッサコアの間で共有メモリとして用いられる。また、この場合、一連のデータから得られる各ブロックは、好ましくは、演算ユニット内のプロセッサコア毎に対応付けられる。よって、複数のブロックが1台の演算ユニットに関連付けられることになる。しかし、ある特定の1個のブロックには、必ず1台の演算ユニットが対応付けられているので、ブロック番号に基づいて演算ユニットを特定することが可能である。よって、以下の説明中、演算ユニットに含まれているプロセッサは、シングルコアプロセッサ又はマルチコアプロセッサのいずれでも構わない。
本発明の一実施形態によれば、一連のデータは、複数個のブロックに分割され、ブロックにはブロック番号が割り当てられる。このブロック番号は、あるデータが複数台の演算ユニットのパイプライン処理によってマージされるときに、コピーされ、マージ後のデータに対応付けられる。よって、このデータに対応するブロック番号を参照することにより、マージ後のデータを元のブロックに関連付けられた演算ユニットへ分配することが可能である。このようにデータにブロック番号を対応付けることによって、各演算プロセッサが他のすべての演算プロセッサからのデータを受信する必要性がなくなるので、並列化の程度が増加しても比較演算のような演算のコストの増加が低減され、かつ、演算ユニット間のデータ通信のコストも抑制される。さらに、データはパイプライン処理されるので、いずれかの演算プロセッサの専用のローカルメモリに大量のデータが蓄積することが回避される。
各演算ユニットのマージ手段は、入力側で1台以上の演算ユニットのマージ手段に接続され、出力側で1台の演算ユニットのマージ手段に接続され、1台以上の演算ユニットから入力された少なくとも2つのローカルデータを1つのローカルデータにマージして、1台の演算ユニットへ出力する。これにより、演算ユニットのマージ手段をトーナメント方式で接続することにより、最終的に1つのローカルデータが生成される。演算ユニットのマージ手段相互の接続は固定ではなく、動的に接続可能であるため、トーナメント表の形や、トーナメント表に配置される演算ユニットを処理対象に応じて変更することが可能である。各演算ユニットのマージ手段は、1台以上の演算ユニットからの3つ以上のローカルデータを1つのローカルデータにマージするように構成されることもある。さらに、演算ユニット間のデータ通信量を削減するため、入力側の2台の演算ユニットのうちの一方と、入力側からのローカルデータをマージするマージ手段を含む演算ユニットとが同一の演算ユニットであっても構わない。
また、演算ユニットのプロセッサがマルチコアプロセッサであるならば、トーナメント表の第1階層のマージ処理は同一の演算ユニット内のプロセッサコアの間で行われることがある。勿論、この場合でも、第1階層のマージ処理が異なる演算ユニットからのローカルデータを用いて実行されても構わない。
本発明の一実施形態によれば、上記一連のデータはデータ項目に対応した項目値を含むレコードの配列として表現される表形式データである。上記複数個のブロックに分割された上記表形式データのうち各演算ユニットに割り当てられたレコード、すなわち、担当レコードは、レコードの順序に依存する順序情報と各データ項目に依存する項目情報とに分離されている。表形式データを順序情報と項目情報とに分離すると、表形式データに検索やソートを適用したときに、順序情報だけが影響を受け、項目情報は検索やソートの適用前の状態を維持する。これにより、演算コスト、データ通信コストが大幅に軽減されることになる。
また、本発明の一実施形態によれば、上記順序情報は、上記表形式データ内で上記担当レコードを識別するレコード番号、すなわち、原始レコード位置番号を上記ブロック内での上記担当レコードのレコード順序番号の順番に格納するレコード順序番号配列、及び、上記担当レコードに含まれる上記項目値にアクセスする項目値アクセス情報を上記レコード順序番号の順番に格納する項目値アクセス情報配列により形成されている。レコード順序番号配列と項目値アクセス情報配列は、整数型配列であり、サイズが等しい。レコード順序番号配列の各要素は、この要素に対応するレコードが表形式データ全体の中での位置、すなわち、原始レコード位置番号を表している。項目値アクセス情報配列の各要素は、順序情報と項目情報を結合するため、項目情報内の特定の配列、すなわち、後述のローカル項目値番号配列を指すインデックスとして用いられる。
一方、上記項目情報は、上記担当レコードに含まれる一意の項目値が所定の順序で格納されているローカル項目値配列、上記担当レコードに含まれる上記項目値が上記ローカル項目値配列内に格納されている位置を指定するローカル項目値番号が上記担当レコードの上記原始レコード位置番号の順番に格納されているローカル項目値番号配列、及び、上記表形式データの全体で上記所定の順序に基づいて上記ローカル項目値配列中の上記一意の項目値に割り当てられた順序番号が格納されているグローバル項目値順序番号配列により形成されている。ローカル項目値番号配列は、担当レコードのレコード数と同じサイズを有し、ローカル項目値番号配列中の要素は、担当レコード中のあるレコードに含まれる項目値を指定するように、ローカル項目値配列を指すインデックスとして用いられる。ローカル項目値配列は、担当レコードの全レコードに含まれる一意の項目値が所定の順序(たとえば、昇順又は降順)で配置された配列である。ローカル項目値配列は、項目値自体を格納する配列であるため、整数型、浮動小数点型、文字列型など様々なデータ型を取り得る。グローバル項目値順序番号配列は、表形式データの全体に保持されている項目値の中での、ローカル項目値配列に格納されている各項目値の順位を、ローカル項目値配列に格納されている項目値の順番に格納する配列である。各項目値の順位は、たとえば、昇順、又は、降順のような所定の順序に基づいて決定される。
本発明の一実施形態によれば、上記の成分分解の考え方と、ブロック番号の考え方と、パイプライン処理の考え方とを組み合わせて、表形式データをメモリ上に構築する分散メモリ型マルチプロセッサが提供される。
表形式データを分散メモリ型マルチプロセッサのメモリ上に構築する処理、すなわち、コンパイル処理は、(i)レコード順序番号配列及び項目値アクセス情報配列を作成する順序集合作成処理と、(ii)ブロック内でローカル項目値番号配列及びローカル項目値配列を作成するブロック内コンパイル処理と、(iii)ブロック間でグローバル項目値順序番号配列を作成するブロック間コンパイル処理とにより構成される。
この表形式データのコンパイル処理を実現するために、本発明の一実施形態によれば、表形式データの(複数又は多数の)レコードは、ブロック番号によって識別されるブロックに分割される。本実施形態によれば、このブロックは、初期的には、このブロックに含まれるレコードの処理を担当する演算ユニットに関連付けられている。各演算ユニットが担当するレコードは、本書中で、担当レコードと呼ばれる。各演算ユニットには、このように定義された担当レコードが外部装置から送信される。外部装置は、外部記憶装置でもよく、又は、外部の演算ユニット若しくは外部のコンピュータでもよい。
各演算ユニットは、担当レコードを認識するために、担当レコードのレコード順序番号(初期的には原始レコード位置番号と一致)がレコード順序番号の順番に格納されているレコード順序番号配列を生成する。原始レコード位置番号とは、元の表形式データの中で各レコードが収容されている位置、たとえば、行番号に対応する。さらに、各演算ユニットは、担当レコードに含まれる項目値にアクセスするため、項目値アクセス情報がレコード順序番号の順番に格納されている項目値アクセス情報配列を生成する。
各演算ユニットの担当レコードに含まれる項目値は、データ項目毎に各演算ユニットが項目値アクセス情報配列を用いてアクセスすることができるように、各演算ユニットのためのローカル項目値配列に格納される。ローカル項目値配列には、データ項目毎に、一意の項目値が所定の順序(昇順又は降順)に格納されている。また、各演算ユニットが項目値アクセス情報配列を用いて担当レコードに含まれる項目値にアクセスするため、データ項目毎に、担当レコードに含まれる項目値を特定するローカル項目値番号が原始レコード位置番号の順番に格納されているローカル項目値番号配列が生成される。さらに、各演算ユニットによって保持されているローカル項目値を表形式データ全体に含まれているグローバル項目値の中で特定できるようにするため、表形式データの全体に含まれているグローバル項目値が所定の順序に格納される仮想的なグローバル項目値配列中での、ローカル項目値の位置を指定するグローバル項目値順序番号配列が生成される。生成された各種の配列は演算ユニットの専用のローカルメモリに記憶されている。
以上の考え方に従って、本発明の一実施形態によれば、
各演算ユニットが、
上記分散メモリ型マルチプロセッサに接続されている外部装置からこの演算ユニットに割り当てられた上記担当レコードを受信する手段と、
受信された上記担当レコードから、上記レコード順序番号配列及び上記項目値アクセス情報配列を生成し、この演算ユニットの上記専用のローカルメモリに格納する手段と、
項目毎に、上記担当レコード中の項目値を上記所定の順序でソートすることにより、上記ローカル項目値配列、及び、上記ローカル項目値番号配列を生成し、この演算ユニットの上記専用のローカルメモリに格納するローカルコンパイル手段と、
項目毎に、上記ローカル項目値配列、上記担当レコードの範囲内で上記所定の順序に基づいて上記ローカル項目値配列に含まれる上記一意の項目値に割り当てられた順序番号が格納されているローカル項目値順序番号配列、及び、上記ローカル項目値順序番号配列中の上記順序番号に関連した上記担当レコードを示す上記ブロック番号を含むブロック番号配列を、上記ローカルデータとして、この演算ユニットの後のパイプライン段にある演算ユニットへ送信する手段と、
を含み、
各演算ユニットの上記マージ手段が、前のパイプライン段からの少なくとも2つのローカルデータに含まれている少なくとも2つのローカル項目値配列中の項目値を上記所定の順序でマージすることにより、上記少なくとも2つのローカルデータを、さらなるブロック番号配列、さらなるローカル項目値順序番号配列及びさらなるローカル項目値配列により形成された1つのローカルデータに変換する手段を含み、
上記分配手段が、最終的に生成されたさらなるローカル項目値順序番号配列に格納されている順序番号を、対応する最終的に生成されたさらなるブロック番号配列に格納されているブロック番号に関連付けられた演算ユニットへ送信する手段を含み、
各演算ユニットが、上記送信された順序番号を上記グローバル項目値順序番号配列に順次に格納する手段をさらに含む、
分散メモリ型マルチプロセッサが提供される。
各演算ユニットが、
上記分散メモリ型マルチプロセッサに接続されている外部装置からこの演算ユニットに割り当てられた上記担当レコードを受信する手段と、
受信された上記担当レコードから、上記レコード順序番号配列及び上記項目値アクセス情報配列を生成し、この演算ユニットの上記専用のローカルメモリに格納する手段と、
項目毎に、上記担当レコード中の項目値を上記所定の順序でソートすることにより、上記ローカル項目値配列、及び、上記ローカル項目値番号配列を生成し、この演算ユニットの上記専用のローカルメモリに格納するローカルコンパイル手段と、
項目毎に、上記ローカル項目値配列、上記担当レコードの範囲内で上記所定の順序に基づいて上記ローカル項目値配列に含まれる上記一意の項目値に割り当てられた順序番号が格納されているローカル項目値順序番号配列、及び、上記ローカル項目値順序番号配列中の上記順序番号に関連した上記担当レコードを示す上記ブロック番号を含むブロック番号配列を、上記ローカルデータとして、この演算ユニットの後のパイプライン段にある演算ユニットへ送信する手段と、
を含み、
各演算ユニットの上記マージ手段が、前のパイプライン段からの少なくとも2つのローカルデータに含まれている少なくとも2つのローカル項目値配列中の項目値を上記所定の順序でマージすることにより、上記少なくとも2つのローカルデータを、さらなるブロック番号配列、さらなるローカル項目値順序番号配列及びさらなるローカル項目値配列により形成された1つのローカルデータに変換する手段を含み、
上記分配手段が、最終的に生成されたさらなるローカル項目値順序番号配列に格納されている順序番号を、対応する最終的に生成されたさらなるブロック番号配列に格納されているブロック番号に関連付けられた演算ユニットへ送信する手段を含み、
各演算ユニットが、上記送信された順序番号を上記グローバル項目値順序番号配列に順次に格納する手段をさらに含む、
分散メモリ型マルチプロセッサが提供される。
本発明の一実施形態によれば、上記の成分分解の考え方と、ブロック番号の考え方と、パイプライン処理の考え方とを組み合わせて、所定の項目に含まれる項目値をキーとして、表形式データをソートする分散メモリ型マルチプロセッサが提供される。
表形式データのソート処理は、ソートされたレコード順序番号配列及びソートされた項目値アクセス情報配列を作成する処理である。このソート処理は、(i)ブロック内で、カウンティングソートを実行し、新しい項目値アクセス情報配列を作成し、後の処理で使用されるグローバル項目値順序番号配列及びレコード順序番号配列を作成するブロック内ソート処理と、(ii)前の処理で作成されたグローバル項目値順序番号配列及びレコード順序番号配列を、ブロック番号配列と共にトーナメント方式でマージするブロック間マージ処理と、(iii)マージされたブロック番号配列から新しいレコード順序番号配列を作成するブロック間分配処理とにより構成される。
この表形式データのソート処理を実現するために、本発明の一実施形態によれば、
各演算ユニットが、
所定の項目に関して、上記担当レコードを含むブロック毎に、上記ローカル項目値番号をキーとして上記レコード順序番号配列、上記項目値アクセス情報配列及び上記グローバル項目値順序番号配列にソートを適用し、これによって、ローカルソートされたレコード順序番号配列、ローカルソートされた項目値アクセス情報配列及びローカルソートされたグローバル項目値順序番号配列を生成するローカルソート手段と、
上記所定の項目に関して、上記ローカルソートされたグローバル項目値順序番号配列、上記ローカルソートされたレコード順序番号配列、及び、上記ローカルソートされたレコード順序番号配列に関連した上記担当レコードを示す上記ブロック番号を含むブロック番号配列を、上記ローカルデータとして、この演算ユニットの後のパイプライン段にある演算ユニットへ送信する手段と、
を含み、
各演算ユニットの上記マージ手段が、前のパイプライン段からの少なくとも2つのローカルデータに含まれている上記ローカルソートされたグローバル項目値順序番号配列と上記ローカルソートされたレコード順序番号配列との組を所定の順序でマージすることにより、上記少なくとも2つのローカルデータを、さらなるグローバル項目値順序番号配列、さらなるレコード順序番号配列及びさらなるブロック番号配列により形成された1つのローカルデータに変換する手段を含み、
上記分配手段が、最終的に生成された上記さらなるブロック番号配列に含まれているブロック番号の上記さらなるブロック番号配列中での順序番号を、上記ブロック番号に関連付けられた演算ユニットへ送信する手段を含み、
各演算ユニットが、上記送信された順序番号を上記レコード順序番号配列に順次に格納する手段をさらに含む。
各演算ユニットが、
所定の項目に関して、上記担当レコードを含むブロック毎に、上記ローカル項目値番号をキーとして上記レコード順序番号配列、上記項目値アクセス情報配列及び上記グローバル項目値順序番号配列にソートを適用し、これによって、ローカルソートされたレコード順序番号配列、ローカルソートされた項目値アクセス情報配列及びローカルソートされたグローバル項目値順序番号配列を生成するローカルソート手段と、
上記所定の項目に関して、上記ローカルソートされたグローバル項目値順序番号配列、上記ローカルソートされたレコード順序番号配列、及び、上記ローカルソートされたレコード順序番号配列に関連した上記担当レコードを示す上記ブロック番号を含むブロック番号配列を、上記ローカルデータとして、この演算ユニットの後のパイプライン段にある演算ユニットへ送信する手段と、
を含み、
各演算ユニットの上記マージ手段が、前のパイプライン段からの少なくとも2つのローカルデータに含まれている上記ローカルソートされたグローバル項目値順序番号配列と上記ローカルソートされたレコード順序番号配列との組を所定の順序でマージすることにより、上記少なくとも2つのローカルデータを、さらなるグローバル項目値順序番号配列、さらなるレコード順序番号配列及びさらなるブロック番号配列により形成された1つのローカルデータに変換する手段を含み、
上記分配手段が、最終的に生成された上記さらなるブロック番号配列に含まれているブロック番号の上記さらなるブロック番号配列中での順序番号を、上記ブロック番号に関連付けられた演算ユニットへ送信する手段を含み、
各演算ユニットが、上記送信された順序番号を上記レコード順序番号配列に順次に格納する手段をさらに含む。
本発明の一実施形態によれば、上記の成分分解の考え方と、ブロック番号の考え方と、パイプライン処理の考え方とを組み合わせて、所定の検索条件を満たすレコードを表形式データから検索する分散メモリ型マルチプロセッサが提供される。
表形式データの検索処理は、検索前の表形式データから、順序情報、すなわち、新たなレコード順序番号配列及び新たな項目値アクセス情報配列を作成する処理である。この検索処理は、(i)ブロック内でローカル項目値配列に格納されている項目値が検索条件に一致するかどうかを判定し、検索条件に一致する項目値に対応するレコード順序番号及び項目値アクセス情報を抽出するローカル処理と、(ii)各ブロックで抽出されたレコード順序番号配列をブロック番号配列と共に所定の順序でマージし、マージされたブロック番号配列に従って最終的な新たなレコード順序番号配列を作成するグローバル処理とにより構成される。
この表形式データの検索処理を実現するために、本発明の一実施形態によれば、
各演算ユニットが、
所定の項目に関して、上記担当レコードを含むブロック毎に、検索条件に一致する項目値を含むレコードに対応する新たなレコード順序番号配列及び新たな項目値アクセス情報配列を生成し、上記項目値アクセス情報配列を上記新たな項目値アクセス情報配列で置き換えるローカル検索手段と、
上記所定の項目に関して、上記新たなレコード順序番号配列、及び、上記新たなレコード順序番号配列に関連した上記担当レコードを示す上記ブロック番号を含むブロック番号配列を、上記ローカルデータとして、この演算ユニットの後のパイプライン段にある演算ユニットへ送信する手段と、
を含み、
各演算ユニットの上記マージ手段が、前のパイプライン段からの少なくとも2つのローカルデータに含まれている上記新たなレコード順序番号配列と上記ブロック番号配列との組を所定の順序でマージすることにより、上記少なくとも2つのローカルデータを、さらなるレコード順序番号配列及びさらなるブロック番号配列により形成された1つのローカルデータに変換する手段を含み、
上記分配手段が、最終的に生成された上記さらなるブロック番号配列に含まれているブロック番号の上記さらなるブロック番号配列中での順序番号を、上記ブロック番号に関連付けられた演算ユニットへ送信する手段を含み、
各演算ユニットが、上記送信された順序番号を上記新たなレコード順序番号配列に順次に格納する手段をさらに含む。
各演算ユニットが、
所定の項目に関して、上記担当レコードを含むブロック毎に、検索条件に一致する項目値を含むレコードに対応する新たなレコード順序番号配列及び新たな項目値アクセス情報配列を生成し、上記項目値アクセス情報配列を上記新たな項目値アクセス情報配列で置き換えるローカル検索手段と、
上記所定の項目に関して、上記新たなレコード順序番号配列、及び、上記新たなレコード順序番号配列に関連した上記担当レコードを示す上記ブロック番号を含むブロック番号配列を、上記ローカルデータとして、この演算ユニットの後のパイプライン段にある演算ユニットへ送信する手段と、
を含み、
各演算ユニットの上記マージ手段が、前のパイプライン段からの少なくとも2つのローカルデータに含まれている上記新たなレコード順序番号配列と上記ブロック番号配列との組を所定の順序でマージすることにより、上記少なくとも2つのローカルデータを、さらなるレコード順序番号配列及びさらなるブロック番号配列により形成された1つのローカルデータに変換する手段を含み、
上記分配手段が、最終的に生成された上記さらなるブロック番号配列に含まれているブロック番号の上記さらなるブロック番号配列中での順序番号を、上記ブロック番号に関連付けられた演算ユニットへ送信する手段を含み、
各演算ユニットが、上記送信された順序番号を上記新たなレコード順序番号配列に順次に格納する手段をさらに含む。
本発明の一実施形態によれば、上記の成分分解の考え方と、ブロック番号の考え方と、パイプライン処理の考え方とを組み合わせて、表形式データを集計する分散メモリ型マルチプロセッサが提供される。
表形式データの集計処理では、集計元の表形式データから、集計結果の表形式データが新たに生成される。集計結果の表形式データは、集計の次元に関する項目と、集計対象に関する項目(集計前の項目、集計計算途中の項目、集計結果の項目など)とを含む表形式データである。よって、集計結果の表形式データを新たに生成するためには、集計元の表形式データから、(i)集計結果の表形式データのサイズを計算する処理と、(ii)集計結果の表形式データをブロックに分割して、複数台の演算ユニットに割り当てる処理と、(iii)(1つ以上の)集計の次元に関する項目の項目値の組を特定し、各演算ユニットに割り当てる処理と、(iv)集計対象に関する項目の項目値を特定し、複数台の演算ユニットに割り当てる処理とにより構成されている。
この表形式データの集計処理を実現するために、本発明の一実施形態によれば、
前記複数台の演算ユニットは、集計元の表形式データとして使用される第1の表形式データに関する第1の担当レコード、及び、上記第1の表形式データの所定の項目の組に関する項目値の組毎に少なくとも1つの別の集計項目に関する項目値を集計することにより得られる集計結果を表現する第2の表形式データに関する第2の担当レコードをそれぞれの専用のローカルメモリに格納するように構成されている。
前記複数台の演算ユニットは、集計元の表形式データとして使用される第1の表形式データに関する第1の担当レコード、及び、上記第1の表形式データの所定の項目の組に関する項目値の組毎に少なくとも1つの別の集計項目に関する項目値を集計することにより得られる集計結果を表現する第2の表形式データに関する第2の担当レコードをそれぞれの専用のローカルメモリに格納するように構成されている。
各演算ユニットは、
上記分散メモリ型マルチプロセッサに接続されている外部装置から、上記第2の表形式データのうちこの演算ユニットに分割される上記第2の担当レコードの範囲情報、及び、上記所定の項目の組に属する一意の項目値の個数の組を受信する手段と、
上記第2の担当レコードの範囲情報に基づいて、この演算ユニットに割り当てられた上記第2の担当レコードのレコード順序番号配列及び項目値アクセス情報配列を生成し、この演算ユニットの上記専用のローカルメモリに格納する手段と、
上記所定の項目毎に、上記第2の担当レコードの範囲情報と上記所定の項目に属する一意の項目値の個数の組とに基づいて、この演算ユニットに割り当てられた上記第2の担当レコードのグローバル項目値順序番号配列及びローカル項目値番号配列を生成し、この演算ユニットの上記専用のローカルメモリに格納する手段と、
上記所定の項目毎に、上記第1の担当レコードに関するこの所定の項目のローカル項目値配列と、上記第2の担当レコードに関するこの所定の項目の上記グローバル項目値順序番号配列と、上記グローバル項目値順序番号配列中の順序番号に関連した上記第2の担当レコードを示すブロック番号を含むブロック番号配列とを、上記ローカルデータとして、この演算ユニットの後のパイプライン段にある演算ユニットへ送信する手段と、
を含む。
上記分散メモリ型マルチプロセッサに接続されている外部装置から、上記第2の表形式データのうちこの演算ユニットに分割される上記第2の担当レコードの範囲情報、及び、上記所定の項目の組に属する一意の項目値の個数の組を受信する手段と、
上記第2の担当レコードの範囲情報に基づいて、この演算ユニットに割り当てられた上記第2の担当レコードのレコード順序番号配列及び項目値アクセス情報配列を生成し、この演算ユニットの上記専用のローカルメモリに格納する手段と、
上記所定の項目毎に、上記第2の担当レコードの範囲情報と上記所定の項目に属する一意の項目値の個数の組とに基づいて、この演算ユニットに割り当てられた上記第2の担当レコードのグローバル項目値順序番号配列及びローカル項目値番号配列を生成し、この演算ユニットの上記専用のローカルメモリに格納する手段と、
上記所定の項目毎に、上記第1の担当レコードに関するこの所定の項目のローカル項目値配列と、上記第2の担当レコードに関するこの所定の項目の上記グローバル項目値順序番号配列と、上記グローバル項目値順序番号配列中の順序番号に関連した上記第2の担当レコードを示すブロック番号を含むブロック番号配列とを、上記ローカルデータとして、この演算ユニットの後のパイプライン段にある演算ユニットへ送信する手段と、
を含む。
各演算ユニットの上記マージ手段は、前のパイプライン段からの少なくとも2つのローカルデータに含まれているローカル項目値配列を所定の順序でマージすることによりさらなるローカル項目値配列を生成し、前のパイプライン段からの少なくとも2つのローカルデータに含まれているブロック番号配列及びグローバル項目値順序番号配列を所定の順序でマージすることによりさらなるブロック番号配列及びさらなるグローバル項目値順序番号配列を生成し、これにより、上記少なくとも2つのローカルデータを、上記さらなるローカル項目値配列、上記さらなるブロック番号配列及び上記さらなるグローバル項目値順序番号配列により形成された1つのローカルデータに変換する手段を含む。
上記分配手段は、最終的に生成されたさらなるグローバル項目値順序番号配列に格納されている順序番号によって指定された最終的に生成されたさらなるローカル項目値配列に格納されている項目値を、対応する最終的に生成されたさらなるブロック番号配列に格納されているブロック番号に関連付けられた演算ユニットへ送信する手段を含む。
各演算ユニットは、上記送信された項目値をこの演算ユニットの上記第2の担当レコードのローカル項目値配列に順次に格納する手段をさらに含む。
各演算ユニットは、上記第1の担当レコードに含まれる上記所定の項目の組に関する項目値の組を特定する次元値番号を含む次元値番号配列と、上記次元値番号に対応する上記少なくとも1つの集計項目に関する項目値の集計値を含むローカル集計値配列とを生成し、上記ローカルデータとして、この演算ユニットの後のパイプライン段にある演算ユニットへ送信する手段をさらに含む。
各演算ユニットの上記マージ手段は、前のパイプライン段からの少なくとも2つのローカルデータに含まれている次元値番号配列及びローカル集計値配列を所定の順序でマージすることにより、上記少なくとも2つのローカルデータをさらなる次元値番号配列及びさらなるローカル集計値配列により形成された1つのローカルデータに変換する手段を含む。
上記分配手段は、最終的に生成されたさらなるローカル集計値配列に格納されている集計値を上記第2の担当レコードの上記範囲情報に従って演算ユニットへ送信する手段をさらに含む。
各演算ユニットは、
上記少なくとも1つの集計項目毎に、上記送信された項目値を所定の順序でソートすることにより、集計項目に関するローカル項目値配列及びローカル項目値番号配列を生成し、この演算ユニットの上記専用のローカルメモリに格納するローカルコンパイル手段と、
上記少なくとも1つの集計項目毎に、上記ローカル項目値配列、上記第2の担当レコードの範囲内で所定の順序に基づいて上記ローカル項目値配列に含まれる一意の項目値に割り当てられた順序番号が格納されているローカル項目値順序番号配列、及び、上記ローカル項目値順序番号配列中の上記順序番号に関連した上記担当レコードを示す上記ブロック番号を含むブロック番号配列を、上記ローカルデータとして、この演算ユニットの後のパイプライン段にある演算ユニットへ送信する手段と、
をさらに含む。
上記少なくとも1つの集計項目毎に、上記送信された項目値を所定の順序でソートすることにより、集計項目に関するローカル項目値配列及びローカル項目値番号配列を生成し、この演算ユニットの上記専用のローカルメモリに格納するローカルコンパイル手段と、
上記少なくとも1つの集計項目毎に、上記ローカル項目値配列、上記第2の担当レコードの範囲内で所定の順序に基づいて上記ローカル項目値配列に含まれる一意の項目値に割り当てられた順序番号が格納されているローカル項目値順序番号配列、及び、上記ローカル項目値順序番号配列中の上記順序番号に関連した上記担当レコードを示す上記ブロック番号を含むブロック番号配列を、上記ローカルデータとして、この演算ユニットの後のパイプライン段にある演算ユニットへ送信する手段と、
をさらに含む。
各演算ユニットの上記マージ手段は、前のパイプライン段からの少なくとも2つのローカルデータに含まれている少なくとも2つのローカル項目値配列中の項目値を上記所定の順序でマージすることにより、上記少なくとも2つのローカルデータを、さらなるブロック番号配列、さらなるローカル項目値順序番号配列及びさらなるローカル項目値配列により形成された1つのローカルデータに変換する手段をさらに含む。
上記分配手段は、最終的に生成されたさらなるローカル項目値順序番号配列に格納されている順序番号を、対応する最終的に生成されたさらなるブロック番号配列に格納されているブロック番号に関連付けられた演算ユニットへ送信する手段をさらに含む。
各演算ユニットは、上記送信された順序番号を、この演算ユニットの上記専用のローカルメモリに設けられた、上記少なくとも1つの集計項目に関するグローバル項目値順序番号配列に順次に格納する手段をさらに含む。
さらに、本発明の別の実施形態によれば、
専用のローカルメモリ及びプロセッサを含み、相互にデータを送受するため通信接続されている複数台の演算ユニットを備え、
一連のデータが上記複数台の演算ユニットに関連付けられた複数個のブロックに分割されて上記複数台の演算ユニットのそれぞれの専用のローカルメモリに保持され、上記一連のデータが上記複数台の演算ユニットのパイプライン処理によって操作される、分散メモリ型マルチプロセッサにおいて、
各演算ユニットが、前のパイプライン段にある1台以上の演算ユニットからそれぞれのローカルデータを受信し、少なくとも2つの受信されたローカルデータを1つのさらなるローカルデータに変換し、上記さらなるローカルデータを後のパイプライン段にある1台の演算ユニットへ送信し、最終的に1つのグローバルデータを生成するようにトーナメント方式で動的に動作するステップと、
少なくとも1台のいずれかの演算ユニットが、前記複数個のブロックに対応するブロック番号に基づいて、前記グローバルデータを分割し前記複数台の演算ユニットへ割り当てるステップと、
を備える、表形式データ操作方法が提供される。
専用のローカルメモリ及びプロセッサを含み、相互にデータを送受するため通信接続されている複数台の演算ユニットを備え、
一連のデータが上記複数台の演算ユニットに関連付けられた複数個のブロックに分割されて上記複数台の演算ユニットのそれぞれの専用のローカルメモリに保持され、上記一連のデータが上記複数台の演算ユニットのパイプライン処理によって操作される、分散メモリ型マルチプロセッサにおいて、
各演算ユニットが、前のパイプライン段にある1台以上の演算ユニットからそれぞれのローカルデータを受信し、少なくとも2つの受信されたローカルデータを1つのさらなるローカルデータに変換し、上記さらなるローカルデータを後のパイプライン段にある1台の演算ユニットへ送信し、最終的に1つのグローバルデータを生成するようにトーナメント方式で動的に動作するステップと、
少なくとも1台のいずれかの演算ユニットが、前記複数個のブロックに対応するブロック番号に基づいて、前記グローバルデータを分割し前記複数台の演算ユニットへ割り当てるステップと、
を備える、表形式データ操作方法が提供される。
さらに、本発明の別の実施例によれば、
専用のローカルメモリ及びプロセッサを含み、相互にデータを送受するため通信接続されている複数台の演算ユニットを備えるコンピュータにロードされ、
一連のデータが上記複数台の演算ユニットに関連付けられた複数個のブロックに分割されて上記複数台の演算ユニットのそれぞれの専用のローカルメモリに保持され、上記一連のデータを上記複数台の演算ユニットのパイプライン処理によって操作するコードを上記コンピュータに実行させるコンピュータ読み取り可能なプログラムであって、
各演算ユニットが、前のパイプライン段にある1台以上の演算ユニットからそれぞれのローカルデータを受信し、少なくとも2つの受信されたローカルデータを1つのさらなるローカルデータに変換し、上記さらなるローカルデータを後のパイプライン段にある1台の演算ユニットへ送信するコードと、
前記複数台の演算ユニットのマージ手段が最終的に1つのグローバルデータを生成するようにトーナメント方式で動的に動作するコードと、
少なくとも1台のいずれかの演算ユニットが、前記複数個のブロックに対応するブロック番号に基づいて、前記グローバルデータを分割し前記複数台の演算ユニットへ割り当てるコードと、
を備えるプログラムが提供される。
専用のローカルメモリ及びプロセッサを含み、相互にデータを送受するため通信接続されている複数台の演算ユニットを備えるコンピュータにロードされ、
一連のデータが上記複数台の演算ユニットに関連付けられた複数個のブロックに分割されて上記複数台の演算ユニットのそれぞれの専用のローカルメモリに保持され、上記一連のデータを上記複数台の演算ユニットのパイプライン処理によって操作するコードを上記コンピュータに実行させるコンピュータ読み取り可能なプログラムであって、
各演算ユニットが、前のパイプライン段にある1台以上の演算ユニットからそれぞれのローカルデータを受信し、少なくとも2つの受信されたローカルデータを1つのさらなるローカルデータに変換し、上記さらなるローカルデータを後のパイプライン段にある1台の演算ユニットへ送信するコードと、
前記複数台の演算ユニットのマージ手段が最終的に1つのグローバルデータを生成するようにトーナメント方式で動的に動作するコードと、
少なくとも1台のいずれかの演算ユニットが、前記複数個のブロックに対応するブロック番号に基づいて、前記グローバルデータを分割し前記複数台の演算ユニットへ割り当てるコードと、
を備えるプログラムが提供される。
さらに、本発明の別の実施例によれば、
専用のローカルメモリ及びプロセッサを含み、相互にデータを送受するため通信接続されている複数台の演算ユニットを備えるコンピュータにロードされ、
一連のデータが上記複数台の演算ユニットに関連付けられた複数個のブロックに分割されて上記複数台の演算ユニットのそれぞれの専用のローカルメモリに保持され、上記一連のデータを上記複数台の演算ユニットのパイプライン処理によって操作する上記表形式データ操作方法を上記コンピュータに実行させるためのコンピュータプログラムプロダクトが提供される。
専用のローカルメモリ及びプロセッサを含み、相互にデータを送受するため通信接続されている複数台の演算ユニットを備えるコンピュータにロードされ、
一連のデータが上記複数台の演算ユニットに関連付けられた複数個のブロックに分割されて上記複数台の演算ユニットのそれぞれの専用のローカルメモリに保持され、上記一連のデータを上記複数台の演算ユニットのパイプライン処理によって操作する上記表形式データ操作方法を上記コンピュータに実行させるためのコンピュータプログラムプロダクトが提供される。
さらに、本発明の別の実施例によれば、
専用のローカルメモリ及びプロセッサを含み、相互にデータを送受するため通信接続されている複数台の演算ユニットを備えるコンピュータにロードされ、
一連のデータが上記複数台の演算ユニットに関連付けられた複数個のブロックに分割されて上記複数台の演算ユニットのそれぞれの専用のローカルメモリに保持され、上記一連のデータを上記複数台の演算ユニットのパイプライン処理によって操作する上記表形式データ操作方法を上記コンピュータに実行させるためのコンピュータプログラムが記録された記憶媒体が提供される。
専用のローカルメモリ及びプロセッサを含み、相互にデータを送受するため通信接続されている複数台の演算ユニットを備えるコンピュータにロードされ、
一連のデータが上記複数台の演算ユニットに関連付けられた複数個のブロックに分割されて上記複数台の演算ユニットのそれぞれの専用のローカルメモリに保持され、上記一連のデータを上記複数台の演算ユニットのパイプライン処理によって操作する上記表形式データ操作方法を上記コンピュータに実行させるためのコンピュータプログラムが記録された記憶媒体が提供される。
本発明の少なくとも1つの実施例によれば、分散メモリ型マルチプロセッサの各演算ユニットの演算量と、各演算ユニットに保持されるデータ量と、演算ユニット間のデータ通信量ができる限り削減されるので、大規模データを効率的に操作することができる分散メモリ型マルチプロセッサを実現することが可能になる。
100 分散メモリ型マルチプロセッサ
110,120,130,140 演算ユニット
111,121,131,141 プロセッサ
112,122,132,142 ローカルメモリ
150 インターコネクト
200 コンピュータシステム
202 分散メモリ型マルチプロセッサ
210 CPU
212 RAM
214 ROM
216 記憶装置
218 CD-ROM
220 CD-ROMドライバ
222 I/F
224 入力装置
226 表示装置
228 バス
500 表形式データ
501 データ項目「School」
502 データ項目「Age」
510 レコード0
511 レコード14
520,521,・・・,527 ブロック
530 順序情報
531 項目情報「School」
532 項目情報「Age」
550-0,550-1,・・・,550-7 ブロック単位順序情報
551-0,551-1,・・・,551-7 レコード順序番号配列
552-0,552-1,・・・,552-7 項目値アクセス情報配列
560-0,560-1,・・・,560-7 ブロック情報「School」
561-0,561-1,・・・,561-7 ローカル項目値番号配列「School」
562-0,562-1,・・・,562-7 ローカル項目値配列「School」
580-0,580-1,・・・,580-7 ブロック情報「Age」
581-0,581-1,・・・,581-7 ローカル項目値番号配列「Age」
582-0,582-1,・・・,582-7 ローカル項目値配列「Age」
583-0,583-1,・・・,583-7 グローバル項目値順序番号配列「Age」
110,120,130,140 演算ユニット
111,121,131,141 プロセッサ
112,122,132,142 ローカルメモリ
150 インターコネクト
200 コンピュータシステム
202 分散メモリ型マルチプロセッサ
210 CPU
212 RAM
214 ROM
216 記憶装置
218 CD-ROM
220 CD-ROMドライバ
222 I/F
224 入力装置
226 表示装置
228 バス
500 表形式データ
501 データ項目「School」
502 データ項目「Age」
510 レコード0
511 レコード14
520,521,・・・,527 ブロック
530 順序情報
531 項目情報「School」
532 項目情報「Age」
550-0,550-1,・・・,550-7 ブロック単位順序情報
551-0,551-1,・・・,551-7 レコード順序番号配列
552-0,552-1,・・・,552-7 項目値アクセス情報配列
560-0,560-1,・・・,560-7 ブロック情報「School」
561-0,561-1,・・・,561-7 ローカル項目値番号配列「School」
562-0,562-1,・・・,562-7 ローカル項目値配列「School」
580-0,580-1,・・・,580-7 ブロック情報「Age」
581-0,581-1,・・・,581-7 ローカル項目値番号配列「Age」
582-0,582-1,・・・,582-7 ローカル項目値配列「Age」
583-0,583-1,・・・,583-7 グローバル項目値順序番号配列「Age」
以下、本発明を実施するための種々の形態を図面と共に詳細に説明する。
[分散メモリ型マルチプロセッサ]
最初に、本発明の一実施例によるデータ処理を実現する分散メモリ型マルチプロセッサについて説明する。図1は分散メモリ型マルチプロセッサの一実施形態の概略図である。分散メモリ型マルチプロセッサ100は、複数台(たとえば、2台、4台、8台等、本例では4台)の演算ユニット110、120、130、140を含む。各演算ユニット110、120、130、140は、データ処理用のプロセッサ111、121、131、141と、プロセッサと直接接続されている専用のローカルメモリ112、122、132、142とを含む。各演算ユニット110、120、130、140は、演算ユニット間で高速データ通信を可能にするインターコネクト150によって接続されている。図示されていないが、演算ユニット110、120、130、140は、キャッシュメモリを備えていてもよい。また、演算ユニットは、他の演算ユニットのローカルメモリへのアクセス(リモートアクセス)を可能にする構成でも構わない。その場合、演算ユニットは、リモートアクセスのためのキャッシュメモリをさらに含むことがある。また、NUMA(不均一メモリアクセス)方式のように、各演算ユニットのローカルメモリが全体として論理的に連続した1つのメモリとして見えるように構成されていても構わない。
最初に、本発明の一実施例によるデータ処理を実現する分散メモリ型マルチプロセッサについて説明する。図1は分散メモリ型マルチプロセッサの一実施形態の概略図である。分散メモリ型マルチプロセッサ100は、複数台(たとえば、2台、4台、8台等、本例では4台)の演算ユニット110、120、130、140を含む。各演算ユニット110、120、130、140は、データ処理用のプロセッサ111、121、131、141と、プロセッサと直接接続されている専用のローカルメモリ112、122、132、142とを含む。各演算ユニット110、120、130、140は、演算ユニット間で高速データ通信を可能にするインターコネクト150によって接続されている。図示されていないが、演算ユニット110、120、130、140は、キャッシュメモリを備えていてもよい。また、演算ユニットは、他の演算ユニットのローカルメモリへのアクセス(リモートアクセス)を可能にする構成でも構わない。その場合、演算ユニットは、リモートアクセスのためのキャッシュメモリをさらに含むことがある。また、NUMA(不均一メモリアクセス)方式のように、各演算ユニットのローカルメモリが全体として論理的に連続した1つのメモリとして見えるように構成されていても構わない。
また、演算ユニット内のプロセッサは、シングルコアプロセッサでもよく、又は、2つ以上のプロセッサコアを含むマルチコアプロセッサでもよい。その場合、演算ユニット内のローカルメモリは、プロセッサコア間で共有メモリとして使用されることがある。
[演算ユニットの機能的構成]
各演算ユニットは、表形式データのような一連のデータが複数台の演算ユニットのパイプライン処理によって操作されるように構成することができる。この場合、各演算ユニットは、前のパイプライン段にある1台以上(たとえば、2台)の演算ユニットからそれぞれのローカルデータを受信し、少なくとも2つ(たとえば、2つ)の受信されたローカルデータを1つのさらなるローカルデータに変換し、さらなるローカルデータを後のパイプライン段にある1台の演算ユニットへ送信するマージ手段を含む。これらの複数台の演算ユニットのマージ手段は最終的に1つのグローバルデータを生成するようにトーナメント方式で動的に接続可能である。ここで、「動的」とは、トーナメント表の段数、トーナメント表内での各演算ユニットの配置などが、マージされるべき対象に応じて可変であることを意味している。さらに、少なくとも1台のいずれかの演算ユニットは、一連のデータを複数個のブロックに分割したときに各ブロックに付与された、すなわち、各ブロックが割り当てられた演算ユニットに付与されたブロック番号に基づいて、マージによって生成されたデータを分割し、複数台の演算ユニットへ割り当てる分配手段を含む。
各演算ユニットは、表形式データのような一連のデータが複数台の演算ユニットのパイプライン処理によって操作されるように構成することができる。この場合、各演算ユニットは、前のパイプライン段にある1台以上(たとえば、2台)の演算ユニットからそれぞれのローカルデータを受信し、少なくとも2つ(たとえば、2つ)の受信されたローカルデータを1つのさらなるローカルデータに変換し、さらなるローカルデータを後のパイプライン段にある1台の演算ユニットへ送信するマージ手段を含む。これらの複数台の演算ユニットのマージ手段は最終的に1つのグローバルデータを生成するようにトーナメント方式で動的に接続可能である。ここで、「動的」とは、トーナメント表の段数、トーナメント表内での各演算ユニットの配置などが、マージされるべき対象に応じて可変であることを意味している。さらに、少なくとも1台のいずれかの演算ユニットは、一連のデータを複数個のブロックに分割したときに各ブロックに付与された、すなわち、各ブロックが割り当てられた演算ユニットに付与されたブロック番号に基づいて、マージによって生成されたデータを分割し、複数台の演算ユニットへ割り当てる分配手段を含む。
より詳細には、演算ユニット内のプロセッサがシングルコアプロセッサの場合、一連のデータから得られる各ブロックは演算ユニット毎に、すなわち、演算ユニット内のシングルコアプロセッサに対応付けられる。一方、マルチコアプロセッサの場合、一連のデータから得られる各ブロックは、演算ユニット内のプロセッサコア毎に対応付けられる。よって、複数のブロックが1台の演算ユニットに関連付けられ、ブロックに関する種々の処理は、演算ユニット内のプロセッサコアの単位で実行されることになる。以下の説明中、演算ユニット内のプロセッサは、シングルコアプロセッサ、又は、マルチコアプロセッサのいずれでも構わない。以下では、説明を簡単化するため、特に断らない限り、発明の実施例は、演算ユニットがシングルコアプロセッサであるかのように、演算ユニットの単位で記載されている。しかし、演算ユニット内のプロセッサがマルチコアプロセッサである場合でも、1台の演算ユニットのプロセッサが1つのコアプロセッサに対応しているとみなすならば、以下の説明がこの場合に同様に適用できることに注意を要する。
[コンピュータシステム構成]
図2は、本発明の一実施形態による大規模な一連のデータを操作するコンピュータシステム200の概略図である。コンピュータシステム200は、一連のデータを複数台の演算ユニットによって分担して操作する、図1に示されているような、分散メモリ型マルチプロセッサ202を備えている。図2に示されているように、コンピュータシステム200は、さらに、プログラムを実行することによりシステム全体および個々の構成部分を制御するCPU210と、ワークデータ等を記憶する、たとえば、RAM(Random Access Memory)のようなメモリ212と、プログラム等を記憶するROM(Read Only Memory)214と、ハードディスク等の記憶装置216と、CD-ROM218をアクセスするためのCD-ROMドライバ220と、CD-ROMドライバ220及び外部ネットワーク等(図示せず)へ繋がれた外部端子に接続されているインターフェイス(I/F)222と、キーボード及びマウス等のような入力装置224と、コンピュータモニターのような表示装置226とを備えている。プロセッサ210、RAM212、ROM214、記憶装置216、I/F222、入力装置224及び表示装置226は、バス228を介して相互に接続されている。
図2は、本発明の一実施形態による大規模な一連のデータを操作するコンピュータシステム200の概略図である。コンピュータシステム200は、一連のデータを複数台の演算ユニットによって分担して操作する、図1に示されているような、分散メモリ型マルチプロセッサ202を備えている。図2に示されているように、コンピュータシステム200は、さらに、プログラムを実行することによりシステム全体および個々の構成部分を制御するCPU210と、ワークデータ等を記憶する、たとえば、RAM(Random Access Memory)のようなメモリ212と、プログラム等を記憶するROM(Read Only Memory)214と、ハードディスク等の記憶装置216と、CD-ROM218をアクセスするためのCD-ROMドライバ220と、CD-ROMドライバ220及び外部ネットワーク等(図示せず)へ繋がれた外部端子に接続されているインターフェイス(I/F)222と、キーボード及びマウス等のような入力装置224と、コンピュータモニターのような表示装置226とを備えている。プロセッサ210、RAM212、ROM214、記憶装置216、I/F222、入力装置224及び表示装置226は、バス228を介して相互に接続されている。
一連のデータの操作をコンピュータシステム200の分散メモリ型マルチプロセッサ202に実行させるプログラムは、CD-ROM218に収容され、CD-ROMドライバ220に読取られても良いし、ROM214に予め記憶されていても良い。また、いったんCD-ROM218から読み出したものを、外部記憶媒体216の所定の領域に記憶しておいても良い。或いは、上記プログラムは、ネットワーク(図示せず)、外部端子、及び、I/F222を介して、外部から供給されるものであっても良い。
また、本発明の一実施形態による分散メモリ型コンピュータは、コンピュータシステム200に一連のデータを操作するプログラムを実行させることにより実現される。
図2に示されているコンピュータシステム200では、分散メモリ型マルチプロセッサ202の他にCPU210が設けられ、システム全体及び個々の構成部分を制御している。しかし、本発明は、このような実施形態に限定されることはなく、代替的な実施形態では、分散メモリ型マルチプロセッサ202に含まれている演算ユニットがシステム全体及び個々の構成部品を制御する。
[情報ブロックに基づくデータ管理機構]
図3は本発明の基礎となるデータ管理機構を説明するための表形式データの一例を表す図である。この表形式データは、上述の国際公開第WO00/10103号に提案したデータ管理機構を用いることにより、コンピュータ内では図4に示されるようなデータ構造として記憶される。このデータ構造は、市販されているコンピュータ、たとえば、パーソナルコンピュータのハードウェア資源、特に、プロセッサ及びメモリを使用して大規模な表形式データの検索、ソート、集計等を実現するために提案された、コンピュータのメモリ上に置かれる表形式データのデータ構造であることに注意すべきである。
図3は本発明の基礎となるデータ管理機構を説明するための表形式データの一例を表す図である。この表形式データは、上述の国際公開第WO00/10103号に提案したデータ管理機構を用いることにより、コンピュータ内では図4に示されるようなデータ構造として記憶される。このデータ構造は、市販されているコンピュータ、たとえば、パーソナルコンピュータのハードウェア資源、特に、プロセッサ及びメモリを使用して大規模な表形式データの検索、ソート、集計等を実現するために提案された、コンピュータのメモリ上に置かれる表形式データのデータ構造であることに注意すべきである。
なお、本書中では、「元の表形式データ中でレコードが収容されている位置を表す情報(すなわち、原始レコード位置番号)」と「レコードの並び順を表す情報(すなわち、レコード順序番号)」とが区別されている。原始レコード位置番号は、データ項目に対応した項目値を含む個々のレコードを特定するために利用される仮想的な情報である。たとえば、通常の表形式データを情報ブロックに基づく表形式データに変換する際に、元々の通常の表形式データ中でレコードが収容されている位置が原始レコード位置番号によって表される。一般に、情報ブロックに基づく表形式データでは、レコードが常に原始レコード位置番号の順番に配列されているとは限らない。たとえば、表形式データをある項目の項目値に関して昇順にソートすると、ソート後の表形式データのレコードの並び順は元の表形式データのレコードの並び順とは異なる。但し、通常の表形式データから変換された直後の情報ブロックに基づく表形式データ中のレコードは、レコードが原始レコード位置番号の順番に並べられていることがあり、この場合には、原始レコード位置番号とレコード順序番号とが初期的に一致している。
図4に示すように、表形式データの各レコードの並び順の番号(レコード順序番号)と、原始レコード位置番号は、レコード順序指定配列401(以下、この配列を「OrdSet」のように略記する。)によって対応付けられる。レコード順序指定配列401は、レコード順序番号の順に原始レコード位置番号を格納している。図4の例では、レコードは原始レコード位置番号の順番に並べられている。
ここで、本明細書中での配列の記法について説明する。一般に、配列Aは、添字をiとすると、配列の要素がA[i]のように表記できるが、図面中では、配列は実線で囲まれた領域内に示され、要素A[i]と要素A[i+1]の境界は点線で示されている。また、要素A[i]の添字iが要素A[i]の左側に示されている。また、配列の添字iは0から始まる整数で表されている。
もう一度図4に戻ると、性別に関しては、表形式データのレコード順序番号=0に対応する原始レコード位置番号は、配列OrdSet[0]から「0」であることがわかる。原始レコード位置番号が「0」であるレコードに関する実際の性別の値、即ち、「男」又は「女」は、実際の値が所定の順序(たとえば、昇順又は降順)に従ってソートされた値リストである項目値配列403(以下、項目値配列、すなわち、値リストを「VL」のように略記する。)へのポインタ配列である項目値番号配列402(以下、項目値番号配列、すなわち、ポインタ配列を「VNo」のように略記する。)を参照することによって取得できる。ポインタ配列402は、配列OrdSet401に格納されている原始レコード位置番号の順番に従って、実際の値リスト403中の要素を指し示すポインタを格納している。これにより、表形式データのレコード「0」に対応する性別の項目値は、(1)配列OrdSet401からレコード順序番号=0に対応する原始レコード位置番号=0を取り出し、(2)値リストへのポインタ配列402から原始レコード位置番号=0に対応する要素「1」を取り出し、(3)値リスト403から、値リストへのポインタ配列302から取り出された要素「1」によって指し示される要素「女」を取り出すことにより取得できる。
他のレコードに対しても、また、年齢及び身長に関しても同様に項目値を取得することができる。
このように表形式データは、値リストVLと、値リストへのポインタ配列VNoの組合せにより表現され、この組合せを、特に、「情報ブロック」と称する。図4には、性別、年齢及び身長に関する情報ブロックがそれぞれ情報ブロック408、409及び410として示されている。
単一のコンピュータが単一のメモリ(物理的には複数であっても良いが、単一のアドレス空間に配置されアクセスされるという意味で単一のメモリ)を有するならば、単一のコンピュータは、当該メモリに、順序集合の配列OrdSet、各情報ブロックを構成する値リストVLおよびポインタ配列VNoとを記憶しておけばよい。しかしながら、本発明の種々の実施形態では、表形式データの操作は、ローカルメモリを伴う複数台の演算ユニットにより構成された分散メモリ型マルチプロセッサによって行われる。そのため、効率的な並列処理を実現するために、表形式データを保持する新たな仕組みが提案されている。
[分散メモリ型マルチプロセッサ向けデータ構造]
次に、本発明の一実施形態による分散メモリ型マルチプロセッサ向けデータ構造について説明する。図5A乃至5Dは本発明の一実施形態によるデータ構造の説明図である。図5Aは表形式データの一例を示している。図5Aに示された表形式データ500は、「School」というデータ項目501に対応した項目値(たとえば、「West」、「South」、「North」及び「East」と、「Age」というデータ項目502に対応した項目値(たとえば、「12」、「8」、「11」、「10」など)とを含むレコードの配列として表される。この表形式データ500のレコードは、先頭から順番に、レコード順序番号=0、1、2、・・・、31の順番に並んでいる。配列の先頭に位置するレコード510は、レコード順序番号0が付与されたレコードである。レコード510のデータ項目「School」の項目値は「West」であり、データ項目「Age」の項目値は「12」である。レコード511のデータ項目「School」の項目値は「North」であり、データ項目「Age」の項目値は「9」である。ここで、この表形式データのレコードがソート処理によって並び替えられると、各レコードに付与されるレコード順序番号は変化することに注意すべきである。
次に、本発明の一実施形態による分散メモリ型マルチプロセッサ向けデータ構造について説明する。図5A乃至5Dは本発明の一実施形態によるデータ構造の説明図である。図5Aは表形式データの一例を示している。図5Aに示された表形式データ500は、「School」というデータ項目501に対応した項目値(たとえば、「West」、「South」、「North」及び「East」と、「Age」というデータ項目502に対応した項目値(たとえば、「12」、「8」、「11」、「10」など)とを含むレコードの配列として表される。この表形式データ500のレコードは、先頭から順番に、レコード順序番号=0、1、2、・・・、31の順番に並んでいる。配列の先頭に位置するレコード510は、レコード順序番号0が付与されたレコードである。レコード510のデータ項目「School」の項目値は「West」であり、データ項目「Age」の項目値は「12」である。レコード511のデータ項目「School」の項目値は「North」であり、データ項目「Age」の項目値は「9」である。ここで、この表形式データのレコードがソート処理によって並び替えられると、各レコードに付与されるレコード順序番号は変化することに注意すべきである。
本発明の一実施形態による分散メモリ型マルチプロセッサ向けデータ構造では、この表形式データのレコードは、ブロック番号(本例では、0から7の8個のブロック番号)によって識別されるブロック520、521、・・・、527に分割される。初期的には、このブロックは、このブロックに含まれるレコードの処理を担当する分散メモリ型マルチプロセッサの演算ユニット、より詳しくは、演算ユニットのプロセッサに関連付けられている。
分散メモリ型マルチプロセッサ向けデータ構造は、レコードの並び順(すなわち、レコード順序番号)と、データ構造内の項目値の格納場所とを対応付ける順序に関する情報(順序情報)と、データ項目毎の項目値に関する情報(項目情報)とによって構成される。順序情報は、機能的に上記の本発明の基礎となるデータ管理機構におけるレコード順序指定配列OrdSetに対応し、項目情報は、同様に情報ブロックに対応している。順序情報と項目情報は、共にグローバルメモリに保持され、必要に応じて、それらの一部が各演算ユニットのローカルメモリへ転送される。図5Bは順序情報530を示し、図5C及び5Dは、それぞれ、データ項目「School」及びデータ項目「Age」の項目情報531及び532を示している。
本実施形態のデータ構造では、レコード毎に当該レコードの操作を担当する演算ユニットが定められる。よって、(複数の)レコードは、各演算ユニットが担当するレコード、すなわち、担当レコードに分割され、担当レコード毎にブロック番号が割り当てられる。本実施形態のように、ブロックと演算ユニットが1対1に対応しているならば、各演算ユニットはブロック番号を保存する必要はない。なお、レコード順序番号をiとすると、後述されるブロック番号配列BlkNo[i]は、レコード順序番号iをもつレコードが属するブロックのブロック番号がBlkNo[i]であることを表している。たとえば、図5Aの例では、レコード順序番号0から3のレコードはブロック番号0のブロックに含まれ、レコード順序番号4から7のレコードはブロック番号1のブロックに含まれ、以下同様である。
本実施形態のデータ構造によれば、全レコードはブロックに対応した担当レコードに分割されるので、ブロック毎に、担当レコードのそれぞれを元の表形式データのレコードと対応付ける情報が必要になる。そのため、順序情報530は、ブロック毎に、担当レコードのレコード順序番号がレコード順序番号の順番に格納されているレコード順序番号配列551-0、551-1、551-2、・・・、551-7を含む。レコード順序番号配列は、以下では、GOrdという名前で呼ばれることがある。たとえば、図5Bの例では、ブロック番号0というブロックに属する担当レコードのレコード順序番号は、0、1、2、3であり、ブロック番号1というブロックに属する担当レコードのレコード順序番号は、4、5、6、7であり、以下同様である。レコード順序番号配列は、各ブロックに属する担当レコードの数と同じサイズを有し、レコード順序番号が昇順に格納されている整数型の配列である。また、レコード順序番号配列は、各演算ユニットのローカルメモリに収容可能なサイズに分割され、各演算ユニット内のローカルメモリに記憶されている。
ここで、ブロック番号配列とレコード順序番号配列551-0、551-1、551-2、・・・、551-7は、相互に変換可能であることに注意すべきである。たとえば、レコード順序番号iをもつレコードが属するブロックのブロック番号がBlkNo[i]で表現され、ブロック番号=jであるブロックに属するレコード順序番号配列の添字kに対応する要素がGOrd[j][k]で表現されるとする。このとき、レコードの総数をRmaxとすると、ブロック番号配列からレコード順序番号配列への変換は、
for (i=0;i<Rmax;i++) {
GOrd[BlkNo[i]][J[BlkNo[i]]]=i;
J[BlkNo[i]]++;
}
として表現される。ここで、配列Jの要素J[BlkNo[i]]は、ブロック番号がBlkNo[i]であるブロックに属するレコード順序番号配列GOrd[BlkNo[i]]の要素を指定する添字を表している。なお、配列Jは全要素が0に初期化されている。
for (i=0;i<Rmax;i++) {
GOrd[BlkNo[i]][J[BlkNo[i]]]=i;
J[BlkNo[i]]++;
}
として表現される。ここで、配列Jの要素J[BlkNo[i]]は、ブロック番号がBlkNo[i]であるブロックに属するレコード順序番号配列GOrd[BlkNo[i]]の要素を指定する添字を表している。なお、配列Jは全要素が0に初期化されている。
逆に、レコード順序番号配列からブロック番号配列への変換は、ブロック番号をi、ブロックの総数をBmax、各ブロック内のレコードの総数をBRmax[i]によって表現すると、以下のように記述される。すなわち、
for (i=0;i<Bmax;i++){
for (j=0;j<BRmax[i];j++) {
BlkNo[GOrd[i]][j]=i;
}
}
となる。
for (i=0;i<Bmax;i++){
for (j=0;j<BRmax[i];j++) {
BlkNo[GOrd[i]][j]=i;
}
}
となる。
このように、ブロック番号配列とレコード順序番号配列は相互変換が可能であるため、何れか一方が準備されているならば十分である。
さらに、各レコードに含まれる項目値は、後述する項目情報の形で保持されているので、各演算ユニットは、担当レコードに含まれる項目値をアクセスするためのアドレス情報、すなわち、項目値アクセス情報を取得することが必要である。よって、本実施形態のデータ構造によれば、順序情報530は、ブロック毎に、担当レコードの項目値アクセス情報がレコード順序番号の順番に格納されている項目値アクセス情報配列552-0、552-1、552-2、・・・、552-7をさらに含む。この項目値アクセス情報配列は整数型の配列であり、項目値アクセス情報配列のサイズは担当レコードのレコード数に一致する。項目値アクセス情報配列は、LOrdという名前で呼ばれることもある。たとえば、図5Bの例では、ブロック番号0というブロックに含まれるレコード順序番号が0というレコードに含まれる項目値は、このブロック番号0に関して、0という項目値アクセス情報によってアクセス可能であり、ブロック番号1というブロックに含まれるレコード順序番号が5というレコードに含まれる項目値は、このブロック番号1に関して、1という項目値アクセス情報によってアクセス可能である。
次に、本実施形態によれば、項目情報は、データ項目毎の項目情報として保持される。たとえば、図5C及び5Dの例では、データ項目「School」に関する項目情報531とデータ項目「Age」に関する項目情報532とが各演算ユニットのローカルメモリに分割され記憶される。そして、ブロック毎の担当レコードに含まれる項目値は、データ項目毎に各演算ユニットが項目値アクセス情報配列を用いてアクセスすることができるように各演算ユニットのローカルメモリに保持される。項目値そのものは、データ項目毎に、一意の項目値が所定の順序(昇順又は降順)に格納されているローカル項目値配列LVLとしてローカルメモリ上に構築されている。たとえば、図5C及び5Dの例では、データ項目「School」に関する項目値は、ローカル項目値配列562-0、562-1、・・・、562-7として各演算ユニットのローカルメモリに保持され、データ項目「Age」に関する項目値は、ローカル項目値配列582-0、582-1、・・・、582-7として各演算ユニットのローカルメモリに保持されている。ローカル項目値配列は、項目値そのものを格納する配列であるため、整数型、浮動小数点型、文字列型などの様々なデータ型をとる。
項目情報は、担当レコードに関連した項目値アクセス情報を用いて、グローバル項目値配列に格納されている項目値を特定できるように構成されている。そのため、項目情報は、データ項目毎に、担当レコードに含まれる項目値を特定するローカル項目値番号がレコード順序番号の順番(たとえば、昇順又は降順)に格納されているローカル項目値番号配列と、ローカル項目値番号によって表される項目値が表形式データ全体に保持されている一意の項目値の配列(以下では、グローバル項目値配列と呼ばれることがある)に格納されている位置を指定するグローバル項目値順序番号配列とを含む。なお、グローバル項目値配列は実際にメモリ上に構築される必要はないことに注意を要する。ローカル項目値番号配列及びグローバル項目値順序番号配列はブロック毎に設けられ、各演算ユニットのローカルメモリに記憶される。ローカル項目値番号配列は、担当レコードのレコード数に一致するサイズを有する整数型配列であり、VNoという名前で呼ばれることもある。グローバル項目値順序番号配列は、担当レコードに含まれる一意の項目値の数と同じサイズを有する整数型配列であり、GVOrdという名前で呼ばれることもある。
図5Cの例では、データ項目「School」に関して、項目情報531は、ローカル項目値番号配列561-0、561-1、・・・、561-7と、ローカル項目値配列562-0、562-1、・・・、562-7と、グローバル項目値順序番号配列563-0、563-1、・・・、563-7とを含む。ローカル項目値番号配列、ローカル項目値配列、及び、グローバル項目値順序番号配列は、いずれもブロック毎に分割されている。同図において、たとえば、Block-0のローカル項目値番号配列VNoの先頭の要素の値は「1」である。これは、値が「0」である項目値アクセス情報によって指定されたレコードに含まれる項目値の項目値番号が「1」であることを意味する。項目値番号が「1」である項目値は、ローカル項目値配列LVLの2番目の要素、すなわち、LVL[1]を参照することにより、「West」であることがわかる。さらに、この項目値は、グローバル項目値順序番号配列の2番目の要素、すなわち、GVOrd[1]を参照することにより、仮想的なグローバル項目値配列の3番目の要素であること、すなわち、表形式データの全体の中でのこの項目値の順序番号は「3」であることがわかる。その他のブロックに関しても、また、その他のデータ項目に関しても、同様である。
このように、本実施形態のデータ構造によれば、各ブロックに属するレコードに含まれる項目値は、ブロック内で各項目値に付けられたローカル項目値番号と、このローカル項目値番号に対応付けられているローカル項目値配列とによって表現されている。
[分散メモリ型マルチプロセッサ向けデータ構造の構築]
図6は、本発明の一実施形態による分散メモリ型マルチプロセッサ向けデータ構造を各演算ユニットのローカルメモリ上に構築する方法のフローチャートである。本方法によれば、分散メモリ型マルチプロセッサ202の複数台の演算ユニットが並列的に動作して、分散メモリ型マルチプロセッサ向けの表形式データ構造を演算ユニットのローカルメモリに構築する。演算ユニットの受信部は、並列的に動作して、たとえば、記憶装置216、I/F222を介して接続されているネットワーク上の機器などの外部装置から、表形式データのうちそれぞれの演算ユニットに割り当てられた担当レコードを受信し、専用のローカルメモリに格納する(ステップ602)。次に、演算ユニットの順序情報作成部は、並列的に動作して、受信された担当レコードから、レコード順序番号配列及び項目値アクセス情報配列を生成し、専用のローカルメモリに格納する(ステップ604)。次に、演算ユニットのローカルコンパイル部は、並列的に動作して、項目毎に、担当レコード中の項目値を所定の順序(たとえば、昇順又は降順)でソートすることにより、ローカル項目値配列、及び、ローカル項目値番号配列を生成し、この演算ユニットの専用のローカルメモリに格納する(ステップ606)。続いて、演算ユニットの送信部は、並列的に動作して、項目毎に、ローカル項目値配列、担当レコードの範囲内で所定の順序に基づいてローカル項目値配列に含まれる一意の項目値に割り当てられた順序番号が格納されているローカル項目値順序番号配列、及び、ローカル項目値順序番号配列中の順序番号に関連した担当レコードを示すブロック番号を含むブロック番号配列を、ローカルデータとして、この演算ユニットの後のパイプライン段にある演算ユニットへ送信する(ステップ608)。さらに、演算ユニットのマージ部は、並列的に動作して、前のパイプライン段からの2つのローカルデータに含まれている2つのローカル項目値配列中の項目値を所定の順序でマージすることにより、2つのローカルデータを、さらなるブロック番号配列、さらなるローカル項目値順序番号配列及びさらなるローカル項目値配列により形成された1つのローカルデータに変換する(ステップ610)。さらに、いずれかの演算ユニットの分配部は、最終的に生成されたさらなるローカル項目値順序番号配列に格納されている順序番号を、対応する最終的に生成されたさらなるブロック番号配列に格納されているブロック番号に関連付けられた演算ユニットへ送信する(ステップ612)。最後に、演算ユニットの順序番号格納部は、並列的に動作して、専用のローカルメモリに確保されたグローバル項目値順序番号配列に、送信された順序番号を順次に格納する(ステップ614)。
図6は、本発明の一実施形態による分散メモリ型マルチプロセッサ向けデータ構造を各演算ユニットのローカルメモリ上に構築する方法のフローチャートである。本方法によれば、分散メモリ型マルチプロセッサ202の複数台の演算ユニットが並列的に動作して、分散メモリ型マルチプロセッサ向けの表形式データ構造を演算ユニットのローカルメモリに構築する。演算ユニットの受信部は、並列的に動作して、たとえば、記憶装置216、I/F222を介して接続されているネットワーク上の機器などの外部装置から、表形式データのうちそれぞれの演算ユニットに割り当てられた担当レコードを受信し、専用のローカルメモリに格納する(ステップ602)。次に、演算ユニットの順序情報作成部は、並列的に動作して、受信された担当レコードから、レコード順序番号配列及び項目値アクセス情報配列を生成し、専用のローカルメモリに格納する(ステップ604)。次に、演算ユニットのローカルコンパイル部は、並列的に動作して、項目毎に、担当レコード中の項目値を所定の順序(たとえば、昇順又は降順)でソートすることにより、ローカル項目値配列、及び、ローカル項目値番号配列を生成し、この演算ユニットの専用のローカルメモリに格納する(ステップ606)。続いて、演算ユニットの送信部は、並列的に動作して、項目毎に、ローカル項目値配列、担当レコードの範囲内で所定の順序に基づいてローカル項目値配列に含まれる一意の項目値に割り当てられた順序番号が格納されているローカル項目値順序番号配列、及び、ローカル項目値順序番号配列中の順序番号に関連した担当レコードを示すブロック番号を含むブロック番号配列を、ローカルデータとして、この演算ユニットの後のパイプライン段にある演算ユニットへ送信する(ステップ608)。さらに、演算ユニットのマージ部は、並列的に動作して、前のパイプライン段からの2つのローカルデータに含まれている2つのローカル項目値配列中の項目値を所定の順序でマージすることにより、2つのローカルデータを、さらなるブロック番号配列、さらなるローカル項目値順序番号配列及びさらなるローカル項目値配列により形成された1つのローカルデータに変換する(ステップ610)。さらに、いずれかの演算ユニットの分配部は、最終的に生成されたさらなるローカル項目値順序番号配列に格納されている順序番号を、対応する最終的に生成されたさらなるブロック番号配列に格納されているブロック番号に関連付けられた演算ユニットへ送信する(ステップ612)。最後に、演算ユニットの順序番号格納部は、並列的に動作して、専用のローカルメモリに確保されたグローバル項目値順序番号配列に、送信された順序番号を順次に格納する(ステップ614)。
[項目値の取得処理]
次に、本発明の一実施形態による分散メモリ型マルチプロセッサ向けデータ構造における表形式データの項目値の取得について説明する。図7は、本発明の一実施形態による項目値取得方法のフローチャートである。項目値は、図5A乃至5Dを参照して説明したように、データ項目毎に、項目情報の形で各演算ユニットのローカルメモリ上に保持されている。よって、たとえば、分散メモリ型マルチプロセッサは、指定されたレコードに含まれる項目値を容易に取得することができる。また、表形式データは、演算ユニットの担当レコードに分割され、演算ユニット毎に独立して保持されている。よって、各演算ユニットは、他の演算ユニットとは完全に独立に、この演算ユニットのローカルメモリに保持されている項目値を取得することが可能である。本実施形態では、多数の演算ユニットが同時に動作することにより、多数のレコードに含まれる項目値を同時に取得するような状況も考慮している。このような状況においても、項目値取得の基本動作は、ある特定の演算ユニットが担当レコード中のあるレコードに含まれる項目値を取得する処理であることが理解されるであろう。
次に、本発明の一実施形態による分散メモリ型マルチプロセッサ向けデータ構造における表形式データの項目値の取得について説明する。図7は、本発明の一実施形態による項目値取得方法のフローチャートである。項目値は、図5A乃至5Dを参照して説明したように、データ項目毎に、項目情報の形で各演算ユニットのローカルメモリ上に保持されている。よって、たとえば、分散メモリ型マルチプロセッサは、指定されたレコードに含まれる項目値を容易に取得することができる。また、表形式データは、演算ユニットの担当レコードに分割され、演算ユニット毎に独立して保持されている。よって、各演算ユニットは、他の演算ユニットとは完全に独立に、この演算ユニットのローカルメモリに保持されている項目値を取得することが可能である。本実施形態では、多数の演算ユニットが同時に動作することにより、多数のレコードに含まれる項目値を同時に取得するような状況も考慮している。このような状況においても、項目値取得の基本動作は、ある特定の演算ユニットが担当レコード中のあるレコードに含まれる項目値を取得する処理であることが理解されるであろう。
図7に示されているように、各演算ユニットは、レコード順序番号が指定されると、指定されたレコード順序番号がローカルメモリに保持されているレコード順序番号配列に存在するかどうかを判定する(ステップ702)。もし、指定されたレコード順序番号が存在しなければ(ステップ702でNo)、プロセスは終了する。指定されたレコード順序番号が存在するならば、演算ユニットは、指定されたレコード順序番号がレコード順序番号配列内で格納されている位置を特定し、特定された位置によって指定される項目値アクセス情報配列中の項目値アクセス情報を読み出す(ステップ704)。その後、演算ユニットは、項目毎に、読み出された項目値アクセス情報によって指定されるローカル項目値番号配列中のローカル項目値番号を読み出す(ステップ706)。続いて、演算ユニットは、項目毎に、読み出されたローカル項目値番号によって指定されるローカル項目値配列中の項目値を特定する(ステップ708)。最後に、演算ユニットは、未だ項目値が特定されていない項目が存在するかどうかを判定する(ステップ710)。未だ項目値が特定されていない項目が存在するならば(ステップ710でYes)、プロセスはステップ706へ戻り、次の項目に関する処理を継続する。すべての項目値が特定されているならば(ステップ710でNo)、プロセスは終了する。
本実施形態によるデータ取得の一例を、図5A乃至5Dに示されたデータ構造を用いて、より詳細に説明する。たとえば、レコード順序番号=14であるレコード、図5A乃至5Dでは、符号511で示されたレコードの項目値を取得することを考える。各演算ユニットがこの演算ユニットのローカルメモリに保持されているレコード順序番号配列を参照すると、ブロック番号=3に対応するブロックBlock-3を担当する演算ユニットだけが、指定されたレコード順序番号=14であるレコードを担当していると判定する。この演算ユニットは、レコード順序番号配列GOrd中でレコード順序番号=14が格納されている位置が2であること、すなわち、GOrd[2]=14であることがわかるので、項目値アクセス情報配列から、レコード順序番号=14の項目値アクセス情報、すなわち、LOrd[2]=2を読み出す。なお、レコード順序番号配列の中で、レコード順序番号=14が格納されている位置は、この演算ユニットの担当レコード中での対象レコードの順位(ランク)とも称される。レコード順序番号配列は、昇順の配列であるため、この格納位置は、周知の2分割法などによって効率的に見つけられる。
次に、この演算ユニットは、項目毎に、ローカル項目値番号配列VNoから、項目値アクセス情報によって指定されるローカル項目値番号を読み出し、読み出されたローカル項目値番号によって指定される項目値をローカル項目値配列から読み出す。たとえば、項目=Schoolの場合、LVL[VNo[LOrd[2]]]=LVL[VNo[2]]=LVL[0]=Northであることから、項目=Schoolの項目値=Northが特定される。同様に、項目=Ageに関して、LVL[VNo[LOrd[2]]]=LVL[VNo[2]]=LVL[2]=9という項目値が特定される。
[表形式データのコンパイル処理]
次に、本発明の一実施形態による表形式データから分散メモリ型マルチプロセッサ向けデータを作成するコンパイル処理について説明する。以下では、図5A乃至5Dに示されたデータ構造に関連して、本発明の一実施形態によるコンパイル処理が記述される。図8は、本発明の一実施形態によるコンパイル処理の概略的なフローチャートである。
次に、本発明の一実施形態による表形式データから分散メモリ型マルチプロセッサ向けデータを作成するコンパイル処理について説明する。以下では、図5A乃至5Dに示されたデータ構造に関連して、本発明の一実施形態によるコンパイル処理が記述される。図8は、本発明の一実施形態によるコンパイル処理の概略的なフローチャートである。
担当レコード取得:本実施形態によれば、最初に、表形式データのうち、各演算ユニットによって担当される担当レコードが演算ユニットに取り込まれる(ステップ802)。当然ながら、1台の演算ユニットに複数のプロセッサが収容されているならば、プロセッサ毎に担当レコードが取り込まれ、ブロック単位の処理はプロセッサ毎に実行される。
順序情報作成:次に、レコード順序番号配列及び項目値アクセス情報配列からなる順序情報が各演算ユニットのローカルメモリ上に作成される(ステップ804)。上述のように、レコード順序番号配列及び項目値アクセス情報配列は、複数台の演算ユニットによって並列的に作成される。
ブロック内コンパイル:次に、複数台の演算ユニットが並列的に動作して、データ項目毎に、単一のブロックに含まれる担当レコードの原始レコード位置番号の順番に、ローカル項目値番号を格納するローカル項目値番号配列を作成し、同時に、複数台の演算ユニットは、担当レコードに含まれる項目値のうちの一意の値を所定の順序(たとえば、昇順又は降順)に格納するローカル項目値配列も作成する(ステップ806)。
ブロック間コンパイル1(マージ):次に、複数台の演算ユニットが並列的かつ階層的に動作して、データ項目毎に、少なくとも2個(本実施例では、2個)のブロックに関連した、ブロック番号配列、ローカル項目値配列、及び、ローカル項目値配列に格納されている項目値が表形式データ全体に含まれる一意の項目値を所定の順序で格納する仮想的なグローバル項目値配列中に格納されている位置を指定するポインタがローカル項目値番号の順番に格納されているグローバル項目値順序番号配列からなる1対の組から、2個のブロックをマージしたブロックに関連した、ブロック番号配列、ローカル項目値配列、及び、グローバル項目値順序番号配列からなる組を作成するマージ処理を実行する。演算ユニットは、最終的に1個のブロックにマージされるまでこのマージ処理を繰り返し実行し、最終的なブロック番号配列、最終的なローカル項目値配列、及び、最終的なグローバル項目値順序番号配列を作成する(ステップ808)。
ブロック間コンパイル2(分配):最後に、少なくとも1台の演算ユニットが、データ項目毎に、最終的なグローバル項目値順序番号配列中の要素を最終的なブロック番号配列中の対応する要素によって指定されたブロック番号毎に、各ブロックを担当する演算ユニットへ順次に分配することにより、各演算ユニットのローカルメモリ上に各演算ユニットの担当レコードに関するグローバル項目値順序番号配列が作成される(ステップ810)。
以上のステップにより、図5Aに示された表形式データから、図5Bに示されたレコード順序番号配列及び項目値アクセス情報配列と、図5Cに示された、データ項目=Schoolに関するローカル項目値番号配列、ローカル項目値配列及びグローバル項目値順序番号配列と、図5Dに示された、データ項目=Ageに関するローカル項目値番号配列、ローカル項目値配列及びグローバル項目値順序番号配列とが各演算ユニットのローカルメモリ上に作成される。
以下、図5A乃至5Dに示された表形式データに関連して、本発明の一実施形態によるコンパイル処理をより詳細に説明する。図9A及び9Bは本発明の一実施形態による順序情報作成処理の説明図である。図9A及び9Bに示されたデータは図5A及び5Bに示されたデータと同じデータであり、図9Aの表形式データ500から、図9Bの順序情報530が作成される。順序情報作成処理については上述の通りである。レコード順序番号配列GOrdには、元の表形式データの行番号がそのまま設定され、項目値アクセス情報配列LOrdには、0から始まる連続番号が設定される。順序情報作成処理は、複数台の演算ユニットによって並列的に実行される。
図10A乃至10Cは、本発明の一実施形態によるブロック内コンパイル処理の概要図である。ブロック内コンパイル処理によれば、図10Aに示された表形式データから、図10B及び図10Cに示されたデータ項目=“School”に関する項目情報及びデータ項目=“Age”に関する項目情報が作成される。同図に示されているように、項目情報には、ローカル項目値番号配列VNoとローカル項目値配列LVLとが含まれている。ブロック内コンパイル処理は、Block-0、Block-1、・・・、Block-7というブロック毎に、各演算ユニットによって並列に実行される。
ここで、1つのブロックについてのブロック内コンパイル処理の一実施例について説明する。図11は、本発明の一実施形態によるブロック内コンパイル処理の概要図である。本例では、ブロック番号=1のデータ項目=Schoolに関する4行(レコード数=4)のSchool(すなわち、原始レコード位置番号の順序に項目値が格納されている項目値配列School)から、ローカル項目値番号配列VNoとローカル項目値配列LVLを作成する。ローカル項目値配列LVLは、項目値配列Schoolに含まれている項目値から抽出された一意の項目値が所定の順序(本例では、アルファベットの昇順)に格納されている値のリストである。一方、ローカル項目値番号配列VNoは、iが原始レコード位置番号を表すとき、元の項目値配列Schoolの要素であるSchool[i]とローカル項目値配列LVL[j]との間に、
School[i]=LVL[VNo[i]]
という関係が成り立つような配列である。なお、以下の処理は、演算ユニットが演算ユニットのローカルメモリを使用して実行する。
School[i]=LVL[VNo[i]]
という関係が成り立つような配列である。なお、以下の処理は、演算ユニットが演算ユニットのローカルメモリを使用して実行する。
次に、ブロック内コンパイル処理の一実施例をより詳細に説明する。図12A乃至12Eは、本発明の一実施形態によるブロック内コンパイル処理の説明図である。図12Aに示されているような項目値配列が演算ユニットのローカルメモリに作成される。続いて、図12Bに示されるように、項目値配列の各要素の配列内での位置を表す値を格納した配列、すなわち、項目値配列をA[i]とするとき、位置配列B[i]=iとなる配列Bをローカルメモリ上に作成する。ここで、項目値配列Aの要素を、項目値をキーとして、項目値の昇順にソートし、同時に、位置配列Bの要素もソートする。これにより、図12Cに示されるような項目値配列A及び位置配列Bが得られる。続いて、一意の項目値に0から順番に項目値番号を付与して項目値番号配列Cを生成する。これにより、項目値番号を用いて項目値が重複なくアクセスできるようになる。そして、項目値を項目値番号の順に並べ換えると、図12Dに示されるように、ローカル項目値配列LVLが生成される。最後に、図12Eに示されるように、位置配列Bの要素によって指定される位置に、項目値番号を格納すると、ローカル項目値番号配列VNoが得られる。すなわち、VNo[B[i]]=C[i]に従って、ローカル項目値番号配列VNoが生成される。以上のブロック内コンパイル処理により、演算ユニットのローカルメモリにローカル項目値番号配列VNo及びローカル項目値配列LVLが生成される。
次に、本発明の一実施形態によるブロック間コンパイル処理について説明する。ブロック間コンパイル処理は、複数台の演算ユニットが並列的かつ階層的に動作して、データ項目毎に、最終的に1個のローカルデータにマージされるまで、1対のローカルデータをマージする処理を繰り返し、最終的なブロック番号配列、最終的なグローバル項目値順序番号配列、及び、最終的なローカル項目値配列を生成するマージ処理と、マージ処理によって生成された最終的なグローバル項目値順序番号配列中のグローバル項目値順序番号を対応するブロック番号配列に格納されているブロック番号に基づいてブロック番号に対応する演算ユニットへ分配する分配処理とを含む。各演算ユニットは、分配されたグローバル項目値順序番号をそれぞれのローカルメモリ上に確保されたグローバル項目値順序番号配列に格納する。
マージ処理では、各演算ユニットが、1対のブロックに関する情報、すなわち、1対のローカルデータをマージして、マージされたより高い層の1個のブロックに関する情報、すなわち、さらなるローカルデータを生成する。よって、マージ処理は、複数台の演算ユニットの並列動作によって実現される。また、各演算ユニットは、同じ層に属するマージされたブロックの対に関する情報をマージし、マージされたさらに高い層の1個のブロックに関する情報を生成する。このようにマージ処理を並列的かつ階層的に繰り返すことにより、最終的に最上層の1個のブロックに関する情報が生成される。最上層の1個のブロックとは、レコード全体を含むブロックである。
たとえば、2n-1台の演算ユニットが存在し、各演算ユニットが2個のブロックに関する情報を入力し、それらをマージして、1個のブロックに関する情報を出力すると仮定すると、各演算ユニットが1回ずつマージ処理を実行することによって、n段(層)のマージ処理が実現される。この場合、全演算ユニットによる全データ通信量のうち、演算ユニットがグローバルメモリとの間で行う通信が占める割合は、1/nである。演算ユニット間の通信量は、全データ通信量の(n-1)/nである。なお、演算ユニット0に関連したブロック0と演算ユニット1に関連したブロック1は、演算ユニット0又は演算ユニット1以外の演算ユニットによってマージされてもよく、或いは、演算ユニット1又は演算ユニット1のいずれかの演算ユニットによってマージされてもよい。このように、元のローカルデータを保持している一方の演算ユニットが次のパイプライン段のマージ処理を担当することにより、演算ユニット間のデータ通信量が削減される。
図13はブロック間コンパイル処理のマージ処理の概要図である。ブロック内コンパイルによって、演算ユニットPE-i(i=0,1,2,・・・,7)は、それぞれに割り当てられたブロックに関する情報Block-i(i=0,1,2,・・・,7)を生成し、パイプライン段の演算ユニットへ送信している。ここで、PE-iは演算ユニットiを表し、Block-iはブロックiを表している。
最初のパイプライン段では、演算ユニット0が演算ユニット0からのブロック0と演算ユニット1からのブロック1とをマージする。演算ユニット2は演算ユニット2からのブロック2と演算ユニット3からのブロック3とをマージする。演算ユニット4は演算ユニット4からのブロック4と演算ユニット5からのブロック5とをマージする。演算ユニット6は演算ユニット6からのブロック6と演算ユニット7からのブロック7をマージする。
次のパイプライン段では、演算ユニット1は、演算ユニット0からのブロック0~1と演算ユニット2からのブロック2~3とをマージする。同様に、演算ユニット5は、演算ユニット4からのブロック4~5と演算ユニット6からのブロック6~7とをマージする。ここで、ブロックi~jという表記は、ブロックiからブロックjまでをマージすることにより生成された1つのブロックを意味している。このように、演算ユニットは、トーナメント方式でパイプライン処理を実行する
最後に、演算ユニット3が演算ユニット1からのブロック0~3と演算ユニット5からのブロック4~7をマージして、1つのブロック0~7を生成する。勿論、トーナメント表内での演算ユニットの配置(すなわち、ブロックと演算ユニットの対応関係)は、図13に示されている配置に限定されることがない。
最後に、演算ユニット3が演算ユニット1からのブロック0~3と演算ユニット5からのブロック4~7をマージして、1つのブロック0~7を生成する。勿論、トーナメント表内での演算ユニットの配置(すなわち、ブロックと演算ユニットの対応関係)は、図13に示されている配置に限定されることがない。
演算ユニット3で生成されるブロック0~7は、値が得られると、順次、演算ユニット7へ送信される。演算ユニット7は、ブロック0~7を元のブロックに対応した演算ユニット0、演算ユニット1、・・・、演算ユニット7へ分配する。
ブロック間コンパイル(グローバルコンパイルとも称される)では、取り扱われる配列(すなわち、ブロック番号配列、グローバル項目値順序番号配列、及び、ローカル項目値配列)が1台の演算ユニットのローカルメモリに収容できない程度のサイズに達することがある。そのため、パイプライン化された演算ユニットは、前のパイプライン段の演算ユニットからデータを受信すると、受信されたデータを直ちに処理し、処理されたデータを後のパイプライン段の演算ユニットへ送信しようとする。後のパイプライン段の演算ユニットは、この演算ユニットのローカルメモリにデータを格納可能であるならば、前のパイプライン段からのデータを受信し、データを格納可能でないならば、前のパイプライン段からの送信を待たせる。データ送信を完了した演算ユニットは、送信されたデータが格納されていたローカルメモリ内の記憶領域を開放することが可能である。データ送信が完了していない演算ユニットは、この演算ユニットのローカルメモリにデータを格納できる限り、前のパイプライン段からのデータを受信し処理するが、ローカルメモリにそれ以上データを格納できなくなったならば、前のパイプライン段の演算ユニットに対して、データの送信を待たせ、ローカルメモリにデータを格納する領域が再び確保されたならば、前のパイプライン段の演算プロセッサに対してデータの送信を再開させる。このように、本実施形態では、データの受信側がデータの送信元に対してデータ送信停止要求及びデータ送信再開要求を発行することによって演算ユニット間のデータ通信を制御しているが、演算ユニット間のデータ通信は、一般的に知られているどのようなフロー制御によっても実現され得ることに注意を要する。
今度は、図14A及び14Bを参照して、本発明の一実施形態によるブロック間コンパイル処理の初期化処理を説明する。図14Aは項目=Schoolに関する項目情報を示し、図14Bは項目=Ageに関する項目情報を示している。最初に、演算ユニットは、この演算ユニットのローカルメモリ上に初期化されたブロック番号配列BlkNoを作成する。ブロック番号配列BlkNoは、既に作成されているローカル項目値配列LVLと同じサイズであり、初期値として、各演算ユニットに割り当てられた担当レコードを識別するためのブロック番号が設定される。本例では、たとえば、演算ユニット0のブロック番号配列には0が格納され、演算ユニット1のブロック番号配列には1が格納され、以下同様である。
演算ユニットは、初期化されたグローバル項目値順序番号配列GVOrdをさらにローカルメモリ上に作成する。グローバル項目値順序番号配列GVOrdのサイズはローカル項目値配列LVLと同じサイズであり、初期値として、先頭から順番に0から始まる連続番号が設定される。
これらの初期化処理は複数台の演算ユニットによって並列的に実行される。
今度は、図15A、15B及び15Cを参照して、本発明の一実施形態によるブロック間コンパイル処理の1段目のマージ処理を説明する。一例として、演算ユニット0がブロック0とブロック1をマージする例を説明する。
最初に、演算ユニット0(PE-0)は、図15Aに示されているように、PE-0からのローカル項目値配列LVLの先頭の格納値=“South”とPE-1からのローカル項目値配列LVLの先頭の格納値=“North”とを比較し、PE-1からの格納値=“North”がPE-0からの格納値=“South”より小さいこと、すなわち、所定の順序(たとえば、本例では、アルファベットの昇順)で高順位であることを検出し、小さい方の項目値=“North”をさらなるローカル項目値配列LVL’に格納する。同時に、小さい方の格納値=“North”に対応するブロック番号=1をさらなるブロック番号配列BlkNo’に格納する。もし、PE-1からのローカルデータに関して、項目値=“North”に対応するグローバル項目値順序番号配列の要素の値が連続的に存在するならば、連続的に存在する要素の値の個数分だけさらなるブロック番号配列の要素を繰り返し格納する。一方、さらなるグローバル項目値順序番号配列には、さらなるブロック番号配列中に要素が格納されている位置と同じ位置まで現在の順序番号(すなわち、本例では、順序番号=0)を充填する。その後、小さい方の格納値=“North”が格納されていた方のローカル項目値配列LVLへのポインタ(すなわち、比較されるべき要素を指定するポインタ)を進める。
次に、PE-0は、図15Bに示されているように、PE-0からのローカル項目値配列LVLの先頭の格納値=“South”とPE-1からのローカル項目値配列LVLの2番目の格納値=“South”とを比較する。両方の格納値が同一値であるため、PE-0は、いずれか一方の項目値=“South”をさらなるローカル項目値配列LVL’に格納する。同時に、PE-0は、これらの項目値に対応するブロック番号のうち、小さい方のブロック番号(本例では、PE-0からのブロック番号=0)をさらなるブロック番号配列BlkNo’に格納する。もし、PE-0からのローカルデータに関して、項目値=“South”に対応するグローバル項目値順序番号配列の要素の値が連続的に存在するならば、連続的に存在する要素の値の個数分だけさらなるブロック番号配列の要素を繰り返し格納する。その後、PE-0は、大きい方のブロック番号(本例では、PE-1からのブロック番号=1)をさらなるブロック番号配列BlkNo’に格納し、同様に、もし、PE-1からのローカルデータに関して、項目値=“South”に対応するグローバル項目値順序番号配列の要素の値が連続的に存在するならば、連続的に存在する要素の値の個数分だけさらなるブロック番号配列の要素を繰り返し格納する。一方、さらなるグローバル項目値順序番号配列には、さらなるブロック番号配列中に要素が格納されている位置と同じ位置まで現在の順序番号(すなわち、本例では、順序番号=1)を充填する。その後、両方のローカル項目値配列LVLへのポインタ(すなわち、比較されるべき要素を指定するポインタ)を進める。
次に、PE-0は、図15Cに示されているように、PE-0からのローカル項目値配列LVLの2番目の格納値=“West”とPE-1からのローカル項目値配列LVLの3番目の格納値=“West”とを比較する。両方の格納値が同一値であるため、PE-0は、いずれか一方の項目値=“West”をさらなるローカル項目値配列LVL’に格納する。同時に、PE-0は、これらの項目値に対応するブロック番号のうち、小さい方のブロック番号(本例では、PE-0からのブロック番号=0)をさらなるブロック番号配列BlkNo’に格納する。もし、PE-0からのローカルデータに関して、項目値=“West”に対応するグローバル項目値順序番号配列の要素の値が連続的に存在するならば、連続的に存在する要素の値の個数分だけさらなるブロック番号配列の要素を繰り返し格納する。その後、PE-0は、大きい方のブロック番号(本例では、PE-1からのブロック番号=1)をさらなるブロック番号配列BlkNo’に格納し、同様に、もし、PE-1からのローカルデータに関して、項目値=“West”に対応するグローバル項目値順序番号配列の要素の値が連続的に存在するならば、連続的に存在する要素の値の個数分だけさらなるブロック番号配列の要素を繰り返し格納する。一方、さらなるグローバル項目値順序番号配列には、さらなるブロック番号配列中に要素が格納されている位置と同じ位置まで現在の順序番号(すなわち、本例では、順序番号=2)を充填する。その後、両方のローカル項目値配列LVLへのポインタ(すなわち、比較されるべき要素を指定するポインタ)を進める。本例では、ポインタが両方のローカル項目値配列LVLの末尾に達しているので、PE-0によるブロック間コンパイル処理の1段目のマージ処理が終了する。
このマージ処理の結果として、2組のローカルデータ、すなわち、2組のブロック番号配列、グローバル項目値順序番号配列及びローカル項目値配列が、1組のさらなるローカルデータ、すなわち、1組のさらなるブロック番号配列、さらなるグローバル項目値順序番号配列及びさらなるローカル項目値配列に変換される。
ブロック間コンパイル処理の1段目のマージ処理は、ローカルメモリへのシーケンシャルアクセスのみによって実行されるので、ブロック番号配列、グローバル項目値順序番号配列及びローカル項目値配列のサイズとは無関係に、小さなサイズの作業メモリだけを使用して実現され得ることに注意を要する。
また、さらなるブロック番号配列BlkNo’に格納されるブロック番号は、さらなるグローバル項目値順序番号配列GVOrd’に格納されている値が同一である限り、必ず所定の順序(本例では、昇順)になることに注意を要する。
今度は、図16を参照して、演算ユニットPE-1が、PE-0から出力されたブロック0~1と、PE-2から出力されたブロック2~3を1つのブロックにマージする2段目のマージ処理について説明する。図16A乃至16Dは、本発明の一実施形態によるブロック間コンパイルにおける2段目のマージ処理の説明図である。2段目のマージ処理は、入力される情報が他の演算ユニットによって既にマージされた結果の情報である点を除いて、1段目のマージ処理と同様である。図16A、16B、16C及び16Dには、この処理の過程と、得られたさらなるブロック番号配列BlkNo’、さらなるグローバル項目値順序番号配列GVOrd’、及び、さらなるローカル項目値配列LVL’とが示されている。
今度は、図17を参照して、次のパイプライン段のマージ処理を説明する。ブロック間コンパイル処理の1段目のマージ処理と2段目のマージ処理を終えると、ブロック0からブロック3までがマージされたブロック0~3と、ブロック4からブロック7までがマージされたブロック4~7が得られる。演算ユニットPE-3は、PE-4によって出力されるブロック0~3と、PE-5によって出力されるブロック4~7とを受信し、2つのブロックのマージ処理を同様に実行する。これにより、最終的な1個のブロックであるBlock0~7が得られる。図17は、本発明の一実施形態によるブロック間コンパイル処理における3段目のマージ処理の結果を説明する図である。図17には、データ項目「School」に関するブロック間コンパイルによるマージ処理の結果が表されている。ここで、最終的なさらなるローカル項目値配列LVL’は、仮想的なグローバル項目値配列に一致することに注意すべきである。
今度は、図18A及び18Bを参照して、ブロック間コンパイル処理における分配処理を説明する。図18Aは、本発明の一実施形態によるブロック間コンパイル処理における分配処理の説明図である。本発明の一実施形態によるブロック間コンパイル処理は、マージ処理の後に、分配処理を実行する。分配処理では、少なくとも1台の演算ユニットが、データ項目毎に、最終的なグローバル項目値順序番号配列GVOrd’の要素を最終的なブロック番号配列BlkNo’の対応する要素によって指定されたブロック番号毎に、このブロック番号に対応する演算プロセッサに分配する。そして、それぞれの演算プロセッサが分配されたグローバル項目値順序番号を所定の順番(たとえば、昇順)で先に初期設定されていたグローバル項目値順序番号配列GVOrdに格納する。
このため、本発明の一実施形態によるブロック間コンパイル処理における分配では、図18Bに示されたデータが取得されているならば、演算ユニットiのグローバル項目値順序番号配列をGVOrd[i][j]と表現すると、グローバル項目値順序番号は次の手順に従って各演算ユニットのローカルメモリに確保されたグローバル項目値順序番号配列GVOrdに分配される。
for (i=0;i<8;i++) {
Offsets[i]=0;
}
for (i=0;i<19;i++) {
GVOrd[BlkNo’[i]][Offsets[BlkNo’[i]]]=GVOrd’[i];
Offsets[BlkNo’[i]]++;
}
上記の分配処理は1台の演算ユニット又はプロセッサコアで操作を実施する場合の操作に対応している。しかし、本発明の一実施形態によれば、好ましくは、複数台の演算ユニット又はプロセッサコアを用いて、グローバル項目値順序番号配列GVOrd’を分配することも可能である。また、グローバル項目値順序番号配列GVOrd[i][j]は、一旦、分配処理を実行している演算ユニットのローカルメモリ上に作成され、このグローバル項目値順序番号配列GVOrd[i][j]の要素が少しずつ充填されるのに応じて、少しずつ各演算ユニットへ送信してもよく、或いは、ある程度の量をまとめて一括して各演算ユニットへ送信してもよい。
for (i=0;i<8;i++) {
Offsets[i]=0;
}
for (i=0;i<19;i++) {
GVOrd[BlkNo’[i]][Offsets[BlkNo’[i]]]=GVOrd’[i];
Offsets[BlkNo’[i]]++;
}
上記の分配処理は1台の演算ユニット又はプロセッサコアで操作を実施する場合の操作に対応している。しかし、本発明の一実施形態によれば、好ましくは、複数台の演算ユニット又はプロセッサコアを用いて、グローバル項目値順序番号配列GVOrd’を分配することも可能である。また、グローバル項目値順序番号配列GVOrd[i][j]は、一旦、分配処理を実行している演算ユニットのローカルメモリ上に作成され、このグローバル項目値順序番号配列GVOrd[i][j]の要素が少しずつ充填されるのに応じて、少しずつ各演算ユニットへ送信してもよく、或いは、ある程度の量をまとめて一括して各演算ユニットへ送信してもよい。
図18Bは、本発明の一実施形態によるブロック間コンパイル処理における分配処理の結果を示す図である。たとえば、演算ユニットPE-0のローカルメモリ上のグローバル項目値順序番号配列GVOrd[0]には、GVOrd[0][0]=2、GVOrd[0][1]=3という順序番号が格納されている。
図18A及び18Bの例では、ブロック数が増加すると、ローカルメモリ上の作業領域も増大する。そのため、本発明の代替的な実施形態では、特に、ブロック数が多い場合に、処理を効率化するために、複数のブロックをグループ化した後に、グループ毎に分配処理を実施する。たとえば、ブロック番号を4で除算することにより、上位ブロック番号と、下位ブロック番号に分離し(グループ化し)、上位ブロック番号と下位ブロック番号に関して別々に分配処理を適用する。具体的には、ブロック間コンパイル処理におけるマージ処理によって得られたブロック番号配列BlkNo’とグローバル項目値順序番号配列GVOrd’の組から、上位ブロック番号用のブロック番号配列BlkNo’とグローバル項目値順序番号配列GVOrd’の組と、下位ブロック番号用のブロック番号配列BlkNo’とグローバル項目値順序番号配列GVOrd’の組が生成される。この処理もまた、複数台の演算ユニットが並列的に動作して、実行可能である。
図19A乃至19Cは、本発明の一実施形態によるコンパイル処理の結果を説明する図である。図19A、19B及び19Cは、それぞれ、図5B、5C及び5Dと同一である。
[表形式データのソート処理の概要]
次に、本発明の一実施形態による分散メモリ型マルチプロセッサによる表形式データのソート処理について説明する。図20A及び20Bは本発明の一実施形態による表形式データのソート処理の説明図である。図20Aにはソート処理前の表形式データが示され、図20Bにはソート処理後の表形式データが示され、ソート処理前の表形式データは図5Aに示された表形式データと同一である。同図の例では、表形式データは、データ項目=“School”をキーとして、このデータ項目の項目値の昇順(より具体的にはアルファベット順)にレコードが並べ替えられている。ソート前のレコード順序番号=0に相当するレコード(West,12)は、ソート処理によってレコード順序番号が24に変化している。また、ソート前のレコード順序番号=2に相当するレコード(West,11)は、ソート処理後にレコード順序番号が25に変化している。このようにキー値が同値(すなわち、West)である2つのレコードの順序がソート処理の前後で変化しないようなソート処理は「安定性のある」ソート処理と呼ばれる。ここで、レコード(A,B)という表記は、データ項目=“School”の項目値がAであり、データ項目=“Age”の項目値がBであるレコードを表している。
次に、本発明の一実施形態による分散メモリ型マルチプロセッサによる表形式データのソート処理について説明する。図20A及び20Bは本発明の一実施形態による表形式データのソート処理の説明図である。図20Aにはソート処理前の表形式データが示され、図20Bにはソート処理後の表形式データが示され、ソート処理前の表形式データは図5Aに示された表形式データと同一である。同図の例では、表形式データは、データ項目=“School”をキーとして、このデータ項目の項目値の昇順(より具体的にはアルファベット順)にレコードが並べ替えられている。ソート前のレコード順序番号=0に相当するレコード(West,12)は、ソート処理によってレコード順序番号が24に変化している。また、ソート前のレコード順序番号=2に相当するレコード(West,11)は、ソート処理後にレコード順序番号が25に変化している。このようにキー値が同値(すなわち、West)である2つのレコードの順序がソート処理の前後で変化しないようなソート処理は「安定性のある」ソート処理と呼ばれる。ここで、レコード(A,B)という表記は、データ項目=“School”の項目値がAであり、データ項目=“Age”の項目値がBであるレコードを表している。
図20Aに示されたソート処理前の表形式データは、分散メモリ型マルチプロセッサ向けデータ構造を用いると図5B乃至5Dに示されたデータ構造によって表現される。これに対して、図21A乃至21Dは、本発明の一実施形態によるソート処理を、図5A乃至5Dに示された表形式データに適用することにより得られる表形式データの説明図である。図21A乃至21Dを参照して、ソート処理の結果を説明する。たとえば、図21Aの表形式データのレコード順序番号=0に相当するレコード(East,6)は、図21Bのレコード順序番号配列GOrdを参照すると、ブロック2のGOrd[0]=0であることから、ブロック番号=2のブロックに属していることがわかる。このレコード順序番号=0が格納されているレコード順序番号配列GOrd中の要素GOrd[0]の格納位置、すなわち、0は、このブロックを受け持つ演算ユニットの担当レコード中での対象レコードの順位(ランク)を表している。レコード順序番号配列は、本実施形態では、昇順の配列であるため、この格納位置は、周知の2分割法などによって効率的に見つけられる。
次に、ブロック番号=2のブロック中でランク=0が付与されたレコードに含まれる項目情報を取得するために、項目値アクセス情報配列LOrdが参照される。より具体的には、LOrd[0]=0は、ブロック2のブロック中のランク=0が付与されたレコードに含まれる項目情報にアクセスするための項目値指定ポインタを表している。
データ項目=“School”に関する項目情報は図21Cに示されている。ブロック2のブロック中のランク=0が付与されたレコードに含まれる項目値は、
LVL[VNo[LOrd[0]]=“East”
によって得られる。この項目値は次の手順にしたがって取得される。最初に、ブロック2に関するローカル項目値番号配列VNo中で、項目値アクセス情報=LOrd[0]=0によって指定される要素
VNo[LOrd[0]]=VNo[0]=0
を取得する。次に、項目値指定ポインタ配列LVL中で、VNo[0]=0によって指定される要素
LVL[VNo[0]]=LVL[0]=“East”
を取得する。これにより、図21Aの表形式データのレコード順序番号=0に相当するレコードに含まれるデータ項目=“School”に関する項目値は“East”であることが示された。同様に、データ項目=“Age”に関する項目値が6であることも明らかである。
LVL[VNo[LOrd[0]]=“East”
によって得られる。この項目値は次の手順にしたがって取得される。最初に、ブロック2に関するローカル項目値番号配列VNo中で、項目値アクセス情報=LOrd[0]=0によって指定される要素
VNo[LOrd[0]]=VNo[0]=0
を取得する。次に、項目値指定ポインタ配列LVL中で、VNo[0]=0によって指定される要素
LVL[VNo[0]]=LVL[0]=“East”
を取得する。これにより、図21Aの表形式データのレコード順序番号=0に相当するレコードに含まれるデータ項目=“School”に関する項目値は“East”であることが示された。同様に、データ項目=“Age”に関する項目値が6であることも明らかである。
このように、本発明の一実施形態によるソート処理では、ソート処理の前後で変化するのは順序情報(すなわち、レコード順序番号配列及び項目値アクセス情報配列)だけであり、項目情報はソート処理の前後で変化しない。
本実施形態の説明では、項目情報は、ローカル項目値番号配列VNo、ローカル項目値配列LVL、及び、グローバル項目値順序番号配列GVOrdによって構成されている。
[表形式データのソート処理]
表形式データのソート処理は、以下の3ステップにより構成される。図22は、本発明の一実施形態による表形式データのソート処理の概略的なフローチャートである。
表形式データのソート処理は、以下の3ステップにより構成される。図22は、本発明の一実施形態による表形式データのソート処理の概略的なフローチャートである。
ステップ2201:ブロック内ソート
各演算ユニットが並列的に動作して、それぞれのブロック内で、ローカル項目値番号配列VNoをキーとして、項目値アクセス情報配列LOrdに分布数え上げソートを適用し、ソートされた項目値アクセス情報配列LOrdに適合するように、次のステップのためのグローバル項目値順序番号配列GVOrd’及びレコード順序番号配列GOrd’を生成する。当然ながら、1台の演算ユニットに複数のプロセッサが収容されているならば、ブロック単位の処理はプロセッサ毎に実行される。
各演算ユニットが並列的に動作して、それぞれのブロック内で、ローカル項目値番号配列VNoをキーとして、項目値アクセス情報配列LOrdに分布数え上げソートを適用し、ソートされた項目値アクセス情報配列LOrdに適合するように、次のステップのためのグローバル項目値順序番号配列GVOrd’及びレコード順序番号配列GOrd’を生成する。当然ながら、1台の演算ユニットに複数のプロセッサが収容されているならば、ブロック単位の処理はプロセッサ毎に実行される。
ステップ2202:ブロック間ソート1(マージ)
各演算ユニットが並列的かつ階層的に動作して、前のパイプライン段からのグローバル項目値順序番号配列GVOrd’及びレコード順序番号配列GOrd’にブロック番号配列BlkNo’を追加し、グローバル項目値順序番号配列GVOrd’及びレコード順序番号配列GOrd’をキーとして、それぞれのブロックからのグローバル項目値順序番号配列GVOrd’、レコード順序番号配列GOrd’及びブロック番号配列BlkNo’をトーナメント方式で所定の順序にマージする。このステップは順次処理である。
各演算ユニットが並列的かつ階層的に動作して、前のパイプライン段からのグローバル項目値順序番号配列GVOrd’及びレコード順序番号配列GOrd’にブロック番号配列BlkNo’を追加し、グローバル項目値順序番号配列GVOrd’及びレコード順序番号配列GOrd’をキーとして、それぞれのブロックからのグローバル項目値順序番号配列GVOrd’、レコード順序番号配列GOrd’及びブロック番号配列BlkNo’をトーナメント方式で所定の順序にマージする。このステップは順次処理である。
ステップ2203:ブロック間ソート2(分配)
少なくとも1台の演算ユニットがブロック番号配列BlkNo’の先頭の要素から順に、要素の値によって指定されるブロック、すなわち、このブロックに関連付けられた演算ユニットに、要素が格納されている位置の値を送信し、各演算ユニットのローカルメモリ上にレコード順序番号配列GOrdを生成する。
少なくとも1台の演算ユニットがブロック番号配列BlkNo’の先頭の要素から順に、要素の値によって指定されるブロック、すなわち、このブロックに関連付けられた演算ユニットに、要素が格納されている位置の値を送信し、各演算ユニットのローカルメモリ上にレコード順序番号配列GOrdを生成する。
このように、表形式データのソート処理は、ブロック内ソートと、ブロック間ソート1(マージ)と、ブロック間ソート2(分配)の3ステップによって実現される。ここで、ブロック間ソート1(マージ)は、1対のブロックからのデータを所定の順序で並べ替えるという意味でソート処理であり、1対のブロックからのデータを1組のデータに統合するという意味でマージ処理でもある。本文書中において、「所定の順序でマージ」するとは、ブロック間ソート1(マージ)における処理を指している。
以下では、図5A乃至5D、図20A及び20B、及び、図21A乃至21Dに示された例を参照して、本発明の一実施形態による表形式データのソート処理の各ステップの処理をより詳細に説明する。
図23A乃至23Cは本発明の一実施形態による表形式データのソート処理におけるブロック内ソート処理の説明図である。同図には、一例として、ブロック番号=1のブロック(すなわち、ブロック1)に関する処理が記載されているが、他のブロックに関する処理も同様に行われることは当業者に明白であろう。各ブロックに関する処理は、そのブロックが割り当てられた各演算ユニットによって実行される。また、以下の説明では、配列の操作は、C言語に類似した疑似命令によって表現されることがある。
図23Aは分布数え上げソート処理におけるカウントアップ処理の説明図である。図23Aには、ブロック1に関するレコード順序番号配列GOrd、項目値アクセス情報配列LOrd、ローカル項目値番号配列VNo、及び、グローバル項目値順序番号配列GVOrdと、分布数え上げソートのキーとして利用するローカル項目値番号の出現回数をカウントするカウント配列Countの遷移が示されている。カウントアップ処理は、
for (i=0;i<ブロック内レコード数;i++) {
Count[VNo[LOrd[i]]]++;
}
として記述できる。図23Aの例では、1段目がi=0、2段目がi=1、3段目がi=2、4段目がi=3に対応している。
for (i=0;i<ブロック内レコード数;i++) {
Count[VNo[LOrd[i]]]++;
}
として記述できる。図23Aの例では、1段目がi=0、2段目がi=1、3段目がi=2、4段目がi=3に対応している。
図23Bは分布数え上げソート処理における累計数化処理の説明図である。カウントアップ処理の結果として得られたカウント配列Countは、
Count[0]=1
Count[1]=2
Count[2]=1
である。この出現回数を累積度数分布に変換すると(すなわち、累計数化すると)、累積度数分布配列Aggrが得られる。なお、この累計数化処理によって生成される累積度数分布配列Aggrの先頭の要素は0であり、実際の累積度数はAggr[1]以降に格納されている。累計数化処理は、たとえば、
Aggr[0]=0;
for (i=1;i<キー値の個数;i++) {
Aggr[i]=Aggr[i-1]+Count[i-1];
}
として記述できる。
Count[0]=1
Count[1]=2
Count[2]=1
である。この出現回数を累積度数分布に変換すると(すなわち、累計数化すると)、累積度数分布配列Aggrが得られる。なお、この累計数化処理によって生成される累積度数分布配列Aggrの先頭の要素は0であり、実際の累積度数はAggr[1]以降に格納されている。累計数化処理は、たとえば、
Aggr[0]=0;
for (i=1;i<キー値の個数;i++) {
Aggr[i]=Aggr[i-1]+Count[i-1];
}
として記述できる。
最後に、このようにして生成された累積度数分布配列Aggrの要素をポインタとして利用して項目値アクセス情報配列LOrdの要素をコピーすることにより、ソートされた項目値アクセス情報配列LOrd’が得られる。図23Cは分布数え上げソート処理における転送処理の説明図である。転送処理では、配列LOrdの要素を配列LOrd’へコピーするだけでなく、新たに生成された配列LOrd’に対応するグローバル項目値順序番号配列GVOrd’及びレコード順序番号配列GOrd’も生成される。たとえば、図23Cの最上段には、LOrd[0]をコピーする処理が示されている。LOrd[0]=0は、LOrd’の要素LOrd’[1]へコピーされている。これは、LOrd[0]であるレコードに含まれる項目値のローカル項目値番号VNo[0]が1であることから、累積度数分布配列Aggr中の要素Aggr[1]=1をポインタとして利用して、項目値アクセス情報配列LOrd’の要素LOrd’[1]にLOrd[0]=0をコピーすることによって実現されている。この転送処理は、一般的に、たとえば、
for (i=0;i<ブロック内のレコード数;i++) {
LOrd’[Aggr[VNo[LOrd[i]]]]=LOrd[i];
GVOrd’[Aggr[VNo[LOrd[i]]]]=GVOrd[VNo[LOrd[i]]];
GOrd’[Aggr[VNo[LOrd[i]]]]=GOrd[i];
Aggr[VNo[LOrd[i]]]++;
}
として記述できる。
for (i=0;i<ブロック内のレコード数;i++) {
LOrd’[Aggr[VNo[LOrd[i]]]]=LOrd[i];
GVOrd’[Aggr[VNo[LOrd[i]]]]=GVOrd[VNo[LOrd[i]]];
GOrd’[Aggr[VNo[LOrd[i]]]]=GOrd[i];
Aggr[VNo[LOrd[i]]]++;
}
として記述できる。
このようにして得られた項目値アクセス情報配列LOrd’は、ソート後のブロック内での最終的な項目値アクセス情報配列LOrdと一致する。また、新たに生成されたグローバル項目値順序番号配列GVOrd’とレコード順序番号配列GOrd’は、ブロック内で項目値をキーとしてソートされたレコードに対応している。
本発明の一実施形態によれば、各演算ユニットによってブロック内でソートされた表形式データのレコードは、次に、ブロック間でマージされる。ブロック間のマージでは、それぞれのブロック内でソートされているデータが併合され、全体としてソートされた併合データが生成される。より具体的には、グローバル項目値順序番号配列GVOrd’の要素とレコード順序番号配列GOrd’の要素の組がソートされる。レコード順序番号配列GOrd’の要素はレコード毎に一意に決まる値をもつので、グローバル項目値順序番号配列GVOrd’の要素とレコード順序番号配列GOrd’の要素の組は一意である。あるデータ項目に関するグローバル項目値順序番号配列GVOrd’の要素は、そのデータ項目に関する項目値が所定の順序で整列させられた仮想的なグローバル項目値配列の要素の位置を指示するので、グローバル項目値順序番号配列GVOrd’の要素の値の順番にソートすることは、項目値の順番にソートすることと等価である。なお、ブロック内ソート処理の結果として得られたグローバル項目値順序番号配列GVOrd’及びレコード順序番号配列GOrd’には、各ブロック内のレコードが属するブロック番号を表すブロック番号配列BlkNo’が後の処理のため追加される。
図24は、このようにして得られた、本発明の一実施形態による表形式データのソート処理におけるブロック内ソート処理の結果の説明図である。この時点で、各ブロック内の項目値アクセス情報配列LOrdは最終的な結果と一致しているので、LOrdのようにプライム記号(’)無しで示されている。一方、グローバル項目値順序番号配列GVOrd’及びレコード順序番号配列GOrd’は最終的な結果ではなく、処理途中の作業用配列を表しているので、プライム記号(’)付きで示されている。さらに、追加的に生成されたブロック番号配列BlkNo’も示されている。
本発明の一実施形態による表形式データのソート処理におけるブロック間ソート処理1(マージ処理)は、図13に示された階層構造と同じ階層構造によって実現することが可能である。ブロック0から7に関連付けられた演算ユニット0から演算ユニット7によって並列的にローカルソート処理が実行されると、1段目のマージ処理として、演算ユニット0によるブロック0とブロック1のマージ処理、演算ユニット2によるブロック2とブロック3のマージ処理、演算ユニット4によるブロック4とブロック5のマージ処理、及び、演算ユニット6によるブロック6とブロック7のマージ処理が実行される。2段目のマージ処理は、演算ユニット1によるブロック0-1とブロック2-3のマージ処理、及び、演算ユニット5によるブロック4-5とブロック6-7のマージ処理により実現される。最後に、3段目のマージ処理として、演算ブロック3が、ブロック0-3とブロック4-7のマージ処理を実行する。各パイプライン段でマージ処理を担当する演算ユニットは上記の組み合わせに限定されないことに注意を要する。なお、分配処理は、たとえば、演算ユニット7によって実行される。
ブロック間ソート処理1(すなわち、マージ処理)では、各演算ユニットが、1対のブロックに関する情報をマージして、マージされたより高い層の1個のブロックに関する情報を生成する。よって、マージ処理は、複数台の演算ユニットの並列動作によって実現される。また、各演算ユニットは、同じ層に属するマージされたブロックの対に関する情報をマージし、マージされたさらに高い層の1個のブロックに関する情報を生成する。このようにマージ処理を並列的かつ階層的に繰り返すことにより、最終的に最上層の1個のブロックに関する情報が生成される。最上層の1個のブロックとは、レコード全体を含むブロックである。
続いて、本発明の一実施形態による表形式データのソート処理におけるブロック間ソート処理1(ブロック間マージ処理)をより詳細に説明する。図25A乃至25Cは、本発明の一実施形態による表形式データのソート処理における1段目のブロック間マージ処理の説明図である。本例では、PE-0がブロックBlock-0(以下、ブロック0)とブロックBlock-1(ブロック1)との間で所定の順序のマージ処理を実行する。ブロック間マージ処理は、2つの昇順リストから1つの昇順リストを生成するという点で昇順リストのマージ処理である。
図25Aには、ブロック0内の1番目のレコードに関する情報(B0(GVOrd’,GOrd’)のように表す)とブロック1内の1番目のレコードに関する情報(B1(GVOrd’,GOrd’)のように表す)とを比較する処理が示されている。このとき、ブロック0側の読み出しポインタとブロック1側の読み出しポインタは共にデータの先頭に位置している。GVOrd’を上位の桁、GOrd’を下位の桁とみなして、ブロック0側及びブロック1側からの(GVOrd’,GOrd’)を所定の順番(たとえば、昇順)に並べる。本例では、
B0(GVOrd’,GOrd’)=(2,1)>B1(GVOrd’,GOrd’)=(1,5)
であるので、B1(GVOrd’,GOrd’)が先頭(最も小さい)要素であることが判定される。よって、ブロック番号を含めた要素の組B1(1,5,1)がマージ処理の結果として取り出される。このマージ処理の結果は、
GVOrd’[0]=1
GOrd’[0]=5
BlkNo’[0]=1
のように記述できる。これにより、ブロック1側のデータが取り出されたので、ブロック1側の読み出しポインタが1つ先へ進められる。
B0(GVOrd’,GOrd’)=(2,1)>B1(GVOrd’,GOrd’)=(1,5)
であるので、B1(GVOrd’,GOrd’)が先頭(最も小さい)要素であることが判定される。よって、ブロック番号を含めた要素の組B1(1,5,1)がマージ処理の結果として取り出される。このマージ処理の結果は、
GVOrd’[0]=1
GOrd’[0]=5
BlkNo’[0]=1
のように記述できる。これにより、ブロック1側のデータが取り出されたので、ブロック1側の読み出しポインタが1つ先へ進められる。
図25Bでは、読み出しポインタが先頭に位置しているブロック0内の1番目のレコードと、読み出しポインタが1つ先へ進められたブロック1内の2番目のレコードとを比較する処理が示されている。同様に、B0(2,1)とB1(2,4)とを比較すると、B0(2,1)の方が小さいと判定されるので、ブロック番号を含めた要素の組B0(2,1,0)がマージ処理の結果、すなわち、
GVOrd’[1]=2
GOrd’[1]=1
BlkNo’[1]=0
として取り出される。これにより、ブロック0側のデータが取り出されたので、ブロック0側の読み出しポインタが1つ先へ進められる。
GVOrd’[1]=2
GOrd’[1]=1
BlkNo’[1]=0
として取り出される。これにより、ブロック0側のデータが取り出されたので、ブロック0側の読み出しポインタが1つ先へ進められる。
このように、ポインタを進めながら、ブロック0側のデータとブロック1側のデータを順次比較することにより、最終的に、ブロック0側のデータとブロック1側のデータがマージされた昇順のリストが得られる。図25Cには、最終的に取り出されたグローバル項目値順序番号配列GVOrd’とレコード順序番号配列GOrd’とブロック番号配列BlkNo’とが示されている。
なお、取り出されたグローバル項目値順序番号配列GVOrd’とレコード順序番号配列GOrd’とブロック番号配列BlkNo’は、2段目のマージ処理のため、本例では、たとえば、PE-1へ送出されるが、最終的な結果を一括して送出するのではなく、ブロック0側とブロック1側の比較処理を進めながら、取り出されたデータを必要に応じて、PE-0からPE-1へ送出してもよい。
以上の説明からわかるように、本発明の一実施形態によるブロック間ソート処理1(マージ処理)の1段目の処理では、データアクセスがシーケンシャルアクセスだけに限定され、かつ、各演算ユニットが並列にブロック間ソート処理1を実行可能である。よって、マルチプロセッサ型処理装置の性能が十分に活かされている。
今度は、演算ユニットPE-1が、PE-0から出力されたブロック0~1と、PE-2から出力されたブロック2~3に所定の順序のマージ処理を適用し、1つのブロック0~3を出力する2段目のブロック間ソート処理1について説明する。図26A及び26Bは、本発明の一実施形態による表形式データのソート処理における2段目のマージ処理の説明図である。2段目のマージ処理は、入力される情報が他の演算ユニットのローカルメモリから転送される点を除いて、1段目のマージ処理と同様である。この処理を簡単に説明すると、図26Aに示されているように、最初、2つのブロックからのグローバル項目値順序番号配列GVOrd’、レコード順序番号配列GOrd’、及び、ブロック番号配列BlkNo’の読み出し用ポインタが先頭に設定される。両方の(GVOrd’,GOrd’)の組の値を比較すると、
B0~1(GVOrd’,GOrd’)=(1,5)>B2~3(GVOrd’,GOrd’)=(0,8)
であることから、B2~3側の要素の方が小さいということがわかる。よって、B2~3側の先頭の要素の組であるB2~3(0,8,2)を取り出す。そして、要素の組が取り出された方のB2~3側の読み出しポインタが1つ先へ進められる。ここで、Ba~bという表記は、ブロックaからブロックbまでの間の所定の順序のマージ処理の結果として得られたデータを表している。
B0~1(GVOrd’,GOrd’)=(1,5)>B2~3(GVOrd’,GOrd’)=(0,8)
であることから、B2~3側の要素の方が小さいということがわかる。よって、B2~3側の先頭の要素の組であるB2~3(0,8,2)を取り出す。そして、要素の組が取り出された方のB2~3側の読み出しポインタが1つ先へ進められる。ここで、Ba~bという表記は、ブロックaからブロックbまでの間の所定の順序のマージ処理の結果として得られたデータを表している。
このような要素の組の大小比較と、小さい方の要素の組の読み出しを繰り返すことにより、図26Bに示されているように、最後にB2~3側の要素の組であるB2~3(3,13,3)が取り出され、2段目のマージ処理が終了する。
なお、取り出されたグローバル項目値順序番号配列GVOrd’とレコード順序番号配列GOrd’とブロック番号配列BlkNo’は、3段目のマージ処理のため、本例では、PE-3へ送出されるが、最終的な結果を一括して送出するのではなく、ブロック0側とブロック1側の比較処理を進めながら、取り出されたデータを必要に応じて、PE-1からPE-3へ送出してもよい。また、以上の説明からわかるように、本発明の一実施形態によるブロック間ソート処理1(マージ処理)の2段目の処理では、データアクセスがシーケンシャルアクセスだけに限定され、かつ、各演算ユニットが並列にブロック間ソート処理1を実行可能である。よって、マルチプロセッサ型処理装置の性能が十分に活かされている。
2段目のマージ処理は、本例では、PE-1とPE-5によって並列に実行されている。PE-1は、ブロック0からブロック3までのブロック間マージ処理の結果をブロック0~3としてPE-3へ出力し、PE-5は、ブロック4からブロック7までのブロック間マージ処理の結果をブロック4~7としてPE-3へ出力する。本例では、ブロックの総数は、ブロック0からブロック7までの8ブロックであるため、PE-3による3段目のマージ処理によって、全てのブロックからのデータのマージが終了し、すなわち、全てのブロックを考慮したソート処理が終了する。当業者によって理解されるように、ブロック数が9個以上ある場合には、たとえば、マージ処理の段数を増加させることにより、最終的に全てのブロックからのデータがマージされたソート処理結果を得ることが可能である。
図27は、本発明の一実施形態による表形式データのソート処理における3段目のマージ処理の説明図である。3段目のマージ処理もまた、1段目のマージ処理及び2段目のマージ処理と同様に、B0~3側のデータB0~3(GVOrd’,GOrd’)とB4~7側のデータB0~4(GVOrd’,GOrd’)を先頭から順番に比較し、小さい方の要素の組を取り出し、要素が取り出された側のデータの読み出し用ポインタを1つ先へ進める、という操作を繰り返す。これにより、図27の右側に示されているような配列の組、すなわち、グローバル項目値順序番号配列GVOrd’、レコード順序番号配列GOrd’、及び、ブロック番号配列BlkNo’の組が得られる。この配列の組は、全レコードのソート結果を表現している。たとえば、グローバル項目値順序番号配列GVOrd’を参照すると、先頭から、同一値を含めて値が昇順に並べられているので、仮想的なグローバル項目値配列中の項目値の整列順にレコードがソートされていることがわかる。また、グローバル項目値順序番号配列GVOrd’の要素の値が同一であるレコードは、レコード順序番号配列GOrd’を参照することにより、ソート前のレコード順序番号の昇順に整列されていることもわかる。このように、レコード順序番号に関して安定性のあるソート結果が得られた理由は、ブロック間ソートの際に、項目値指定ポインタとレコード順序番号の組に関する大小関係に基づいてレコードの並べ替えが行われたからである。
本発明の一実施形態による表形式データのソート処理におけるブロック間ソート処理1(マージ処理)によって得られた3つの配列から次のことがわかる。たとえば、配列の組の1行目のデータ=(0,8,2)を参照すると、ソート後にレコード順序番号0が付与されるレコードは、
(i)ソートのキーとなるデータ項目に関する項目値のグローバル項目値順序番号の値が0であり、
(ii)ソート前に付与されていたレコード順序番号が8であり、
(iii)ブロック2に属している。
(i)ソートのキーとなるデータ項目に関する項目値のグローバル項目値順序番号の値が0であり、
(ii)ソート前に付与されていたレコード順序番号が8であり、
(iii)ブロック2に属している。
発明の理解を助けるため、このブロック間ソート処理1(マージ処理)の結果が分散メモリ型マルチプロセッサ向けのデータ構造で表現される。
本発明の一実施形態による表形式データのソート処理では、最後に、各ブロックに属するレコードのレコード順序番号を決定する。このレコード順序番号を決定する処理は、ブロック間ソート処理2(分配処理)と呼ばれる。図28に示す分配処理では、少なくとも1台の演算ユニット又はプロセッサコア(たとえば、本例では、演算ユニットPE-7)が、ブロック番号配列BlkNo’の添字iに相当するレコード順序番号をブロック番号BlkNo[i]で表されるブロック毎に分配し、分配されたレコード順序番号をブロック内で所定の順番(たとえば、昇順)に並べる。この処理は、たとえば、ブロックjのレコード順序番号配列のk番目の要素をGOrd[j][k]とし、レコード順序番号配列GOrd[j]にレコード順序番号を設定するための書き込み用ポインタkをOffsets[j]とすると、次のように記述できる。
オフセット配列Offsetsを初期化;
for (i=0;i<レコード総数;i++) {
GOrd[BlkNo[i]][Offsets[BlkNo[i]]=i;
Offsets[BlkNo[i]]++;
}
或いは、複数台の演算ユニット又はプロセッサコアがブロック番号配列BlkNoの一部を分担して分配処理を行ってもよい。そのため、あるブロックに関するレコード順序番号配列GOrd[j]は複数台の演算ユニットによって分担して処理される。そして、複数の演算ユニットによって分担して作成されたレコード順序番号配列がブロック毎に1つのレコード順序番号配列に統合される。ブロック番号配列BlkNo’の複数台の演算ユニットへの割り当てが連続的に行われるならば、すなわち、各演算ユニットが担当するブロック番号配列BlkNo’の一部が連続しているならば、この統合処理は非常に簡単化される。なぜならば、同一のブロックに関して、別々の演算ユニットによって作成されたレコード順序番号配列の間で要素の順番を入れ替える必要がないからである。つまり、レコード順序番号配列の統合処理は、別々に作成されたレコード順序番号配列を単に連結することにより達成される。
オフセット配列Offsetsを初期化;
for (i=0;i<レコード総数;i++) {
GOrd[BlkNo[i]][Offsets[BlkNo[i]]=i;
Offsets[BlkNo[i]]++;
}
或いは、複数台の演算ユニット又はプロセッサコアがブロック番号配列BlkNoの一部を分担して分配処理を行ってもよい。そのため、あるブロックに関するレコード順序番号配列GOrd[j]は複数台の演算ユニットによって分担して処理される。そして、複数の演算ユニットによって分担して作成されたレコード順序番号配列がブロック毎に1つのレコード順序番号配列に統合される。ブロック番号配列BlkNo’の複数台の演算ユニットへの割り当てが連続的に行われるならば、すなわち、各演算ユニットが担当するブロック番号配列BlkNo’の一部が連続しているならば、この統合処理は非常に簡単化される。なぜならば、同一のブロックに関して、別々の演算ユニットによって作成されたレコード順序番号配列の間で要素の順番を入れ替える必要がないからである。つまり、レコード順序番号配列の統合処理は、別々に作成されたレコード順序番号配列を単に連結することにより達成される。
今度は、図29A乃至29Eを参照して、本発明の一実施形態による表形式データのソート処理の流れ、特に、ブロック間ソート処理の流れをもう一度説明する。図29Aは、本発明の一実施形態によるブロック間ソート処理の説明図である。図29Aに示されているように、ブロック内ソート処理によって、各演算ユニットのローカルメモリには、担当レコード(すなわち、それぞれのブロック)に関する項目値アクセス情報配列LOrd、グローバル項目値順序番号配列GVOrd’、レコード順序番号配列GOrd’、及び、ブロック番号配列BlkNo’が作成されている。図29Bに示されているように、パイプライン処理の1段目では、演算ユニット0が演算ユニット0及び演算ユニット1からのローカルデータをマージし、演算ユニット2が演算ユニット2及び演算ユニット3からのローカルデータをマージし、演算ユニット4が演算ユニット4及び演算ユニット5からのローカルデータをマージし、演算ユニット6が演算ユニット6及び演算ユニット7からのローカルデータをマージする。次に、図29Cに示されているように、パイプライン処理の2段目では、演算ユニット1が演算ユニット0及び演算ユニット2からのローカルデータをマージし、演算ユニット5が演算ユニット4及び演算ユニット6からのローカルデータをマージする。次に、図29Dに示されているように、パイプライン処理の3段目では、演算ユニット3が演算ユニット1及び演算ユニット5からのローカルデータをマージする。このように、ブロック間処理におけるマージ処理はトーナメント方式で階層的に行われる。最後に、図29Eに示されているように、演算ユニット7は、演算ユニット3によって生成された最終的なローカルデータのうち、ブロック番号配列BlkNo’を先頭から受信し、ブロック番号がブロック番号配列中で格納されている位置、すなわち、レコード順序番号を、ブロック番号に関連付けられた演算ユニットへ分配する。レコード順序番号が分配された演算ユニットは、分配されたレコード順序番号をそれぞれのローカルメモリ上のレコード順序番号配列GOrdに順次に格納する。なお、図29Dには、説明の便宜上、ブロック番号配列BlkNo’の他に、グローバル項目値順序番号配列GVOrd’及びレコード順序番号配列GOrd’が示されているが、必要とされる最終的なマージ結果は、ブロック番号配列BlkNo’であることに注意を要する。したがって、マージ処理の最終段では、ブロック番号配列BlkNo’だけを生成すればよい。なお、パイプライン処理の3段目に位置している演算プロセッサ3が分配処理をさらに行っても構わない。
図30は、以上の本発明の一実施形態による表形式データのソート処理によって生成された順序情報の説明図である。これは、図21Bに示されたソート後の順序集合と一致している。ソート処理によって、項目情報は変化しないことに注意を要する。
[表形式データの多項目ソート処理]
本発明の一実施形態による表形式データのソート処理は、所定のデータ項目に関するソート処理である。このソート処理によって変化するのは、レコード順序番号配列及び項目値アクセス情報配列である。一方、各ブロックに属するレコード、及び、項目情報は変化しない。よって、複数のデータ項目に関するソート処理は、上述の所定のデータ項目に関するソート処理を繰り返すことによって実現される。本発明の分散メモリ型マルチプロセッサの好ましい一実施形態によれば、多項目ソート処理は、制御ユニットが、複数のデータ項目に関してソート処理を繰り返すように演算ユニットを制御することによって実現される。
本発明の一実施形態による表形式データのソート処理は、所定のデータ項目に関するソート処理である。このソート処理によって変化するのは、レコード順序番号配列及び項目値アクセス情報配列である。一方、各ブロックに属するレコード、及び、項目情報は変化しない。よって、複数のデータ項目に関するソート処理は、上述の所定のデータ項目に関するソート処理を繰り返すことによって実現される。本発明の分散メモリ型マルチプロセッサの好ましい一実施形態によれば、多項目ソート処理は、制御ユニットが、複数のデータ項目に関してソート処理を繰り返すように演算ユニットを制御することによって実現される。
よって、たとえば、図5Aに示された表形式データに対して、最初に、項目=“School”に関してソート処理を実行し、次に、項目=”Age”に関してソート処理を実行する場合(多段階ソート処理)、上述のソート処理によって項目=“
School”に関するソートを行い、続いて、同様に、項目=“Age”に関するソート処理を実行すればよい。なお、複数のデータ項目に関してソート処理を順次適用する場合、優先度の高いデータ項目に関するソート処理が後から適用される。
School”に関するソートを行い、続いて、同様に、項目=“Age”に関するソート処理を実行すればよい。なお、複数のデータ項目に関してソート処理を順次適用する場合、優先度の高いデータ項目に関するソート処理が後から適用される。
或いは、代替的な実施形態では、多項目ソート処理を1段階で実現することも可能である。これば、上記の実施形態におけるブロック内ソート処理で実行される分布数え上げソート処理を複数の項目を併合して実行することにより実現される。たとえば、図5Aの表形式データの例において、項目=“School”を優先度の低い項目とし、項目=“Age”を優先度の高い項目として、多項目ソート処理を実施する場合を考える。項目=“School”のグローバル項目値順序番号の値Xと項目=“Age”のグローバル項目値順序番号の値Yとを組み合わせて生成される値Zを新たなグローバル項目値順序番号とみなしてソート処理を実行すればよい。本例では、Xの値の取り得る範囲が0≦X≦3の4通りであり、かつ、Yの値の取り得る範囲が0≦Y≦6の7通りであるので、2つの項目値の組み合わせに対して、4×7=28の値、すなわち、0から27までの値を割り付ける。より具体的には、項目=“Age”が優先度の高い項目であることから、
Z=4×Y+X
という値Zを新たなグローバル項目値順序番号とみなして、ソート処理を実行すればよい。
Z=4×Y+X
という値Zを新たなグローバル項目値順序番号とみなして、ソート処理を実行すればよい。
実際的には、新たな項目値をもつ新たな表形式データを作成する必要はなく、分布数え上げソート処理のキー値Zとして、値Z=4×Y+Xを使用すればよい。そして、この新しい項目値指定ポインタZを用いて、ブロック内ソート処理、ブロック間ソート処理1(マージ処理)、及び、ブロック間ソート処理2(分配処理)を実行することにより、データ項目毎にソート処理を実行する場合と同じ結果を得ることができる。なお、ソートが適用される項目の優先順に応じてソート処理の結果が異なることは当然である。
[表形式データの検索処理の概要]
次に、本発明の一実施形態による分散メモリ型マルチプロセッサによる表形式データの検索処理について説明する。図31A及び31Bは本発明の一実施形態による表形式データの検索処理の説明図である。図31Aには検索処理前の表形式データが示され、図31Bには検索処理後の表形式データが示され、検索処理前の表形式データは図5Aに示された表形式データと同一である。同図の例では、表形式データにおいて、項目=“School”に関して、項目値=“North”という検索条件に一致するレコードが検索されている。検索前のレコード順序番号=5に相当するレコード(North,6)は、検索処理によってレコード順序番号=0のレコードとして取り出されている。また、検索前のレコード順序番号=2に相当するレコード(West,11)は、検索条件に一致していないので、検索後の表形式データ中に現れない。ここで、レコード(A,B)という表記は、データ項目=“School”の項目値がAであり、データ項目=“Age”の項目値がBであるレコードを表している。
次に、本発明の一実施形態による分散メモリ型マルチプロセッサによる表形式データの検索処理について説明する。図31A及び31Bは本発明の一実施形態による表形式データの検索処理の説明図である。図31Aには検索処理前の表形式データが示され、図31Bには検索処理後の表形式データが示され、検索処理前の表形式データは図5Aに示された表形式データと同一である。同図の例では、表形式データにおいて、項目=“School”に関して、項目値=“North”という検索条件に一致するレコードが検索されている。検索前のレコード順序番号=5に相当するレコード(North,6)は、検索処理によってレコード順序番号=0のレコードとして取り出されている。また、検索前のレコード順序番号=2に相当するレコード(West,11)は、検索条件に一致していないので、検索後の表形式データ中に現れない。ここで、レコード(A,B)という表記は、データ項目=“School”の項目値がAであり、データ項目=“Age”の項目値がBであるレコードを表している。
図31Aに示された検索処理前の表形式データは、分散メモリ型マルチプロセッサ向けデータ構造を用いると図5B乃至5Dに示されたデータ構造によって表現される。これに対して、図32A乃至32Dは、本発明の一実施形態による検索処理を、図5A乃至5Dに示された表形式データに適用することにより得られる表形式データの説明図である。図32A乃至32Dを参照して、検索処理の結果を説明する。図32Aには、図31Aに対応する検索前の(すなわち、検索元の)表形式データの順序情報が示されている。図32Bには、図31Bに対応する検索後の表形式データの順序情報が示され、図32C及び図32Dには、図32Bに対応する検索後の表形式データの項目情報が示されている。
たとえば、図31Aの表形式データのブロック0には、検索条件に一致するレコードが存在しないので、図32Bの表形式データのブロック0に関する順序情報には、検索結果となるデータが存在しない。一方、図31Aの表形式データのブロック1には、検索条件に一致するレコード(North,6)が存在するので、図32Bの表形式データのブロック1に関する順序情報には、検索結果として、レコード順序番号配列GOrd[0]=0と、項目値アクセス情報配列[0]=1が格納されている。この検索結果は、レコード(North,6)が検索結果の中でレコード順序番号=0のレコードであり、かつ、このレコードに属する項目値が、ブロック1の項目情報の中でランク=1に対応する領域に格納されていることを意味している。
このように、本発明の一実施形態による検索処理では、検索処理の前後で変化するのは順序情報(すなわち、レコード順序番号配列及び項目値アクセス情報配列)だけであり、項目情報はソート処理の前後で変化しない。本実施形態の説明では、項目情報は、ローカル項目値番号配列VNo、ローカル項目値配列LVL、及び、グローバル項目値順序番号配列GVOrdによって構成されている。
[表形式データの検索処理]
表形式データの検索処理は、以下の5ステップにより構成される。図33は、本発明の一実施形態による表形式データの検索処理の概略的なフローチャートである。上述の通り、検索では、順序情報だけが変化する。したがって、検索処理によって作成されるのは、レコード順序番号配列GOrd及び項目値アクセス情報配列LOrdである。
表形式データの検索処理は、以下の5ステップにより構成される。図33は、本発明の一実施形態による表形式データの検索処理の概略的なフローチャートである。上述の通り、検索では、順序情報だけが変化する。したがって、検索処理によって作成されるのは、レコード順序番号配列GOrd及び項目値アクセス情報配列LOrdである。
ステップ3301:ローカル処理(ヒットフラグ配列設定)
各演算ユニットが並列的に動作して、それぞれのブロック内で、検索対象となる項目に関して、ローカル項目値配列LVL内の各項目値が検索条件に一致するかどうかを判定し、検索条件に一致する項目値に対応するヒットフラグ配列の要素をセットする。当然ながら、1台の演算ユニットに複数のプロセッサが収容されているならば、ブロック単位の処理はプロセッサ毎に実行される。
各演算ユニットが並列的に動作して、それぞれのブロック内で、検索対象となる項目に関して、ローカル項目値配列LVL内の各項目値が検索条件に一致するかどうかを判定し、検索条件に一致する項目値に対応するヒットフラグ配列の要素をセットする。当然ながら、1台の演算ユニットに複数のプロセッサが収容されているならば、ブロック単位の処理はプロセッサ毎に実行される。
ステップ3302:ローカル処理(レコード抽出)
各演算ユニットが並列的に動作して、ヒットフラグがセットされている項目値に対応するレコード順序番号及び項目値アクセス情報を抽出し、レコード順序番号配列GOrd及び項目値アクセス情報配列LOrdを作成する。
各演算ユニットが並列的に動作して、ヒットフラグがセットされている項目値に対応するレコード順序番号及び項目値アクセス情報を抽出し、レコード順序番号配列GOrd及び項目値アクセス情報配列LOrdを作成する。
ステップ3303:グローバル処理(ブロック番号設定)
各演算ユニットが並列的に動作して、作成されたレコード順序番号配列GOrdと同じサイズのブロック番号配列BlkNoを作成し、ブロック番号を設定する。
各演算ユニットが並列的に動作して、作成されたレコード順序番号配列GOrdと同じサイズのブロック番号配列BlkNoを作成し、ブロック番号を設定する。
ステップ3304:グローバル処理(マージ処理)
各演算ユニットのマージ手段が、レコード順序番号配列GOrd及びブロック番号配列BlkNoをトーナメント方式でマージする。
各演算ユニットのマージ手段が、レコード順序番号配列GOrd及びブロック番号配列BlkNoをトーナメント方式でマージする。
ステップ3305:グローバル処理(分配処理)
少なくとも1台の演算ユニットの分配手段が、最終的なブロック番号配列BlkNoの先頭の要素から順に、この要素が格納されている位置の値、すなわち、順序番号を、この要素の値によって指定されるブロック、すなわち、このブロックに関連付けられた演算ユニットへ送信し、各演算ユニットが送信された順序番号をそれぞれのレコード順序番号配列GOrdに順次に格納する。
少なくとも1台の演算ユニットの分配手段が、最終的なブロック番号配列BlkNoの先頭の要素から順に、この要素が格納されている位置の値、すなわち、順序番号を、この要素の値によって指定されるブロック、すなわち、このブロックに関連付けられた演算ユニットへ送信し、各演算ユニットが送信された順序番号をそれぞれのレコード順序番号配列GOrdに順次に格納する。
このように、表形式データの検索処理は、ブロック内での検索処理に相当するローカル処理と、ブロック間でのマージ処理と、ブロック間での分配処理とを含む。
以下では、図34乃至36に示された例を参照して、本発明の一実施形態による表形式データの検索処理の各ステップの処理をより詳細に説明する。
図34は本発明の一実施形態による表形式データの検索処理におけるヒットフラグ配列設定処理の説明図である。同図に示されているように、各演算ユニットは、検索対象となる項目=“School”に関して、ローカル項目値配列LVLの中で検索条件=“North”に一致する項目値を検索し、ローカルヒットフラグLocal_Hit_Flagの要素のうち、検索条件に一致する項目値に対応する要素をマーキングする(すなわち、フラグを立てる)。たとえば、図34に示された例では、ブロック0には、検索条件に一致する項目値は存在しないが、ブロック1には、検索条件に一致する項目値=“North”が存在するので、ローカルヒットフラグ配列中の“North”のランク=0によって示される位置にフラグが立てられる。
今度は、図35A乃至35Cを参照して、検索条件に一致するレコードを抽出する処理を説明する。図35A乃至35Cは、本発明の一実施形態による表形式データの検索処理におけるローカル処理の説明図である。ここでは、ヒットフラグ配列中のフラグがセットされているレコードが抽出される。具体的には、演算ユニットは、ヒットフラグ配列中のフラグがセットされているレコードの項目値アクセス情報配列LOrd’及びレコード順序番号配列GOrd’をローカルメモリ上に作成する。たとえば、ブロック1に関する演算ユニット1の動作について説明すると、演算ユニット1は、担当レコードのローカル項目値番号配列の要素、すなわち、ローカル項目値番号を配列の先頭から順番に取り出し、このローカル項目値番号によって指定されるヒットフラグ配列の要素がセットされているかどうかを判定する。ヒットフラグがセットされているならば、このローカル項目値番号に対応するレコードは、検索条件に一致しているので、このレコードの項目値アクセス情報及びレコード順序番号がそれぞれ項目値アクセス情報配列LOrd’及びレコード順序番号配列GOrd’に格納される。図35Bに示されているように、このレコード抽出処理は、複数台の演算ユニットによって並列的に実行される。最終的に、図35Cに示されているように、検索条件に一致するレコードに関する項目値アクセス情報配列LOrd’及びレコード順序番号配列GOrd’が演算ユニットのローカルメモリ上に構築される。このとき構築された項目値アクセス情報配列LOrd’は検索結果として生成される順序情報に含まれる項目値アクセス情報LOrdと一致する。
今度は、本発明の一実施形態による表形式データの検索処理のグローバル処理を示す図36を参照して、検索処理のグローバル処理をより詳細に説明する。最初に、各演算ユニットは、レコード抽出処理によって作成されたレコード順序番号配列GOrd’と同じサイズのブロック番号配列BlkNo’をローカルメモリ上に作成し、各演算ユニットの担当レコードを示すブロック番号でこのブロック番号配列を充填する。本例では、演算ユニット0が担当するブロック0には、検索条件に一致するレコードが存在しないので、レコード順序番号配列GOrd’及びブロック番号配列BlkNo’は空である。一方、演算ユニット3が担当するブロック3には、検索条件=“North”に一致するレコードが2つ存在するので、GOrd[0]=14、BlkNo’[0]=3、及び、GOrd[1]=15、BlkNo’[1]=3というローカルデータが作成され、1段目のマージ処理を実行する演算ユニットへ送信される。
本発明の一実施形態によれば、各演算ユニットによってブロック内で検索された表形式データのレコードは、次に、ブロック間でマージされる。ブロック間のマージでは、それぞれのブロック内で検索されたデータが併合され、全体として検索された併合データが生成される。より具体的には、レコード順序番号配列GOrd’の要素とブロック番号配列BlkNo’の要素の組が、レコード順序番号の昇順にマージされる。レコード順序番号配列GOrd’の要素はレコード毎に一意に決まる値をもつので、要素の組は一意である。
本発明の一実施形態による表形式データの検索処理におけるマージ処理は、図13に示された階層構造と同じ階層構造によって実現することが可能である。ブロック0から7に関連付けられた演算ユニット0から演算ユニット7によって並列的にローカル処理が実行されると、1段目のマージ処理として、演算ユニット0によるブロック0とブロック1のマージ処理、演算ユニット2によるブロック2とブロック3のマージ処理、演算ユニット4によるブロック4とブロック5のマージ処理、及び、演算ユニット6によるブロック6とブロック7のマージ処理が実行される。2段目のマージ処理は、演算ユニット1によるブロック0-1とブロック2-3のマージ処理、及び、演算ユニット5によるブロック4-5とブロック6-7のマージ処理により実現される。最後に、3段目のマージ処理として、演算ブロック3が、ブロック0-3とブロック4-7のマージ処理を実行する。各パイプライン段でマージ処理を担当する演算ユニットは上記の組み合わせに限定されないことに注意を要する。なお、分配処理は、たとえば、演算ユニット3とは別の演算ユニット7によって実行されてもよい。
マージ処理では、ソートの場合と同様に、各演算ユニットが、1対のブロックに関する情報をマージして、マージされたより高い層の1個のブロックに関する情報を生成する。よって、マージ処理は、複数台の演算ユニットの並列動作によって実現される。また、各演算ユニットは、同じ層に属するマージされたよりブロックの対に関する情報をマージし、マージされたさらに高い層の1個のブロックに関する情報を生成する。このようにマージ処理を並列的かつ階層的に繰り返すことにより、最終的に最上層の1個のブロックに関する情報が生成される。最上層の1個のブロックとは、レコード全体を含むブロックである。演算ユニット3は、最終的に1つのレコード順序番号配列GOrd’及びブロック番号配列BlkNo’を生成する。レコード順序番号配列GOrd’の要素は、所定の順序(本例では、昇順)に整列させられている。一方、ブロック番号配列BlkNo’の要素は、本例では、偶然に、昇順に並べられているが、一般には、所定の順序に並べられることはない。
本発明の一実施形態による表形式データの検索処理におけるマージ処理は、表形式データのソート処理におけるブロック間ソート処理1(ブロック間マージ処理)と全く同様に実現され得るので、これ以上詳細には説明されない。
以上の説明からわかるように、本発明の一実施形態による検索処理におけるマージ処理では、データアクセスがシーケンシャルアクセスだけに限定され、かつ、各演算ユニットが並列にマージ処理を実行可能である。よって、マルチプロセッサ型処理装置の性能が十分に活かされている。
本発明の一実施形態による表形式データの検索処理におけるマージ処理によって得られた2つの配列から次のことがわかる。たとえば、配列の組の1行目のデータ=(5,1)を参照すると、検索後にレコード順序番号0が付与されるレコードは、
(i)検索前に付与されていたレコード順序番号が5であり、
(ii)ブロック1に属している。
(i)検索前に付与されていたレコード順序番号が5であり、
(ii)ブロック1に属している。
本発明の一実施形態による表形式データの検索処理では、最後に、各ブロックに属するレコードのレコード順序番号を決定する。このレコード順序番号を決定する処理は分配処理と呼ばれる。分配処理では、少なくとも1台の演算ユニット又はプロセッサコア(たとえば、本例では、演算ユニットPE-7)が、ブロック番号配列BlkNo’の添字iに相当するレコード順序番号をブロック番号BlkNo[i]で表されるブロック毎に分配し、分配されたレコード順序番号をブロック内で所定の順番(たとえば、昇順)に並べる。この処理は、たとえば、ブロックjのレコード順序番号配列のk番目の要素をGOrd[j][k]とし、レコード順序番号配列GOrd[j]にレコード順序番号を設定するための書き込み用ポインタkをOffsets[j]とすると、次のように記述できる。
オフセット配列indexを初期化;
for (i=0;i<レコード総数;i++) {
GOrd[BlkNo[i]][Offsets[BlkNo[i]]=i;
Offsets[BlkNo[i]]++;
}
以上の処理によって、各演算ユニットのローカルメモリには、検索条件に一致するレコードのレコード順序番号配列GOrdが作成される。上述されているように、ローカル処理において、項目値アクセス情報LOrdが既に作成されているので、レコード順序番号配列GOrdの作成によって順序情報が完成し、検索処理が終了する。
オフセット配列indexを初期化;
for (i=0;i<レコード総数;i++) {
GOrd[BlkNo[i]][Offsets[BlkNo[i]]=i;
Offsets[BlkNo[i]]++;
}
以上の処理によって、各演算ユニットのローカルメモリには、検索条件に一致するレコードのレコード順序番号配列GOrdが作成される。上述されているように、ローカル処理において、項目値アクセス情報LOrdが既に作成されているので、レコード順序番号配列GOrdの作成によって順序情報が完成し、検索処理が終了する。
或いは、複数台の演算ユニット又はプロセッサコアがブロック番号配列BlkNoの一部を分担して分配処理を行ってもよい。そのため、あるブロックに関するレコード順序番号配列GOrd[j]は複数台の演算ユニットによって分担して処理される。そして、複数の演算ユニットによって分担して作成されたレコード順序番号配列がブロック毎に1つのレコード順序番号配列に統合される。ブロック番号配列BlkNo’の複数台の演算ユニットへの割り当てが連続的に行われるならば、すなわち、各演算ユニットが担当するブロック番号配列BlkNo’の一部が連続しているならば、この統合処理は非常に簡単化される。なぜならば、同一のブロックに関して、別々の演算ユニットによって作成されたレコード順序番号配列の間で要素の順番を入れ替える必要がないからである。つまり、レコード順序番号配列の統合処理は、別々に作成されたレコード順序番号配列を単に連結することにより達成される。
[表形式データの集計処理の概要]
今度は、本発明の一実施形態による表形式データの集計処理について説明する。図37A及び37Bは表形式データの集計処理の説明図であり、図37Aには、集計元の表形式データが示され、図37Bには、集計結果の表形式データが示されている。集計元の表形式データは、School、Class、Ageという3つの項目により形成され、たとえば、レコード順序番号=0のレコードは、
項目=“School”:項目値=“West”
項目=“Class”:項目値=“A”
項目=“Age”:項目値=12
であることがわかる。以下では、Rec[0]=(West,A,12)と表記されることがある。一方、集計結果の表形式データは、School、Class、Ageの個数、Ageの和という4つの項目により形成されている。すなわち、本例では、項目=“Age”に関して、項目値の出現回数と、項目値の和とが集計されている。たとえば、集計結果の表形式データのレコードRec「0」=(East,A,3,20)は、項目=“School”の項目値が“East”であり、項目=“Class”の項目値が“A”であるレコードに関して、項目=“Age”の項目値の出現回数が3回であり(本例では、項目=“Age”の項目値を含まないレコードは存在しないので、項目値の出現回数はレコードの個数と一致している)、項目=“Age”の項目値の和が20であることを意味している。なお、本例における項目=“School”及び項目=“Class”のように、集計とは、表形式データのある項目(次元)のある項目値(次元値)毎に、この項目、又は、別の項目の項目値に基づく数量(測度)を算出することである。測度の算出とは、測度の個数をカウントしたり、測度の総和を算出したり、測度の平均値を算出したりすることである。また、次元数は、本例のように、2次元以上でも構わない。例えば、Schoolという項目と、Cassという項目と、Ageという項目を含む表形式データである場合に、School・Class別にAgeの平均値を求める処理は、SchoolとClassを次元とし、Ageの平均値を測度とする集計処理である。
今度は、本発明の一実施形態による表形式データの集計処理について説明する。図37A及び37Bは表形式データの集計処理の説明図であり、図37Aには、集計元の表形式データが示され、図37Bには、集計結果の表形式データが示されている。集計元の表形式データは、School、Class、Ageという3つの項目により形成され、たとえば、レコード順序番号=0のレコードは、
項目=“School”:項目値=“West”
項目=“Class”:項目値=“A”
項目=“Age”:項目値=12
であることがわかる。以下では、Rec[0]=(West,A,12)と表記されることがある。一方、集計結果の表形式データは、School、Class、Ageの個数、Ageの和という4つの項目により形成されている。すなわち、本例では、項目=“Age”に関して、項目値の出現回数と、項目値の和とが集計されている。たとえば、集計結果の表形式データのレコードRec「0」=(East,A,3,20)は、項目=“School”の項目値が“East”であり、項目=“Class”の項目値が“A”であるレコードに関して、項目=“Age”の項目値の出現回数が3回であり(本例では、項目=“Age”の項目値を含まないレコードは存在しないので、項目値の出現回数はレコードの個数と一致している)、項目=“Age”の項目値の和が20であることを意味している。なお、本例における項目=“School”及び項目=“Class”のように、集計とは、表形式データのある項目(次元)のある項目値(次元値)毎に、この項目、又は、別の項目の項目値に基づく数量(測度)を算出することである。測度の算出とは、測度の個数をカウントしたり、測度の総和を算出したり、測度の平均値を算出したりすることである。また、次元数は、本例のように、2次元以上でも構わない。例えば、Schoolという項目と、Cassという項目と、Ageという項目を含む表形式データである場合に、School・Class別にAgeの平均値を求める処理は、SchoolとClassを次元とし、Ageの平均値を測度とする集計処理である。
このような集計処理では、最初に、次元を設定し、次元値毎にレコードを分類することが必要である。次元値毎にレコードを分類するために、次元値に関してレコードをソートする処理を利用することが可能である。特に、多次元集計においては、レコードを次元値の組毎にグループ化し、同一のグループに属するレコードに含まれる項目値に基づく測度を算出することによって、表形式データ全体の集計が達成される。よって、大規模な表形式データを高速集計するためには、集計のための、特に、多次元集計のための次元を高速に作成する技術が必要である。
図38A乃至38Dは、図37Aと等価である、本発明の一実施形態によるデータ構造で表現された集計元の表形式データの説明図である。図38Aは順序情報を表し、図38Bは項目=“School”に関する項目情報を表し、図38Cは項目=”Class”に関する項目情報を表し、図38Dは項目=“Age”に関する項目情報を表している。レコード順序番号0から3がブロック0に含まれ、レコード順序番号4から7がブロック1に含まれ、レコード順序番号8から11がブロック2に含まれ、レコード順序番号12から15がブロック3に含まれ、レコード順序番号16から19がブロック4に含まれ、レコード順序番号20から23がブロック5に含まれ、レコード順序番号24から27がブロック6に含まれ、レコード順序番号28から31がブロック7に含まれている。この表形式データが上述の本発明のコンパイル処理を用いて演算ユニットのローカルメモリ上に構築できることは明白である。
同様に、図39A乃至39Eは、図37Bと等価である、本発明の一実施形態によるデータ構造で表現された集計結果の表形式データの説明図である。本例では、図37Bに示された集計結果の表形式データは、図37Aに示された集計元の表形式データとはことなるブロックに分割されている。一般に、集計元の表形式データと集計結果の表形式データは、ブロック分割の仕方が異なっている。図39Aは順序情報を表し、図39Bは次元1=“School”の項目情報を表し、図39Cは次元2=“Class”の項目情報を表し、図39Dは測度1=“Count(Age)”の項目情報を表し、図39Eは測度2=“Sum(Age)”の項目情報を表している。本例では、レコード順序番号0から4がブロック0に含まれ、レコード順序番号5と6がブロック1に含まれ、レコード順序番号7と8がブロック2に含まれ、レコード順序番号9から11がブロック3に含まれている。このように表形式データのブロックへの分割法が規定されるならば、この表形式データが上述の本発明のコンパイル処理を用いて演算ユニットのローカルメモリ上に構築できることは明白である。
表形式データの集計処理では、上述されているように、集計元の表形式データに基づいて、別個の集計結果の表形式データが作成される。このとき、集計結果の表形式データのサイズは、各次元の一意の項目値の個数から推定可能である。具体的には、たとえば、(各次元の一意の項目値の個数)の積によって、集計結果の表形式データのレコード数が決定される。なお、各次元の一意の項目値の個数は、集計元の表形式テーブルにおいて、次元に対応する項目に関するグローバル項目値順序番号の最大値に1を加えた値であるので、実際に集計することなく、集計結果の表形式データのサイズが決定され得る。さらに、集計結果の表形式データのブロックへの分割もまた、集計結果の表形式データのサイズに基づいて、事前に決定され得ることに注意を要する。これらの事前知識を利用することにより、表形式データの集計がより効率的に行われる。
今度は、図40を参照して、本発明の一実施形態による表形式データの集計処理の概要を説明する。図40には、本発明の一実施形態による表形式データの集計方法のフローチャートが示されている。集計方法は、
集計元の表形式テーブルを各演算ユニットのローカルメモリ上に展開するステップ4002と、
集計結果の表形式テーブルのサイズ及びブロック分割定義を決定するステップ4004と、
集計結果の表形式テーブルの順序情報を作成するステップ4006と、
次元の分割を決定し、次元の項目情報を作成するステップ4008と、
次元空間に測度の項目値を割り当てるステップ4010と、
測度の項目値を集計するステップ4012と、
測度の項目情報を作成するステップ4014と、
を備える。当然ながら、1台の演算ユニットに複数のプロセッサが収容されているならば、ブロック単位の処理はプロセッサ毎に実行される。
集計元の表形式テーブルを各演算ユニットのローカルメモリ上に展開するステップ4002と、
集計結果の表形式テーブルのサイズ及びブロック分割定義を決定するステップ4004と、
集計結果の表形式テーブルの順序情報を作成するステップ4006と、
次元の分割を決定し、次元の項目情報を作成するステップ4008と、
次元空間に測度の項目値を割り当てるステップ4010と、
測度の項目値を集計するステップ4012と、
測度の項目情報を作成するステップ4014と、
を備える。当然ながら、1台の演算ユニットに複数のプロセッサが収容されているならば、ブロック単位の処理はプロセッサ毎に実行される。
[集計処理における次元の定義]
今度は、集計処理における次元の定義について詳述する。集計の次元となる項目(以下、次元項目とも称される)に関して、仮想的なグローバル項目値配列GVLのサイズ、すなわち、一意の項目値の個数を考える。仮想的なグローバル項目値配列GVLは、ローカル項目値配列LVLの要素の値を重複なくマージすることにより生成される配列である。このGVLのサイズは、集計元の表形式テーブルの次元項目に関するグローバル項目値順序番号の最大値+1である。ここで、グローバル項目値順序番号の最大値は集計元の表形式データから容易に決定される。よって、次元空間のサイズ(すなわち、次元項目の一意の項目値の組の個数)は、GVLのサイズの積である。図38A乃至38Dの例では、次元1(School)のGVLのサイズ=4と次元2(Class)のGVLのサイズ=3とから、次元空間のサイズは4*3=12である。これにより、次元1の項目値番号と次元2の項目値番号の組(次元1の項目値番号,次元2の項目値番号)は、(0,0)、(0,1)、(0,2)、(1,0)、(1,1)、(1,2)、(2,0)、(2,1)、(2,2)、(3,0)、(3,1)、(3,2)の12通りであることがわかる。
今度は、集計処理における次元の定義について詳述する。集計の次元となる項目(以下、次元項目とも称される)に関して、仮想的なグローバル項目値配列GVLのサイズ、すなわち、一意の項目値の個数を考える。仮想的なグローバル項目値配列GVLは、ローカル項目値配列LVLの要素の値を重複なくマージすることにより生成される配列である。このGVLのサイズは、集計元の表形式テーブルの次元項目に関するグローバル項目値順序番号の最大値+1である。ここで、グローバル項目値順序番号の最大値は集計元の表形式データから容易に決定される。よって、次元空間のサイズ(すなわち、次元項目の一意の項目値の組の個数)は、GVLのサイズの積である。図38A乃至38Dの例では、次元1(School)のGVLのサイズ=4と次元2(Class)のGVLのサイズ=3とから、次元空間のサイズは4*3=12である。これにより、次元1の項目値番号と次元2の項目値番号の組(次元1の項目値番号,次元2の項目値番号)は、(0,0)、(0,1)、(0,2)、(1,0)、(1,1)、(1,2)、(2,0)、(2,1)、(2,2)、(3,0)、(3,1)、(3,2)の12通りであることがわかる。
以下では、次元が1からNまでのN次元であり、第i次元(1≦i≦N)のGVLのサイズをCiとして、一般的な例について説明する。
このとき、次元空間のサイズCSize_allは、ΠCi,i=1..Nによって与えられる。但し、Πφ=1とする。集計結果の表形式データは、次元空間のサイズを参照して、0番目から(M-1)番目までのM個のブロックに分割される。各ブロックのサイズはブロックに収容可能なレコード数を考慮して決定される。ここで、ブロックkが集計結果の表形式データのRk行からRk+1-1行までを担当する場合を考える。図39A乃至39Eの例では、
ブロック0の担当範囲:0行から4行
ブロック1の担当範囲:5行から6行
ブロック2の担当範囲:7行から8行
ブロック3の担当範囲:9行から11行
と定義されているので、R0=0、R1=5、R2=7、R3=9、R4=12である。勿論、ブロックの分割定義はこの例に限定されない。
ブロック0の担当範囲:0行から4行
ブロック1の担当範囲:5行から6行
ブロック2の担当範囲:7行から8行
ブロック3の担当範囲:9行から11行
と定義されているので、R0=0、R1=5、R2=7、R3=9、R4=12である。勿論、ブロックの分割定義はこの例に限定されない。
集計結果の表形式データを作成するためには、ブロックkに含まれる次元値を特定することが必要である。ブロックkの第p次元に属する次元値は次のように特定され得る。ここで、次元値、すなわち、項目値は、次元値自体を取り扱う必要はなく、各項目値に付与されているグローバル項目値順序番号によって、個々の項目値を特定することが可能である。グローバル項目値順序番号を用いて記述することにより、項目値のデータ型とは無関係に、整数型を用いて次元値を取り扱うことが可能である。また、次元値を特定するとは、具体的には、ローカル項目値番号配列VNo及びローカル項目値配列LVLを特定することに相当する。
CSize_high=ΠCi,i=p..N
CSize_low=ΠCi,i=p+1..N
但し、Πφ=1
と表すと、CSize_all=4*3=12であり、
第1次元(School)に関して、
CSize_high=4*3=12
CSize_low=3
であり、第2次元(Class)に関して、
CSize_high=3
CSize_low=1
である。
CSize_low=ΠCi,i=p+1..N
但し、Πφ=1
と表すと、CSize_all=4*3=12であり、
第1次元(School)に関して、
CSize_high=4*3=12
CSize_low=3
であり、第2次元(Class)に関して、
CSize_high=3
CSize_low=1
である。
一般的に、第p次元のブロックkのローカル項目値番号配列VNo及びローカル項目値配列LVLの算出は、次の3つのケースに分類して考えることができる。
ケースA:このケースでは、次の関係式、
(Rk+1-Rk)≧CSize_high
が成り立ち、第p次元のすべての項目値がブロックkに含まれている。
(Rk+1-Rk)≧CSize_high
が成り立ち、第p次元のすべての項目値がブロックkに含まれている。
ケースB:このケースでは、次の関係式、
(Rk+1-Rk)<CSize_high
かつ
((Rk mod CSize_high) div CSize_low)≦((Rk+1-1) mod CSize_high) div CSize_low)
が成り立ち、第p次元の項目値が小さい方から順に部分的にブロックkに含まれている。
(Rk+1-Rk)<CSize_high
かつ
((Rk mod CSize_high) div CSize_low)≦((Rk+1-1) mod CSize_high) div CSize_low)
が成り立ち、第p次元の項目値が小さい方から順に部分的にブロックkに含まれている。
ケースC:このケースでは、次の関係式、
(Rk+1-Rk)<CSize_high
かつ
((Rk mod CSize_high) div CSize_low)>((Rk+1-1) mod CSize_high) div CSize_low)
が成り立ち、第p次元の項目値の一部がブロックkに含まれ、しかも、昇順又は降順のような一定の順序ではなく(単調に変化するのではなく)、小さい値から大きい値へ変化している項目値が、ブロックkの途中で、大きい値から小さい値へ変化し、再び小さい値から大きい値へ変化する。
(Rk+1-Rk)<CSize_high
かつ
((Rk mod CSize_high) div CSize_low)>((Rk+1-1) mod CSize_high) div CSize_low)
が成り立ち、第p次元の項目値の一部がブロックkに含まれ、しかも、昇順又は降順のような一定の順序ではなく(単調に変化するのではなく)、小さい値から大きい値へ変化している項目値が、ブロックkの途中で、大きい値から小さい値へ変化し、再び小さい値から大きい値へ変化する。
なお、上記関係式中、divは整数の除算を表し、商の小数点以下は切り捨てられる。また、modは整数の剰余を表している。
この場合分けを上述の本例のブロック分割定義、すなわち、
ブロック0の担当範囲:0行から4行
ブロック1の担当範囲:5行から6行
ブロック2の担当範囲:7行から8行
ブロック3の担当範囲:9行から11行
に適用すると、上述のように、第1次元(School)に関して、
CSize_high=4*3=12
CSize_low=3
であるため、すべてのブロック分割がケースBに分類されることがわかる。たとえば、ブロック0に関して、実際に計算すると、
(Rk+1-Rk)=(5-0)=5
CSize_high=12
より、
(Rk+1-Rk)<CSize_high
が成立し、
((Rk mod CSize_high) div CSize_low)
=((0 mod 12) div 3)=0
((Rk+1-1) mod CSize_high) div CSize_low)
=((5-1) mod 12) div 3
=(4 mod 12) div 3=1
より、
((Rk mod CSize_high) div CSize_low)≦((Rk+1-1) mod CSize_high) div CSize_low)
が成立する。他のブロックについても同様に計算することにより、ケースBに分類されることがわかる。
ブロック0の担当範囲:0行から4行
ブロック1の担当範囲:5行から6行
ブロック2の担当範囲:7行から8行
ブロック3の担当範囲:9行から11行
に適用すると、上述のように、第1次元(School)に関して、
CSize_high=4*3=12
CSize_low=3
であるため、すべてのブロック分割がケースBに分類されることがわかる。たとえば、ブロック0に関して、実際に計算すると、
(Rk+1-Rk)=(5-0)=5
CSize_high=12
より、
(Rk+1-Rk)<CSize_high
が成立し、
((Rk mod CSize_high) div CSize_low)
=((0 mod 12) div 3)=0
((Rk+1-1) mod CSize_high) div CSize_low)
=((5-1) mod 12) div 3
=(4 mod 12) div 3=1
より、
((Rk mod CSize_high) div CSize_low)≦((Rk+1-1) mod CSize_high) div CSize_low)
が成立する。他のブロックについても同様に計算することにより、ケースBに分類されることがわかる。
次に、この場合分けを第2次元(Class)に関して適用すると、上述のように、第2次元(School)に関して、
CSize_high=3
CSize_low=1
であるため、ブロック毎にケースA、ケースB、ケースCに分類されることがわかる。たとえば、ブロック0に関して、実際に計算すると、
(Rk+1-Rk)=(5-0)=5
CSize_high=3
より、
(Rk+1-Rk)≧CSize_high
が成立するので、ブロック0はケースAに分類される。ブロック1に関して、実際に計算すると、
(Rk+1-Rk)=7-5=2
CSize_high=3
より、
(Rk+1-Rk)<CSize_high
であり、さらに、
((Rk mod CSize_high) div CSize_low)
=((5 mod 3) div 1)=2
((Rk+1-1) mod CSize_high) div CSize_low)
=((7-1) mod 3) div 1
=(6 mod 3) div 1=0
より、
((Rk mod CSize_high) div CSize_low)>((Rk+1-1) mod CSize_high) div CSize_low)
が成立するので、ブロック1はケースCに分類される。さらに、ブロック2に関して、実際に計算すると、
(Rk+1-Rk)=9-7=2
CSize_high=3
より、
(Rk+1-Rk)<CSize_high
であり、さらに、
((Rk mod CSize_high) div CSize_low)
=((7 mod 3) div 1)=0
((Rk+1-1) mod CSize_high) div CSize_low)
=((9-1) mod 3) div 1
=(8 mod 3) div 1=2
より、
((Rk mod CSize_high) div CSize_low)≦((Rk+1-1) mod CSize_high) div CSize_low)
が成立するので、ブロック2はケースBに分類される。さらに、ブロック3に関して、実際に計算すると、
(Rk+1-Rk)=12-9=3
CSize_high=3
より、
(Rk+1-Rk)≧CSize_high
が成立するので、ブロック3はケースAに分類される。
CSize_high=3
CSize_low=1
であるため、ブロック毎にケースA、ケースB、ケースCに分類されることがわかる。たとえば、ブロック0に関して、実際に計算すると、
(Rk+1-Rk)=(5-0)=5
CSize_high=3
より、
(Rk+1-Rk)≧CSize_high
が成立するので、ブロック0はケースAに分類される。ブロック1に関して、実際に計算すると、
(Rk+1-Rk)=7-5=2
CSize_high=3
より、
(Rk+1-Rk)<CSize_high
であり、さらに、
((Rk mod CSize_high) div CSize_low)
=((5 mod 3) div 1)=2
((Rk+1-1) mod CSize_high) div CSize_low)
=((7-1) mod 3) div 1
=(6 mod 3) div 1=0
より、
((Rk mod CSize_high) div CSize_low)>((Rk+1-1) mod CSize_high) div CSize_low)
が成立するので、ブロック1はケースCに分類される。さらに、ブロック2に関して、実際に計算すると、
(Rk+1-Rk)=9-7=2
CSize_high=3
より、
(Rk+1-Rk)<CSize_high
であり、さらに、
((Rk mod CSize_high) div CSize_low)
=((7 mod 3) div 1)=0
((Rk+1-1) mod CSize_high) div CSize_low)
=((9-1) mod 3) div 1
=(8 mod 3) div 1=2
より、
((Rk mod CSize_high) div CSize_low)≦((Rk+1-1) mod CSize_high) div CSize_low)
が成立するので、ブロック2はケースBに分類される。さらに、ブロック3に関して、実際に計算すると、
(Rk+1-Rk)=12-9=3
CSize_high=3
より、
(Rk+1-Rk)≧CSize_high
が成立するので、ブロック3はケースAに分類される。
図41には、ブロック0からブロック3のすべてのブロックの第1次元及び第2次元の分類結果が示されている。
[集計処理における次元の項目情報の作成(ローカル処理)]
今度は、図41に示されるような分類結果に基づいて、実際に次元を作成する処理を説明する。第1次元は、すべてのブロックがケースAに分類されているので、以下の例では、第2次元=Classに関して、次元作成処理を説明する。
今度は、図41に示されるような分類結果に基づいて、実際に次元を作成する処理を説明する。第1次元は、すべてのブロックがケースAに分類されているので、以下の例では、第2次元=Classに関して、次元作成処理を説明する。
最初に、ブロック0の第2次元を参照すると、このブロックはケースAに分類されている。ケースAでは、一般的に説明すると、第p次元のすべての値がブロックkに存在する。ブロックkを担当している演算プロセッサは、第p次元の値のすべてがこの演算プロセッサに割り当てられているので、割り当てられた値を参照することにより、第p次元の一意の値の個数(GVLのサイズ)がわかる。よって、グローバル項目値順序番号配列GVOrdを作成することができる。本例では、第2次元=ClassのGVLのサイズは3である。よって、演算プロセッサは、ブロック0のグローバル項目値順序番号配列GVOrdとして、
GVOrd[0]=0
GVOrd[1]=1
GVOrd[2]=2
を作成する。
GVOrd[0]=0
GVOrd[1]=1
GVOrd[2]=2
を作成する。
第2次元に関して、ブロック3もまたケースAに分類されているので、ブロック3のグローバル項目値順序番号配列GVOrdもまた、
GVOrd[0]=0
GVOrd[1]=1
GVOrd[2]=2
である。
GVOrd[0]=0
GVOrd[1]=1
GVOrd[2]=2
である。
次に、ブロックkを担当している演算プロセッサは、第p次元に関して、ローカル項目値番号配列VNoを作成する。ケースAのブロックkに含まれているレコードのレコード順序番号、すなわち、行番号をLとすると、ローカル項目値番号VNoは、
VNo=(L mod CSize_high) div CSize_low
によって計算することができる。また、ブロックkに含まれているレコードの行番号Lは、上述のように、RkからRk+1-1の範囲に入る。よって、ローカル項目値番号配列VNoは、次の通り決定される。
for (i=0;i<Rk+1-Rk;i++) {
VNo[i]=((i+Rk) mod CSize_high) div CSize_low;
}
第2次元のブロック0の例では、
VNo[0]=(0 mod 3) div 1=0
VNo[1]=(1 mod 3) div 1=1
VNo[2]=(2 mod 3) div 1=2
VNo[3]=(3 mod 3) div 1=0
VNo[4]=(4 mod 3) div 1=1
が得られる。
VNo=(L mod CSize_high) div CSize_low
によって計算することができる。また、ブロックkに含まれているレコードの行番号Lは、上述のように、RkからRk+1-1の範囲に入る。よって、ローカル項目値番号配列VNoは、次の通り決定される。
for (i=0;i<Rk+1-Rk;i++) {
VNo[i]=((i+Rk) mod CSize_high) div CSize_low;
}
第2次元のブロック0の例では、
VNo[0]=(0 mod 3) div 1=0
VNo[1]=(1 mod 3) div 1=1
VNo[2]=(2 mod 3) div 1=2
VNo[3]=(3 mod 3) div 1=0
VNo[4]=(4 mod 3) div 1=1
が得られる。
同様に、第2次元のブロック3の例では、
VNo[0]=(9 mod 3) div 1=0
VNo[1]=(10 mod 3) div 1=1
VNo[2]=(11 mod 3) div 1=2
が得られる。
VNo[0]=(9 mod 3) div 1=0
VNo[1]=(10 mod 3) div 1=1
VNo[2]=(11 mod 3) div 1=2
が得られる。
次に、ブロック1の第2次元を参照すると、ブロック1はケースCに分類されている。ケースCでは、一般に、ブロックkの第p次元の値は、ブロックk内では、前半の昇順部分1と後半の昇順部分2とに分離され、前半の昇順部分1の最後で最大値に達し、後半の昇順部分2の先頭で最小値に戻る。このとき、グローバル項目値順序番号配列GVOrdを決定するために、最初に、次の変数Gapを計算する。
Gap=((Rk mod CSize_high) div CSize_low)-(((Rk+1-1) mod CSize_high) div CSize_low)-1
ブロック1の第2次元の場合には、
Gap=((5 mod 3) div 1)-(((7-1) mod 3) div 1)-1=2-0-1=1
となる。グローバル項目値順序番号配列GVOrdのサイズは、第2次元のGVLのサイズからGapを減算した値、すなわち、
3-Gap=3-1=2
である。
Gap=((Rk mod CSize_high) div CSize_low)-(((Rk+1-1) mod CSize_high) div CSize_low)-1
ブロック1の第2次元の場合には、
Gap=((5 mod 3) div 1)-(((7-1) mod 3) div 1)-1=2-0-1=1
となる。グローバル項目値順序番号配列GVOrdのサイズは、第2次元のGVLのサイズからGapを減算した値、すなわち、
3-Gap=3-1=2
である。
ケースCでは、グローバル項目値順序番号の最小値と最大値は必ずグローバル項目値順序番号配列GVOrdに格納され、最小値と最大値の間の区間は、区間の先頭の格納位置及び格納値が、
((Rk+1-1) mod CSize_high) div CSize_low
によって表され、区間の末尾の格納位置及び格納値が、それぞれ、
(Rk mod CSize_high) div CSize_low
((Rk mod CSize_high) div CSize_low)-Gap
によって表される。
((Rk+1-1) mod CSize_high) div CSize_low
によって表され、区間の末尾の格納位置及び格納値が、それぞれ、
(Rk mod CSize_high) div CSize_low
((Rk mod CSize_high) div CSize_low)-Gap
によって表される。
ブロック1の第2次元の例では、グローバル項目値順序番号配列GVOrdのサイズは2であり、グローバル項目値順序番号の最小値=0と最大値=2が必ずグローバル項目値順序番号配列GVOrdに格納されているので、
GVOrd[0]=0
GVOrd[1]=2
が得られる。なお、中間の区間の先頭の位置及び値は、
((Rk+1-1) mod CSize_high) div CSize_low=((7-1) mod 3) div 1=0 div 1=0
である。本例では、実際には中間の区間が存在しないので、中間の区間の先頭は、グローバル項目値順序番号配列GVOrdの先頭と一致している。また、中間の区間の末尾の位置は、
((Rk mod CSize_high) div CSize_low)-Gap=((5 mod 3) div 1)-1=(2 div 1)-1=1
であり、中間の区間の末尾の値は、
(Rk mod CSize_high) div CSize_low=((5 mod 3) div 1)=2 div 1=2
である。本例では、実際には中間の区間が存在しないので、中間の区間の末尾は、グローバル項目値順序番号配列GVOrdの末尾と一致している。
GVOrd[0]=0
GVOrd[1]=2
が得られる。なお、中間の区間の先頭の位置及び値は、
((Rk+1-1) mod CSize_high) div CSize_low=((7-1) mod 3) div 1=0 div 1=0
である。本例では、実際には中間の区間が存在しないので、中間の区間の先頭は、グローバル項目値順序番号配列GVOrdの先頭と一致している。また、中間の区間の末尾の位置は、
((Rk mod CSize_high) div CSize_low)-Gap=((5 mod 3) div 1)-1=(2 div 1)-1=1
であり、中間の区間の末尾の値は、
(Rk mod CSize_high) div CSize_low=((5 mod 3) div 1)=2 div 1=2
である。本例では、実際には中間の区間が存在しないので、中間の区間の末尾は、グローバル項目値順序番号配列GVOrdの末尾と一致している。
さらに、ブロックkを担当している演算プロセッサは、第p次元に関して、ローカル項目値番号配列VNoを作成する。ケースCの場合、ブロックkに含まれている項目値は、項目値全体のうち、最小値と第1の中間値との間のすべての値と、第2の中間値と最大値との間のすべての値である。換言すると、ブロックkには、項目値全体のうち、第1の中間値と第2の中間値との間の項目値が含まれていない。これをローカル項目値番号の観点からみると、ローカル項目値番号配列VNoには、先頭から順に、第2の中間値に対応する項目値番号から連続的に最大値に対応する項目値番号までが格納され、次に、最小値に対応する項目値番号から連続的に第1の中間値に対応する項目値番号までが格納されている。ブロック1の第2次元に関しては、簡単に、
VNo[0]=1
VNo[1]=0
となる。ローカル項目値番号配列VNoの一般的な計算法は次の通りである。
VNo[0]=1
VNo[1]=0
となる。ローカル項目値番号配列VNoの一般的な計算法は次の通りである。
変数HighPartStartを、
HighPartStart=(Rk mod CSize_high) div CSize_low
と定義すると、上記のGapを用いて、ローカル項目値番号配列VNoは、
for (i=Rk;i<Rk+1;i++) {
offset = (i mod CSize_high) div CSize_low;
if (offset >= HighPartStart) {
VNo[i-Rk]=offset - Gap;
} else {
VNo[i-Rk]=offset;
}
}
として取得される。
HighPartStart=(Rk mod CSize_high) div CSize_low
と定義すると、上記のGapを用いて、ローカル項目値番号配列VNoは、
for (i=Rk;i<Rk+1;i++) {
offset = (i mod CSize_high) div CSize_low;
if (offset >= HighPartStart) {
VNo[i-Rk]=offset - Gap;
} else {
VNo[i-Rk]=offset;
}
}
として取得される。
最後に、ブロック2の第2次元を参照すると、ブロック2はケースBに分類されている。ケースBでは、一般に、ブロックkの第p次元の値は、昇順に出現する。このとき、グローバル項目値順序番号配列GVOrdを決定するためには、グローバル項目値順序番号の最小値及び最大値を決定すればよい。グローバル項目値順序番号の最小値Min(GVOrd)及び最大値Max(GVOrd)は、それぞれ、
Min(GVOrd)=(Rk mod CSize_high) div CSize_low
及び
Max(GVOrd)=((Rk+1-1) mod CSize_high) div CSize_low
によって決定される。よって、本例において、ブロック1の第2次元に関して、
Min(GVOrd)=(7 mod 3) div 1=1
Max(GVOrd)=((9-1) mod 3) div 1=2
が得られる。したがって、ブロック2の第2次元のグローバル項目値順序番号配列GVOrdは、
GVOrd[0]=1
GVOrd[1]=2
である。
Min(GVOrd)=(Rk mod CSize_high) div CSize_low
及び
Max(GVOrd)=((Rk+1-1) mod CSize_high) div CSize_low
によって決定される。よって、本例において、ブロック1の第2次元に関して、
Min(GVOrd)=(7 mod 3) div 1=1
Max(GVOrd)=((9-1) mod 3) div 1=2
が得られる。したがって、ブロック2の第2次元のグローバル項目値順序番号配列GVOrdは、
GVOrd[0]=1
GVOrd[1]=2
である。
さらに、ブロックkを担当している演算プロセッサは、第p次元に関して、ローカル項目値番号配列VNoを作成する。ケースBのブロックkに含まれているレコードのレコード順序番号、すなわち、行番号をLとすると、ローカル項目値番号VNoは、
VNo=(L mod CSize_high) div CSize_low - Min(GVOrd)
によって計算することができる。また、ブロックkに含まれているレコードの行番号Lは、上述のように、RkからRk+1-1の範囲に入る。よって、ローカル項目値番号配列VNoは、次の通り決定される。
for (i=0;i<Rk+1-Rk;i++) {
VNo[i]=(((i+Rk) mod CSize_high) div CSize_low)- Min(GVOrd)
}
ブロック2の第2次元の例では、
VNo[0]=((7 mod 3) div 1)-1=0
VNo[1]=((8 mod 3) div 1)-1=1
が得られる。
VNo=(L mod CSize_high) div CSize_low - Min(GVOrd)
によって計算することができる。また、ブロックkに含まれているレコードの行番号Lは、上述のように、RkからRk+1-1の範囲に入る。よって、ローカル項目値番号配列VNoは、次の通り決定される。
for (i=0;i<Rk+1-Rk;i++) {
VNo[i]=(((i+Rk) mod CSize_high) div CSize_low)- Min(GVOrd)
}
ブロック2の第2次元の例では、
VNo[0]=((7 mod 3) div 1)-1=0
VNo[1]=((8 mod 3) div 1)-1=1
が得られる。
以上の処理により、第2次元に関して、図42A乃至42Dに示されているように、ブロック毎にローカル項目値番号配列VNo及びグローバル項目値順序番号配列GVOrdが得られる。
[集計処理における次元の項目情報の作成(グローバル処理)]
今度は、本発明の一実施形態による表形式データの集計処理における項目情報作成処理を示す図43を参照して、項目情報作成処理のグローバル処理をより詳細に説明する。最初に、各演算ユニットは、集計結果の表形式データのローカルな項目情報作成処理によって作成されたグローバル項目値順序番号配列GVOrdと同じサイズのブロック番号配列BlkNoをローカルメモリ上に作成し、各演算ユニットの担当レコードを示すブロック番号でこのブロック番号配列を充填する。さらに、各演算ユニットは、集計元の表形式データのローカル項目値配列LVLを準備する。各演算処理ユニットは、集計元の表形式データのローカル項目値配列LVLと、集計結果の表形式データのブロック番号配列BlkNo及びグローバル項目値順序番号配列GVOrdとをローカルデータとして、1段目のマージ処理を実行する演算ユニットへ送信する。
今度は、本発明の一実施形態による表形式データの集計処理における項目情報作成処理を示す図43を参照して、項目情報作成処理のグローバル処理をより詳細に説明する。最初に、各演算ユニットは、集計結果の表形式データのローカルな項目情報作成処理によって作成されたグローバル項目値順序番号配列GVOrdと同じサイズのブロック番号配列BlkNoをローカルメモリ上に作成し、各演算ユニットの担当レコードを示すブロック番号でこのブロック番号配列を充填する。さらに、各演算ユニットは、集計元の表形式データのローカル項目値配列LVLを準備する。各演算処理ユニットは、集計元の表形式データのローカル項目値配列LVLと、集計結果の表形式データのブロック番号配列BlkNo及びグローバル項目値順序番号配列GVOrdとをローカルデータとして、1段目のマージ処理を実行する演算ユニットへ送信する。
本発明の一実施形態によれば、各演算ユニットによってブロック内で準備されたローカルデータは、次に、ブロック間でマージされる。ブロック間のマージでは、それぞれのブロック内で準備されたデータが併合され、全体として新たな併合データが生成される。より具体的には、集計元の表形式データのローカル項目値配列LVLがローカル項目値の昇順にマージされると共に、集計結果の表形式データのグローバル項目値順序番号配列GVOrdの要素とブロック番号配列BlkNoの要素の組がグローバル項目値順序番号をキーとしてマージされる。ここでは、集計元の表形式データに関連する項目情報と、集計結果の表形式データに関連する項目値情報とがそれぞれ独立にマージされていることに注意を要する。
本発明の一実施形態による表形式データの検索処理におけるマージ処理は、図13に示された階層構造と同じ階層構造によって実現することが可能である。ブロック0から7に関連付けられた演算ユニット0から演算ユニット7によって並列的にローカル処理が実行されると、1段目のマージ処理として、演算ユニット0によるブロック0とブロック1のマージ処理、演算ユニット2によるブロック2とブロック3のマージ処理、演算ユニット4によるブロック4とブロック5のマージ処理、及び、演算ユニット6によるブロック6とブロック7のマージ処理が実行される。2段目のマージ処理は、演算ユニット1によるブロック0-1とブロック2-3のマージ処理、及び、演算ユニット5によるブロック4-5とブロック6-7のマージ処理により実現される。最後に、3段目のマージ処理として、演算ブロック3が、ブロック0-3とブロック4-7のマージ処理を実行する。各パイプライン段でマージ処理を担当する演算ユニットは上記の組み合わせに限定されないことに注意を要する。なお、分配処理は、たとえば、演算ユニット3とは別の演算ユニット7によって実行されてもよい。
マージ処理では、ソートの場合と同様に、各演算ユニットが、1対のブロックに関する情報をマージして、マージされたより高い層の1個のブロックに関する情報を生成する。よって、マージ処理は、複数台の演算ユニットの並列動作によって実現される。また、各演算ユニットは、同じ層に属するマージされたよりブロックの対に関する情報をマージし、マージされたさらに高い層の1個のブロックに関する情報を生成する。このようにマージ処理を並列的かつ階層的に繰り返すことにより、最終的に最上層の1個のブロックに関する情報が生成される。最上層の1個のブロックとは、レコード全体を含むブロックである。演算ユニット3は、最終的に、集計元の表形式データに関するローカル項目値番号配列(すなわち、仮想的なグローバル項目値番号配列)と、集計結果の表形式データに関連する1つのグローバル項目値順序番号配列GVOrd及びブロック番号配列BlkNoを生成する。集計結果の表形式データに関連する項目情報は、グローバル項目値順序番号の順序(本例では、昇順)に整列させられている。
本発明の一実施形態による表形式データの集計処理におけるマージ処理は、表形式データのソート処理におけるブロック間ソート処理1(ブロック間マージ処理)と全く同様に実現され得るので、これ以上詳細には説明されない。
以上の説明からわかるように、本発明の一実施形態による集計処理におけるマージ処理では、データアクセスがシーケンシャルアクセスだけに限定され、かつ、各演算ユニットが並列にマージ処理を実行可能である。よって、マルチプロセッサ型処理装置の性能が十分に活かされている。
本発明の一実施形態による表形式データの集計処理における次元作成処理では、最後に、各ブロックに含まれるローカル項目値配列LVLを作成する。このローカル項目値配列を生成する処理は分配処理とも呼ばれる。分配処理では、少なくとも1台の演算ユニット(たとえば、本例では、演算ユニットPE-7)が、ブロック番号配列BlkNoの添字iに相当するグローバル項目値順序番号によって指定される項目値を仮想的なグローバル項目値配列LVLから取り出し、この項目値をブロック番号によって指定されたブロック毎に分配する。分配された項目値を受信した演算ユニットは、受信した項目値をこの演算ユニットのローカルメモリ上のローカル項目値配列LVLに順次に格納する。
この処理は、たとえば、ブロックjのローカル項目値配列のk番目の要素をLVL[j][k]とし、ローカル項目値配列LVL[j][k]に項目値を設定するための書き込み用ポインタkをOffsets[j]とし、仮想的なグローバル項目値配列を(ブロック毎のローカル項目値配列と区別するために)GVLとすると、次のように記述できる。
オフセット配列Offsetsを初期化;
for (i=0;i<一意のグローバル項目値の個数;i++) {
LVL[BlkNo[i]][Offsets[BlkNo[i]]=GVL[GVOrd[i]];
Offsets[BlkNo[i]]++;
}
以上の処理によって、各演算ユニットのローカルメモリには、集計処理の次元に関する項目情報に含まれるローカル項目値配列LVLが作成される。上述されているように、ローカル処理において、ローカル項目値番号配列VNo及びグローバル項目値順序番号配列GVOrdが既に作成されているので、ローカル項目値配列LVLの作成によって集計の次元に関する項目情報が完成する。
オフセット配列Offsetsを初期化;
for (i=0;i<一意のグローバル項目値の個数;i++) {
LVL[BlkNo[i]][Offsets[BlkNo[i]]=GVL[GVOrd[i]];
Offsets[BlkNo[i]]++;
}
以上の処理によって、各演算ユニットのローカルメモリには、集計処理の次元に関する項目情報に含まれるローカル項目値配列LVLが作成される。上述されているように、ローカル処理において、ローカル項目値番号配列VNo及びグローバル項目値順序番号配列GVOrdが既に作成されているので、ローカル項目値配列LVLの作成によって集計の次元に関する項目情報が完成する。
本例の場合も、複数台の演算ユニットが分配処理を担当してもよい。
なお、集計の次元に関する項目情報、すなわち、ローカル項目値番号配列VNo、グローバル項目値順序番号配列GOrd、及び、ローカル項目値配列LVLは、たとえば、集計結果の表形式データを分担して保持する演算ユニットが、他の演算ユニットから、他の演算ユニットが保持している集計元の表形式データのグローバル項目値順序番号配列GVOrd及びローカル項目値配列VLを取得することにより、各演算ユニットが独立に取得してもよい。
[集計処理における測度の作成]
最初に、測度の項目に関して、グローバル項目値配列GVLを定義する。グローバル項目値配列GVLは、各ブロックに存在する項目値を重複無しにマージすることによって得られる仮想的な項目値配列である。ここで、仮想的とは、実際に作成する必要がないということを意味している。この仮想的なグローバル項目値配列GVLのデータ型は、ローカル項目値配列LVLのデータ型と同じであり、文字列型、整数型、浮動小数点型などの種々のデータ型をとる。グローバル項目値配列GVLに格納されている項目値は所定の順序(たとえば、昇順)に並べられている。上述の通り、格納されている項目値に重複がない。さらに、グローバル項目値配列GVLのサイズは、各ブロックに存在するグローバル項目値順序番号配列GVOrdの格納値の最大値+1である。
最初に、測度の項目に関して、グローバル項目値配列GVLを定義する。グローバル項目値配列GVLは、各ブロックに存在する項目値を重複無しにマージすることによって得られる仮想的な項目値配列である。ここで、仮想的とは、実際に作成する必要がないということを意味している。この仮想的なグローバル項目値配列GVLのデータ型は、ローカル項目値配列LVLのデータ型と同じであり、文字列型、整数型、浮動小数点型などの種々のデータ型をとる。グローバル項目値配列GVLに格納されている項目値は所定の順序(たとえば、昇順)に並べられている。上述の通り、格納されている項目値に重複がない。さらに、グローバル項目値配列GVLのサイズは、各ブロックに存在するグローバル項目値順序番号配列GVOrdの格納値の最大値+1である。
測度は次元値の組毎に値を集計することにより作成される。よって、測度作成処理は、集計元の表形式データに関して、次元値の組、すなわち、次元値に対応する項目値番号の組を項目値の昇順にソートし、ソートされた項目値番号の組毎に測度の値を計算し、計算された測度の値から項目毎に項目情報を作成する。
図44A乃至44Jは、測度作成のための次元値の組のソート処理の説明図である。このソート処理では、最初に、優先度の低い第2次元に関して、項目値アクセス情報配列LOrdをソートし、次に、優先度の高い第1次元に関して、項目値アクセス情報配列LOrdを再度ソートする。以下では、集計元の表形式データのブロック0の例について説明する。ソート処理は、よく知られているカウンティングソートを使用する。
図44A乃至図44Dは、ローカル項目値番号をカウントアップする処理の説明図である。次に、図44Eに示されているように、カウントアップによって生成されたカウント配列Countを累計数化し、累計数配列Aggrを作成する。配列Aggrは、Count配列の要素を1個後へずらして累計数化することにより作成される。
次に、図44F乃至図44Gに示されているように、項目値アクセス情報配列LOrdの要素を累計数配列Aggrの要素をポインタとして用いて転送することにより、ソートされた項目値アクセス情報配列LOrd’が作成される。図44Hには、第2次元に関するソート処理によって生成された項目値アクセス情報配列LOrd’が示されている。
続いて、図44Iに示されているように、項目値アクセス情報配列LOrd’を優先度の高い第1次元に関してソートすると、項目値アクセス情報配列LOrd’’が得られる。
以上のソート処理は、複数台の演算ユニットによって並列的に実行され、図44Jに示されるように、ブロック0からブロック7までのすべてのブロックについて、項目値アクセス情報配列LOrd’’が生成される。
次に、次元に関してソートされた項目値アクセス情報配列LOrd’’を用いて、測度に関して、次元空間内順序番号配列CubeAdrと、この次元空間内順序番号に対応する測度値を格納した測度項目値配列wVLを作成する。次元空間内順序番号とは、次元値の項目値番号の組に対して、次元値のソート順に付与された順序番号である。次元空間順序番号は、本例では、(第1次元のGVOrdの値)×(次元2の仮想的なグローバル項目値配列のサイズの積)+(第2次元のGVOrdの値)によって計算される。図45には、次元空間内順序番号配列及び測度項目値配列の作成処理が示されている。
すべてのブロックに関して、演算ユニットによって次元空間内順序番号配列CubeAdr及び測度項目値配列wVLが作成されると、演算ユニットは、次元空間内順序番号毎に集計値を計算する。本例では、測度の値の出現回数Countと、測度の値の和Sumとが計算される。図46には、次元空間内順序番号配列CubAdrと測度項目値配列wVLとから、測度出現回数配列Countと測度和配列Sumを作成する処理が示されている。本例では、CubeAdrの値が重複していなければ、Count配列に1が格納され、SumにwVLの値が格納される。一方、ブロック0のCubeAdr=7のように、CubeAdrに重複値が存在するならば、Count配列及びSum配列を作成する際に、次元空間内順序番号を1つにまとめ、CubeAdrの重複回数が配列Countに格納され、同一のCubeAdrに対するwVLの値の和が配列Sumに格納される。同時に重複値を含まない次元空間内順序番号配列CubeAdr’も作成される。
次に、図47に示されているように、CubeAdr’の値をキーとして、配列Countと配列Sumが複数のブロック間でマージされる。マージ処理は、本明細書中で既に説明されているように、複数台の演算ユニットのマージ手段がトーナメント方式でパイプライン処理を実行することによって実現される。本例では、ローカルデータとして、次元空間内順序番号配列CubeAdr’、出現回数配列Count、及び、和配列Sumが利用され、同じ次元空間内順序番号に関連付けられた出現回数及び和が併合されると共に、ローカルデータの各要素は次元空間内順序番号の昇順に並べられる。
最後に、トーナメント方式でマージされた出現回数配列Count及び和配列Sumを、既に作成されている集計結果の表形式データの順序情報を用いて、集計結果の表形式データの項目情報に変換する。図48Aは集計結果の表形式データの順序情報を示し、図48Bは出現回数配列Countに関するコンパイル処理の説明図であり、図48Cは和配列Sumに関するコンパイル処理の説明図である。コンパイル処理については、本明細書中で既に説明されているので、これ以上詳細には説明しない。
以上の集計処理により、図39D及び39Eに示された集計結果の表形式データが作成される。
本発明は、以上の実施の形態に限定されることなく、特許請求の範囲に記載された発明の範囲内で、種々の変更が可能であり、それらも本発明の範囲内に包含されるものであることは言うまでもない。
Claims (17)
- 専用のローカルメモリ及びプロセッサを含み、相互にデータを送受するため通信接続されている複数台の演算ユニットを備え、
一連のデータが上記複数台の演算ユニットに関連付けられた複数個のブロックに分割されて上記複数台の演算ユニットのそれぞれの専用のローカルメモリに保持され、上記一連のデータが上記複数台の演算ユニットのパイプライン処理によって操作される、分散メモリ型マルチプロセッサであって、
各演算ユニットが、前のパイプライン段にある1台以上の演算ユニットからそれぞれのローカルデータを受信し、少なくとも2つの受信されたローカルデータを1つのさらなるローカルデータに変換し、上記さらなるローカルデータを後のパイプライン段にある1台の演算ユニットへ送信するマージ手段を含み、
前記複数台の演算ユニットのマージ手段が最終的に1つのグローバルデータを生成するようにトーナメント方式で動的に接続可能であり、
少なくとも1台のいずれかの演算ユニットが、前記複数個のブロックに対応するブロック番号に基づいて、前記グローバルデータを分割し前記複数台の演算ユニットへ割り当てる分配手段を含む、
分散メモリ型マルチプロセッサ。 - 上記一連のデータがデータ項目に対応した項目値を含むレコードの配列として表現される表形式データであり、
上記複数個のブロックに分割された上記表形式データのうち各演算ユニットに割り当てられた担当レコードが、レコードの順序に依存する順序情報と各データ項目に依存する項目情報とに分離されている、
請求項1記載の分散メモリ型マルチプロセッサ。 - 上記順序情報が、上記表形式データ内での上記担当レコードの原始レコード位置番号を上記ブロック内での上記担当レコードのレコード順序番号の順番に格納するレコード順序番号配列、及び、上記担当レコードに含まれる上記項目値にアクセスする項目値アクセス情報を上記レコード順序番号の順番に格納する項目値アクセス情報配列により形成され、
上記項目情報が、上記担当レコードに含まれる一意の項目値が所定の順序で格納されているローカル項目値配列、上記担当レコードに含まれる上記項目値が上記ローカル項目値配列内に格納されている位置を指定するローカル項目値番号が上記担当レコードの上記原始レコード位置番号の順番に格納されているローカル項目値番号配列、及び、上記表形式データの全体で上記所定の順序に基づいて上記ローカル項目値配列中の上記一意の項目値に割り当てられた順序番号が格納されているグローバル項目値順序番号配列により形成されている、
請求項2記載の分散メモリ型マルチプロセッサ。 - 各演算ユニットが、
上記分散メモリ型マルチプロセッサに接続されている外部装置からこの演算ユニットに割り当てられた上記担当レコードを受信する手段と、
受信された上記担当レコードから、上記レコード順序番号配列及び上記項目値アクセス情報配列を生成し、この演算ユニットの上記専用のローカルメモリに格納する手段と、
項目毎に、上記担当レコード中の項目値を上記所定の順序でソートすることにより、上記ローカル項目値配列、及び、上記ローカル項目値番号配列を生成し、この演算ユニットの上記専用のローカルメモリに格納するローカルコンパイル手段と、
項目毎に、上記ローカル項目値配列、上記担当レコードの範囲内で上記所定の順序に基づいて上記ローカル項目値配列に含まれる上記一意の項目値に割り当てられた順序番号が格納されているローカル項目値順序番号配列、及び、上記ローカル項目値順序番号配列中の上記順序番号に関連した上記担当レコードを示す上記ブロック番号を含むブロック番号配列を、上記ローカルデータとして、この演算ユニットの後のパイプライン段にある演算ユニットへ送信する手段と、
を含み、
各演算ユニットの上記マージ手段が、前のパイプライン段からの少なくとも2つのローカルデータに含まれている少なくとも2つのローカル項目値配列中の項目値を上記所定の順序でマージすることにより、上記少なくとも2つのローカルデータを、さらなるブロック番号配列、さらなるローカル項目値順序番号配列及びさらなるローカル項目値配列により形成された1つのローカルデータに変換する手段を含み、
上記分配手段が、最終的に生成されたさらなるローカル項目値順序番号配列に格納されている順序番号を、対応する最終的に生成されたさらなるブロック番号配列に格納されているブロック番号に関連付けられた演算ユニットへ送信する手段を含み、
各演算ユニットが、上記送信された順序番号を上記グローバル項目値順序番号配列に順次に格納する手段をさらに含む、
請求項3記載の分散メモリ型マルチプロセッサ。 - 各演算ユニットが、
所定の項目に関して、上記担当レコードを含むブロック毎に、上記ローカル項目値番号をキーとして上記レコード順序番号配列、上記項目値アクセス情報配列及び上記グローバル項目値順序番号配列にソートを適用し、これによって、ローカルソートされたレコード順序番号配列、ローカルソートされた項目値アクセス情報配列及びローカルソートされたグローバル項目値順序番号配列を生成するローカルソート手段と、
上記所定の項目に関して、上記ローカルソートされたグローバル項目値順序番号配列、上記ローカルソートされたレコード順序番号配列、及び、上記ローカルソートされたレコード順序番号配列に関連した上記担当レコードを示す上記ブロック番号を含むブロック番号配列を、上記ローカルデータとして、この演算ユニットの後のパイプライン段にある演算ユニットへ送信する手段と、
を含み、
各演算ユニットの上記マージ手段が、前のパイプライン段からの少なくとも2つのローカルデータに含まれている上記ローカルソートされたグローバル項目値順序番号配列と上記ローカルソートされたレコード順序番号配列との組を所定の順序でマージすることにより、上記少なくとも2つのローカルデータを、さらなるグローバル項目値順序番号配列、さらなるレコード順序番号配列及びさらなるブロック番号配列により形成された1つのローカルデータに変換する手段を含み、
上記分配手段が、最終的に生成されたさらなるブロック番号配列に含まれているブロック番号の上記さらなるブロック番号配列中での順序番号を、上記ブロック番号に関連付けられた演算ユニットへ送信する手段を含み、
各演算ユニットが、上記送信された順序番号を上記レコード順序番号配列に順次に格納する手段をさらに含む、
請求項3記載の分散メモリ型マルチプロセッサ。 - 各演算ユニットが、
所定の項目に関して、上記担当レコードを含むブロック毎に、検索条件に一致する項目値を含むレコードに対応する新たなレコード順序番号配列及び新たな項目値アクセス情報配列を生成し、上記項目値アクセス情報配列を上記新たな項目値アクセス情報配列で置き換えるローカル検索手段と、
上記所定の項目に関して、上記新たなレコード順序番号配列、及び、上記新たなレコード順序番号配列に関連した上記担当レコードを示す上記ブロック番号を含むブロック番号配列を、上記ローカルデータとして、この演算ユニットの後のパイプライン段にある演算ユニットへ送信する手段と、
を含み、
各演算ユニットの上記マージ手段が、前のパイプライン段からの少なくとも2つのローカルデータに含まれている上記新たなレコード順序番号配列と上記ブロック番号配列との組を所定の順序でマージすることにより、上記少なくとも2つのローカルデータを、さらなるレコード順序番号配列及びさらなるブロック番号配列により形成された1つのローカルデータに変換する手段を含み、
上記分配手段が、最終的に生成されたさらなるブロック番号配列に含まれているブロック番号の上記さらなるブロック番号配列中での順序番号を、上記ブロック番号に関連付けられた演算ユニットへ送信する手段を含み、
各演算ユニットが、上記送信された順序番号を上記新たなレコード順序番号配列に順次に格納する手段をさらに含む、
請求項3記載の分散メモリ型マルチプロセッサ。 - 前記複数台の演算ユニットが、集計元の表形式データとして使用される第1の表形式データに関する第1の担当レコード、及び、上記第1の表形式データの所定の項目の組に関する項目値の組毎に少なくとも1つの別の集計項目に関する項目値を集計することにより得られる集計結果を表現する第2の表形式データに関する第2の担当レコードをそれぞれの専用のローカルメモリに格納するように構成され、
各演算ユニットが、
上記分散メモリ型マルチプロセッサに接続されている外部装置から、上記第2の表形式データのうちこの演算ユニットに分割される上記第2の担当レコードの範囲情報、及び、上記所定の項目の組に属する一意の項目値の個数の組を受信する手段と、
上記第2の担当レコードの範囲情報に基づいて、この演算ユニットに割り当てられた上記第2の担当レコードのレコード順序番号配列及び項目値アクセス情報配列を生成し、この演算ユニットの上記専用のローカルメモリに格納する手段と、
上記所定の項目毎に、上記第2の担当レコードの範囲情報と上記所定の項目に属する一意の項目値の個数の組とに基づいて、この演算ユニットに割り当てられた上記第2の担当レコードのグローバル項目値順序番号配列及びローカル項目値番号配列を生成し、この演算ユニットの上記専用のローカルメモリに格納する手段と、
上記所定の項目毎に、上記第1の担当レコードに関するこの所定の項目のローカル項目値配列と、上記第2の担当レコードに関するこの所定の項目の上記グローバル項目値順序番号配列と、上記グローバル項目値順序番号配列中の順序番号に関連した上記第2の担当レコードを示すブロック番号を含むブロック番号配列とを、上記ローカルデータとして、この演算ユニットの後のパイプライン段にある演算ユニットへ送信する手段と、
を含み、
各演算ユニットの上記マージ手段が、前のパイプライン段からの少なくとも2つのローカルデータに含まれているローカル項目値配列を所定の順序でマージすることによりさらなるローカル項目値配列を生成し、前のパイプライン段からの少なくとも2つのローカルデータに含まれているブロック番号配列及びグローバル項目値順序番号配列を所定の順序でマージすることによりさらなるブロック番号配列及びさらなるグローバル項目値順序番号配列を生成し、これにより、上記少なくとも2つのローカルデータを、上記さらなるローカル項目値配列、上記さらなるブロック番号配列及び上記さらなるグローバル項目値順序番号配列により形成された1つのローカルデータに変換する手段を含み、
上記分配手段が、最終的に生成されたさらなるグローバル項目値順序番号配列に格納されている順序番号によって指定された最終的に生成されたさらなるローカル項目値配列に格納されている項目値を、対応する最終的に生成されたさらなるブロック番号配列に格納されているブロック番号に関連付けられた演算ユニットへ送信する手段を含み、
各演算ユニットが、上記送信された項目値をこの演算ユニットの上記第2の担当レコードのローカル項目値配列に順次に格納する手段をさらに含み、
各演算ユニットが、上記第1の担当レコードに含まれる上記所定の項目の組に関する項目値の組を特定する次元値番号を含む次元値番号配列と、上記次元値番号に対応する上記少なくとも1つの集計項目に関する項目値の集計値を含むローカル集計値配列とを生成し、上記ローカルデータとして、この演算ユニットの後のパイプライン段にある演算ユニットへ送信する手段をさらに含み、
各演算ユニットの上記マージ手段が、前のパイプライン段からの少なくとも2つのローカルデータに含まれている次元値番号配列及びローカル集計値配列を所定の順序でマージすることにより、上記少なくとも2つのローカルデータをさらなる次元値番号配列及びさらなるローカル集計値配列により形成された1つのローカルデータに変換する手段を含み、
上記分配手段が、最終的に生成されたさらなるローカル集計値配列に格納されている集計値を上記第2の担当レコードの上記範囲情報に従って演算ユニットへ送信する手段を含み、
各演算ユニットが
上記少なくとも1つの集計項目毎に、上記送信された項目値を所定の順序でソートすることにより、集計項目に関するローカル項目値配列及びローカル項目値番号配列を生成し、この演算ユニットの上記専用のローカルメモリに格納するローカルコンパイル手段と、
上記少なくとも1つの集計項目毎に、上記ローカル項目値配列、上記第2の担当レコードの範囲内で所定の順序に基づいて上記ローカル項目値配列に含まれる一意の項目値に割り当てられた順序番号が格納されているローカル項目値順序番号配列、及び、上記ローカル項目値順序番号配列中の上記順序番号に関連した上記担当レコードを示す上記ブロック番号を含むブロック番号配列を、上記ローカルデータとして、この演算ユニットの後のパイプライン段にある演算ユニットへ送信する手段と、
をさらに含み、
各演算ユニットの上記マージ手段が、前のパイプライン段からの少なくとも2つのローカルデータに含まれている少なくとも2つのローカル項目値配列中の項目値を上記所定の順序でマージすることにより、上記少なくとも2つのローカルデータを、さらなるブロック番号配列、さらなるローカル項目値順序番号配列及びさらなるローカル項目値配列により形成された1つのローカルデータに変換する手段をさらに含み、
上記分配手段が、最終的に生成されたさらなるローカル項目値順序番号配列に格納されている順序番号を、対応する最終的に生成されたさらなるブロック番号配列に格納されているブロック番号に関連付けられた演算ユニットへ送信する手段を含み、
各演算ユニットが、上記送信された順序番号を、この演算ユニットの上記専用のローカルメモリに設けられた、上記少なくとも1つの集計項目に関するグローバル項目値順序番号配列に順次に格納する手段をさらに含む、
請求項3記載の分散メモリ型マルチプロセッサ。 - 専用のローカルメモリ及びプロセッサを含み、相互にデータを送受するため通信接続されている複数台の演算ユニットを備え、
一連のデータが上記複数台の演算ユニットに関連付けられた複数個のブロックに分割されて上記複数台の演算ユニットのそれぞれの専用のローカルメモリに保持され、上記一連のデータが上記複数台の演算ユニットのパイプライン処理によって操作される、分散メモリ型マルチプロセッサにおいて、
各演算ユニットが、前のパイプライン段にある1台以上の演算ユニットからそれぞれのローカルデータを受信し、少なくとも2つの受信されたローカルデータを1つのさらなるローカルデータに変換し、上記さらなるローカルデータを後のパイプライン段にある1台の演算ユニットへ送信し、最終的に1つのグローバルデータを生成するようにトーナメント方式で動的に動作するステップと、
少なくとも1台のいずれかの演算ユニットが、前記複数個のブロックに対応するブロック番号に基づいて、前記グローバルデータを分割し前記複数台の演算ユニットへ割り当てるステップと、
を備える、表形式データ操作方法。 - 上記一連のデータがデータ項目に対応した項目値を含むレコードの配列として表現される表形式データであり、
上記複数個のブロックに分割された上記表形式データのうち各演算ユニットに割り当てられた担当レコードが、レコードの順序に依存する順序情報と各データ項目に依存する項目情報とに分離されている、
請求項8記載の表形式データ操作方法。 - 上記順序情報が、上記表形式データ内での上記担当レコードの原始レコード位置番号を上記ブロック内での上記担当レコードのレコード順序番号の順番に格納するレコード順序番号配列、及び、上記担当レコードに含まれる上記項目値にアクセスする項目値アクセス情報を上記レコード順序番号の順番に格納する項目値アクセス情報配列により形成され、
上記項目情報が、上記担当レコードに含まれる一意の項目値が所定の順序で格納されているローカル項目値配列、上記担当レコードに含まれる上記項目値が上記ローカル項目値配列内に格納されている位置を指定するローカル項目値番号が上記担当レコードの上記原始レコード位置番号の順番に格納されているローカル項目値番号配列、及び、上記表形式データの全体で上記所定の順序に基づいて上記ローカル項目値配列中の上記一意の項目値に割り当てられた順序番号が格納されているグローバル項目値順序番号配列により形成されている、
請求項8記載の表形式データ操作方法。 - 各演算ユニットが、上記分散メモリ型マルチプロセッサに接続されている外部装置からこの演算ユニットに割り当てられた上記担当レコードを受信するステップと、
各演算ユニットが、受信された上記担当レコードから、上記レコード順序番号配列及び上記項目値アクセス情報配列を生成し、この演算ユニットの上記専用のローカルメモリに格納するステップと、
各演算ユニットが、項目毎に、上記担当レコード中の項目値を上記所定の順序でソートすることにより、上記ローカル項目値配列、及び、上記ローカル項目値番号配列を生成し、この演算ユニットの上記専用のローカルメモリに格納するステップと、
各演算ユニットが、項目毎に、上記ローカル項目値配列、上記担当レコードの範囲内で上記所定の順序に基づいて上記ローカル項目値配列に含まれる上記一意の項目値に割り当てられた順序番号が格納されているローカル項目値順序番号配列、及び、上記ローカル項目値順序番号配列中の上記順序番号に関連した上記担当レコードを示す上記ブロック番号を含むブロック番号配列を、上記ローカルデータとして、この演算ユニットの後のパイプライン段にある演算ユニットへ送信するステップと、
を備え、
上記マージするステップが、前のパイプライン段からの少なくとも2つのローカルデータに含まれている少なくとも2つのローカル項目値配列中の項目値を上記所定の順序でマージすることにより、上記少なくとも2つのローカルデータを、さらなるブロック番号配列、さらなるローカル項目値順序番号配列及びさらなるローカル項目値配列により形成された1つのローカルデータに変換するステップを含み、
上記分配するステップが、最終的に生成されたさらなるローカル項目値順序番号配列に格納されている順序番号を、対応する最終的に生成されたさらなるブロック番号配列に格納されているブロック番号に関連付けられた演算ユニットへ送信するステップを含み、
各演算ユニットが、上記送信された順序番号を上記グローバル項目値順序番号配列に順次に格納するステップをさらに備える、
請求項10記載の表形式データ操作方法。 - 各演算ユニットが、所定の項目に関して、上記担当レコードを含むブロック毎に、上記ローカル項目値番号をキーとして上記レコード順序番号配列、上記項目値アクセス情報配列及び上記グローバル項目値順序番号配列にソートを適用し、これによって、ローカルソートされたレコード順序番号配列、ローカルソートされた項目値アクセス情報配列及びローカルソートされたグローバル項目値順序番号配列を生成するステップと、
各演算ユニットが、上記所定の項目に関して、上記ローカルソートされたグローバル項目値順序番号配列、上記ローカルソートされたレコード順序番号配列、及び、上記ローカルソートされたレコード順序番号配列に関連した上記担当レコードを示す上記ブロック番号を含むブロック番号配列を、上記ローカルデータとして、この演算ユニットの後のパイプライン段にある演算ユニットへ送信するステップと、
を備え
上記マージするステップが、前のパイプライン段からの少なくとも2つのローカルデータに含まれている上記ローカルソートされたグローバル項目値順序番号配列と上記ローカルソートされたレコード順序番号配列との組を所定の順序でマージすることにより、上記少なくとも2つのローカルデータを、さらなるグローバル項目値順序番号配列、さらなるレコード順序番号配列及びさらなるブロック番号配列により形成された1つのローカルデータに変換するステップを含み、
上記分配するステップが、最終的に生成されたさらなるブロック番号配列に含まれているブロック番号の上記さらなるブロック番号配列中での順序番号を、上記ブロック番号に関連付けられた演算ユニットへ送信するステップを含み、
各演算ユニットが、上記送信された順序番号を上記レコード順序番号配列に順次に格納するステップをさらに備える、
請求項10記載の表形式データ操作方法。 - 各演算ユニットが、所定の項目に関して、上記担当レコードを含むブロック毎に、検索条件に一致する項目値を含むレコードに対応する新たなレコード順序番号配列及び新たな項目値アクセス情報配列を生成し、上記項目値アクセス情報配列を上記新たな項目値アクセス情報配列で置き換えるステップと、
各演算ユニットが、上記所定の項目に関して、上記新たなレコード順序番号配列、及び、上記新たなレコード順序番号配列に関連した上記担当レコードを示す上記ブロック番号を含むブロック番号配列を、上記ローカルデータとして、この演算ユニットの後のパイプライン段にある演算ユニットへ送信するステップと、
を備え、
上記マージするステップが、前のパイプライン段からの少なくとも2つのローカルデータに含まれている上記新たなレコード順序番号配列と上記ブロック番号配列との組を所定の順序でマージすることにより、上記少なくとも2つのローカルデータを、さらなるレコード順序番号配列及びさらなるブロック番号配列により形成された1つのローカルデータに変換するステップを含み、
上記分配するステップが、最終的に生成された上記さらなるブロック番号配列に含まれているブロック番号の上記さらなるブロック番号配列中での順序番号を、上記ブロック番号に関連付けられた演算ユニットへ送信するステップを含み、
各演算ユニットが、上記送信された順序番号を上記新たなレコード順序番号配列に順次に格納するステップをさらに備える、
請求項10記載の表形式データ操作方法。 - 前記複数台の演算ユニットが、集計元の表形式データとして使用される第1の表形式データに関する第1の担当レコード、及び、上記第1の表形式データの所定の項目の組に関する項目値の組毎に少なくとも1つの別の集計項目に関する項目値を集計することにより得られる集計結果を表現する第2の表形式データに関する第2の担当レコードをそれぞれの専用のローカルメモリに格納するように構成され、
各演算ユニットが、上記分散メモリ型マルチプロセッサに接続されている外部装置から、上記第2の表形式データのうちこの演算ユニットに分割される上記第2の担当レコードの範囲情報、及び、上記所定の項目の組に属する一意の項目値の個数の組を受信するステップと、
各演算ユニットが、上記第2の担当レコードの範囲情報に基づいて、この演算ユニットに割り当てられた上記第2の担当レコードのレコード順序番号配列及び項目値アクセス情報配列を生成し、この演算ユニットの上記専用のローカルメモリに格納するステップと、
各演算ユニットが、上記所定の項目毎に、上記第2の担当レコードの範囲情報と上記所定の項目に属する一意の項目値の個数の組とに基づいて、この演算ユニットに割り当てられた上記第2の担当レコードのグローバル項目値順序番号配列及びローカル項目値番号配列を生成し、この演算ユニットの上記専用のローカルメモリに格納するステップと、
各演算ユニットが、上記所定の項目毎に、上記第1の担当レコードに関するこの所定の項目のローカル項目値配列と、上記第2の担当レコードに関するこの所定の項目の上記グローバル項目値順序番号配列と、上記グローバル項目値順序番号配列中の順序番号に関連した上記第2の担当レコードを示すブロック番号を含むブロック番号配列とを、上記ローカルデータとして、この演算ユニットの後のパイプライン段にある演算ユニットへ送信するステップと、
を備え、
上記マージするステップが、前のパイプライン段からの少なくとも2つのローカルデータに含まれているローカル項目値配列を所定の順序でマージすることによりさらなるローカル項目値配列を生成し、前のパイプライン段からの上記少なくとも2つのローカルデータに含まれているブロック番号配列及びグローバル項目値順序番号配列を所定の順序でマージすることによりさらなるブロック番号配列及びさらなるグローバル項目値順序番号配列を生成し、これにより、上記2つのローカルデータを、上記さらなるローカル項目値配列、上記さらなるブロック番号配列及び上記さらなるグローバル項目値順序番号配列により形成された1つのローカルデータに変換する手段を含み、
上記分配手段が、最終的に生成されたさらなるグローバル項目値順序番号配列に格納されている順序番号によって指定された最終的に生成されたさらなるローカル項目値配列に格納されている項目値を、対応する最終的に生成されたさらなるブロック番号配列に格納されているブロック番号に関連付けられた演算ユニットへ送信するステップを含み、
各演算ユニットが、上記送信された項目値をこの演算ユニットの上記第2の担当レコードのローカル項目値配列に順次に格納するステップと、
各演算ユニットが、上記第1の担当レコードに含まれる上記所定の項目の組に関する項目値の組を特定する次元値番号を含む次元値番号配列と、上記次元値番号に対応する上記少なくとも1つの集計項目に関する項目値の集計値を含むローカル集計値配列とを生成し、上記ローカルデータとして、この演算ユニットの後のパイプライン段にある演算ユニットへ送信するステップと、
をさらに備え、
上記マージするステップが、前のパイプライン段からの少なくとも2つのローカルデータに含まれている次元値番号配列及びローカル集計値配列を所定の順序でマージすることにより、上記少なくとも2つのローカルデータをさらなる次元値番号配列及びさらなるローカル集計値配列により形成された1つのローカルデータに変換する手段を含み、
上記分配手段が、最終的に生成されたさらなるローカル集計値配列に格納されている集計値を上記第2の担当レコードの上記範囲情報に従って演算ユニットへ送信するステップを含み、
各演算ユニットが、上記少なくとも1つの集計項目毎に、上記送信された項目値を所定の順序でソートすることにより、集計項目に関するローカル項目値配列及びローカル項目値番号配列を生成し、この演算ユニットの上記専用のローカルメモリに格納するステップと、
各演算ユニットが、上記少なくとも1つの集計項目毎に、上記ローカル項目値配列、上記第2の担当レコードの範囲内で所定の順序に基づいて上記ローカル項目値配列に含まれる一意の項目値に割り当てられた順序番号が格納されているローカル項目値順序番号配列、及び、上記ローカル項目値順序番号配列中の上記順序番号に関連した上記担当レコードを示す上記ブロック番号を含むブロック番号配列を、上記ローカルデータとして、この演算ユニットの後のパイプライン段にある演算ユニットへ送信するステップと、
をさらに備え、
上記マージするステップが、前のパイプライン段からの少なくとも2つのローカルデータに含まれている少なくとも2つのローカル項目値配列中の項目値を上記所定の順序でマージすることにより、上記2つのローカルデータを、さらなるブロック番号配列、さらなるローカル項目値順序番号配列及びさらなるローカル項目値配列により形成された1つのローカルデータに変換するステップをさらに含み、
上記分配するステップが、最終的に生成されたさらなるローカル項目値順序番号配列に格納されている順序番号を、対応する最終的に生成されたさらなるブロック番号配列に格納されているブロック番号に関連付けられた演算ユニットへ送信するステップを含み、
各演算ユニットが、上記送信された順序番号を、この演算ユニットの上記専用のローカルメモリに設けられた、上記少なくとも1つの集計項目に関するグローバル項目値順序番号配列に順次に格納するステップをさらに備える、
請求項10記載の表形式データ操作方法。 - 専用のローカルメモリ及びプロセッサを含み、相互にデータを送受するため通信接続されている複数台の演算ユニットを備えるコンピュータにロードされ、
一連のデータが上記複数台の演算ユニットに関連付けられた複数個のブロックに分割されて上記複数台の演算ユニットのそれぞれの専用のローカルメモリに保持され、上記一連のデータを上記複数台の演算ユニットのパイプライン処理によって操作するコードを上記コンピュータに実行させるコンピュータ読み取り可能なプログラムであって、
各演算ユニットが、前のパイプライン段にある1台以上の演算ユニットからそれぞれのローカルデータを受信し、少なくとも2つの受信されたローカルデータを1つのさらなるローカルデータに変換し、上記さらなるローカルデータを後のパイプライン段にある1台の演算ユニットへ送信するコードと、
前記複数台の演算ユニットのマージ手段が最終的に1つのグローバルデータを生成するようにトーナメント方式で動的に動作するコードと、
少なくとも1台のいずれかの演算ユニットが、前記複数個のブロックに対応するブロック番号に基づいて、前記グローバルデータを分割し前記複数台の演算ユニットへ割り当てるコードと、
を備えるプログラム。 - 専用のローカルメモリ及びプロセッサを含み、相互にデータを送受するため通信接続されている複数台の演算ユニットを備えるコンピュータにロードされ、
一連のデータが上記複数台の演算ユニットに関連付けられた複数個のブロックに分割されて上記複数台の演算ユニットのそれぞれの専用のローカルメモリに保持され、上記一連のデータを上記複数台の演算ユニットのパイプライン処理によって操作する請求項8乃至14のうちいずれか1項記載の表形式データ操作方法を上記コンピュータに実行させるためのコンピュータプログラムプロダクト。 - 専用のローカルメモリ及びプロセッサを含み、相互にデータを送受するため通信接続されている複数台の演算ユニットを備えるコンピュータにロードされ、
一連のデータが上記複数台の演算ユニットに関連付けられた複数個のブロックに分割されて上記複数台の演算ユニットのそれぞれの専用のローカルメモリに保持され、上記一連のデータを上記複数台の演算ユニットのパイプライン処理によって操作する請求項8乃至14のうちいずれか1項記載の表形式データ操作方法を上記コンピュータに実行させるためのコンピュータプログラムが記録された記憶媒体。
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/JP2008/063660 WO2010013320A1 (ja) | 2008-07-30 | 2008-07-30 | 表形式データを操作する方法、分散メモリ型マルチプロセッサ、及び、プログラム |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/JP2008/063660 WO2010013320A1 (ja) | 2008-07-30 | 2008-07-30 | 表形式データを操作する方法、分散メモリ型マルチプロセッサ、及び、プログラム |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2010013320A1 true WO2010013320A1 (ja) | 2010-02-04 |
Family
ID=41610044
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/JP2008/063660 Ceased WO2010013320A1 (ja) | 2008-07-30 | 2008-07-30 | 表形式データを操作する方法、分散メモリ型マルチプロセッサ、及び、プログラム |
Country Status (1)
| Country | Link |
|---|---|
| WO (1) | WO2010013320A1 (ja) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2011099114A1 (ja) * | 2010-02-09 | 2011-08-18 | 株式会社ターボデータラボラトリー | ハイブリッド型データベースシステム及びその動作方法 |
| CN111538750A (zh) * | 2020-06-24 | 2020-08-14 | 深圳壹账通智能科技有限公司 | 一种信息还原方法、装置、计算机系统及可读存储介质 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH05128164A (ja) * | 1990-03-27 | 1993-05-25 | Internatl Business Mach Corp <Ibm> | データベース処理装置 |
| JPH05143287A (ja) * | 1991-11-19 | 1993-06-11 | Hitachi Ltd | ハードウエアソート処理装置 |
| WO2000010103A1 (en) * | 1998-08-11 | 2000-02-24 | Shinji Furusho | Method and apparatus for retrieving, accumulating, and sorting table-formatted data |
| WO2005041066A1 (ja) * | 2003-10-24 | 2005-05-06 | Shinji Furusho | 分散メモリ型情報処理システム |
| WO2005041067A1 (ja) * | 2003-10-27 | 2005-05-06 | Shinji Furusho | 分散メモリ型情報処理システム |
-
2008
- 2008-07-30 WO PCT/JP2008/063660 patent/WO2010013320A1/ja not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH05128164A (ja) * | 1990-03-27 | 1993-05-25 | Internatl Business Mach Corp <Ibm> | データベース処理装置 |
| JPH05143287A (ja) * | 1991-11-19 | 1993-06-11 | Hitachi Ltd | ハードウエアソート処理装置 |
| WO2000010103A1 (en) * | 1998-08-11 | 2000-02-24 | Shinji Furusho | Method and apparatus for retrieving, accumulating, and sorting table-formatted data |
| WO2005041066A1 (ja) * | 2003-10-24 | 2005-05-06 | Shinji Furusho | 分散メモリ型情報処理システム |
| WO2005041067A1 (ja) * | 2003-10-27 | 2005-05-06 | Shinji Furusho | 分散メモリ型情報処理システム |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2011099114A1 (ja) * | 2010-02-09 | 2011-08-18 | 株式会社ターボデータラボラトリー | ハイブリッド型データベースシステム及びその動作方法 |
| JPWO2011099114A1 (ja) * | 2010-02-09 | 2013-06-13 | 株式会社ターボデータラボラトリー | ハイブリッド型データベースシステム及びその動作方法 |
| CN111538750A (zh) * | 2020-06-24 | 2020-08-14 | 深圳壹账通智能科技有限公司 | 一种信息还原方法、装置、计算机系统及可读存储介质 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Wen et al. | Exploiting GPUs for efficient gradient boosting decision tree training | |
| US9805080B2 (en) | Data driven relational algorithm formation for execution against big data | |
| US10521441B2 (en) | System and method for approximate searching very large data | |
| KR101196566B1 (ko) | 멀티 프로세서 시스템 및 그 정보처리방법 | |
| JP6418431B2 (ja) | 効率的な1対1結合のための方法 | |
| Song et al. | DTransE: Distributed translating embedding for knowledge graph | |
| US8996436B1 (en) | Decision tree classification for big data | |
| Yelick et al. | The parallelism motifs of genomic data analysis | |
| JP4511469B2 (ja) | 情報処理方法及び情報処理システム | |
| US11734244B2 (en) | Search method and search device | |
| CN116414822B (zh) | 地震数据索引库的构建方法、装置、相关设备和索引库 | |
| WO2010013320A1 (ja) | 表形式データを操作する方法、分散メモリ型マルチプロセッサ、及び、プログラム | |
| JP4881435B2 (ja) | メモリ共有型並列処理システムにおいて表形式データを集計する方法及び装置 | |
| JP4620593B2 (ja) | 情報処理システムおよび情報処理方法 | |
| JP4511464B2 (ja) | 情報処理システムおよび情報処理方法 | |
| JPWO2009044486A1 (ja) | 表形式データをソートする方法、マルチコア型装置、及び、プログラム | |
| JP4995724B2 (ja) | 情報処理システムおよび情報処理方法 | |
| JP4772506B2 (ja) | 情報処理方法、情報処理システムおよびプログラム | |
| JP5208117B2 (ja) | 表形式データを操作するマルチコア対応データ処理方法、マルチコア型処理装置、及び、プログラム | |
| Marchet | Advancements in practical k-mer sets: essentials for the curious | |
| US11734318B1 (en) | Superindexing systems and methods | |
| Riha et al. | An Adaptive Hybrid OLAP Architecture with optimized memory access patterns | |
| Kaur et al. | Sentimental analysis using various analytical tools from hadoop eco system | |
| KR20100072855A (ko) | 고차원 데이터의 색인/검색 시스템 및 그 방법 | |
| Liu et al. | Accelerating Multi-Output GBDTs with GPUs |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 08791891 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 08791891 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: JP |