Computer Engineering and Applications ›› 2021, Vol. 57 ›› Issue (20): 253-262.DOI: 10.3778/j.issn.1002-8331.2006-0059

Previous Articles     Next Articles

Event Level Parallelization Research of BESIII Experimental Software

MA Zhentai, ZHANG Xiaomei, SUN Gongxing   

  1. 1.Institute of High Energy Physics, Chinese Academy of Sciences, Beijing 100049, China
    2.University of Chinese Academy of Sciences, Beijing 100049, China
  • Online:2021-10-15 Published:2021-10-21



  1. 1.中国科学院 高能物理研究所,北京 100049
    2.中国科学院大学,北京 100049


The job level parallel of BESIII experimental software has the disadvantage of huge memory consumption, the sequence level parallel needs complex sorting work. Aiming at solving these problems, this article puts forward parallel solution at event level, since each event data is independent, data parallelization is selected. Coarse-grained locking of event group provides the best balance between the performance benefits of thread parallelism and the overhead of thread interaction. Creating event group FIFO queue, setting corresponding semaphore for event group state make file output thread, file input thread, event processing threads interact effectively. The mapping table is established to allocate event for event processing threads and update corresponding context. As a result, the data can flow in the original order, avoiding the sorting work. The lazy loading technique is applied to reduce memory waste caused by invalid data. For tuple output of event level parallel, three-layer mapping makes each thread fill the corresponding tree. The experimental results show that event level parallel solution reduces memory consumption 46.5%, the performance improves significantly.

Key words: sort, event group FIFO queue, event group allocation, thread interaction, three layers of mapping



关键词: 排序, 事例组先进先出队列, 事例组分配, 线程交互, 三层映射