A particle management method and system in PIC / MCC simulation based on GPU architecture

By introducing particle state variables and parallel compression algorithms on the GPU device side, combined with atomic operation mechanisms, autonomous management of particle lifecycles is achieved. This solves the memory fragmentation and access conflict problems of particle management under GPU architecture, improves simulation efficiency and memory utilization, and is applicable to multiple simulation fields.

CN121302838BActive Publication Date: 2026-02-24TSINGHUA SHENZHEN INTERNATIONAL GRADUATE SCHOOL
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511861661.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-11
Publication Date
2026-02-24
Estimated Expiration
2045-12-11

AI Technical Summary

Technical Problem

In GPU architecture, traditional particle management methods in PIC/MCC simulation suffer from memory fragmentation, access conflicts, and low efficiency in dynamic updates, resulting in low computational efficiency and making it difficult to implement efficiently on GPU platforms.

Method used

By employing particle state variables, parallel compression algorithms, and atomic operation mechanisms, autonomous management of particle lifecycles is achieved on the GPU device. By pre-allocating contiguous video memory areas, active particles are periodically compressed and the index mapping table is updated, avoiding frequent memory reallocation and data transfer.

Benefits of technology

It significantly improves the continuity and access efficiency of particle storage, enhances simulation performance, is suitable for simulation calculation models of various dimensions, has efficient dynamic management capabilities and thread safety, and is applicable to fields such as plasma discharge, arc simulation and ion transport simulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121302838B_ABST
    Figure CN121302838B_ABST
Patent Text Reader

Abstract

The application discloses a kind of particle management method and system in PIC / MCC simulation based on GPU architecture.The method preallocates continuous video memory storage particle attribute and state variable at GPU device end;When new particle is generated, thread appends attribute at the end of array and is marked as active;Need to delete particle only mark as non-active without immediately removing;Periodically, active particle is compressed to continuous area by parallel scanning and prefix sum algorithm, and non-active particle is filtered;After compression, update particle index mapping table to ensure correct access of subsequent module.Atomic operation is used in the process to ensure parallel writing safety and data consistency.The system realizes autonomous management of particle at GPU end, effectively solves memory fragmentation, access conflict and low efficiency of dynamic update, significantly improves storage continuity, access efficiency and simulation speed, and is suitable for high-performance PIC / MCC simulation such as plasma discharge in all dimensions and arc simulation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of plasma numerical simulation and high-performance computing, and in particular to a particle management method and system based on GPU architecture PIC / MCC simulation. Background Technology

[0002] The Particle-In-Cell / Monte Carlo Collision (PIC / MCC) method is an important numerical tool for studying plasma discharge characteristics and particle transport laws. In large-scale simulations, the number of particles can reach millions or even hundreds of millions, and particle generation and disappearance are frequent. Traditional CPU particle management methods have significant bottlenecks in memory allocation, data access, and thread synchronization, resulting in low simulation efficiency.

[0003] The particle simulation-Monte Carlo collision (PIC / MCC) method is an important numerical tool for studying the discharge characteristics, particle transport mechanisms, and electromagnetic field evolution of cryogenic plasmas. It is widely used in various fields such as plasma etching, vacuum arcing, electric propulsion, and discharge analysis of flexible DC systems. By solving the dynamic equations of charged particles and combining them with a Monte Carlo random collision model, this method can accurately reproduce the complex non-equilibrium processes in plasma systems numerically.

[0004] In PIC / MCC simulations, the number of particles is typically... to The computational scale is enormous; at each time step, operations such as position updates, velocity advancement, collision detection, and charge allocation must be performed on all particles. Simultaneously, particle generation and disappearance are extremely frequent; for example, ionization reactions and surface secondary electron emission generate new particles, while particles reaching electrodes or chamber boundaries must be deleted. Improper particle management can lead to memory fragmentation, indexing errors, and thread access conflicts, severely impacting computational efficiency.

