CPU parallel acceleration method and system for calculating multi-frequency decay

By rewriting and parallel processing of single-frequency computing use cases in LWPC source code and using multi-core CPUs to perform parallel computing, the problem of long calculation time of wideband signals is solved and the computing efficiency is significantly improved.

CN119292738APending Publication Date: 2025-01-10SHANGRAO NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411029103.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

When LWPC is used to calculate the propagation field strength and phase of a wideband signal, the increase in the number of frequency points leads to a significant increase in the calculation time, especially on ordinary computers, the serial calling method cannot be effectively accelerated, resulting in inefficient computing efficiency.

Method used

By obtaining the LWPC source code, locate the single-frequency computing use case interface part, rewrite the use case name, use Python loop to write multiple use cases to be executed, and use parallel libraries to hand over the generated thread tasks to the thread pool scheduling, and use multiple CPU cores to perform parallelism Compute, and finally save the result as a three-dimensional matrix and visualize it.

Benefits of technology

It effectively reduces the overall time-consuming calculation, significantly improves the efficiency of wideband signal propagation field strength calculation, and realizes parallel CPU acceleration, especially in a multi-core CPU environment with the highest acceleration ratio.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119292738A_ABST
    Figure CN119292738A_ABST
Patent Text Reader

Abstract

The invention provides a CPU parallel acceleration method and system for calculating multi-frequency decay, and the method comprises the steps: obtaining an LWPC source code which is an open source code of a V21 version, is compiled through a Fortran language, and is compiled into an executable program in a Linux environment; positioning a single-frequency calculation case interface part in the LWPC source code, rewriting a case name according to a preset rule, and recompiling a program after modification is completed so as to establish an LWPC case to be executed; writing a plurality of LWPC to-be-executed use cases of the preset task by using python circulation; using the parallel library to generate a thread task from the LWPC to-be-executed use case, and delivering the thread task to the thread pool for self-scheduling; and when all thread tasks are completed, storing all calculation results as a three-dimensional matrix, and performing visual display, thereby finally achieving the purpose of reducing the overall time consumption of calculation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of CPU parallel acceleration for calculating multi-frequency decay, and in particular relates to a CPU parallel acceleration method and system for calculating multi-frequency decay. Background Art

[0002] LWPC (Long Wavelength Propagation Capability) is an engineering package developed based on Fortran language for the calculation of long-wave electromagnetic wave propagation field strength and phase. It is a mode solver based on waveguide mode theory that can be used to solve long-wave electromagnetic wave propagation problems. The LWPC model divides the Earth-ionosphere waveguide propagation channel into "segments" of tens to hundreds of kilometers, and solves the propagation mode of electromagnetic waves in each segment. This segmented solution method enables LWPC to efficiently predict the amplitude and phase of electromagnetic waves at any location in the world. At the same time, LWPC also takes into account factors such as the conductivity of the earth's surface, the direction of the magnetic field, and arbitrary electron density distribution, thereby improving the accuracy and credibility of the simulation results. Compared with other methods, LWPC does not require high computing resources to complete a large-scale electromagnetic wave propagation simulation in a short time, thereby greatly improving work efficiency.

[0003] However, efficient calculation is mainly aimed at the calculation of the field strength attenuation curve of a fixed-frequency long-wave signal along a certain propagation path, which is also the main purpose of LWPC design. However, with the promotion of LWPC application fields, it is increasingly used in the propagation calculation of broadband signals, such as lightning electromagnetic pulse signals. When it is necessary to calculate the propagation field strength and phase of a broadband signal such as lightning electromagnetic pulse, due to the increase in the number of frequency points, if the calculation is simply performed by serially calling LWPC, the calculation time will be greatly increased. For a computer with 16GB of memory and ordinary performance, the time required for LWPC single-frequency field strength calculation is about 1-3 seconds. If a broadband signal composed of 100 frequency points needs to be calculated, the calculation time will increase to at least 100-300 seconds. Therefore, when LWPC is used for the propagation field strength calculation of broadband long-wave signals, it is necessary to perform acceleration design. Summary of the invention

