Last data update: 2014.03.03

R: Divide Tasks for Distribution in a Cluster
splitIndicesR Documentation

Divide Tasks for Distribution in a Cluster

Description

This divides up 1:nx into ncl lists of approximately equal size, as a way to allocate tasks to nodes in a cluster.

It is mainly for internal use, but some package authors have found it useful.

Usage

splitIndices(nx, ncl)

Arguments

nx

Number of tasks.

ncl

Number of cluster nodes.

Value

A list of length ncl, each element being an integer vector.

Examples

splitIndices(20, 3)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(parallel)
> png(filename="/home/ddbj/snapshot/RGM3/R_rel/result/parallel/splitIndices.Rd_%03d_medium.png", width=480, height=480)
> ### Name: splitIndices
> ### Title: Divide Tasks for Distribution in a Cluster
> ### Aliases: splitIndices
> ### Keywords: utility
> 
> ### ** Examples
> 
> splitIndices(20, 3)
[[1]]
[1] 1 2 3 4 5 6 7

[[2]]
[1]  8  9 10 11 12 13

[[3]]
[1] 14 15 16 17 18 19 20

> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>