You are on page 1of 54

Parallel Computational Technologies

12th International Conference PCT 2018


Rostov on Don Russia April 2 6 2018
Revised Selected Papers Leonid
Sokolinsky
Visit to download the full and correct content document:
https://textbookfull.com/product/parallel-computational-technologies-12th-international
-conference-pct-2018-rostov-on-don-russia-april-2-6-2018-revised-selected-papers-le
onid-sokolinsky/
More products digital (pdf, epub, mobi) instant
download maybe you interests ...

Parallel Computational Technologies 14th International


Conference PCT 2020 Perm Russia May 27 29 2020 Revised
Selected Papers Leonid Sokolinsky

https://textbookfull.com/product/parallel-computational-
technologies-14th-international-conference-pct-2020-perm-russia-
may-27-29-2020-revised-selected-papers-leonid-sokolinsky/

Soft Computing Systems Second International Conference


ICSCS 2018 Kollam India April 19 20 2018 Revised
Selected Papers Ivan Zelinka

https://textbookfull.com/product/soft-computing-systems-second-
international-conference-icscs-2018-kollam-india-
april-19-20-2018-revised-selected-papers-ivan-zelinka/

Computer Vision ACCV 2018 14th Asian Conference on


Computer Vision Perth Australia December 2 6 2018
Revised Selected Papers Part IV C.V. Jawahar

https://textbookfull.com/product/computer-vision-accv-2018-14th-
asian-conference-on-computer-vision-perth-australia-
december-2-6-2018-revised-selected-papers-part-iv-c-v-jawahar/

Computer Vision ACCV 2018 14th Asian Conference on


Computer Vision Perth Australia December 2 6 2018
Revised Selected Papers Part V C.V. Jawahar

https://textbookfull.com/product/computer-vision-accv-2018-14th-
asian-conference-on-computer-vision-perth-australia-
december-2-6-2018-revised-selected-papers-part-v-c-v-jawahar/
Computer Vision ACCV 2018 14th Asian Conference on
Computer Vision Perth Australia December 2 6 2018
Revised Selected Papers Part VI C.V. Jawahar

https://textbookfull.com/product/computer-vision-accv-2018-14th-
asian-conference-on-computer-vision-perth-australia-
december-2-6-2018-revised-selected-papers-part-vi-c-v-jawahar/

Parallel and Distributed Computing Applications and


Technologies 19th International Conference PDCAT 2018
Jeju Island South Korea August 20 22 2018 Revised
Selected Papers Jong Hyuk Park
https://textbookfull.com/product/parallel-and-distributed-
computing-applications-and-technologies-19th-international-
conference-pdcat-2018-jeju-island-south-korea-
august-20-22-2018-revised-selected-papers-jong-hyuk-park/

Computer Vision ACCV 2018 14th Asian Conference on


Computer Vision Perth Australia December 2 6 2018
Revised Selected Papers Part I C. V. Jawahar

https://textbookfull.com/product/computer-vision-accv-2018-14th-
asian-conference-on-computer-vision-perth-australia-
december-2-6-2018-revised-selected-papers-part-i-c-v-jawahar/

Computer Vision ACCV 2018 14th Asian Conference on


Computer Vision Perth Australia December 2 6 2018
Revised Selected Papers Part II C. V. Jawahar

https://textbookfull.com/product/computer-vision-accv-2018-14th-
asian-conference-on-computer-vision-perth-australia-
december-2-6-2018-revised-selected-papers-part-ii-c-v-jawahar/

Computer Vision ACCV 2018 14th Asian Conference on


Computer Vision Perth Australia December 2 6 2018
Revised Selected Papers Part III C. V. Jawahar

https://textbookfull.com/product/computer-vision-accv-2018-14th-
asian-conference-on-computer-vision-perth-australia-
december-2-6-2018-revised-selected-papers-part-iii-c-v-jawahar/
Leonid Sokolinsky
Mikhail Zymbler (Eds.)

Communications in Computer and Information Science 910

Parallel Computational
Technologies
12th International Conference, PCT 2018
Rostov-on-Don, Russia, April 2–6, 2018
Revised Selected Papers

123
Communications
in Computer and Information Science 910
Commenced Publication in 2007
Founding and Former Series Editors:
Phoebe Chen, Alfredo Cuzzocrea, Xiaoyong Du, Orhun Kara, Ting Liu,
Dominik Ślęzak, and Xiaokang Yang

Editorial Board
Simone Diniz Junqueira Barbosa
Pontifical Catholic University of Rio de Janeiro (PUC-Rio),
Rio de Janeiro, Brazil
Joaquim Filipe
Polytechnic Institute of Setúbal, Setúbal, Portugal
Igor Kotenko
St. Petersburg Institute for Informatics and Automation of the Russian
Academy of Sciences, St. Petersburg, Russia
Krishna M. Sivalingam
Indian Institute of Technology Madras, Chennai, India
Takashi Washio
Osaka University, Osaka, Japan
Junsong Yuan
University at Buffalo, The State University of New York, Buffalo, USA
Lizhu Zhou
Tsinghua University, Beijing, China
More information about this series at http://www.springer.com/series/7899
Leonid Sokolinsky Mikhail Zymbler (Eds.)

Parallel Computational
Technologies
12th International Conference, PCT 2018
Rostov-on-Don, Russia, April 2–6, 2018
Revised Selected Papers

123
Editors
Leonid Sokolinsky Mikhail Zymbler
South Ural State University South Ural State University
Chelyabinsk Chelyabinsk
Russia Russia

ISSN 1865-0929 ISSN 1865-0937 (electronic)


Communications in Computer and Information Science
ISBN 978-3-319-99672-1 ISBN 978-3-319-99673-8 (eBook)
https://doi.org/10.1007/978-3-319-99673-8

Library of Congress Control Number: 2018952058

© Springer Nature Switzerland AG 2018


This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the
material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information
storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now
known or hereafter developed.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication
does not imply, even in the absence of a specific statement, that such names are exempt from the relevant
protective laws and regulations and therefore free for general use.
The publisher, the authors and the editors are safe to assume that the advice and information in this book are
believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors
give a warranty, express or implied, with respect to the material contained herein or for any errors or
omissions that may have been made. The publisher remains neutral with regard to jurisdictional claims in
published maps and institutional affiliations.

This Springer imprint is published by the registered company Springer Nature Switzerland AG
The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland
Preface

This volume contains a selection of the papers presented at the 12th International
Scientific Conference on Parallel Computational Technologies, PCT 2018, held during
April 2‒6, 2018, in Rostov-on-Don, Russia.
The PCT series of conferences aims at providing an opportunity to discuss the future
of parallel computing, as well as to report the results achieved by leading research
groups in solving both scientific and practical issues using supercomputer technologies.
The scope of the PCT series of conferences includes all aspects of high performance
computing in science and technology such as applications, hardware and software,
specialized languages, and packages.
The PCT series is organized by the Supercomputing Consortium of Russian
Universities and the Federal Agency for Scientific Organizations. Originated in 2007 at
the South Ural State University (Chelyabinsk, Russia), the PCT series of conferences
has now become one of the most prestigious Russian scientific meetings on parallel
programming and high-performance computing. PCT 2018 in Rostov-on-Don con-
tinued the series after Chelyabinsk (2007), St. Petersburg (2008), Nizhny Novgorod
(2009), Ufa (2010), Moscow (2011), Novosibirsk (2012), Chelyabinsk (2013),
Rostov-on-Don (2014), Ekaterinburg (2015), Arkhangelsk (2016), and Kazan (2017).
All papers submitted to the conference were scrupulously evaluated by three
reviewers on the relevance to the conference topics, scientific and practical contribu-
tion, experimental evaluation of the results, and presentation quality. PCT’s Program
Committee selected the 24 best papers to be included in this CCIS proceedings volume.
We would like to thank the Russian Foundation for Basic Research for their con-
tinued financial support of the PCT series of conferences, as well as the respected PCT
2018 sponsors, namely platinum sponsors, RSC Group and Intel, gold sponsors,
NVIDIA and Hewlett Packard Enterprise, and silver sponsor AMD.
We would like to express our gratitude to every individual who contributed to the
success of PCT 2018. Special thanks go to the Program Committee members and the
external reviewers for evaluating papers submitted to the conference. Thanks also go to
the Organizing Committee members and all the colleagues involved in the conference
organization from Don State Technical University, the South Ural State University, and
Moscow State University. We thank the participants of PCT 2018 for sharing their
research and presenting their achievements as well.
Finally, we thank Springer for publishing the proceedings of PCT 2018 in the
Communications in Computer and Information Science series.

May 2018 Leonid Sokolinsky


Mikhail Zymbler
Organization

The 12th International Scientific Conference on Parallel Computational Technologies,


PCT 2018, was organized by the Supercomputing Consortium of Russian Universities
and the Federal Agency for Scientific Organizations, Russia.

Steering Committee
Berdyshev, V. I. Krasovskii Institute of Mathematics and Mechanics,
Yekaterinburg, Russia
Ershov, Yu. L. United Scientific Council on Mathematics
and Informatics, Novosibirsk, Russia
Minkin, V. I. South Federal University, Rostov-on-Don, Russia
Moiseev, E. I. Moscow State University, Russia
Savin, G. I. Joint Supercomputer Center, Russian Academy
of Sciences, Moscow, Russia
Sadovnichiy, V. A. Moscow State University, Russia
Chetverushkin, B. N. Keldysh Institute of Applied Mathematics, Russian
Academy of Sciences, Moscow, Russia
Shokin, Yu. I. Institute of Computational Technologies, Russian
Academy of Sciences, Novosibirsk, Russia

Program Committee
Sadovnichiy, V. A. (Chair) Moscow State University, Russia
Dongarra, J. (Co-chair) University of Tennessee, USA
Sokolinsky, L. B. (Co-chair) South Ural State University, Russia
Voevodin, Vl. V. (Co-chair) Moscow State University, Russia
Zymbler, M. L. (Academic South Ural State University, Russia
Secretary)
Ablameyko, S. V. Belarusian State University, Belarus
Afanasiev, A. P. Institute for Systems Analysis, Russian Academy
of Sciences, Russia
Akimova, E. N. Krasovskii Institute of Mathematics and Mechanics,
UrB, Russian Academy of Sciences, Russia
Andrzejak, A. Heidelberg University, Germany
Balaji, P. Argonne National Laboratory, USA
Boldyrev, Y. Ya. Saint-Petersburg Polytechnic University, Russia
Carretero, J. Carlos III University of Madrid, Spain
Gazizov, R. K. Ufa State Aviation Technical University, Russia
Gergel, V. P. Lobachevsky State University of Nizhny Novgorod,
Russia
VIII Organization

Glinsky, B. M. Institute of Computational Mathematics and