[0004] Based on this, an embodiment of the present invention provides a CPU parallel acceleration method and system for calculating multi-frequency decay, aiming to calculate multi-frequency point data based on LWPC and complete CPU parallel acceleration.

[0005] A first aspect of an embodiment of the present invention provides a CPU parallel acceleration method for calculating multi-frequency decay, which is applied to the simulation of far-field very low frequency electromagnetic pulse waveforms. The method comprises:

[0006] Step 1: Obtain LWPC source code, wherein the LWPC source code is an open source code of version V21, written in Fortran language, and compiled into an executable program in a Linux environment;

[0007] Step 2: locate the single-frequency calculation use case interface part in the LWPC source code, rewrite the use case name according to the preset rules, and recompile the program after the modification is completed to establish an LWPC use case to be executed;

[0008] Step 3: Use Python to loop and write several LWPC to-be-executed test cases of preset tasks;

[0009] Step 4: Use the parallel library to generate thread tasks for the LWPC to-be-executed use cases and deliver them to the thread pool for self-scheduling;

[0010] Step 5: When all thread tasks are completed, all calculation results are stored as a three-dimensional matrix and displayed visually.

[0011] Further, in the step of locating the single-frequency calculation use case interface part in the LWPC source code, the single-frequency calculation use case interface part is the decode_tx_data.for file part.

[0012] Furthermore, in the step of rewriting the use case name according to a preset rule, the rewriting is performed using an identification identifier.

[0013] Furthermore, in the step of recompiling the program after the modification is completed, the .for file in the LWPC source code is compiled into a .o middleware file.

[0014] Furthermore, in the step of using the parallel library to generate thread tasks from the LWPC to-be-executed use cases and delivering them to the thread pool for self-scheduling, the multiprocessing library in the Python main program is used to generate thread tasks from the LWPC to-be-executed use cases and deliver them to the thread pool for self-scheduling, wherein the multiprocessing library will create an independent process for each thread task.

[0015] Furthermore, the multiprocessing library is used to distribute thread tasks to the LWPC compiler. When the LWPC compiler runs each use case, it schedules available CPU cores to give execution thread resources and controls waiting for all running instances to complete.

[0016] Furthermore, when all thread tasks are completed, all calculation results are stored as a three-dimensional matrix, and in the step of visual display, the three-dimensional matrix is ​​drawn using the Matplotlib.pyplot drawing library.

[0017] A second aspect of an embodiment of the present invention provides a CPU parallel acceleration system for calculating multi-frequency decay, which is applied to the simulation of far-field very low frequency electromagnetic pulse waveforms. The system includes:

[0018] An acquisition module is used to acquire LWPC source code, wherein the LWPC source code is an open source code of version V21, written in Fortran language, and compiled into an executable program in a Linux environment;

[0019] A positioning module is used to locate the single-frequency calculation use case interface part in the LWPC source code, rewrite the use case name according to a preset rule, and recompile the program after the modification is completed to establish an LWPC use case to be executed;

[0020] Write a module for writing several LWPC to-be-executed use cases of preset tasks using Python loops;

[0021] The generation module is used to use the parallel library to generate thread tasks from LWPC to-be-executed use cases and deliver them to the thread pool for self-scheduling;

[0022] The visualization module is used to store all calculation results as a three-dimensional matrix and display them visually when all thread tasks are completed.

[0023] A third aspect of an embodiment of the present invention provides an electronic device, including:

[0024] one or more processors;

[0025] A storage device is used to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement any of the CPU parallel acceleration methods for calculating multi-frequency decay as described above.

[0026] A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-described CPU parallel acceleration methods for calculating multi-frequency decay.

