OpenLLM-France/wikimedia huggingface dataset:
# Building a Beowulf Cluster

A beowulf cluster is a cluster of computers designed to run computing jobs in parallel. This provides an up-to date example of assembled hardware and installed programs (plus configuration). There will be explanations of how to run processes in parallel with computing languages such as matlab and R. After the computers are setup we may want to transfer the configuration to other computers, a process called cloning. In the last chapter, we will deal with benchmarking and profiling.

## Outline

* Introduction
* Hardware
* Installation, Configuration, and Administration
* Parallelization of computation
* Cloning of Slaves
* Profiling and Benchmarking

## Wikibooks on related topics

* Parallel Computing and Computer Clusters
* Programming Languages/Concurrent Languages
# Building a Beowulf Cluster/Installation, Configuration, and Administration/Shared directories and SSH

Now we want to share data among computers. NFS configuration is remarkably simple (see the linux nfs faq for help). You basically have to install the package, start the nfs services, and change two files.
Let's see the example files:
Sharing /home and /root directories password-less ssh login is simplified. For every user that need access to slaves the following achieves the goal:
The ~/.ssh/known_host file needs entries for each computer (e.g. by logging in to each machine once). I used option -v with the ssh command to speed up ssh changing parameters in /etc/ssh/ssh_config and /etc/ssh/sshd_config. Options that you might want to specify include protocol 2, port 22, PreferredAuthentications PublicKey, IdentityFile ~/.ssh/id_rsa. You might want to turn off checking of .ssh/known_hosts, and on the slaves you might want to ignore the host ip (CheckHostIP no), and turn off any authentication method except for public key and password. One of the fastest cipher methods is RC4 (arcfour in ssh config file)

## External Links

* SSH server FAQ]

## See also

* SSH
* LPI Linux Certification/Configuring An NFS Server
* ↑ speed comparison of cypher methods with ssh
# Building a Beowulf Cluster/Installation, Configuration, and Administration

In this chapter, you will find basics of installation, configuration, and administration. Most important here: 1. network setup with DHCP, 2. sharing files over the network with the network file system (NFS). After we cover this, we will come to some more general ideas of administration.
Most beowulfs use a network structure of master (also network head) and slaves, so that computing jobs are going to be distributed from the master to the slaves. All machines of the cluster are connected to the switch. The head will additionally interface with an external network. Master and slaves will share user data over the network. It is easiest to only install the master and one slave (called golden slave) in a first step. In a later chapter we will come to cloning, which is the process of creating machines that are identical to the golden slave. Alternatively to cloning, one may choose to do a diskless boot.
Practically this means, that the master (or head node) has two network interfaces (say eth0, eth1), one connected to the outside world and one connected to the cluster intranet over a network switch. All other computers (the slaves or nodes) are connected to the switch. In order to start processes on the cluster a user logs in on the master and spawns the processes from there to the slaves.

## Outline

* OS and Software
* Diskless Boot
* Networking
* Shared directories and SSH
* Miscellaneous
# Building a Beowulf Cluster/Installation, Configuration, and Administration/OS and Software

There are linux distributions specialized on beowulf clusters, such as Rocks Clusters, which can facilitate the installation and administration of clusters. Unfortunately, rocks clusters (v. 5) didn't recognize the network cards of our computers. We tried the Ubuntu Server Edition (Hardy), which didn't recognize the CD-ROM. Fedora 9 recognized all hardware at once, so this was our distribution of choice.
Linux isn't the only choice, Solaris, AIX, DragonflyBSD, and many more systems have and can be used in clusters. The basic method is the same, often only with minor changes (e.g. Sun Studio instead of GCC).
For master and slaves, we started from vanilla installations.
A selected list of software:
* basic gnu toolchain
* editors: vim, emacs, ed
* version control software: subversion, git
* openssh server+client
* X11
* script languages: Perl, python, R, matlab
* compilers: c/c++, java, fortran, mpicc
* sun java
* mpich2, pvm
# Building a Beowulf Cluster/Cloning of Slaves

