Abstract
This paper explores a way to build a new computing environment based on Hadoop to make the Large High Altitude Air Shower Observatory(LHAASO) jobs run on it transparently. Particularly, we discuss a new mechanism to support LHAASO software to random access data in HDFS. This new feature allows the Map/Reduce tasks to random read/write data on the local file system instead of using Hadoop data streaming interface. This makes HEP jobs run on Hadoop possible. We also develop MapReduce patterns for LHAASO jobs such as Corsika simulation, ARGO detector simulation (Geant4), KM2A simulation and Medea++ reconstruction. And user-friendly interface is provided. In addition, we provide the real-time cluster monitoring in terms of cluster healthy, number of running jobs, finished jobs and killed jobs. Also the accounting system is included. This work has been in production for LHAASO offline data analysis to gain about 20,000 CPU hours per month since September, 2016. The results show the efficiency of IO intensive job can be improved about 46%. Finally, we describe our ongoing work of data migration tool to serve the data move between HDFS and other storage systems.
Introduction
The Large High Altitude Air Shower Observatory (LHAASO) is a major international scientific project focused on cosmic ray research and gamma-ray astronomy. With its vast array of detectors, LHAASO generates approximately 2 petabytes (PB) of raw data annually. Processing this volume of data presents significant challenges for traditional High Energy Physics (HEP) computing infrastructures.
Historically, HEP data analysis has followed a "move data to computation" paradigm. In this model, data is stored in centralized, high-performance storage arrays (such as Lustre or EOS) and pulled over a high-speed network to worker nodes for processing. However, as data volumes scale into the multi-petabyte range, this architecture encounters severe bottlenecks at the network switches and storage controllers. To address these limitations, this research explores the adaptation of the Hadoop ecosystem—a "move computation to data" framework—for LHAASO offline data analysis.
The Architectural Shift
The primary goal was to transition from a specialized, high-cost infrastructure to a distributed environment built on commodity hardware. In the traditional setup, computing nodes are separated from storage nodes, requiring a complex fabric of high-speed interconnects. In contrast, the Hadoop-based approach utilizes a "Computing & Storage Cluster" where each node serves as both a processing unit and a data storage unit.
By leveraging data locality, the system minimizes network traffic, as MapReduce tasks are scheduled to run on the specific nodes where the required data blocks reside.
Methodology: Bridging Hadoop and HEP
While Hadoop offers scalability, it was not originally designed for the specific needs of HEP software. The two main hurdles were data access patterns and software compatibility.
HDFS Random Access Extension
The Hadoop Distributed File System (HDFS) is optimized for sequential streaming of large files. However, HEP software typically utilizes the ROOT data format, which requires random access to specific file segments. To resolve this, we modified the HDFS source code to implement a "bypass" mechanism. Instead of interacting with data through the standard HDFS streaming API, MapReduce tasks can now identify the physical location of data blocks on the DataNode and perform direct read/write operations on the local Linux file system. This allows existing HEP libraries to function without modification while benefiting from HDFS's data locality.
Custom MapReduce Patterns
To make the environment "transparent" for scientists, we developed specialized MapReduce wrappers for common LHAASO tasks:
- Corsika: Cosmic ray air shower simulation.
- Geant4: Detector simulation for the ARGO experiment.
- KM2A: Simulation for the Kilometer Square Array.
- Medea++: Reconstruction software.
These patterns abstract the underlying Hadoop logic, allowing researchers to submit standard jobs through a user-friendly interface.
Performance and Production Results
The new environment has been in production since September 2016, consistently delivering approximately 20,000 CPU hours per month. In 2017, the cluster successfully processed over 500,000 tasks.
Benchmarking against a traditional Lustre-based system revealed significant performance improvements:
- I/O Throughput: HDFS demonstrated a 10% improvement in write performance and a 2x to 3x increase in read performance compared to Lustre.
- Job Efficiency: For I/O-intensive reconstruction jobs using Medea++, CPU utilization increased from 67% on the traditional system to nearly 100% on the Hadoop cluster. This translates to a 46% improvement in overall job efficiency.
Conclusion and Future Work
The successful integration of Hadoop into the LHAASO workflow demonstrates that commodity big data technologies can effectively support high-scale scientific research when properly adapted. By enabling random access in HDFS and providing transparent MapReduce wrappers, we have significantly reduced I/O bottlenecks.
Ongoing work focuses on developing more robust data migration tools to facilitate the movement of datasets between HDFS and other storage systems like Lustre. Furthermore, we are exploring memory-based computing to further accelerate statistical analysis tasks that exceed the performance capabilities of disk-based I/O.
Summary updated