Search

CN-121980125-A - Distributed drainage basin model multi-flux parallel computing method

CN121980125ACN 121980125 ACN121980125 ACN 121980125ACN-121980125-A

Abstract

The invention provides a distributed drainage basin model multi-flux parallel computing method which comprises the steps of S1, creating a parallel computing system according to the total process number, including a main control process for overall unique task allocation regulation, a plurality of computing processes for physical processes and a plurality of transfer processes for data transmission among computing units, S3, sequentially distributing computing tasks of all units to the computing processes according to multi-branch tree coding, S4, receiving tasks by the computing processes, receiving upstream data from the transfer processes, unpacking and starting computation, S5, packing and transmitting results to the transfer processes after the computing process tasks are completed, and S6, repeating the steps S3-S5 until all the computing units are calculated. The invention realizes the multi-flux parallel computing method for the distributed drainage basin model which is discretized by any tree structure.

Inventors

  • ZHANG XIAOYUE
  • XUE ZITONG
  • XUE YUAN
  • FU XUDONG

Assignees

  • 清华大学

Dates

Publication Date
20260505
Application Date
20260119

Claims (10)

  1. 1. A distributed watershed model multi-flux parallel computing method, comprising: Performing multi-tree coding on mutually independent computing units according to parallel characteristics of the distributed drainage basin model; creating a parallel computing system according to the total process number, wherein the parallel computing system comprises a main control process which is globally and uniquely responsible for task allocation regulation and control, a plurality of computing processes which are responsible for physical processes and a plurality of transfer processes which are responsible for data transmission among computing units; The main control process sequentially distributes the calculation tasks of each unit to the calculation process according to the multi-way tree codes, the calculation process receives the tasks and upstream data from the intermediate transfer process, and the calculation is started to obtain a calculation result after unpacking; and after the calculation process task is completed, the calculation result is packaged and transmitted to the transfer process until all calculation units complete calculation.
  2. 2. The method of claim 1, wherein said multi-tree encoding of mutually independent computational units according to distributed basin model parallelism comprises: Multiple-fork tree coding adopts triplet to describe topological relation of units Wherein the layer code Representing the number of layers of units in a multi-way tree, node codes Representing the location of a cell at the home level, parent node code Node code representing downstream unit ; The feature refers to a mode of decomposing the total computation task into mutually independent computation tasks by a model, and comprises spatial discrete based on an upstream-downstream confluence relation and time-space discrete combined with time slicing.
  3. 3. The method of claim 1, wherein the parallel computing system created according to the total process number comprises a globally unique master process responsible for task allocation regulation, a plurality of computing processes responsible for physical processes, and a plurality of relay processes responsible for data transfer between computing units: the parallel computing system consists of a main control process, a plurality of computing processes and a plurality of transfer processes; the transfer process is responsible for data transmission among the computing units, and the transfer process adopts a non-blocking communication method; the plurality of transfer processes can reduce the plurality of calculation processes, and meanwhile, the phenomenon of reduction of the speed-up ratio of parallel calculation is caused by data interaction with the transfer processes, and the specific number of the transfer processes is intelligently rated according to the actual speed-up characteristics of the parallel calculation.
  4. 4. The method of claim 1, wherein the master process sequentially distributes the computing tasks of each unit to the computing processes according to the multi-way tree code, the computing processes receive the tasks and receive the upstream data from the intermediate process, and the computing processes start computing after unpacking and obtain the computing results, including: The main control process constructs a computing unit address matrix according to the multi-way tree coding table; The layer code of the computing unit is the layer number of the computing unit in the address matrix, and the node code of the computing unit is the column number corresponding to the computing unit in the address matrix.
  5. 5. The method of claim 4, wherein the computing unit further comprises: Each computing unit is marked by a Boolean variable, and whether the computing unit has completed computation can be determined by the Boolean variable; The master control process traverses from the bottom layer of the address matrix to the upper layer, if all the Boolean variables of the upstream computing units are calculated for each traversed unit, the computing units are in a computable state, the master control process ejects the first computing process from the idle computing process list, and the computing tasks of the computing units are sent to the computing process for computing.
  6. 6. The method of claim 1, wherein the step of packaging and transmitting the calculation result to the transfer process after the calculation process task is completed until all the calculation units complete the calculation comprises: after the computing process receives the computing task, if the computing unit of the task has a corresponding upstream unit, the computing process acquires an upstream boundary condition from the transfer process; the calculation result of the calculation unit is stored in the uniquely corresponding transfer process, for Number calculation unit, assuming that the upstream calculation unit is It needs to be called The unit calculation results are used as boundary conditions, and it is assumed that the system is common The transfer processes are respectively numbered as Then The result of the calculation unit is stored in (Remainder taking operation) number.
  7. 7. The method of claim 1, wherein the data transmission module in the parallel computing has excellent expansibility, and can transmit any group of water sand data, water temperature and solute flux according to the requirement of a computing task, and the implementation method can be based on unpacking and packing operations of MPI or combining multiple groups of data into one array for access based on offset.
  8. 8. The method of claim 1, wherein the parallel algorithm is completely decoupled from the physical process, and the computing process is linked to the physical model required to perform the computation through an interface reserved therein.
  9. 9. A distributed watershed model multi-flux parallel computing device, comprising: The multi-tree coding module is used for carrying out multi-tree coding on the mutually independent calculation units according to the parallel characteristics of the distributed drainage basin model; The parallel computing system construction module is used for creating a parallel computing system according to the total process number, and comprises a main control process which is globally unique and is responsible for task allocation regulation, a plurality of computing processes which are responsible for physical processes and a plurality of transfer processes which are responsible for data transmission among computing units; The task allocation regulation and control module is used for sequentially allocating the calculation tasks of each unit to the calculation process by the main control process according to the multi-way tree codes, receiving the tasks by the calculation process, receiving upstream data from the intermediate transfer process, and starting calculation after unpacking; And the calculation result processing module is used for packaging and transmitting the result to the transfer process after the calculation process task is completed until all calculation units complete calculation.
  10. 10. The apparatus of claim 9, wherein the multi-tree encoding module is further to: Multiple-fork tree coding adopts triplet to describe topological relation of units Wherein the layer code Representing the number of layers of units in a multi-way tree, node codes Representing the location of a cell at the home level, parent node code Node code representing downstream unit ; The feature refers to a mode of decomposing the total computation task into mutually independent computation tasks by a model, and comprises spatial discrete based on an upstream-downstream confluence relation and time-space discrete combined with time slicing.

