找回密码
 注册
查看: 321|回复: 0

R语言 snowFT包 snowFT-cluster()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-30 11:05:54 | 显示全部楼层 |阅读模式
snowFT-cluster(snowFT)
snowFT-cluster()所属R语言包:snowFT

                                        Cluster-Level Functions with Fault Tolerance Features
                                         聚类级别的功能与容错功能

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Functions that extend the collection of cluster-level functions of the snow package while providing fault tolerance, reproducibility and additional management features. The heart of the package is the function performParallel.
功能扩展集合snow包的聚类级别的功能,同时提供容错性,可重复性和额外的管理功能。心的包的功能是performParallel。


用法----------Usage----------


performParallel(count, x, fun, initfun = NULL, exitfun = NULL,
                printfun = NULL, printargs = NULL,
                printrepl = max(length(x)/10,1),
                cltype = getClusterOption("type"),
                cluster.args = NULL,
                gentype = "RNGstream", seed = sample(1:9999999,6),
                prngkind = "default", para = 0,
                mngtfiles = c(".clustersize",".proc",".proc_fail"),
                ft_verbose = FALSE, ...)

clusterApplyFT(cl, x, fun, initfun = NULL, exitfun = NULL,
               printfun = NULL, printargs = NULL,
               printrepl = max(length(x)/10,1), gentype = "None",
               seed = rep(123456,6), prngkind = "default", para = 0,
               mngtfiles = c(".clustersize",".proc",".proc_fail"),
               ft_verbose = FALSE, ...)
               
clusterCallpart(cl, nodes, fun, ...)

clusterEvalQpart(cl, nodes, expr)

printClusterInfo(cl)



参数----------Arguments----------

参数:count
Number of cluster nodes. If count=0, the process runs sequentially.
聚类节点的数目。如果count=0,按顺序运行。


参数:cl
Cluster object.
聚类对象。


参数:x
Vector of values to be passed to function fun.  Its length determines how many times fun is to be called. x[i] is passed to fun (as its first argument) in the i-th call.
向量的值传递给函数fun。它的长度确定多少次fun是被称为的。 x[i]传递给fun(作为第一个参数)中的第i个呼叫。


参数:fun
Function or character string naming a function.
功能或字符串命名的功能。


参数:initfun
Function or character string naming a function with no arguments that is to be called on each node prior to the computation.  It can be used for example for loading required libraries.
功能或字符串命名不带任何参数,是被称为计算之前,在每个节点上的一个函数。它可用于例如,用于加载所需的库。


参数:exitfun
Function or character string naming a function with no arguments that is to be called on each node after the computation is completed.
命名不带参数的一个函数,计算完成后,在每个节点上的是被称为功能或字符串。


参数:printfun, printargs, printrepl
printfun is a function or character string naming a function that is to be called on the master node after each printrepl completed replicates, and thus it can be used for accessing intermediate results. Arguments passed to printfun are: a list (of length |x|) of results (including the non-finished ones), the number of finished results, and printargs.
printfun是一个函数,它是被称为后的主节点上的一个函数或字符串命名每个printrepl完成复制,因此,它可用于访问中间结果。参数传递给printfun:列表(长度|x|)的结果(包括非成品)的数量,完成的结果,和printargs的。


参数:cltype
Character string that specifies cluster type (see makeClusterFT). Possible values are 'PVM', 'MPI' and 'SOCK'.
字符串,指定聚类的类型(见makeClusterFT“)。可能的值是PVM,MPI“和”SOCK“。


参数:cluster.args
List of arguments passed to the function makeClusterFT. For the "SOCK" layer, the most useful argument in this list is names which can contain a vector of host names, or a list containing specification for each host (see Example in makeCluster). Due to the dynamic resizing feature, the length of this vector (or list) does not need to match the size of the cluster - it is used as a pool from which hosts are taken as they are needed. Another useful argument is outfile, specifying name of a file to which slave node output is to be directed.
参数列表传递的功能makeClusterFT的。对于“SOCK层,在此列表中是最有用的参数names它可以包含一个矢量的主机名,或者为每个主机的列表,其中包含规范(见例makeCluster)。由于动态调整大小功能,此向量的长度(或列表)不需要的大小相匹配的聚类 - 它是用来作为从该主机的池,因为它们是需要采取。另外一个有用的参数是outfile,指定名称的文件,从节点的输出被定向。


参数:gentype
Character string that specifies the type of the random number generator (RNG).  Possible values: "RNGstream" (L'Ecuyer's RNG), "SPRNG", or "None", see clusterSetupRNG.FT. If gentype="None", no RNG action is taken.
字符的字符串指定的随机数发生器(RNG)的类型。可能的值:“RNGstream”(LEcuyers RNG),“SPRNG”,或“无”,看到clusterSetupRNG.FT。如果gentype="None",没有RNG采取行动。


参数:seed, prngkind, para
Seed, kind and parameters for the RNG (see clusterSetupRNG.FT).
种子,种类和参数的RNG(见clusterSetupRNG.FT“)。


参数:mngtfiles
A character vector of length 3 containing names of management files: mngtfiles[1] for managing the cluster size, mngtfiles[2] for monitoring replicates as they are processed, mngtfiles[3] for monitoring failed replicates. If any of these files equals an empty string, the corresponding management actions (i.e. dynamic cluster resizing, outputting processed replicates, and cluster repair in case of failures) are not performed. If the files already exist, their content is overwritten. Note that the cluster repair action is only available for PVM. Furthermore, the dynamic cluster resizing is not available for MPI.
字符向量的长度包含管理文件的名称:mngtfiles[1]管理,簇的大小,mngtfiles[2]进行监测的复制,因为他们处理,mngtfiles[3]监视失败的复制。如果这些文件的任何等同于空字符串,则相应的管理操作(即动态聚类调整大小,复制,输出处理和聚类修复失败的情况下)不执行。如果文件已经存在,其内容将被覆盖。请注意,在聚类的修复操作仅适用于PVM。此外,动态聚类的大小调整为MPI。


