<!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>SCALABILITY OF THE PARALLEL STRONGIN ALGORITHM IN THE PROBLEM OF OPTIMIZING A MOLECULAR-DYNAMIC FORCE FIELD</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>K. S. Shefov</string-name>
          <email>k.s.shefov@gmail.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>M. M. Stepanova</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>St. Petersburg State University</institution>
          ,
          <addr-line>7-9 University emb, St. Petersburg, 199034</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2018</year>
      </pub-date>
      <fpage>605</fpage>
      <lpage>610</lpage>
      <abstract>
        <p>Strongin's multifactorial global search algorithm (MGSA) allows one to find an absolute minimum of a function of multiple variables on a mesh. In this contribution a parallel program is presented that implements the algorithm above applied to ReaxFF MD force field parameters search. In case of ReaxFF optimization, computation time of an objective function value significantly exceeds time of data exchange between parallel processes. One is able to speed up computation by obtaining not only one but several function values in various points simultaneously. Our software implements two levels of parallelism. To deal with function of multiple variables, one uses a scan for mapping a multi dimensional domain of definition of a function into a one-dimensional segment. To decrease the effect of losing information of multi-dimensional points proximity,  scans are used. Function values in  different mesh points are computed in parallel. This is the first level of parallelism. To define a mesh point of a next iteration, MGSA finds a subinterval with the most probable location of the minimum and computes an objective function value in a certain point of this subinterval. Function values are also calculated in parallel in ( − 1) subintervals with less probability. This is the second level of parallelism. Thus the two levels allow one to compute  ∙  function values in parallel each iteration. In this contribution we research scalability of our MGSA implementation, namely, the dependence of the number of algorithm iterations and time it needs to converge on the number of CPU cores used, separately for each level of parallelism.</p>
      </abstract>
      <kwd-group>
        <kwd>numerical simulation</kwd>
        <kwd>chemically reactive systems</kwd>
        <kwd>reactive force field</kwd>
        <kwd>molecular dynamics</kwd>
        <kwd>parameter optimization</kwd>
        <kwd>parallel algorithm</kwd>
        <kwd>scalability</kwd>
        <kwd>absolute extremum search</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>hardware.</p>
    </sec>
    <sec id="sec-2">
      <title>2. The Problem</title>
      <p>Strongin’s multifactorial global search algorithm (MGSA) allows one to obtain an absolute
minimum of a function of multiple variables on a mesh. This paper investigates scalability of our
parallel MGSA implementation, developed to search for parameters of ReaxFF molecular-dynamic
force field. The feature of the implementation is two-level parallelism. The aim of the work is to
justify the choice of the optimal parameters of the algorithm for a specific calculation on the available
Classical molecular dynamics (MD) method is to numerically solve Newton’s equations for
every atom in a simulated system:   ⃗ = −∇ ( ⃗ ), where  ⃗ are impulses of atoms in the system,  is
time,  ⃗ are coordinates of atoms in the system, and ∇ ( ⃗ ) is a gradient of a force field. The force field
where</p>
      <p>is the domain of parameters search having dimension of  .
depends on a set of parameters:</p>
      <p>=  ( 1,  2, … ,   ). These parameters are defined before the
solution of Newton’s equations and do not alter during the simulation. The procedure of searching the
force field parameters for a particular simulated system is referred to as optimization. The measure of
optimality is the objective function (OF) that depend on the parameters:  ( 1,  2, … ,   ). The OF is
determined by the deviation of any characteristics of the simulated system obtained methods of MD,
from those obtained by other, more accurate methods. The process of optimization is to search the
force field parameters that bring the OF the minimal value:  1∗,  2∗, … ,  ∗ :  ( 1∗,  2∗, … ,  ∗ ) = mi n  ,</p>
    </sec>
    <sec id="sec-3">
      <title>3. ReaxFF Force Field</title>
      <p>As the MD force field  ( ⃗) we use ReaxFF (Reactive Force Field). It is the sum of several
terms, each responsible for their own type of interaction, and has the general formula [1]:
 ReaxFF({  }, {  }, { 
}, { 
}, {</p>
      <p>
        }) =  bond +  lp +  over +  under +  val +  pen +
+  coa +  tors +  conj+  hbond +  vdWaals +  Coulomb.
(
        <xref ref-type="bibr" rid="ref1">1</xref>
        )
