<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>PARALLEL FRAMEWORK FOR PARTIAL WAVE ANALYSIS AT BES-III EXPERIMENT</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>V.A. Tokareva</string-name>
          <email>tokareva@jinr.ru</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>I.I. Denisenko</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Laboratory of Nuclear Problems, Joint Institute for Nuclear Research</institution>
          ,
          <addr-line>6 Joliot-Curie, Dubna, Moscow region, 141980</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2017</year>
      </pub-date>
      <fpage>303</fpage>
      <lpage>308</lpage>
      <abstract>
        <p>The most common approach to the partial wave analysis in modern experiments is the event-by-event maximum likelihood fit. Within this approach the analysis of the collected so far statistics at BESIII (more than one billion of  / events) typically requires huge amount of a computational time. Fortunately, the event-by-event analysis can be naturally parallelized. We developed the parallel cross-platform software architecture that can run calculations at various high-performance computing platforms, such as multi-core CPUs, Intel Xeon Phi co-processors, and GPUs. The software supports switching between different minimization algorithms like MINUIT or FUMILI. The wave functions amplitudes are constructed using covariant tensor formalism. Currently, analysis is developed for the J/ψ → K+K-π0 decay channel. The algorithm for caching the intermediate results has been developed, that minimizes the amount of calculations performed in each iteration. Besides, a number of software optimizations has been used, including vectorization, memory access linearization, and data alignment. In future we plan to add the analysis for new reaction channels, the option for combined analysis of several reaction or decay channels and opportunity to adapt our software for use in other experiments.</p>
      </abstract>
      <kwd-group>
        <kwd>partial wave analysis</kwd>
        <kwd>big data</kwd>
        <kwd>heterogeneous computing</kwd>
        <kwd>high-performance computing</kwd>
        <kwd>Xeon Phi</kwd>
        <kwd>GPU</kwd>
        <kwd>minimization algorithms</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Proceedings of the XXVI International Symposium on Nuclear Electronics &amp; Computing (NEC’2017)</p>
    </sec>
    <sec id="sec-2">
      <title>1. Introduction</title>
      <p>Partial wave analysis (PWA) is the technique of studying scattering or decay of hadrons
based on the decomposition of the process amplitude to partial waves. This method is widely used
nowadays in HEP (high energy physics) experiments such as
BESIII, LHCb, COMPASS etc. in
order to search for new and exotic resonances, that can not be seen directly as a peak in the mass
spectrum.</p>
      <p>
        The main objective of the BES-III experiment, which takes place at Beijing Electron–
Positron Collider II (China), is investigating the properties of charmonia and charmed mesons. The
physics program of BESIII includes light hadron spectroscopy in charmonia decays. The typical
process that can be studied in BESIII experiment is the J/ψ →
K K π
+ - 0 decay. For the moment,
(1310.6 ± 7.0) × 106 billions [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] J/ψ events have been accumulated and the number is expected to
rise up to 10 billions.
      </p>
      <p>
        From the other side, the unbinned likelihood PWA method is a computationally expensive
one (see the discussion of PWA cost issues in [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]), and has a number of restrictions related to
minimization issues, which will be considered further. The third point is that models tend to be
complicated, and the larger number of parameters we have, the
more time-consuming the
calculations are.
      </p>
      <p>Thus, performing PWA for the typical J/ψ process mentioned above provides us with a
number of challenges to solve because the expensive calculations have to be performed under the big
data amounts in appropriate time. The widely-used nowadays approach to solution of such kind of
problems is optimization and refactoring of existing algorithms for effective usage on
massiveparallel hardware (GPU, multi-core CPU, Xeon Phi processors, etc.).</p>
      <p>In this article we present the current state of the parallel PWA framework being developed at
DLNP JINR.</p>
    </sec>
    <sec id="sec-3">
      <title>2. Issues of the task and our optimization approach</title>
      <p>
        In our studies used covariant tensor formalism [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] to described partial waves and assumed
that decay amplitude
      </p>
      <p>can be described with the isobar model (i.e. decay amplitude is given by a
sum of resonances for each pair of our final mesons). Our fit model consisted of set of resonances
with masses, width and couplings to be determined in the fit. Given the fit model we can calculate
probability to observe data event  with measured momenta of final particles:</p>
      <p>= |  |2/ ,