When master and one slave (the golden slave) are installed and configured and now we want to scale up this configuration to more slaves by replicating the exact configuration of the golden slave.
Installing and configuring the OS on each machine manually is cumbersome and prone to error. However, nodes are identical, so why not just copy everything we need? This process is called cloning. We first setup a so-called golden node or model node and then transfer the system to other slave machines. Each new node will come with one new entry in the head node's DHCP server file (/etc/dhcpd.conf) and /etc/hosts file.
For preparation, make sure that in /etc/fstab and in the /boot/grub/menu.lst, there are no physical addresses of hardware (e.g. a hard disk), as they will be different among the nodes. All hardware should be addressed by their subdirectory in /dev which you can see in the output when you type mount.
I used low level R/W with dd and piping to and from netcat, respectively on machine to clone from and machine to clone to, as described in a howto. We clone using convert and copy (dd) and netcat (nc).
On the golden slave (or an identical clone) you run:
On the completely blank soon-to-be-slave you run:
where 192.168.1.1 is the ip of the golden slave. This presupposes the disk of soon-to-be slave is at least as big as the disk in the golden slave.
This took several hours time (it said 158GB read/written), but it worked.
# Building a Beowulf Cluster/Installation, Configuration, and Administration/Diskless Boot

There are plenty of reasons one may choose to do a diskless boot for a cluster. For instance, when using old computers do build a beowulf, the use of their old hard disks devices would make the system less reliable, due to their probability of failure.
# Building a Beowulf Cluster/Installation, Configuration, and Administration/Miscellaneous

These two scripts can help in setting up other user accounts or installing additional software.
GNU Screen can help you speed up the configuration. On a side note, using screen the above two scripts could be already used for parallelization of computing tasks, however there are dedicated protocols for more advanced usage, you might want to have resource balancing, for example.
To create more users, create them on node0 and node1. Then from node1 you copy /etc/passwd and /etc/group to the other slaves.
# Building a Beowulf Cluster/Installation, Configuration, and Administration/Networking

We want the computers to work in a local network.
The easiest way to setup the network is by DHCP. For practical purposes it is easiest to set up dynamic addresses (DHCP) handled by the master on the basis of physical addresses of slaves' network interfaces. DHCP simplifies the installation of new nodes, because the mac address and hostname is the only thing that is different among the nodes and the DHCP server on the master can manage a new node by a new entry into the configuration file.
In this example we will set up the network IPs to 192.168.1.1 until 192.168.1.8, where 8 is the master.
The idea is to give to slaves the names nodei corresponding to their ip address 192.168.1.i.
Note that the DHCP server provides IP addresses for the other machines not for itself. The master you give a static ip address (192.168.1.250 here). In red hat based distributions this is configured in /etc/sysconfig/network-scripts/ifcfg-eth0 or /etc/sysconfig/network-scripts/ifcfg-eth1.
I configured eth0 for the organization network and eth1 for the cluster intranet. Example files: /etc/sysconfig/network-scripts/ifcfg-eth0 corresponds to your organization network settings.
For the slaves, the interface to the cluster intranet is as follows:
If you don't use a DNS service on your head you use the DNS service of the network of your organization.
Note in /etc/hosts that in the loopback line (first line) the hostname is not given in order to avoid problems with message protocols (PVM, MPI).
You need to activate ip forwarding on the head in order to have internet access on all machines. You enable the firewall and include masquerading on the network interface to you cluster. This you do by changing the /etc/sysconfig/iptables file or using some user interface, e.g. system-config-firewall on red hat based systems. Be careful not to make your firewall too restrictive as this can cause problems.
In the /etc/sysconfig/network you need to have:
You have to reinitiate the network services and startup the dhcp server daemon (dhcpd). To have dhcpd startup at boot, in fedora you the ntsysv program allows you to search a list and mark the corresponding entry.
You may want to setup your printers on master and slave (you can copy an existing printer configuration recursively from /etc/cups e.g. from your local office desktop computer).

## Useful references

* linux networking howto
* linux DHCP howto]
* linux firewall howto]
# Bartending/Cocktails/Flat Liner

