<!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>Web Environment for Program Analysis and Transformation onto Reconfigurable Architectures</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>A.P. B</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Southern Federal University</institution>
          ,
          <addr-line>Rostov-on-Don 344006</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
      </contrib-group>
      <fpage>49</fpage>
      <lpage>58</lpage>
      <abstract>
        <p>Experience of designing different versions of web-based development environment (IDE) for Optimizing parallelizing system and compiler onto reconfigurable architecture is described. Designed system is based on existing tools and frameworks such as Jupyter Notebook and Eclipse Che. Set of requirements for Optimizing parallelizing system components is developed to make it possible to integrate them into web-based development environment accessible through the Internet. Designing portable environment for compiler development, compiler technology demonstration and teaching parallel program development is also described. Newly developed program transformations are shown to be used during program optimizations for FPGA inside the designed web environment. Means of program transformation visualization are described for use with Jupyter Notebook. The work shown demonstrates possibility to organize remote access to library of instruments and tools for program optimizations currently under development that would be convenient for application developers.</p>
      </abstract>
      <kwd-group>
        <kwd>Integrated Development Environment</kwd>
        <kwd>Program Transformations</kwd>
        <kwd>Parallelizing Compiler</kwd>
        <kwd>Containerization</kwd>
        <kwd>Wed IDE</kwd>
        <kwd>Cloud Computing</kwd>
        <kwd>FPGA</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>During development of a complex software system, like an optimizing compiler as an
example, multitude of problems arise that concern overall organization of
development process, deployment and usage of developed system. Complexities arise as well
with regards to training and inclusion of new developers, organizing outside access to
experimental results, like performing demonstrations of particular functions.</p>
      <p>Problems that arise are in many ways similar to those that are faced by
programmers not familiar with software development for field-programmable gate arrays, as it
requires using complex development environments.</p>
      <p>At present moment systems that allow to directly transform high level language
programs into low-level hardware description for FPGA are either not sufficiently
developed or not sufficiently widespread. To alleviate this problem it is sensible to
organize remote access to such systems as they are being developed through Internet
in form browser accessible integrated development environment, that is
complemented with particular extensions that allow developers to iteratively modify their program
and resulting low level hardware description, interactively estimate their
characteristics. This approach could help solve some of urgent problems that more and more
application developers are facing in their first attempts to develop software targeting
FPGA.</p>
      <p>Lets note main problems and goals considered in this work:
1. Rapid deployment of developer environment that includes all necessary tools for
new member of developer team or new client for the system.
2. Remote delivery of intuitive and simple dialogue-based interface that allows
developer to create hardware description for FPGA from source program.
3. Development of tools to aid demonstration of certain new features of compiler that
is being developed.
4. Using proposed web environment and parts of compiler system for teaching
software development and parallel programming.
5. Using parts, select functions of system being developed in scientific research
which requires ease of access to experimental findings, results and convenience of
reproduction.</p>
      <p>
        Earlier some web interfaces were developed for demonstration of Optimizing
parallelizing system capabilities [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] and some of its functions [
        <xref ref-type="bibr" rid="ref2 ref3">2, 3</xref>
        ]. Overall view of first
version of such interface is show on Fig. 1.
This kind of interface allows user to upload program source code, choose an action
from predefined set of options (program transformations, automatic parallelization,
etc.), perform chosen action on remote server and download resulting source code of
transformed program.
      </p>
      <p>This way of using web access solves only problem #2, however only partially. User
has no ability to directly manage what system does and tweak any parameters, while
developer has to create specially crafted scenarios for using the system.</p>
      <p>This work states the problem of developing more universal and flexible
development environment (software service) that would be accessible remotely through
Internet and would have useful properties:
1. Service would be based on currently available tools from cloud computing
industry, open source software-as-a-service packages and cloud IDEs.
2. Service would solve all of the stated problems to some extent.
3. Service would not require any extra effort for functionality maintenance from
developers as they modify and develop underlying compiler itself while it is being
updated.</p>
      <p>
        Compiler onto reconfigurable computer architecture is being developed based on
OPS [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] by a team that this work’s author is a part of and all stated problems are
especially pertinent to that compiler. Therefore approaches that are described here are
meant first and foremost to be applied to that project.
      </p>
      <p>Main results of this work include, firstly, new architectural requirements for
