Parallel Nonparametric Kernel Smoothing Methods for Mixed Data Types Using 'MPI'

Nonparametric (and semiparametric) kernel methods that seamlessly handle a mix of continuous, unordered, and ordered factor data types. This package is a parallel implementation of the 'np' package based on the 'MPI' specification that incorporates the 'Rmpi' package (Hao Yu ) with minor modifications and we are extremely grateful to Hao Yu for his contributions to the 'R' community. We would like to gratefully acknowledge support from the Natural Sciences and Engineering Research Council of Canada (NSERC, < https://www.nserc-crsng.gc.ca/>), the Social Sciences and Humanities Research Council of Canada (SSHRC, < https://sshrc-crsh.canada.ca/en.aspx>), and the Shared Hierarchical Academic Research Computing Network (SHARCNET, < https://sharcnet.ca/>). We would also like to acknowledge the contributions of the 'GNU GSL' authors. In particular, we adapt the 'GNU GSL' B-spline routine 'gsl_bspline.c' adding automated support for quantile knots (in addition to uniform knots), providing missing functionality for derivatives, and for extending the splines beyond their endpoints.


npRmpi

npRmpi provides parallel nonparametric kernel methods for mixed datatypes. It is written and maintained by Jeffrey S. Racine ([email protected]) and co-authored by Tristen Hayfield ([email protected]).

Installation

With a working MPI implementation already installed, install the current CRAN release with:

install.packages("npRmpi", dependencies = TRUE)

The CRAN release and the development branch can have different version numbers. To install the development branch directly from GitHub:

remotes::install_github(
  "JeffreyRacine/R-Package-np",
  ref = "npRmpi",
  build_vignettes = FALSE
)

Set build_vignettes = TRUE only when the required vignette toolchain is available.

MPI backend and installation notes

MPICH is the documented macOS build route below; see BUILD.md for linkage checks and session, attach and profile-mode validation. Backend qualification is specific to the platform, runtime version and launch mode, not established by a successful package installation alone.

Historical note: the 0.70-5 release protocol qualified MPICH and waived Open MPI runtime validation because the tested singleton-spawn and prelaunched-master finalization routes did not satisfy its gates. That disposition refers to 0.70-5, not a blanket statement about every backend/version combination.

MPICH via MacPorts

sudo port install mpich-default
sudo port select --set mpi mpich-mp-fortran

export RMPI_TYPE=MPICH
export RMPI_INCLUDE=/opt/local/include/mpich-mp
export RMPI_LIB_PATH=/opt/local/lib/mpich-mp

The package configure script consumes these three RMPI_* variables. RMPI_LIBS is not required. Let R use its configured C/C++/Fortran compilers; do not replace CC and CXX with MPI wrapper compilers unless you have deliberately validated that toolchain combination.

Verify the selected runtime before building:

mpiexec --version
test -f "$RMPI_INCLUDE/mpi.h"
test -f "$RMPI_LIB_PATH/libmpi.dylib"
R CMD config CC
R CMD config CXX
R CMD config FLIBS

From the repository root, build and install a source tarball without hardcoding the package version:

VERSION=$(awk -F': *' '/^Version:/{print $2; exit}' DESCRIPTION)
R CMD build .
R CMD INSTALL "npRmpi_${VERSION}.tar.gz"

See BUILD_MPICH.md for the complete public MPICH recipe and BUILD.md for release-validation expectations.

Quick start

For prediction, no-search refitting with standard errors or gradients, and the 0.70-5 migration guide, use vignette("npRmpi_getting_started", package = "npRmpi"). The Gallery FAQ and runnable quickstarts provide further examples.

Interactive session/spawn mode:

library(npRmpi)
npRmpi.init(nslaves = 1)

set.seed(1)
x <- runif(200)
y <- sin(2 * pi * x) + rnorm(200, sd = 0.2)
bw <- npregbw(y ~ x, regtype = "ll", bwmethod = "cv.ls")
fit <- npreg(bws = bw)
summary(fit)

npRmpi.quit(force = TRUE)

On macOS, npRmpi.quit() without force = TRUE may intentionally retain the worker pool for reuse. Use force = TRUE when the session is finished and a clean teardown is required.

Batch/cluster attach mode:

mpiexec -n 4 Rscript foo.R

foo.R should contain:

library(npRmpi)
is_master <- npRmpi.init(mode = "attach", autodispatch = TRUE,
                         np.messages = FALSE)

if (isTRUE(is_master)) {
  # ... np* calls ...
  npRmpi.quit(mode = "attach")
}

See the installed MPI_SETUP.md guide for session, attach, and profile/manual-broadcast details.

For more information, visit the maintainer's website: https://experts.mcmaster.ca/people/racinej.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("npRmpi")

0.80-2 by Jeffrey S. Racine, a day ago


https://github.com/JeffreyRacine/R-Package-np, https://jeffreyracine.github.io/gallery/


Report a bug at https://github.com/JeffreyRacine/R-Package-np/issues


Browse source code at https://github.com/cran/npRmpi


Authors: Jeffrey S. Racine [aut, cre] , Tristen Hayfield [aut] , Hao Yu [ctb, cph] , The GSL Team [cph] , Numerical Recipes Software [cph]


Documentation:   PDF Manual  


GPL license


Imports compiler, boot, methods, quadprog, quantreg, stats, parallel, tools, crs

Suggests MASS, logspline, ks, testthat, np, withr, knitr, rmarkdown, rgl, htmlwidgets

Linking to crs

System requirements: MPI


See at CRAN