[0005] Traditional PIC / MCC programs mostly run on CPU platforms and maintain particle array structures using serial or limited multi-threaded methods. The main problems with this type of structure include: (1) low efficiency in adding and deleting particles: when the number of particles changes frequently, array rearrangement and memory reallocation lead to a large amount of time overhead; (2) severe memory fragmentation: frequent deletion operations cause particle data to be discontinuous and the cache hit rate to decrease; (3) frequent parallel conflicts: when multiple threads access particle attributes at the same time, write competition is likely to occur, requiring locking or synchronization, which further reduces efficiency; (4) difficult GPU porting: due to the differences between CPU serial logic and GPU large-scale parallel architecture, traditional data structures are difficult to implement directly on GPUs.

[0006] With the improvement of GPU computing power, parallel PIC / MCC simulation based on CUDA or OpenCL has become the mainstream trend. However, how to achieve dynamic and efficient particle management under GPU architecture remains one of the important challenges in this field. GPUs have tens of thousands of computing cores and can process a large amount of particle data simultaneously, but they require continuous memory access patterns and minimized thread synchronization; otherwise, performance will drop sharply.

[0007] It should be noted that the information disclosed in the background section above is only for understanding the background of this application, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0008] The main objective of this invention is to overcome the deficiencies in the aforementioned background technology and provide a particle management method and system based on GPU architecture PIC / MCC simulation.

[0009] To achieve the above objectives, the present invention adopts the following technical solution:

[0010] In a first aspect of the present invention, a particle management method based on GPU architecture PIC / MCC simulation includes the following steps:

[0011] S1. During the simulation startup phase, a contiguous video memory area is pre-allocated on the GPU device to store particle attribute information, including state variables;

[0012] S2. When a new particle is generated, the corresponding thread appends its attributes to the end of the particle array and sets the state variable to the active state;

[0013] S3. When a particle needs to be deleted, only set its state variable to an inactive state, instead of removing it from the array immediately;

[0014] S4. Periodically perform compression operations, reorder the particles with active state variables through parallel scanning and prefix sum algorithms, store them in a contiguous video memory area, and filter out inactive particles.

[0015] S5. After the compression operation, update the particle index mapping table to ensure that subsequent physics modules can correctly access particle properties;

[0016] In the process of adding particle attributes and modifying state variables, atomic operations are used to ensure the safety and data consistency of parallel write operations.

[0017] Furthermore, in step S1, the particle attribute information includes position, velocity, charge, mass, energy, and state variables.

[0018] Furthermore, in step S2, new particles are generated during the ionization or excitation process, and the corresponding thread directly appends the attributes to the end of the array without needing to re-allocate memory or perform global synchronization operations.

[0019] Furthermore, in step S3, particles need to be deleted because they are out of bounds or have run out of energy. The inactivity flag is only modified by changing the state variable to avoid global memory reordering.

[0020] Furthermore, in step S4, the compression operation is implemented through parallel scanning and prefix sum algorithms and is executed independently on the GPU without CPU intervention.

[0021] Further, in step S4, the compression operation includes the following sub-steps:

[0022] Allocate temporary memory;

[0023] Check the state variables of each particle; if it is active, query the index mapping and copy its data to temporary memory.

[0024] After all particles have been processed, the data in the temporary memory will be migrated back to the contiguous video memory area.

[0025] Release temporary memory.

[0026] Furthermore, in step S5, updating the particle index mapping table uses an intra-block synchronization and event logging mechanism to achieve global consistency.

[0027] Furthermore, the atomic operations include the atomicAdd() and atomicCAS() primitives, which are used to ensure the safety and data consistency of parallel write operations.

[0028] Furthermore, the compression operation is performed periodically at regular intervals to maintain the orderliness and efficiency of the particle array structure.

[0029] In a second aspect of the present invention, a PIC / MCC simulation particle management system based on GPU architecture includes: a control host and a GPU device;

[0030] The control host is used to initialize the simulation task and instruct the GPU device to allocate storage resources;

[0031] The GPU device is configured as follows:

[0032] A contiguous area of ​​video memory is pre-allocated to store particle attribute arrays, including state variables;

[0033] During the simulation, the addition and logical deletion of particles are dynamically executed. The addition of particles is achieved by appending attributes to the end of the linear array, and the logical deletion is achieved by modifying the particle state variable.

[0034] The parallel compression kernel function is periodically called to reorder and integrate active particles based on the prefix sum algorithm in order to maintain the continuity of particle data in video memory.