The force field depend on the distance between atoms in each atom pair, on angles formed by each
three atoms, on dihedral angles formed by each four atoms, on atoms’ effective charges and bond
orders (BO) between atoms. Atoms’ charges as well as bond orders have non-integer values and
themselves depend on mutual location of the atoms of the system.
      </p>
    </sec>
    <sec id="sec-4">
      <title>4. Objective Function</title>
      <p>
        As the measure of optimality we use the objective function (
        <xref ref-type="bibr" rid="ref2">2</xref>
        ).
 = ∑ =1   | kQC −  kReaxFF| + ∑ =1   + √∑ 


 =1 ∑ =1( kQαCi −  kRαeiaxFF)2
3
(
        <xref ref-type="bibr" rid="ref2">2</xref>
        )
as basis for optimization),
      </p>
      <p>are components of forces acting on every atom of the models,  is the</p>
      <p>
        Here   are potential energies of models of the training-set (simple chemical compounds used
number of models in the training-set,   is the number of atoms in the model  , and   are the weight
factors. Indices QC and ReaxFF mean that the corresponding characteristics are obtained with
quantum chemistry methods and MD methods, respectively.  kReaxFF and  kRαeiaxFF depend on the
parameters  1,  2, … ,   of ReaxFF force field. In our multifactorial algorithm in addition to the main
objective function (
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) we take into account several more functions-restrictions on the individual
groups of terms in (
        <xref ref-type="bibr" rid="ref2">2</xref>
        ). This allows one to set all weights   equal to unity and not to solve the task of
their optimal choice.
      </p>
    </sec>
    <sec id="sec-5">
      <title>5. Strongin Global Search Algorithm</title>
      <p>To optimize the objective function we use Strongin global search algorithm [2] (GSA). It
allows one to find an absolute minimum of a function on a segment and is bases on probability
approach. Initially GSA is formulated for functions of one variable defined on a segment. The OF
 ( ) must satisfy the generalized Lipschitz condition on the entire search domain: | ( 1) −  ( 2)| ≤
 ( 1,  2), where  1 и  2 are any numbers from the search interval,  is a constant, and  is a metric
in the space  1,  ( 1,  2) =  (| 1 −  2|), and the function  has its own inverse  −1. Initial step of
GSA is to compute values of the OF at the boundaries of the search domain and, if necessary, in 
different arbitrary points inside it.</p>
      <p>The general scheme of a single iteration is below.
1. Sort the points of  previous iterations in ascending order of their coordinates:
 =  0 &lt; ⋯ &lt;   &lt; ⋯ &lt;   =  .
2. Compute for every interval (  −1,   ), 1 ≤  ≤  the characteristic  ( ) that defines probability of
finding the minimum on the given interval.
3. Sort  ( ) in descending order:  ( 1) &gt; ⋯ &gt;  (  ).
4. For all the intervals having numbers  1, … ,   ,  &lt;  , compute OF in points   + =  (  ) ∈
(   −1,    ),  = ̅1̅̅,̅̅̅. Computations are done in parallel. Here  (  ) is the position of the
mathematical expectation of a minimum.
5. Check the stop condition: |  1 −   1−1| &lt;  .</p>
      <p>The presented scheme allows one to execute GSA in parallel using  processes. In the
multivariate version of the algorithm a multivariable function is reduced to a function of one variable
by means of scans of the Peano curve type. From here one can obtain another level of parallelism,
applying the method rotating scans [3]. Each parallel process works with its own scan rotated relative
to the main one by the angles ±  in some pair of dimensions. In total one is able to do  · ( − 1) of
2
such rotations for  -dimensional domain of definition of a function. Thus, the maximal number of
processes at this level of parallelism is  max =  · ( − 1) + 1. Each of them executed GSA and at
every iteration communicates its result to all the rest of the processes. Working with several scans
simultaneously compensates consequences of information loss about points proximity when a
multidimensional domain is mapped to a segment.</p>
      <p>In the current work we use the non-injective Peano type curve [2] when every point of a
search domain of dimension  may have up to 2 prototypes on a segment. In this variant GSA the
minimum is being searched on a mesh. The number of mesh points on a segment is 2 ( +1) − 2 .
Here m is the scan parameter that defines its complexity and the number of points of multidimensional
mesh for a single dimension (2 + 1). More about the MGSA in the problem of ReaxFF optimization
see in [4].</p>
    </sec>
    <sec id="sec-6">
      <title>6. Implementation</title>
      <p>The program is written in C++ with use of MPI and has two levels of parallelism: the first one
is parallel work with  scans when mapping the search domain to a segment; the second one is
parallel calculation of the OF value for  greatest probability characteristics  ( ) (see GSA general
scheme). Thus, the program operates with a rectangular matrix of processes of size  ·  .</p>
      <p>Let us note that in case of ReaxFF optimization the computation time of the OF value
significantly exceeds both the data exchange time and the time of all the rest procedures inside a single
MGSA iteration.</p>
      <p>On the first level of parallelism (Figure 1) each block corresponds to a single scan. All 
blocks are equivalent and perform the same sequence of routines, exchanging data between each other
three times every iteration.
ones mean exchange between 2nd-level processes
inside a 1st-level block.</p>
      <p>Notations:</p>
      <p>— search domain points
(type double[D]);   — objective function values
(type double);</p>
      <p>— MGSA indices values (type
int);   — mesh points in segment [0, 1], to which
the serach domain is mapped (type double).</p>
      <p>The triplets {  ,   ,   } are stored in a
special structure which simultaneously is a linked
list for all   , common red-black tree for   , and
separate red-black trees for   with the same   .</p>
      <p>This structure significantly reduces the time of a
single iteration of the algorithm.</p>
    </sec>
    <sec id="sec-7">
      <title>7. Scalability</title>
      <sec id="sec-7-1">
        <title>7.1. Average iteration time depending on the number of cores</title>
        <p>limited
cases</p>
        <p>The first level of parallelism</p>
        <p>has
maximal number of processes. The
= 11 and</p>
        <p>= 4 with averaging over
100 iterations were investigated. In Figure 3
the plots of average time of a single MGSA
iteration dependencies on the number of used
cores 
=  ·</p>
        <p>are shown for 7 different
cases.  is the number of cores on the 1st level
of parallelism, and 
—</p>
        <p>on the 2nd. The
number of OF values calculated in a single
iteration is equal to  . So although the time
of a single iteration increases
with  , the
17
n16
o
ita15
r
e
itA14
S
G13
M
computation of an OF value accelerates. An OF value is computed for several dozens of molecules
with the help of LAMMPS [5] MD simulation library. It takes from 10 to 13 seconds. Each process
consumes less than 100 MB of RAM.</p>
        <p>The chart shows two stages of growth. In the first stage, when 1 ≤ 
≤ 4 (within 1 CPU), the
increase of the duration of a single iteration is due to an increase in the calculation time of the value of
the OF. This is a feature of the hardware and LAMMPS library. In the second stage, when 
&gt; 4, the
increase of duration is caused by overhead costs for data exchange between processes and interaction
with the file system. Let us note that the duration increase does not depend on the distribution of cores
by the levels of parallelism. For</p>
        <p>&lt; 11 the charts’ slopes are smaller, since overheads are declining
with  .</p>
      </sec>
      <sec id="sec-7-2">
        <title>7.2. Defining optimal dimension of the search domain</title>
        <p>and the number of mesh nodes of the order of 106 the mesh on
Let us plot the dependencies of
MGSA acceleration by the number of its
iterations needed for convergence on the
number of parallel processes 
level and the number of scans 
of the 2nd
= 1 for
1 ≤ 
 ( )
 (8), where  ( ) is the number of MGSA</p>
        <p>≤ 5. The acceleration   ( ) =
iterations
needed
for convergence.</p>
        <p>The
number of points of the segment is chosen so
that for different  it is of the same order —
106, and the algorithm converged in less than</p>
        <p>For the case of  = 4 and three fixed
numbers of scans</p>
        <p>= 1, 7, 13 let us compare
the dependency of MGSA acceleration by the
number of iterations   and time   on the
number of cores 
5).   ( ,  ) =</p>
        <p>
          on the 2nd level (Figure
 (
          <xref ref-type="bibr" rid="ref1 ref1">1,1</xref>
          )
 ( , )
,   ( ,  ) =
 (
          <xref ref-type="bibr" rid="ref1 ref1">1,1</xref>
          ) ,
 ( , )
where  ( ,  ) and  ( ,  ) are, respectively,
the
number of
        </p>
        <p>MGSA</p>
        <p>iterations and its
operation time until convergence. In Figure 5
the blue lines indicate the dependencies by
iterations (  ( )), the red lines — by time
(  ( )). Linear approximation
using
least
square method tells us of the constant scalability
efficiency (∆  /∆ ) no matter how many cores
are used. By the difference between the plots of
16
14
12
1
=10
N
,on 8
it
rea 6
l</p>
      </sec>
      <sec id="sec-7-3">
        <title>7.4. Scalability dependence on the objective function</title>
        <p>AI, Group 1
AI, Group 2
AT, Group 1</p>
        <p>AT, Group 2</p>
        <p>
          Analytical formulas of individual
terms of ReaxFF (
          <xref ref-type="bibr" rid="ref2">2</xref>
          ) differ a lot, therefore
when optimizing groups of parameters from
different terms, we will have the OF of a very
different type. In Figure 6 one can see the
dependencies of MGSA acceleration by
iterations and by time on the number of cores
for  = 4,  = 1 when optimizing 4 0 8 16 24 32 40 48 56 64 72 80 88 96 104 112 120 128
parameters form the terms  Coulomb and Number of cores = P
 bond, and 4 — from the term  vdWaals. The Figure 6. MGSA scalability for diff. param. groups
red lines indicate the acceleration by convergence time, the blue ones — by iterations number.
Scalability efficiencies for the first and the second group of parameters, obtained by LSA, are equal to,
respectively, (71.6 ± 1.6) % and (70.2 ± 2.0) %. The values match with accuracy to errors, hence the
effectiveness of this realization is independent of the OF type.
        </p>
      </sec>
    </sec>
    <sec id="sec-8">
      <title>8. Conclusion</title>
      <p>It is shown that the implementation of the multifactorial global search algorithm (MGSA) with
meshes more than 106 nodes and executed on a cluster of 128 cores is scalable with constant efficiency
up to 71 % when the number of optimized parameters  &gt; 2.</p>
      <p>For the given hardware it is optimal to operate with groups of 4 ReaxFF force field
parameters, since MGSA converges in less than an hour.</p>
      <p>It is more efficient to distribute resources to the 2nd level of parallelism with only one scan.</p>
      <p>The introduction of the 2nd level of parallelism (by probability characteristics of MGSA) and
the increase in the number of cores to 128 reduces the calculation time by 30 – 50 times (compared to
the previously used single-level MGSA implementation [6]).</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>K.</given-names>
            <surname>Nomura</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R. K.</given-names>
            <surname>Kalia</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Nakano</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Vashishta</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. L.</given-names>
            <surname>Landa</surname>
          </string-name>
          .
          <article-title>A scalable parallel algorithm for large-scale reactive force-field molecular dynamics simulation // Comp</article-title>
          . Phys.
          <string-name>
            <surname>Comm</surname>
          </string-name>
          .
          <article-title>-</article-title>
          <year>2008</year>
          . - Vol.
          <volume>178</volume>
          (
          <issue>2</issue>
          ). - P.
          <fpage>73</fpage>
          -
          <lpage>87</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Strongin</surname>
            <given-names>R.G.</given-names>
          </string-name>
          <article-title>Chislennye metody v mnogoekstremalnykh zadachakh [Numerical Methods in Multi-Extremal Problems]</article-title>
          . - M.: «Nauka».
          <year>1978</year>
          . - 240 p.
          <article-title>(in Russian)</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>Strongin</surname>
            <given-names>R.G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gergel</surname>
            <given-names>V.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Barkalov</surname>
            <given-names>K.A.</given-names>
          </string-name>
          <article-title>Parallelnye metody resheniya zadach globalnoy optimizatsii [Parallel methods of global optimization</article-title>
          problems solution] // Izvestiya Vuzov. Priborostroenie.
          <article-title>-</article-title>
          <year>2009</year>
          . - Vol.
          <volume>52</volume>
          . - P.
          <fpage>25</fpage>
          -
          <lpage>33</lpage>
          (in Russian).
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <surname>Stepanova</surname>
            <given-names>M.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shefov</surname>
            <given-names>K.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Slavyanov</surname>
            <given-names>S.</given-names>
          </string-name>
          <string-name>
            <surname>Yu</surname>
          </string-name>
          .
          <article-title>Multifactorial global search algorithm in the problem of optimizing a reactive force field // Theoretical</article-title>
          and Mathematical Physics.
          <article-title>-</article-title>
          <year>2016</year>
          . - Vol.
          <volume>187</volume>
          , Issue 1. - P.
          <fpage>603</fpage>
          -
          <lpage>617</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5] LAMMPS package: https://lammps.sandia.
          <source>gov/ (accessed 30.09</source>
          .
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <surname>Shefov</surname>
            <given-names>K.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Stepanova</surname>
            <given-names>M.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kotriakhova</surname>
            <given-names>S.N.</given-names>
          </string-name>
          <article-title>Parametrization of the Reactive MD Force Field for Zn-</article-title>
          <string-name>
            <surname>O-H Systems</surname>
          </string-name>
          // CEUR Workshop Proceedings. -
          <year>2016</year>
          . - Vol.
          <volume>1787</volume>
          . - P.
          <fpage>567</fpage>
          -
          <lpage>572</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>