Mathematical Geophysics SB, Russian Academy
of Sciences, Russia
Goryachev, V. D. Tver State Technical University, Russia
Il’in, V. P. Institute of Computational Mathematics and
Mathematical Geophysics SB, Russian Academy
of Sciences, Russia
Kobayashi, H. Tohoku University, Japan
Kunkel, J. University of Hamburg, Germany
Labarta, J. Barcelona Supercomputing Center, Spain
Lastovetsky, A. University College Dublin, Ireland
Ludwig, T. German Climate Computing Center, Germany
Lykosov, V. N. Institute of Numerical Mathematics, Russian Academy
of Sciences, Russia
Mallmann, D. Julich Supercomputing Centre, Germany
Michalewicz, M. A*STAR Computational Resource Centre, Singapore
Malyshkin, V. E. Institute of Computational Mathematics and
Mathematical Geophysics SB, Russian Academy
of Sciences, Russia
Modorsky, V. Ya. Perm Polytechnic University, Russia
Shamakina, A. V. High Performance Computing Center in Stuttgart,
Germany
Shumyatsky, P. University of Brasilia, Brazil
Sithole, H. Centre for High Performance Computing, South Africa
Starchenko, A. V. Tomsk State University, Russia
Sterling, T. Indiana University, USA
Taufer, M. University of Delaware, USA
Turlapov, V. E. Lobachevsky State University of Nizhny Novgorod,
Russia
Wyrzykowski, R. Czestochowa University of Technology, Poland
Yakobovskiy, M. V. Keldysh Institute of Applied Mathematics,
Russian Academy of Sciences, Russia
Yamazaki, Y. Federal University of Pelotas, Brazil

Organizing Committee
Sukhinov, A. I. (Chair) Don State Technical University, Russia
Chistyakov, A. E. Don State Technical University, Russia
(Co-chair)
Sidoryakina, V. V. Chekhov Taganrog Institute, Russia
(Secretary)
Antonov, A. S. Moscow State University, Russia
Antonova, A. P. Moscow State University, Russia
Bardina, M. G. South Ural State University, Russia
Bednaya, T. A. Don State Technical University, Russia
Belova, Yu. V. Don State Technical University, Russia
Organization IX

Kraeva, Ya. A. South Ural State University, Russia


Ladosha, E. N. Don State Technical University, Russia
Nikitenko, D. A. Moscow State University, Russia
Nikitina, A. V. Don State Technical University, Russia
Ostrovskikh, N. O. South Ural State University, Russia
Porksheyan, V. M. Don State Technical University, Russia
Semenyakina, A. A. Supercomputers and Neurocomputers Research Center,
Russia
Sobolev, S. I. Moscow State University, Russia
Voevodin, Vad. V. Moscow State University, Russia
Zymbler, M. L. South Ural State University, Russia
Contents

High Performance Architectures, Tools and Technologies

Hierarchical Domain Representation in the AlgoWiki Encyclopedia:


From Problems to Implementations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Alexander Antonov, Alexey Frolov, Igor Konshin,
and Vladimir Voevodin

A Toolkit for the Development of Data-Driven Functional


Parallel Programmes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Alexander I. Legalov, Vladimir S. Vasilyev, Ivan V. Matkovskii,
and Mariya S. Ushakova

Machine Learning Techniques for Detecting Supercomputer Applications


with Abnormal Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Alexander Bezrukov, Mikhail Kokarev, Denis Shaykhislamov,
Vadim Voevodin, and Sergey Zhumatiy

Role-Dependent Resource Utilization Analysis for Large HPC Centers . . . . . 47


Dmitry Nikitenko, Pavel Shvets, Vadim Voevodin, and Sergey Zhumatiy

High-Performance Reconfigurable Computer Systems with


Immersion Cooling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Ilya Levin, Alexey Dordopulo, Alexander Fedorov,
and Yuriy Doronchenko

Hybrid Supercomputer Desmos with Torus Angara Interconnect:


Efficiency Analysis and Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Nikolay Kondratyuk, Grigory Smirnov, Ekaterina Dlinnova,
Sergey Biryukov, and Vladimir Stegailov

Performance of Elbrus Processors for Computational Materials Science


Codes and Fast Fourier Transform. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Vladimir Stegailov, Alexey Timofeev, and Denis Dergunov

Performance and Energy Analysis of Nighttime Satellite Image Archive


Processing Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Ekaterina Tyutlyaeva, Sergey Konyukhov, Igor Odintsov,
Alexander Moskovsky, and Mikhail Zhizhin
XII Contents

Parallel Numerical Algorithms

Fully Homomorphic Encryption for Parallel Implementation


of Approximate Methods for Solving Differential Equations . . . . . . . . . . . . . 119
Artem K. Vishnevsky and Sergey F. Krendelev

Static Balancing Methods in Projection-Based Mesh


Generation Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Sergej K. Grigorjev and Mikhail V. Yakobovskiy

Fine-Grained Parallel Algorithms in TIM-3D Code . . . . . . . . . . . . . . . . . . . 147


Andrey Alexandrovich Voropinov and Ivan Gennadievich Novikov

Modified Componentwise Gradient Method for Solving Structural


Magnetic Inverse Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
Elena N. Akimova, Vladimir E. Misilov, and Andrey I. Tretyakov

Parallel Multipoint Approximation Method for Large-Scale


Optimization Problems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
Victor P. Gergel, Konstantin A. Barkalov, Evgeny A. Kozinov,
and Vassili V. Toropov

High-Performance Computation of Initial Boundary Value Problems . . . . . . . 186


Valery Il’in

A Study of Euclidean Distance Matrix Computation on Intel


Many-Core Processors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
Timofey Rechkalov and Mikhail Zymbler

Parallel Method of Pseudoprojection for Linear Inequalities . . . . . . . . . . . . . 216


Irina Sokolinskaya

Supercomputer Simulation

GPU Acceleration of Bubble-Particle Dynamics Simulation . . . . . . . . . . . . . 235


Ilnur A. Zarafutdinov, Yulia A. Pityuk, Azamat R. Gainetdinov,
Nail A. Gumerov, Olga A. Abramova, and Iskander Sh. Akhatov

VM2D: Open Source Code for 2D Incompressible Flow Simulation


by Using Vortex Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
Kseniia Kuzmina, Ilia Marchevsky, and Evgeniya Ryatina

Modeling of Nonstationary Two-Phase Flows in Channels Using


Parallel Technologies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
Yury Perepechko, Sergey Kireev, Konstantin Sorokin,
and Sherzad Imomnazarov
Contents XIII

Supercomputer Simulation of Cathodoluminescence Transients


in the Vicinity of Threading Dislocations . . . . . . . . . . . . . . . . . . . . . . . . . . 280
Karl K. Sabelfeld and Anastasiya Kireeva

Supercomputer Simulation of Promising Nanocomposite Anode Materials


for Lithium-Ion Batteries: New Results . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
Vadim M. Volokhov, Dmitry A. Varlamov, Tatyana S. Zyubina,
Alexander S. Zyubin, Alexander V. Volokhov, Elena S. Amosova,
and Gennady A. Pokatovich

Parallel Solution of Sediment and Suspension Transportation Problems


on the Basis of Explicit Schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
Alexander I. Sukhinov, Alexander E. Chistyakov,
and Valentina V. Sidoryakina

Three-Dimensional Mathematical Model of Wave Propagation Towards


the Shore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
Alexander Sukhinov, Alexander Chistyakov, and Sophia Protsenko

Supercomputer Modeling of Hydrochemical Condition of Shallow Waters


in Summer Taking into Account the Influence of the Environment . . . . . . . . 336
Alexander I. Sukhinov, Alexander E. Chistyakov, Alla V. Nikitina,
Yulia V. Belova, Vladimir V. Sumbaev, and Alena A. Semenyakina

Author Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353


High Performance Architectures, Tools
and Technologies
Hierarchical Domain Representation
in the AlgoWiki Encyclopedia: From
Problems to Implementations

Alexander Antonov1(B) , Alexey Frolov2 , Igor Konshin2 ,


and Vladimir Voevodin1
1
Lomonosov Moscow State University, Moscow, Russia
{asa,voevodin}@parallel.ru
2
Institute of Numerical Mathematics of the Russian Academy of Sciences,
Moscow, Russia
frolov@inm.ras.ru, igor.konshin@gmail.com

Abstract. Algorithm description is the basic unit in the AlgoWiki Open


Encyclopedia of Algorithmic Features. However, computational algo-
rithms are not objectives in and of themselves: they are needed to address
problems encountered in various fields of science and industry. On the
other hand, there are many practical problems that can be tackled using
various methods. This warrants the introduction of another basic term
that fits between the concepts of a problem and an algorithm. Also, any
algorithm can have different implementations, whether related to a single
computing platform or to different platforms. The “problem–method–
algorithm–implementation” chain is the basis for describing any subject
area in AlgoWiki. This paper describes the permitted freedom in describ-
ing such chains, which arises when studying the approaches to address
various practical problems.

Keywords: AlgoWiki · Problem · Method · Algorithm


Implementation · Parallelism resource · Parallel computing
Supercomputers

1 Introduction
The issues of efficiency and parallelism support throughout the entire supercom-
puter software stack are central to all global supercomputing forums today [1–3].
Judging by current trends, the degree of computing system parallelism will grow
by an order of magnitude every several years [4]. This illustrates the relevance

The results described in Sects. 2–5 were obtained at Lomonosov Moscow State Uni-
versity with the financial support of the Russian Science Foundation (agreement
№ 14-11-00190). The research was carried out using the equipment of the shared
research facilities of HPC computing resources at Lomonosov Moscow State Univer-
sity.
c Springer Nature Switzerland AG 2018
L. Sokolinsky and M. Zymbler (Eds.): PCT 2018, CCIS 910, pp. 3–15, 2018.
https://doi.org/10.1007/978-3-319-99673-8_1
4 A. Antonov et al.

and importance of addressing this issue throughout the entire range of comput-
ing devices, from mobile platforms to exascale supercomputers. Scientists are
currently examining architectures that would potentially form the foundation
for new generations of computers. Light and/or heavy computing cores, acceler-
ators, SIMD and data-flow processing concepts can be used. Vector processing
seems to be getting new life today. This is true for the new-generation Intel Xeon
and Intel Xeon Phi processors. Scalable Vector Extensions (SVE) to ARM pro-
cessor instruction set [5] were announced in August 2016. These extensions were
developed together with Fujitsu, which is planning to use it in a new generation
of CPU for creating the Post-K supercomputer [6]. Intel has started working on
integrating classical multi-core CPUs and ARM processors with FPGA segments
on the same chip [7,8].
The Sunway TaihuLight supercomputer [9], the current leader on the TOP500
list, consists of more than 10 million cores, an unprecedented degree of paral-
lelism. At the same time, its architecture has a few features that dictate a need
to follow a certain style for writing efficient programs [10], namely to maintain
a very high ratio of arithmetic operations execution speed to data transmission
speed from RAM (flops/bytes). . . These facts clearly show how important it is
to know the properties and features of parallel algorithm structures today and
in the future. Obviously, the full utilization of future computer capacity would
require redesigning and rewriting source code; the important thing, though, is
that the basic properties of the algorithms will remain the same.

