CN-121997340-A - Verification method and system for scientific computing hybrid programming model
Abstract
The invention discloses a verification method and a verification system for a scientific calculation hybrid programming model, which relate to the technical field of information and comprise the steps of performing differential analysis on an original programming model and a high-performance programming model; initializing physical parameters and calculation parameters and distributed topology of an original programming model, analyzing the original programming model by adopting a performance analysis tool to obtain a hot spot function, establishing a matching mapping mechanism of the original programming model and a high-performance programming model, transplanting the hot spot function, constructing a verification function, performing mixed compiling with the original programming model, performing unit test and integrated test respectively, and outputting a verification result. The method and the device can find out program loopholes in the transplanting process and avoid overload workload of manual comparison results of a large amount of output data. The invention supports the verification of multiple mixed programming models, and can be used as an intermediate process method of two or more programming conversions to verify the correctness of the target code.
Inventors
- TIAN SHAOBO
- ZHAO LIAN
- JIANG JINRONG
- CHI XUEBIN
- LI CHEN
- HAN XIANG
- HUANG JIAN
- BAI YIDI
- HAO HUIQUN
Assignees
- 中国科学院计算机网络信息中心
Dates
- Publication Date
- 20260508
- Application Date
- 20260126
Claims (10)
- 1. The verification method for the scientific computing hybrid programming model is characterized by comprising the following steps of: Performing differential analysis on the original programming model and the high-performance programming model; Initializing physical parameters and calculation parameters of an original programming model and performing distributed topology; analyzing an original programming model by adopting a performance analysis tool to obtain a hotspot function; Establishing a matching mapping mechanism of an original programming model and a high-performance programming model, and performing hot spot function transplanting; After the hot spot function is transplanted, a verification function is built based on the type of the high-performance programming model, unit test and integration test are respectively carried out based on the verification function, mixed compiling is carried out, and a verification result is obtained through output.
- 2. The method for verifying a scientific computing hybrid programming model according to claim 1, wherein the initializing the physical parameters and the computing parameters of the original programming model comprises: The physical parameters comprise a horizontal wind field, a ground surface and three-dimensional air temperature, and the calculation parameters comprise calculation grid point information.
- 3. The method of claim 1, wherein the performing the differential analysis on the original programming model and the high performance programming model comprises: Deploying the original programming model to the super computing platform, determining grammar rules of variables and functions in the original programming model aiming at a compiler used by the original programming model on the super computing platform, and simultaneously determining grammar rules of the variables and functions of the high-performance programming model on the super computing platform.
- 4. The method for verifying a scientific computing hybrid programming model as claimed in claim 1, wherein the distributed topology comprises: If the original programming model is an MPI programming model, establishing a Cartesian topology of an MPI process, carrying out grouping management on process numbers, and dividing grids according to an MPI mapping mode; if the original programming model is a serial programming model, a single CPU processor is used to compute the entire grid.
- 5. The method of claim 1, wherein analyzing the original programming model with the performance analysis tool to obtain the hotspot function comprises performing test analysis on the original programming model with the performance analysis tool to determine the hotspot function as the objective function to be transplanted.
- 6. The method for verifying a hybrid programming model for scientific computing according to claim 1, wherein the step of establishing a matching mapping mechanism of the original programming model and the high-performance programming model comprises establishing variable and function associations between the original programming model and the high-performance programming model according to commonalities of the original programming model and the high-performance programming model, and determining uniform and unique variable and function identifications.
- 7. The method for verifying a scientific computing hybrid programming model of claim 6, wherein performing modular management of hotspot functions to implement transcoding comprises: And managing variables related to the hot spot function in a head file mode, placing C/C++ global variables converted by Fortran in the head file, reducing repeated declarations of the variables, and transplanting sub-functions related to the hot spot function step by step.
- 8. The method for verifying a scientific computing hybrid programming model of claim 1, wherein constructing the verification function comprises: If the bottom layer of the high-performance programming model is based on the CPU machine instruction, establishing variable and function association between the programming models, then transplanting the hot spot function, and finally outputting a calculation result to a memory of the high-performance programming model, and comparing the calculation result; If the high-performance programming model adopts a non-CPU machine instruction, the original programming model is converted into an intermediate programming model which is the most similar to the high-performance programming model, then the intermediate programming model is converted into the high-performance programming model, variable and function correlations among the programming models are established at the same time, a conversion mechanism is utilized to allocate a new storage space based on the high-performance programming model, input data of a hot spot function is transmitted to the new space for data calculation, a result is output to a memory space allocated by the intermediate programming model, and a calculation result is compared.
- 9. The method for verifying a scientific computing hybrid programming model according to claim 1, wherein the performing unit test and integration test respectively, performing hybrid compiling, and outputting the verification result comprises: In the primary verification stage, transplanting and unit testing are carried out on the sub-functions, original sub-functions and corresponding functions adopting a high-performance programming model are compiled in a mixed mode, executable files are submitted, and real-time operation results are checked; After the sub-functions are transplanted, performing integrated test, remixing and compiling the original hot-spot functions and the corresponding functions adopting the high-performance programming model, submitting executable files, and checking real-time operation results.
- 10. A scientific computing hybrid programming model oriented verification system, comprising: the difference analysis module is used for carrying out difference analysis on the original programming model and the high-performance programming model; the initialization module is used for initializing physical parameters and calculation parameters of the original programming model and carrying out distributed topology; the performance analysis module is used for analyzing the original programming model by adopting a performance analysis tool to obtain a hot spot function; The hot spot function transplanting module is used for establishing a matching mapping mechanism of the original programming model and the high-performance programming model and performing hot spot function transplanting; And the verification module is used for constructing a verification function based on the type of the high-performance programming model after the hot spot function is transplanted, respectively carrying out unit test and integration test on the sub-functions of the hot spot function based on the verification function, carrying out mixed compiling, and outputting to obtain a verification result.
Description
Verification method and system for scientific computing hybrid programming model Technical Field The invention relates to the technical field of information, in particular to a verification method and a verification system for a scientific computing hybrid programming model. Background Numerical simulation is a method of simulating physical phenomena in the real world by means of mathematical models and computer techniques. It plays an important role in scientific research and engineering design, especially in situations that are difficult to directly observe or test through experiments. The establishment of numerical simulation strongly promotes the development of scientific computation, however, with the rapid iteration of computer hardware and programming technology, the original programming model of numerical simulation software cannot meet the actual computing requirements. In order to improve the performance of numerical simulation software, researchers begin to try to use a high-performance programming model to accelerate application, but the software code transplanting workload is large, and particularly, large-scale coupling simulation software relates to complex calling relations and various data structures. Therefore, a compromise scheme is proposed to migrate the hot spot function of the software to improve the performance of the software. The problem of software performance is solved by mixing an original programming model of scientific software with a high-performance programming model, and how to realize high-precision verification of the mixed programming model becomes a difficult problem. The correctness of the result can be evaluated empirically by a person skilled in the art through visualization of the data. When the calculation result is inaccurate, the professional in the field needs to analyze the algorithm more carefully and gradually verify the correctness of the positioning of the guessing problem, and the process is relatively complex. It is difficult to find the core of the problem from an algorithmic level for people without relevant knowledge reserves. Therefore, how to propose a method and a system for verifying a scientific computing hybrid programming model, which overcome the defects in the prior art, are the problems that a person skilled in the art needs to solve. Disclosure of Invention The invention provides a verification method and a verification system for a scientific computing hybrid programming model, which realize efficient verification of multiple classes of hybrid programming models. The method comprises the steps of analyzing variables related to an original hot spot function by combing a calculation flow and the hot spot function, distributing a new storage space based on a high-performance programming model, performing data calculation, simultaneously, transmitting a calculation result of the high-performance model to storage of the original calculation model for solving the problems of incompatibility of variables caused by grammar differences of different programming models, accurate finding of memory boundary crossing of the hot spot function transplanting process variables and the like, comparing the calculation result of the original model with the calculation result of the high-performance programming model, and finally realizing effective verification of the data result. The test verification process is based on the eastern of the super computing platform, and can dispatch computing resources according to the type and the application requirement of the hybrid programming model related by numerical simulation, implement computing tasks and carry out verification work, and in order to achieve the purposes, the invention adopts the following technical scheme: A verification method for a scientific computing hybrid programming model comprises the following steps: Performing differential analysis on the original programming model and the high-performance programming model; Initializing physical parameters and calculation parameters of an original programming model and performing distributed topology; analyzing an original programming model by adopting a performance analysis tool to obtain a hotspot function; Establishing a matching mapping mechanism of an original programming model and a high-performance programming model, and performing hot spot function transplanting; After the hot spot function is transplanted, a verification function is built based on the type of the high-performance programming model, unit test and integration test are respectively carried out based on the verification function, mixed compiling is carried out, and a verification result is obtained through output. Optionally, the initializing physical parameters and calculation parameters of the original programming model includes: The physical parameters comprise a horizontal wind field, a ground surface and three-dimensional air temperature, and the calculation parameters comprise ca