space distributed events). Finally log-likelihood  to be minimized is given by
where  is a normalization integral over the phase space ( = ∫ | |2 
) . In following this integral
will be approximated as MC-sum : ∫ | |2</p>
      <p>=  ∑ |  |2 (index  runs over sample of MC phase

= −
= − (∏   ) = − ∑    ,

where the product and the sum are taken over data events. An important feature of this approach is
that detector data selection efficiency can be trivially introduced.</p>
      <p>The classical approach to solving such tasks include using gradient minimization methods
where the values of parameters are being varied on the sequential basis and the numerical value of
the log-likelihood function is being recalculated, respectively. At the end of every step the direction
of next step (i.e. the direction where the function gradient is decreased in the fastest way) is chosen.
In this work, we use the realizations of gradient minimization methods included in the ROOT
framework (see further).</p>
      <p>Since the contributions to the log-likelihood function could be estimated independently for
different events, the task can be naturally parallelized. The data access linearization provides the
decreasing of execution time too, especially for the multi-core devices supporting vector calculations
(modern multi-core CPUs, Intel Xeon Phi coprocessors, etc.). The main formula could be separated
in parts, which can be calculated independently and do not need to be recalculated in case, if there
were no changes in this part parameters on the current step.</p>
      <p>Thus, the properly organized data caching is helpful for decreasing computational costs. The
speed up even increases with the increasing the model complexity (as more parameters mean more
(1)
(2)
cached factors that do not need to be recalculated) and the number of events being analyzed (as the
relative importance of overheads for creating the parallel regions diminishes).</p>
      <p>Performance has been measured with 105 data events and a PHSP sample of data for
normalization consisting of 106 events.</p>
    </sec>
    <sec id="sec-4">
      <title>3. Minimization notes</title>
      <p>
        Minimization of a log likelihood function is a narrow place for any PWA framework
development. Various minimization algorithms have different convergence and demand various
computation times per iteration. It was noticed in [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] that it is exponentially hard to determine
whether the likelihood fit (usually with a large number of free parameters) has found the global
minimum or one of the local ones.
      </p>
      <p>Using the approved and broadly known minimization tools, besides obvious advantages, do
not provide the opportunity to fine-tune the inner work of a minimizer.</p>
      <p>
        Such issues are being solved in different ways at the others PWA projects [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]-[8]. It is quite
typical for the frameworks in this domain to support minimization employing one or two
minimization frameworks. For these and other essential details about PWA frameworks supported
nowadays, see Table 1.
      </p>
      <p>Framework
Fortran PWA
GPUPWA
PyPWA
ComPWA
ROOTPWA
Our framework</p>
      <p>C++
Language
Fortran
C++
Python
C++
C++, Python</p>
    </sec>
    <sec id="sec-5">
      <title>4. Algorithm and realizations</title>
      <p>Presently, the industry of multi-core devices is rapidly developing and almost every
computing device around us already has several cores inside. It is reasonable to assume that proper
use of all computing cores allows one to speed up the execution of the code without losing the quality
of calculations. However, any implementation of the framework aimed at parallel computations
inevitably should deal with the volumes of simultaneously available RAM, the bandwidth of
accessing it, and the resolution of collisions in case of sequential atomic operations. Individual
approach of the developers to solving these issues is implemented through the choice of general
software architecture of the framework, as well as the tools and the platforms for parallelization.</p>
      <p>In our framework we implemented support for two popular solutions for heterogeneous
clusters: either of control CPU and executing GPU or control CPU and executing coprocessor Intel
Xeon Phi of the first generation. Our framework also supports performing multi-threaded
computations on a multi-core CPU — this category, besides CPU nodes present on most modern
computing clusters, includes also the majority of user-end PCs sold nowadays, potentially expanding
the audience of users for our framework.</p>
      <p>Fig. 2 shows the results of comparative testing of the framework on various hardware
platforms: CPU (represented by 2 ×Intel Xeon E5-2695v2), GPU (NVIDIA Tesla K80), and Intel
Xeon Phi (model 5110P, denoted as PHI).</p>
      <p>GPU is deservedly the most popular tool for solving massively-parallel tasks. We can see in
our case it shows the best performance as well. CPU performance is comparable to that of GPU.
Xeon Phi looks like not as effective, probably because it is more sensitive to vectorization issues like
memory alignment. Fine-tuning of the code for a better performance on Phi coprocessors is included
in our future plans.</p>
      <p>For CPU and Phi processors we have taken the numbers of threads, where the system reaches
its maximum performance and/or a plateau. More details on the performance of the parallel algorithm
depending on the number of cores can be seen in Fig. 3-4. We see that the speedup at low amounts of
threads increases almost linearly and reaches plateau at the number of threads that equals
approximately the number of physical CPU cores, meaning that for this task hyper-threading brings
almost no effect since there are almost no I/O operations.</p>
    </sec>
    <sec id="sec-6">
      <title>5. Future plans</title>
      <p>Our priorities involve employing other models and reactions which are typically used in
PWA to support our users with a wide range of predefined analysis patterns.</p>
      <p>We are going as well to increase framework cross-platform stability, providing a big deal of
benchmarks, unit tests and user documentation.</p>
      <p>We are planning to make a comparative study of performance and features for the currently
available PWA frameworks, which is going to bring massive benefits for the community of PWA
users and product developers and advance community searches for the general PWA framework
solution to a new discussion level.</p>
      <p>Additionally speeding up for the calculations could be discussed in terms of lower level code
specifications and searches for new applicable architecture patterns.</p>
      <p>Our priorities also include an implementation of ROOT-independent PWA framework
version (on the base of the stand-alone versions of Minuit and Fumili minimizers).</p>
    </sec>
    <sec id="sec-7">
      <title>6. Acknowledgements</title>
      <p>Authors express their gratitude to the team of HybriLIT heterogeneous cluster for support,
discussions and provided resources.</p>
      <p>We are thankful to the Fumili minimizer authors for the fruitful discussions on optimization
theory and applications.</p>
    </sec>
    <sec id="sec-8">
      <title>7. Conclusion</title>
      <p>The framework for the partial wave analysis, which we are working on, employes data-level
parallelisation of calculations event-by-event maximum likelihood estimation using the benefits of
brand-new high-performance computing hardware (such as fast parallel processing of big amounts of
data and good task scalability). Since during the technical revolution such kind of computational
devices became cheaper and easier-available not only for big organizations, but for personal users as
well, our framework is organized in such a way individual researchers could use it with a maximum
profit.</p>
      <p>The framework architecture is intended for calculations performing on a wide range of
popular multi-core devices, which are multi-core CPUs, Intel Xeon Phi coprocessors, and GPUs.
Minimization is provided on the basis of both Minuit and Fumili minimizers.</p>
      <p>In this research, sensitive architecture principles were discussed, performance benchmarks
for calculations on different types of devices and for different minimization tools were provided for
predefined analysis of the J/ψ → K+K-π0 decay reaction employing the data samples accumulated by
the BES-III experiment.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Ablikim</surname>
            <given-names>M.</given-names>
          </string-name>
          et al.
          <article-title>Determination of the number of J/ψ events with inclusive J/ψ decays</article-title>
          . // Chinese Phys. C,
          <year>2017</year>
          , vol.
          <volume>41</volume>
          , No.
          <volume>1</volume>
          (
          <issue>013001</issue>
          ). DOI:
          <volume>10</volume>
          .1088/
          <fpage>1674</fpage>
          -1137/41/1/013001.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Berger</surname>
            <given-names>N.</given-names>
          </string-name>
          <article-title>Partial Wave Analysis using Graphics Cards</article-title>
          .
          <source>// Proceedings of the XIV International Conference on Hadron Spectroscopy (hadron2011)</source>
          , Munich,
          <year>2011</year>
          , edited by B.
          <string-name>
            <surname>Grube</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          <string-name>
            <surname>Paul</surname>
            , and
            <given-names>N.</given-names>
          </string-name>
          <string-name>
            <surname>Brambilla</surname>
          </string-name>
          , eConf C110613 (
          <year>2011</year>
          ) [arXiv:
          <fpage>1108</fpage>
          .5882v1], pp.
          <fpage>810</fpage>
          -
          <lpage>817</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>Zou</surname>
            <given-names>B.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bugg D</surname>
          </string-name>
          .V.
          <article-title>Covariant tensor formalism for partial wave analyses of ψ decay to mesons</article-title>
          . // arXiv:hep-ph
          <source>/0211457v2. Web. 26 Dec</source>
          <year>2002</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>[4] GPUPWA framework, available at http://sourceforge.net/projects/gpupwa/ [5] ROOTPWA framework, available at http://sourceforge.net/projects/rootpwa/.</mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [6] PyPWA framework, available at https://github.com/JeffersonLab/PyPWA [7] ComPWA framework, available at https://github.com/ComPWA/ComPWA [8]
          <article-title>Model-independent partial wave analysis using a massively-parallel fitting framework</article-title>
          . //submitted to the
          <source>proceedings of the 22nd International Conference on Computing in High Energy and Nuclear Physics, CHEP</source>
          <year>2016</year>
          , arXiv:
          <fpage>1703</fpage>
          .03284v1.
          <source>Web.19 Feb</source>
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [9]
          <string-name>
            <surname>James</surname>
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Roos</surname>
            <given-names>M</given-names>
          </string-name>
          .
          <article-title>Minuit - a system for function minimization and analysis of the parameter errors and correlations</article-title>
          . //Comp. Phys.
          <source>Communications</source>
          , vol.
          <volume>10</volume>
          (
          <year>1975</year>
          ), pp.
          <fpage>343</fpage>
          -
          <lpage>367</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [10]
          <string-name>
            <surname>Dymov</surname>
            <given-names>S. N.</given-names>
          </string-name>
          et al. Constrained minimization in C++ environment. // Nucl. Instrum.
          <source>Meth. A440</source>
          ,
          <fpage>431</fpage>
          -
          <lpage>437</lpage>
          (
          <year>2000</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [11] PyFit, available at http://www.stsci.edu/institute/software_hardware/pyfits/Download [12]
          <article-title>Geneva optimisation tools</article-title>
          , available at https://www.gemfony.eu/index.php?id=geneva
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>