Multi-core parallel approach for ray-based underwater acoustic propagation model

Through the multi-core parallel method and the OpenMP programming model, the problem of low calculation efficiency of the ray hydroacoustic model is solved, and efficient calculation of the ray hydroacoustic propagation sound field is realized to meet the fast computing needs in the marine environment, with an efficiency of more than 60%.

CN113672235BActive Publication Date: 2024-08-23NAT UNIV OF DEFENSE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110983364.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-25
Publication Date
2024-08-23
Estimated Expiration
2041-08-25

AI Technical Summary

Technical Problem

The ray hydroacoustic model has low computational efficiency in large-scale sound field calculations, resulting in bottlenecks. Especially when the sound field calculation sea area expands and the number of rays increases, it is difficult to meet the needs for efficient calculations.

Method used

Using a multi-core parallel method, we use performance analysis tools to identify hot-spot functions, design a multi-core coarse-grained parallel strategy, and use the OpenMP parallel programming model to implement multi-core parallel calculation of the ray hydroacoustic propagation model to ensure the correctness of variable attributes and maintain the original serial code to the maximum extent. frame.

Benefits of technology

It has significantly improved the efficiency of sound field calculation for ray underwater sound propagation, achieving a parallel execution efficiency of more than 60% under a multi-core hardware platform, meeting the needs for fast sound field calculation in marine environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113672235B
    Figure CN113672235B
Patent Text Reader

Abstract

The present invention belongs to the cross-technical field of high-performance computing and computational ocean acoustics, and in particular, relates to a multi-core parallel method for a ray-based hydroacoustic propagation model. The hotspot area of ​​the ray-based hydroacoustic model is analyzed by a performance analysis tool, parallel analysis is performed on the hotspot function of the ray-based hydroacoustic model, and a multi-core parallel strategy is designed. The multi-core parallelism of the ray-based hydroacoustic model is realized by using the OpenMP programming model. The present invention constructs a parallel computing framework for the ray-based hydroacoustic propagation model, effectively improving the efficiency of the sound field calculation of the ray-based hydroacoustic propagation model. For a multi-core CPU computing platform, the sound field calculation for a typical ocean environment achieves a parallel efficiency of more than 60%. It provides a fast sound field calculation model for sonar performance prediction, underwater target positioning, and ocean environment parameter inversion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the cross-technical field of high performance computing and computational ocean acoustics, and in particular relates to a multi-core parallel method for a ray underwater acoustic propagation model. Background Art

[0002] The underwater acoustic propagation model is a modeling of the propagation law of sound in the ocean. The main underwater acoustic propagation models currently include the simple normal wave model, the parabolic model, and the ray model. Among these models, the ray model has more obvious advantages in some cases. For example, in shallow sea environments, when the sound source is at high frequency, the ray model has good applicability, especially in deep sea conditions, whether it is a high-frequency or low-frequency sound source, the ray model has good adaptability. However, with the increase in the scope of the sound field calculation sea area and the increase in the number of rays, the sound field calculation requirements in the ray underwater acoustic model increase linearly. Therefore, the computational efficiency of the ray underwater acoustic model has become a bottleneck in the application of the model in large-scale sound field calculations. With the development of computer processors to multi-core CPUs and the rapid development of supercomputer hardware architecture, the hardware foundation has been laid for the efficient calculation of the ray underwater acoustic model. Summary of the invention

[0003] The purpose of the invention is to provide a multi-core parallel method for ray-based underwater acoustic propagation model. The method constructs a multi-core parallel framework for ray-based underwater acoustic propagation model calculation, which can effectively improve the efficiency of ray-based underwater acoustic propagation sound field calculation and provide a fast sound field calculation model for sonar performance prediction, underwater target positioning, and ocean environment parameter inversion.

[0004] To achieve the above purpose, the present invention adopts the following technical solution.

[0005] A multi-core parallel method for a ray underwater acoustic propagation model includes the following steps:

[0006] Step 1: Use performance analysis tools to analyze the serial code of the ray-based hydroacoustic model, find the hotspot functions in the serial calculation of the ray-based hydroacoustic model, and use parallel theory to evaluate and analyze the parallel acceleration ratio based on the proportion of the hotspot functions in the total execution time;

[0007] Step 2: Conduct parallel analysis on the hotspot functions of the ray model and design a multi-core coarse-grained parallel strategy for multi-core CPU computing architecture.

[0008] Step 3: For the hotspot functions of the ray-based hydroacoustic model, the OpenMP parallel programming model is used to implement the multi-core parallelism of the ray-based hydroacoustic model.

[0009] In the specific implementation scheme of the multi-core parallel method for the aforementioned ray underwater acoustic propagation model, the step 1 specifically includes:

[0010] 1A. Select the open source performance analysis tool gprof, compile the serial code of the ray-type hydroacoustic model, set the -pg compilation option, select a hydroacoustic field calculation example, run the ray-type hydroacoustic model, and collect performance data through gprof;

[0011] 1B. According to the analysis results of the gprof performance analysis tool, the execution time information of each function is counted, and the hot function is focused on. The hot function refers to the function that takes up most of the execution time;

[0012] 1C. Assuming that the total serial execution time of the ray-based underwater acoustic propagation model is T, the execution time of the hotspot function is B, and the execution time of the non-hotspot function is TB, and assuming that N CPUs are used to parallelize the hotspot function part, the ideal speedup ratio of the ray-based underwater acoustic propagation model can be estimated:

[0013] In the specific implementation scheme of the multi-core parallel method for the aforementioned ray underwater acoustic propagation model, the step 2 specifically includes:

[0014] 2A. Based on the parallelism analysis in the previous step, combined with the multi-core parallel method, a coarse-grained multi-core parallel strategy is designed, including applying parallelism to the ray loop layer, each thread is responsible for processing the same number of rays, different threads are executed in parallel, and the rays within the thread are processed serially.

[0015] Further improvement or specific implementation scheme of the multi-core parallel method of the aforementioned ray underwater acoustic propagation model, step 3 specifically includes:

[0016] 3A. Analyze the attributes of the variables used in the parallel region, determine whether each variable has private attributes or shared attributes, and indicate the shared variables and private variables in the compilation guidance statement;

[0017] 3B. For the calculation of the sound field, a shared array will be applied for saving the final sound field result, and an array will be applied for each thread to save the sound field result calculated by each thread. When all threads complete the sound field calculation, the results of all thread calculations will be reduced to the shared array through the main thread.

[0018] A further improvement or specific implementation scheme of the multi-core parallel method for the aforementioned ray-based underwater acoustic propagation model is that in step 3A, the definition of variable attributes is based on the following steps:

[0019] 1. For global shared variables or arrays in the serial implementation of the ray propagation model, if they will have an incorrect impact on the results in parallel execution mode, declare them as private variables or arrays;

[0020] 2. The Nstep member variable of the Beam data structure in the ray model needs to be declared as a private variable from a global shared variable. This variable mainly represents the number of steps in the ray tracing process.

[0021] 3. The data structure ray2DPt used to store the information of each point in the ray trajectory is processed as a local private variable kernel array;

[0022] 4. The array ray2D used to store all point information within a ray is treated as a local private variable kernel array.

[0023] The present invention provides a multi-core parallel method for a ray underwater acoustic propagation model, which has the following beneficial effects:

[0024] 1. Implemented a multi-core parallel solution for the ray underwater acoustic propagation model;

[0025] 2. Adopt the OpenMP parallel programming model and add compilation guidance statements to keep the original serial code framework to the maximum extent, so as to realize the multi-core parallelism of the ray underwater acoustic propagation model;

[0026] 3. For the sound field calculation scenarios in multiple ocean environments, the multi-core parallel execution efficiency of the ray underwater acoustic propagation model reaches more than 60% on a multi-core hardware platform. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 is an overall flow chart of an embodiment of the present invention;

[0028] Figure 2 It is the statistics of the execution time proportion of the sound field calculation of the ray model in the three examples in the embodiment of the present invention;

[0029] Figure 3 It is a pseudo code flow of OpenMP parallel implementation of the ray model in an embodiment of the present invention;

[0030] Figure 4 is the parallel speedup ratio of the ray model in the embodiment of the present invention under three examples;

[0031] Figure 5 is the parallel efficiency of the ray model in the embodiment of the present invention under three examples;

[0032] Figure 6 is a diagram of the sound field result calculated by the Dickins example using the ray model in an embodiment of the present invention;

[0033] Figure 7 is a diagram of the sound field result calculated by the Munk example using the ray model in an embodiment of the present invention;

[0034] Figure 8is a diagram of the sound field result calculated by the wedge example using the ray model in an embodiment of the present invention; DETAILED DESCRIPTION

[0035] The present invention is described in detail below in conjunction with specific embodiments.

[0036] In order to make the technical problems, technical solutions and beneficial effects solved by the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0037] The present invention provides a multi-core parallel method for the ray underwater acoustic propagation model. Figure 1 , which is an overall flow chart of the multi-core parallel method for the ray underwater acoustic propagation model provided by the present invention, specifically comprising the following steps:

[0038] Step 1: Use performance analysis tools to analyze the serial code of the ray-based hydroacoustic model, find the hotspot functions in the serial calculation of the ray-based hydroacoustic model, and evaluate and analyze the parallel acceleration ratio based on the proportion of the hotspot functions in the total execution time using parallel theory. The specific steps include:

