Package doredis. R topics documented: December 15, Type Package. Title Foreach parallel adapter for the rredis package. Version 1.0.

Similar documents
Package doredis. R topics documented: February 19, Type Package

Introduction to the doredis Package

Elastic computing with R and Redis

Package imgur. R topics documented: December 20, Type Package. Title Share plots using the imgur.com image hosting service. Version 0.1.

Distributed Computing Patterns in R

Nesting Foreach Loops

Package future.apply

Package datasets.load

Package parfossil. February 20, 2015

Package cgh. R topics documented: February 19, 2015

Package smoother. April 16, 2015

Package iterators. December 12, 2017

Package lvec. May 24, 2018

2 sybildynfba-package. Dynamic Flux Balance Analysis

Package rcmdcheck. R topics documented: November 10, 2018

NAT Routemaps Outside-to-Inside Support

Package inca. February 13, 2018

Package GenSA. R topics documented: January 17, Type Package Title Generalized Simulated Annealing Version 1.1.

Using the dorng package

Package biganalytics

Package callr. August 29, 2016

Package knitrprogressbar

Package ramcmc. May 29, 2018

Package ssh. June 4, 2018

Package hkclustering

Interacting with Remote Systems + MPI

Package tropicalsparse

Package SPIn. R topics documented: February 19, Type Package

BlueCielo Meridian Enterprise Server Quick start for application administrators

Package rngsetseed. February 20, 2015

Package kirby21.base

Package getopt. February 16, 2018

Package reportr. October 6, 2016

Package intcensroc. May 2, 2018

Package eulerian. February 19, Index 5

Package catchr. R topics documented: December 30, Type Package. Title Catch, Collect, and Raise Conditions. Version 0.1.0

Package RODBCext. July 31, 2017

Package ssd. February 20, Index 5

Package pso. R topics documented: February 20, Version Date Title Particle Swarm Optimization

Package Storm. February 19, 2015

Package RcppProgress

Package keep. R topics documented: December 16, 2015

Package assortnet. January 18, 2016

Package DSL. July 3, 2015

Introduction to dompi

GUI ScreenIO Client/Server Layer Job Timeout Facility

Package GUTS. R topics documented: October 10, Type Package

Package chunked. July 2, 2017

retask Documentation Release 1.0 Kushal Das

TotalView. Debugging Tool Presentation. Josip Jakić

Package filelock. R topics documented: February 7, 2018

Large Software System Programming Project CPSC410 Operating Systems. Loman: Distributed Traveling Salesman Utilizing Simulated Annealing Schedules

Package SAENET. June 4, 2015

SAND CDBMS Nearline for SAP BW v3.1 MR2

Package robustreg. R topics documented: April 27, Version Date Title Robust Regression Functions

Package texpreview. August 15, 2018

Package recoder. R topics documented: July 10, Type Package Title A Simple and Flexible Recoder

Package globalgsa. February 19, 2015

Package primertree. January 12, 2016

Celery-RabbitMQ Documentation

Package logitnorm. R topics documented: February 20, 2015

Package allan. R topics documented: February 19, 2015

Package distance.sample.size

Package dfoptim. April 2, 2018

Automating Administration with Windows PowerShell 2.0

Package genelistpie. February 19, 2015

PPPoE Client DDR Idle-Timer

Developing Enterprise Cloud Solutions with Azure

Configuring AVC to Monitor MACE Metrics

Package alphashape3d

Package sessioninfo. June 21, 2017

Package gsalib. R topics documented: February 20, Type Package. Title Utility Functions For GATK. Version 2.1.

Package RYoudaoTranslate

Package furrr. May 16, 2018

Implementing the Twelve-Factor App Methodology for Developing Cloud- Native Applications

Administrivia. HW1 due Oct 4. Lectures now being recorded. I ll post URLs when available. Discussing Readings on Monday.

COMPUTER NETWORK. Homework #3. Due Date: May 22, 2017 in class