2 About the AlgoWiki Project

The AlgoWiki Open Encyclopedia of Parallel Algorithmic Features [11] project


has been running at Lomonosov Moscow State University since 2014. During
this time, the project has drawn attention from the computing community [12,
15]. All computational algorithms are described in AlgoWiki using the same
universal structure, with special emphasis on properties related to parallelism.
The description consists of two primary parts. The first describes the machine-
independent properties of an algorithm. The second part describes the properties
of its specific implementations [13]. As the number of algorithms described in the
AlgoWiki Encyclopedia rapidly grew, the issue of classification and distribution
by thematic categories was raised shortly after the project was launched.
A logical extension to the AlgoWiki project was the specific algorithm anal-
ysis [14] with expert-quality reviews of various approaches to addressing indi-
vidual applied problems. Each problem can usually be addressed with several
different algorithmic approaches or methods. Each method has its own features,
and those algorithms that fit well a specific class of computers may not always
be suitable for another class. The AlgoWiki project is acquiring new dimensions
that help researchers move from analyzing individual algorithms to analyzing
various algorithmic approaches to tackling problems.
Hierarchical Domain Representation in the AlgoWiki Encyclopedia 5

3 The Basic Concepts Are: Problem, Method, Algorithm


and Implementation

Algorithm description the basic unit in the AlgoWiki Open Encyclopedia of


Algorithmic Features. The notion of an algorithm has been in existence for a
long time, with the actual word originating from the name of al-Khwarizmi, an
Arab scientist who lived between the 8th and 9th centuries [16]. Many definitions
of the term “algorithm” exist, probably the most famous one being attributed
to Knuth [17]: an algorithm is “a finite set of rules that gives a sequence of
operations for solving a specific type of problem,” and it “has five important
features:
– Finiteness. . .
– Definiteness. . .
– Input. . .
– Output. . .
– Effectiveness.”

A common universal structure was proposed for describing in a standard form


these and other important properties of various computational algorithms in the
AlgoWiki project. According to D. Knuth, “[a]lgorithms are the threads that tie
together most of the subfields of computer science.” In the AlgoWiki Encyclo-
pedia, algorithm descriptions also act as the central link in the chain connecting
applied scientific problems with the results of supercomputer experiments.
At its initial stage of development, AlgoWiki was a simple list of algorithm
descriptions. As the project expanded, the algorithms were divided into thematic
subcategories, eventually developing into a form of algorithm classification. How-
ever, computational algorithms are not objectives in and of themselves: they are
needed to solve problems faced in various areas of science and industry. For
this reason, descriptions of the practical problems to be addressed were added
to the AlgoWiki Encyclopedia. The problems can be described at various lev-
els: from a specific practical problem being addressed (for example, “a general
atmospheric circulation model”) to mathematical formulations (“solving ellipti-
cal equations”).
Many practical problems can be addressed using various methods: this war-
rants the introduction of another basic term that fits between the concepts of
a problem and an algorithm. A problem can potentially be addressed via dif-
ferent methods (for example, elliptical equations can be solved using the direct
method, Fourier transforms or iterative methods [18–20]). Each method has its
advantages and may be preferred over others under certain conditions. These
conditions can be dictated by the target software and hardware environment
(e.g., iterative methods are preferred when solving elliptical equations on par-
allel computers with distributed memory). Some methods can also use other
methods in sequence, which requires AlgoWiki to have several method levels.
Also, any algorithm can have different implementations, whether related to a
single computing platform or to different platforms. For example, the following
6 A. Antonov et al.

parallel implementations are known for three-dimensional Fast Fourier Trans-


form: FFTW (using MPI+OpenMP technologies) [21], MKL FFT (MPI) [22],
AccFFT (MPI, CUDA) [23], etc. Within the algorithm description, AlgoWiki
allows the properties of each specific implementation of the algorithm to be
described, with visualization of the results obtained on various software and
hardware platforms.
Thus, a “problem–method–algorithm–implementation” chain is being built as
part of the AlgoWiki Open Encyclopedia of Algorithmic Features, which forms
the basis for describing any subject area and follows the concept of linked rep-
resentation of various algorithmic approaches to addressing one and the same
problem. Effectively, the AlgoWiki project is acquiring new dimensions that help
researchers move from analyzing individual algorithms to analyzing various algo-
rithmic methods for addressing problems. Whether evaluating a definite integral,
finding characteristic vectors, or searching for the minimum spanning tree of a
graph, multiple algorithms can be offered to address the problem at hand, each
having its own properties that can be key to efficiently implementing it on a
specific computing system.
The classification of algorithms in the AlgoWiki project by their compati-
bility with specific supercomputer infrastructure will become the basis for com-
paring various algorithms to each other, which is needed for switching from
analyzing individual algorithms to analyzing algorithmic methods for address-
ing problems. This markup makes it possible to compare the compliance of
algorithms to the properties of a specific computer architecture, understand the
advantages of each specific approach compared to others, compare the theoreti-
cal potential of various algorithmic approaches to the same problem, and draw
a variety of other conclusions.

4 Interrelationships Between Basic Concepts


4.1 From Problem to Method
The Problem (P) level is the most general of the basic concepts considered in
AlgoWiki. Algorithms addressing problems from various areas of study can be
described in the AlgoWiki Encyclopedia. From various areas in mathematics
and more specific problems in computational physics, quantum chemistry and
biomathematics, to practical issues in construction, design and all areas of sci-
ence where computer simulation can be applied. More complex problems may
require addressing additional problems (P–P link), for some of which solutions
are already available (see Fig. 1a).
The way a problem is addressed can be called a Method (M); the resulting
link is denoted as P–M (Fig. 1a). The description of a method usually contains
a mathematical description of the way it addresses the problem, an explanation
of its precision level, some considerations on the solution accuracy, the way to
arrive at a solution and a justification for this being the only solution. Let us
assume that a method is a mathematically justified sequence of actions by which
one can follow to arrive at a solution to the original problem.
Hierarchical Domain Representation in the AlgoWiki Encyclopedia 7

a) Possible connections b) Possible connections c) Possible connections


from P level from M level from A level

Fig. 1. Possible connections between nodes and links in the “problem–method–


algorithm–implementation” chain. We denote with“P” a problem, with “M” a method,
with “A” an algorithm, and with “I” an implementation

As an example of the sub-chain being considered, we can describe a solution


to a specific problem (P level), for instance, the analysis of the flow around
an aircraft. The solution to gas dynamic equations in a complex-shaped area
requires solving the subproblem (P) of construction of a computational grid
in the given region. The latter problem is usually reduced to solving a set of
linear elliptical equations (P), which requires performing the decomposition (P)
of a coefficient matrix into triangular factors (P). Matrix decomposition can
be done using the Cholesky factorization method (M level). Thus, the sequence
considered above can be presented as follows: P–P–P–P–P–M. It should be noted
that the last three nodes in this sub-chain are already described in AlgoWiki.

4.2 From Method to Algorithm

The method level (M) stands for a known solution to a certain (most commonly
mathematical) problem. Methods usually operate with mathematical objects of
a general nature (matrices, vectors, graphs, arrays, etc.). Very complex methods
can include solving certain secondary subproblems using other known methods
(M–M links; Fig. 1b). These contain a description of the general method for
tackling a problem, frequently providing an opportunity to detail the method
further.
The method is detailed by recording a fixed sequence of computations that
result in the concept of an algorithm (A) and, consequently, an M–A link
(Fig. 1b). One method can lead to a variety of algorithms with different compu-
tational properties. An algorithm implies a precise indication of the entire set of
operations needed to implement the method and their sequence of operations.
Even though a Gaussian elimination method for a linear system is not sensitive
to the order of calculation of the partial sums in each line of the matrix, this order
needs to be defined in the algorithm. At the same time, it should be noted that
two algorithms related to the same Gaussian method but with a different order
of calculation of partial sums (ascending or descending order), besides difference
8 A. Antonov et al.

in accuracy due to round-off errors, would have completely different properties:


one is strictly serial, while the other has a good parallel implementation.
As an example, we can quote a sub-chain fully described in AlgoWiki. If matrix
factoring is performed using Gaussian elimination by finding a triangular factor-
ization (M), and its option LU-decomposition [24] without using transposition
(M), with the compact Gaussian elimination method (M), or more specifically,
the compact Gaussian elimination for tridiagonal matrices (M), then, for exam-
ple, serial algorithm (A) for the compact factoring scheme described above can be
considered. The chain above can be represented as follows: M–M–M–M–A.

4.3 From Algorithm to Implementation


The algorithm level (A) is the most branched structure in AlgoWiki, owing to
the use of various clarifications of a specific method, or to the application of
certain tricks to solve the problem faster. Some algorithms can engage many
different operations, each being an independent algorithm (A–A link; Fig. 1c).
For example, an algorithm (A) for solving a system of linear equations by the
conjugate gradients method [20], in which every iteration uses auxiliary algo-
rithms, is also described in AlgoWiki Encyclopedia: multiplication of a densely
populated matrix by a vector (A), scalar multiplication of vectors (A), finding
the vector norm (A), and vector operations (A) such as AXPY. This can result
in a long chain of algorithms or trees of algorithms.
Once an algorithm is selected for solving a problem, a data structure should
be developed. After the data structure is fixed, the most suitable programming
language can be chosen and work can start on writing a specific implementation
(I) of the chosen algorithm as a computer program (A–I link; Fig. 1c). It should
be noted that the preliminary design and data structure development for complex
algorithms may take a substantial amount of time, comparable to the time it
takes to write the actual computer program.
As a result, each algorithm can be implemented using different program-
ming languages. Many developers publish their implementations with detailed
descriptions. This makes it possible to find either the necessary program or
the information on how to write the most efficient program. Most pages in the
AlgoWiki Encyclopedia, together with algorithm descriptions, contain reviews
of existing implementations and direct links to open source codes.

4.4 From Implementation to Computations


When running the computations using the written program or a specific exist-
ing implementation, one should pay attention to the correct operation of the
program; the most experienced developers design tests to debug the program.
An important indicator of the quality of a program is its computational per-
formance. This issue receives much attention in AlgoWiki Encyclopedia articles.
The computation locality and data usage locality are analyzed, criteria for assess-
ing parallel efficiency are developed, and the results of the parallel computation
are presented with a scalability analysis [29].
Hierarchical Domain Representation in the AlgoWiki Encyclopedia 9

As a conclusion to the review of the various forms of the “problem–method–


algorithm–implementation” chain, it should be noted that the least experienced
developers make their first attempt to consider features of the computer architec-
ture only during the very last stage, when analyzing the results of their first runs.
However, the highest efficiency and scalability of the program can be achieved at
the topmost levels, when choosing a method for solving the problem. One of the
main goals for creating the AlgoWiki Open Encyclopedia of Algorithmic Fea-
tures is to specifically give the user an opportunity well in advance to visualize
the entire chain in full detail, from problem to implementation, and to choose
the methods and algorithms that will produce the most efficient solutions.