Flat liner is a layered cocktail which is drunk from a shooter glass. Tabasco sauce lies between two layers of spirits forming a line between them. In Estonia, this drink is also known under the name "Millimalikas" which is Estonian for "Jellyfish".

### Ingredients

* 1 oz. Sambuca
* 1 oz. Tequila
* 1 dash Tabasco sauce

### Glass

shooter glass

### Procedure

* Add one ounce of Sambuca to a shot glass.
* Shake several drops of Tobasco sauce onto the surface of the Sambuca.
* Hold an inverted teaspoon in the glass and carefully layer the tequila over the Sambuca.
* Serve.
# Bartending/Cocktails/Fourth Estate Cocktail

This cocktail is for people who like the bitter taste of wormwood.

### Ingredients

* 1 part Gin
* 1 part Dry Vermouth
* 1 part Sweet Vermouth
* 1 dash Absinthe
Mix in a cocktail shaker over ice. Serve in a cocktail glass.

### Variations

* Pimm's No.1 may be used in place of the Gin for a different flavor.
* Bitters or Pernod Ricard Pastis may be used in the place of the absinthe if a good absinthe is unavailable.
# Bartending/Cocktails/Gin and Ginger

A Gin and Ginger is a cocktail created in the following way:
Approximately 1.5 ounces (37.5 milliliters) of gin is poured over ice in a chilled Highball glass - this is then topped with Ginger Ale.
# Bartending/Cocktails/French 75

The French 75 is a cocktail of gin and champagne flavoured with lemon,

### Ingredients

* 1½ ozs. (40 ml) gin
* 2 tsp. caster (superfine) sugar
* 1 tbs. lemon juice
* Champagne

### Garnish

cherry or orange slice

### Glass

flute or Collins

### Procedure