Package IgorR. May 21, 2017

Tutorial 4: Condor. John Watt, National e-science Centre

Announcements. Program #1. Program #0. Reading. Is due at 9:00 AM on Thursday. Re-grade requests are due by Monday at 11:59:59 PM.

Package SASmarkdown. R topics documented: November 30, Version Date Title 'SAS' Markdown

Package spark. July 21, 2017

Package synchronicity

Package intccr. September 12, 2017

Fractals exercise. Investigating task farms and load imbalance

Package curry. September 28, 2016

Introduction to MapReduce (cont.)

Kuyruk Documentation. Release 0. Cenk Altı

COMPUTER NETWORK. Homework #3. Due Date: May 22, 2017 in class

Package gpdtest. February 19, 2015

Package redux. May 31, 2018

parallel Parallel R ANF R Vincent Miele CNRS 07/10/2015

Package SoftClustering

Package callr. January 30, 2018

Package PIPS. February 19, 2015

ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective

Package MicroStrategyR

Package Combine. R topics documented: September 4, Type Package Title Game-Theoretic Probability Combination Version 1.

Package ms.sev. R topics documented: December 21, Type Package

Edition 0.1. real scenarios for managing EAP instances. Last Updated:

Transcription:

Package doredis December 15, 2010 Type Package Title Foreach parallel adapter for the rredis package Version 1.0.1 Date 2010-04-22 Author Maintainer A Redis parallel backend for the %dopar% function Depends R (>= 2.5), rredis, foreach(>= 1.3.0), iterators(>= 1.0.0),utils License GPL-2 LazyLoad yes Repository CRAN Date/Publication 2010-12-15 17:38:53 R topics documented: doredis-package...................................... 2 redisworker......................................... 3 registerdoredis....................................... 4 removequeue........................................ 5 setchunksize........................................ 6 startlocalworkers...................................... 7 Index 9 1

