<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.3 20210610//EN" "JATS-journalpublishing1-3.dtd">
<article article-type="research-article" dtd-version="1.3" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xml:lang="ru"><front><journal-meta><journal-id journal-id-type="publisher-id">mais</journal-id><journal-title-group><journal-title xml:lang="ru">Моделирование и анализ информационных систем</journal-title><trans-title-group xml:lang="en"><trans-title>Modeling and Analysis of Information Systems</trans-title></trans-title-group></journal-title-group><issn pub-type="ppub">1818-1015</issn><issn pub-type="epub">2313-5417</issn><publisher><publisher-name>Yaroslavl State University</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.18255/1818-1015-2021-2-198-214</article-id><article-id custom-type="elpub" pub-id-type="custom">mais-1488</article-id><article-categories><subj-group subj-group-type="heading"><subject>Research Article</subject></subj-group><subj-group subj-group-type="section-heading" xml:lang="ru"><subject>Theory of Computing</subject></subj-group></article-categories><title-group><article-title>Трансформация функционально-потоковых параллельных программ в императивные</article-title><trans-title-group xml:lang="en"><trans-title>The System for Transforming the Code of Dataflow Programs into Imperative</trans-title></trans-title-group></title-group><contrib-group><contrib contrib-type="author" corresp="yes"><contrib-id contrib-id-type="orcid">https://orcid.org/0000-0002-3340-6678</contrib-id><name-alternatives><name name-style="eastern" xml:lang="ru"><surname>Васильев</surname><given-names>Владимир Сергеевич</given-names></name><name name-style="western" xml:lang="en"><surname>Vasilev</surname><given-names>Vladimir S.</given-names></name></name-alternatives><email xlink:type="simple">vsvasilev@sfu-kras.ru</email><xref ref-type="aff" rid="aff-1"/></contrib><contrib contrib-type="author" corresp="yes"><contrib-id contrib-id-type="orcid">https://orcid.org/0000-0002-5487-0699</contrib-id><name-alternatives><name name-style="eastern" xml:lang="ru"><surname>Легалов</surname><given-names>Александр Иванович</given-names></name><name name-style="western" xml:lang="en"><surname>Legalov</surname><given-names>Alexander I.</given-names></name></name-alternatives><email xlink:type="simple">alegalov@hse.ru</email><xref ref-type="aff" rid="aff-2"/></contrib><contrib contrib-type="author" corresp="yes"><contrib-id contrib-id-type="orcid">https://orcid.org/0000-0002-2115-5461</contrib-id><name-alternatives><name name-style="eastern" xml:lang="ru"><surname>Зыков</surname><given-names>Сергей Викторович</given-names></name><name name-style="western" xml:lang="en"><surname>Zykov</surname><given-names>Sergey V.</given-names></name></name-alternatives><email xlink:type="simple">szykov@hse.ru</email><xref ref-type="aff" rid="aff-2"/></contrib></contrib-group><aff-alternatives id="aff-1"><aff xml:lang="ru"><institution>Сибирский федеральный университет</institution><country>Россия</country></aff><aff xml:lang="en"><institution>Siberian Federal University</institution><country>Russian Federation</country></aff></aff-alternatives><aff-alternatives id="aff-2"><aff xml:lang="ru"><institution>Национальный исследовательский университет «Высшая школа экономики»</institution><country>Россия</country></aff><aff xml:lang="en"><institution>Higher school of Economics, National research University</institution><country>Russian Federation</country></aff></aff-alternatives><pub-date pub-type="collection"><year>2021</year></pub-date><pub-date pub-type="epub"><day>11</day><month>06</month><year>2021</year></pub-date><volume>28</volume><issue>2</issue><fpage>198</fpage><lpage>214</lpage><permissions><copyright-statement>Copyright &amp;#x00A9; Васильев В.С., Легалов А.И., Зыков С.В., 2021</copyright-statement><copyright-year>2021</copyright-year><copyright-holder xml:lang="ru">Васильев В.С., Легалов А.И., Зыков С.В.</copyright-holder><copyright-holder xml:lang="en">Vasilev V.S., Legalov A.I., Zykov S.V.</copyright-holder><license xml:lang="ru" license-type="creative-commons-attribution" xlink:href="https://creativecommons.org/licenses/by/4.0/" xlink:type="simple"><license-p>Данная работа распространяется под лицензией Creative Commons Attribution 4.0.</license-p></license><license xml:lang="en" license-type="creative-commons-attribution" xlink:href="https://creativecommons.org/licenses/by/4.0/" xlink:type="simple"><license-p>This work is licensed under a Creative Commons Attribution 4.0 License.</license-p></license></permissions><self-uri xlink:href="https://www.mais-journal.ru/jour/article/view/1488">https://www.mais-journal.ru/jour/article/view/1488</self-uri><abstract><p>Функционально-потоковая парадигма параллельного программирования ориентирована на разработку параллельных переносимых программ. Исходный код функционально-потоковых программ транслируется в набор графов, отражающих информационные и управляющие зависимости. Основным способом их исполнения является интерпретация, что не позволяет эффективно выполнять вычисления на реальных параллельных вычислительных системах и ведет к низкой производительности. Для непосредственного выполнения программ на существующих вычислительных системах требуется использование специфических методов оптимизации и трансформации, учитывающих особенности как языка программирования, так и архитектуры исполнителя. В настоящее время наиболее распространенной является архитектура Фон-Неймана, параллельное программирование для которой в большинстве случаев осуществляется с использованием языков, поддерживающих императивный стиль и ориентированных на статическую систему типов. Для различных архитектур параллельных вычислительных систем существуют разнообразные подходы к написанию параллельных программ. Трансформация функционально-потоковых параллельных программ в императивные позволяет сформировать общий каркас из фрагментов императивного кода, непосредственно отображающих последовательные вычисления, который в дальнейшем может быть адаптирован к конкретной параллельной архитектуре. В работе рассматривается подход к выполнению такого типа трансформации, заключающийся в выделении фрагментов функционально-потоковых параллельных программ в качестве шаблонов, заменяемых впоследствии на эквивалентные фрагменты императивных языков. Предлагаемые методы трансформации позволяют порождать программный код, к которому в дальнейшем можно применять различные оптимизирующие преобразования, включая распараллеливание с учетом целевой архитектуры.</p></abstract><trans-abstract xml:lang="en"><p>Functional dataflow programming languages are designed to create parallel portable programs. The source code of such programs is translated into a set of graphs that reflect information and control dependencies. The main way of their execution is interpretation, which does not allow to perform calculations efficiently on real parallel computing systems and leads to poor performance. To run programs directly on existing computing systems, you need to use specific optimization and transformation methods that take into account the features of both the programming language and the architecture of the system. Currently, the most common is the Von Neumann architecture, however, parallel programming for it in most cases is carried out using imperative languages with a static type system. For different architectures of parallel computing systems, there are various approaches to writing parallel programs. The transformation of dataflow parallel programs into imperative programs allows to form a framework of imperative code fragments that directly display sequential calculations. In the future, this framework can be adapted to a specific parallel architecture. The paper considers an approach to performing this type of transformation, which consists in allocating fragments of dataflow parallel programs as templates, which are subsequently replaced by equivalent fragments of imperative languages. The proposed transformation methods allow generating program code, to which various optimizing transformations can be applied in the future, including parallelization taking into account the target architecture.</p></trans-abstract><kwd-group xml:lang="ru"><kwd>трансформация программ</kwd><kwd>функционально-потоковое параллельное программирование</kwd><kwd>анализ программ</kwd><kwd>типизация</kwd><kwd>промежуточные представления программ</kwd></kwd-group><kwd-group xml:lang="en"><kwd>transformation of programs</kwd><kwd>dataflow parallel programming</kwd><kwd>program analysis</kwd><kwd>typing</kwd><kwd>intermediate program representations</kwd></kwd-group></article-meta></front><back><ref-list><title>References</title><ref id="cit1"><label>1</label><citation-alternatives><mixed-citation xml:lang="ru">K. Vivek, Parallel Computing Architectures and APIs: IoT Big Data Stream Processing. 2019.</mixed-citation><mixed-citation xml:lang="en">K. Vivek, Parallel Computing Architectures and APIs: IoT Big Data Stream Processing. 2019.</mixed-citation></citation-alternatives></ref><ref id="cit2"><label>2</label><citation-alternatives><mixed-citation xml:lang="ru">I. I. Levin, A. I. Dordopulo, and V. A. Gudkov, “Programming of reconfigurable computing nodes in the COLAMO language,” Training manual. Taganrog: Publishing house of TTI SFEDU. In Russian, 2011.</mixed-citation><mixed-citation xml:lang="en">I. I. Levin, A. I. Dordopulo, and V. A. Gudkov, “Programming of reconfigurable computing nodes in the COLAMO language,” Training manual. Taganrog: Publishing house of TTI SFEDU. In Russian, 2011.</mixed-citation></citation-alternatives></ref><ref id="cit3"><label>3</label><citation-alternatives><mixed-citation xml:lang="ru">A. I. Dordopulo and I. I. Levin, “Resource-independent programming of hybrid reconfigurable computing systems,” in Russian Supercomputing Days. In Russian, 2017, pp. 714-723.</mixed-citation><mixed-citation xml:lang="en">A. I. Dordopulo and I. I. Levin, “Resource-independent programming of hybrid reconfigurable computing systems,” in Russian Supercomputing Days. In Russian, 2017, pp. 714-723.</mixed-citation></citation-alternatives></ref><ref id="cit4"><label>4</label><citation-alternatives><mixed-citation xml:lang="ru">V. Kasyanov, “Sisal 3.2: functional language for scientific parallel programming,” Enterprise Information Systems, vol. 7, no. 2, pp. 227-236, 2013.</mixed-citation><mixed-citation xml:lang="en">V. Kasyanov, “Sisal 3.2: functional language for scientific parallel programming,” Enterprise Information Systems, vol. 7, no. 2, pp. 227-236, 2013.</mixed-citation></citation-alternatives></ref><ref id="cit5"><label>5</label><citation-alternatives><mixed-citation xml:lang="ru">A. I. Legalov, “Functional language for creating architecturally independent parallel programs,” Computing technologies, vol. 10, no. 1, 2005.</mixed-citation><mixed-citation xml:lang="en">A. I. Legalov, “Functional language for creating architecturally independent parallel programs,” Computing technologies, vol. 10, no. 1, 2005.</mixed-citation></citation-alternatives></ref><ref id="cit6"><label>6</label><citation-alternatives><mixed-citation xml:lang="ru">I. I. Levin, A. I. Dordopulo, I. V. Pisarenko, and A. K. Melnikov, “An approach to architecture-independent programming of computing systems based on the aspect-oriented Set@ language,” Proceedings of the Southern Federal University. Technical sciences. In Russian, vol. 197, no. 3, 2018.</mixed-citation><mixed-citation xml:lang="en">I. I. Levin, A. I. Dordopulo, I. V. Pisarenko, and A. K. Melnikov, “An approach to architecture-independent programming of computing systems based on the aspect-oriented Set@ language,” Proceedings of the Southern Federal University. Technical sciences. In Russian, vol. 197, no. 3, 2018.</mixed-citation></citation-alternatives></ref><ref id="cit7"><label>7</label><citation-alternatives><mixed-citation xml:lang="ru">A. I. Legalov, V. S. Vasilev, I. V. Matkovskii, and M. S. Ushakova, “A toolkit for the development of data-driven functional parallel programmes,” in International Conference on Parallel Computational Technologies, 2018, pp. 16-30.</mixed-citation><mixed-citation xml:lang="en">A. I. Legalov, V. S. Vasilev, I. V. Matkovskii, and M. S. Ushakova, “A toolkit for the development of data-driven functional parallel programmes,” in International Conference on Parallel Computational Technologies, 2018, pp. 16-30.</mixed-citation></citation-alternatives></ref><ref id="cit8"><label>8</label><citation-alternatives><mixed-citation xml:lang="ru">V. S. Vasilev and A. I. Legalov, “Loop-invariant Optimization in the Pifagor Language,” Automatic Control and Computer Sciences, vol. 52, no. 7, pp. 843-849, 2018.</mixed-citation><mixed-citation xml:lang="en">V. S. Vasilev and A. I. Legalov, “Loop-invariant Optimization in the Pifagor Language,” Automatic Control and Computer Sciences, vol. 52, no. 7, pp. 843-849, 2018.</mixed-citation></citation-alternatives></ref><ref id="cit9"><label>9</label><citation-alternatives><mixed-citation xml:lang="ru">U. V. Udalova, A. I. Legalov, and N. U. Sirotinina, “Methods for debugging and verifying functional-stream parallel programs,” Journal of the Siberian Federal University. Equipment and technologies, vol. 4, no. 2, 2011.</mixed-citation><mixed-citation xml:lang="en">U. V. Udalova, A. I. Legalov, and N. U. Sirotinina, “Methods for debugging and verifying functional-stream parallel programs,” Journal of the Siberian Federal University. Equipment and technologies, vol. 4, no. 2, 2011.</mixed-citation></citation-alternatives></ref><ref id="cit10"><label>10</label><citation-alternatives><mixed-citation xml:lang="ru">M. S. Ushakova and A. I. Legalov, “Verification of Programs with Mutual Recursion in Pifagor Language,” Automatic Control and Computer Sciences, vol. 52, no. 7, pp. 850-866, 2018.</mixed-citation><mixed-citation xml:lang="en">M. S. Ushakova and A. I. Legalov, “Verification of Programs with Mutual Recursion in Pifagor Language,” Automatic Control and Computer Sciences, vol. 52, no. 7, pp. 850-866, 2018.</mixed-citation></citation-alternatives></ref><ref id="cit11"><label>11</label><citation-alternatives><mixed-citation xml:lang="ru">S. V. Zykov, Fundamentals of Modern Programming. Development of heterogeneous systems in an Internet-oriented environment. IPR Media, 2017.</mixed-citation><mixed-citation xml:lang="en">S. V. Zykov, Fundamentals of Modern Programming. Development of heterogeneous systems in an Internet-oriented environment. IPR Media, 2017.</mixed-citation></citation-alternatives></ref><ref id="cit12"><label>12</label><citation-alternatives><mixed-citation xml:lang="ru">A. I. Legalov, I. A. Legalov, and I. V. Matkovsky, “Specifics of semantics of a statically typed language of functional and dataflow parallel programming,” in Scientific Conference Scientific Service on the Internet, 2019, pp. 489-500.</mixed-citation><mixed-citation xml:lang="en">A. I. Legalov, I. A. Legalov, and I. V. Matkovsky, “Specifics of semantics of a statically typed language of functional and dataflow parallel programming,” in Scientific Conference Scientific Service on the Internet, 2019, pp. 489-500.</mixed-citation></citation-alternatives></ref><ref id="cit13"><label>13</label><citation-alternatives><mixed-citation xml:lang="ru">A. I. Legalov, I. V. Matkovsky, M. S. Ushakova, and D. S. Romanova, “Dynamically Changing Parallelism with the Asynchronous Sequential Data Flows,” Modeling and analysis of information systems, vol. 27, no. 2, pp. 164-179, 2020.</mixed-citation><mixed-citation xml:lang="en">A. I. Legalov, I. V. Matkovsky, M. S. Ushakova, and D. S. Romanova, “Dynamically Changing Parallelism with the Asynchronous Sequential Data Flows,” Modeling and analysis of information systems, vol. 27, no. 2, pp. 164-179, 2020.</mixed-citation></citation-alternatives></ref><ref id="cit14"><label>14</label><citation-alternatives><mixed-citation xml:lang="ru">O. V. Nepomnyashchiy, I. N. Ryzhenko, and A. I. Legalov, “Method of architecture-independent high-level synthesis of VLSI,” Proceedings of the Southern Federal University. Technical sciences, vol. 202, no. 8, 2018.</mixed-citation><mixed-citation xml:lang="en">O. V. Nepomnyashchiy, I. N. Ryzhenko, and A. I. Legalov, “Method of architecture-independent high-level synthesis of VLSI,” Proceedings of the Southern Federal University. Technical sciences, vol. 202, no. 8, 2018.</mixed-citation></citation-alternatives></ref><ref id="cit15"><label>15</label><citation-alternatives><mixed-citation xml:lang="ru">O. V. Nepomnyashchiy, I. N. Ryzhenko, and A. I. Legalov, “Methods, algorithms, and software tools for architecturally independent high-level synthesis of single-chip digital systems,” in Supercomputing Technologies (SCT-2018), 2018, pp. 104-109.</mixed-citation><mixed-citation xml:lang="en">O. V. Nepomnyashchiy, I. N. Ryzhenko, and A. I. Legalov, “Methods, algorithms, and software tools for architecturally independent high-level synthesis of single-chip digital systems,” in Supercomputing Technologies (SCT-2018), 2018, pp. 104-109.</mixed-citation></citation-alternatives></ref><ref id="cit16"><label>16</label><citation-alternatives><mixed-citation xml:lang="ru">M. S. Ushakova, “Data type semantics of the dataflow parallel programming language Pifagor,” Educational resources and technologies, vol. 14, no. 2, 2016.</mixed-citation><mixed-citation xml:lang="en">M. S. Ushakova, “Data type semantics of the dataflow parallel programming language Pifagor,” Educational resources and technologies, vol. 14, no. 2, 2016.</mixed-citation></citation-alternatives></ref><ref id="cit17"><label>17</label><citation-alternatives><mixed-citation xml:lang="ru">I. V. Matkovsky and A. I. Legalov, “Instrumental support for the translation and execution of functional-stream parallel programs,” Polzunovsky vestnik, no. 2, pp. 49-52, 2013.</mixed-citation><mixed-citation xml:lang="en">I. V. Matkovsky and A. I. Legalov, “Instrumental support for the translation and execution of functional-stream parallel programs,” Polzunovsky vestnik, no. 2, pp. 49-52, 2013.</mixed-citation></citation-alternatives></ref><ref id="cit18"><label>18</label><citation-alternatives><mixed-citation xml:lang="ru">J. Ferrante, K. J. Ottenstein, and J. D. Warren, “The program dependence graph and its use in optimization,” ACM Transactions on Programming Languages and Systems (TOPLAS), vol. 9, no. 3, pp. 319-349, 1987.</mixed-citation><mixed-citation xml:lang="en">J. Ferrante, K. J. Ottenstein, and J. D. Warren, “The program dependence graph and its use in optimization,” ACM Transactions on Programming Languages and Systems (TOPLAS), vol. 9, no. 3, pp. 319-349, 1987.</mixed-citation></citation-alternatives></ref><ref id="cit19"><label>19</label><citation-alternatives><mixed-citation xml:lang="ru">V. M. Bakanov, “Software tools for analyzing the information structure of algorithms based on their information graphs,” in Parallel Computing Technologies (PaVT ' 2016), 2016, pp. 432-441.</mixed-citation><mixed-citation xml:lang="en">V. M. Bakanov, “Software tools for analyzing the information structure of algorithms based on their information graphs,” in Parallel Computing Technologies (PaVT ' 2016), 2016, pp. 432-441.</mixed-citation></citation-alternatives></ref></ref-list><fn-group><fn fn-type="conflict"><p>The authors declare that there are no conflicts of interest present.</p></fn></fn-group></back></article>