参数:ft_verbose
If TRUE, debugging messages are sent to standard output.
如果是TRUE,调试信息发送到标准输出。


参数:nodes
Indices of cluster nodes.
指数的聚类节点。


参数:expr
Expression to evaluate.
表达式。


参数:...
Additional arguments to pass to function fun.
其他参数传递给函数fun。


Details

详细信息----------Details----------

clusterApplyFT is a fault tolerant version of clusterApplyLB of the snow package with additional features, such as results reproducibility, computation transparency and dynamic cluster resizing. The master process searches for failed nodes in its waiting time. If failures are detected, the cluster is repaired. All failed computations are restarted (in three additional runs) after the replication loop is finished, and hence the user should not notice any interruptions.
clusterApplyFT是一个容错版本的clusterApplyLB的雪包的附加功能,如结果的重现性,计算透明度和动态聚类的大小调整。主进程搜索失败的节点,在其等待时间。如果检测到故障,聚类被修复。重新启动所有失败的计算(三个附加试验)的复制循环结束后,因此用户应该不会注意到任何中断。

The file mngtfiles[1] (which defaults to ".clustersize") is initially written by the master prior to the computation and it contains a single integer value corresponding to the number of cluster nodes. Then the value can be arbitrarily changed by the user (but should remain in the same format). The master reads the file  in its waiting time. If the value in this file is larger than the current cluster size, new nodes are created and the computation is expanded on them. If on the other hand the value is smaller, nodes are successively discarded after they finish their current computation. The arguments initfun, exitfun in clusterApplyFT are only used, if there are changes in the cluster, i.e. if new nodes are added or if nodes are removed from cluster.
开始写之前计算的主mngtfiles[1](即默认为。clustersize)的文件,它包含一个整数值对应的聚类节点的数量。然后,该值可以由用户任意地改变(但应保持在相同的格式)。主站读取的文件在其等待时间。如果在该文件中的值大于当前簇大小,创建新的节点,对他们的计算被扩展。如果在另一方面,该值越小,节点依次丢弃后,他们完成他们的电流计算。的参数initfun, exitfun的clusterApplyFT只使用,如果有变化的聚类,即如果在添加新节点,或者如果节点从聚类中删除。

The RNG uses the scheme 'one stream per replicate', in contrary to 'one stream per node' used by clusterApplyLB. Therefore with each replicate, the RNG is reset to the corresponding stream (identified by the replicate number). Thus, the final results are reproducible.
RNG使用该计划的每一个流复制“,违背了”一个流的每个节点使用clusterApplyLB。因此,与每个重复,该RNG是复位到相应的流(复制数确定)。因此,最终的结果是可重复的。

performParallel is a wrapper function for clusterApplyFT and we recommend using this function rather than using clusterApplyFT directly. It creates a cluster of count nodes, on all nodes it calls initfun and initializes the RNG. Then it calls clusterApplyFT. After the computation is finished, it calls exitfun on all nodes and stops the cluster. If count=0, function fun is invoked sequentially with the same settings (including random numbers) as it would in parallel. This mode can be used for debugging purposes.
performParallel是一个包装函数clusterApplyFT,我们建议使用此功能,而不是使用clusterApplyFT直接。 count节点,创建一个聚类的所有节点上调用initfun和初始化的RNG。然后它调用clusterApplyFT。计算完成后,它会调用exitfun在所有节点上停止聚类。如果count=0,功能fun按顺序调用相同的设置(包括随机数),因为它会在平行。此模式可用于调试目的。

clusterCallpart calls a function fun with identical arguments  ... on nodes specified by indices nodes in the cluster cl and returns a list of the results.
clusterCallpart调用一个函数fun具有相同的参数...节点上指定的指数nodes聚类中的cl,并返回一个结果列表。

clusterEvalQpart evaluates a literal expression on nodes specified by indices nodes.
clusterEvalQpart评估的文字表达节点上指定的指数nodes。

printClusterInfo prints out some basic information about the cluster.
printClusterInfo打印出的聚类的一些基本信息。


值----------Value----------

clusterApplyFT returns a list of two elements. The first one is a list (of length |x|) of results, the second one is the (possibly updated) cluster object.
clusterApplyFT返回一个两个元素的列表。第一个结果是一个(长度|x|),第二个是聚类对象(可能)。

performParallel returns a list of results.
performParallel返回的结果列表。


(作者)----------Author(s)----------


Hana Sevcikova



实例----------Examples----------


## Not run: [#不运行:]
# generates n normally distributed random numbers in r replicates[生成n正态分布的随机数r中复制]
# on p nodes and prints their mean after each r/10 replicate.[P节点和打印他们的意思后,每个R/10复制。]

printfun <- function(res, n, args=NULL) {
  res <- unlist(res)
  res <- res[!is.null(res)]
  print(paste("mean after:", n,"replicates:", mean(res),
           "(from",length(res),"RNs)"))
  }

r<-1000; n<-100; p<-5
res <- performParallel(p, rep(n,r), fun=rnorm,
  gentype="RNGstream", seed=rep(1,6), printfun=printfun)

# Setting p&lt;-0 will run rnorm sequentially and should give [设置P <-0运行准化顺序和应]
# exactly the same results[完全相同的结果]

## End(Not run)[#(不执行)]

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-6-7 08:09 , Processed in 0.030522 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表