[0027] A CPU parallel acceleration method and system for calculating multi-frequency decay are provided in an embodiment of the present invention. The method obtains LWPC source code, wherein the LWPC source code is an open source code of version V21, written in Fortran language, and compiled into an executable program in a Linux environment; locates the single-frequency calculation use case interface part in the LWPC source code, rewrites the use case name according to a preset rule, and recompiles the program after the modification is completed to establish an LWPC use case to be executed; uses Python to loop and write several LWPC use cases to be executed of preset tasks; uses a parallel library to generate thread tasks from the LWPC use cases to be executed, and delivers them to a thread pool for self-scheduling; when all thread tasks are completed, all calculation results are stored as a three-dimensional matrix and visualized. Specifically, the LWPC single-frequency attenuation function code is reconstructed, Python is used as the main program for signal synthesis, a subtask list is established, and the parallel library is used to schedule multi-task parallel execution to achieve program acceleration, effectively reducing the overall calculation time. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 A flowchart of a CPU parallel acceleration method for calculating multi-frequency decay provided by the first embodiment of the present invention;

[0029] Figure 2 Code for decode_tx_data.for file;

[0030] Figure 3 For the modified code;

[0031] Figure 4 This is a diagram of the use case text;

[0032] Figure 5 It is a schematic diagram of the execution structure;

[0033] Figure 6 This is a schematic diagram of the visualization results;

[0034] Figure 7 This is a diagram showing the relationship between the number of cores allocated and the speedup ratio;

[0035] Figure 8 A schematic diagram of the structure of a CPU parallel acceleration system for calculating multi-frequency decay provided in Embodiment 3 of the present invention;

[0036] Fig. 9 It is a schematic structural diagram of an electronic device in a fourth embodiment of the present invention.

[0037] The following specific implementation manner will be further described in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION

[0038] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Several embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.

[0039] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.

[0040] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items.

[0041] Embodiment 1

[0042] See also Figure 1 , Figure 1 A flowchart of a CPU parallel acceleration method for calculating multi-frequency decay provided by a first embodiment of the present invention is shown. The method specifically includes steps 1 to 5.

[0043] Step 1: Obtain LWPC source code, wherein the LWPC source code is an open source code of version V21, written in Fortran language, and compiled into an executable program in a Linux environment.

[0044] Among them, the open source program LWPC is mainly used.

[0045] Step 2: locate the single-frequency calculation use case interface part in the LWPC source code, rewrite the use case name according to the preset rules, and recompile the program after the modification is completed to establish an LWPC use case to be executed.

[0046] Specifically, in the single-frequency calculation use case interface part in the LWPC source code, by analyzing the LWPC execution process and the names of related input and output files, two key entry codes were located in the source code library: the execution statement of the LWPC single-frequency calculation process is LWPC s1 (s1 is the use case name). At this time, a program actual input parameter named xmtr.lis will be generated in the lwpcv21 / data / directory, and it will be obtained in the get_xmtr.for file, and get_xmtr.for will pass the value to its upper-level calling code decode_tx_data.for. Then, it can be determined that the single-frequency calculation use case interface part is the decode_tx_data.for file part. Because when processing different use cases in parallel, it is found that multiple use cases will point to a unique xmtr.lis input parameter file at the same time, so it is necessary to modify LWPC to enable it to distinguish multiple xmtr.lis input parameters.

[0047] For further information, see Figure 2 and Figure 3 , the code for the decode_tx_data.for file, Figure 3 For the modified code, specifically, in the step of rewriting the use case name according to the preset rules, the identification identifier is used for rewriting. Since the LWPC mentioned above only performs single-frequency point operations, this unique identifier and frequency point are also unique. Therefore, this is modified to be able to receive the form of xmtr_kk_k.lis, where k represents the frequency point to be calculated. For example, xmtr_10_0.lis represents the propagation parameters of the 10Khz frequency that need to be calculated. Therefore, in order to pass the unique frequency point identifier, the regulations are also followed when naming the execution use case. If the data of the 10Khz frequency is calculated, the use case file name is written as s10_0.inp.

[0048] Furthermore, in the step of recompiling the program after the modification is completed, the .for file in the LWPC source code is compiled into a .o middleware file. Exemplarily, in a Fortan compilation environment, the following command is executed: #gfortran-c-odecode_tx_data.odecode_tx_data.for to generate a new decode_tx_data.o file.

[0049] Step 3: Use Python to loop and write several LWPC to-be-executed test cases for the preset tasks.

