Large-scale artificial societies with millions or billions of agents call for high-performance parallel simulation.Prevailing supercomputers with thousands of CPUs and GPUs make it possible to carry out such simulatio...Large-scale artificial societies with millions or billions of agents call for high-performance parallel simulation.Prevailing supercomputers with thousands of CPUs and GPUs make it possible to carry out such simulation.The key is to distribute large-scale agents to massive cores of CPUs and GPUs properly for parallel computing with efficient communication and synchronization.For simplicity and efficiency,a modified discrete event system specification(DEVS)is proposed for large-scale artificial society modeling and parallelism is exploited in agent models because similar agents usually share similar behaviors.Through phased synchronization,a two-tier parallel simulation engine is designed with support of MPI and OpenCL where GPU is used as coprocessor.One-sided communication is used for reflection of remote simulation objects and message passing between processes.A general kernel function prototype is elaborately designed and conditionally compiled for execution on both CPU and GPU.An artificial society for epidemic study is used to test the performance on a supercomputer with 1024 CPU cores and 1792 GPU cores.The speedup reaches 3512 for even 2 billion agents with GPU acceleration which is far over 701 when only CPUs are used.It turns out feasible for parallel simulation of large-scale artificial society with GPU as coprocessor.展开更多
基金supported by the National Natural Science Foundation of China under grant 91024030.
文摘Large-scale artificial societies with millions or billions of agents call for high-performance parallel simulation.Prevailing supercomputers with thousands of CPUs and GPUs make it possible to carry out such simulation.The key is to distribute large-scale agents to massive cores of CPUs and GPUs properly for parallel computing with efficient communication and synchronization.For simplicity and efficiency,a modified discrete event system specification(DEVS)is proposed for large-scale artificial society modeling and parallelism is exploited in agent models because similar agents usually share similar behaviors.Through phased synchronization,a two-tier parallel simulation engine is designed with support of MPI and OpenCL where GPU is used as coprocessor.One-sided communication is used for reflection of remote simulation objects and message passing between processes.A general kernel function prototype is elaborately designed and conditionally compiled for execution on both CPU and GPU.An artificial society for epidemic study is used to test the performance on a supercomputer with 1024 CPU cores and 1792 GPU cores.The speedup reaches 3512 for even 2 billion agents with GPU acceleration which is far over 701 when only CPUs are used.It turns out feasible for parallel simulation of large-scale artificial society with GPU as coprocessor.