<!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>Veri cation of BSF Parallel Computational Model</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Nadezhda Ezhova?</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>South Ural State University</institution>
          ,
          <addr-line>Chelyabinsk</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
      </contrib-group>
      <fpage>30</fpage>
      <lpage>39</lpage>
      <abstract>
        <p>The article is devoted to the veri cation of the BSF parallel computing model. The BSF-model is an evolution of the \master-slave" model and SPMD-model. The BSF-model is oriented to iterative algorithms that are implemented in cluster computing systems. The article brie y describes the basics of the BSF-model and its cost metrics. The structure of the BSF program is shown in the form of a UML activity diagram. The simulator of BSF-programs, implemented in C++ language using the MPI-library, is described. The results of computational experiments con rming the adequacy of the cost metrics of the BSF-model are presented.</p>
      </abstract>
      <kwd-group>
        <kwd>parallel computational model</kwd>
        <kwd>BSF</kwd>
        <kwd>Bulk Synchronous</kwd>
        <kwd>Farm</kwd>
        <kwd>scalability</kwd>
        <kwd>parallel e</kwd>
        <kwd>ciency</kwd>
        <kwd>distributed memory multiproces- sors</kwd>
        <kwd>simulation</kwd>
        <kwd>validation</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        The Sunway TaihuLight is the fastest supercomputer in the world according to