4.5 Interconnection of Sub-chains


In fact, different sub-chains may intersect or have many common nodes and links
since each method can usually be applied to the solution of various problems.
Short chains can be composed of longer ones. For example, all the sub-chains
considered in Subsects. 4.1–4.3 could be combined into one. Thus, the subtask of
the solution of a system of linear elliptic equations (P) considered in Subsect. 4.1
can be solved by using the algorithm (A) for the solution of linear systems by the
conjugate gradients method (see Subsect. 4.3), which will use as a preconditioner
an incomplete triangular factorization, referred to in Subsect. 4.2. Such long
chains can also arise when solving other practical problems. Another example of
a complete chain description is considered in the next section.

5 An Example Description of the “Problem-Method-


Algorithm-Implementation” Chain in the AlgoWiki
Encyclopedia
Let us take a look at one of the full “problem-method-algorithm-implementation”
chains already described in the AlgoWiki Encyclopedia—the chain that goes
from the “Matrix factorization” group of problems to Householder’s (reflection)
method of QR factorization [25–28] of a square matrix, floating point variant
(see Fig. 2).
Starting with the program (Matrix factorization), an AlgoWiki reader would
see the “P” icon, indicating the problem level. In this case, however, it is not
a single problem but a group of problems: Matrix factorization as a problem
requires decomposing a matrix into a series of special matrices (unitary, tri-
angular, etc.), depending on what is used in a higher-level problem (solving a
system of linear equations, eigenvalue problems, etc.). Next, the reader sees that
the detailed description of the problem raises another level with the same “P”
sign, and again, these are not individual problems but groups of problems:
– “Triangular factorization”: different versions of Gaussian decomposition, with
or without transpositions, using the original matrix structures, up to compact
schemes for tridiagonal matrices; a place is also prepared for pre-computed
factorization of known matrices.
10 A. Antonov et al.

Fig. 2. Example of the full “problem–method–algorithm–implementation” chain

– “Unitary-triangular factorization”: the intermediary point we seek in our


chain (we will look at it in more detail later).
– “Similar factorization”: reduction of the matrix by means of a two-sided sim-
ilarity transform to a Hessenberg form or tridiagonal symmetric matrix form,
and spectral factorization.
Hierarchical Domain Representation in the AlgoWiki Encyclopedia 11

– “Unsimilar unitary factorization”: reduction of the matrix by means of an


unbounded similarity transform to a two-diagonal form, and singular factor-
ization.

Before proceeding with the chosen factorization group, note that the pages
describing variations at the lower “algorithmic” level (e.g., Gaussian method with
the selection of a leading element) are quite brief, but we can say in advance
that no detailed description will be available for at least two of them since they
are not used in practice and are only mentioned as a tribute to the history of
the algorithm development.
In the chosen group of problems, “Unitary-triangular factorization,” after
moving a level lower, the reader finally gets to the individual problem level.
There are two of them in the classification so far: QR factorization for a dense
non-singular matrix and for Hessenberg matrices. The latter only has a short
description at the method level, as the actual algorithm is not used in practice
(factorization is not explicitly used in the QR algorithm but as iterations with
implicit shifts). The LQ decomposition is also mentioned in the description at
this level as a variation of QR factorization for a matrix transposed from the
original matrix.
A more detailed description of the problem “QR factorization for dense non-
singular matrix” is the last step in our chain, with the “P” icon. This is why,
following the rules for describing the single-problem level, a brief list of solution
methods is given along with a brief comparison of the above methods.
Digressing from the chosen chain towards the Householder method, one can
note that different chains do not always end at the algorithm level. For exam-
ple, the last method (using Gramian matrix factorization) does not have such
descriptions. The reason is that, owing to a narrow application area (in addition
to requiring a non-singular matrix, the A * A matrix conditioning is the square
of the original matrix conditioning, so the error margin for this method is much
greater), this algorithm has not been implemented by anyone.
Choosing the Householder method next, the user arrives at the method level
(“M” icon on screen), specifically at the “Householder (reflection) method for
matrix QR-factorization”. Naturally, at this level the user is presented with just
a basic mathematical concept for the method in question, as the actual algorithm
is described in more detail at the algorithm-level page (“Householder (reflection)
method of QR-factorization of a square matrix, floating point variant”). Other
versions of the algorithm have not been described yet, but they are mentioned in
the method description: “In addition to the classical point version, the method
has many other implementations such as the block version.”
Following the link to the algorithm, the user sees the “A” icon and a detailed
description of all features for the chosen algorithm. Among other things, the
general and mathematical descriptions of the algorithm contain not just general
words about the Householder transformation, but also specific formulas for each
step in the computation and for reducing the transformations to a sequence of
scalar multiplications and weighted vector sums. These basic operations are parts
of the computational core of the algorithm and are described in the respective
12 A. Antonov et al.

section. A description of the algorithm macro structure shows why the main
parts of scalar multiplications in the same step can be performed independently.
Looking at the implementation chart of the serial algorithm, the reader will
see a description of the mathematical essence of the stages within one step.
Serial complexity is presented as a formula for the number of floating point
multiplications and additions/subtractions.

Fig. 3. Algorithm step graph (zeroing column i). Squares represent input data for this
step (taken from the input data or from previous step), circles show operations. The
outlined group of operations is repeated independently n − i times

The information graph (see Fig. 3) is given for a single step as no parallelism is
observed between individual steps. The parallelism resource is calculated assum-
ing serial execution of scalar multiplication, but there are also assessments for
other methods, namely the serial-parallel and pairing methods. Input and output
data for the algorithm and its other properties are described further.
As one can clearly see, the correlation between serial and parallel complexities
is linear, which provides a good incentive for paralleling the algorithm execution.
However, the fastest level-parallel form of the graph has a square-law width,
which indicates an imbalance between device loads in an attempt to actually
program it. That is why it is more reasonable to keep the number of devices
Hierarchical Domain Representation in the AlgoWiki Encyclopedia 13

(e.g., cluster nodes) linear to the matrix size, even in the presence of a good (fast)
communication network, which doubles the critical path for the level parallel
form.
In this case, the algorithm’s computational efficiency, expressed as the ratio
of the number of operations to the total amount of input and output data, is
linear.
The algorithm is fully determined within the selected version.
The computational error in the Householder (reflection) method grows in a
linear manner, as well as in the Givens (rotations) method.
The next item after the description of the actual algorithm is the descrip-
tion of its software implementation from SCALAPACK’s PDGEQRF function.
The “Implementation peculiarities of the serial algorithm” section presents a
fragment of the program in Fortran implementing the given algorithm.
The next session presents an analysis of the algorithm locality and its quali-
tative assessment.
Next, the user can see how the algorithm’s dynamic characteristics change
with different computation performance parameters for the same algorithm
implementation.
Algorithm implementation can have relatively good performance, owing to
the use of the SCALAPACK implementation of BLAS libraries, etc. Finally, at
the end of the chain, the user can see some recommendations, particularly the
advice to avoid using the classical version of the method and to use the block
versions instead, for which numerous research works are available.

6 Conclusions
The paper considers the hierarchical approach used in the AlgoWiki Open
Encyclopedia of Algorithmic Features to represent the structure of the subject
area. A description is offered in the form of a “problem–method–algorithm–
implementation” chain, which corresponds to numeric descriptions of the prob-
lems used in computational mathematics. In the paper, we show the intercon-
nection between the basic concepts and analyze the descriptions of such chains
obtained while working on additional content for the AlgoWiki Encyclopedia.
The proposed approach to the description of “problem–method–algorithm–
implementation” chains is now being implemented in descriptions within the
AlgoWiki Open Encyclopedia of Algorithmic Features. This makes it possible to
describe subject areas in which computational algorithms are used more clearly
and according to a single scheme.
14 A. Antonov et al.

References
1. Patwary, M.M.A., et al.: Parallel efficient sparse matrix-matrix multiplication on
multicore platforms. In: Kunkel, J.M., Ludwig, T. (eds.) ISC High Performance
2015. LNCS, vol. 9137, pp. 48–57. Springer, Cham (2015). https://doi.org/10.1007/
978-3-319-20119-1 4
2. Solc, R., Kozhevnikov, A., Haidar, A., Tomov, S., Dongarra, J., Schulthess, T.C.:
Efficient implementation of quantum materials simulations on distributed CPU-
GPU systems. In: Proceedings of the International Conference for High Perfor-
mance Computing, Networking, Storage and Analysis (SC 2015), pp. 10:1–10:12.
ACM, New York (2015). https://doi.org/10.1145/2807591.2807654
3. Alam, M., Khan, M., Vullikanti, A., Marathe, M.: An efficient and scalable algo-
rithmic method for generating large-scale random graphs. In: Proceedings of the
International Conference for High Performance Computing, Networking, Storage
and Analysis, pp. 32:1–32:12. IEEE Press, Piscataway (2016). https://doi.org/10.
1109/SC.2016.31
4. Dongarra, J., et al.: The international exascale software project roadmap. Int.
J. High Perform. Comput. Appl. 25(1), 3–60 (2011). https://doi.org/10.1177/
1094342010391989
5. Arm HPC tools for SVE. https://developer.arm.com/products/software-
development-tools/hpc/sve
6. Post-K computer. http://www.aics.riken.jp/en/postk/project
7. Intel Eases Use of FPGA Acceleration: Combines Platforms, Software Stack
and Ecosystem Solutions to Maximize Performance and Lower Data Cen-
ter Costs. https://newsroom.intel.com/news/intel-eases-use-fpga-acceleration-
combines-platforms-software-stack-//ecosystem-solutions/
8. Intel Enables 5G, NFV and Data Centers with High-Performance, High-Density
ARM-based Intel Stratix 10 FPGA. https://newsroom.intel.com/news/intel-
enables-5g-nfv-data-centers-high-performance-high-density-arm-//based-intel-
stratix-10-fpga/
9. Fu, H., et al.: The Sunway TaihuLight supercomputer: system and applications.
Sci. China Inf. Sci. 59(7) (2016). https://doi.org/10.1007/s11432-016-5588-7
10. Zhang, J., et al.: Extreme-Scale phase field simulations of coarsening dynamics
on the Sunway TaihuLight supercomputer. In: Proceedings of the International
Conference for High Performance Computing, Networking, Storage and Analysis
(SC 2016), pp. 4:1–4:12. IEEE Press, Piscataway (2016). https://doi.org/10.1109/
SC.2016.3
11. Open Encyclopedia of Parallel Algorithmic Features. https://algowiki-project.org/
en
12. Voevodin, Vl., Antonov, A., Dongarra, J.: AlgoWiki: an open encyclopedia of paral-
lel algorithmic features. Supercomput. Frontiers Innov. 2(1), 4–18 (2015). https://
doi.org/10.14529/jsfi150101
13. Antonov, A., Voevodin, V., Voevodin, Vl., Teplov, A.: A study of the dynamic char-
acteristics of software implementation as an essential part for a universal descrip-
tion of algorithm properties. In: 24th Euromicro International Conference on Par-
allel, Distributed, and Network-Based Processing Proceedings, 17th-19th February
2016, pp. 359–363 (2016). https://doi.org/10.1109/PDP.2016.24
14. Antonov, A., et al.: Parallel processing model for Cholesky decomposition algo-
rithm in Algowiki project. Supercomput. Frontiers Innov. 3(3), 61–70 (2016).
https://doi.org/10.14529/jsfi160307
Hierarchical Domain Representation in the AlgoWiki Encyclopedia 15

