Skip to content
wrathematics edited this page Mar 9, 2015 · 5 revisions

Integrating the Thrust Graph Library to R

Summary: Build an interface to the Thrust Graph Library, and offer some usability imrpovements to the Rth package.

Description: The Rth package offers parallelism to R via the thrust template library. Thrust allows developers to write their C++ code once (if some care is taken) and have it compile to use OpenMP, Intel TBB, or Cuda. This enables users to compile the Rth package against their preferred parallel backend and have multicore or GPU parallelism with many common functions (e.g., sort, distance computations, pearson correlation, ...).

In this project, we hope to extend Rth functionality to include an interface to the Thrust Graph Library, to bring parallel graph computations to R. In addition, we intend to include some basic graphics capabilities for existing Rth routines.

For students who are in the United States (or have a professional affiliation there), we will provide access to NSF an supercomputing resource. This will enable the student to perform development and testing with many cores (16+) and an NVIDIA GPU, without needing to purchase special hardware. Unfortunately, due to legal restrictions, we can not extend this offer to students who have no US-based affiliation.

Related work: The current gold standard for network analysis in R is igraph. While igraph is a spectacular package, it is inherently serial. This project would have vastly reduced functionality compared to igraph; but for certain computationally expensive graph operations, the Rth approach (same code/different parallel backend) is compelling.

Potential tasks:

  • Develop a new package RthGraph that integrates the Thrust Graph Library.
  • Add some simple graphics capabilities for existing Rth routines.
  • Improve the compatibility of existing Rth routines with GPU builds.

Skills required:

  • C++
  • Parallel programming background.
  • Ability to work in a remote Linux environment strongly preferred.

Test: Write a C/C++ function, callable by R (use of Rcpp is fine) that solves a simple numerical problem (e.g., sum of elements of a vector), and (correctly) uses OpenMP to perform the operation in parallel.

Mentor: Norm Matloff ([@](mailto:nsmatloff {at} ucdavis {dot} edu)) and Drew Schmidt ([@](mailto:wrathematics {at} gmail {dot} com))

Test Solutions: Shyam Venkataraman offers a solution computing the mandelbrot set.