r - 在 ROUT 文件中屏蔽来自 foreach 的“启动工作人员”消息
问题描述
我的代码目前看起来像这样
results= foreach(i=seq(1,n),.combine='c') %dopar% {
require('Matrix',quietly=TRUE)
start_time=Sys.time()
Q[i]=some_function(1,2,3)
end_time=Sys.time()
print(end_time-start_time)
}
我正在并行计算一些东西,并希望能够在每个并行进程中打印到 ROUT 文件。问题是我的 ROUT 文件充满了以下内容
starting worker pid=82688 on localhost:11668 at 10:57:10.347
starting worker pid=82672 on localhost:11668 at 10:57:10.347
starting worker pid=82677 on localhost:11668 at 10:57:10.347
starting worker pid=82680 on localhost:11668 at 10:57:10.347
starting worker pid=82669 on localhost:11668 at 10:57:10.346
由于我的代码涉及我多次调用 foreach 这使得解析 ROUT 文件变得非常困难
有没有办法从foreach
包中的 R outfile 中静音“starting worker pid = ...”行?
解决方案
推荐阅读
- c# - 将 WindowsIndentity 发送到 WebService
- pandas - 在熊猫中循环以从一行创建一个数据框
- python - 如何查找给定的python导入语句是内部的还是外部的?
- docker - 从 alpine 基础镜像创建 docker 镜像时如何添加用户
- elasticsearch - elasticsearch中“LIMIT”的替代方案
- javascript - 如何从 HTML 表格生成 PDF?
- reactjs - Next.js,严格的 Typescript 和缺少/很难找到 RenderPageResult 类型
- angular - 默认情况下如何打开 ng bootstrap 下拉菜单
- c++ - Vector in an abstract class
- curl - 将 bitbucket 工件部署到下载