<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Parallel Computing on Digi Hunch</title><link>https://static.digihunch.com/tag/parallel-computing/</link><description>Recent content in Parallel Computing on Digi Hunch</description><generator>Hugo -- gohugo.io</generator><language>en-US</language><lastBuildDate>Sat, 20 Jul 2024 16:48:26 -0400</lastBuildDate><atom:link href="https://static.digihunch.com/tag/parallel-computing/index.xml" rel="self" type="application/rss+xml"/><item><title>High Performance Computing</title><link>https://static.digihunch.com/2020/12/high-performance-computing-cluster/</link><pubDate>Fri, 11 Dec 2020 23:42:00 -0400</pubDate><guid>https://static.digihunch.com/2020/12/high-performance-computing-cluster/</guid><description>&lt;h3 class="wp-block-heading" id="h-overview"&gt;Overview&lt;/h3&gt;&#10;&lt;p class="wp-block-paragraph"&gt;High Performance Computing (HPC) has recently been commoditized with the advent of commodity server hardware (x86 server), virtualization technology and cloud delivery model. It is common in specialized industries where intensive computing tasks are required, for example:&lt;/p&gt;&#10;&lt;ul class="wp-block-list"&gt;&#10;&lt;li&gt;HCL (healthcare and life science): drug discovery, computer aided diagnosis (CAD), genome engineering; &lt;/li&gt;&#10;&lt;li&gt;CAD, CAE, CAM (computer aided design, engineering, and manufacturing): 3D modeling, computational fluid dynamics (CFD), finite element analysis (FEA), structural mechanical design, etc &lt;/li&gt;&#10;&lt;li&gt;Finance: portfolio management, automated trading, risk analysis&lt;/li&gt;&#10;&lt;li&gt;Geoscience and geo-engineering: oil and gas exploration, geographic data, weather forecasting;&lt;/li&gt;&#10;&lt;li&gt;Scientific computation&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Computing performance is measured in FLOPS (floating point operations per second) and is usually delivered in a cluster to aggregate the computing power from a number of networked nodes. This is referred to as an HPC cluster. &lt;/p&gt;&#10;&lt;h3 class="wp-block-heading" id="h-hardware-stack"&gt;Hardware stack&lt;/h3&gt;&#10;&lt;p class="wp-block-paragraph"&gt;An HPC cluster features the following components:&lt;/p&gt;&#10;&lt;ul class="wp-block-list"&gt;&#10;&lt;li&gt;Head node (aka master node or login node): a gateway and coordinator; head node may be broken into several nodes&lt;/li&gt;&#10;&lt;li&gt;Compute node (worker node): the executor of jobs; the compute node can either be homogenous or heterogeneous, for different purposes. the number of compute nodes can be quite large&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p class="wp-block-paragraph"&gt;There are four common form factors for server: tower, rack-mount, blade, mainframe. Traditionally, the nodes are rack-mount 1U &amp;#8220;pizza box&amp;#8221; servers. Bladed systems started to replace due to the increased node density, thanks to the shared/redundant power and cooling management. In the past, the HPC cluster is operated in data centres, which is an expensive operation item. In the last decades, many organizations extends their compute workload to the cloud, forming a hybrid model.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;HPC typically has specialized storage system because HPC applications notoriously create large amounts of data. NFS traditionally does not scale well as number of node increases. Some proprietary storage system such as Isilon provides good performance via NFS protocol. There are also open-source parallel file system such as Lustre and HDFS. &lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;HPC networking handles three types of traffic:&lt;/p&gt;&#10;&lt;ul class="wp-block-list"&gt;&#10;&lt;li&gt;computation traffic between compute nodes (if the compute nodes interact with each other)&lt;/li&gt;&#10;&lt;li&gt;file system traffic: for compute nodes to read and write on file system (e.g. NFS)&lt;/li&gt;&#10;&lt;li&gt;administrative traffic: fairly light compared to the two above&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p class="wp-block-paragraph"&gt;For that, many HPC runs two networks, a private (backend) network and a public (frontend) network. Backend network must be high speed and low latency, typically in the form of 10Gig Ethernet, or InfiniBand.&lt;/p&gt;&#10;&lt;h3 class="wp-block-heading" id="h-software-stack"&gt;Software stack&lt;/h3&gt;&#10;&lt;p class="wp-block-paragraph"&gt;On the software layer, the core functionality is &amp;nbsp;&lt;strong&gt;Message Passing Interface (MPI)&lt;/strong&gt;, a specification for the developers and users of message passing libraries. MPI constitutes a standardized and portable message-passing system which consists of a library and a protocol to support parallel computing. MPI enables passing information between various nodes of a HPC cluster or between particular clusters, and has different implementations that provide the libraries to run HPC applications in a distributed manner across different physical nodes.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;In the operation, user submits a job through head node in order to request the resource. User needs to specify the resources for the job (e.g. how many CPU cores, how much memory, etc). The head node runs a scheduler to allocate computing resource based on pre-defined policies, based on priority of jobs, availability of resources, distribution of load, etc. Depending on the nature of the computing jobs, the nodes participating in the task may or may not communicate with one another. If they do need to talk to each other, the program must support it. Such program can be called a cluster program, and the MPI (message passing interface) library greatly facilitates the development of such program. The sub-jobs communicating with each other also creates a considerable amount of network traffic within the cluster.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Cluster software ties all nodes in the cluster together. It turns raw hardware into a functioning cluster by provisioning (installing and configuring) the head nodes. Compute nodes can usually be added or removed dynamically therefore the head nodes should be able to provision compute nodes, and administer cluster, leaving the programming as the job for the user to complete. As mentioned, in parallel programming, the most important HPC tool is MPI (Message Passing Interface), which allows programs to talk to one another over cluster networks. There are both open (e.g. &lt;a href="https://www.open-mpi.org/" class="rank-math-link"&gt;Open MPI&lt;/a&gt;) and commercial MPI (e.g. &lt;a href="https://docs.microsoft.com/en-us/message-passing-interface/microsoft-mpi" class="rank-math-link"&gt;Microsoft MPI&lt;/a&gt;) versions. Cluster software should also provide compilers, debuggers, and profilers in addition to MPI.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;There are cluster software in both Linux and Windows operating systems: &lt;a href="http://www.rocksclusters.org/" class="rank-math-link"&gt;Rocks Clusters&lt;/a&gt;, &lt;a href="https://oscar-cluster.github.io/oscar/" class="rank-math-link"&gt;Oscar &lt;/a&gt;(Open Source Clusters Application Resources), Red Hat HPC solution, &lt;a href="https://docs.microsoft.com/en-us/powershell/high-performance-computing/overview?view=hpc19-ps" class="rank-math-link"&gt;Microsoft HPC pack&lt;/a&gt; and &lt;a href="https://docs.aws.amazon.com/parallelcluster/latest/ug/what-is-aws-parallelcluster.html" class="rank-math-link"&gt;AWS Parallel Cluster&lt;/a&gt;.&lt;/p&gt;&#10;&lt;h3 class="wp-block-heading" id="h-implementation"&gt;Implementation&lt;/h3&gt;&#10;&lt;p class="wp-block-paragraph"&gt;&lt;a class="rank-math-link" href="https://www.webmo.net/support/pdf/byoc.pdf"&gt;Here&lt;/a&gt; is an example of setting up HPC cluster with CentOS. Despite of the well documented steps, note that the author of the document refers to HPC cluster simply as cluster, which is ambiguous. There are&lt;strong&gt; three basic motivators for creating a cluster&lt;/strong&gt;: high performance computing (HPC), network traffic load balancing, and service resilience in the form of high availability (HA). The author should be specific in the &lt;a class="rank-math-link" href="https://www.webmo.net/support/pdf/byoc-centos7.pdf"&gt;document&lt;/a&gt; about the HPC cluster. If RDMA (Infiniband) network is involved, a configuration guide is provided in RedHat literature.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;&lt;a href="https://aws.amazon.com/getting-started/hands-on/deploy-elastic-hpc-cluster/" class="rank-math-link"&gt;Here&lt;/a&gt; is an example of deploying HPC cluster in AWS. &lt;a href="https://docs.microsoft.com/en-us/powershell/high-performance-computing/overview?view=hpc19-ps" class="rank-math-link"&gt;Here&lt;/a&gt; is the guide to deploy HPC pack in Microsoft technologies.&lt;/p&gt;&#10;&lt;h3 class="wp-block-heading" id="h-hpc-and-big-data"&gt;HPC and Big Data&lt;/h3&gt;&#10;&lt;p class="wp-block-paragraph"&gt;HPC and Big Data are two distinctive computing paradigmes. Although there is some signs of convergence and blurred boundaries, it is still a long way before one can treat HPC and Big Data interchangeably. This &lt;a href="https://ieeexplore.ieee.org/document/7776538" class="rank-math-link"&gt;paper&lt;/a&gt; does a phenomenal job in comparing the two paradigms. &lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;The fundamental difference lies in the respective problems they intend to address. HPC focuses on the large computational loads, whereas Big Data targets applications that need to handle very large and complex data sets (usually in the order of multi-terabytes or exabytes). Many scientific data analytics applications are becoming I/O bound in modern systems, such as seismic algorithms, Big Data applications are thus very demanding in terms of storage, to accommodate such a masive amount of data, while HPC is usualy thought more in inters of sheer computational needs. The open-source projects in Big Data also aims to run on conventional hardware to make it easier and less expensive to scale. This is not the main focus of HPC.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;So, you can run Big Data (e.g. Hadoop) analytics jobs on HPC gear. On the other hand, you can&amp;#8217;t run HPC jobs on commodity hardware as commonly seen in the Big Data stack. Both HPC and Hadoop analytics use parallel processing of data. In a Hadoop/analytics environment, data is stored on commodity hardware and distributed across multiple nodes of hardware. In HPC, where the size of data file is much greater, data storage in centralized. Also, because of the sheer volume of its files, HPC also requires more expensive networking communications such as Infiniband, because the size of the file it processes require high throughput and low latency.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;In BigData job, each query in Hadoop reads data from disk and runs as a separate MapReduce job. Spark enables in-memory iterative processing (through the RDD abstraction), allowing the user to query repeatedly on a dataset without having to perform intermediate disk operations. RDD are exposed in the Spark API where each dataset is represented as a read-only object, and transformations are invoked using methods on these objects. For an example project, check out &lt;a href="https://static.digihunch.com/2020/09/spark-cassandra-and-python/" class="rank-math-link"&gt;this&lt;/a&gt; post.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;The underlying software stacks for HPC and Big Data are fundamentally different, mainly due to the differences represent in their target class of applications, as outlined in the diagram below:&lt;/p&gt;&#10;&lt;figure class="wp-block-image size-large"&gt;&lt;img loading="lazy" decoding="async" width="1598" height="862" src="https://static.digihunch.com/wp-content/uploads/2020/12/image.png" alt="" class="wp-image-1942"/&gt;&lt;figcaption class="wp-element-caption"&gt;software stack difference between HPC and Big Data&lt;/figcaption&gt;&lt;/figure&gt;&#10;&lt;p class="wp-block-paragraph"&gt;As to which one is for me, the &lt;a href="https://www.techrepublic.com/article/4-steps-to-implementing-high-performance-computing-for-big-data-processing/" class="rank-math-link"&gt;over-simplified advice&lt;/a&gt; is: if you can avoid HPC and just use Hadoop for your analytics, do it. It is cheaper, easier, and more cloud friendly. However, bear in mind that an all-Hadoop shop is not possible for many industries such as life sciences, weather, pharmaceutical, and academic applications.&lt;/p&gt;&#10;&lt;nav class="wp-post-navigation" aria-label="Post navigation"&gt;&#10;&lt;a rel="prev" href="https://static.digihunch.com/2020/12/instance-initialization-with-aws-cdk-in-python/"&gt;&lt;span class="wp-post-navigation-label"&gt;Previous Post&lt;/span&gt;&lt;strong class="wp-post-navigation-title"&gt;AWS CDK example in Python – provision Kubernetes Nodes&lt;/strong&gt;&lt;/a&gt;&#10;&lt;a rel="next" href="https://static.digihunch.com/2020/12/ansible-tower-lab-environment-on-aws/"&gt;&lt;span class="wp-post-navigation-label"&gt;Next Post&lt;/span&gt;&lt;strong class="wp-post-navigation-title"&gt;AWS CDK example in Typescript – provision an AWX server&lt;/strong&gt;&lt;/a&gt;&#10;&lt;/nav&gt;&#10;</description></item></channel></rss>