Description

Distributed drainage basin model multi-flux parallel computing method Technical Field The application relates to the technical field of water resource scheduling, in particular to a distributed watershed model multi-flux parallel computing method. Background The distributed river basin model is used as an important calculation tool in the field of water resource scheduling, and is widely applied to multi-physical process simulation such as flood forecast, sediment transportation, water temperature prediction and the like. In the related art, a parallel computing system based on sub-drainage basin/grid division is constructed through the collaborative operation of space dispersion and time slicing. Specifically, the technology covers the whole process from model structure decomposition to task allocation, and comprises key links such as Horton-Strahler coding, ID mapping and the like. Along with the improvement of the complexity of the river basin model, the existing method adopts spatial dependency relationship and time slicing treatment, but the coding rule is still limited to a specific model structure, so that the coupling degree of a physical process and a parallel architecture is higher, and the parallel transmission requirement of multi-flux data (water sand, water temperature and solute) is difficult to adapt. However, in the existing parallel computing method, grid coordinate coding or sub-stream domain ID coding is directly adopted, and a unified topology description framework is not established, so that model suitability is limited, or numerical overflow risks occur in the case of a super-ten thousand unit scale. Specifically, the traditional coding rule needs to manually define the upstream-downstream relation in a model based on sub-watershed division, and the traditional coding rule depends on a fixed grid structure in a grid model, and the fragmentation feature remarkably increases the development cost of parallelization transformation of a new model. Meanwhile, the transfer process in the existing data transmission mechanism is single in form, and the process blocking phenomenon is easy to occur under different parallel acceleration characteristics. Particularly, in a massive parallel computing scene, the interaction efficiency of a computing process and a transfer process directly influences the overall acceleration ratio performance. Disclosure of Invention The present invention aims to solve at least one of the technical problems in the related art to some extent. To this end, a first object of the present invention is to propose a distributed watershed model multi-flux parallel computing method. A second object of the present invention is to propose a distributed watershed model multi-flux parallel computing device. To achieve the above object, an embodiment of a first aspect of the present invention provides a distributed drainage basin model multi-flux parallel computing method, including: S10, performing multi-way tree coding on mutually independent calculation units according to parallel characteristics of the distributed drainage basin model; S20, creating a parallel computing system according to the total process number, wherein the parallel computing system comprises a main control process which is globally and uniquely responsible for task allocation regulation and control, a plurality of computing processes which are responsible for physical processes and a plurality of transfer processes which are responsible for data transmission among computing units; S30, the main control process sequentially distributes the calculation tasks of each unit to the calculation process according to the multi-way tree codes, the calculation process receives the tasks and upstream data from the intermediate transfer process, and the calculation is started after unpacking to obtain a calculation result; s40, after the calculation process task is completed, the calculation result is packaged and transmitted to the transfer process until all calculation units complete calculation. In one embodiment of the present invention, the S10 includes: Multiple-fork tree coding adopts triplet to describe topological relation of units Wherein the layer codeRepresenting the number of layers of units in a multi-way tree, node codesRepresenting the location of a cell at the home level, parent node codeNode code representing downstream unit; The feature refers to a mode of decomposing the total computation task into mutually independent computation tasks by a model, and comprises spatial discrete based on an upstream-downstream confluence relation and time-space discrete combined with time slicing. In one embodiment of the present invention, the S20 includes: the parallel computing system consists of a main control process, a plurality of computing processes and a plurality of transfer processes; the transfer process is responsible for data transmission among the computing units, and the transfer process adopts a non