2 doredis-package doredis-package A Redis-based backend for parallel computing with foreach. The doredis package supplies a simple and lightweight parallel backend for the foreach %dopar% function. The foreach package for R defines a modular interface for backend parallel processing implementations. The doredis imlpements a simple but very flexible parallel backend that uses Redis for inter-process communication. The doredis package requires a connection to an available Redis server (not included with the References http://cran.r-project.org/web/packages/foreach/index.html foreach # The example assumes that a Redis server is running on the local host # and standard port. # 1. Open one or more 'worker' R sessions and run: redisworker('jobs') # We use the name 'jobs' to identify a work queue. # 2. Open another R session acting as a 'master' and run this simple # sampling approximation of pi: registerdoredis('jobs') foreach(j=1:10,.combine=sum,.multicombine=true) %dopar% 4*sum((runif(1000000)^2 + runif(1000000)^2)<1)/10000000

redisworker 3 redisworker redisworker Initialize a doredis worker R process. redisworker(queue, host = "localhost", port = 6379, iter = Inf, timeout = 60, log = queue host port iter timeout log A (character) work queue name, or a list or character vector of queue names. The Redis server host name or (character) I. P. address. The Redis server port number. The maximum number of jobs to execute before exiting the worker loop (defaults to infinity). The worker loop terminates if the work queue is deleted after the specified timeout interval. Log messages to the specified destination (defaults to stdout()). The redisworker function enrolls the current R session in one or more doredis worker pools specified by the work queue names. The worker loop takes over the R session until either the work queue(s) are deleted. Nothing is returned but status messages are printed to the log during operation of the worker loop. registerdoredis

4 registerdoredis redisworker('jobs') registerdoredis Register the doredis parallel back end for foreach. The doredis package supplies a simple and lightweight parallel backend for the foreach %dopar% function. registerdoredis(queue, host = "localhost", port = 6379) queue host port A (character) work queue name. The Redis server host or (character) I. P. address. The Redis server port number. The doredis package imlpements a simple but flexible parallel backend for foreach that uses Redis for inter-process communication. The work queue name specifies the base name of a small set of Redis keys that the master and worker processes use to exchange data. Back-end worker R processes advertise their availablility for work with the redisworker function. The doredis parallel backend supports dynamic pools of back-end workers. New workers may be added to work queues at any time and can be immediately used by in-flight foreach computations. Nothing is returned.

removequeue 5 References http://cran.r-project.org/web/packages/foreach/index.html redisworker removequeue ## The example assumes that a Redis server is running on the local host ## and standard port. ## 1. Open one or more 'worker' R sessions and run: redisworker('jobs') ## 2. Open another R session acting as a 'master' and run this simple ## sampling approximation of pi: registerdoredis('jobs') foreach(j=1:10,.combine=sum,.multicombine=true) %dopar% 4*sum((runif(1000000)^2 + runif(1000000)^2)<1)/10000000 removequeue('jobs') removequeue Remove doredis work queues. Use the removequeue function to delete one or more doredis work queues. removequeue(queue) queue A character work queue name or vector or list of queue names. This action will terminate the worker loops running on any corresponding back-end workers. Upon termination the workers will clean up any ancillary Redis keys.

6 setchunksize TRUE is returned if the queues were successfully deleted, FALSE and probably an error condition otherwise. registerdoredis # The example assumes that a Redis server is running on the local host # and standard port. # 1. Open one or more 'worker' R sessions and run: redisworker('jobs') # We use the name 'jobs' to identify a work queue. # 2. Open another R session acting as a 'master' and run this simple # sampling approximation of pi: registerdoredis('jobs') foreach(j=1:10,.combine=sum,.multicombine=true) %dopar% 4*sum((runif(1000000)^2 + runif(1000000)^2)<1)/10000000 removequeue('jobs') setchunksize setchunksize Set the default granularity of distributed tasks. setchunksize(value = 1)

startlocalworkers 7 value The new default chunk size. The setchunksize function lets users set the default number of jobs that are doled out to each worker process. The doredis package doles out jobs one at a time by default. Setting the default chunk size larger for shorter-running jobs can substantially improve performance. Setting this value too high can negatively impact load-balancing across workers, however. This value is overriden by setting the chunksize option in the foreach loop (see the examples). Nothing is returned. setchunksize(10) ## Override the default value in a loop as shown in the following example: foreach(j=1:1000,.options.redis=list(chunksize=100)) startlocalworkers startlocalworkers Start background R worker processes on the local system. startlocalworkers(n, queue, host = "localhost", port = 6379, iter = Inf, timeout =

8 startlocalworkers n queue host port iter timeout log Rbin The number of workers to start. A (character) work queue name, or a list or character vector of queue names. The Redis server host name or (character) I. P. address. The Redis server port number. The maximum number of jobs to execute before exiting the worker loop (defaults to infinity). The worker loop terminates if the work queue is deleted after the specified timeout interval. Log messages to the specified destination (defaults to stderr()). The full path to the command-line R program. Use startlocalworkers to start one or more doredis R worker processes in the background. The worker processes are started on the local system using the redisworker function. Running workers self-terminate when their work queues are deleted with the removequeue function. Nothing is returned. Set the log parameter to stdout() to see log messages printed on standard output of the invoking R session. registerdoredis redisworker registerdoredis('jobs') startlocalworkers(n=2, queue='jobs') print(getdoparworkers()) foreach(j=1:10,.combine=sum,.multicombine=true) %dopar% 4*sum((runif(1000000)^2 + runif(1000000)^2)<1)/10000000 removequeue('jobs')

Index doredis (doredis-package), 2 doredis-package, 2 foreach, 2 redisworker, 3, 4, 5, 8 registerdoredis, 3, 4, 6, 8 removequeue, 5, 5 setchunksize, 6 startlocalworkers, 7 9