[0035] After each compression operation, the global particle index mapping is updated to ensure that subsequent physics calculation modules can correctly access particle data;

[0036] In the process of writing particle data and modifying its state, atomic operations are used to ensure data consistency under multi-threaded concurrency.

[0037] The present invention has the following beneficial effects:

[0038] This invention proposes a GPU-based PIC / MCC simulation particle management method. By introducing particle state variables, parallel compression algorithms, and atomic operation mechanisms, it achieves rapid addition, deletion, and dynamic rearrangement of particles. This method enables autonomous management of particle lifecycles on the GPU device, effectively avoiding frequent memory reallocation and data transfer, and significantly improving the continuity and access efficiency of particle storage. Simultaneously, through periodic compression and index synchronization mechanisms, it maintains the orderliness and efficiency of the particle array structure, making it suitable for simulation computation models of various dimensions.

[0039] As a particle dynamic management solution implemented under GPU architecture, this invention targets the Particle-In-Cell / Monte Carlo Collision (PIC / MCC) simulation program. It can efficiently complete the storage, addition, deletion, compression, and indexing of particle data in a parallel computing environment, thereby achieving stable management and fast access to large-scale particle systems and significantly improving overall simulation performance. Its core value lies in constructing a GPU particle management mechanism that supports both dynamic particle addition and deletion and ensures efficient data access, providing crucial support for overcoming the particle management bottleneck in GPU parallel simulation and improving parallel simulation performance.

[0040] This invention specifically addresses the core problems of existing particle management methods in GPU parallel computing environments, including memory fragmentation, access conflicts, and low efficiency in dynamic updates. By implementing autonomous particle data management on the device side, combined with state variable identification, parallel compression, and index synchronization mechanisms, this invention can efficiently complete the rapid addition, deletion, and rearrangement of particles. This significantly improves the speed of particle simulation while substantially increasing memory utilization, ensuring the stability and efficiency of large-scale particle system simulations.

[0041] Compared with traditional particle management schemes, this invention has outstanding technical advantages: First, it is applicable to simulation calculation models of various dimensions, has efficient dynamic management capabilities, and particle addition and deletion operations only require modification of state variables, without the need for complex array rearrangement or memory adjustment, making the operation simple and time-saving; Second, this method can significantly reduce memory fragmentation, reduce the problem of cache hit rate decline caused by data discontinuity, and effectively improve the efficiency of video memory access; Third, relying on atomic operation and other mechanisms, this invention has strong thread safety, which can avoid write competition during multi-threaded concurrent access and ensure data consistency in parallel computing.

[0042] Furthermore, the method of this invention is characterized by its simple structure and strong versatility, and can be widely applied in various fields such as plasma discharge, arc simulation, and ion transport simulation. Its efficient particle management mechanism implemented on the GPU platform not only demonstrates significant innovation but also possesses excellent scalability, providing a solid foundation for high-performance simulation of complex discharge systems and contributing to numerical simulation research and engineering applications in related fields.

[0043] Other beneficial effects of the embodiments of the present invention will be further described below. Attached Figure Description

[0044] Figure 1 This is a flowchart illustrating the overall process of the particle management method in PIC / MCC simulation based on the GPU architecture of this invention.

[0045] Figure 2 This is a flowchart illustrating the technical implementation principle of the particle management method according to an embodiment of the present invention. Detailed Implementation

[0046] The embodiments of the present invention will be described in detail below. It should be emphasized that the following description is merely exemplary and not intended to limit the scope and application of the present invention.

[0047] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of embodiments of the present invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0048] This invention aims to address the problems of memory fragmentation, access conflicts, and low dynamic update efficiency in existing particle management methods for PIC / MCC simulations under GPU architecture. It proposes a method for autonomous particle lifecycle management on the GPU device side by introducing particle state variables, parallel compression algorithms, and atomic operation mechanisms. This method avoids frequent memory reallocation and data transfer, significantly improving particle storage continuity, access efficiency, and thread safety. It is applicable to simulations across various dimensions, has a simple structure, strong versatility, and can support high-performance simulations of complex discharge systems.

[0049] See Figure 1 This invention provides a particle management method in PIC / MCC simulation based on GPU architecture, comprising the following steps:

[0050] Step S1. During the simulation startup phase, a contiguous video memory area is pre-allocated on the GPU device to store the particle's attribute information, including state variables.

[0051] In some embodiments, in step S1, the particle attribute information includes position, velocity, charge, mass, energy, and state variables.

[0052] Step S2. When a new particle is generated, the corresponding thread appends its attributes to the end of the particle array and sets the state variable to the active state. During the particle attribute appending and state variable modification process, atomic operations are used to ensure the safety and data consistency of parallel write operations.

[0053] In some embodiments, in step S2, new particles are generated during the ionization or excitation process, and the corresponding thread directly appends the attributes to the end of the array without needing to reallocate memory or perform global synchronization operations.

[0054] Step S3. When a particle needs to be deleted, only set its state variable to an inactive state, instead of immediately removing it from the array; during the state variable modification process, use atomic operations to ensure the safety and data consistency of parallel write operations.

[0055] In some embodiments, in step S3, the particle needs to be deleted because it is out of bounds or has run out of energy. The inactive flag is only modified by changing the state variable to avoid global memory reordering.

[0056] Step S4. Periodically perform compression operations, reorder the particles with active state variables through parallel scanning and prefix sum algorithms, store them in a contiguous video memory area, and filter out inactive particles.

[0057] In some embodiments, in step S4, the compression operation is implemented through parallel scanning and prefix sum algorithms and is executed independently on the GPU without CPU intervention.

[0058] In some embodiments, step S4 includes the following sub-steps: allocating temporary memory; checking the state variables of each particle, and if it is in an active state, querying the index mapping and copying its data to the temporary memory; after all particles have been processed, migrating the data in the temporary memory back to the contiguous video memory area; and releasing the temporary memory.

[0059] Step S5. After the compression operation, update the particle index mapping table to ensure that subsequent physics modules can correctly access particle properties.

[0060] In some embodiments, in step S5, updating the particle index mapping table uses an intra-block synchronization and event logging mechanism to achieve global consistency.

[0061] In some embodiments, the atomic operations include the atomicAdd() and atomicCAS() primitives to ensure the safety and data consistency of parallel write operations.

[0062] In some embodiments, the compression operation is performed periodically at intervals of a certain time step to maintain the orderliness and efficiency of the particle array structure.

[0063] A PIC / MCC simulation particle management system based on GPU architecture includes: a control host and a GPU device; the control host is used to initialize simulation tasks and instruct the GPU device to allocate storage resources; the GPU device is configured to: pre-allocate a contiguous video memory region for storing particle attribute arrays, including state variables; during simulation operation, the addition and logical deletion of particles are dynamically executed, wherein adding particles is achieved by appending attributes to the end of a linear array, and logical deletion is achieved by modifying particle state variables; a parallel compression kernel function is periodically called to reorder and integrate active particles based on a prefix sum algorithm to maintain the continuity of particle data in video memory; after each compression operation, the global particle index mapping is updated to ensure that subsequent physics calculation modules can correctly access particle data; wherein, during particle data writing and state modification, atomic operations are used to ensure data consistency under multi-threaded concurrency.

[0064] This invention proposes a GPU-based PIC / MCC simulation particle management method and system. Addressing the issues of memory allocation bottlenecks, inefficient data access, thread synchronization conflicts, and difficulties in GPU porting in traditional CPU-based PIC / MCC simulation particle management, as well as the low dynamic update efficiency in existing GPU particle management, this invention pre-allocates contiguous video memory on the GPU device to store particle attributes containing state variables; implements particle logic addition and deletion by modifying state variables (new particles are directly appended to the end of the array, and particles to be deleted are only marked as inactive to avoid frequent memory reordering); periodically uses parallel scanning and prefix sum algorithms to compress active particles and filter inactive particles; and leverages the original... The sub-operations ensure the safety and data consistency of parallel write operations, and the particle index mapping table is updated after compression to ensure accurate access to subsequent physics modules. This enables autonomous management of the particle lifecycle on the GPU side, significantly improving particle storage continuity, access efficiency, particle simulation speed, and memory utilization. It effectively reduces memory fragmentation and thread access conflicts, and is applicable to simulation calculation models of various dimensions. The method has a simple structure and strong versatility, and can be widely used in fields such as plasma discharge, arc simulation, and ion transport simulation. Its efficient particle management mechanism on the GPU platform is both innovative and scalable, providing fundamental support for high-performance PIC / MCC simulation of complex discharge systems.