[0050] It should be noted that, as can be seen from step 2, the name of the written use case should be skk_k.inp (k is the frequency), where the propagation parameters are given as required, such as the propagation distance, azimuth, propagation step, and ionosphere model. Use the For loop to traverse and change the calculation frequency parameters, and save the file name. Figure 4 , is a diagram of the use case text, where the use case name is S5_0 and its id is also S5_0, and the decay process of a 5.0khz single-frequency signal propagating 1100km from the position (28.10N, 112.6w) to an azimuth of 76.5 degrees is calculated. The ionospheric parameters are selected at 04:50 on May 15, 2023, universal time. The use case content of other frequency points is also as shown in the example, the difference is the id and the calculation frequency point.

[0051] Step 4: Use the parallel library to generate thread tasks for the LWPC to-be-executed use cases and deliver them to the thread pool for self-scheduling.

[0052] Specifically, since the previous steps complete the parallel preparation of LWPC calculation, mainly to ensure that the calculation tasks between different frequency points will not have parameter interference when called by the same executable LWPC program, the current tasks are independent and do not need to follow the sequential topological operation structure.

[0053] In this embodiment, the multiprocessing library in the Python main program is used to generate thread tasks for the LWPC to-be-executed use cases and deliver them to the thread pool for self-scheduling. The multiprocessing library will create an independent process for each thread task. Figure 5 , which is a schematic diagram of the execution structure. The multiprocessing library is used to distribute thread tasks to the LWPC compiler. When the LWPC compiler runs each use case, it schedules the available CPU cores to give execution thread resources and controls the waiting time for all running instances to complete.

[0054] It should be noted that in order to avoid Python's global lock, a Python main program is used to schedule tasks as much as possible. The multiprocessing library is introduced in this step. The multiprocessing library does not directly allocate thread resources, but creates an independent process for each task. When executing each task, the construction of the process pool mainly follows the following pseudo code:

[0055] 1.pool=multiprocessing.Pool(num_processes);

[0056] 2.pool.starmap(submission,[INFO]);

[0057] 3.pool.close();

[0058] 4.pool.join();

[0059] Among them, 1 indicates the number of CPU cores allocated; 2 indicates the parallel execution statement, where submission is a sub-function, a function that has the function of calling the LWPC task and can execute the key code ". / LWPC skk_k" (Skk_k.inp has been completed in step 3), and the function input will be provided by an iterable list [INFO]. The main parameter provided is the name of the use case to be calculated. At this time, the iteration length of the [INFO] list is the number of all sub-tasks; 3 indicates stopping the submission of tasks; 4 indicates waiting for the completion of the submitted tasks.

[0060] Step 5: When all thread tasks are completed, all calculation results are stored as a three-dimensional matrix and displayed visually.

[0061] In this embodiment, the Matplotlib.pyplot library is used to draw a three-dimensional matrix, and the three axes represent frequency (Khz), distance (KM), and reference amplitude. Figure 6 , which is a schematic diagram of the visualization results.

[0062] In summary, the present invention proposes a CPU parallel acceleration method for calculating multi-frequency decay. The method obtains LWPC source code, wherein the LWPC source code is an open source code of version V21, written in Fortran language, and compiled into an executable program under Linux environment; locates the single-frequency calculation use case interface part in the LWPC source code, rewrites the use case name according to preset rules, and recompiles the program after the modification is completed to establish an LWPC use case to be executed; uses Python to loop and write several LWPC use cases to be executed of preset tasks; uses a parallel library to generate thread tasks from the LWPC use cases to be executed, and delivers them to the thread pool for self-scheduling; when all thread tasks are completed, all calculation results are stored as a three-dimensional matrix and visualized. Specifically, the LWPC single-frequency attenuation function code is reconstructed, Python is used as the main program for signal synthesis, a subtask list is established, and the parallel library is used to schedule multi-task parallel execution to achieve program acceleration, effectively reducing the overall calculation time.

[0063] Embodiment 2