15. Voevodin, Vl., Antonov, A., Dongarra, J.: Why is it hard to describe properties
of algorithms? Procedia Comput. Sci. 101, 4–7 (2016). https://doi.org/10.1016/j.
procs.2016.11.002
16. Boyer, C.B.: The Arabic Hegemony. A History of Mathematics, Second edn. Wiley,
Hoboken (1991)
17. Knuth, D.: The Art of Computer Programming. Fundamental Algorithms, vol. 1,
3rd edn. Addison-Wesley, Reading (1997)
18. Gloukhov, V.: Parallel implementation of the INM atmospheric general circula-
tion model on distributed memory multiprocessors. In: Sloot, P.M.A., Hoekstra,
A.G., Tan, C.J.K., Dongarra, J.J. (eds.) ICCS 2002. LNCS, vol. 2329, pp. 753–762.
Springer, Heidelberg (2002). https://doi.org/10.1007/3-540-46043-8 76
19. Hess, R., Joppich, W.: A comparison of parallel multigrid and a fast Fourier trans-
form algorithm for the solution of the Helmholtz equation in numerical weather
prediction. Parallel Comput. 22, 1503–1512 (1997)
20. Saad, Y.: Iterative Methods for Sparse Linear Systems, Second edn. SIAM,
Philadelphia (2003). https://doi.org/10.1137/1.9780898718003
21. FFTW Home Page. http://www.fftw.org
22. Computing Cluster FFT. https://software.intel.com/node/521992
23. AccFFT. A New Parallel FFT Library. http://accfft.org
24. Davis, T.A.: Direct methods for sparse linear systems. SIAM (2006). https://doi.
org/10.1137/1.9780898718881
25. Golub, G., Van Loan, C.F.: Matrix Computations, Third edn. Johns Hopkins Uni-
versity Press, Baltimore (1996)
26. Chu, E., George, A.: QR factorization of a dense matrix on a hypercube multipro-
cessor. SIAM J. Sci. Stat. Comput. 11, 990–1028 (1990). https://doi.org/10.1137/
0911057
27. Paige, C.: Some aspects of generalized QR factorization. In: Cox, M., Hammarling,
S. (eds.) Reliable Numerical Computations. Clarendon Press, Oxford (1990)
28. Dongarra, J.J., D’Azevedo, E.F.: The design and implementation of the parallel
out-of-core ScaLAPACK LU, QR, and Cholesky factorization routines. Depart-
ment of Computer Science Technical report CS-97-347, University of Tennessee,
Knoxville, TN (1997)
29. Antonov, A., Teplov, A.: Generalized approach to scalability analysis of parallel
applications. In: Carretero, J., et al. (eds.) ICA3PP 2016. LNCS, vol. 10049, pp.
291–304. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-49956-7 23
A Toolkit for the Development
of Data-Driven Functional Parallel
Programmes

Alexander I. Legalov(B) , Vladimir S. Vasilyev, Ivan V. Matkovskii,


and Mariya S. Ushakova

Siberian Federal University, Krasnoyarsk, Russia


legalov@mail.ru, rrrFer@mail.ru, alpha900i@mail.ru, ksv@akadem.ru

Abstract. In the article a technology is considered which aims at cre-


ating architecture-independent parallel programmes based on the data-
driven functional paradigm. A proposed toolkit provides the translation,
execution, debugging, optimisation and verification of programmes. A
programme in a data-driven functional parallel language is translated
into the data-flow graph (which describes the data dependencies of an
implemented algorithm) of the programme. On the basis of this represen-
tation, the control-flow graph (which defines the organisation of compu-
tations) is generated. Both graphs allow to carry out various optimising
transformations. The resulting data-flow graph is also used for the for-
mal verification of the programme. A computation process is considered
as a cooperation of the control-flow graph and the data-flow graph. The
execution of data-driven functional parallel programmes is carried out
by a special interpreter (event machine), which consist of a number of
event processors controlled by a special manager.

Keywords: Data-driven functional parallel programming


Software development toolkit · Parallel-programmes translation
Parallel-programmes optimisation · Parallel-programmes verification

1 Introduction
Parallel computing have outgrown the application in high-performance comput-
ing long ago. It is widely used for solving problems in different areas. Nowadays,
the main feature of parallel programming is the source-code dependence on the
architecture of the target computation system. So, to port a programme to another
architecture, it should be completely rewritten or appreciably modified. The rea-
son is the intention to increase the efficiency of parallel programmes, which results
in software being heavily tied to particular hardware characteristics.
Computational resources and their communications are the main character-
istics of a computation system which should be considered during the develop-
ment in order to increase the programmes efficiency. So, in addition to solving
The research is supported by the RFBR (research project No. 17-07-00288).
c Springer Nature Switzerland AG 2018
L. Sokolinsky and M. Zymbler (Eds.): PCT 2018, CCIS 910, pp. 16–30, 2018.
https://doi.org/10.1007/978-3-319-99673-8_2
A Toolkit for the Development of DDFP Programmes 17

an applied problem, we need to explicitly manage computations and resolve


resource conflicts among parallel processes. That is why parallel programming
is hard [1] and requires non-trivial analysis of programme correctness taking
different approaches, for instance, model checking [2] for formal verification.
It should be pointed out that a dependency on a particular parallel hardware
precludes writing truly parallel algorithms at the initial stage of the develop-
ment. This leads to the reduction of problem parallelism according to hardware
resources, which prevents from applying more effective solutions when a mod-
ification of the programme is needed. At the same time, the development of
hardware-dependent programmes is the mainstream of parallel programming.
The existing approaches have very different ideology of parallelisation. The most
widespread approaches are: parallelisation with message passing [3], multithread
and multi-core programming for systems with shared memory [4], graphical pro-
cessing unit programming [5], and also the mixture of these three approaches in
different combinations for systems with heterogeneous and distributed architec-
ture [6–9].
Though the concept of unlimited parallelism is not widespread in parallel
programmes development nowadays [10], it has some prospects as a basis of
programming system that provide for subsequent transformations of programmes
into resource-limited and architecture-dependent parallel programmes. So it is
topical to develop a language and a toolkit to provide for creation of parallel
programmes which are initially independent of peculiarities of a specific parallel
computer system. Porting a programme to a particular system can be done after
the processes of verification, testing and debugging.
The proposed approach is based on the concept of architecture-independent
parallel programming. Its key ideas are exclusion of resource conflicts and
implicit control over computations from within the programme being devel-
oped. It is supposed that a virtual machine which executes the programme has
unlimited resources and a programming language allows to define solely data
dependencies between the executed functions. An interaction between functions
takes place on data readiness. This allows to create programmes with maximal
achievable parallelism, which is compressed to special computing resources at
the stage of the intermediate representation after verification and debugging of
the source code. This allows to increase the efficiency of parallel-programme
development process. For example, it is possible to create a generic library of
functions adaptable to different existing and prospective architectures. The sub-
sequent transformations of such programmes can be done with formal methods
by changing the control-flow graph to fit the target architecture, preserving the
correspondence with the data-flow graph (DFG).
The goal of our research is the development of architecture-independent
parallel-programming technology based on the data-driven functional parallel
paradigm [11]. To achieve the goal we solve the following problems:

– the development and further improvement of the data-driven functional par-


allel (DDFP) computing model, on whose basis a programming language
is defined; it allows the creation of architecture-independent parallel pro-
grammes;
18 A. I. Legalov et al.

– the development of a toolkit to provide translation, testing, debugging and


execution of data-driven functional parallel programmes;
– the development of methods for programme verification and optimisation at
the level of the programme DFG;
– the development of control-flow graph transformation methods that allow
to change the programme parallelism and, in the future, to transform pro-
grammes for particular parallel architectures.

2 Problems of Imperative Paradigm Employment


in Parallel Programming
Wide application of the imperative programming paradigm introduces certain
difficulties in the development of parallel programmes. A programmer has to
explicitly or implicitly form relations between programme objects [12]. The pos-
sible relations are:

– data relations which specify the DFG of the programme; this graph defines
dependencies between operations and operands being processed;
– control relations which set the order of execution of operations; these relations
are associated with the DFG of the programme in order to ensure the right
logic of transformations of operands;
– relations between computing resources (memory, processor units) that are
used during the operation execution.
In most cases, a programme developer has to explicitly take into account the
dependencies between these relations in an attempt to avoid any logical contra-
dictions leading to an erroneous execution. In the ubiquitously used imperative
programming, the relations between the data and the control are kept in the pro-
grammer’s mind but are not explicitly expressed in the programme. For instance,
let us consider the factorial function over the range 1 to n.

int fact1n(int n) {
int r = 1; int i = 1;
loop:
if(i <= n) {
r *= i;
i++;
goto loop;
}
return r;
}

It is evident that the only explicit relation is the relation of programme objects
order in the source code or (after translation and loading for execution) in the
system memory. But it does not specify the exact order of computing. A graphical
representation of the given function explicitly represents all kinds of relations and
Another random document with
no related content on Scribd:
38. Seizure of Private Property at Sea[118]

The essence of the question involved in the seizure of “private


