<?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">sapi</journal-id><journal-title-group><journal-title xml:lang="ru">Системный анализ и прикладная информатика</journal-title><trans-title-group xml:lang="en"><trans-title>«System analysis and applied information science»</trans-title></trans-title-group></journal-title-group><issn pub-type="ppub">2309-4923</issn><issn pub-type="epub">2414-0481</issn><publisher><publisher-name>Belarusian National Technical University</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.21122/2309-4923-2021-3-40-50</article-id><article-id custom-type="elpub" pub-id-type="custom">sapi-522</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>Защита информации</subject></subj-group><subj-group subj-group-type="section-heading" xml:lang="en"><subject>Information security</subject></subj-group></article-categories><title-group><article-title>Оптимизация размещения данных в иерархической памяти для блочных алгоритмов поиска кратчайших путей</article-title><trans-title-group xml:lang="en"><trans-title>Optimization of data allocation in hierarchical memory for blocked shortest paths algorithms</trans-title></trans-title-group></title-group><contrib-group><contrib contrib-type="author" corresp="yes"><name-alternatives><name name-style="eastern" xml:lang="ru"><surname>Прихожий</surname><given-names>А. А.</given-names></name><name name-style="western" xml:lang="en"><surname>Prihozhy</surname><given-names>A. A.</given-names></name></name-alternatives><bio xml:lang="ru"><p>Прихожий Анатолий Алексеевич – профессор кафедры программного обеспечения вычислительной техники и автоматизированных систем, доктор технических наук, профессор</p></bio><bio xml:lang="en"><p>Anatoly Prihozhy, doctor of science, professor, Computer and system software department</p><p>Minsk</p></bio><xref ref-type="aff" rid="aff-1"/></contrib></contrib-group><aff-alternatives id="aff-1"><aff xml:lang="ru"><institution>Белорусский национальный технический университет</institution><country>Беларусь</country></aff><aff xml:lang="en"><institution>Belarusian National Technical University</institution><country>Belarus</country></aff></aff-alternatives><pub-date pub-type="collection"><year>2021</year></pub-date><pub-date pub-type="epub"><day>01</day><month>10</month><year>2021</year></pub-date><volume>0</volume><issue>3</issue><fpage>40</fpage><lpage>50</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">Prihozhy A.A.</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://sapi.bntu.by/jour/article/view/522">https://sapi.bntu.by/jour/article/view/522</self-uri><abstract><p>Статья посвящена сокращению обмена данными между основной памятью и кэш прямого сопоставления при выполнении блочных алгоритмов поиска кратчайших путей, представляющих данные матрицей блоков D[M×M]. Для больших графов размер кэш S = d×M2, d &lt; 1 меньше размера матрицы. Кэш назначает группу блоков основной памяти на один блок кэш. Алгоритмы пересчитывают блок матрицы через один или два других блока и могут обращаться сразу к трем блокам. Если эти блоки назначены на один блок кэш, между ними возникает конфликт, приводящий к активному обмену данными между уровнями памяти. Распределение блоков по группам и число конфликтов сильно зависят от размещения и упорядочения блоков матрицы в основной памяти. В статье предлагается решать проблему оптимального размещения на взвешенном графе конфликтов блоков и различать два случая назначения блоков на кэш: бесконфликтного и минимально-конфликтного. В первом случае формулируется проблема равномерной раскраски графа конфликтов, предлагаются детерминированный и случайный алгоритмы ее решения. Во втором случае формулируется проблема взвешенной дефектной раскраски графа при ограничении на число цветов, предлагается случайный алгоритм ее решения. Экспериментальные результаты показывают, что случайный алгоритм равномерной раскраски дает верхнюю границу размера кэш очень близкую к нижней границе, оцениваемой через полный подграф, и показывает, что бесконфликтное размещение матрицы возможно при d = 0.5 для M = 4 и при d = 0.1 для M = 20. Для малого размера кэш взвешенный дефектный алгоритм дает число оставшихся конфликтов до 8.8 раз меньшее чем начальное размещение. Предложенные модель и алгоритмы применимы также к k-канальному ассоциативному кэш.</p></abstract><trans-abstract xml:lang="en"><p>This paper is devoted to the reduction of data transfer between the main memory and direct mapped cache for blocked shortest paths algorithms (BSPA), which represent data by a D[M×M] matrix of blocks. For large graphs, the cache size S = δ×M2, δ &lt; 1 is smaller than the matrix size. The cache assigns a group of main memory blocks to a single cache block. BSPA performs multiple recalculations of a block over one or two other blocks and may access up to three blocks simultaneously. If the blocks are assigned to the same cache block, conflicts occur among the blocks, which imply active transfer of data between memory levels. The distribution of blocks on groups and the block conflict count strongly depends on the allocation and ordering of the matrix blocks in main memory. To solve the problem of optimal block allocation, the paper introduces a block conflict weighted graph and recognizes two cases of block mapping: non-conflict and minimum-conflict. In first case, it formulates an equitable color-class-size constrained coloring problem on the conflict graph and solves it by developing deterministic and random algorithms. In second case, the paper formulates a problem of weighted defective color-count constrained coloring of the conflict graph and solves it by developing a random algorithm. Experimental results show that the equitable random algorithm provides an upper bound of the cache size that is very close to the lower bound estimated over the size of a complete subgraph, and show that a non-conflict matrix allocation is possible at δ = 0.5 for M = 4 and at δ = 0.1 for M = 20. For a low cache size, the weighted defective algorithm gives the number of remaining conflicts that is up to 8.8 times less than the original BSPA gives. The proposed model and algorithms are applicable to set-associative cache as well.</p></trans-abstract><kwd-group xml:lang="ru"><kwd>алгоритм поиска кратчайших путей</kwd><kwd>иерархическая память</kwd><kwd>кэш прямого отображения</kwd><kwd>производительность</kwd><kwd>размещение данных</kwd><kwd>граф конфликтов блоков</kwd><kwd>равномерная раскраска</kwd><kwd>дефектная раскраска</kwd></kwd-group><kwd-group xml:lang="en"><kwd>shortest paths algorithm</kwd><kwd>hierarchical memory</kwd><kwd>direct mapped cache</kwd><kwd>performance</kwd><kwd>block conflict graph</kwd><kwd>data allocation</kwd><kwd>equitable coloring</kwd><kwd>defective coloring</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">R. W. Floyd “Algorithm 97: Shortest path”, Communications of the ACM, 1962, 5(6), p. 345.</mixed-citation><mixed-citation xml:lang="en">R. W. Floyd “Algorithm 97: Shortest path”, Communications of the ACM, 1962, 5(6), p.345.</mixed-citation></citation-alternatives></ref><ref id="cit2"><label>2</label><citation-alternatives><mixed-citation xml:lang="ru">Hofner, P. Dijkstra, Floyd and Warshall Meet Kleene / P. Hofner and B. Moller // Formal Aspect of Computing, Vol. 24, No. 4, 2012, № 2, pp. 459–476.</mixed-citation><mixed-citation xml:lang="en">Hofner, P. Dijkstra, Floyd and Warshall Meet Kleene / P. Hofner and B. Moller // Formal Aspect of Computing, Vol. 24, No. 4, 2012, № 2, pp. 459–476.</mixed-citation></citation-alternatives></ref><ref id="cit3"><label>3</label><citation-alternatives><mixed-citation xml:lang="ru">G. Venkataraman, S. Sahni, S. Mukhopadhyaya “A Blocked All-Pairs Shortest Paths Algorithm”, Journal of Experimental Algorithmics (JEA), Vol 8, 2003, pp. 857–874</mixed-citation><mixed-citation xml:lang="en">G. Venkataraman, S. Sahni, S. Mukhopadhyaya “A Blocked All-Pairs Shortest Paths Algorithm”, Journal of Experimental Algorithmics (JEA), Vol. 8, 2003, pp. 857–874</mixed-citation></citation-alternatives></ref><ref id="cit4"><label>4</label><citation-alternatives><mixed-citation xml:lang="ru">Прихожий, А. А. Разнородный блочный алгоритм поиска кратчайших путей между всеми парами вершин графа / А. А. Прихожий, О. Н. Карасик // Системный анализ и прикладная информатика. – № 3. – 2017. – С. 68–75.</mixed-citation><mixed-citation xml:lang="en">Prihozhy A.A., Karasik O. N. “Heterogeneous blocked all-pairs shortest paths algorithm”. «System analysis and applied information science». 2017; (3): 68–75. (In Russ.) https://doi.org/10.21122/2309–4923–2017–3–68–75.</mixed-citation></citation-alternatives></ref><ref id="cit5"><label>5</label><citation-alternatives><mixed-citation xml:lang="ru">C. Kozyrakis “Computer Systems Architecture. Advanced Caching Techniques”, Stanford University, pp. 1–35, 2012.</mixed-citation><mixed-citation xml:lang="en">C. Kozyrakis. “Computer Systems Architecture. Advanced Caching Techniques”, Stanford University, pp. 1–35, 2012.</mixed-citation></citation-alternatives></ref><ref id="cit6"><label>6</label><citation-alternatives><mixed-citation xml:lang="ru">Smith, A.J. “Cache Memories”, Computing Surveys. 1982, 14 (3): 473–530.</mixed-citation><mixed-citation xml:lang="en">Smith, A. J., “Cache Memories”, Computing Surveys. 1982, 14 (3): 473–530.</mixed-citation></citation-alternatives></ref><ref id="cit7"><label>7</label><citation-alternatives><mixed-citation xml:lang="ru">J. S. Park, M. Penner, and V. K. Prasanna “Optimizing graph algorithms for improved cache performance” / J. S. Park, // IEEE Trans. on Parallel and Distributed Systems, 2004, 15(9), pp.769–782.</mixed-citation><mixed-citation xml:lang="en">J. S. Park, M. Penner, and V. K. Prasanna. “Optimizing graph algorithms for improved cache performance” / J. S. Park, // IEEE Trans. on Parallel and Distributed Systems, 2004, 15(9), pp. 769–782.</mixed-citation></citation-alternatives></ref><ref id="cit8"><label>8</label><citation-alternatives><mixed-citation xml:lang="ru">Prihozhy A.A. Simulation of direct mapped, k-way and fully associative cache on all pairs shortest paths algorithms. «System analysis and applied information science». 2019; (4):10–18.</mixed-citation><mixed-citation xml:lang="en">Prihozhy A.A. Simulation of direct mapped, k-way and fully associative cache on all pairs shortest paths algorithms. «System analysis and applied information science». 2019; (4):10–18.</mixed-citation></citation-alternatives></ref><ref id="cit9"><label>9</label><citation-alternatives><mixed-citation xml:lang="ru">Solomonik, E. Minimizing Communication in All Pairs Shortest Paths / E. Solomonik, A. Buluc, and J. Demmel // IEEE 27th International Symposium on Parallel &amp; Distributed Processing, 2013, pp. 548–559.</mixed-citation><mixed-citation xml:lang="en">Solomonik, E. Minimizing Communication in All Pairs Shortest Paths / E. Solomonik, A. Buluc, and J. Demmel // IEEE 27th International Symposium on Parallel &amp; Distributed Processing, 2013, pp. 548–559.</mixed-citation></citation-alternatives></ref><ref id="cit10"><label>10</label><citation-alternatives><mixed-citation xml:lang="ru">Tang, P. Rapid Development of Parallel Blocked All-Pairs Shortest Paths Code for Multi-Core Computers / P. Tang // IEEE SOUTHEASTCON 2014, pp. 1–7.</mixed-citation><mixed-citation xml:lang="en">Tang, P. Rapid Development of Parallel Blocked All-Pairs Shortest Paths Code for Multi-Core Computers / P. Tang // IEEE SOUTHEASTCON 2014, pp. 1–7.</mixed-citation></citation-alternatives></ref><ref id="cit11"><label>11</label><citation-alternatives><mixed-citation xml:lang="ru">Прихожий, А. А. Адаптивное управление памятью / А. А. Прихожий // Автоматика и вычислительная техника, 1988, № 3, с. 58–65</mixed-citation><mixed-citation xml:lang="en">Prihozhy, A.A. Adaptive memory management. Automation and computer technology, 1988, № 3, с. 58–65.</mixed-citation></citation-alternatives></ref><ref id="cit12"><label>12</label><citation-alternatives><mixed-citation xml:lang="ru">Prihozhy, A.A. Asynchronous scheduling and allocation / A.A. Prihozhy / Proceedings Design, Automation and Test in Europe. Paris, France. – IEEE, 1998, pp. 963–964.</mixed-citation><mixed-citation xml:lang="en">Prihozhy, A.A. Asynchronous scheduling and allocation / A.A. Prihozhy / Proceedings Design, Automation and Test in Europe. Paris, France. – IEEE, 1998, pp. 963–964.</mixed-citation></citation-alternatives></ref><ref id="cit13"><label>13</label><citation-alternatives><mixed-citation xml:lang="ru">Прихожий, А. А. Исследование методов реализации многопоточных приложений на многоядерных системах / А. А. Прихожий, О. Н. Карасик // Информатизация образования, 2014, № 1, с. 43–62.</mixed-citation><mixed-citation xml:lang="en">Prihozhy A.A., Karasik O. N. Investigation of methods for implementing multithreaded applications on multicore systems. Informatization of education, 2014, № 1, с. 43–62.</mixed-citation></citation-alternatives></ref><ref id="cit14"><label>14</label><citation-alternatives><mixed-citation xml:lang="ru">Прихожий, А. А. Кооперативная модель оптимизации выполнения потоков на многоядерной системе / А. А. Прихожий, О. Н. Карасик // Системный анализ и прикладная информатика, 2014, № 4, с. 13–20.</mixed-citation><mixed-citation xml:lang="en">Prihozhy A.A., Karasik O. N. Cooperative model for optimization of execution of threads on multi-core system. «System analysis and applied information science». 2014;(4):13–20. (In Russ.)</mixed-citation></citation-alternatives></ref><ref id="cit15"><label>15</label><citation-alternatives><mixed-citation xml:lang="ru">Chaitin, G. J. “Register allocation &amp; spilling via graph colouring”, Proc. 1982 SIGPLAN Symposium on Computer Construction, 1982, pp. 98–105.</mixed-citation><mixed-citation xml:lang="en">Chaitin, G. J. “Register allocation &amp; spilling via graph colouring”, Proc. 1982 SIGPLAN Symposium on Computer Construction, 1982, pp. 98–105.</mixed-citation></citation-alternatives></ref><ref id="cit16"><label>16</label><citation-alternatives><mixed-citation xml:lang="ru">Bodlaender, H.L., Fomin, F.V. “Equitable colorings of bounded treewidth graphs”, Theoretical Computer Science, 2005, 349 (1): 22–30.</mixed-citation><mixed-citation xml:lang="en">Bodlaender, H. L., Fomin, F. V. “Equitable colorings of bounded treewidth graphs”, Theoretical Computer Science, 2005, 349 (1): 22–30.</mixed-citation></citation-alternatives></ref><ref id="cit17"><label>17</label><citation-alternatives><mixed-citation xml:lang="ru">Hajnal, A., Szemeredi E. “Proof of a conjecture of P. Erdős”, Combinatorial theory and its applications, II (Proc. Colloq., Balatonfüred, 1969), North-Holland, 1970, pp. 601–623</mixed-citation><mixed-citation xml:lang="en">Hajnal, A., Szemeredi E. “Proof of a conjecture of P. Erdős”, Combinatorial theory and its applications, II (Proc. Colloq., Balatonfüred, 1969), North-Holland, 1970, pp. 601–623</mixed-citation></citation-alternatives></ref><ref id="cit18"><label>18</label><citation-alternatives><mixed-citation xml:lang="ru">Cowen, L. J., Cowen, R. H., Woodall, D. R. “Defective colorings of graphs in surfaces: Partitions into subgraphs of bounded valency”. Journal of Graph Theory, 2006, 10 (2): 187–195.</mixed-citation><mixed-citation xml:lang="en">Cowen, L. J., Cowen, R. H., Woodall, D. R. “Defective colorings of graphs in surfaces: Partitions into subgraphs of bounded valency”. Journal of Graph Theory, 2006, 10 (2): 187–195.</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>