* In a flute or Collins glass add the gin.
* Top with a half flute of sparkling wine or champagne.
* Add sugar (it will fizz up so make sure the flute isn't full yet) then top off with more sparkling wine.

### Variations

    Combine sugar, lemon juice, and gin in a shaker full of ice. Shake well, then pour into a tall glass and top with champagne. (If possible, ice the glass ahead of time.)

## External Links

* French 75 Video on Small Screen Network
# Bartending/Cocktails/Flaming Engineer

The Flaming Engineer is a cocktail originating at Ryerson University in Toronto, Canada, and is very popular among engineering students and in the surrounding area.

### Ingredients

* 3/4 pint Molson Canadian beer
* 1 1/2 oz. amaretto
* 1 1/2 oz. Canadian Club whiskey
* orange juice

### Glass

20 oz. beer mug

### Procedure

* Pour the beer into the beer mug.
* Add the amaretto and the whiskey.
* Fill with orange juice.

## Other Names

This drink is also known as a Billy and Dr. Boil My Gladiator

## References

* Drinksmixer
# Bartending/Cocktails/Gin Rickey

In a highball glass combine with ice:
* 1 1/2 oz gin
* juice from half a lime
* fill with soda
Garnish with the lime.
# Bartending/Cocktails/Gin and Orange Juice

Often called an Orange Blossom, this drink is simply 1.5oz Gin topped with Orange Juice.
# Bartending/Cocktails/Flaming Dr. Pepper

The Flaming Dr. Pepper is a cocktail with a taste reminiscent of the commercial soft drink 'Dr. Pepper'.

## Ingredients

* 3/4 shot Amaretto
* 1/4 shot Bacardi 151 or Everclear
* 1/2 pint Beer

## Glass

* Shot glass
* Pint glass

## Instructions

In a single shot glass, delicately pour the 1/4 shot of Bacardi on top of the 3/4 shot of Amaretto being careful to avoid mixing the 2 ingredients together. When the consumer is ready, use a match to ignite the Bacardi in the shot glass and drop the shot into the half pint of beer. The drink should be quickly consumed immediately following the dropping of the shot into the beer.

## Notes

Use caution when making flammable cocktails as the flame can often be invisible.

## Related Cocktails

* Numerous alcoholic beverages whose flavour resembles that of soft drinks exist. For example the Cheeky Vimto
# Bartending/Cocktails/Gin and Tonic

Many different ratios of the gin and tonic cocktail exist. The most common ratios are 1 part gin to 3 parts tonic and 1 part gin to 1 part tonic. A good gin and tonic, however, is just in the middle of those ratios.
To make a Gin and Tonic you will need the following ingredients:
* Tonic
* 1 1/2 oz Gin (or 1 jigger)
* 1 Wedge of lime or lemon.
First, take the wedge of Lime (or lemon, lime is preferable) and squeeze gently while running round the rim of the glass then drop in the bottom. Add plenty of ice, about 2/3 filling your glass. Pour the Gin first, then fill the glass to the top with tonic. You should always pour the alcohol first so that stirring is not required.
# C++ Language/Std/Stl/Algorithms/Querying/Searching

The algorithm std::find_if(x.begin, x.end, callableObject) returns an iterator to the first item that it finds satisfying the callable-object (which must return a bool).
Additional information about searching algorithms (includes interactive examples)
# C++ Language/Std/Stl/Algorithms/Modifying/Copying

If you have an appropriate callable-object, then copying can be conditional, with item-by-item testing of that condition: std::copy_if(src.begin,src.end,desti.begin,IsOdd).
Additional information about copying algorithms (includes interactive examples)
# C++ Language/Std/Stl/Algorithms/Querying

A "querying" algorithm is an algorithm that computes some kind of answer, without having any side-effect on the collection data.
* Counting
* Searching
* Accumulating
# C++ Language/Std/Stl/Algorithms/Querying/Accumulating

The std::accumulate algorithm iterates over items, accumulating them into a summation (or into some other kind of combination, if you provide a custom callable-object for doing each accumulation step).
Additional information about the std::accumulate algorithm (includes interactive examples)
# C++ Language/Std/Stl/Algorithms/UsageWithCArray

A C-pointer implements operations (e.g., ++) that some STL algorithms expect from their iterators. Thus, some algorithms (including std::copy) allow you to use a C-array as if it were a STL collection.
Additional information about using STL algorithms with a C-array
# C++ Language/Std/Stl/Algorithms/Modifying

Some STL algorithms are designed to modify a collection of items.
* Copying
* Removing
* Reordering
# C++ Language/Std/Stl/Algorithms/Modifying/Removing

The std::remove algorithm doesn't actually remove any items. Instead, it shifts the items-to-be-removed to the end of the collection. You need to call the collection class' item-removal function in order to complete the removal process.
Additional information about algorithms for the removal of items
# C++ Language/Std/Stl/Algorithms/Modifying/Reordering

The std::sort algorithm uses a predicate callable-object for all of its internal comparisons between two items. That predicate defaults to std::less<>.
Additional information about reordering algorithms (includes interactive examples)
# C++ Language/Std/Stl/Algorithms/Querying/Counting

A sorted collection has a built-in mapciVar.count('i') member function that is most efficient. But for a sequence collection, you need to use the count algorithm.
Additional information about counting algorithms (includes interactive examples)
# C++ Language/Std/Stl/CallableObjects

The purpose of a "callable-object" is to abstractly refer to one specific invoke-able subroutine. A callable-object exists as an instance of std::function<>.
* A Function Name as a Value
* Member Function
* Implicit Getter-Function
* Functor
* Lambda
* Generic Lambda
* Binding a new Function
# Caro-Kann Defence - Advance Variation

White seemingly has a large number of choices here, although 5.Be2 is most commonly played. 5.a3 and 5.c3 are two reasonable alternatives - none of the others have given white much success.

## Theory table

For explanation of theory tables, see theory table and for notation, see algebraic notation. .
1.e4 c6 2.d4 d5 3.e5 Bf5 4.Nf3 e6
| 5 |
| Be2 |
| a3 |
| c3 |
| Be3 | -+ |
| Nbd2 | -+ |
| Nc3 | -+ |
| c4 | -+ |
| Bg5 | -+ |
When contributing to this Wikibook, please follow the Conventions for organization.

## References

* Nunn's Chess Openings. 1999. John Nunn (Editor), Graham Burgess, John Emms, Joe Gallagher. ISBN 1-8574-4221-0.
* Modern Chess Openings: MCO-14. 1999. Nick de Firmian, Walter Korn. ISBN 0-8129-3084-3.
* Kasparov, Garry, & Keene, Raymond 1989 Batsford chess openings 2. ISBN 0-8050-3409-9.
# Caro-Kann Defence - Advance Variation

Black has a large number of options here. In line with the typical Caro-Kann theme of playing for c5, black usually responds with either 5...Nd7, or 5...c5. Interestingly, highlighting the solidity of the Caro-Kann, the unorthodox moves, except for the tempo-wasting 5...Bg4, and 5...a6, unsuccessfully debuted by Karpov against Anand in 1991, have all shown reasonable success for black.

## Theory table

For explanation of theory tables, see theory table and for notation, see algebraic notation. .
1.e4 c6 2.d4 d5 3.e5 Bf5 4.Nf3 e6 5.Be2
* 5
* Nd7
* c5
* Ne7
* h6
* Bg6
* Bb4+
* Be7
* Qb6
* Bg4
* a6
* h5
* Nh6
* Na6
When contributing to this Wikibook, please follow the Conventions for organization.

## References

* Nunn's Chess Openings. 1999. John Nunn (Editor), Graham Burgess, John Emms, Joe Gallagher. ISBN 1-8574-4221-0.
* Modern Chess Openings: MCO-14. 1999. Nick de Firmian, Walter Korn. ISBN 0-8129-3084-3.
* Kasparov, Garry, & Keene, Raymond 1989 Batsford chess openings 2. ISBN 0-8050-3409-9.
# Caro-Kann Defence - Advance Variation

Black has rarely been so bold as to play 5...Bb4+, and although theory is limited, black has seen surprising success with this line. White has responded with 6. Nbd2, or, more rarely, 6.c3.

## Theory table

For explanation of theory tables, see theory table and for notation, see algebraic notation. .
1.e4 c6 2.d4 d5 3.e5 Bf5 4.Nf3 e6 5.Be2 Bb4+
* 6
* Nbd2
* c3
When contributing to this Wikibook, please follow the Conventions for organization.

## References

* Nunn's Chess Openings. 1999. John Nunn (Editor), Graham Burgess, John Emms, Joe Gallagher. ISBN 1-8574-4221-0.
* Modern Chess Openings: MCO-14. 1999. Nick de Firmian, Walter Korn. ISBN 0-8129-3084-3.
* Kasparov, Garry, & Keene, Raymond 1989 Batsford chess openings 2. ISBN 0-8050-3409-9.
# Caro-Kann Defence - Advance Variation

In the limited number of games this has been played in serious chess, it's invariably ended in defeat for black. It wastes a tempo, and not in line with conventional Caro-Kann strategy for black. White simply carries on developing, either by castling, or bringing the knight out.

## Theory table

For explanation of theory tables, see theory table and for notation, see algebraic notation. .
1.e4 c6 2.d4 d5 3.e5 Bf5 4.Nf3 e6 5.Be2 Bg4
* 6
* O-O
* Nbd2
When contributing to this Wikibook, please follow the Conventions for organization.

## References

* Nunn's Chess Openings. 1999. John Nunn (Editor), Graham Burgess, John Emms, Joe Gallagher. ISBN 1-8574-4221-0.
* Modern Chess Openings: MCO-14. 1999. Nick de Firmian, Walter Korn. ISBN 0-8129-3084-3.
* Kasparov, Garry, & Keene, Raymond 1989 Batsford chess openings 2. ISBN 0-8050-3409-9.
# Caro-Kann Advance Variation
## Theory table

For explanation of theory tables, see theory table and for notation, see algebraic notation. .
1.e4 c6 2.d4 d5 3.e5 Bf5 4. Nf3 e6 5. Be2 Nd7
| | 6 |
| 1 | O-O |
| 2 | Be3 |
| 3 | c3 |
| 4 | Nbd2 |
When contributing to this Wikibook, please follow the Conventions for organization.

## References

* Nunns Chess Openings. 1999. John Nunn (Editor), Graham Burgess, John Emms, Joe Gallagher. ISBN 1-8574-4221-0.
* Modern Chess Openings: MCO-14. 1999. Nick de Firmian, Walter Korn. ISBN 0-8129-3084-3.
* Kasparov, Garry, & Keene, Raymond 1989 Batsford chess openings 2. ISBN 0-8050-3409-9.
# Caro-Kann Advance Variation
## Theory table

For explanation of theory tables, see theory table and for notation, see algebraic notation. .
1.e4 c6 2.d4 d5 3.e5 Bf5 4. Nf3 e6 5. Be2 Nd7 6. O-O Ne7 7. Nh4 Bg6
| | 8 |
| 1 | Nd2 |
When contributing to this Wikibook, please follow the Conventions for organization.

## References

* Nunns Chess Openings. 1999. John Nunn (Editor), Graham Burgess, John Emms, Joe Gallagher. ISBN 1-8574-4221-0.
* Modern Chess Openings: MCO-14. 1999. Nick de Firmian, Walter Korn. ISBN 0-8129-3084-3.
* Kasparov, Garry, & Keene, Raymond 1989 Batsford chess openings 2. ISBN 0-8050-3409-9.
# Caro-Kann Defence - Advance Variation

A sounder response than 4. Bd3, though less ambitious than 4. Nc3, 4. Nf3 was popularized by English Grandmaster Nigel Short.
It is almost always met with 4...e6, with black aiming ultimately to play c5.

## Theory table

For explanation of theory tables, see theory table and for notation, see algebraic notation. .
1.e4 c6 2.d4 d5 3.e5 Bf5
* 4
* e6
* h6
* Bg4
* Nd7
When contributing to this Wikibook, please follow the Conventions for organization.

## References

* Nunn's Chess Openings. 1999. John Nunn (Editor), Graham Burgess, John Emms, Joe Gallagher. ISBN 1-8574-4221-0.
* Modern Chess Openings: MCO-14. 1999. Nick de Firmian, Walter Korn. ISBN 0-8129-3084-3.
* Kasparov, Garry, & Keene, Raymond 1989 Batsford chess openings 2. ISBN 0-8050-3409-9.
* This Chess related article is a stub. Please assist Wikibooks by expanding it.
# Caro-Kann Advance Variation
## Theory table

For explanation of theory tables, see theory table and for notation, see algebraic notation. .
1.e4 c6 2.d4 d5 3.e5 Bf5 4. Nf3 e6 5. Be2 Nd7 6. O-O
| | 6 |
| 1 | Ne7 |
When contributing to this Wikibook, please follow the Conventions for organization.

## References

* Nunns Chess Openings. 1999. John Nunn (Editor), Graham Burgess, John Emms, Joe Gallagher. ISBN 1-8574-4221-0.
* Modern Chess Openings: MCO-14. 1999. Nick de Firmian, Walter Korn. ISBN 0-8129-3084-3.
* Kasparov, Garry, & Keene, Raymond 1989 Batsford chess openings 2. ISBN 0-8050-3409-9.
# Caro-Kann Advance Variation
## Theory table

For explanation of theory tables, see theory table and for notation, see algebraic notation. .
1.e4 c6 2.d4 d5 3.e5 Bf5 4. Nf3 e6 5. Be2 Nd7 6. O-O Ne7 7. Nh4
| | 7 |
| 1 | Bg6 |
When contributing to this Wikibook, please follow the Conventions for organization.

## References

* Nunns Chess Openings. 1999. John Nunn (Editor), Graham Burgess, John Emms, Joe Gallagher. ISBN 1-8574-4221-0.
* Modern Chess Openings: MCO-14. 1999. Nick de Firmian, Walter Korn. ISBN 0-8129-3084-3.
* Kasparov, Garry, & Keene, Raymond 1989 Batsford chess openings 2. ISBN 0-8050-3409-9.