property” at sea is transportation; and with three such conspicuous
instances[119] within a century its effectiveness is historically
demonstrated. The belligerent state, in the exercise of a right as yet
conceded by international law, says in substance to its adversary, “I
forbid your citizens the maritime transportation of their commercial
property. Articles of whatever character, including the vessels which
carry them, violating this lawful order will be seized and
condemned.” Seizure is made contingent upon movement; otherwise
the property is merely bidden to stay at home, where it will be safe.
All this is in strict conformity with the execution of law under
common conditions; and the practice is now regulated with a
precision and system consonant to other legal adjudication, the
growth of centuries of jurisprudence directed to this particular
subject. Its general tendency I have indicated by certain specific
instances. It is efficient to the ends of war, more or less, according to
circumstances; and by distributing the burden over the whole
community affected it tends to peace, as exemption from capture
could not do. If the suffering of war could be made to fall only on the
combatants actually in the field, the rest of the nation being
protected from harm and loss by the assured ability to pursue their
usual avocations undisturbed, the selfishness of men would more
readily resort to violence to carry their ends.
In support of the widespread effects of interruption to
transportation, I gladly quote one of the recent contendents for
immunity of “private property” from maritime capture. Having on
one page maintained the ineffectiveness of the seizure, because
individual losses never force a nation to make peace, he concludes
his article by saying:
“The question interests directly and vitally thousands of people in
every country. It is of vital importance to those who go down to the
sea in ships, and those who occupy their business in great waters. It
appeals not only to every shipowner, but also to every merchant
whose goods are shipped upon the sea, to every farmer whose grain
is sent abroad, to every manufacturer who sells to a foreign market,
and to every banker who is dependent upon the prosperity of his
countrymen.”
I can do little to enhance this vivid presentation by an opponent;
yet if we add to his list the butchers, the bakers, the tailors,
shoemakers, grocers, whose customers economize; the men who
drive drays to and from shipping, and find their occupation gone; the
railroads, as the great common carriers, whose freights fall off; the
stockholders whose dividends shrink; we shall by no means have
exhausted the far-reaching influence of this intermeddling with
transportation. It is a belligerent measure which touches every
member of the hostile community, and, by thus distributing the evils
of war, as insurance distributes the burden of other losses, it brings
them home to every man, fostering in each a disposition to peace.
It doubtless will not have escaped readers familiar with the subject
of maritime prize that so far I have not distinguished between the
interruption of transportation by blockade and that by seizure on the
high seas. The first, it may be said, is not yet in question; the second
only is challenged. My reason has been that the underlying military
principle—and, as I claim, justification—is the same in both; and, as
we are dealing with a question of war, the military principle is of
equal consideration with any other, if not superior. The effect
produced is in character the same in both. In efficacy, they differ,
and their comparative values in this respect are a legitimate subject
for discussion. In principle and method, however, they are identical;
both aim at the stoppage of transportation, as a means of destroying
the resources of the enemy, and both are enforced by the seizure and
condemnation of “private property” transgressing the orders.
This community of operation is so evident that, historically, the
advocates of exemption of private property from confiscation in the
one case have demanded, or at the least suggested, that blockade as a
military measure cannot be instituted against commerce—that it can
be resorted to only as against contraband, or where a port is
“invested” by land as well as by sea. This was Napoleon’s contention
in the Berlin Decree; and it is worthy of grave attention that, under
the pressure of momentary expediency, the United States more than
once, between 1800 and 1812, advanced the same view. This I have
shown in my history of the War of 1812.[120] Had this opinion then
prevailed, the grinding blockade of the War of Secession could not
have been applied. If we may imagine the United States and the
Confederate States parties to a Hague Conference, we can conceive
the impassioned advocacy of restricted blockade by the one, and the
stubborn refusal of the other. This carries a grave warning to test
seeming expediency in retaining or yielding a prescriptive right.
There is no moral issue, if my previous argument is correct; unless it
be moral, and I think it is, to resort to pecuniary pressure rather than
to bloodshed to enforce a belligerent contention. As regards
expediency, however, each nation should carefully weigh the effects
upon itself, upon its rivals, and upon the general future of the
community of states, before abandoning a principle of far-reaching
consequence, and in operation often beneficent in restraining or
shortening war.
It has been urged that conditions have so changed, through the
numerous alternatives to sea transport now available, that the
former efficacy can no longer be predicted. There might be
occasional local suffering, but for communities at large the streams
of supply are so many that the particular result of general popular
distress will not be attained to any decisive degree. Has this
argument really been well weighed? None, of course, will dispute
that certain conditions have been much modified, and for the better.
Steam not only has increased rapidity of land transit for persons and
goods; it has induced the multiplication of roads, and enforced the
maintenance of them in good condition. Thanks to such
maintenance, we are vastly less at the mercy of the seasons than we
once were, and communities now have several lines of
communication open where formerly they were dependent upon one.
Nevertheless, for obvious reasons of cheapness and of facility, water
transport sustains its ascendancy. It may carry somewhat less
proportionately than in old times; but, unless we succeed in
exploiting the air, water remains, and always must remain, the great
medium of transportation. The open sea is a road which needs
neither building nor repairs. Compared with its boundless expanse,
two lines of rails afford small accommodation—a circumstance which
narrowly limits their capacity for freight.
[It is shown that water transportation still plays an immense part
in commerce, even in the case of inland watercourses in competition
with railroads, and that any interruption of commerce throws a
heavy burden on the nation involved.—Editor.]
Such derangement of an established system of sea transportation
is more searching, as well as more easy, when the shipping involved
has to pass close by an enemy’s shores; and still more if the ports of
possible arrival are few. This is conspicuously the case of Germany
and the Baltic States relatively to Great Britain, and would be of
Great Britain were Ireland independent and hostile. The striking
development of German mercantile tonnage is significant of the
growing grandeur, influence, and ambitions of the empire. Its
exposure, in case of war with Great Britain, and only in less degree
with France, would account, were other reasons wanting, for the
importunate demand for naval expansion. Other reasons are not
wanting; but in the development of her merchant shipping Germany,
to use a threadbare phrase, has given a hostage to Fortune. Except by
the measure advocated, and here opposed, of exempting from
capture merchant vessels of a belligerent, with their cargoes, as being
“private property,” Germany is bound over to keep the peace, unless
occasion of national safety—vital interests—or honor drive her, or
unless she equip a navy adequate to so great a task as protecting fully
the carrying-trade she has laboriously created. The exposure of this
trade is not merely a matter of German interest, nor yet of British. It
is of international concern, a circumstance making for peace.
The retort is foreseen: How stands a nation to which the native
mercantile shipping, carrying-trade, is a distinctly minor interest,
and therefore does not largely affect the question of transportation?
This being maintained by neutrals, the accretion of national wealth
by circulation may go on little impaired by hostilities. The first most
obvious reply is that such is a distinctly specialized case in a general
problem, and that its occurrence and continuance are dependent
upon circumstances which frequently vary. It lacks the elements of
permanence, and its present must therefore be regarded with an eye
to the past and future. A half-century ago the mercantile marine of
the United States was, and for nearly a century before had been, a
close second to that of Great Britain; to-day it is practically non-
existent, except for coasting-trade. On the other hand, during the
earlier period the thriving Hanse towns were nearly the sole
representatives of German shipping, which now, issuing from the
same harbors, on a strip of coast still narrow, is pressing rapidly
forward under the flag of the empire to take the place vacated by the
Americans.
With such a reversal of conditions in two prominent examples, the
problem of to-day in any one case is not that of yesterday, and may
very well not be that of to-morrow. From decade to decade
experience shifts like a weather-cock; the statesman mounted upon it
becomes a Mr. Facing-Bothways. The denial of commercial blockade,
the American national expediency of 1800, suggested by such
eminent jurists as John Marshall and James Madison, would have
been ruinous manacles to the nation of 1861–65. A government
weighing its policy with reference to the future, having regard to
possible as well as actual conditions, would do well before
surrendering existing powers—the bird in the hand—to consider
rather the geographical position of the country, its relation to
maritime routes—the strategy, so to say, of the general permanent
situation—and the military principles upon which maritime capture
rests. In that light a more accurate estimate will be made of
temporary tactical circumstances, to-day’s conditions—such, for
instance, as set forth by the present Lord Chancellor of Great Britain.
[121]
In his letter, favoring immunity from capture for “private
property,” disproportionate stress is laid upon the dangers of Great
Britain, the points which make against her; a serious tactical error.
The argument from exposure is so highly developed, that the possible
enemies whose co-operation is needed to secure the desired
immunity for “private” property might well regard the request to
assist as spreading the net in the sight of the bird; a vanity which
needs not a wise man to detect. On the other hand, the offensive
advantage of capture to Great Britain, owing to her situation, is, in
my judgment, inadequately appreciated.
The writer has fallen into the mistake which our General Sherman
characterized as undue imagination concerning what “the man on
the other side of the hill” might do; a quaint version of the first
Napoleon’s warning against “making a picture to yourself.” The
picture of Great Britain’s dangers is overdrawn; that to her enemies
—“the full measure of the mischief we could do to a Continental
nation”—is underdrawn. It would seem as if, in his apprehension,
“the disastrous consequences[122] which would flow from even slight
depredations by commerce destroyers on British shipping” could
find no parallel in the results to a Continental trade from British
cruisers. France or Germany, for example, shut off from the sea, can
be supplied by rail from, say, Antwerp or Rotterdam; but it is
apparently inconceivable that, in the contingency of a protracted
naval war, the same ports might equally supply Great Britain by
neutral ships. Alternate sea routes close, apparently automatically;
only alternate land routes stay open. Thus undue weight is laid upon
defensive motives, where the offensive requires the greater
emphasis. The larger merchant tonnage of Great Britain involves a
greater defensive element, yes; but are not defensive conditions
favorably modified by her greater navy, and by her situation, with all
her western ports open to the Atlantic, from Glasgow to Bristol and
round to Southampton? And is not the station for such defense
identical with the best for offense by maritime capture? The British
vessels there occupy also a superior position for coal renewal; the
difficulty of which for an enemy, threatening the Atlantic approaches
to Great Britain, seems too largely discounted by imaginations
preoccupied with hostile commerce destroyers.
The concluding sentence of Lord Loreburn’s letter contains a
warning familiar to military thought. “Great Britain will gain much
from a change long and eagerly desired by the great majority of other
Powers.” The wish of a possible enemy is the beacon which suggests
the shoal. The truth is, if the British Navy maintains superiority, it is
to the interest of her enemies to have immunity from capture for
“private property;” if it falls, it is to their interest to be able to
capture. The inference is safe that probable enemies, if such there be,
and if they entertain the wish asserted, do not expect shortly to
destroy the British Navy.
While unconvinced by the reasoning, it is refreshing to recognize
in this letter a clear practical enunciation which sweeps away much
sentimental rhetoric. “I urge [immunity for private property] not
upon any ground of sentiment or humanity (indeed, no operation of
war inflicts less suffering than the capturing of unarmed vessels at
sea), but upon the ground that on the balance of argument, coolly
weighed, the interests of Great Britain will gain much from the
change.” I more than doubt the conclusion; but its sobriety contrasts
pleasantly with the exuberances, “noble and enlightened action,”
“crown of glory,” and the like, with which it pleases certain of our
American advocates to enwreathe this prosaic utilitarian proposition.
A possibility which affects the general question much more
seriously than others so far considered, is that of neutral carriers
taking the place of a national shipping exposed to capture under
present law. This is one phase of a change which has come over the
general conditions of carrying-trade since the United States became
a nation, and since Great Britain, three quarters of a century
afterwards, formally repealed her Navigation Acts. The discussion
preceding this repeal, together with the coincident Free Trade
movement, preceded by but a few years the Treaty of Paris in 1856,
and gave an impulse which doubtless facilitated the renouncement in
that treaty by Great Britain of the right to capture enemy’s property
under a neutral flag. The concession was in the air, as we say; which
proves only that it was contagious, not that it was wise. Like many
hasty steps, however, once taken it probably is irreversible.
The effect of this concession has been to legalize, among the
several great states signatory to the treaty, the carriage of belligerent
property by neutral ships, in which previously it had been liable to
seizure. In its later operation, the condemnation of the enemy’s
property had not involved the neutral carrier further than by the
delays necessary to take her into port, adjudicate the question of
ownership, and remove the property, if found to be belligerent. Such
detention, however, was a strong deterrent, and acted as an
impediment to the circulation of belligerent wealth by neutral
means. It tended to embarrass and impoverish the belligerent; hence
the removal of it is a modification of much importance. Neutral
shipping thus is now free to take a part in hostilities, which formerly
it could only do at the risk of loss, more or less serious. To carry
belligerent property, which under its own flag would be open to
seizure, is to aid the belligerent; is to take part in the war.
In considering such an amelioration, if it be so regarded, it is
possible to exaggerate its degree. If a nation cherishes its carrying-
trade, does a large part of its transportation in its own vessels, and is
unable in war to protect them, the benefit of the innovation will be
but partial. Its own shipping, driven from the sea, is an important
element in the total navigation of the world, and the means to
replace it will not be at once at hand. Neutrals have their own
commerce to maintain, as well as that of the weaker belligerent. They
would not undertake the whole of the latter, if they could; and, if they
would, they will not at once have the means. Steamships driven off
the sea, and for the moment lost to navigation, cannot be replaced as
rapidly as the old sailing-vessels. Moreover, neutral merchants have
to weigh the chances of hostilities being short, and that the banished
shipping of the belligerent may return in its might to the seas with
the dawn of peace, making their own a drug on the market. In short,
while the belligerent profits from a change which gives him free use
of neutral ships, whereas he formerly had only a limited use, a
considerable embarrassment remains. The effect is identical in
principle and operation with that before indicated, as resulting from
blockading a few chief harbors. A certain large fraction of
transportation is paralyzed, and the work done by it is thrown upon
ports and roads which have not the necessary facilities. It is as
though a main trunk line of railroad were seized and held. The
general system is deranged, prices rise, embarrassment results, and
is propagated throughout the business community. This affects the
nation by the suffering of thousands of individuals, and by the
consequent reduction of revenue.
It would seem, therefore, that even under modern conditions
maritime capture—of “private” property—is a means of importance
to the ends of war; that it acts directly upon the individual citizens
and upon the financial power of the belligerent, the effect being
intensified by indirect influence upon the fears of the sensitive
business world. These political and financial consequences bring the
practice into exact line with military principle; for, being directed
against the resources of the enemy, by interrupting his
communications with the outer world, it becomes strictly analogous
to operations against the communications of an army with its base—
one of the chief objects of strategy. Upon the maintenance of
communications the life of an army depends, upon the maintenance
of commerce the vitality of a state. Money, credit, is the life of war.
Lessen it, and vigor flags; destroy it, and resistance dies. Accepting
these conclusions, each state has to weigh the probable bearing upon
its own fortunes of the continuance or discontinuance of the practice.
From the military point of view the question is not merely, nor
chiefly, “What shall our people escape by the abandonment of this
time-sanctioned method?” but, “What power to overcome the enemy
shall we thereby surrender?” It is a question of balance, between
offense and defense. As Jefferson said, when threatened with a
failure of negotiations, “We shall have to begin the irrational process
of trying which can do the other most harm.” As a summary of war,
the sentence is a caricature; but it incidentally embodies Farragut’s
aphorism, “The best defense is a rapid fire from our own guns.” For
the success of war, offense is better than defense; and in
contemplating this or any other military measure, let there be
dismissed at once, as preposterous, the hope that war can be carried
on without some one or something being hurt; that the accounts
should show credit only and no debit.
For the community of states a broader view should be taken, from
the standpoint that whatever tends to make war more effective tends
to shorten it and to prevent it.
39. The Moral Aspect of War[123]