[0065] The following further describes the implementation methods and advantages of specific embodiments of the present invention.

[0066] A particle management method based on GPU architecture PIC / MCC simulation, the technical implementation process of which is as follows: Figure 2 As shown, the main steps include:

[0067] (1) Particle attribute initialization: During the simulation startup phase, a contiguous video memory area is pre-allocated on the GPU device to store all the attribute information of the particles, including position, velocity, charge, mass, energy and state variables, so as to ensure the continuity and sharing of access between threads.

[0068] (2) When new particles are generated by processes such as ionization and excitation, the corresponding thread directly appends their attributes to the end of the particle array and sets the state variable to "1" to indicate an active state. Since the video memory space has been uniformly allocated during the initialization phase, there is no need to re-allocate memory or perform global synchronization operations, thus maintaining high parallel efficiency.

[0069] (3) For particles that have exceeded the limit or run out of energy, the program only needs to set their state variable to "0" instead of immediately removing the particle from the array. This identification method effectively avoids global memory rearrangement caused by frequent deletions and greatly reduces the synchronization delay in the calculation process.

[0070] (4) After several steps of simulation, the addition and deletion of particles will cause the distribution of active particles in the video memory to become discontinuous, thus affecting the cache hit rate and parallel performance. To address this, the present invention designs a periodically executed compression mechanism. This mechanism reorders particles with a state variable of "1" through parallel scanning and a prefix-sum algorithm, storing them in a contiguous region, while particles with a state of "0" are automatically filtered out. This compression kernel function is executed independently on the GPU without CPU intervention.

[0071] (5) After the particle rearrangement is completed, the system automatically updates the particle index mapping table to ensure that subsequent physics modules (such as charge distribution and propulsion calculations) can correctly access the corresponding particle properties. This process uses intra-block synchronization and event logging mechanisms to achieve global consistency.

[0072] To avoid contention caused by multiple threads writing to the same memory unit simultaneously, this invention employs CUDA atomic operations, including primitives such as atomicAdd() and atomicCAS(), to ensure the safety and data consistency of parallel write operations.

[0073] Compared with traditional particle management schemes, this invention is applicable to simulation calculation models of all dimensions, has efficient dynamic management capabilities, and particle addition and deletion operations only involve modification of state variables; at the same time, it can significantly reduce memory fragmentation, improve the efficiency of video memory access, and has strong thread safety.

[0074] The method of this invention can be widely applied in PIC / MCC simulation frameworks.

[0075] Taking a one-dimensional radio frequency discharge model as an example, the main implementation steps are as follows:

[0076] (1) Set the simulation domain mesh, electrode boundaries and initial particle distribution. Allocate fixed video memory on the GPU to store particle attribute arrays, such as pos_x[], vel_x[], charge[], mass[], flag[], etc.

[0077] (2) At each time step, the GPU kernel executes in parallel to determine whether the particle exceeds the boundary. If it does, its state variable is modified. If a new particle generation event occurs, the thread automatically allocates an index and writes its attributes to the end of the array.

[0078] (3) Execute the compression kernel function once every N steps: use prefix sum to scan the positions of active particles and rearrange the particles, and update the global particle counter and index table.

[0079] Experimental verification

[0080] To verify the efficiency improvement effect of the GPU-based particle management method and system proposed in this invention in actual PIC / MCC simulation, this embodiment built two comparable particle management test platforms: one for CPU and one for GPU. The CPU test platform used an Intel Xeon w9-3495X processor (56 cores, clock speed 1.9–4.8 GHz) and employed traditional CPU-side particle propulsion and particle addition / deletion management strategies. The GPU test platform used an NVIDIA GeForce RTX 4090 graphics card (24 GB VRAM), employing the CUDA architecture to permanently store all particle data in VRAM, and using the strategy proposed in this invention to achieve large-scale parallel addition and deletion operations of particles. To ensure fairness in the comparison, both schemes were written in Python, used the same random number seed and particle data structure, and maintained consistent data distribution to ensure the fairness of the comparison results.

