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

R语言:makeCluster()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-16 20:31:47 | 显示全部楼层 |阅读模式
makeCluster(parallel)
makeCluster()所属R语言包:parallel

                                         Create a Parallel Socket Cluster
                                         创建一个并行的Socket集群

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

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

Creates a set of copies of R running in parallel and communicating over sockets.
创建一个集研发副本并行运行,并通过套接字通信。


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


makeCluster(spec, type, ...)
makePSOCKcluster(names, ...)
makeForkCluster(nnodes = getOption("mc.cores", 2L), ...)

stopCluster(cl)



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

参数:spec
A specification appropriate to the type of cluster.
一个适当的集群类型的规范。


参数:names
Either a character vector of host names on which to run the worker copies of R, or a positive integer (in which case that number of copies is run on localhost).
无论是特征向量的主机名在其上运行的R工人副本,或正整数(在这种情况下,份数localhost运行)。


参数:nnodes
The number of nodes to be forked.
分支节点数量。


参数:type
One of the supported types: see "Details".
支持的类型之一:见“详细资料”。


参数:...
Options to be passed to the function spawning the workers. See "Details".
选项将被传递给功能产卵工人。见“详细资料”。


参数:cl
an object of class "cluster".
对象类"cluster"。


Details

详情----------Details----------

makeCluster creates a cluster of one of the supported types. The default type, "PSOCK", calls makePSOCKcluster.  Type "FORK"calls makeForkCluster.  Other types are passed to package snow.
makeCluster创建一个集群支持的类型之一。默认类型,"PSOCK",makePSOCKcluster。类型"FORK"称makeForkCluster。其他类型通过打包snow。

makePSOCKcluster is very similar to makeSOCKcluster in package snow.  It runs Rscript on the specified host(s) to set up a worker process which listens on a socket for expressions to evaluate, and returns the results (as serialized objects).
makePSOCKclustermakeSOCKcluster包snow很相似。它运行Rscript指定主机上的(S)成立一个工作进程,监听插座一个表达式来评估,并返回结果(序列化对象)。

makeForkCluster is merely a stub on Windows.  On Unix-alike platforms it creates the worker process by forking.
makeForkCluster只不过是一个在Windows上的存根。在Unix相似的平台上,它通过fork创建工作进程。

The workers are most often running on the same host as the master, when no options need be set.
工人是最经常作为主相同的主机上运行时,没有选项需要设置。

Several options are supported (mainly for makePSOCKcluster):
几个选项支持(主要用于makePSOCKcluster):




master The host name of the master, as known to the workers.  This may not be the same as it is known to the master, and on private subnets it may be necessary to specify this as a numeric IP address.  For example, Mac OS X is likely to detect a
master称为工人师傅,主机名。这未必是相同的,因为它是已知的主,和私人子网,它可能需要指定为一个数字IP地址。例如,Mac OS X是可能检测




port The port number for the socket connection, default taken from the environment variable R_PARALLEL_PORT,
port套接字连接,从环境变量R_PARALLEL_PORT采取默认的端口号,




timeout The timeout in seconds for that port.  Default 30 days (and the POSIX standard only requires values up to 31 days
timeout在该端口秒超时。默认为30天(和POSIX标准只要求值高达31天




outfile Where to direct the stdout and stderr connection output from the workers. "" indicates no redirection (which may only be useful for workers on the local machines).  Defaults to "/dev/null" ("nul:" on Windows).  The other possibility is a file path on the worker's host. Files will be opened in append mode, as all workers log to the
outfile直接stdout和stderr工人从连接输出。 ""表示没有重定向(这可能只是本地机器上有用的工人)。默认为/dev/null(nul:在Windows上)。另一种可能性是一个工人的主机上的文件路径。将在追加模式打开文件,所有工人登录到




homogeneous Logical.  Are all the hosts running identical setups, so Rscript can be launched using its full path on the master?  Otherwise it has to be in the default
homogeneous逻辑。是所有的主机上运行相同的设置,所以Rscript可以启动主服务器上使用它的完整路径?否则它必须是在默认




rscript The path to Rscript on the workers.
rscriptRscript对工人的路径。




renice A numerical "niceness" to set for the worker processes, e.g. 15 for a low priority.
renice数值“我爱你”为工作进程,例如15为低优先级。




rshcmd The command to be run on the master to launch a
rshcmd在主服务器上运行的命令启动




user The user name to be used when communicating with
user用户名时所使用的通信




manual Logical.  If true the workers will need to be
manual逻辑。如果真正的工人将需要




methods Logical.  If true (default) the workers will load the methods package: not loading it saves ca 30% of the
methods逻辑。如果为true(默认值)的工人将载入methods包:不加载它节省了约30%

Function makeForkCluster creates a socket cluster by forking (and hence is not available on Windows).  It supports options port, timeout and outfile.
功能makeForkCluster通过fork创建一个套接字集群(因此不是在Windows上使用)。它支持选项port,timeout和outfile。

It is good practice to shut down the workers by calling stopCluster: however the workers will terminate themselves once the socket on which they are listening for commands becomes unavailable, which it should if the master R session is completed (or its process dies).
这是很好的做法,关闭调用工人stopCluster:然而,工人将终止自己变得不可用插座上,他们是听命令后,它应该如果主R会话完成(或它的进程死亡)。


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

An object of class c("SOCKcluster", "cluster").
对象类c("SOCKcluster", "cluster")。


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



Luke Tierney and R Core.

Derived from the <span class="pkg">snow</span> package.


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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-24 08:23 , Processed in 0.021432 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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