The poet’s words, “The Parliament of man, the federation of the


world,” were much in men’s mouths this past summer. There is no
denying the beauty of the ideal, but there was apparent also a
disposition, in contemplating it, to contemn the slow processes of
evolution by which Nature commonly attains her ends, and to
impose at once, by convention, the methods that commended
themselves to the sanguine. Fruit is not best ripened by premature
plucking, nor can the goal be reached by such short cuts. Step by
step, in the past, man has ascended by means of the sword, and his
more recent gains, as well as present conditions, show that the time
has not yet come to kick down the ladder which has so far served
him. Three hundred years ago, the people of the land in which the
Conference was assembled wrenched with the sword civil and
religious peace, and national independence, from the tyranny of
Spain. Then began the disintegration of her empire, and the
deliverance of peoples from her oppression; but this was completed
only last year, and then again by the sword—of the United States.
In the centuries which have since intervened, what has not
“justice, with valor armed,” when confronted by evil in high places,
found itself compelled to effect by resort to the sword? To it was due
the birth of the United States, not least among the benefits of which
was the stern experience that has made Great Britain no longer the
mistress, but the mother, of her dependencies. The control, to good
from evil, of the devastating fire of the French Revolution, and of
Napoleon, was due to the sword. The long line of illustrious names
and deeds, of those who bore it not in vain, has in our times
culminated—if indeed the end is even yet nearly reached—in the new
birth of the United States by the extirpation of human slavery, and in
the downfall, but yesterday, of a colonial empire identified with
tyranny. What the sword, and it supremely, tempered only by the
stern demands of justice and of conscience, and the loving voice of
charity, has done for India and for Egypt, is a tale at once too long
and too well known for repetition here. Peace, indeed, is not
adequate to all progress; there are resistances that can be overcome
only by explosion. What means less violent than war would in a half-
year have solved the Caribbean problem, shattered national ideas
deep rooted in the prepossessions of a century, and planted the
United States in Asia, face to face with the great world problem of the
immediate future? What but the War of 1898 rent the veil which
prevented the English-speaking communities from seeing eye to eye,
and revealed to each the face of a brother? Little wonder that a war
which, with comparatively little bloodshed, brought such
consequences, was followed by the call for a Peace Conference!
Power, force, is a faculty of national life; one of the talents
committed to nations by God. Like every other endowment of a
complex organization, it must be held under control of the
enlightened intellect and of the upright heart; but no more than any
other can it be carelessly or lightly abjured, without incurring the
responsibility of one who buries in the earth that which was
entrusted to him for use. And this obligation to maintain right, by
force if need be, while common to all states, rests peculiarly upon the
greater, in proportion to their means. Much is required of those to
whom much is given. So viewed, the ability speedily to put forth the
nation’s power, by adequate organization and other necessary
preparation, according to the reasonable demands of the nation’s
intrinsic strength and of its position in the world, is one of the clear
duties involved in the Christian word “watchfulness,”—readiness for
the call that may come, whether expectedly or not. Until it is
demonstrable that no evil exists, or threatens the world, which
cannot be obviated without recourse to force, the obligation to
readiness must remain; and, where evil is mighty and defiant, the
obligation to use force—that is, war—arises. Nor is it possible,
antecedently, to bring these conditions and obligations under the
letter of precise and codified law, to be administered by a tribunal.
The spirit of legalism is marked by blemishes as real as those
commonly attributed to “militarism,” and not more elevated. The
considerations which determine good and evil, right and wrong, in
crises of national life, or of the world’s history, are questions of
equity often too complicated for decision upon mere rules, or even
upon principles, of law, international or other. The instances of
Bulgaria, of Armenia, and of Cuba, are entirely in point; and it is
most probable that the contentions about the future of China will
afford further illustration. Even in matters where the interest of
nations is concerned, the moral element enters; because each
generation in its day is the guardian of those which shall follow it.
Like all guardians, therefore, while it has the power to act according
to its best judgment, it has no right, for the mere sake of peace, to
permit known injustice to be done to its wards.
The present strong feeling in favor of arbitration, throughout the
nations of the world, is in itself a subject for congratulation almost
unalloyed. It carries indeed a promise, to the certainty of which no
paper covenants can pretend; for it influences the conscience by
inward conviction, not by external fetter. But it must be remembered
that such sentiments, from their very universality and evident
laudableness, need correctives, for they bear in themselves a great
danger of excess or of precipitancy. Excess is seen in the disposition,
far too prevalent, to look upon war not only as an evil, but as an evil
unmixed, unnecessary, and therefore always unjustifiable; while
precipitancy, to reach results considered desirable, is evidenced by
the wish to impose arbitration, to prevent recourse to war, by a
general pledge previously made. Both frames of mind receive
expression in the words of speakers among whom a leading
characteristic is lack of measuredness and of proportion. Thus an
eminent citizen is reported to have said: “There is no more occasion
for two nations to go to war than for two men to settle their
difficulties with clubs.” Singularly enough, this point of view assumes
to represent peculiarly Christian teaching. In so doing, it willfully
ignores the truth that Christianity, while it will not force the
conscience by other than spiritual arguments, as “compulsory”
arbitration might, distinctly recognizes the sword as the resister and
remedier of evil in the sphere “of this world.”
Arbitration’s great opportunity has come in the advancing moral
standards of states, whereby the disposition to deliberate wrong-
doing has diminished; consequently, the occasions for redressing
wrong by force are less frequent to arise. In view of recent events,
however, and very especially of notorious, high-handed oppression,
initiated since the calling of the Peace Conference,[124] and resolutely
continued during its sessions in defiance of the public opinion of the
world at large, it is premature to assume that such occasions belong
wholly to the past. Much less can it be assumed that there will be no
further instances of a community believing, conscientiously and
entirely, that honor and duty require of it a certain course, which
another community with equal integrity may hold to be inconsistent
with the rights and obligations of its own members. It is, for
instance, quite possible, especially to one who has recently visited
Holland, to conceive that Great Britain and the Boers are alike
satisfied of the substantial justice of their respective claims. It is
permissible most earnestly to hope that, in disputes between
sovereign states, arbitration may find a way to reconcile peace with
fidelity to conscience, in the case of both; but if the conviction of
conscience remains unshaken, war is better than disobedience,—
better than acquiescence in recognized wrong. The great danger of
undiscriminating advocacy of arbitration, which threatens even the
cause it seeks to maintain, is that it may lead men to tamper with
equity, to compromise with unrighteousness, soothing their
conscience with the belief that war is so entirely wrong that beside it
no other tolerated evil is wrong. Witness Armenia, and witness Crete.
War has been avoided; but what of the national consciences that
beheld such iniquity and withheld the hand?
40. The Practical Aspect of War[125]

If it be true, as I have expressed my own conviction, that moral