[0064] The second embodiment of the present invention is used to verify the CPU parallel acceleration method for calculating multi-frequency decay provided by the first embodiment. Specifically, the acceleration ratio is calculated by the average time of ten groups of experiments, and the serial calculation results and the parallel calculation results are checked to see whether they are consistent. After the array_equal method of the numpy library is used to test, all the calculation results are equal. Please refer to Figure 7 , which is a diagram showing the relationship between the number of cores allocated and the speedup ratio. Please refer to the following table:

[0065] CPU model and number of allocated cores I7-7700HQ (allocated 2 cores) I5-12400F (allocated 6 cores) Kunpeng 920 (allocated 64 cores) Average time of serial calculation 7.8403s 4.5412s 9.6991s Average time spent on parallel computing 2.1936s 1.2528s 0.8230s Speedup 3.57 3.63 11.78

[0066] From the above table, we can see that the single-core capability of the server is the weakest, but because it has multiple CPU cores, its average parallel computing time is the shortest, and the acceleration ratio is also particularly high. Although the parallel computing time depends on the CPU single-core performance, parallel experiments have proved that the more CPU cores allocated to the algorithm, the more obvious the acceleration effect, that is, the higher the acceleration ratio.

[0067] Embodiment 3

[0068] Another embodiment of the present invention provides a CPU parallel acceleration system 200 for calculating multi-frequency decay, see Figure 8 , is a schematic diagram of the structure of a CPU parallel acceleration system for calculating multi-frequency decay provided by Embodiment 3 of the present invention, wherein the system 200 includes:

[0069] An acquisition module 21 is used to acquire LWPC source code, wherein the LWPC source code is an open source code of version V21, written in Fortran language, and compiled into an executable program in a Linux environment;

[0070] The positioning module 22 is used to locate the single-frequency calculation use case interface part in the LWPC source code, rewrite the use case name according to the preset rule, and recompile the program after the modification is completed to establish an LWPC use case to be executed, wherein the single-frequency calculation use case interface part is the decode_tx_data.for file part, which is rewritten using the identification identifier, and the .for file in the LWPC source code is compiled into a .o middleware file;

[0071] A writing module 23 is used to write several LWPC to-be-executed use cases of preset tasks in a loop using Python;

[0072] A generation module 24 is used to generate thread tasks from LWPC to-be-executed use cases using a parallel library, and deliver them to a thread pool for self-scheduling, wherein the multiprocessing library in the Python main program is used to generate thread tasks from LWPC to-be-executed use cases, and deliver them to a thread pool for self-scheduling, wherein the multiprocessing library will create an independent process for each thread task, and the multiprocessing library is used to distribute thread tasks to the LWPC compiler, and when the LWPC compiler runs each use case, the available CPU core is scheduled to be given to the execution thread resources, and control to wait for all running instances to complete;

[0073] The visualization module 25 is used to store all calculation results as a three-dimensional matrix and perform visual display when all thread tasks are completed, wherein the three-dimensional matrix is ​​drawn using the Matplotlib.pyplot drawing library.

[0074] Embodiment 4

[0075] Another aspect of the present invention provides an electronic device, see Fig. 9 , shown is a schematic diagram of the structure of an electronic device in the fourth embodiment of the present invention, including a memory 20, a processor 10, and a computer program 30 stored in the memory and executable on the processor, wherein when the processor 10 executes the computer program 30, the CPU parallel acceleration method for calculating multi-frequency decay as described above is implemented.

[0076] In some embodiments, the processor 10 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor or other data processing chip, used to run program codes or process data stored in the memory 20, such as executing access restriction programs.

[0077] Among them, the memory 20 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. The memory 20 may be an internal storage unit of an electronic device in some embodiments, such as a hard disk of the electronic device. The memory 20 may also be an external storage device of an electronic device in other embodiments, such as a plug-in hard disk equipped on the electronic device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. Further, the memory 20 may also include both an internal storage unit and an external storage device of the electronic device. The memory 20 may be used not only to store application software and various types of data of the electronic device, but also to temporarily store data that has been output or is to be output.