[0081] The experiment started with an initial particle number of 5 × 10⁻⁶. 5 1×10 6 Under the given conditions, two sets of addition and deletion scales are set, with each operation adding and deleting 1×10. 4 One particle and 5×10 4 The experimental results show that the GPU particle management method proposed in this invention has significant performance improvements in scenarios with large-scale particle sets and large-volume addition and deletion. When the initial number of particles is 5 × 10⁻⁶ particles... 5 And each addition and deletion is 5×10 4 When processing particles, the GPU takes only 0.173ms, approximately 41 times faster than the CPU's 7.133ms; this improvement is further achieved when the initial particle count is increased to 1×10⁻⁶. 6 And each addition and deletion is 5×10 4 When processing particles, the GPU took 0.274 ms, a speedup of 52.81 times compared to the CPU's 14.459 ms. As the particle size and the number of addition and deletion operations increased, the GPU's speedup further expanded, demonstrating excellent scalability. Table 1 shows the time and speedup ratio of CPU and GPU under different initial particle numbers and different addition / deletion scales in the experiment.

[0082] Table 1. CPU and GPU time consumption and speedup ratio under different initial particle numbers and different addition / removal scales.

[0083]

[0084] In summary, this invention proposes a PIC / MCC simulation particle management method and system based on GPU architecture. Key innovative contributions and design features include: the introduction of particle state variables, parallel compression algorithms, and atomic operation mechanisms to achieve rapid addition, deletion, and dynamic rearrangement of particles; the construction of an autonomous management mechanism for particle lifecycles on the GPU device; and the maintenance of the orderliness and efficiency of the particle array structure through periodic compression and index synchronization mechanisms. For particle simulation-Monte Carlo collision (PIC / MCC) programs, it is adaptable to parallel computing environments, efficiently completing particle data storage, addition, deletion, compression, and index maintenance. This enables stable management and rapid access to large-scale particle systems, forming a GPU particle management system that supports both dynamic particle addition and deletion and ensures efficient data access.

[0085] Compared with the prior art, the significant technical advantages of the present invention are reflected in the following aspects:

[0086] This invention effectively solves the problems of memory fragmentation, access conflicts, and low dynamic update efficiency in existing particle management methods in GPU parallel computing environments. It avoids frequent memory reallocation and data transfer, significantly improving the continuity of particle storage, access efficiency, particle simulation speed, and memory utilization. Particle addition and deletion operations can be completed by modifying state variables only. It has efficient dynamic management capabilities and is applicable to simulation calculation models of various dimensions. At the same time, this invention has a simple structure and strong versatility, and can be widely used in fields such as plasma discharge, arc simulation, and ion transport simulation. Its efficient particle management mechanism implemented on the GPU platform has significant innovation and scalability, and can also ensure strong thread safety, providing a solid foundation for high-performance simulation of complex discharge systems.

[0087] This invention also provides a storage medium for storing a computer program, which, when executed, performs at least the methods described above.

[0088] This invention also provides a control device, including a processor and a storage medium for storing a computer program; wherein the processor executes the computer program by performing at least the method described above.

[0089] This invention also provides a processor that executes a computer program, at least performing the methods described above.

[0090] The storage medium can be implemented by any type of non-volatile storage device, or a combination thereof. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc or CD-ROM; magnetic surface memory can be disk storage or magnetic tape storage. The storage media described in the embodiments of this invention are intended to include, but are not limited to, these and any other suitable types of memory.

[0091] In the several embodiments provided by this invention, it should be understood that the disclosed systems and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.

[0092] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.

[0093] In addition, in the various embodiments of the present invention, each functional unit can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.

[0094] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0095] Alternatively, if the integrated units of this invention are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.

[0096] The methods disclosed in the several method embodiments provided by this invention can be arbitrarily combined without conflict to obtain new method embodiments.

[0097] The features disclosed in the several product embodiments provided by this invention can be arbitrarily combined without conflict to obtain new product embodiments.

[0098] The features disclosed in the several method or device embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new method or device embodiments.