motives are gaining in force the world over, we can have hope of the
time when they shall prevail; but it is evident that they must prevail
over all nations equally, or with some approach to equality, or else
discussion between two disputants will not rest on the same plane. In
the difference between the United States and Spain, I suppose the
argument of the United States, the moral justification to itself of its
proposed action, would be that misgovernment of Cuba, and
needless Cuban suffering, had continued so long as to show that
Spain was not capable of giving good government to her distant
dependency. There was no occasion to question her desire to give it,
the honesty either of her assertions or measures to that end; but it
was quite apparent that it was not in her to give effect to her efforts.
Now, presuming Spain to take that view, it is conceivable (to the
imagination) that her rulers might say, “Yes, it is true, we have failed
continuously. The Cubans have a moral right to good government,
and as we have not been able to give it them, it is right that we should
step out.” But, assuming Spain unequal to such sublime moral
conviction and self-abnegation, what was the United States to do, as
a practical matter? What she did was perfectly practical; she used the
last argument of nations as international law stands; but, suppose
she had gone to arbitration, upon what grounds would the Court
proceed? What the solid prearranged basis of its decision, should
that be that Spain must evacuate Cuba? Is there anything in the
present accord of states, styled International Law, that would give
such power? And, more pertinent still, are states prepared now to
concede to an arbitral Court the power to order them out of territory
which in its opinion they misgovern, or which in its opinion they
should not retain after conquest? e. g., Schleswig Holstein, Alsace
and Lorraine, the Transvaal, Porto Rico and the Philippine Islands?
Or, take another impending and very momentous instance, one
fraught with immeasurable issues. If I rightly appreciate conditions,
there is, among the English-speaking communities bordering the
Pacific, a deep instinctive popular determination, one of those before
which rulers have to bow, to exclude, from employment in the
sparsely settled territories occupied by them, the concentrated
crowded mass of mankind found in Japan and China. More than
anything else this sums up the question of the Pacific. Two seas of
humanity, on very different levels as to numbers and economical
conditions, stand separated only by this artificial dyke of legislation,
barring the one from rushing upon and flooding the other. I do not
criticize an attitude with which, whether I approve or not, I can
sympathize; but as I look at the legislation, and contrast the material
conditions, I wonder at the improvidence of Australasia in trusting
that laws, though breathing the utmost popular conviction and
purpose, can protect their lands from that which threatens. “Go
home,” said Franklin to a fellow colonist in the days of unrest in
America, “and tell them to get children. That will settle all our
difficulties.” Fill up your land with men of your own kind, if you wish
to keep it for yourselves. The Pacific States of North America are
filling up, and, more important, they back solidly upon, and are
politically one with, other great communities into which the human
tide is pouring apace; yet in them, too, labor may inflict upon its own
aims revolutionary defeat, if for supposed local advantage it
embarrasses the immigration of its own kind. It is very different for
those who are severed from their like by sea, and therefore must
stand on their own bottom. All the naval· power of the British
Empire cannot suffice ultimately to save a remote community which
neither breeds men in plenty nor freely imports them.
We speak of these questions now as racial, and the expression is
convenient. It is compact, and represents truly one aspect of such
situations, which, however, are essentially economical and territorial.
In long-settled countries race and territory tend to identity of
meaning, but we need scarce a moment’s recollection to know that
race does not bind as do border lines, nor even they as do economical
facts. Economical facts largely brought about the separation of
America from Great Britain; economical facts brought about the
American Union and continue to bind it. The closer union of the
territories which now constitute the British Empire must be found in
economical adjustments; the fact of common race is not sufficient
thereto. Now, economical influences are of the most purely material
order—the order of personal self-interest; in that form at least they
appeal to the great majority, for the instructed political economists
form but a small proportion of any community. Race, yes; territory—
country—yes; the heart thrills, the eyes fill, self-sacrifice seems
natural, the moral motive for the moment prevails; but in the long
run the hard pressure of economical truth comes down upon these
with the tyranny of the despot. There are, indeed, noble leaders not a
few, who see in this crushing burden upon their fellow millions an
enemy to be confronted and vanquished, not by direct opposition,
but by circumvention, relieving his sway by bettering environment,
and so giving play to the loftier sentiments. But that these men may
so work they need to be, as we say, independent, released from the
grip of daily bread; and their very mission, alike in its success and its
failures, testifies to the preponderant weight of economical
conditions in the social world....
If with wealth, numbers and opportunity, a people still cannot so
organize their strength as to hold their own, it is not practical to
expect that those to whom wealth and opportunity are lacking, but
who have organizing faculty and willingness to fight, will not under
the pressure of need enter upon an inheritance which need will
persuade themselves is ethically their due. What, it may be asked, is
likely to be the reasoning of an intelligent Chinese or Japanese
workman, realizing the relative opportunities of his crowded country
and those of Australia and California, and finding himself excluded
by force? What ethical, what moral, value will he find in the
contention that his people should not resort to force to claim a share
in the better conditions from which force bars him? How did the
white races respect the policy of isolation in Japan and China,
though it only affected commercial advantages? I do not in the least
pronounce upon the ethical propriety of exclusion by those in
possession—the right of property, now largely challenged. I merely
draw attention to the apparent balance of ethical argument, with the
fact of antagonistic economical conditions; and I say that for such a
situation the only practical arbiter is the physical force, of which war
is merely the occasional political expression.
In the broad outlook, which embraces not merely armed collision,
but the condition of preparation and attitude of mind that enable a
people to put forth, on demand, the full measure of their physical
strength,—numerical, financial and military,—to repel a threatened
injury or maintain a national right, war is the regulator and adjuster
of those movements of the peoples, which in their tendencies and
outcome constitute history. These are natural forces, which from
their origin and power are self-existent and independent in relation
to man. His provision against them is war; the artificial organization
of other forces, intrinsically less powerful materially, but with the
advantage which intelligent combination and direction confer. By
this he can measurably control, guide, delay, or otherwise
beneficially modify, results which threaten to be disastrous in their
extent, tendency, or suddenness. So regarded war is remedial or
preventive.
I apprehend that these two adjectives, drawn from the vocabulary
of the healer, embody both the practical and moral justification of
war. An ounce of prevention is worth a pound of cure. It will be well
that we invoke moral power to help heal the evils of the world, as the
physician brings it to bear on the ills of the body; but few are
prepared to rely upon it alone. We need material aid as well. The
dikes of Holland withstand by direct opposition the natural mission
of the North Sea to swallow up the land they protect. The levees of
the Mississippi restrain and guide to betterment the course of the
mighty current, which but for them would waste its strength to
devastate the shores on either hand. These two artificial devices
represent a vast expenditure of time, money, and energy; of
unproductive labor so-called; but they are cheaper than a flood. The
police of our great cities prevent the outburst of crime, the fearful
possibilities of which manifest themselves on the happily rare
occasions when material prevention has from any cause lapsed. The
police bodies are a great expense; but they cost less than a few days
of anarchy. Let us not deceive ourselves by fancying that the strong
material impulses which drive those masses of men whom we style
nations, or races, are to be checked or guided, unless to the argument
of a reasonable contention there be given the strong support of
organized material power. If the organized disappear, the
unorganized will but come into surer and more dreadful collision.
41. Motives for Naval Power[126]

There is one further conclusion to be drawn from the war between


Japan and Russia, which contradicts a previous general impression
that I myself have shared, and possibly in some degree have
contributed to diffuse. That impression is, that navies depend upon
maritime commerce as the cause and justification of their existence.
To a certain extent, of course, this is true; and, just because true to a
certain extent, the conclusion is more misleading. Because partly
true, it is accepted as unqualifiedly true. Russia has little maritime
commerce, at least in her own bottoms; her merchant flag is rarely
seen; she has a very defective sea-coast; can in no sense be called a
maritime nation. Yet the Russian navy had the decisive part to play
in the late war; and the war was unsuccessful, not because the navy
was not large enough, but because it was improperly handled.
Probably, it also was intrinsically insufficient—bad in quality; poor
troops as well as poor generalship. The disastrous result does not
contravene the truth that Russia, though with little maritime
shipping, was imperatively in need of a navy.
I am not particularly interested here to define the relations of
commerce to a navy. It seems reasonable to say that, where merchant
shipping exists, it tends logically to develop the form of protection
which is called naval; but it has become perfectly evident, by
concrete examples, that a navy may be necessary where there is no
shipping. Russia and the United States to-day are such instances in
point. More and more it becomes clear, that the functions of navies
are distinctly military and international, whatever their historical
origin in particular cases. The navy of the United States, for example,
took its rise from purely commercial considerations. External
interests cannot be confined to those of commerce. They may be
political as well as commercial; may be political because commercial,
like the claim to “the open door” in China; may be political because
military, essential to national defense, like the Panama Canal and
Hawaii; may be political because of national prepossessions and
sympathies, race sympathies, such as exist in Europe, or traditions
like the Monroe Doctrine. The Monroe Doctrine in its beginnings
was partly an expression of commercial interest, directed against a
renewal of Spanish monopoly in the colonial system; it was partly
military, defensive against European aggressions and dangerous
propinquity; partly political, in sympathy with communities
struggling for freedom.
A broad basis of mercantile maritime interests and shipping will
doubtless conduce to naval efficiency, by supplying a reserve of
material and personnel. Also, in representative governments,
military interests cannot without loss dispense with the backing
which is supplied by a widely spread, deeply rooted, civil interest,
such as merchant shipping would afford us.
To prepare for war in time of peace is impracticable to commercial
representative nations, because the people in general will not give
sufficient heed to military necessities, or to international problems,
to feel the pressure which induces readiness. All that naval officers
can do is to realize to themselves vividly, make it a part of their
thought, that a merchant shipping is only one form of the many
which the external relations of a country can assume. We have such
external questions in the Monroe Doctrine, the Panama Canal, the
Hawaiian Islands, the market of China, and, I may add, in the
exposure of the Pacific Coast, with its meagre population,
insufficiently developed resources, and somewhat turbulent attitude
towards Asiatics. The United States, with no aggressive purpose, but
merely to sustain avowed policies, for which her people are ready to
fight, although unwilling to prepare, needs a navy both numerous
and efficient, even if no merchant vessel ever again flies the United
States flag. If we hold these truths clearly and comprehensively, as
well as with conviction, we may probably affect those who affect
legislation. At all events, so to hold will do no harm.
APPENDIX

CHRONOLOGICAL OUTLINE

1840. September 27, Alfred Thayer Mahan born at West Point,


New York, son of Professor Dennis Hart Mahan of the U. S.
Military Academy.
1854–1856. Student at Columbia College in the City of New York.
1856. September 30, entered the third class, U. S. Naval Academy,
as acting midshipman. Appointed from the 10th
Congressional District of New York.
1859. June 9, graduated as midshipman.
1859–1861, Frigate Congress, Brazil station.
1861. August 31, promoted to lieutenant. Converted steamer
James Adger for ten days.
1861–1862. Steam corvette Pocahontas, in the Potomac flotilla;
capture of Port Royal, November 7, 1861; South Atlantic
Blockading Squadron.
1862–1863. Naval Academy at Newport, Rhode Island. First
lieutenant in the Macedonian during the summer practice
cruise to England in 1863.
1863–1864. Steam corvette Seminole, West Gulf Blockading
Squadron.
1864–1865. James Adger; staff of Rear Admiral Dahlgren, South
Atlantic Blockading Squadron; James Adger.
1865–1866. Double-ender Muscoota.
1865. June 7, promoted to lieutenant commander.
1866. Ordnance duty, Washington Navy Yard.
1867–1869. Steam sloop Iroquois, to Asiatic station, via Cape of
Good Hope. Detached in 1869; returned via Rome and Paris.
1869. Commanding gunboat Aroostook, Asiatic station.

You might also like