A performance portable numerical simulation uniform acceleration interface method
By using iterators to traverse the topology matrix on a high-performance computing platform, obtain data locations, and perform operator operations, the complexity of programming interfaces on heterogeneous platforms is solved, achieving cross-platform performance portability and simplified development, adapting to various grid computing needs.
Patent Information
- Application Number
- CN202310059534.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-16
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2043-01-16
AI Technical Summary
On high-performance computing platforms with heterogeneous many-core architectures, the existing programming interfaces are different, which makes it difficult to develop and adapt upper-layer applications and achieve performance portability of 'one code, multiple platform acceleration'. In particular, array operations are complex and unintuitive when using the GraphBLAS interface.
This paper provides a performance-portable unified acceleration interface method for numerical simulation. It uses iterators to traverse the topological matrix of data relationships, obtain data position information, and perform operator operations on data sequence elements. It supports interfaces such as vector iteration, matrix-vector iteration, and matrix-matrix iteration, shielding the underlying data structure and algorithm details, and supports the calculation of any number of arrays and parameters.
It achieves cross-platform performance portability, simplifies the use of acceleration interfaces, makes development more intuitive, adapts to various mesh and meshless discrete relational operations, and improves computational efficiency and maintainability.
Smart Images

Figure CN116166589B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a performance-portable unified acceleration interface method for numerical simulation. Background Technology
[0002] High-performance computing has entered the era of many-core architecture. As of June 2022, the top 10 of the world's Top500 supercomputers almost all adopted heterogeneous many-core architectures. The rise of heterogeneous many-core architectures has led to a proliferation of high-performance processors, and high-performance computer architectures have seen various structures such as system heterogeneity, node heterogeneity, and on-chip heterogeneity. Therefore, different platforms have different parallel programming models and programming interfaces, posing a severe challenge to the development and adaptation of upper-layer high-performance computing applications. To address the "programming wall" problem on advanced high-performance computing platforms, achieve the goal of "one set of code, multi-platform acceleration" for upper-layer applications, improve the maintainability of upper-layer applications, and protect development investments, relevant organizations and individuals at home and abroad have carried out some work. A typical example is the GraphBLAS standard, which unifies upper-layer application algorithms through matrix-vector operations and mathematical abstraction. It defines standard building blocks for graph algorithms in linear algebra languages. GraphBLAS is built on the concept that sparse matrices can be used to represent graphs as adjacency matrices or incidence matrices. The GraphBLAS specification describes how to efficiently implement graph computation operations (such as graph traversal and transformation) on different semirings using linear algebraic methods (e.g., matrix multiplication). In the field of numerical simulation, GraphBLAS is significant because, compared to general sparse matrix libraries, its matrix and vector data types and specific operations are definable. This overcomes the limitations of traditional sparse libraries like MKL and cuSparse, which only support basic types like integers, floating-point numbers, and complex numbers, and whose operations are limited to basic multiplication and addition. Furthermore, GraphBLAS matrices primarily abstract graphs, and their structure and related algorithms can be implemented internally, improving adaptability and extensibility to various topologies, including structured and unstructured ones. However, from the perspective of practical application development needs, the number of arrays involved in computation is variable, and the operations are highly complex. Using the interfaces defined by GraphBLAS often requires SOA to AOS aggregation conversion and the conversion of user computations into abstract semirings and monoids, making it undoubtedly difficult to use. Summary of the Invention
[0003] To address the aforementioned problems, this invention provides a performance-portable unified acceleration interface method for numerical simulation, which can solve these problems, supports any number of arrays and parameters in the calculation, and makes the interface more intuitive and convenient to use.
[0004] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0005] This invention provides a performance-portable unified acceleration interface method for numerical simulation, characterized by comprising the following steps:
[0006] S101: Traverse the topological matrix of data relationships using an iterator;
[0007] S102: The iterator calculates the position information of the data in the topological matrix and obtains the data sequence;
[0008] S103: Perform operator operations on each data sequence element using an iterator.
[0009] The performance-portable unified acceleration interface method for numerical simulation provided by this invention preferably further includes an algorithm interface centered on four types of interfaces: vector iteration, matrix-vector iteration, matrix-matrix iteration, and a vector reduction interface covering data reduction and statistical requirements.
[0010] Vector iteration algorithm: concurrently and unorderedly traverses each element position of a vector;
[0011] Vector reduction algorithm: Based on the vector iteration algorithm, reduction calculation is performed to obtain the final reduction result;
[0012] Matrix-vector iteration algorithm: Iterates over each entry of the topological matrix concurrently and in an unordered manner, and iterates over the row and column index vector positions corresponding to each entry;
[0013] Matrix-Matrix Iteration Algorithm: The matrix-matrix iteration algorithm consists of a left matrix, a right matrix, and a result matrix; the row indices of the left matrix are the same as those of the result matrix; the column indices of the right matrix are the same as those of the result matrix; the column indices of the left matrix and the row indices of the right matrix represent the annihilation dimension; the matrix-matrix iteration algorithm concurrently and unorderedly traverses all entries of the left matrix, as well as the associated entries of the right matrix and the result matrix, and traverses the corresponding positions of the vectors of the left matrix rows, right matrix columns, and annihilation dimension.
[0014] The present invention provides a performance-portable unified acceleration interface method for numerical simulation. Preferably, the vector reduction algorithm is based on the vector iteration algorithm, and the reduction results of concurrent threads are recursively reduced in pairs in a tree structure to obtain the final reduction result.
[0015] The performance-portable unified acceleration interface method for numerical simulation provided by this invention preferably further includes:
[0016] Basic type conventions: Data sequences can only store basic type elements, and basic type data objects have contiguous and finite storage space in memory; operations supported by basic type data objects generally do not introduce intermediate variables or external function calls.
[0017] Operator behavior conventions: Operators are used to describe user computations and only support operations supported by basic types, operations of high-level language system types, branching judgments and looping calculations based on high-level language foundations. In principle, operators do not support the creation of temporary variables.
[0018] The present invention provides a performance-portable unified acceleration interface method for numerical simulation, preferably including a copy attribute for the data sequence in the iterative calculation; the copy attribute includes copy-in, copy-out, and copy-in-copy-out.
[0019] The present invention provides a performance-portable unified acceleration interface method for numerical simulation, preferably including topological sorting in step S102; rearranging the target topological matrix, and rearranging the data sequences of the rows and columns of the rearranged topological matrix respectively.
[0020] The present invention provides a performance-portable unified acceleration interface method for numerical simulation. Preferably, in step S103, the user accesses relevant data sequence elements and performs mutual operations based on iteratively traversing the current index of the reference element and its associated index.
[0021] The performance-portable unified acceleration interface method for numerical simulation provided by the present invention preferably includes a substitution subscript in step S103; the substitution subscript is an element index subscript provided to the operator definition.
[0022] The present invention provides a performance-portable unified acceleration interface method for numerical simulation. Preferably, the data sequence includes a length access interface for accessing the length of the data sequence, an element access interface for accessing basic type elements in the data sequence, a data location access interface for obtaining the position of a data object in the topology, a copy attribute access interface for obtaining the copy attribute of the data object when participating in computation, a construction interface for constructing a data sequence object, and a destructor interface for destructing the data sequence object. The length access interface outputs the length of the data sequence as an integer. The element access interface takes as input an identifier indicating the order of data in the data sequence and outputs a basic type object. The data location access interface outputs the position information of the data sequence in the topology, including rows, columns, or entries. The copy attribute access interface outputs the copy attribute of the data sequence when participating in computation. The construction interface takes as input a data sequence object constructed from an array and outputs a returned data sequence object.
[0023] The present invention provides a performance-portable unified acceleration interface method for numerical simulation. Preferably, the topology includes an access interface, a sorting interface, a construction interface, and a destruction interface for acquiring topology information. The access interface includes an access entry number interface (output parameter: number of topology entries), an access topology row number interface (output parameter: number of topology rows), an access topology type interface (output parameter: topology type), an access entry row index interface, and an access entry column index interface. The access entry row index interface takes the index of the currently acquired entry as input and outputs the row index of the current entry. The access entry column index interface takes the index of the currently acquired entry as input and outputs the column index of the current entry. The sorting interface includes a topology sorting interface, a row sorting interface, and a column sorting interface. The topology sorting interface includes single topology rearrangement. The system includes three topology rearrangements: a single topology rearrangement for rearranging a target topology object, and a three-topology rearrangement for accelerating matrix-matrix computations, comprising three parameters: the topology of the left matrix to be sorted, the topology of the right matrix to be sorted, and the topology of the result matrix to be sorted. The row sorting interface rearranges the data in the rows of the rearranged topology, taking the number of sorted data sequences as input and outputting the sorted data sequences. The column sorting interface rearranges the data in the columns of the rearranged topology, taking the number of sorted data sequences as input and outputting the sorted data sequences. The construction interface takes the type of the topology and an array of topology row / column indices or other integer sequences as input parameters and returns the topology object. The destruction interface takes the topology object to be destroyed as input parameters.
[0024] The present invention provides a performance-portable unified acceleration interface method for numerical simulation. Preferably, vector computation includes an iterative interface and a vector reduction interface. The operator types of the iterative interface include A parameters and B parameters. The A parameter is an input vector subscript used to represent the loop variable for traversing the vector; this subscript is generally a system-specified symbol or a default value. The B parameter is a data sequence of an indefinite number of elements, whose elements are accessed according to the A parameter subscripts and subjected to operator-defined computation operations; its copy-in / copy-out is determined by the copy properties of the data sequence. The iterative interface includes C... The C parameter is the input operator; the D parameter is a variable number of data sequences whose elements are traversed and computational operations defined by the C parameter operator are applied, and their copy-in / copy-out is determined by the copy property of the data sequence; the vector reduction interface input parameters include A operator type, B operator type and variable parameter data sequence type, and returns the reduction result; the A operator type is the operator that takes vector subscripts and variable parameter data sequence type as input and returns the reduction result; the B operator type is the type of the reduction result that takes intermediate results of multi-threaded reduction as input and returns the reduction result.
[0025] The performance-portable unified acceleration interface method for numerical simulation provided by this invention preferably further includes a matrix-vector computation interface. The operator type input parameters of the matrix-vector computation interface include matrix entry subscripts for defining data indices on coefficient matrix entries, vector subscripts for defining data indices on coefficient matrix rows, and vector subscripts for defining data indices on coefficient matrix columns. The operator type parameters of the matrix-vector computation interface also include a variable number of data sequences. The data sequences access elements through operator subscript parameters and apply computational operations defined by the operators. The input or output attributes of the data sequences are determined by the copy attributes of the data sequences. The input parameters of the matrix-vector iteration interface for multi-data-sequence computation include topological parameters and operator types. The input and output attributes of the data sequences are determined based on their copy attributes. The parameters of the matrix-vector iteration interface for multi-data-sequence computation also include a variable number of data sequences. The elements of the data sequences are traversed and accessed, and computational operations defined by the operators are applied. The input or output attributes of the data sequences are determined by the copy attributes of the data sequences.
[0026] The performance-portable unified acceleration interface method for numerical simulation provided by this invention preferably further includes a matrix-matrix computation interface. The operator type input parameters of the matrix-matrix computation interface include: subscripts for left matrix entries, right matrix entries, and result matrix entries used to define data indices on sparse matrix entries; vector subscripts for defining data indices on sparse matrix rows, valid for both the left and result matrices; vector subscripts for defining data indices on sparse matrix columns, valid for both the right and result matrices; and vector subscripts for defining data indices on coefficient matrix columns, which also serve as both left matrix column indices and right matrix row indices. The operator type parameter of the matrix-matrix computation interface also includes a variable number of data sequences. The data sequences access elements through operator subscript parameters and apply the computational operations defined by the operators. The input or output attributes of the data sequences are determined by the copy attributes of the data sequences. The input parameters of the matrix-matrix iteration interface for multi-data-sequence computation include left matrix topology parameters, right matrix topology parameters, result matrix topology parameters, and operator type. The parameters of the matrix-matrix iteration interface for multi-data-sequence computation also include a variable number of data sequences. The elements of the data sequences are traversed and accessed, and the computational operations defined by the operators are applied. The input or output attributes of the data sequences are determined by the copy attributes of the data sequences.
[0027] The above technical solution has the following advantages or beneficial effects:
[0028] This invention provides a performance-portable unified acceleration interface method for numerical simulation, characterized by comprising the following steps:
[0029] S101: Traverse the topological matrix of data relationships using an iterator;
[0030] S102: The iterator calculates the position information of the data in the topological matrix and obtains the data sequence;
[0031] S103: Perform operator operations on each data sequence element using an iterator.
[0032] This invention, with iterators at its core, can support any number of arrays and parameters to participate in the calculation, supports flexible user-defined calculation functions, and supports the participation of structure arrays in the calculation, making the acceleration interface more intuitive and meeting the actual needs of accelerated computing development and optimization. Attached Figure Description
[0033] The invention, its features, shape, and advantages will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings. Like reference numerals denote like parts throughout the drawings. The drawings are not intentionally drawn to scale; the focus is on illustrating the spirit of the invention.
[0034] Figure 1 This is a schematic diagram of the steps of a performance-portable unified acceleration interface method for numerical simulation provided in Embodiment 1 of the present invention. Detailed Implementation
[0035] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, but these are not intended to limit the scope of the invention.
[0036] Example 1:
[0037] Embodiment 1 of the present invention provides a performance-portable unified acceleration interface method for numerical simulation, characterized by comprising the following steps:
[0038] S101: Traverse the topological matrix of data relationships using an iterator;
[0039] S102: The iterator calculates the position information of the data in the topological matrix and obtains the data sequence;
[0040] S103: Perform operator operations on each data sequence element using an iterator.
[0041] For structured grids, when data is arranged according to high and low dimensions, the relationships exhibit multi-dimensional vector characteristics. When the structural relationships are represented by the incidence matrix and adjacency matrix, the matrix exhibits multi-diagonal characteristics. For unstructured grids, the relationships between grids exhibit irregularity. When the structural relationships are represented by the incidence matrix and adjacency matrix, the matrix exhibits general sparse matrix characteristics, such as COO and CSR format matrices. Other spatial discretization methods generally exhibit local or multi-level structured relationships, or can completely degenerate into unstructured relationships. Therefore, various numerical calculations based on grid relationships can be abstracted into calculations based on matrices with certain regular or irregular structures. This invention refers to the structure of such matrices as topology.
[0042] Data related to matrix entries and row and column vectors can be represented by a continuously stored sequence of elements of the same type. This invention refers to these data as data sequences.
[0043] Users access related data sequence elements and perform operations on each other based on the current index of the reference element and its associated index. In this invention, user-defined computational operations are called operators.
[0044] The present invention provides a performance-portable unified acceleration interface method for numerical simulation by using iterators as the main interface. It can support any number of arrays and parameters to participate in the calculation, supports flexible user-defined calculation functions, and supports the participation of structure arrays in the calculation, making the acceleration interface more intuitive to use and meeting the actual needs of accelerated computing development and optimization.
[0045] General geometry-independent computations, such as computations between different variables at the same grid location, can be abstracted as vector element computations. Geometry-related computations include spatial interpolation, spatial integration, or matrix computations in algebraic equation systems, which can be abstracted as matrix-vector-based generalized computations. In addition, there are some cross-topology computations, such as multigrid coarsening and refinement, cross-domain interpolation, and some special algebraic solution methods, which can be abstracted as matrix-matrix generalized computations.
[0046] Based on the above algorithm implementation requirements, this embodiment 1 proposes an algorithm interface with four core types of interfaces: vector iteration, matrix-vector iteration, matrix-matrix iteration, and a vector reduction interface covering data reduction and statistical requirements. These include:
[0047] Vector iteration algorithm: concurrently and unorderedly traverses each element position of a vector;
[0048] Vector reduction algorithm: Based on the vector iteration algorithm, the reduction results of concurrent threads can be recursively reduced in pairs using a tree structure to obtain the final reduction result.
[0049] Matrix-vector iteration algorithm: Iterates over each entry of the topological matrix concurrently and in an unordered manner, and iterates over the row and column index vector positions corresponding to each entry;
[0050] Matrix-Matrix Iteration Algorithm: This algorithm consists of a left matrix, a right matrix, and a result matrix. The row indices of the left matrix are the same as those of the result matrix; the column indices of the right matrix are the same as those of the result matrix; and the column indices of the left matrix are the same as those of the right matrix, referred to as the annihilation dimension. The algorithm concurrently and unorderedly traverses all entries of the left matrix, as well as the associated entries of the right matrix and the result matrix, and also traverses the corresponding positions of the vectors representing the rows of the left matrix, the columns of the right matrix, and the annihilation dimension. This facilitates calculations between associated elements.
[0051] Embodiment 1 of this invention forms a unified concept of matrix and vector through an algorithm, performs a unified abstraction of data structure, and hides the implementation details of data structure and algorithm details at the bottom layer of topology. This shields users from the detailed differences in implementation on different hardware platforms, thereby achieving the goal of cross-platform performance portability.
[0052] When a data sequence participates in a computation, its position needs to be specified. For example, in matrix-vector computation, the data position can be on a row, a column, or a matrix; in matrix-matrix computation, the data position can be on the left matrix, the right matrix, the result matrix, a matrix row, a matrix column, or an annihilation dimension, or a parameter sequence with no corresponding relationship.
[0053] In a preferred embodiment of this example, it further includes:
[0054] Basic type conventions: Data sequences can only store basic type elements, and basic type data objects have contiguous and finite storage space in memory; operations supported by basic type data objects generally do not introduce intermediate variables and external function calls, thereby avoiding the risk of cache overflow.
[0055] Operator behavior conventions: Operators are used to describe user computations and only support operations supported by basic types, operations of high-level language system types, branching judgments and loop calculations based on high-level language foundations. In principle, temporary variable creation is not supported inside operators, mainly to avoid some uncontrollable buffer overflows or inaccessible external function calls in operators.
[0056] In iterative computation, in order to fully control the flow relationship between storage spaces such as data memory and cache, thereby facilitating performance improvement, in this embodiment 1, iterative computation also includes copy attributes for data sequences; the copy attributes include copy-in, copy-out, and copy-in-copy-out, and the copy attributes clarify the copy-in and copy-out behavior of the data sequence.
[0057] In a preferred embodiment of this invention, step S102 further includes topological sorting; rearranging the target topological matrix, and rearranging the data sequences of the rows and columns of the rearranged topological matrix respectively. Embodiment 1 of the present invention achieves the objectives of bandwidth reduction and local data concentration during computation by rearranging the target topological object.
[0058] In a preferred embodiment of this example, the user accesses related data sequence elements and performs operations on them based on the current index of the reference element and its associated index.
[0059] User-defined operators are based on iterating through the data sequence elements corresponding to the base element and associated elements. Therefore, in this embodiment 1, it is necessary to provide nominal element index subscripts for the operator definition, which are referred to as substitute subscripts in this invention. For example, in matrix-vector operations, ENT replaces the matrix element index, ROW replaces the corresponding row index, COL replaces the corresponding column index, etc.
[0060] The performance-portable unified acceleration interface method for numerical simulation provided in Embodiment 1 of this invention stipulates that:
[0061] The data sequence includes a length access interface for accessing the length of the data sequence, an element access interface for accessing the basic type elements in the data sequence, a data location access interface for obtaining the position of the data object in the topology, a copy attribute access interface for obtaining the copy attribute of the data object when participating in the calculation, a construction interface for constructing a data sequence object, and a destructor interface for destructing the data sequence object, defined as follows;
[0062] Topology includes access interfaces and sorting interfaces for obtaining topology information;
[0063] The access interface includes an access entry number interface with the output parameter being the number of topology entries, an access topology row number interface with the output parameter being the number of topology rows, an access topology type interface with the output parameter being the topology type, an access entry row label interface, and an access entry column label interface, defined as follows;
[0064] The topology sorting interface includes single topology rearrangement and triple topology rearrangement; the single topology rearrangement is used to rearrange the target topology object; the triple topology rearrangement is used to accelerate matrix-matrix computation and includes three parameters: the topology of the left matrix to be sorted, the topology of the right matrix to be sorted, and the topology of the result matrix to be sorted, as defined below;
[0065] It also includes a constructor interface and a destructor interface, defined as follows;
[0066] Vector computation includes an iteration interface and a vector reduction interface, defined as follows;
[0067] The matrix-vector calculation interface is defined as follows:
[0068] The matrix-matrix calculation interface is defined as follows:
[0069] In summary, the present invention provides a performance-portable unified acceleration interface method for numerical simulation, which uses iterators as its core. It supports a variable number of arrays and parameters to participate in the calculation and allows users to flexibly define calculation functions. Furthermore, it can adapt to various grids and gridless discrete relational operations, shields the underlying data structures and algorithm details, and is simpler and more convenient to use, thus achieving cross-platform performance portability for upper-layer applications.
[0070] Those skilled in the art should understand that variations can be implemented by combining existing technology and the above embodiments, and will not be elaborated here. Such variations do not affect the substantive content of the present invention, and will not be elaborated here. The preferred embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the specific embodiments described above, and the devices and structures not described in detail should be understood as being implemented in a conventional manner in the art; any possible changes and modifications made by those skilled in the art without departing from the technical solution of the present invention, or modifications to equivalent embodiments with equivalent changes, do not affect the substantive content of the present invention. Therefore, any simple modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention shall still fall within the protection scope of the technical solution of the present invention.
Claims
1. A performance-portable unified acceleration interface method for numerical simulation, characterized in that, Includes the following steps: S101: Traverse the topological matrix of data relationships using an iterator; S102: The iterator calculates the position information of the data in the topological matrix and obtains the data sequence; S103: Perform operator operations on each data sequence element using an iterator; This includes four core types of algorithm interfaces: vector iteration, matrix-vector iteration, matrix-matrix iteration, and vector reduction, which covers data reduction and statistical requirements. Vector iteration algorithm: concurrently and unorderedly traversing each element position of a vector; Vector reduction algorithm: Based on the vector iteration algorithm, reduction calculation is performed to obtain the final reduction result; Matrix-vector iteration algorithm: Iterates over each entry of the topological matrix concurrently and in an unordered manner, and iterates over the row and column index vector positions corresponding to each entry; Matrix-Matrix Iteration Algorithm: The matrix-matrix iteration algorithm consists of a left matrix, a right matrix, and a result matrix; the row indices of the left matrix are the same as those of the result matrix; the column indices of the right matrix are the same as those of the result matrix; the column indices of the left matrix are the same as those of the right matrix, i.e., the annihilation dimension; the matrix-matrix iteration algorithm concurrently and unorderedly traverses all entries of the left matrix and the associated entries of the right matrix and the result matrix, as well as traversing the corresponding positions of the vectors of the left matrix rows, right matrix columns, and annihilation dimension.
2. The performance-portable unified acceleration interface method for numerical simulation as described in claim 1, characterized in that, The vector reduction algorithm is based on the vector iteration algorithm, which performs pairwise tree-based recursive reduction on the reduction results of concurrent threads to obtain the final reduction result.
3. The performance-portable unified acceleration interface method for numerical simulation as described in claim 1, characterized in that, Also includes: Basic type conventions: Data sequences can only store elements of basic types, and basic type data objects have contiguous and finite storage space in memory; Operations supported by primitive data type objects generally do not involve intermediate variables or external function calls; Operator behavior conventions: Operators are used to describe user computations and only support operations supported by basic types, operations of high-level language system types, branching judgments and looping calculations based on high-level language foundations. In principle, operators do not support the creation of temporary variables.
4. The performance-portable unified acceleration interface method for numerical simulation as described in claim 1, characterized in that, Iterative computation also includes copy properties of the data sequence; copy properties include copy-in, copy-out, and copy-in-copy-out.
5. The performance-portable unified acceleration interface method for numerical simulation as described in claim 1, characterized in that, Step S102 also includes topological sorting; rearranging the target topological matrix, and rearranging the data sequences of the rows and columns of the rearranged topological matrix respectively.
6. The performance-portable unified acceleration interface method for numerical simulation as described in claim 1, characterized in that, In step S103, the user accesses relevant data sequence elements and performs operations on each other based on the current index of the reference element and its associated index.
7. The performance-portable unified acceleration interface method for numerical simulation as described in claim 5, characterized in that, Step S103 also includes a substitute subscript; the substitute subscript is an element index subscript provided to the operator definition.
8. The performance-portable unified acceleration interface method for numerical simulation as described in claim 1, characterized in that, The data sequence includes a length access interface for accessing the length of the data sequence, an element access interface for accessing the basic type elements in the data sequence, a data location access interface for obtaining the position of the data object in the topology, a copy attribute access interface for obtaining the copy attribute of the data object when participating in the calculation, a construction interface for constructing a data sequence object, and a destructor interface for destructing the data sequence object. The length access interface outputs an integer data sequence length; The element access interface takes as input the order of data in the data sequence and outputs an object of a basic type. The data location access interface outputs the location information of the data sequence in the topology, including rows, columns, or entries; The copy attribute access interface outputs the copy attribute of the data sequence when it is used in the calculation. The construction interface takes a data sequence object constructed from an array as input and outputs a returned data sequence object.
9. The performance-portable unified acceleration interface method for numerical simulation as described in claim 8, characterized in that, Topology includes access interfaces, sorting interfaces, construction interfaces, and destruction interfaces for obtaining topology information; The access interface includes an access entry number interface with the output parameter being the number of topology entries, an access topology row number interface with the output parameter being the number of topology rows, an access topology type interface with the output parameter being the topology type, an access entry row label interface, and an access entry column label interface. The access entry row index interface takes the index of the currently retrieved entry as input and outputs the row index of the current entry; The access entry column index interface takes the index of the currently retrieved entry as input and outputs the column index of the current entry; The sorting interface includes a topology sorting interface, a row sorting interface, and a column sorting interface; The topology sorting interface includes single topology rearrangement and triple topology rearrangement; the single topology rearrangement is used to rearrange the target topology object; the triple topology rearrangement is used to accelerate matrix-matrix computation and includes three parameters: the topology of the left matrix to be sorted, the topology of the right matrix to be sorted, and the topology of the result matrix to be sorted. The row sorting interface rearranges the data on the rearranged topology row, takes the number of data sequences to be sorted as input, and outputs the sorted data sequences. The column sorting interface rearranges the data on the rearranged topology column, takes the number of data sequences to be sorted as input, and outputs the sorted data sequences. The input parameters for the construction interface include the type of the topology and an array of topology row / column indices or other integer sequences, and the output is a returned topology object; The input parameter of the destructor interface is the topology object to be destructed.
10. The performance-portable unified acceleration interface method for numerical simulation as described in claim 9, characterized in that, Vector computation includes an iterative interface and a vector reduction interface; The iterative interface includes two operator types: A and B. The A parameter is an input vector index used to represent the loop variable for traversing the vector; this index can be a system-specified symbol or a default value. The B parameter is a variable number of data sequences whose elements are accessed and subjected to operator-defined computations according to the A parameter indices; its copy-in / copy-out is determined by the copy property of the data sequence. The iterative interface also includes two parameters: C and D. The C parameter is the input operator; the D parameter is a variable number of data sequences whose elements are traversed and subjected to operator-defined computations according to the C parameter; its copy-in / copy-out is determined by the copy property of the data sequence. The vector reduction interface takes A operator type, B operator type, and variable parameter data sequence type as input parameters and returns the reduction result. A operator type is an operator that takes vector subscripts and variable parameter data sequence type as input and returns the reduction result. B operator type is a type of reduction result that takes intermediate results of multi-threaded reduction as input and returns the reduction result.
11. The performance-portable unified acceleration interface method for numerical simulation as described in claim 9, characterized in that, It also includes a matrix-vector calculation interface; The operator type input parameters of the matrix-vector computation interface include matrix entry subscripts for defining data indices on coefficient matrix entries, vector subscripts for defining data indices on coefficient matrix rows, and vector subscripts for defining data indices on coefficient matrix columns. The operator type parameters of the matrix-vector computation interface also include a variable number of data sequences. The data sequences access elements through operator subscript parameters and apply the computational operations defined by the operators. The input or output attributes of the data sequences are determined by the copy attributes of the data sequences. The input parameters of the matrix-vector iteration interface for multi-data-sequence computation include topological parameters and operator type; the input and output attributes of the data sequence are determined by its copy attribute; the parameters of the matrix-vector iteration interface for multi-data-sequence computation also include a variable number of data sequences, the elements of the data sequence are traversed and accessed and computational operations defined by the operator are applied, and the input or output attributes of the data sequence are determined by the copy attribute of the data sequence.
12. The performance-portable unified acceleration interface method for numerical simulation as described in claim 9, characterized in that, It also includes a matrix-matrix calculation interface; The operator type input parameters for the matrix-matrix calculation interface include: Used to define the left matrix entry subscript, right matrix entry subscript, and result matrix entry subscript for data indexing on sparse matrix entries; used to define the vector subscript for data indexing on sparse matrix rows, valid for both the left and result matrices; used to define the vector subscript for data indexing on sparse matrix columns, valid for both the right and result matrices; used to define the vector subscript for data indexing on coefficient matrix columns, which also serves as both the left matrix column index and the right matrix row index; The operator type parameter of the matrix-matrix computation interface also includes a variable number of data sequences. The data sequences access elements through operator subscript parameters and apply the computational operations defined by the operators. The input or output attributes of the data sequences are determined by the copy attributes of the data sequences. The input parameters of the matrix-matrix iteration interface for multi-data-sequence computation include left matrix topology parameters, right matrix topology parameters, result matrix topology parameters, and operator type. The parameters of the matrix-matrix iteration interface for multi-data-sequence computation also include a variable number of data sequences. The elements of the data sequences are traversed and accessed, and the computational operations defined by the operators are applied. The input or output attributes of the data sequences are determined by the copy attributes of the data sequences.
Citation Information
Patent Citations
Real-time streaming graph relationship processing method and system
CN112632336A