[0078] It should be pointed out that Fig. 9 The structure shown does not constitute a limitation on the electronic device. In other embodiments, the electronic device may include fewer or more components than those shown in the figure, or combine certain components, or arrange the components differently.

[0079] The embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the CPU parallel acceleration method for calculating multi-frequency decay as described above is implemented.

[0080] Those skilled in the art will appreciate that the logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For purposes of this specification, a "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.

[0081] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0082] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or a combination thereof: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0083] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0084] The above embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention patent shall be subject to the attached claims.

Claims

1. A CPU parallel acceleration method for calculating multi-frequency decay, characterized in that: Applied to the simulation of far-field very low frequency electromagnetic pulse waveform, the method comprises: Step 1: Obtain LWPC source code, wherein the LWPC source code is an open source code of version V21, written in Fortran language, and compiled into an executable program in a Linux environment; Step 2: locate the single-frequency calculation use case interface part in the LWPC source code, rewrite the use case name according to the preset rules, and recompile the program after the modification is completed to establish an LWPC use case to be executed; Step 3: Use Python to loop and write several LWPC to-be-executed test cases of preset tasks; Step 4: Use the parallel library to generate thread tasks for the LWPC to-be-executed use cases and deliver them to the thread pool for self-scheduling; Step 5: When all thread tasks are completed, all calculation results are stored as a three-dimensional matrix and displayed visually.

2. The CPU parallel acceleration method for calculating multi-frequency decay according to claim 1, characterized in that: In the step of locating the single-frequency calculation use case interface part in the LWPC source code, the single-frequency calculation use case interface part is the decode_tx_data.for file part.

3. The CPU parallel acceleration method for calculating multi-frequency decay according to claim 2, characterized in that: In the step of rewriting the use case name according to a preset rule, the identification identifier is used for rewriting.

4. The CPU parallel acceleration method for calculating multi-frequency decay according to claim 3, characterized in that: In the step of recompiling the program after the modification is completed, the .for file in the LWPC source code is compiled into a .o middleware file.

5. The CPU parallel acceleration method for calculating multi-frequency decay according to claim 4, characterized in that: In the step of using the parallel library to generate thread tasks from the LWPC to-be-executed use cases and delivering them to the thread pool for self-scheduling, the multiprocessing library in the Python main program is used to generate thread tasks from the LWPC to-be-executed use cases and deliver them to the thread pool for self-scheduling, wherein the multiprocessing library will create an independent process for each thread task.

6. The CPU parallel acceleration method for calculating multi-frequency decay according to claim 5, characterized in that: The multiprocessing library is used to distribute thread tasks to the LWPC compiler. When the LWPC compiler runs each use case, it schedules available CPU cores to give execution thread resources and controls waiting for all running instances to complete.

7. The CPU parallel acceleration method for calculating multi-frequency decay according to claim 6, characterized in that: When all thread tasks are completed, all calculation results are stored as a three-dimensional matrix, and in the step of visual display, the three-dimensional matrix is ​​drawn using the Matplotlib.pyplot drawing library.

8. A CPU parallel acceleration system for calculating multi-frequency decay, characterized in that: Applied to the simulation of far-field very low frequency electromagnetic pulse waveform, the system comprises: An acquisition module is used to acquire LWPC source code, wherein the LWPC source code is an open source code of version V21, written in Fortran language, and compiled into an executable program in a Linux environment; A positioning module is used to locate the single-frequency calculation use case interface part in the LWPC source code, rewrite the use case name according to a preset rule, and recompile the program after the modification is completed to establish an LWPC use case to be executed; Write a module for writing several LWPC to-be-executed use cases of preset tasks using Python loops; The generation module is used to use the parallel library to generate thread tasks from LWPC to-be-executed use cases and deliver them to the thread pool for self-scheduling; The visualization module is used to store all calculation results as a three-dimensional matrix and display them visually when all thread tasks are completed.

9. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the CPU parallel acceleration method for calculating multi-frequency decay as described in any one of claims 1-7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the CPU parallel acceleration method for calculating multi-frequency decay as described in any one of claims 1 to 7 is implemented.