FQL: An Extensible Feature Query Language and Toolkit on Searching Software Characteristics for HPC Applications

Weijian Zheng, Dali Wang, Fengguang SongarXiv 2019 · arXiv

TL;DR

Researchers have developed the Feature Query Language (FQL), a domain-specific language and toolkit designed to automatically extract technical characteristics from large-scale scientific software. By performing rapid static code analysis, FQL allows developers and decision-makers to quickly identify a project's dependencies, programming models, and hardware requirements without manual code audits.

What Problem Does This Paper Address?

The ecosystem of open-source scientific software is exploding, particularly in High-Performance Computing (HPC). Modern scientific codes—used for everything from climate modeling to material science—are massive, complex, and riddled with specific hardware and library dependencies.

For a researcher or manager, evaluating a new software package is a daunting task. Does it support MPI one-sided communication? Is it ready for NVIDIA GPUs via CUDA? Does it use OpenMP for multi-threading? Existing tools like ScanCode or Fossology focus narrowly on licenses and copyrights, leaving a gap for a "universal interface" that can query any technical feature of a codebase.

Methods

The authors introduce a two-part solution: the Feature Query Language (FQL) and a corresponding Toolkit.

The Language

FQL uses a SQL-like syntax to define what to look for. A typical clause looks like this: CHECK (keyword_phrase) WHERE (file_extension_phrase) AS (feature_name_phrase)

For example, to check for OpenMP usage, a user might query for the string #pragma omp.

The Toolkit

The toolkit processes these queries through a four-stage pipeline:

  1. Lexical Analyzer: Breaks the FQL query into basic tokens.
  2. Semantic Analyzer: Translates tokens into specific keywords (e.g., identifying that #pragma omp indicates the "OpenMP" feature).
  3. Keywords Scanner: Performs a fast static scan of the source code to find these keywords.
  4. Result Generator: Compiles the findings into a human-readable report.
Figure 1: Software components for parsing and executing a single FQL query. The com- ponents above the dotted line are user input and output.

Datasets

The researchers evaluated their toolkit using several large-scale HPC scientific codes. The primary case study presented is QMCPack, a quantum Monte Carlo package used in the Department of Energy’s Exascale Computer Project. They also mention harvesting features from projects within the INCITE program and Earth System Modeling initiatives.

Key Insights and Ideas

  • Extensibility is King: Unlike hard-coded scanners, FQL is designed to be extended. If a new programming model emerges, users simply add a new FQL sentence to the repository rather than rewriting the tool.
  • Bridging the Abstraction Gap: FQL allows users to ask high-level questions (e.g., "What MPI process topologies are used?") and maps them to low-level code patterns (e.g., searching for MPI_CART_Create or MPI_GRAPH_Create).
  • Static Analysis Efficiency: By focusing on keyword scanning rather than full code compilation or execution, the tool provides a "quick" evaluation suitable for scanning massive repositories like GitHub or Bitbucket.
Table 1: Examples of HPC feature related frequently asked questions and corresponding queries

Key Results

The toolkit successfully mapped the complex architecture of QMCPack. As shown in the results table, FQL automatically identified that the software:

  • Requires MPI 2.0 and supports one-sided communication.
  • Uses a hybrid MPI/OpenMP programming model.
  • Is CUDA-ready for both single and double precision on multiple GPUs.
  • Combines C99 and Fortran 2003 standards.
Table 2: HPC features of the QMCPack

Limitations and Future Work

While the paper focuses heavily on HPC-specific features, the authors acknowledge that FQL is currently a "first version."

  • Keyword Reliance: The current implementation relies on keyword matching. While fast, this might miss features if the code uses unusual naming conventions or wrappers that hide standard API calls.
  • Generalization: The authors suggest the toolkit can be extended to general software features (like coding patterns or portability), but these applications weren't the primary focus of this study.
  • Future Directions: Promising directions include expanding the query repository to cover more diverse software domains beyond scientific computing.

Summary updated

Abstract

The amount of large-scale scientific computing software is dramatically increasing. In this work, we designed a new language, named feature query language (FQL), to collect and extract software features from a quick static code analysis. We designed and implemented an FQL toolkit to automatically detect and present the software features using an extensible query repository. Several large-scale, high performance computing (HPC) scientific codes have been used in the paper to demonstrate the HPC-related feature extraction and information collection. Although we emphasized the HPC features in the study, the toolkit can be easily extended to answer general software feature questions, such as coding pattern and hardware dependency.
BibTeX
@misc{zheng2019fql,
  author = {Weijian Zheng and Dali Wang and Fengguang Song},
  title = {{FQL: An Extensible Feature Query Language and Toolkit on Searching Software Characteristics for HPC Applications}},
  year = {2019},
  eprint = {1905.09364},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1905.09364},
}
Figure