Parallel Computers Architecture and Programming V. Rajaraman download
Parallel Computers Architecture and Programming V. Rajaraman download
V. Rajaraman download
https://textbookfull.com/product/parallel-computers-architecture-
and-programming-v-rajaraman/
https://textbookfull.com/product/parallel-programming-concepts-
and-practice-1st-edition-bertil-schmidt/
https://textbookfull.com/product/parallel-programming-with-co-
arrays-robert-w-numrich/
https://textbookfull.com/product/parallel-programming-for-modern-
high-performance-computing-systems-czarnul/
https://textbookfull.com/product/programming-quantum-computers-
essential-algorithms-and-code-samples-1st-edition-eric-r-
johnston/
Fortran 2018 with Parallel Programming 1st Edition
Subrata Ray (Author)
https://textbookfull.com/product/fortran-2018-with-parallel-
programming-1st-edition-subrata-ray-author/
https://textbookfull.com/product/digital-architecture-beyond-
computers-fragments-of-a-cultural-history-of-computational-
design-roberto-bottazzi/
https://textbookfull.com/product/mathematica-functional-and-
procedural-programming-2nd-edition-v-aladjev/
https://textbookfull.com/product/concurrency-in-c-cookbook-
asynchronous-parallel-and-multithreaded-programming-2nd-edition-
stephen-cleary/
https://textbookfull.com/product/assembly-programming-and-
computer-architecture-for-software-engineers-brian-hall/
PARALLEL COMPUTERS
Architecture and Programming
SECOND EDITION
V. RAJARAMAN
Honorary Professor
Supercomputer Education and Research Centre
Indian Institute of Science Bangalore
C. SIVA RAM MURTHY
Richard Karp Institute Chair Professor
Department of Computer Science and Engineering
Indian Institute of Technology Madras
Chennai
Delhi-110092
2016
PARALLEL COMPUTERS: Architecture and Programming, Second Edition
V. Rajaraman and C. Siva Ram Murthy
© 2016 by PHI Learning Private Limited, Delhi. All rights reserved. No part of this book may be reproduced in any form, by
mimeograph or any other means, without permission in writing from the publisher.
ISBN-978-81-203-5262-9
The export rights of this book are vested solely with the publisher.
Published by Asoke K. Ghosh, PHI Learning Private Limited, Rimjhim House, 111, Patparganj Industrial Estate, Delhi-
110092 and Printed by Mohan Makhijani at Rekha Printers Private Limited, New Delhi-110020.
To
the memory of my dear nephew Dr. M.R. Arun
— V. Rajaraman
To
the memory of my parents, C. Jagannadham and C. Subbalakshmi
— C. Siva Ram Murthy
Table of Contents
Preface
1. Introduction
1.1 WHY DO WE NEED HIGH SPEED COMPUTING?
1.1.1 Numerical Simulation
1.1.2 Visualization and Animation
1.1.3 Data Mining
1.2 HOW DO WE INCREASE THE SPEED OF COMPUTERS?
1.3 SOME INTERESTING FEATURES OF PARALLEL COMPUTERS
1.4 ORGANIZATION OF THE BOOK
EXERCISES
Bibliography
2. Solving Problems in Parallel
2.1 UTILIZING TEMPORAL PARALLELISM
2.2 UTILIZING DATA PARALLELISM
2.3 COMPARISON OF TEMPORAL AND DATA PARALLEL PROCESSING
2.4 DATA PARALLEL PROCESSING WITH SPECIALIZED PROCESSORS
2.5 INTER-TASK DEPENDENCY
2.6 CONCLUSIONS
EXERCISES
Bibliography
3. Instruction Level Parallel Processing
3.1 PIPELINING OF PROCESSING ELEMENTS
3.2 DELAYS IN PIPELINE EXECUTION
3.2.1 Delay Due to Resource Constraints
3.2.2 Delay Due to Data Dependency
3.2.3 Delay Due to Branch Instructions
3.2.4 Hardware Modification to Reduce Delay Due to Branches
3.2.5 Software Method to Reduce Delay Due to Branches
3.3 DIFFICULTIES IN PIPELINING
3.4 SUPERSCALAR PROCESSORS
3.5 VERY LONG INSTRUCTION WORD (VLIW) PROCESSOR
3.6 SOME COMMERCIAL PROCESSORS
3.6.1 ARM Cortex A9 Architecture
3.6.2 Intel Core i7 Processor
3.6.3 IA-64 Processor Architecture
3.7 MULTITHREADED PROCESSORS
3.7.1 Coarse Grained Multithreading
3.7.2 Fine Grained Multithreading
3.7.3 Simultaneous Multithreading
3.8 CONCLUSIONS
EXERCISES
BIBLIOGRAPHY
4. Structure of Parallel Computers
4.1 A GENERALIZED STRUCTURE OF A PARALLEL COMPUTER
4.2 CLASSIFICATION OF PARALLEL COMPUTERS
4.2.1 Flynn’s Classification
4.2.2 Coupling Between Processing Elements
4.2.3 Classification Based on Mode of Accessing Memory
4.2.4 Classification Based on Grain Size
4.3 VECTOR COMPUTERS
4.4 A TYPICAL VECTOR SUPERCOMPUTER
4.5 ARRAY PROCESSORS
4.6 SYSTOLIC ARRAY PROCESSORS
4.7 SHARED MEMORY PARALLEL COMPUTERS
4.7.1 Synchronization of Processes in Shared Memory Computers
4.7.2 Shared Bus Architecture
4.7.3 Cache Coherence in Shared Bus Multiprocessor
4.7.4 MESI Cache Coherence Protocol
4.7.5 MOESI Protocol
4.7.6 Memory Consistency Models
4.7.7 Shared Memory Parallel Computer Using an Interconnection Network
4.8 INTERCONNECTION NETWORKS
4.8.1 Networks to Interconnect Processors to Memory or Computers to
Computers
4.8.2 Direct Interconnection of Computers
4.8.3 Routing Techniques for Directly Connected Multicomputer Systems
4.9 DISTRIBUTED SHARED MEMORY PARALLEL COMPUTERS
4.9.1 Cache Coherence in DSM
4.10 MESSAGE PASSING PARALLEL COMPUTERS
4.11 Computer Cluster
4.11.1 Computer Cluster Using System Area Networks
4.11.2 Computer Cluster Applications
4.12 Warehouse Scale Computing
4.13 Summary and Recapitulation
EXERCISES
BIBLIOGRAPHY
5. Core Level Parallel Processing
5.1 Consequences of Moore’s law and the advent of chip multiprocessors
5.2 A generalized structure of Chip Multiprocessors
5.3 MultiCore Processors or Chip MultiProcessors (CMPs)
5.3.1 Cache Coherence in Chip Multiprocessor
5.4 Some commercial CMPs
5.4.1 ARM Cortex A9 Multicore Processor
5.4.2 Intel i7 Multicore Processor
5.5 Chip Multiprocessors using Interconnection Networks
5.5.1 Ring Interconnection of Processors
5.5.2 Ring Bus Connected Chip Multiprocessors
5.5.3 Intel Xeon Phi Coprocessor Architecture [2012]
5.5.4 Mesh Connected Many Core Processors
5.5.5 Intel Teraflop Chip [Peh, Keckler and Vangal, 2009]
5.6 General Purpose Graphics Processing Unit (GPGPU)
EXERCISES
BIBLIOGRAPHY
6. Grid and Cloud Computing
6.1 GRID COMPUTING
6.1.1 Enterprise Grid
6.2 Cloud computing
6.2.1 Virtualization
6.2.2 Cloud Types
6.2.3 Cloud Services
6.2.4 Advantages of Cloud Computing
6.2.5 Risks in Using Cloud Computing
6.2.6 What has Led to the Acceptance of Cloud Computing
6.2.7 Applications Appropriate for Cloud Computing
6.3 CONCLUSIONS
EXERCISES
BIBLIOGRAPHY
7. Parallel Algorithms
7.1 MODELS OF COMPUTATION
7.1.1 The Random Access Machine (RAM)
7.1.2 The Parallel Random Access Machine (PRAM)
7.1.3 Interconnection Networks
7.1.4 Combinational Circuits
7.2 ANALYSIS OF PARALLEL ALGORITHMS
7.2.1 Running Time
7.2.2 Number of Processors
7.2.3 Cost
7.3 PREFIX COMPUTATION
7.3.1 Prefix Computation on the PRAM
7.3.2 Prefix Computation on a Linked List
7.4 SORTING
7.4.1 Combinational Circuits for Sorting
7.4.2 Sorting on PRAM Models
7.4.3 Sorting on Interconnection Networks
7.5 SEARCHING
7.5.1 Searching on PRAM Models
Analysis
7.5.2 Searching on Interconnection Networks
7.6 MATRIX OPERATIONS
7.6.1 Matrix Multiplication
7.6.2 Solving a System of Linear Equations
7.7 PRACTICAL MODELS OF PARALLEL COMPUTATION
7.7.1 Bulk Synchronous Parallel (BSP) Model
7.7.2 LogP Model
7.8 CONCLUSIONS
EXERCISES
BIBLIOGRAPHY
8. Parallel Programming
8.1 MESSAGE PASSING PROGRAMMING
8.2 MESSAGE PASSING PROGRAMMING WITH MPI
8.2.1 Message Passing Interface (MPI)
8.2.2 MPI Extensions
8.3 SHARED MEMORY PROGRAMMING
8.4 SHARED MEMORY PROGRAMMING WITH OpenMP
8.4.1 OpenMP
8.5 HETEROGENEOUS PROGRAMMING WITH CUDA AND OpenCL
8.5.1 CUDA (Compute Unified Device Architecture)
8.5.2 OpenCL (Open Computing Language)
8.6 PROGRAMMING IN BIG DATA ERA
8.6.1 MapReduce
8.6.2 Hadoop
8.7 CONCLUSIONS
EXERCISES
BIBLIOGRAPHY
9. Compiler Transformations for Parallel Computers
9.1 ISSUES IN COMPILER TRANSFORMATIONS
9.1.1 Correctness
9.1.2 Scope
9.2 TARGET ARCHITECTURES
9.2.1 Pipelines
9.2.2 Multiple Functional Units
9.2.3 Vector Architectures
9.2.4 Multiprocessor and Multicore Architectures
9.3 DEPENDENCE ANALYSIS
9.3.1 Types of Dependences
9.3.2 Representing Dependences
9.3.3 Loop Dependence Analysis
9.3.4 Subscript Analysis
9.3.5 Dependence Equation
9.3.6 GCD Test
9.4 TRANSFORMATIONS
9.4.1 Data Flow Based Loop Transformations
9.4.2 Loop Reordering
9.4.3 Loop Restructuring
9.4.4 Loop Replacement Transformations
9.4.5 Memory Access Transformations
9.4.6 Partial Evaluation
9.4.7 Redundancy Elimination
9.4.8 Procedure Call Transformations
9.4.9 Data Layout Transformations
9.5 FINE-GRAINED PARALLELISM
9.5.1 Instruction Scheduling
9.5.2 Trace Scheduling
9.5.3 Software Pipelining
9.6 Transformation Framework
9.6.1 Elementary Transformations
9.6.2 Transformation Matrices
9.7 PARALLELIZING COMPILERS
9.8 CONCLUSIONS
EXERCISES
BIBLIOGRAPHY
10. Operating Systems for Parallel Computers
10.1 RESOURCE MANAGEMENT
10.1.1 Task Scheduling in Message Passing Parallel Computers
10.1.2 Dynamic Scheduling
10.1.3 Task Scheduling in Shared Memory Parallel Computers
10.1.4 Task Scheduling for Multicore Processor Systems
10.2 PROCESS MANAGEMENT
10.2.1 Threads
10.3 Process Synchronization
10.3.1 Transactional Memory
10.4 INTER-PROCESS COMMUNICATION
10.5 MEMORY MANAGEMENT
10.6 INPUT/OUTPUT (DISK ARRAYS)
10.6.1 Data Striping
10.6.2 Redundancy Mechanisms
10.6.3 RAID Organizations
10.7 CONCLUSIONS
EXERCISES
BIBLIOGRAPHY
11. Performance Evaluation of Parallel Computers
11.1 BASICS OF PERFORMANCE EVALUATION
11.1.1 Performance Metrics
11.1.2 Performance Measures and Benchmarks
11.2 SOURCES OF PARALLEL OVERHEAD
11.2.1 Inter-processor Communication
11.2.2 Load Imbalance
11.2.3 Inter-task Synchronization
11.2.4 Extra Computation
11.2.5 Other Overheads
11.2.6 Parallel Balance Point
11.3 SPEEDUP PERFORMANCE LAWS
11.3.1 Amdahl’s Law
11.3.2 Gustafson’s Law
11.3.3 Sun and Ni’s Law
11.4 SCALABILITY METRIC
11.4.1 Isoefficiency Function
11.5 PERFORMANCE ANALYSIS
11.6 CONCLUSIONS
EXERCISES
BIBLIOGRAPHY
Appendix
Index
Preface
Of late there has been a lot of interest generated all over the world on parallel processors and
parallel computers. This is due to the fact that all current micro-processors are parallel
processors. Each processor in a microprocessor chip is called a core and such a
microprocessor is called a multicore processor. Multicore processors have an on-chip
memory of a few megabytes (MB). Before trying to answer the question “What is a parallel
computer?”, we will briefly review the structure of a single processor computer (Fig. 1.1). It
consists of an input unit which accepts (or reads) the list of instructions to solve a problem (a
program) and data relevant to that problem. It has a memory or storage unit in which the
program, data and intermediate results are stored, a processing element which we will
abbreviate as PE (also called a Central Processing Unit (CPU)) which interprets and executes
instructions, and an output unit which displays or prints the results.
The role of experiments, theoretical models, and numerical simulation is shown in Fig.
1.2. A theoretically developed model is used to simulate the physical system. The results of
simulation allow one to eliminate a number of unpromising designs and concentrate on those
which exhibit good performance. These results are used to refine the model and carry out
further numerical simulation. Once a good design on a realistic model is obtained, it is used
to construct a prototype for experimentation. The results of experiments are used to refine the
model, simulate it and further refine the system. This repetitive process is used until a
satisfactory system emerges. The main point to note is that experiments on actual systems are
not eliminated but the number of experiments is reduced considerably. This reduction leads to
substantial cost saving. There are, of course, cases where actual experiments cannot be
performed such as assessing damage to an aircraft when it crashes. In such a case simulation
is the only feasible method.
Figure 1.2 Interaction between theory, experiments and computer simulation.
With advances in science and engineering, the models used nowadays incorporate more
details. This has increased the demand for computing and storage capacity. For example, to
model global weather, we have to model the behaviour of the earth’s atmosphere. The
behaviour is modelled by partial differential equations in which the most important variables
are the wind speed, air temperature, humidity and atmospheric pressure. The objective of
numerical weather modelling is to predict the status of the atmosphere at a particular region
at a specified future time based on the current and past observations of the values of
atmospheric variables. This is done by solving the partial differential equations numerically
in regions or grids specified by using lines parallel to the latitude and longitude and using a
number of atmospheric layers. In one model (see Fig. 1.3), the regions are demarcated by
using 180 latitudes and 360 longitudes (meridian circles) equally spaced around the globe. In
the vertical direction 12 layers are used to describe the atmosphere. The partial differential
equations are solved by discretizing them to difference equations which are in turn solved as
a set of simultaneous algebraic equations. For each region one point is taken as representing
the region and this is called a grid point. At each grid point in this problem, there are 5
variables (namely air velocity, temperature, pressure, humidity, and time) whose values are
stored. The simultaneous algebraic equations are normally solved using an iterative method.
In an iterative method several iterations (100 to 1000) are needed for each grid point before
the results converge. The calculation of each trial value normally requires around 100 to 500
floating point arithmetic operations. Thus, the total number of floating point operations
required for each simulation is approximately given by:
Number of floating point operations per simulation
= Number of grid points × Number of values per grid point × Number of trials × Number
of operations per trial
Figure 1.3 Grid for numerical weather model for the Earth.
In this example we have:
Number of grid points = 180 × 360 × 12 = 777600
Number of values per grid point = 5
Number of trials = 500
Number of operations per trial = 400
Thus, the total number of floating point operations required per simulation = 777600 × 5 ×
500 × 400 = 7.77600 × 1011. If each floating point operation takes 100 ns the total time taken
for one simulation = 7.8 × 104 s = 21.7 h. If we want to predict the weather at the intervals of
6 h there is no point in computing for 21.7 h for a prediction! If we want to simulate this
problem, a floating point arithmetic operation on 64-bit operands should be complete within
10 ns. This time is too short for a computer which does not use any parallelism and we need a
parallel computer to solve such a problem. In general the complexity of a problem of this
type may be described by the formula:
Problem complexity = G × V × T × A
where
G = Geometry of the grid system used
V = Variables per grid point
T = Number of steps per simulation for solving the problem
A = Number of floating point operations per step
For the weather modelling problem,
G = 777600, V = 5, T = 500 and A = 400 giving problem complexity = 7.8 × 1011.
There are many other problems whose complexity is of the order of 1012 to 1020. For
example, the complexity of numerical simulation of turbulent flows around aircraft wings and
body is around 1015. Some other areas where numerically intensive simulation is required
are:
In this chapter we will explain with examples how simple jobs can be solved in parallel in
many different ways. The simple examples will illustrate many important points in perceiving
parallelism, and in allocating tasks to processors for getting maximum efficiency in solving
problems in parallel.
2.1 UTILIZING TEMPORAL PARALLELISM
Suppose 1000 candidates appear in an examination. Assume that there are answers to 4
questions in each answer book. If a teacher is to correct these answer books, the following
instructions may be given to him:
Procedure 2.1 Instructions given to a teacher to correct an answer book
Step 1: Take an answer book from the pile of answer books.
Step 2: Correct the answer to Q1 namely, A1.
Step 3: Repeat Step 2 for answers to Q2, Q3, Q4, namely, A2, A3, A4.
Step 4: Add marks given for each answer.
Step 5: Put answer book in a pile of corrected answer books.
Step 6: Repeat Steps 1 to 5 until no more answer books are left in the input.
A teacher correcting 1000 answer books using Procedure 2.1 is shown in Fig. 2.1. If a
paper takes 20 minutes to correct, then 20,000 minutes will be taken to correct 1000 papers.
If we want to speedup correction, we can do it in the following ways:
When the storm-god Wodan was banished from nature altogether and identified
with the imported, and naturally inconceivable, Satan, he was no more regarded
as Frigga’s rough lord, but as her remorseless foe. She was popularly revered as
St. Walpurga, the original May Queen, and it was believed that happy and
industrious children might sometimes see her on May-day with long flowing
flaxen hair, fine shoes, distaff in hand, and a golden crown on her head. But for
the nine nights after May-day she was relentlessly pursued by the Wild
Huntsman and his mounted train. There is a picture by G. Watts of the hunted
lady of Bocaccio’s tale, now in the Cosmopolitan Club of London, which vividly
reproduces the weird impressiveness of this myth. The White Lady tries to hide
from her pursuer in standing corn, or gets herself bound up in a sheaf. The Wild
Huntsman’s wrath extends to all her retinue,—moss maidens of the wood, or
Holtzweibeln. The same belief characterises Waldemar’s hunt. It is a common
legend in Denmark that King Volmer rode up to some peasants, busy at harvest
on Sobjerg Hill, and, in reply to his question whether they had seen any game,
one of the men said—‘Something rustled just now in yonder standing corn.’ The
King rushed off, and presently a shot was heard. The King reappeared with a
mermaid lying across his horse, and said as he passed, ‘I have chased her a
hundred years, and have her at last.’ He then rode into the hill. In this way
Frigga and her little people, hunted with the wild creatures, awakened sympathy
for them.
The holy friar. Eckhardt (who may be taken as a myth and type of the Church ad
hoc) gained his legendary fame by being supposed to go in advance of the Wild
Huntsman and warn villagers of his approach; but as time went on and a
compromise was effected between the hunting Barons and the Church, on the
basis that the sports and cruelties should be paid for with indulgence-fees,
Eckhardt had to turn his attention rather to the White Lady. She was declared a
Wild Huntress, but the epithet slipped to other shoulders. The priests identified
her ultimately with Freija, or Frau Venus; and Eckhardt was the holy hermit who
warned young men against her sorceries in Venusberg and elsewhere. But
Eckhardt never prevailed against the popular love of Mother Rose as he had
against her pursuer; he only increased the attractions of ‘Frau Venus’ beyond her
deserts. In the end it was as much as the Church could do to secure for Mary the
mantle of her elder sister’s sanctity. Even then the earlier faith was not
eradicated. After the altars of Mary had fallen, Frigga had vitality enough to hold
her own as the White Witch who broke the Dark One’s spells. It was chiefly this
helpful Mother-goddess to whom the wretched were appealing when they were
burnt for witchcraft.
1 ‘Der deutsche Volksaberglaube der Gegenwart.’ Von Dr. Adolf Wuttke, Prof. der Theol. in
Halle. Berlin: Verlag von Wiegand & Grieben. 1869.
2 ‘Histoire de France et des Choses Mémorables,’ &c.
3 The universal myth of Sleepers,—christianised in the myth of St. John, and of the Seven
whose slumber is traceable as far as Tours,—had a direct pagan development in Jami,
Barbarossa, Arthur, and their many variants. It is the legend of the Castle of Sewingshields in
Northumberland, that King Arthur, his queen and court, remain there in a subterranean hall,
entranced, until some one should first blow a bugle-horn near the entrance hall, and then with
‘the sword of the stone’ cut a garter placed there beside it. But none had ever heard where the
entrance to this enchanted hall was, till a farmer, fifty years since, was sitting knitting on the
ruins of the castle, and his clew fell and ran downwards through briars into a deep subterranean
passage. He cleared the portal of its weeds and rubbish, and entering a vaulted passage, followed
the clew. The floor was infested with toads and lizards; and bats flitted fearfully around him. At
length his sinking courage was strengthened by a dim, distant light, which, as he advanced, grew
gradually brighter, till all at once he entered a vast and vaulted hall, in the centre of which a fire,
without fuel, from a broad crevice in the floor, blazed with a high and lambent flame, that
showed all the carved walls and fretted roof, and the monarch and his queen and court reposing
around in a theatre of thrones and costly couches. On the floor, beyond the fire, lay the faithful
and deep-toned pack of thirty couple of hounds; and on a table before it the spell-dissolving
horn, sword, and garter. The shepherd firmly grasped the sword, and as he drew it from its rusty
scabbard the eyes of the monarch and his courtiers began to open, and they rose till they sat
upright. He cut the garter, and as the sword was slowly sheathed the spell assumed its ancient
power, and they all gradually sank to rest; but not before the monarch had lifted up his eyes and
hands and exclaimed—
O woe betide that evil day
On which this witless wight was born,
Who drew the sword—the garter cut,
But never blew the bugle horn.
Terror brought on loss of memory, and the shepherd was unable to give any correct account of
his adventure, or to find again the entrance to the enchanted hall.—Hodgson’s
‘Northumberland.’
4 This great discussion between the animals and sages is given in ‘The Sacred Anthology’
(London: Trübner & Co. New York: Henry Holt & Co.). It is a very ancient story, and was
probably written down at the beginning of the christian era.
5 It is a strange proof of the ignorance concerning Hindu religion that Jugernath, raised in a
sense for reprobation of cruelty to man and beast, should have been made by a missionary myth
a Western proverb for human sacrifices!
6 St. Olaf = Stooley = Tooley.
7 High bloweth Heimdall
His horn aloft;
Odin consulteth
Mimir’s head;
The old ash yet standing
Yggdrasill
To its summit is shaken,
And loose breaks the giant.—Voluspa.
8 ‘Rigveda,’ x. 99.
9 ‘Zoolog. Myth.,’ ii. 8, 10, &c.
10 ‘The Mahawanso.’ Translated by the Hon. George Turnour, Ceylon, 1836, p. 69.
11 It was an ancient custom to offer a stag on the high altar of Durham Abbey, the sacrifice
being accompanied with winding of horns, on Holy Rood Day, which suggests a form of
propitiating the Wild Huntsman in the hunting season. On the Cheviot Hills there is a chasm
called Hen Hole, ‘in which there is frequently seen a snow egg at Midsummer, and it is related
that a party of hunters, while chasing a roe, were beguiled into it by fairies, and could never
again find their way out.’—Richardson’s ‘Borderer’s Table-Book,’ vi 400. The Bridled Devil of
Durham Cathedral may be an allusion to the Wild Huntsman.
Chapter XXVII.
Le Bon Diable.
The Devil repainted—Satan a divine agent—St. Orain’s heresy—Primitive
universalism—Father Sinistrari—Salvation of demons—Mediæval sects—Aquinas—
His prayer for Satan—Popular antipathies—The Devil’s gratitude—Devil defending
innocence—Devil against idle lords—The wicked ale-wife—Pious offenders punished
—Anachronistic Devils—Devils turn to poems—Devil’s good advice—Devil sticks to
his word—His love of justice—Charlemagne and the Serpent—Merlin—His prison of
Air—Mephistopheles in Heaven.
The phrase which heads this chapter is a favourite one in France. It may have
had a euphemistic origin, for the giants dreaded by primitive Europeans were too
formidable to be lightly spoken of. But within most of the period concerning
which we have definite knowledge such phrases would more generally have
expressed the half-contemptuous pity with which these huge beings with weak
intellects were regarded. The Devil imported with Christianity was made over,
as we have seen, into the image of the Dummeteufel, or stupid good-natured
giant, and he is represented in many legends which show him giving his gifts
and services for payments of which he is constantly cheated. Le Bon Diable in
France is somewhat of this character, and is often taken as the sign of tradesmen
who wish to represent themselves as lavishing their goods recklessly for
inadequate compensation. But the large accession of demons and devils from the
East through Jewish and Moslem channels, of a character far from stupid, gave a
new sense to that phrase and corresponding ones. There is no doubt that a very
distinct reaction in favour of the Devil arose in Europe, and one expressive of
very interesting facts and forces. The pleasant names given him by the masses
would alone indicate this,—Monsieur De Scelestat, Lord Voland, Blümlin
(floweret), Federspiel (gay-plumed), Maitre Bernard, Maitre Parsin (Parisian).
The Devil is not so black as he’s painted. This proverb concerning the long-
outlawed Evil One has a respectable antiquity, and the feeling underlying it has
by no means been limited to the vulgar. Even the devout George Herbert wrote
—
It is hard to destroy the natural sentiments of the human heart. However much
they may be overlaid by the transient exigencies of a creed, their indestructible
nature is pretty certain to reveal itself. The most orthodox supporters of divine
cruelty in their own theology will cry out against it in another. The saint who is
quite satisfied that the everlasting torture of Satan or Judas is justice, will look
upon the doom of Prometheus as a sign of heathen heartlessness; and the
burning of one widow for a few moments on her husband’s pyre will stimulate
merciful missionary ardour among millions of christians whose creed passes the
same poor victim to endless torture, and half the human race with her.
It is a legend of the island Iona that when St. Columba attempted to build a
church there, the Devil—i.e., the same Druid magicians who tried to prevent his
landing there by tempests—threw down the stones as often as they were piled
up. An oracle declared that the church could arise only after some holy man had
been buried alive at the spot, and the saint’s friend Orain offered himself for the
purpose. After Orain had been buried, and the wall was rising securely, St.
Columba was seized with a strong desire to look upon the face of his poor friend
once more. The wall was pulled down, the body dug up; but instead of Orain
being found dead, he sat up and told the assembled christians around him that he
had been to the other world, and discovered that they were in error about various
things,—especially about Hell, which really did not exist at all. Outraged by this
heresy the christians immediately covered up Orain again in good earnest.
The resurrection of this primitive universalist of the seventh century, and his
burial again, may be regarded as typifying a dream of the ultimate restoration of
the universe to the divine sway which has often given signs of life through
christian history, though many times buried. The germ of it is even in Paul’s
hope that at last ‘God may be all in all’ (1 Cor. xv. 28). In Luke x. 17, also, it
was related that the seventy whom Jesus had sent out among the idol-
worshipping Gentiles ‘returned again with joy, saying, Lord, even the devils are
subject unto us through thy name.’ These ideas are recalled in various legends,
such as that elsewhere related of the Satyr who came to St. Anthony to ask his
prayers for the salvation of his demonic tribe. On the strength of Anthony’s
courteous treatment of that Satyr, the famous Consulteur of the Inquisition,
Father Sinistrari (seventeenth century), rested much of his argument that demons
were included in the atonement wrought by Christ and might attain final
beatitude. The Father affirmed that this was implied in Christ’s words, ‘Other
sheep I have which are not of this flock: them also I must bring, and they shall
hear my voice; and there shall be one fold and one shepherd’2 (John x. 16). That
these words were generally supposed to refer to the inclusion of the Gentile
world was not accepted by Sinistrari as impairing his argument, but the contrary.
He maintained with great ingenuity that the salvation of the Gentiles logically
includes the salvation of their inspiring demons, and that there would not be one
fold if these aerial beings, whose existence all authorities attested, were
excluded. He even intimates, though more timidly, that their father, Satan
himself, as a participator in the sin of Adam and sharer of his curse, may be
included in the general provision of the deity for the entire and absolute removal
of the curse throughout nature.
St. Thomas Aquinas, the ‘Angelical Doctor,’ in his famous work ‘Summa
Theologiæ,’ maintains that in the Resurrection the bodies of the redeemed will
rise with all their senses and organs, including those of sex, active and refined.
The authentic affirmation of that doctrine in the thirteenth century was of a
significance far beyond the comprehension of the Church. Aquinas confused the
lines between flesh and spirit, especially by admitting sex into heaven. The
Devil could not be far behind. The true interpretation of his doctrine is to be
found in the legend that Aquinas passed a night in prayer for the salvation and
restoration of the Devil. This legend is the subject of a modern poem so fraught
with the spirit of the mediæval heart, pining in its dogmatic prison, that I cannot
forbear quoting it here:—
While this might be the feeling of devout philosophers whose minds were
beginning to form a conception of a Cosmos in which the idea of a perpetual
empire of Evil could find no place, the humble and oppressed masses, as we
have seen in the chapter on Witchcraft, were familiarising their minds with the
powers and glories of a Satan in antagonism to the deities and saints of the
Church. It was not a penitent devil supplicating for pardon whom they desired,
but the veritable Prince of the World, to whom as well as to themselves their
Christian oppressors were odious. They invested the Powers which the priests
pronounced infernal with those humanly just and genial qualities that had been
discarded by ecclesiastical ambition. The legends which must be interpreted in
this sense are very numerous, and a few of the most characteristic must suffice
us here. The habit of attributing every mishap to the Devil was rebuked in many
legends. One of these related that when a party were driving over a rough road
the waggon broke down and one of the company exclaimed, ‘This is a bit of the
Devil’s work!’ A gentleman present said, ‘It is a bit of corporation work. I don’t
believe in saddling the Devil with all the bad roads and bad axles.’ Some time
after, when this second speaker was riding over the same road alone, an old
gentleman in black met him, and having thanked him for his defence of the
Devil, presented him with a casket of splendid jewels. Very numerous are
legends of the Devil’s apparition to assist poor architects and mechanics unable
to complete their contracts, even carving beautiful church pillars and the like for
them, and this sometimes without receiving any recompense. The Devil’s
apparition in defence of accused innocence is a well-known feature of European
folklore. On one occasion a soldier, having stopped at a certain inn, confided to
the innkeeper some money he had for safe-keeping, and when he was about to
leave the innkeeper denied having received the deposit. The soldier battered
down the door, and the neighbours of the innkeeper, a prominent man in the
town, put him in prison, where he lay in prospect of suffering death for an
attempted burglary. The poor soldier, being a stranger without means, was
unable to obtain counsel to defend him. When the parties appeared before the
magistrate, a smart young lawyer, with blue hat and white feathers, unknown in
the town, volunteered to defend the soldier, and related the whole story with
such effect that the innkeeper in his excitement cried, ‘Devil take me if I have
the money!’ Instantly the smart lawyer spread his wings, and, seizing the
innkeeper, disappeared with him through the roof of the court-room. The
innkeeper’s wife, struck with horror, restored the money. In an Altmark version
of this story the Devil visits the prisoner during the previous night and asks for
his soul as fee, but the soldier refuses, saying he had rather die. Despite this the
Devil intervened. It was an old-time custom in Denmark for courts to sit with an
open window, in order that the Devil might more easily fly away with the
perjurer.
Always a democrat, the Devil is said in many stories to have interfered in favour
of the peasant or serf against the noble. On one occasion he relieved a certain
district of all its arrogant and idle noblemen by gathering them up in a sack and
flying away with them; but unhappily, as he was passing over the town of
Friesack, his sack came in collision with the church steeple, and through the hole
so torn a large number of noble lords fell into the town—which thence derived
its name—and there they remained to be patrons of the steeple and burthens on
the people.
Fig. 23.—The Wicked Ale-wife.
The Devil was universally regarded as a Nemesis on all publicans and ale-wives
who adulterated the beer they dealt out to the people, or gave short measures. At
Reetz, in Altmark, the legend of an ale-wife with whom he flew away is
connected with a stone on which they are said to have rested, and the villagers
see thereon prints of the Devil’s hoof and the woman’s feet. This was a favourite
theme of old English legends. The accompanying Figure (23), one of the
misereres in Ludlow parish church, Shropshire, represents the end of a wicked
ale-wife. A devil on one side reads the long list of her shortcomings, and on the
other side hell-mouth is receiving other sinners. A devil with bagpipe welcomes
her arrival. She carries with her only her fraudulent measure and the fashionable
head-dress paid for out of its wicked gains.
It has been observed that the early nature-deities, reflecting the evil and good of
nature, in part through the progress of human thought and ideality, and through
new ethnical rivalries, were degraded into demons. They then represented the
pains, obstructions, and fears in nature. We have seen that as these apparent
external evils were vanquished or better understood, the demons passed to the
inward nature, and represented a new series of pains, obstructions, and fears. But
these, too, were in part vanquished, or better understood. Still more, they so
changed their forms that the ancient demons-turned-devils were no longer
sufficiently expressive to represent them. Thus we find that the Jews,
mohammedans, and christians did not find their several special antagonists
impressively represented by either Satan, Iblis, or Beelzebub. Each, therefore,
personified its foe in accordance with later experiences—an Opponent called
Armillus, Aldajjail, Antichrist (all meaning the same thing), in whom all other
devils were merged.
As to their spirit; but as to their forms they shrank in size and importance, and
did duty in small ways. We have seen how great dragons were engaged in
frightening boys who fished on Sundays, or oppressive squires; how Satan
presided over wine-casks, or was adapted to the punishment of profanity; how
hosts of once tremendous fiends turned into the grotesque little forms which
Callot, truly copying the popular notions around him, painted as motley imps
disturbing monks at their prayers. Such diminutions of the devils correspond to a
parallel process among the gods and goddesses, by which they were changed to
‘little people’ or fairies. In both cases the transformation is an expression of
popular disbelief in their reality.
But revivals took place. The fact of evil is permanent; and whenever the old
chains of fear, after long rusting, finally break, there follows an insurrection
against the social and moral order which alarms the learned and the pious. These
see again the instigations of evil powers, and it takes form in the imagination of
a Dante, a Luther, a Milton. But when these new portraits of the Devil are
painted, it is with so much contemporary colouring that they do not answer to
the traditional devils preserved in folklore. Dante’s Worm does not resemble the
serpent of fable, nor does Milton’s Satan answer to the feathered clown of
Miracle Plays. Thus, behind the actual evils which beset any time, there stands
an array of grand diabolical names, detached from present perils, on which the
popular fancy may work without really involving any theory of Absolute Evil at
all. Were starry Lucifer to be restored to his heavenly sphere, he would be one
great brand plucked from the burning, but the burning might still go on.
Theology itself had filled the world with other devils by diabolising all the gods
and goddesses of rival religions, and the compassionate heart was thus left free
to select such forms or fair names as preserved some remnant of ancient majesty
around them, or some ray from their once divine halo, and pray or hope for their
pardon and salvation. Fallen foes, no longer able to harm, can hardly fail to
awaken pity and clemency.
With the picture of Dives and Lazarus presented elsewhere (vol. i. p. 281) may
be instructively compared the accompanying scene of a rich man’s death-bed
(Fig. 24), taken from ‘Ars Moriendi,’ one of the early block-books. This picture
is very remarkable from the suggestion it contains of an opposition between a
devil on the dying man’s right and the hideous dragon on his left. While the
dragon holds up a scroll, bidding him think of his treasure (Yntende thesauro),
the Devil suggests provision for his friends (Provideas amicis). This devil seems
to be a representative of the rich man’s relatives who stand near, and appears to
be supported by his ugly superior, who points towards hell as the penalty of not
making such provision as is suggested. There would appear to be in this picture
a vague distinction between the mere bestial fiend who tempts, and the ugly but
good-natured devil who punishes, and whom rich sinners cannot escape by
bequests to churches.
One of the most notable signs of the appearance of ‘the good Devil’ was the
universal belief that he invariably stuck to his word. In all European folklore
there is no instance of his having broken a promise. In this respect his reputation
stands far higher than that of the christians, seeing that it was a boast of the
saints that, following the example of their godhead, who outwitted Satan in the
bargain for man’s redemption, they were continually cheating the Devil by
technical quibbles. There is a significant saying found among Prussian and
Danish peasants, that you may obtain a thing by calling on Jesus, but if you
would be sure of it you must call on the Devil! The two parties were judged by
their representatives.
One of the earliest legendary compacts with the Devil was that made by St.
Theophilus in the sixth century; when he became alarmed and penitent, the
Virgin Mary managed to trick Satan out of the fatal bond. The ‘Golden Legend’
of Jacobus de Voragine tells why Satan was under the necessity of demanding in
every case a bond signed with blood. ‘The christians,’ said Satan, ‘are cheats;
they make all sorts of promises so long as they want me, and then leave me in
the lurch, and reconcile themselves with Christ so soon as, by my help, they
have got what they want.’
Even apart from the consideration of possessing the soul, the ancient office of
Satan as legal prosecutor of souls transmitted, to the latest forms into which he
was modified, this character for justice. Many mediæval stories report his
gratitude whenever he is treated with justice, though some of these are disguised
by connection with other demonic forms. Such is the case with the following
romance concerning Charlemagne.
When Charlemagne dwelt at Zurich, in the house commonly called ‘Zum Loch,’
he had a column erected to which a bell was attached by a rope. Any one that
demanded justice could ring this bell when the king was at his meals. It
happened one day that the bell sounded, but when the servants went to look no
one was there. It continued ringing, so the Emperor commanded them to go
again and find out the cause. They now remarked that an enormous serpent
approached the rope and pulled it. Terrified, they brought the news to the
Emperor, who immediately rose in order to administer justice to beast as well as
man. After the reptile had respectfully inclined before the emperor, it led him to
the banks of the river and showed him, sitting upon its nest and eggs, an
enormous toad. Charlemagne having examined the case decided thus:—The toad
was condemned to be burnt and justice shown to the serpent. The verdict was no
sooner given than it was accomplished. A few days after the snake returned to
court, bowed low to the King, crept upon the table, took the cover from a gold
goblet standing there, dropped into it a precious stone, bowed again and crept
away. On the spot where the serpent’s nest had been, Charlemagne built a church
called ‘Wasserkelch.’ The stone he gave to his much-loved spouse. This stone
possessed the power of making the owner especially loved by the Emperor, so
that when absent from his queen he mourned and longed for her. She, well aware
that if it came into other hands the Emperor would soon forget her, put it under
her tongue in the hour of death. The queen was buried with the stone, but
Charlemagne could not separate himself from the body, so had it exhumed, and
for eighteen years carried it about with him wherever he went. In the meantime,
a courtier who had heard of the secret virtue of the stone, searched the corpse,
and at last found the stone hidden under the tongue, and took it away and
concealed it on his own person. Immediately the Emperor’s love for his wife
turned to the courtier, whom he now scarcely permitted out of his sight. At
Cologne the courtier in a fit of anger threw the stone into a hot spring, and since
then no one has succeeded in finding it. The love the Emperor had for the knight
ceased, but he felt himself wonderfully attracted to the place where the stone lay
hidden. On this spot he founded Aix-la-Chapelle, his subsequent favourite place
of residence.
It is not wonderful that the tradition should arise at Aix, founded by the human
hero of this romance, that the plan of its cathedral was supplied by the Devil; but
it is characteristic there should be associated with this legend an example of how
he who as a serpent was awarded justice by Charlemagne was cheated by the
priests of Aix. The Devil gave the design on condition that he was to have the
first who entered the completed cathedral, and a wolf was goaded into the
structure in fulfilment of the contract!
In the ancient myth and romaunt of ‘Merlin’ may be found the mediæval witness
to the diabolised religion of Britain. The emasculated saints of the South-east
could not satisfy the vigorous race in the North-west, and when its gods were
outlawed as devils they brought the chief of them back, as it were, had him duly
baptized and set about his old work in the form of Merlin! Here, side by side
with the ascetic Jesus, brought by Gatien and Augustin, was a Northern Christ,
son of an Arch-incubus, born of a Virgin, baptized in the shrunken Jordan of a
font, performing miracles, summoning dragons to his aid, overcoming Death and
Hell in his way, brought before his Pilate but confounding him, throning and
dethroning kings, and leading forth, on the Day of Pentecost, an army whose
knights are inspired by Guenever’s kisses in place of flaming tongues. How
Merlin ‘went about doing good,’ after the Northman’s ideal of such work; how
he saved the life of his unwedded mother by proving that her child (himself) was
begotten by a devil without her knowledge; how, as a child, he exposed at once
the pretension of the magistrate to high birth and the laxity of his lady and his
parson; how he humiliated the priestly astrologers of Vortigern, and prophesied
the destruction of that usurper just as it came to pass; how he served Uther
during his seven years’ reign, and by enabling him to assume the shape of the
Duke of Cornwall and so enjoy the embraces of the Duchess Igerna, secured the
birth of Arthur and hope of the Sangréal;4 how he defended Arthur’s legitimacy
of birth and assisted him in causing illegitimate births; and how at last he was
bound by his own spells, wielded by Vivien, in a prison of air where he now
remains;—this was the great mediæval gospel of a baptized christian Antichrist
which superseded the imported kingdom not of this world.
Merlin was the Good Devil, but baptism was a fatal Vivien-spell to him. He still
dwells in all the air which is breathed by Anglo-Saxon men,—an ever-expanding
prison! Whether the Briton is transplanted in America, India, or Africa, he still
carries with him the Sermon on the Mount as inspired by his baptized Prince of
the Air, and his gospel of the day is, ‘If thine enemy hunger, starve him; if he
thirst, give him fire; if he hate you, heap melted lead on his head!’ Such remains
the soul of the greatest race, under the fatal spell of a creed that its barbarism
needs only baptism to be made holiness and virtue.
In the reign of George II., when Lord Bute and a Princess of easy virtue were
preying on England, and fanatical preachers were directing their donkeys to
heaven beside the conflagration of John Bull’s house, the eye of Hogarth at least
(as is shown in our Figure 25, from his ‘Raree Show’) was able to see what the
baptized Merlin had become in his realm of Air. The other worldly-Devil is
serpent-legged Hypocrisy. The Nineteenth Century has replaced Merlin by
Mephistopheles, the Devil who, despite a cloven foot, steps firmly on earth, and
means the power that wit and culture can bring against the baptized giant Force.
Him the gods fear not, even look upon with satisfaction. In the ‘Prologue in
Heaven,’ of Goethe’s ‘Faust,’ the Lord is even more gracious to Mephistopheles
than the Jehovah of Job was to Satan. ‘The like of thee have never moved my
hate,’ he says—
This is but a more modern expression of the rabbinical fable, already noted, that
when the first man was formed there were beside him two Spirits,—one on the
right that remained quiescent, another on the left who ever moved restlessly up
and down. When the first sin was committed, he of the left was changed to a
devil. But he still meant the progressive, inquiring nature of man. ‘The Spirit I,
that evermore denies,’ says the Mephistopheles of Goethe. How shall man learn
truth if he know not the Spirit that denies? How shall he advance if he know not
the Spirit of discontent? This restless spirit gains through his ignorance a cloven
hoof,—a divided movement, sometimes right, sometimes wrong. From his
selfishness it acquires a double tongue. But both hoof and serpent-tongue are
beneath the evolutional power of experience; they shall be humanised to the foot
that marches firmly on earth, and the tongue that speaks truth; and, the baptismal
spell broken, Merlin shall descend, bringing to man’s aid all his sharp-eyed
dragons transformed to beautiful Arts.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
textbookfull.com