Optimizing parallelizing system and its components that are gradually adopted in it to
allow creation of program optimization tools based on it and creation of education
tools for parallel programming and showcasing program optimizations for FPGA
programming. Secondly, another outcome of this work is a prototype of web-based
development environment for program transformation onto FPGA that is based on
OPS and available open-source cloud IDEs.</p>
      <p>Further content of this paper is as follows. More detailed requirements for compiler
components to facilitate creation of web IDE based on said compiler are described in
section “Problem statement”. Section “Jupyterlab employment for OPS” describes
approach to create interactive development environment for OPS based on interactive
browser-based scientific notebooks and C++ language. Section “Results” describes
most important modifications that allow to create minimally functional development
environment for experimenting with program transformations onto FPGA based on
compiler components.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Problem Statement</title>
      <p>In cloud computing industry there exists multitude of widely employed web-oriented
development environments with open source code that allow to make extensions for
any particular field of study or subject area, for example to support new programming
languages, management of supercomputer clusters, etc.</p>
      <p>
        Eclipse Che [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] should be noted in particular, as it has architecture that allows to
solve almost all problems that were stated in introduction:
1. Creation and employment of containerised workspaces for system’s developers
using docker solves rapid deployment problem by easily creating workspaces with
repeatable characteristics from recipies.
2. Extensible API for development environment management solves the problem of
making convenient demonstration scenarios for particular functions of the system.
3. Possibility to create extensions to all architectural components of the system allows
to add new representations and views to demonstrate important functions and
visualize results.
      </p>
      <p>However, using this particular software as a basis for specialized cloud
development environment requires modifications done to Eclipse Che itself as well as to the
compiler.</p>
      <p>Generally, modifications necessary would include:
1. Separating compiler pipeline into stages with possibility to export and visualize
intermediate results between stages
2. Adding new representations to IDE interface and corresponding methods for
workspace API.
3. Creation of set of containers to run compiler and its parts inside predefined
environment.
4. Refactor compiler source code to loosen tight relations between modules to make it
easier to use them inside cloud-based IDE.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Jupyterlab Employment for OPS</title>
      <p>
        Jupyterlab [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] is currently the simplest and most well supported tool to organize
