Data management and parallel computing method and device
Through the methods of data alignment, striped storage and data blocking, the three-dimensional array storage and calculation method of elastic wave forward simulation calculation in oil and mineral exploration is optimized, and the problem of inefficient computing in the existing technology is solved, and more efficient data reading, writing and parallel computing is achieved.
Patent Information
- Application Number
- CN202311655412.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-05
- Publication Date
- 2025-06-06
AI Technical Summary
When performing elastic wave forward simulation calculations in oil and mineral exploration in the prior art, there are calculation efficiency bottlenecks caused by the three-dimensional array storage method, including the problem of long data reading and writing time, high parallel communication delay across CPU nodes, and insufficient parallel utilization of OPENMP in CPU nodes.
Through the methods of data alignment, striped storage and data chunking, the storage and calculation methods of three-dimensional arrays are optimized. The specific steps include aligning the three-dimensional array of data in the x-direction and y-direction data in the z-direction, storing data on the xz plane using striped storage, and dividing it from multiple directions into multiple three-dimensional data blocks for parallel calculation.
It effectively reduces data reading and writing time, improves computing efficiency, reduces synchronization time, and makes full use of the parallel computing power of CPU and GPU.
Smart Images

Figure CN120105769A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of petroleum and mineral exploration, and in particular to a data management and parallel computing method and system. Background Art
[0002] In the field of oil and mineral exploration, elastic wave forward modeling is often required to predict underground structures, locate resources, etc. Time-frequency domain staggered grid finite difference calculation is an important method for elastic wave forward modeling, which can accurately simulate the propagation and scattering laws of waves, has high calculation accuracy, and can effectively reduce errors.
[0003] On the other hand, the finite difference method has a large amount of calculations, and its computational efficiency is currently improved mainly by optimizing its parallel computing methods. For example, "Forward Simulation of Three-Dimensional Acoustic Wave Equation Based on MPI+OPENMP" (Song Peng, Xie Chuang, Li Jinshan, etc.; published in 2015), "Mixed Parallel Finite Difference Algorithm for Three-Dimensional Elastic Wave Equation Based on MPI and OPENMP" (Yang Shubo, Qiao Wenxiao, Che Xiaohua; published in 2018), etc. proposed MPI+OPENMP two-level parallel optimization schemes; "GPU Cluster Implementation of Three-Dimensional Staggered Grid Finite Difference Seismic Wave Simulation" (Long Guihua, Zhao Yubo, Li Xiaofan, etc.; published in 2011), "Elastic Wave Forward Simulation of Advanced Rotated Staggered Grid Finite Difference Method Based on CUDA" (Zhao Mingzhe, Yang Jun, Zhang Lujun, etc.; published in 2022), etc. proposed MPI+CUDA two-level parallel optimization schemes.
[0004] However, there are still some factors in the existing technology that limit the further improvement of parallel efficiency: First, the three-dimensional array storage method. At present, three-dimensional data is usually stored in a three-dimensional array (or converted into a one-dimensional array) according to the fast direction (such as the z direction), the slow direction (such as the x direction) and the slowest direction (such as the y direction). From the fastest to the slowest different calculation directions, the calculation data spacing increases from small to large, and the data reading and writing time becomes longer, which makes the calculation part idle waiting, restricting the improvement of calculation efficiency; second, the cross-CPU node MPI parallelism, the high communication delay of the boundary data exchange of large data blocks, and the high time cost of data synchronization also seriously limit the improvement of calculation efficiency; third, the use of OPENMP parallelism within the CPU node cannot fully utilize the CPU vector parallel computing capability, which limits the improvement of calculation efficiency, or the use of vector code to replace the method of calculating the time-consuming and parallel part of the serial code, the program portability becomes worse. Therefore, it is expected to propose a more efficient method to improve the elastic wave forward simulation calculation, especially the efficiency of staggered grid finite difference calculation in the time-frequency domain. Summary of the invention
[0005] The present invention provides a data management and parallel computing method, which can effectively reduce data reading and writing time and greatly improve computing efficiency.
[0006] A first aspect of the present invention provides a data management and parallel computing method, comprising:
[0007] Data alignment: align the three-dimensional arrays of data in the x-direction and y-direction according to the z-direction respectively;
[0008] Striped storage, the three-dimensional arrays of aligned x-direction and y-direction data are stored in strips along the x-direction on the xz plane;
[0009] Data blocking, for the three-dimensional array stored in stripe form, dividing it into a plurality of three-dimensional data blocks in the x direction, the y direction and the z direction;
[0010] Parallel computing: performing block-by-block parallel computing based on the multiple three-dimensional data blocks on a computing node;
[0011] The x direction and the y direction represent two directions perpendicular to each other in a plane, and the z direction represents a depth direction.
[0012] Preferably, aligning the three-dimensional arrays of data in the x-direction and y-direction data in the z-direction respectively includes:
[0013] Round up the data length of the three-dimensional array of data in the x-direction and y-direction in the z-direction of the three-dimensional array to an integer multiple of the current vector length, and fill the positions without data with zero floating-point values.
[0014] Preferably, in the striped storage, the three-dimensional arrays of aligned x-direction and y-direction data are stored in stripes in the x direction on the xz plane according to the vector length or the z-direction data block length.
[0015] Preferably, the size of the three-dimensional data block in the y direction is 7 to 10, the size in the z direction is 2 or 3 times the vector length, and the size in the x direction is 1 or 2 times the vector length, and the vector length is 16.
[0016] Preferably, the parallel computing further includes:
[0017] Vector parallel computation is performed within the three-dimensional data blocks.
[0018] Preferably, the method is used for staggered grid finite difference numerical simulation calculation of anisotropic wave equation, and the x-direction and y-direction data include x-direction velocity data and y-direction velocity data, respectively;
[0019] The data alignment further includes:
[0020] Align the three-dimensional array of z-direction data in the x or y direction;
[0021] The aligning of the three-dimensional array of z-direction data according to the x-direction or y-direction includes:
[0022] Round up the data length of the three-dimensional array of z-direction data in the x-direction of the three-dimensional array to an integer multiple of the vector length, and fill the positions without data with zero floating-point values, wherein the vector length is the data length of 16 single-precision floating-point numbers;
[0023] The striped storage further includes:
[0024] The three-dimensional array of z-direction data is stored in strips along the z direction on the xz plane or the yz plane;
[0025] The data block also includes:
[0026] For the three-dimensional array of z-direction data stored in stripe form, the three-dimensional array is divided into a plurality of three-dimensional data blocks in the x-direction, the y-direction and the z-direction;
[0027] The z-direction data includes z-direction velocity data.
[0028] Preferably, the data management and parallel computing method further includes:
[0029] Establishing a three-dimensional array of first pressure data and a three-dimensional array of second pressure data, wherein the first pressure data is composite pressure data in the x-direction and the y-direction, and the second pressure data is pressure data in the z-direction;
[0030] The data alignment further includes:
[0031] Align the three-dimensional array of the first pressure data in the z direction, and align the three-dimensional array of the second pressure data in the x or y direction;
[0032] The striped storage further includes:
[0033] The aligned three-dimensional array of the first pressure data is stored in a stripe shape on the xz plane or the yz plane along the x direction, and the aligned three-dimensional array of the second pressure data is stored in a stripe shape on the xz plane or the yz plane along the z direction;
[0034] The data block also includes:
[0035] The three-dimensional array of the first pressure data and the three-dimensional array of the second pressure data stored in stripes are divided into a plurality of three-dimensional data blocks in the x direction, the y direction and the z direction respectively;
[0036] The parallel computing includes:
[0037] Performing parallel calculation of z-direction differences based on a plurality of three-dimensional data blocks of the three-dimensional array of the second pressure data, and performing parallel calculation of z-direction velocities based on a plurality of three-dimensional data blocks of the three-dimensional array of the z-direction data;
[0038] Based on the three-dimensional array of the first pressure data, a plurality of three-dimensional data blocks are used to perform parallel calculation of differences in the y direction and the x direction, and based on the three-dimensional array of the y direction data and the x direction data, a plurality of three-dimensional data blocks are used to perform parallel calculation of velocities in the y direction and the x direction;
[0039] Based on the parallel calculation results of the velocities in the y direction, x direction and z direction, the velocity differences in the y direction, x direction and z direction are respectively calculated in parallel, and based on the parallel calculation results of the velocity differences, the first pressure data and the second pressure data are calculated in parallel.
[0040] Preferably, the computing node is a CPU node, and the CPU node adopts a two-level parallel framework of OPENMP+vector parallelism.
[0041] Preferably, the computing node is a GPU node, and the GPU node adopts a two-level parallel framework or a three-level parallel framework of grid (Grid) + block (Block) within the GPU.
[0042] A second aspect of the present invention provides a data management and parallel computing device, comprising:
[0043] A data alignment module is used to align the three-dimensional arrays of data in the x-direction and y-direction according to the z-direction respectively;
[0044] A striping storage module is used to store the three-dimensional arrays of aligned x-direction and y-direction data in stripes along the x direction on the xz plane;
[0045] A data block module, used for dividing the three-dimensional array stored in stripe form into a plurality of three-dimensional data blocks in the x-direction, the y-direction and the z-direction;
[0046] A parallel computing module, used for performing block-by-block parallel computing based on the multiple three-dimensional data blocks on a computing node;
[0047] The x direction and the y direction represent two directions perpendicular to each other in a plane, and the z direction represents a depth direction.
[0048] According to a third aspect of the present invention, an electronic device is provided, comprising: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to call the instructions stored in the memory to execute the data management and parallel computing method.
[0049] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the data management and parallel computing method is implemented.
[0050] The beneficial effects of the present invention include at least:
[0051] 1. By aligning the three-dimensional array data, vector data can be read and written at one time;
[0052] 2. Striped storage makes the distance between vector data in a certain direction unit distance (continuous storage), which greatly reduces the data reading and writing time;
[0053] 3. Three-dimensional data segmentation reduces the data reading and writing range in three directions and reduces data reading and writing delays, thereby balancing the computing load during parallel computing and reducing synchronization time;
[0054] 4. Parallel computing within the node: select different parallel frameworks according to different computing node types to improve parallel computing efficiency.
[0055] In summary, the data management and parallel computing method of the present invention effectively reduces the data reading and writing time by using data alignment, striped storage, and data partitioning, and performs parallel computing within a node based on data partitioning, which greatly improves the computing efficiency. The data management and parallel computing method of the present invention is particularly suitable for wave equation staggered grid finite difference numerical simulation calculations, and is also suitable for regular grid finite difference calculations after a slight transformation, which can greatly improve its computing efficiency.
[0056] The methods and apparatus of the present invention have other features and advantages that will be apparent from or will be described in detail in the accompanying drawings and subsequent detailed descriptions incorporated herein, which together serve to explain the specific principles of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] The above and other objects, features and advantages of the present invention will become more apparent through a more detailed description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, wherein like reference numerals generally represent like components throughout the exemplary embodiments of the present invention.
[0058] Figure 1 A flow chart of a data management and parallel computing method according to an embodiment of the present invention is shown.
[0059] Figure 2 A schematic diagram of three-dimensional array data alignment and storage of data in the x and y directions of a data management and parallel computing method according to an embodiment of the present invention is shown.
[0060] Figure 3 A schematic diagram of three-dimensional array data alignment and storage of z-direction data in a data management and parallel computing method according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0061] The preferred embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the preferred embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to make the present invention more thorough and complete, and to fully convey the scope of the present invention to those skilled in the art.
[0062] The present invention proposes a data management and parallel computing method, comprising the following steps:
[0063] Data alignment: align the three-dimensional arrays of data in the x-direction and y-direction according to the z-direction respectively;
[0064] Striped storage, the three-dimensional arrays of aligned x-direction and y-direction data are stored in stripes along the x-direction on the xz plane;
[0065] Data blocking, for the three-dimensional array stored in stripe form, dividing it into a plurality of three-dimensional data blocks in the x direction, the y direction and the z direction;
[0066] Parallel computing: performing block-by-block parallel computing based on multiple three-dimensional data blocks on computing nodes;
[0067] The x direction and the y direction represent two directions perpendicular to each other in a plane, and the z direction represents a depth direction.
[0068] The data management and parallel computing method of the present invention utilizes data alignment, striped storage, and data partitioning to effectively reduce the data reading and writing time, and performs parallel computing within a node based on data partitioning, thereby greatly improving the computing efficiency. The data management and parallel computing method of the present invention is particularly suitable for staggered grid finite difference numerical simulation calculations of anisotropic wave equations, and is also suitable for regular grid finite difference calculations after a slight transformation, which can greatly improve its computing efficiency.
[0069] Embodiment 1
[0070] Figure 1 The following is a flow chart showing a data management and parallel computing method according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:
[0071] Step 1: Data alignment: align the three-dimensional arrays of data in the x-direction and y-direction according to the z-direction respectively.
[0072] From the perspective of data management, there are two main factors that affect the efficiency of vector parallel computing. The first is data vector alignment, which means that the starting address of data access is an integer multiple of the vector length. In this case, one vector data load instruction can complete the vector reading, reducing the data reading latency. The second is data spacing. If the data is stored continuously or the data spacing is small, then the time required for data reading and writing is very short, and the vector computing efficiency is relatively high.
[0073] Based on the above factors, in the method of this embodiment, data alignment is first performed, that is, the three-dimensional arrays of data in the x-direction and the y-direction are aligned in the z-direction respectively, specifically including:
[0074] The data length of the three-dimensional array of x-direction and y-direction data in the z-direction of the three-dimensional array is rounded up to an integer multiple of the current vector length, and the position without data is filled with a zero floating point value, so as to ensure that the subsequent vector data reading and writing in the z-direction are based on the alignment of the vector length. Rounding up here means to carry the decimal part of the data length without rounding. Among them, the x-direction and the y-direction represent two directions perpendicular to each other in the plane, and the z-direction represents the depth direction. The x-direction, the y-direction and the z-direction represent both the data direction, such as the speed data direction and the pressure data direction, and the dimensional direction of the three-dimensional array. Because in the actual operation of this field, the dimensional direction of the three-dimensional array storage data is consistent with the actual data direction. In this embodiment, the x-direction data, the y-direction data, and the z-direction data can represent the x-direction component, the y-direction component and the z-direction component of the vector data, respectively. For example, the x-direction data, the y-direction data, and the z-direction data represent the x-direction component, the y-direction component and the z-direction component of the speed or pressure, respectively.
[0075] Step 2: Striped storage: the three-dimensional arrays of aligned x-direction and y-direction data are stored in stripes along the x direction on the xz plane.
[0076] In the prior art, three-dimensional data is usually stored in a three-dimensional array according to the fast direction, slow direction and slowest direction, or converted and stored in a one-dimensional array. This causes the calculation data spacing to increase from small to large according to different calculation directions from fast to slow, the data reading and writing time becomes longer, the calculation part is idle and waiting, and the calculation efficiency is not high. Therefore, the present invention designs a new striped storage method, that is, the three-dimensional arrays of aligned x-direction and y-direction data are respectively stored in strips on the xz plane according to the x direction.
[0077] Specifically, in striped storage, the three-dimensional arrays of aligned x-direction and y-direction data are stored in stripes in the x-direction on the xz plane according to the vector length or the z-direction data block length. Here, the z-direction data block length is pre-set and is an integer multiple of the vector length.
[0078] By storing the three-dimensional arrays of aligned x-direction and y-direction data in strips on the xz plane according to the vector length or the z-direction data block length in the x direction, the vector data spacing in the x direction calculation is unit distance (i.e., continuous storage) or very small.
[0079] Step 3: Data blocking: for the three-dimensional array stored in stripes, divide it into multiple three-dimensional data blocks from the x direction, the y direction and the z direction.
[0080] This embodiment provides a data partitioning method, that is, partitioning a large three-dimensional array into multiple small three-dimensional data partitions. The data partitioning reduces the data reading and writing range in the y direction and reduces the data reading and writing time.
[0081] In addition, data segmentation can also reduce the synchronization time in the parallel computing process. Synchronization time refers to the time required for synchronization or coordination between various processing units (such as CPU cores or GPU SMs) during parallel computing. This usually occurs in the following situations:
[0082] When a processing unit needs to wait for other processing units to complete a task or reach a certain state, it may stop. This waiting time is the synchronization time.
[0083] When certain synchronization primitives (such as locks, barriers, etc.) are used to ensure data consistency or task order, all processing units need to wait, which also generates synchronization time.
[0084] Synchronization time is an important bottleneck of parallel computing performance. If the synchronization time is too long, then even with a large number of processing units, the overall computing efficiency may be affected. Therefore, reducing the synchronization time is one of the keys to improving parallel computing performance.
[0085] By dividing the data into blocks, the amount of calculation for each data block is not large. In this way, when the data blocks are calculated in parallel, the calculation load of each CPU core or GPUSM is relatively balanced, thereby reducing the synchronization time in the calculation process.
[0086] In this embodiment, for the aligned three-dimensional array of striped storage, when data is divided into blocks, the size of the three-dimensional data blocks in the y direction is 7 to 10. The principle for determining the block size in the y direction is that the size of the three-dimensional array in the y direction divided by the size of the three-dimensional data block is closest to an integer.
[0087] In the z direction, the size of the 3D data block is 2 or 3 times the vector length, where the vector length is 16, that is, the data length of 16 single-precision floating-point numbers; in the x direction, the size of the 3D data block is 1 or 2 times the vector length. After testing, the 3D data block with the above size can minimize the data reading and writing time and reduce the synchronization time during parallel computing.
[0088] When the computing node is a GPU node, the size of the three-dimensional data blocks in the z direction and the x direction can be adjusted according to the GPU hardware configuration to fully utilize the GPU computing power.
[0089] Step 4: Parallel computing: performing block-by-block parallel computing based on multiple three-dimensional data blocks on the computing nodes.
[0090] All CPU cores have vector parallel (SIMD) computing capabilities. One CPU core in Intel Xeon CPU can complete parallel computing of 16 single-precision floating-point numbers (vector length) at a time. One Wrap (thread bundle) in NVIDIA GPU SM is composed of 32 threads, which is also vector parallel computing in nature. It can be seen that the most basic parallel computing method for both CPU and GPU is vector parallel computing.
[0091] In this embodiment, parallel computing is performed on the computing node, and data is only read and written in the computing node memory, so the data read and write latency is low and the parallel computing efficiency is high. When the computing node is a CPU node, the CPU node adopts a two-level parallel framework of OPENMP+ vector parallelism, multi-threaded parallel computing of each three-dimensional data block, threads are bound to CPU cores, and CPU core vectors are parallelly computed.
[0092] OPENMP is a parallel programming model suitable for shared memory systems with multiple processors / cores. It provides a simple programming interface so that programmers can specify parallel regions in the program and automatically parallelize the program. OPENMP supports programming languages such as C, C++, and Fortran, and has been widely accepted and promoted.
[0093] OPENMP can improve program performance by executing loops in parallel with multiple threads, but when the amount of data is very large, the efficiency of this parallelization may be limited by the overhead of communication and synchronization. To further improve parallel efficiency, OPENMP can be combined with the two-level parallel framework of Vector Parallelism.
[0094] The basic idea of the two-level parallel framework is:
[0095] First level of parallelism: Divide the data into multiple small blocks, each of which is processed by a thread. This level of parallelism can be achieved using OPENMP's parallel loop.
[0096] Second level of parallelism: Within each small data block, vector parallelism is used to further subdivide the computational tasks. For example, SIMD instructions can be used to perform the same operation on multiple data elements.
[0097] In the two-level parallel framework, the task division of the first level of parallelism and the vector operation of the second level of parallelism can be used in combination. For example, the data can be divided into multiple small data blocks, each small data block is processed by a thread, and then vector instructions are used in each thread to operate on the data. This two-level parallel framework can better utilize the computing resources of multi-core processors and improve the performance of the program.
[0098] Optionally, the computing node can also be a GPU node, and the GPU node adopts the two-level parallel framework or three-level parallel framework of Grid+Block in the GPU. When the GPU memory meets the computing requirements, the two-level parallel framework of Grid+Block in the GPU is adopted, and multiple Blocks are parallelly calculated in blocks. The Block is automatically assigned to one SM (streaming Multiprocessor), and the thread bundles (wrap) in the Block perform multi-threaded parallel computing; when the GPU memory cannot meet the computing requirements, the three-level parallel framework of the GPU node is adopted, that is, multiple GPUs in the first-level node are added to the two-level parallel framework.
[0099] The two-level parallel framework of Grid+Block includes two parallel modes: block parallelism within the grid and warp parallelism within the block. In the first level of parallelism, the grid is composed of many blocks, which divide the entire calculation data into multiple data blocks, and each data block is processed by a block. Each block is assigned to the SM for calculation, and there is no need for communication between different blocks.
[0100] In the second level of parallelism, multiple computing threads are divided into thread warps in each block, and 1 thread warp executes 32 threads in parallel. This parallel method can further split tasks and improve the parallelism and computing efficiency of the program.
[0101] The GPU node three-level parallel framework is based on the two-level parallel framework of Grid+Block, and multiple GPUs are added to the first-level node for parallel computing, forming a three-level parallel framework. This three-level parallel framework can further utilize the computing resources of multiple GPUs to improve the parallelism and computing efficiency of the program.
[0102] Embodiment 2
[0103] This embodiment provides a data management and parallel computing method for anisotropic wave equation staggered grid finite difference numerical simulation calculation. In this embodiment, the x-direction and y-direction data represent the x-direction velocity data and the y-direction velocity data, respectively, and the z-direction data represents the z-direction velocity data. In addition, a three-dimensional array of first pressure data and a three-dimensional array of second pressure data are established, wherein the first pressure data is the composite pressure data of the x-direction and the y-direction, and the second pressure data is the z-direction pressure data.
[0104] The data management and parallel computing method of this embodiment includes the following steps:
[0105] Data alignment: align the three-dimensional arrays of data in the x-direction and y-direction according to the z-direction respectively, and align the three-dimensional array of data in the z-direction according to the x-direction or y-direction;
[0106] Striped storage: the three-dimensional arrays of aligned x-direction and y-direction data are stored in stripes on the xz plane along the x direction, and the three-dimensional arrays of aligned z-direction data are stored in stripes on the xz plane or yz plane along the z direction;
[0107] Data block, for the three-dimensional array of striped storage, including the three-dimensional array of data in the x-direction, y-direction, and z-direction, it is divided into multiple three-dimensional data blocks in the x-direction, y-direction, and z-direction respectively;
[0108] Parallel computing: performing block-by-block parallel computing based on multiple three-dimensional data blocks on computing nodes.
[0109] The x direction and the y direction represent two directions perpendicular to each other in a plane, and the z direction represents a depth direction.
[0110] In this embodiment, the three-dimensional arrays of data in the x-direction and the y-direction are respectively aligned in the z-direction, including:
[0111] Round up the data length of the three-dimensional array of data in the x-direction and y-direction in the z-direction of the three-dimensional array to an integer multiple of the current vector length, and fill the positions without data with zero floating-point values. Figure 2 Schematic diagram showing the alignment of 3D array data in the x and y directions.
[0112] Aligning the three-dimensional array of z-direction data in the x- or y-direction includes:
[0113] Round up the data length of the three-dimensional array of z-direction data in the x-direction of the three-dimensional array to an integer multiple of the vector length, fill the positions without data with zero floating-point values, and the vector length is 16. Figure 3 Schematic diagram showing the alignment of the 3D array data for the z-direction data.
[0114] In this embodiment, in striped storage, the three-dimensional arrays of aligned x-direction and y-direction data are stored in stripes on the xz plane along the x direction according to the vector length or the z-direction data block length, and the three-dimensional array of aligned z-direction data is stored in stripes on the xz plane or the yz plane along the z direction. Figure 2 and Figure 3 Schematic diagrams of striped storage of data in the x and y directions and data in the z direction are shown respectively. By storing the three-dimensional arrays of aligned x-direction and y-direction data in strips in the x direction on the xz plane according to the vector length or the z-direction data block length, the vector data spacing in the x direction calculation is unit distance (i.e., continuous storage) or very small. Similarly, by storing the z-direction component in strips in the z direction on the xz plane or yz plane according to the vector length, the vector data spacing in the z direction calculation is unit distance (i.e., continuous storage).
[0115] In this embodiment, data segmentation includes segmenting the three-dimensional array of data in the x-direction, y-direction and z-direction into a plurality of three-dimensional data segments in the x-direction, y-direction and z-direction, respectively. The size of the three-dimensional data segment in the y-direction is 7 to 10, the size in the z-direction is 2 or 3 times the vector length, the size in the x-direction is 1 or 2 times the vector length, and the vector length is 16.
[0116] In this embodiment, it is also necessary to perform data alignment, stripe storage and data blocking on the three-dimensional data of the first pressure data and the second pressure data, and then perform parallel calculation.
[0117] Therefore, data alignment also includes:
[0118] Align the three-dimensional array of the first pressure data in the z direction, and align the three-dimensional array of the second pressure data in the x or y direction;
[0119] Striped storage also includes:
[0120] The aligned three-dimensional array of the first pressure data is stored in a stripe shape on the xz plane or the yz plane along the x direction, and the aligned three-dimensional array of the second pressure data is stored in a stripe shape on the xz plane or the yz plane along the z direction;
[0121] Data chunking also includes:
[0122] The three-dimensional array of the first pressure data and the three-dimensional array of the second pressure data stored in stripes are divided into a plurality of three-dimensional data blocks in the x direction, the y direction and the z direction respectively.
[0123] In this embodiment, the parallel computing includes:
[0124] Based on the multiple three-dimensional data blocks of the three-dimensional array of the second pressure data (i.e., the pressure data in the z direction), a difference parallel calculation in the z direction is performed; based on the multiple three-dimensional data blocks of the three-dimensional array of the z direction data (i.e., the speed data in the z direction), a speed parallel calculation in the z direction is performed;
[0125] Based on the multiple three-dimensional data blocks of the three-dimensional array of the first pressure data (i.e., the composite pressure data in the x-direction and the y-direction), the differential parallel calculation in the y-direction and the x-direction is performed; based on the multiple three-dimensional data blocks of the three-dimensional array of the y-direction data (i.e., the y-direction velocity data) and the x-direction data (i.e., the x-direction velocity data), the velocity parallel calculation in the y-direction and the x-direction is performed;
[0126] Based on the parallel calculation results of the velocities in the y direction, x direction and z direction, the velocity differences in the y direction, x direction and z direction are respectively calculated in parallel, and based on the parallel calculation results of the velocity differences, the first pressure data and the second pressure data are calculated in parallel.
[0127] Among them, parallel computing includes block parallel computing and vector parallel computing within blocks.
[0128] With the rapid growth of CPU computing cores and GPU computing performance, as well as the continuous improvement of GPU memory capacity, it has become a reality to use a dual-CPU or dual-GPU computing node to perform a forward simulation of a shot gathering data. In this embodiment, when the computing node is a CPU node, the CPU node adopts a two-level parallel framework of OPENMP+vector parallelism; when the computing node is a GPU node, the GPU node adopts a two-level parallel framework or a three-level parallel framework of Grid+Block in the GPU.
[0129] The actual program test shows that the data management and parallel computing method of the present invention is used to perform three-dimensional seismic acoustic wave forward modeling. On the same machine with two Xeon 6226R CPU computing nodes (a total of 32 cores and 192GB memory), the same version of Intel compiler as the existing program is used for compilation. Compared with the existing method (using the OPENMP parallel framework and the commonly used three-dimensional array storage method, which uses the optimization compiler option to compile and automatically generate CPU core 128-bit vector parallelism), the data management and parallel computing method of the present invention can improve the computational efficiency of three-dimensional seismic forward modeling of one shot collection data by about 3 times. If applied to three-dimensional wave field forward modeling in engineering fields such as oil exploration, the present invention can improve computational efficiency, save computing time and machine time fees, reduce computing energy consumption, and reduce service costs.
[0130] Embodiment 3
[0131] This embodiment provides a data management and parallel computing device, including:
[0132] A data alignment module is used to align the three-dimensional arrays of data in the x-direction and y-direction according to the z-direction respectively;
[0133] A striping storage module is used to store the three-dimensional arrays of aligned x-direction and y-direction data in stripes along the x direction on the xz plane;
[0134] A data block module, used for dividing the three-dimensional array stored in stripe form into a plurality of three-dimensional data blocks in the x-direction, the y-direction and the z-direction;
[0135] A parallel computing module, used for performing block-by-block parallel computing based on the multiple three-dimensional data blocks on a computing node;
[0136] The x direction and the y direction represent two directions perpendicular to each other in a plane, and the z direction represents a depth direction.
[0137] In this embodiment, the three-dimensional arrays of data in the x-direction and the y-direction are respectively aligned in the z-direction, including:
[0138] Round up the data length of the three-dimensional array of data in the x-direction and y-direction in the z-direction of the three-dimensional array to an integer multiple of the current vector length, and fill the positions without data with zero floating-point values.
[0139] In striped storage, the three-dimensional arrays of aligned x-direction and y-direction data are stored in stripes in the x-direction on the xz plane according to the vector length or the z-direction data block length.
[0140] The size of the three-dimensional data block in the y direction is 7 to 10, the size in the z direction is 2 or 3 times the vector length, and the size in the x direction is 1 or 2 times the vector length, and the vector length is 16.
[0141] In this embodiment, the parallel computing further includes:
[0142] Perform vector parallel computation within 3D data blocks.
[0143] In this embodiment, the data management and parallel computing method is used for staggered grid finite difference numerical simulation calculation of anisotropic wave equation, and the x-direction and y-direction data include x-direction velocity data and y-direction velocity data respectively;
[0144] Data alignment also includes:
[0145] Align the three-dimensional array of z-direction data in the x or y direction;
[0146] Aligning the three-dimensional array of z-direction data in the x- or y-direction includes:
[0147] Round up the data length of the three-dimensional array of z-direction data in the x-direction of the three-dimensional array to an integer multiple of the vector length, fill the positions without data with zero floating-point values, and the vector length is 16;
[0148] Striped storage also includes:
[0149] The three-dimensional array of z-direction data is stored in strips along the z direction on the xz plane or the yz plane;
[0150] Data chunking also includes:
[0151] For the three-dimensional array of z-direction data stored in stripe form, the three-dimensional array is divided into a plurality of three-dimensional data blocks in the x-direction, the y-direction and the z-direction;
[0152] The z-direction data includes z-direction velocity data.
[0153] The data management and parallel computing method also includes:
[0154] Establishing a three-dimensional array of first pressure data and a three-dimensional array of second pressure data, wherein the first pressure data is composite pressure data in the x-direction and the y-direction, and the second pressure data is pressure data in the z-direction;
[0155] Data alignment also includes:
[0156] Align the three-dimensional array of the first pressure data in the z direction, and align the three-dimensional array of the second pressure data in the x or y direction;
[0157] Striped storage also includes:
[0158] The aligned three-dimensional array of the first pressure data is stored in a stripe shape on the xz plane or the yz plane along the x direction, and the aligned three-dimensional array of the second pressure data is stored in a stripe shape on the xz plane or the yz plane along the z direction;
[0159] Data chunking also includes:
[0160] The three-dimensional array of the first pressure data and the three-dimensional array of the second pressure data stored in stripes are divided into a plurality of three-dimensional data blocks in the x direction, the y direction and the z direction respectively;
[0161] Parallel computing includes:
[0162] Performing parallel calculation of z-direction differences based on multiple three-dimensional data blocks of the three-dimensional array of second pressure data, and performing parallel calculation of z-direction velocities based on multiple three-dimensional data blocks of the three-dimensional array of z-direction data;
[0163] Based on the multiple three-dimensional data blocks of the three-dimensional array of the first pressure data, the differential calculation in the y direction and the x direction is performed in parallel, and based on the multiple three-dimensional data blocks of the three-dimensional array of the y direction data and the x direction data, the velocity calculation in the y direction and the x direction is performed in parallel;
[0164] Based on the parallel calculation results of the velocities in the y direction, x direction and z direction, the velocity differences in the y direction, x direction and z direction are respectively calculated in parallel, and based on the parallel calculation results of the velocity differences, the first pressure data and the second pressure data are calculated in parallel.
[0165] For other detailed descriptions of this exemplary embodiment, reference may be made to the corresponding descriptions in the aforementioned embodiments, which will not be repeated here.
[0166] Embodiment 4
[0167] This embodiment provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the aforementioned data management and parallel computing method is implemented.
[0168] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.
[0169] For other detailed descriptions of this exemplary embodiment, reference may be made to the corresponding descriptions in the aforementioned embodiments, which will not be repeated here.
[0170] Embodiment 5
[0171] This embodiment provides an electronic device, including:
[0172] A memory storing executable instructions;
[0173] The processor runs the executable instructions in the memory to implement the aforementioned method for improving the resolution of seismic data based on wavelet shaping.
[0174] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0175] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0176] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0177] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0178] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0179] For other detailed descriptions of this exemplary embodiment, reference may be made to the corresponding descriptions in the aforementioned embodiments, which will not be repeated here.
[0180] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A data management and parallel computing method, It is characterized in that include: Data alignment: align the three-dimensional arrays of data in the x-direction and y-direction according to the z-direction respectively; Striped storage, the three-dimensional arrays of aligned x-direction and y-direction data are stored in stripes along the x-direction on the xz plane; Data blocking, for the three-dimensional array stored in stripe form, dividing it into a plurality of three-dimensional data blocks in the x direction, the y direction and the z direction; Parallel computing: performing block-by-block parallel computing based on the multiple three-dimensional data blocks on a computing node; The x direction and the y direction represent two directions perpendicular to each other in a plane, and the z direction represents a depth direction.
2. The data management and parallel computing method according to claim 1, It is characterized in that Align the three-dimensional arrays of data in the x-direction and y-direction according to the z-direction, including: Round up the data length of the three-dimensional array of data in the x-direction and y-direction in the z-direction of the three-dimensional array to an integer multiple of the current vector length, and fill the positions without data with zero floating-point values.
3. The data management and parallel computing method according to claim 1, It is characterized in that In the striped storage, the three-dimensional arrays of aligned x-direction and y-direction data are stored in stripes in the x-direction on the xz plane according to the vector length or the z-direction data block length.
4. The data management and parallel computing method according to claim 1, It is characterized in that The size of the three-dimensional data block in the y direction is 7 to 10, the size in the z direction is 2 or 3 times the vector length, and the size in the x direction is 1 or 2 times the vector length. The vector length is 16.
5. The data management and parallel computing method according to claim 1, It is characterized in that The parallel computing also includes: Vector parallel computation is performed within the three-dimensional data blocks.
6. The data management and parallel computing method according to claim 1, It is characterized in that The method is used for staggered grid finite difference numerical simulation calculation of anisotropic wave equation, and the x-direction and y-direction data include x-direction velocity data and y-direction velocity data respectively; The data alignment further includes: Align the three-dimensional array of z-direction data in the x or y direction; The aligning of the three-dimensional array of z-direction data according to the x-direction or y-direction includes: Round up the data length of the three-dimensional array of z-direction data in the x-direction of the three-dimensional array to an integer multiple of the vector length, and fill the positions without data with zero floating-point values, and the vector length is 16; The striped storage further includes: The three-dimensional array of aligned z-direction data is stored in strips along the z direction on the xz plane or the yz plane; The data blocks also include: For the three-dimensional array of z-direction data stored in stripe form, the three-dimensional array is divided into a plurality of three-dimensional data blocks in the x-direction, the y-direction and the z-direction; The z-direction data includes z-direction velocity data.
7. The data management and parallel computing method according to claim 6, It is characterized in that Also includes: Establishing a three-dimensional array of first pressure data and a three-dimensional array of second pressure data, wherein the first pressure data is composite pressure data in the x-direction and the y-direction, and the second pressure data is pressure data in the z-direction; The data alignment further includes: Align the three-dimensional array of the first pressure data in the z direction, and align the three-dimensional array of the second pressure data in the x or y direction; The striped storage further includes: The aligned three-dimensional array of the first pressure data is stored in a stripe shape on the xz plane or the yz plane along the x direction, and the aligned three-dimensional array of the second pressure data is stored in a stripe shape on the xz plane or the yz plane along the z direction; The data blocks also include: The three-dimensional array of the first pressure data and the three-dimensional array of the second pressure data stored in stripes are divided into a plurality of three-dimensional data blocks in the x direction, the y direction and the z direction respectively; The parallel computing includes: Performing parallel calculation of z-direction differences based on a plurality of three-dimensional data blocks of the three-dimensional array of the second pressure data, and performing parallel calculation of z-direction velocities based on a plurality of three-dimensional data blocks of the three-dimensional array of the z-direction data; Performing parallel calculation of differences in the y direction and the x direction based on a plurality of three-dimensional data blocks of the three-dimensional array of the first pressure data, and performing parallel calculation of velocities in the y direction and the x direction based on a plurality of three-dimensional data blocks of the three-dimensional array of the y direction data and the x direction data; Based on the parallel calculation results of the velocities in the y direction, x direction and z direction, the velocity differences in the y direction, x direction and z direction are respectively calculated in parallel, and based on the parallel calculation results of the velocity differences, the first pressure data and the second pressure data are calculated in parallel.
8. The data management and parallel computing method according to claim 1, It is characterized in that The computing node is a CPU node, and the CPU node adopts a two-level parallel framework of OPENMP+vector parallelism.
9. The data management and parallel computing method according to claim 1, It is characterized in that The computing node is a GPU node, and the GPU node adopts a two-level parallel framework or a three-level parallel framework of a grid+block in a GPU.
10. A data management and parallel computing device, It is characterized in that include: A data alignment module is used to align the three-dimensional arrays of data in the x-direction and y-direction according to the z-direction respectively; A striping storage module is used to store the three-dimensional arrays of aligned x-direction and y-direction data in stripes along the x direction on the xz plane; A data block module, used for dividing the three-dimensional array stored in stripe form into a plurality of three-dimensional data blocks in the x-direction, the y-direction and the z-direction; A parallel computing module, used for performing block-by-block parallel computing based on the multiple three-dimensional data blocks on a computing node; The x direction and the y direction represent two directions perpendicular to each other in a plane, and the z direction represents a depth direction.
11. An electronic device, It is characterized in that include: processor; A memory for storing processor executable instructions; wherein the processor is configured to call the instructions stored in the memory to execute the data management and parallel computing method described in any one of claims 1 to 7.
12. A computer-readable storage medium having computer program instructions stored thereon, It is characterized in that When the computer program instructions are executed by a processor, the data management and parallel computing method described in any one of claims 1 to 7 is implemented.