Skip to content

Latest commit

 

History

History
88 lines (60 loc) · 5.66 KB

README.md

File metadata and controls

88 lines (60 loc) · 5.66 KB

R Parallel

Purpose

Here, we briefly explain different ways to use R in parallel on the Harvard University FASRC Cannon cluster.

Parallel computing may be necessary to speed up a code or to deal with large datasets. It can divide the workload into chunks and each worker (i.e. core) will take one chunk. The goal of using parallel computing is to reduce the total computational time by having each worker process its workload in parallel with other workers.

Cannon cluster basics

Cannon has 1800+ compute nodes with 80,000+ CPU cores. Each compute node is equivalent to a computer and typically made up of CPU cores, memory, local storage, and sometimes a GPU card.

Sequential vs. multi-core vs. multi-node

A sequential (or serial) code uses one single CPU core and each instruction is processed in sequence (indicated by the triangle).

A multi-core (and single-node) code uses one compute node (i.e. one "computer") and it can use any number of cores that comprises a node (indicated by the stars). In Cannon, depending on the partition, the number of cores varies from 32 to 64. In addition, multi-core codes can take advantage of the shared memory between the cores.

A multi-node code uses cores across multiple nodes (indicated by the Xs), which means that we need a special communication between nodes. This communication generally happens using message passing interface (MPI), which has a specific standard for exchanging messages between many computers working in parallel. In R, we show below a few packages that wrap MPI.

In addition to parallel codes, we may also need different strategies to deal with large datasets.

Below we provide a summary of R parallel packages that can be used in Cannon. You can find a complete list of available packages at CRAN. You can also find more examples under Resources

Processing large datasets

Single-node, multi-core (shared memory)

Multi-node, distributed memory

Hybrid: Multi-node + shared-memory

Using nested futures and package future.batchtools, we can perform a multi-node and multi-core job.

Resources