interactive access to computations with rich data representations and diverse set of
compatible technologies. Jupyterlab is a web application and set of language-specific tools
that support multitude of programming languages including C++ with use of
XeusCling [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. This allows to offer easy access to all components of OPS using
interactive notebooks in web browser, as illustrated on Fig. 2.
      </p>
      <p>Because it is actually possible in Jupyterlab to use interactive notebooks with the
same programming language that OPS itself is written in, usage scenarios for various
typical use cases and user types could be written easily.</p>
      <p>Now to allow different users access to different scenarios it is enough to create set
of interactive notebooks that would offer following:
1. Examples of how to use key functions of the system, for example working with
internal representation, performing program transformation, which is especially
useful for educational purposes.
2. Allow users to perform experiments with examining performance effects and other
changes made by different program transformations for sample program using
external services for testing, performance analysis, etc.
3. Simple and convenient interface for system’s developers to exchange results of
their work, data, test results and examples.
JupyterLab allows to use several cell data formats that allow visualization of data of
any type. To visualize results of program transformations it is needed to process
following types of data:
1. Program source code in plain text format or with complex notes for operators,
variable occurrences, etc., which HTML is the most convenient format to use.
2. Program code with associated graph representation that have variable occurrences,
expressions or operators as nodes, which SVG graphics can represent.
3. Tabular data such as test results, performance measurements, source code metrics,
all of which could be represented with Markdown formatted text.
4. Graph representations of source code that are particularly complex, such as lattice
graph for multidimensional loop nest, that could be represented with a bitmap.</p>
      <p>It is most convenient to use HTML to represent source code of initial program and
its version after transformation as shown on Fig. 3, which illustrates 2 results of
similar source code fragment detection for the purpose of adding new instructions to
softcore CPU. Apart from marking operators by color it is possible to use interactive
control elements. Using text data formats such as HTML or SVG makes developing
many specific visualizations and passing results around easier.</p>
    </sec>
    <sec id="sec-4">
      <title>Program transformation results</title>
      <p>During development and testing of optimizing program transformations in Optimizing
parallelizing system it is useful to have flexible development environment to test
transformations alone and in sequence and estimate their applicability for mapping
programs onto FPGA. This environment needs to facilitate display of results,
inclusion of samples into documentation. Using JupyterLab with specifically developed
extensions that are assembled into integral system satisfied these requirements. Fig. 4
illustrates how program transformations are ran for simple programs, particularly for
transformation that forms C function into macro-definition of operation set extension
in TCE co-design environment.</p>
      <p>Examples like these allow to expand documentation for OPS compiler, make
source code more self-documenting, add to unit tests and integration tests and create
easy to use scenarios for different modules, functions and transformation pipelines.
This allows to easily perform experiments with parts of the system, develop and test
new sequences of program transformations.
6</p>
    </sec>
    <sec id="sec-5">
      <title>Results</title>
      <p>
        To solve previously stated problems we have introduced following improvements and
additions to OPS:
1. Set of container images to facilitate reliable and repeatable builds of OPS itself and
of tools based on it, as well as to simplify execution of OPS tools and compiler for
sample programs.
2. Extra services to test performance of transformed C language programs similar to
earlier developed black box testing system [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], to simulate execution of hardware
description for FPGA that was produced by OPS compiler.
3. Compiler internal working process is split into separate stages that could be
managed:
a. Choosing what parts of program to map onto FPGA could be fully automatic of
performed by user via adding pragmas around target fragments.
b. Compiler accepts a set of input parameters that describe what actions to
perform.
c. Possible OPS compiler actions include export of intermediate results for
analysis and visualization, generating output program, etc.
4. For several OPS compiler functions corresponding views for data visualization
inside IDE are created, for example for examining static profiler results [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] and for
common pipeline construction function [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ].
      </p>
      <p>Fig. 5 shows a set of main OPS modules that implement independent plugins. This
allows to offer access to only limited set of interfaces to the end user, as well as speed
up and simplify system build and its deployment.
Further work is being done in two main directions:
1. Support for using compiler source code inside cloud-based IDE to make
compiler development more convenient.
2. Adding functionality to specialized web IDE that allows to use the compiler
and its modules.</p>
      <p>Now to start working with OPS source code and OPS compiler it is enough to
simply open a given URL inside web browser after which a fresh workspace will be
created for the user with full configured development environment. This makes it easy
to introduce users to the system and its source code and lowers amount of time needed
for setup, helps in education environment.
7</p>
    </sec>
    <sec id="sec-6">
      <title>Conclusion</title>
      <p>Specialized tools for easy development, employment and educational use of complex
software systems could be created on top of modern cloud-based integrated
development environments.</p>
      <p>To develop functionally sound web-based development environment based on
retargetable compiler it is necessary to solve multiple problems with regards to source
code modularity, managing system’s external dependencies, making it more portable
and developing flexible programming interfaces for accessing its functions. Solving
these problems allows to make system development easier as well as allow more
convenient use of it, including using it as educational tool for teaching software
programming and demonstrating its key capabilities, visualization of experimental data
for web IDE users in interactive form.</p>
      <p>The reported study was funded by RFBR according to the research project No
1837-00179.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <article-title>Optimizing parallelizing system URL: www</article-title>
          .ops.rsu.
          <source>ru (date of access: 25.07</source>
          .19).
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Shteinberg</surname>
            ,
            <given-names>B.Ia.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Allazov</surname>
            ,
            <given-names>A.N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Alymova</surname>
            ,
            <given-names>E.V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Baglii</surname>
            ,
            <given-names>A.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Guda</surname>
            ,
            <given-names>S.A</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dubrov</surname>
            ,
            <given-names>D.V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kravchenko</surname>
            ,
            <given-names>E.N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Morylev</surname>
            ,
            <given-names>R.I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Roshal</surname>
            ,
            <given-names>A.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Iurushkin</surname>
            ,
            <given-names>M.V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shteinberg</surname>
          </string-name>
          , R.B.:
          <article-title>Weborientirovannyi avtomaticheskii rasparallelivatel program</article-title>
          . In:
          <article-title>Parallelnye vychislitelnye tekhnologii (PAVT'</article-title>
          <year>2014</year>
          ),
          <article-title>Trudy mezhdunarodnoi nauchnoi konferentsii, Rostov-na-</article-title>
          <string-name>
            <surname>Donu</surname>
          </string-name>
          (
          <year>2014</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Alymova</surname>
            ,
            <given-names>E.V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kravchenko</surname>
            ,
            <given-names>E.N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Morylev</surname>
            ,
            <given-names>R.I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Iurushkin</surname>
            ,
            <given-names>M.V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shteinberg</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          <string-name>
            <surname>Ia</surname>
          </string-name>
          .:
          <article-title>Rasparallelivanie i optimizatsiia programm s pomoshchiu Web-uskoritelia ORS</article-title>
          . In:
          <article-title>Nauchnyi servis v seti Internet: poisk novykh reshenii, Trudy XIV Mezhdunarodnoi superkompiuternoi konferentsii</article-title>
          , Moscow, Izd-vo
          <string-name>
            <surname>MGU</surname>
          </string-name>
          (
          <year>2012</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Steinberg</surname>
            ,
            <given-names>B.Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bugliy</surname>
            ,
            <given-names>A.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dubrov</surname>
            ,
            <given-names>D.V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mikhailuts</surname>
            ,
            <given-names>Y.V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Steinberg</surname>
            ,
            <given-names>O.B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Steinberg</surname>
          </string-name>
          , R.B.:
          <article-title>A Project of Compiler for a Processor with Programmable Accelerator</article-title>
          .
          <source>Procedia Computer Science</source>
          ,
          <volume>101</volume>
          ,
          <fpage>435</fpage>
          -
          <lpage>438</lpage>
          (
          <year>2016</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5. Localhost is Killing Software Delivery.Codenvy blog https://blog.codenvy.com/localhostis-killing
          <source>-software-delivery-8c93cd49328, last accessed</source>
          <year>2019</year>
          /11/21.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Shteinberg</surname>
            ,
            <given-names>B.Ia.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Alymova</surname>
            ,
            <given-names>E.V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Baglii</surname>
            ,
            <given-names>A.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Morylev</surname>
            ,
            <given-names>R.I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nis</surname>
            ,
            <given-names>Z.Ia.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Petrenko</surname>
            ,
            <given-names>V.V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shteinberg R</surname>
          </string-name>
          .B.:
          <article-title>Avtomatizatsiia testirovaniia elementov vysokoproizvoditelnogo programmnogo kompleksa. Nauchnyi servis v seti Internet: masshtabiruemost, parallelnost, effektivnost. Trudy Vserossiiskoi superkompiuternoi konferentsii (21-26 sentiabria 2009g</article-title>
          ., g.
          <source>Novorossiisk)</source>
          , pp.
          <fpage>287</fpage>
          -
          <lpage>292</lpage>
          , Moscow, Izd-vo
          <string-name>
            <surname>MGU</surname>
          </string-name>
          (
          <year>2009</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Poluian</surname>
            ,
            <given-names>S.V.</given-names>
          </string-name>
          :
          <article-title>Profilirovanie i ego primenenie v dialogovom optimiziruiushchem rasparallelivatele. Nauchnyi servis v seti Internet: superkompiuternye tsentry i zadachi: Trudy Mezhdunarodnoi superkompiuternoi konferentsii</article-title>
          ,
          <fpage>652</fpage>
          -
          <lpage>653</lpage>
          , Moscow, Izd-vo
          <string-name>
            <surname>MGU</surname>
          </string-name>
          (
          <year>2010</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Baglii</surname>
            ,
            <given-names>A.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dubrov</surname>
            ,
            <given-names>D.V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shteinberg</surname>
            ,
            <given-names>B.Ia.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shteinberg</surname>
          </string-name>
          , R.B.:
          <article-title>Povtornoe ispolzovanie resursov pri konveiernykh vychisleniiakh. Nauchnyi servis v seti Internet: trudy XIX Vserossiiskoi nauchnoi konferentsii</article-title>
          , pp.
          <fpage>43</fpage>
          -
          <lpage>46</lpage>
          , Moscow, IPM im. M.V.
          <string-name>
            <surname>Keldysha</surname>
          </string-name>
          (
          <year>2017</year>
          ), https://doi.org/10.20948/abrau-2017.
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Kluyver</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          et al.:
          <article-title>Jupyter Notebooks - a publishing format for reproducible computational workflows</article-title>
          . Positioning and Power in Academic Publishing: Players, Agents and Agendas, IOS Press Ebooks, pp.
          <fpage>87</fpage>
          -
          <lpage>90</lpage>
          (
          <year>2016</year>
          ), https://doi.org/10.3233/978-1-
          <fpage>61499</fpage>
          -649-1-87.
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <article-title>Xeus-cling project on Github</article-title>
          , https://github.com/QuantStack/xeus-cling,
          <source>last accessed</source>
          <year>2019</year>
          /11/21.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>