[0039] 1A. Use the open source performance analysis tool gprof to compile the ray-hydroacoustic model serial code, set the -pg compilation option, select a hydroacoustic calculation example, and run the ray-hydroacoustic model. After the program runs, a data file gmon.out that records the program's performance, call relationship, and other information will be generated. The program's performance data can be output through the gproftest.exe gmon.out command, where test.exe is the ray model serial executable file;

[0040] This step is mainly to collect the performance data of the serial code running of the hydroacoustic model. It is necessary to set an input for the program. The input is a specific example. The choice of which example to use during the specific implementation process has little effect on the performance conclusion of the program. Priority is given to a classic hydroacoustic calculation example, such as the wedge-shaped seabed example.

[0041] 1B. According to the analysis results of the gprof performance analysis tool, count the execution time information of each function and focus on the hot functions, that is, the functions that take up the majority of the execution time. Figure 2 The execution time ratio of the acoustic field calculation part in the execution of the ray model of the Munk example, the wedge example, and the Dickins example;

[0042] 1C. Assuming that the total serial execution time of the ray-based underwater acoustic propagation model is T, the execution time of the hotspot function is B, and the execution time of the non-hotspot function is TB, and assuming that N CPUs are used to parallelize the hotspot function part, the ideal speedup ratio of the ray-based underwater acoustic propagation model can be estimated:

[0043] Step 2: Conduct parallel analysis on the hotspot functions of the ray model, and design a multi-core coarse-grained parallel strategy for the multi-core CPU computing architecture. Specifically, the core calculation in the ray model is a loop for each ray-related calculation. The calculations included in the loop are ray trajectory tracing and calculation of the sound field around the ray. The outermost loop processes different ray beams in turn. The ray tracing between different rays is independent of each other, and the calculation of the sound field around each ray is also independent of each other, which has good parallelism. Specific implementation steps:

[0044] 2A. Based on the parallelism analysis in the previous step and the proposed multi-core parallel method, a coarse-grained multi-core parallel strategy is designed. The main purpose is to apply parallelism to the ray loop layer. Each thread is responsible for processing the same number of rays. Different threads are executed in parallel, and the rays within the thread are still processed serially.

[0045] Step 3: For the hotspot functions of the ray-based hydroacoustic model, based on the parallelism analysis and parallel strategy design in step 2, the OpenMP parallel programming model is used to implement the multi-core parallelism of the ray-based hydroacoustic model.

[0046] Based on the above parallel analysis and parallel strategy design, this patent invention targets the hotspot functions of the ray-based underwater acoustic propagation model, including ray tracing and sound field calculation, and adopts the OpenMP multi-core parallel programming model to achieve the parallelization of the core calculation of the ray-based underwater acoustic model by adding relevant compilation guidance statements in the serial code. The specific steps include:

[0047] 3A. Correctly analyze the properties of the variables used in the parallel region, determine whether each variable is private or shared, and indicate the shared variables and private variables in the compilation guidance statement.

[0048] In the serial implementation of the ray propagation model, there are some global data structures, such as the Nsteps member variable in the Beam data structure. In the serial execution mode, as a global variable, it will not affect the result. However, in the parallel execution mode, this variable cannot be used as a global shared variable and needs to be declared as a private variable. In addition, there is a data structure ray2DPt for storing the information of each point in the ray trajectory. This structure is used to save the relevant information of a point in a ray trajectory, including the spatial coordinates of the point, the sound propagation speed at the point, the phase and amplitude of the sound source propagating to the point, and other information. ray2D is an array containing MaxN, which is used to save all the point information in a ray. In the serial implementation of the ray model, ray2DPt and ray2D are global variables and arrays. However, in the parallel execution mode, they also need to be processed as local thread private variables and arrays to ensure the correctness of the parallel results; specifically:

[0049] 1. For global shared variables or arrays in the serial implementation of the ray propagation model, if they will have an incorrect impact on the results in parallel execution mode, declare them as private variables or arrays;

[0050] 2. Through analysis, the Nstep member variable of the Beam data structure in the ray model needs to be declared as a private variable from a global shared variable. This variable mainly represents the number of steps in the ray tracing process. In addition, the data structure ray2DPt used to store the information of each point in the ray trajectory specifically includes the spatial coordinates of the point, the sound propagation speed at the point, the phase and amplitude information of the sound source propagating to the point, and the information of all points in a ray is saved through an array ray2D of size MaxN. ray2DPt and ray2D will be treated as local private variable core arrays.

