Using Beowulf to make a common PC variable cluster

Source: Internet
Author: User
Tags file system require requires reserved variable advantage linux
Now, Linux has a very important impact in IT industry, in addition to its free, efficient, reliable and other advantages, for computer scientists and those who need to do a lot of computing, it is a very powerful tool. Since Donald Becker launched the Beowulf cluster calculation, Thomas Sterling, who works at NASA's Goddard Space Flight Center, has expanded the application of Linux in High-performance parallel computing. Today, a large number of common PC based clusters appear at various levels of laboratories, industrial technology centers, universities and even small colleges. If someone asks you if a question about scientific computing can be solved by some loose computational resources. The answer is certainly yes. We can use the Beowulf cluster, which can use a lot of ordinary PCs to make a cluster to solve the problems we face, and the price advantage of this cluster is unmatched by the traditional parallel computer.

How to create a Beowulf cluster in fact, using an existing PC or an old PC that you don't use, anyone can build a parallel system of their own to practice parallel programming or parallel operations. In a computer lab, we can make a PC into a dual-boot system (which can go into Windows or Linux as needed) and use it for two purposes. In addition, for those machines that are no longer in use, they can be made into a parallel computing system like stone soupercomputer.

No two Beowulf clusters are exactly the same. In fact, the hardware and software configurations of such systems are so flexible that they can be easily customized into different combinations. Although each Beowulf cluster system is different and its configuration is based on the needs of the application, there are some basic requirements that are the same. Let's take a look at some of the basic issues you need to consider when creating a cluster.

Minimum requirements for creating a cluster to create a cluster, each node should contain at least one Intel 486 CPU and motherboard. Although Intel 386 can work, its performance will not be worth the effort. Memory requirements depend on the needs of the target application, but each node requires at least 16MB of memory. Most applications will require each node to have more than 32MB of memory. By using a centralized disk space, a node can be started from a floppy disk, a small-capacity hard disk, or a network file system. After startup, nodes can access their own root partitions on the file system via the network, typically through NFS (network File system). In an environment with High-bandwidth and high-performance servers, this configuration will work very well. For better performance, you should install an operating system, swap partitions on your local disk, and the data can be obtained at each node. Each node should have at least 200MB of disk space for operating system components and for swap space, and should have 400MB or more space reserved for use in program execution. Each node must contain at least one network card (preferably a high-speed network card). Finally, each node needs a video card, a hard drive, and a power supply. The keyboard and the monitor are only required for system installation and configuration.

It's important to note that all of the hardware you choose to use has a driver or corresponding module in Linux, which is not a problem unless the hardware is very old. For the primary node that needs to be managed for the entire cluster, it is best to install an X server for convenience. During installation, if a particular component has a problem or there is no driver, you can ask for help in the forum.

Network connections if possible, each node is preferably in a separate LAN and has a hub of its own. This ensures that the network communication can be carried out smoothly. The first or primary node in the cluster should have two network adapters, one of which is connected to the internal network and the other is connected to a public network. This is especially useful for user logins and file transfers. In an internal network, you need to use an IP address that is not used on the Internet. In general, the simplest approach is a class 10.0.0.0 address because these addresses are reserved specifically for networks that do not have routes. In this example, the/etc/hosts file for each node appears as follows:

With a node number of 2, the Ifcfg-eth0 configuration file using Red Hat Linux looks like this:

In addition, we often need a DNS, especially for internal networks where node names and addresses are constantly changing. DNS can run at the first node to provide a name/address resolution for the nodes of the internal network.

Locally stored on the issue of loading the operating system, creating a Beowulf cluster requires a predetermined number of storage-side configuration decisions. Because once the installation is complete to make changes to reinstall all the nodes, so be sure to do very careful consideration. While most linux-based Beowulf clusters run on Red Hat Linux distributions, virtually all Linux distributions support basic clusters. " Red hat installation is very simple, we can use the CD or through the first node of the cluster to install (provided that there is already a distribution copy on the node). In the actual use of the process, many people found that from the main node through FTP to load the operating system to each node than through NFS mount root partition better. This approach avoids unnecessary network traffic and preserves bandwidth for information transfer while the application is running.