[0099] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various equivalent substitutions or obvious modifications can be made without departing from the concept of the present invention, and all such modifications, achieving the same performance or application, should be considered within the scope of protection of the present invention.

Claims

1. A particle management method in PIC / MCC simulation based on GPU architecture, characterized in that, Includes the following steps: S1. During the simulation startup phase, a contiguous video memory area is pre-allocated on the GPU device to store particle attribute information, including state variables; S2. When a new particle is generated, the corresponding thread appends its attributes to the end of the particle array and sets the state variable to the active state; S3. When a particle needs to be deleted, only set its state variable to an inactive state, instead of removing it from the array immediately; S4. Periodically perform a compression operation, reordering particles with active state variables using parallel scanning and prefix sum algorithms, storing them in a contiguous video memory area, while filtering out inactive particles; the compression operation includes the following sub-steps: allocating temporary memory; checking the state variable of each particle, if it is active, querying the index mapping and copying its data to the temporary memory; after all particles have been processed, migrating the data in the temporary memory back to the contiguous video memory area; releasing the temporary memory; S5. After the compression operation, update the particle index mapping table so that subsequent physics modules can correctly access particle properties; In the process of adding particle attributes and modifying state variables, atomic operations are used to maintain the safety and data consistency of parallel write operations.

2. The particle management method in GPU architecture PIC / MCC simulation as described in claim 1, characterized in that, In step S1, the particle attribute information includes position, velocity, charge, mass, energy, and state variables.

3. The particle management method in GPU architecture PIC / MCC simulation as described in claim 1 or 2, characterized in that, In step S2, new particles are generated during the ionization or excitation process, and their attributes are directly appended to the end of the array by the corresponding thread without the need to re-allocate memory or perform global synchronization operations.

4. The particle management method in GPU architecture PIC / MCC simulation as described in any one of claims 1 to 2, characterized in that, In step S3, particles need to be deleted because they are out of bounds or have run out of energy. The inactivity flag is only modified by changing the state variable to avoid global memory reordering.

5. The particle management method in GPU architecture PIC / MCC simulation as described in any one of claims 1 to 2, characterized in that, In step S4, the compression operation is implemented through parallel scanning and prefix sum algorithms and is executed independently on the GPU without CPU intervention.

6. The particle management method in GPU architecture PIC / MCC simulation as described in any one of claims 1 to 2, characterized in that, In step S5, updating the particle index mapping table uses intra-block synchronization and event logging mechanisms to achieve global consistency.

7. The particle management method in GPU architecture PIC / MCC simulation as described in any one of claims 1 to 2, characterized in that, The atomic operations include the atomicAdd() and atomicCAS() primitives, which are used to maintain the safety and data consistency of parallel write operations.

8. The particle management method in GPU architecture PIC / MCC simulation as described in any one of claims 1 to 2, characterized in that, The compression operation is performed periodically at time intervals to maintain the orderliness and efficiency of the particle array structure.

9. A PIC / MCC simulation particle management system based on a GPU architecture, used to implement the particle management method as described in any one of claims 1 to 8, characterized in that, include: Control host and GPU devices; The control host is used to initialize the simulation task and instruct the GPU device to allocate storage resources; The GPU device is configured as follows: A contiguous area of ​​video memory is pre-allocated to store particle attribute arrays, including state variables; During the simulation, the addition and logical deletion of particles are dynamically executed. The addition of particles is achieved by appending attributes to the end of the linear array, and the logical deletion is achieved by modifying the particle state variable. The parallel compression kernel function is periodically called to reorder and integrate active particles based on the prefix sum algorithm in order to maintain the continuity of particle data in video memory. The compression operation includes: allocating temporary memory; checking the state variables of each particle, and if it is active, querying the index mapping and copying its data to the temporary memory; after all particles have been processed, migrating the data in the temporary memory back to the contiguous video memory area; and releasing the temporary memory. After each compression operation, the global particle index mapping is updated so that the subsequent physics calculation module can correctly access the particle data. In particular, atomic operations are used to ensure data consistency under multi-threaded concurrency during particle data writing and state modification.

Citation Information

Patent Citations

  • A particle system rendering method, device, and electronic device

    CN119741411A

  • Dynamic rendering resource scheduling method and related equipment

    CN120295731A