[0051] 3B. In the multi-core parallel code implementation, create a globally shared three-dimensional array U_shared (:,:,:). The third dimension of the three-dimensional array corresponds to each thread, which means that each thread uses part of the two-dimensional array space to save the sound field information calculated by each thread. After all threads have finished calculating, each thread accumulates the sound field calculated by each thread into a shared two-dimensional array U. The final result of U is the sound field generated by all rays in the two-dimensional space. The specific pseudo code is as follows: Figure 3 shown.

[0052] As shown in the figure, after the multi-core parallelization of the ray hydroacoustic model, three examples, Dickins, Munk and wedge, were selected for performance testing. Figure 4The speedup ratios obtained by using 1, 2, 4, and 8 cores are shown. The results show that as the number of CPU cores increases, the three examples all achieve significant speedup effects. Figure 5 The speedup ratio is further converted into parallel efficiency. When the number of CPU cores used reaches 8, the parallel efficiency of the three examples exceeds 60%. Figures 6 to 8 These are the acoustic field result diagrams of the three examples when running the parallel program of the ray hydroacoustic model, which are consistent with the acoustic field results of the serial calculation.

[0053] Therefore, on the basis of realizing the multi-core parallel solution of the ray underwater acoustic propagation model, this application adopts the OpenMP parallel programming model, and by adding compilation guidance statements, it maximizes the maintenance of the original serial code framework to realize the multi-core parallelism of the ray underwater acoustic propagation model. Moreover, for the sound field calculation scenarios in multiple ocean environments, on the multi-core hardware platform, the multi-core parallel execution efficiency of the ray underwater acoustic propagation model reaches more than 60%.

[0054] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present application, rather than to limit the scope of protection of the present application. Although the present application has been described in detail with reference to the embodiments, ordinary technicians in this field should understand that the technical solution of the present application can be modified or replaced by equivalents without departing from the essence and scope of the technical solution of the present application.

Claims

1. A multi-core parallel method for ray underwater acoustic propagation model, characterized in that: The steps include: Step 1: Use performance analysis tools to analyze the serial code of the ray-based hydroacoustic model, find the hotspot functions in the serial calculation of the ray-based hydroacoustic model, and evaluate and analyze the parallel acceleration ratio based on the proportion of the hotspot functions in the total execution time and using parallel theory. Specifically, it includes: 1A. Select the open source performance analysis tool gprof, compile the serial code of the ray-type hydroacoustic model, set the -pg compilation option, select a hydroacoustic field calculation example, run the ray-type hydroacoustic model, and collect performance data through gprof; 1B. According to the analysis results of the gprof performance analysis tool, the execution time information of each function is counted, and the hot function is focused on. The hot function refers to the function that takes up most of the execution time; 1C. Assuming that the total serial execution time of the ray-based underwater acoustic propagation model is T, the execution time of the hotspot function is B, and the execution time of the non-hotspot function is TB, and assuming that N CPUs are used to parallelize the hotspot function part, the ideal speedup ratio of the ray-based underwater acoustic propagation model can be estimated: Step 2: Conduct parallel analysis on the hotspot functions of the ray model and design a multi-core coarse-grained parallel strategy for the multi-core CPU computing architecture. Specifically, it includes: 2A. Based on the parallelism analysis in the previous step, combined with the multi-core parallel method, a coarse-grained multi-core parallel strategy is designed, including applying parallelism to the ray loop layer, each thread is responsible for processing the same number of rays, different threads are executed in parallel, and the rays within the thread are processed serially; Step 3: For the hotspot functions of the ray-based hydroacoustic model, the OpenMP parallel programming model is used to implement the multi-core parallelism of the ray-based hydroacoustic model.

2. The multi-core parallel method of the ray underwater acoustic propagation model according to claim 1 is characterized in that: Step 3 The specific steps include: 3A. Analyze the attributes of the variables used in the parallel region, determine whether each variable has private attributes or shared attributes, and indicate the shared variables and private variables in the compilation guidance statement; 3B. For the calculation of the sound field, a shared array will be applied for saving the final sound field result, and an array will be applied for each thread to save the sound field result calculated by each thread. When all threads complete the sound field calculation, the results of all thread calculations will be reduced to the shared array through the main thread.

3. The multi-core parallel method of the ray underwater acoustic propagation model according to claim 2 is characterized in that: In step 3A, the definition of variable attributes is based on the following steps:

1. For global shared variables or arrays in the serial implementation of the ray propagation model, if they will have an incorrect impact on the results in parallel execution mode, declare them as private variables or arrays; 2. The Nstep member variable of the Beam data structure in the ray model needs to be declared as a private variable from a global shared variable; 3. The data structure ray2DPt used to store the information of each point in the ray trajectory is processed as a local private variable kernel array; 4. The array ray2D used to store all point information within a ray is treated as a local private variable kernel array.