The Red Hat Linux Runtime Environment requires approximately 100MB of disk space per node, but in practice it is necessary to include a compilation and some other tools at each node. Therefore, in the configuration, each operating system requires approximately 175MB of disk space. Although there are clusters of switched partitions configured on a regular file system, it is a more efficient choice to use a dedicated swap partition on a local disk. In general, the node's swap space should be twice times the size of memory, and when the memory is greater than 64MB, the swap space should equal the size of the memory. In practice, when the memory is 64MB to 128MB, we typically set the swap partition to 128MB. So, if a node has 32MB of RAM and has 2 hard drives, then we should load the Linux system onto the main driver and use the other hard disk as swap space (64MB) and local run space (138MB).

Management and maintenance of cluster management systems is a tedious task, especially for large clusters. However, we can find some tools and scripts from the Internet to simplify the work. For example, a node must be synchronized with other nodes in time and system files (/etc/passwd,/etc/group,/etc/hosts,/ETC/HOSTS.EQUIV, and so on). A simple script that can be executed by Cron will be able to complete the synchronization process.

Once all the nodes have been loaded and configured, we can develop and design parallel applications to take full advantage of the new system's computing power.

Developing parallel applications for cluster computing under Linux, we can use a commercial compiler, or we can use a free compiler. GCC, g++, and Fortran (G77) compilers are included in most Linux distributions. in which C-+ + + compiler has been very good, and the Fortran compiler is also in constant progress. Commercial compilers can be obtained from companies such as Absoft, Portland group, the numerical algorithms group. If properly configured, some commercial FORTRAN-90 compilers can automatically implement parallel computations. In general, developing parallel code requires the use of PVM (parallel virtual machines), MPI (Information transfer interface), or other communication libraries between processors for clear messaging. Both PVM and MPI are free, and can be implemented through simple library calls to communicate information between nodes in the process of computation.

Of course, not all computing tasks are suitable for parallel computing. Generally speaking, in order to make full use of the advantages of parallel computing, it is usually necessary to do some development work for the task. Many scientific problems can be subdivided, that is, they can be decomposed into relatively independent modules so that they can be processed at each individual node. For example, an image processing task can often be subdivided to allow each node to process a part of the image. The effect is better when an image can be processed independently (for example, when processing this part of the image does not require other parts of the information).

The most dangerous flaw in parallel computing is that it turns a computational problem into a communication problem (whether it's using an existing parallel operation code or a new development code of your own). This kind of problem generally occurs when the task is excessively refined, so that the time that each node transmits data in order to keep synchronization exceeds the time that the CPU calculates. In this case, fewer nodes may be used instead of getting more uptime and leveraging resources more fully. This means that, for different parallel applications, adjustments and optimizations are made based on the load and traffic computed by the local node.

Finally, when developing parallel algorithms, if the nodes of the cluster environment are different, you should consider the problem fully. In fact, when running a parallel application, the CPU speed of each node is very critical, therefore, in a different cluster, the task is simply distributed evenly, then the faster CPU must wait for slower CPU to complete its task, which is obviously unreasonable. Therefore, the design of appropriate algorithms can handle this situation well, of course, regardless of the algorithm, we must fully consider the problem of communication overload.

Parallel processing can be organized in a number of ways, but Master/slave is the easiest way to understand and write programs. In this mode, one node as master, and the other as slave. The master node usually determines how the task is split and the delivery of the command information, while the slave node is responsible for processing the assigned tasks and reporting to master when the task is completed.

In fact, in the development of parallel code, there is no strict rules, but to be based on the actual situation. The prerequisite for optimizing your hardware configuration and algorithms is to know the details of the application you want to run. In different clusters of nodes, load balancing in each node and communication in each node depends on the specifics of the hardware. In the fast communication environment, the task can be divided into finer, otherwise it is not appropriate to the task too refined.

It should be said that the "Beowulf movement" will be parallel computing popular. Parallel code developed using standard Information transfer libraries in Beowulf systems can run directly above a business-level supercomputer without any changes. As a result, the Beowulf cluster can serve as an entry point to transition to mainframes when needed. In addition, a cheap, generic cluster means that a parallel computer environment can be used for specific tasks, and large business supercomputers are too expensive to focus on a single application. Obviously, as the parallel environment becomes more and more applied to the real work, it will further promote its application in various fields.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.