the TOP500 List (edition of June 2017) [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. It uses 40,960 processors, each of
which contains 260 processing cores. The total system memory is 1.3 Petabytes;
the peak performance exceeds 120 peta ops. Analysis of the growth
dynamics of the performance of supercomputers (see Fig. 1) shows that in 8-9 years
the most powerful supercomputer becomes an ordinary system, and that in
56 years we can expect the appearance of exascale computing. The emergence
of such powerful multiprocessor computing systems brings to the fore issues
related to the development of frameworks (templates) that allow creating highly
scalable parallel programs oriented to systems with distributed memory. In this
context, the most important problem is the development of parallel
computation models allowing to estimate the scalability of the algorithm at an early
stage of implementing. In paper [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], a new parallel computation model called
BSF (Bulk-Synchronous Farm) was proposed. The BSF-model is an evolution of
the \master-slave" model and focused on iterative algorithms executing on the
cluster computing systems. In this paper, the issue concerning to a veri cation
of the BSF model is discussed. The paper has the following structure. Section 2
is the description of the BSF-model. In Section 3, a cost metric of BSF-model is
given. In Section 4, the simulator of BSF-programs is described and
computational experiments con rming the adequacy of the cost metrics of the BSF-model
are presented. In Section 5, the results are summarized and directions for further
research are outlined.
Parallel computation model BSF (Bulk Synchronous Farm) was proposed in [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
It extends the \Master-slave" paradigm [3{5] and the BSP computational model [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
The BSF-model is oriented on multiprocessor systems. BSF-computer is a set of
homogeneous processor nodes with private memory connected by the network
that provides data transfer from one node to another. Among the processor
nodes, there is one called a master node. The remaining K nodes are called
slaves. BSF-computer must have at least one master node and one slave node
(K 1). The architecture of the BSF-computer is shown in Fig. 2.
      </p>
      <p>Network
M
. . .</p>
      <p>WK</p>
      <p>
        BSF-computer works according to the SPMD programming model [
        <xref ref-type="bibr" rid="ref4 ref7">4, 7</xref>
        ].
BSF-program consists of a sequence of macro-steps and global barrier
synchronizations. Each macro-step is divided into sections of two types: master sections
and slave sections. The order of such sections within the macro-step is not
signi cant. The data processed by the particular slave is determined by the number
of its node. BSF-program includes the following sequential sections (see Fig. 3):
      </p>
      <sec id="sec-1-1">
        <title>Iterative process</title>
        <p>Master Sections Slave Sections</p>
      </sec>
      <sec id="sec-1-2">
        <title>Master Slave</title>
      </sec>
      <sec id="sec-1-3">
        <title>Initialization Initialization</title>
        <sec id="sec-1-3-1">
          <title>Barrier Synchronization</title>
        </sec>
        <sec id="sec-1-3-2">
          <title>Begin of Iterative Process</title>
        </sec>
      </sec>
      <sec id="sec-1-4">
        <title>Sending Receiving</title>
      </sec>
      <sec id="sec-1-5">
        <title>Orders Order</title>
      </sec>
      <sec id="sec-1-6">
        <title>Processing</title>
      </sec>
      <sec id="sec-1-7">
        <title>Sending</title>
      </sec>
      <sec id="sec-1-8">
        <title>Result</title>
      </sec>
      <sec id="sec-1-9">
        <title>Receiving</title>
      </sec>
      <sec id="sec-1-10">
        <title>Results</title>
      </sec>
      <sec id="sec-1-11">
        <title>Output</title>
      </sec>
      <sec id="sec-1-12">
        <title>Finalizing</title>
      </sec>
      <sec id="sec-1-13">
        <title>Master</title>
        <sec id="sec-1-13-1">
          <title>Barrier synchronization</title>
        </sec>
      </sec>
      <sec id="sec-1-14">
        <title>Evaluating</title>
      </sec>
      <sec id="sec-1-15">
        <title>Results</title>
        <sec id="sec-1-15-1">
          <title>End of Iterative Process</title>
        </sec>
      </sec>
      <sec id="sec-1-16">
        <title>Finalizing Slave</title>
        <p>Initialization is a macro-step, during which the master and slaves read or
generate input data. The initialization is completed by a barrier
synchronization. The iterative process repeatedly performs its body until the exit condition
checked by the master becomes true. In the nalization macro-step, the master
outputs the results and ends the program. Body of the iterative process includes
the following macro-steps:
1. sending the order (from master to slaves);
2. processing the order (slaves);
3. receiving the results (from slaves to master);
4. evaluating the results (master).</p>
        <p>In the rst macro-step, the master sends the same orders to all the slaves.
Then, the slaves execute the received orders (the master is idle at that time).
All the slaves execute the same program code but act on the di erent data with
the base address depending on the slave-node number.</p>
        <p>It means that all slaves spend the same time for calculating. During
processing the order, there are no data transfers between nodes. The last is an important
property of the BSF-model. In the third macro-step, all slaves send the results to
the master. After that, global barrier synchronization is performed. During the
last macro-step of iterative process, the master evaluates received results. The
slaves are idle at that time. After result evaluations, the master checks the exit
condition. If the exit condition is true then iterative process is nished, otherwise
the iterative process is continued. The outline of the BSF-program in form of
UML activity diagram is shown in Fig. 4.</p>
        <p>
          The BSF-model was designed for the scalable iterative numerical methods
that have a high computational complexity of iteration with relatively low cost
of communications. A scalable iterative method is a method that allows iteration
to be splitted into subtasks that do not require data exchanges. An example of
such a method can be found in [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ].
3
        </p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>Cost Metric of BSF-Model</title>
      <p>
        The BSF-model provides an analytical estimation of the scalability of a
BSFprogram. The main parameters of the model are [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]:
K: the number of slave-nodes;
L: an upper bound on the latency, or delay, incurred in communicating a
message containing one byte from its source node to its target node;
ts: time that the master-node is engaged in sending one order to one slave-node
excluding the latency;
BSF program
      </p>
      <p>Master</p>
      <p>Start
Reading
Input data
Sending
Orders
tv: time that a slave-node is engaged in execution an order within one iteration
(BSF-model assumes that this time is the same for all the slave-nodes and
it is a constant within the iterative process;
tr: total time that the master-node is engaged in receiving the results from all
the slave-nodes excluding the latency;
tp: total time that the master-node is engaged in evaluating the results received
from all the slave-nodes.</p>
      <p>
        Let s denote tw = K tv - summarized time which is spent by slave-nodes
for order executions (without taking into account the e ect of parallelization).
Then, the upper bound of a BSF-program scalability can be estimated by the
following inequality [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]:
      </p>
      <p>
        The speedup of BSF-program can be calculated by the following equation [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]:
K
r
      </p>
      <p>tw
2L + ts
a =</p>
      <p>K(2L + ts + tr + tp + tw)
K2(2L + ts) + K(tr + tp) + tw
:
(1)
(2)
(3)</p>
      <p>
        One more important property of a parallel program is the parallel e ciency.
The parallel e ciency of a BSF-program can be calculated by the following
approximate equation [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]:
e
      </p>
      <p>1
1 + (K2(2L + ts) + K(tr + tp))=tw
:
4</p>
    </sec>
    <sec id="sec-3">
      <title>Veri cation of BSF-Model</title>
      <p>To verify the cost metrics of the BSF-model, a simulator of BSF-programs
was designed and implemented in C++ with MPI-library. The source code of
the simulator is freely available on Github, at
https://github.com/nadezhdaezhova/BSF-simulator. The simulator uses SPMD-model and includes both the
master and slave sections. The master section is performed if MPI_Comm_rank
returns 0. The slave section is performed if MPI_Comm_rank returns a value
greater than 0. The order is an arbitrary string of speci ed length transferring
from the master to slave by the MPI_Isend command. The slave reads the order
by the MPI_Irecv command. The order processing is simulated by calling the
usleep(tv) function which causes the slave MPI-process to be suspended from
execution until the speci ed number of real-time microseconds has elapsed. After
processing, the master and all the slaves perform global barrier synchronization
by using MPI_Barrier command. As a result, the slave sends to the master
an arbitrary string of speci ed length using MPI_Send command. The master
reads the results of all the slaves by MPI_Recv command. The synchronization
is performed by MPI_Waitall command. Then, the master simulates evaluation
of the results by calling the usleep(tp) function which causes the master
MPIprocess to be suspended from execution until the speci ed number of real-time
microseconds has elapsed.</p>
      <p>To verify the equation (2) determining the speedup, the parameter v =
lg (tw=ts ) connecting the values of tw and ts was introduced. The following
values of the parameter were studied: 4, 4.5 and 6. The speedup curves
plotted using the equation (2), were compared with the curves obtained as a result
of numerical simulations performed via the BSF-simulator. Parameters of the
experiments are given in Table (1).</p>
      <p>Parameter
tr
tp
tw
L</p>
      <p>Semantics
time that the master-node is engaged
in sending one order to one slave-node</p>
      <p>excluding the latency
total time that the master-node is
engaged in evaluating the results received
from all the slave-nodes
total time that slave-nodes are engaged
in execution of an orders
an upper bound on the latency, or
delay, incurred in communicating a
message containing one byte from its
source node to its target node</p>
      <p>The latency value L was obtained experimentally as the transfer time of the
message in 1 byte using the functions MPI_Send and MPI_Recv. The value of
tr corresponds to sending a message with a length of 14 MB. The values of
the parameter ts depends on v and tw. This dependence is determined by the
equation ts = 10 vtw. The corresponding values of the parameter were obtained
by varying the length of the order (see Table (2)).</p>
      <p>
        All the numerical experiments were conducted on the supercomputer
\Tornado SUSU" [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. The veri cation results of equation (2), shown in Fig. 5, show
that the cost metrics of the BSF-model quite well predict the results produced
by the BSF-simulator. In this case, the accuracy of the analytical estimates of
the speedup increases with increasing of the parameter v value.
      </p>
      <p>To verify the equation (3) determining the parallel e ciency, the parameter
q = tp + tr connecting the values of tp and tr was introduced. The following
parameter q values were studied: 0.02, 2 and 20. The parameter tr value was a
constant equal to 0.01, and the parameter tp took values 0.01, 1.99 and 19.99.
The parameter ts was also a constant equal to 0.005. This corresponds to a value
of v equal to 5. The veri cation results of equation (3), shown in Fig. 6, show
that the cost metrics of the BSF-model quite well predict the results produced
by the BSF-simulator. At the same time, the accuracy of analytical estimates of
parallel e ciency increases with increasing parameter q value.</p>
      <p>80
70
60
50
p
u
ed40
e
p
S
30
20
10
0
50
In the paper, the issue of the adequacy of the BSF parallel computing model was
studied. To verify the model, a simulator of BSF-programs in C++ language was
developed using the MPI library. The emulator is implemented on the basis of the
\master-slave" model. As orders, the master sends slaves messages of a certain
length with arbitrary symbols. As a result, slaves are send to the master message
of a certain length with arbitrary symbols. Calculations are simulated using the
usleep() function. Via the simulator, computational experiments were carried
out for various parameters of the BSF-model. The experimental and analytical
0.2
0</p>
      <p>100 150 200
Number of processor nodes
250</p>
      <p>300
1. design a skeleton for the rapid creation of BSF-applications and implement
this framework in C++ using the MPI library;
2. construct a (construct) dialog editor for fast creation of BSF-applications
based on BSF-skeleton;
3. implement some numerical methods using BSF-skeleton.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>TOP500</given-names>
            <surname>Supercomputer</surname>
          </string-name>
          <article-title>Sites</article-title>
          . https://www.top500.org/
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Sokolinsky L</surname>
          </string-name>
          .B.:
          <article-title>Analytical study of the \master-worker" framework scalability on multiprocessors with distributed memory</article-title>
          .
          <source>arXiv:1704</source>
          .05816 [cs.DC].
          <year>2017</year>
          . P.
          <volume>15</volume>
          . http://arxiv.org/abs/1704.05816
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Sahni S.: Vairaktarakis</surname>
            <given-names>G.</given-names>
          </string-name>
          <article-title>The master-slave paradigm in parallel computer and industrial settings</article-title>
          .
          <source>J. Glob. Optim</source>
          .
          <year>1996</year>
          . Vol.
          <volume>9</volume>
          ,
          <issue>3</issue>
          {4. P.
          <volume>357</volume>
          {
          <fpage>377</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Silva</surname>
            <given-names>L.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Buyya</surname>
            <given-names>R.</given-names>
          </string-name>
          :
          <article-title>Parallel programming models and paradigms</article-title>
          .
          <source>High Performance Cluster Computing: Architectures and Systems</source>
          . Vol.
          <volume>2</volume>
          .
          <year>1999</year>
          . P.
          <volume>4</volume>
          {
          <fpage>27</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Leung J.Y.-T.</surname>
          </string-name>
          ,
          <string-name>
            <surname>Zhao</surname>
            <given-names>H.</given-names>
          </string-name>
          :
          <article-title>Scheduling problems in master-slave model</article-title>
          .
          <source>Ann. Oper. Res</source>
          .
          <year>2008</year>
          . Vol.
          <volume>159</volume>
          , 1. P.
          <volume>215</volume>
          {
          <fpage>231</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Valiant</surname>
            <given-names>L.G.</given-names>
          </string-name>
          :
          <article-title>A bridging model for parallel computation</article-title>
          .
          <source>Commun. ACM</source>
          .
          <year>1990</year>
          . Vol.
          <volume>33</volume>
          , 8. P.
          <volume>103</volume>
          {
          <fpage>111</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Darema F</surname>
          </string-name>
          . et al.:
          <article-title>A single-program-multiple-data computational model for EPEX/FORTRAN</article-title>
          . Parallel Comput.
          <year>1988</year>
          . Vol.
          <volume>7</volume>
          , 1. P.
          <volume>11</volume>
          {
          <fpage>24</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Sokolinskaya</surname>
            <given-names>I.</given-names>
          </string-name>
          , Sokolinsky L.B.:
          <article-title>On the Solution of Linear Programming Problems in the Age of Big Data</article-title>
          .
          <source>Parallel Computational Technologies - 11th International Conference, PCT</source>
          <year>2017</year>
          , Kazan, Russia, April 3-
          <issue>7</issue>
          ,
          <year>2017</year>
          , Proceedings (to be published in
          <source>Communications in Computer and Information Science</source>
          , vol.
          <volume>753</volume>
          ).
          <source>arXiv:1706.10030 [cs.DS]</source>
          .
          <year>2017</year>
          . P.
          <volume>15</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Kostenetskiy</surname>
            <given-names>P.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Safonov</surname>
            <given-names>A.Y.</given-names>
          </string-name>
          :
          <article-title>SUSU Supercomputer Resources</article-title>
          .
          <source>Proceedings of the 10th Annual International Scienti c Conference on Parallel Computing Technologies (PCT</source>
          <year>2016</year>
          ).
          <source>CEUR Workshop Proceedings</source>
          . Vol.
          <volume>1576</volume>
          .
          <year>2016</year>
          . P.
          <volume>561</volume>
          {
          <fpage>573</fpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>