向condor提交ar作业时读取R文件时出错

发布于 2024-09-15 07:03:21 字数 888 浏览 1 评论 0原文

我有一个提交给秃鹰的 R 作业,提交给秃鹰的 R 文件(one.R)正在读取另一个 R 文件(two.R),当我将作业提交给秃鹰时,它失败了并且原因是提交的 R(one.R) 文件没有读取调用的 R 文件(two.R) 文本文件中的错误是:

Error in file(file, "rt") : cannot open the connection
Calls: read.table -> file
In addition: Warning message:
In file(file, "rt") :
  cannot open file 'C:/Users/pcname/Desktop/test_case/two.R': Permission denied
Execution halted 

我的提交文件是

#test_input.condor
#

executable = C:\R\R-2.10.1\bin\Rscript.exe
arguments = one.R
universe = vanilla
getenv = true
#requirements = ARCH == "INTEL" && OPSYS == "WINNT60" 
input = one.R

should_transfer_files = yes
transfer_executable = false
when_to_transfer_output = ON_EXIT
transfer_input_files = C:/Users/OmegaAdmin/Desktop/test_case/two.R

log = test_input.log
output = test_input.out
error = test_input.err

queue 

欣赏对此的任何想法。

谢谢,

I have a R Job that is submitted to the condor, The R file(one.R) which is submitted to the condor is reading another R file(two.R), when I submit the job to the condor its is failed and the reason for that is the submitted R(one.R) file is not reading the called R file(two.R)
Error in text file is :

Error in file(file, "rt") : cannot open the connection
Calls: read.table -> file
In addition: Warning message:
In file(file, "rt") :
  cannot open file 'C:/Users/pcname/Desktop/test_case/two.R': Permission denied
Execution halted 

and my submit file is

#test_input.condor
#

executable = C:\R\R-2.10.1\bin\Rscript.exe
arguments = one.R
universe = vanilla
getenv = true
#requirements = ARCH == "INTEL" && OPSYS == "WINNT60" 
input = one.R

should_transfer_files = yes
transfer_executable = false
when_to_transfer_output = ON_EXIT
transfer_input_files = C:/Users/OmegaAdmin/Desktop/test_case/two.R

log = test_input.log
output = test_input.out
error = test_input.err

queue 

Appreciate any ideas on this.

Thanks,

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

标点 2024-09-22 07:03:22

这不是R相关的问题,而是可访问性的问题。错误消息对我来说似乎相当清楚:服务器没有该文件的读取权限。确保您共享要读入的文件或文件夹。我不知道您所在位置的网络和集群的设置是什么,但您最好联系管理员以询问如何将文件放在正确的位置地方。

另请确保,如果将文件传输到服务器/集群,请调整 R 脚本,使其指向正确的目录。这可能不是您自己的硬盘...

This is not an R-related problem, but a problem of accessibility. The error message seems rather clear to me: the server has no reading rights for that file. Make sure you share the file or folder you want to read in. I don't know what the setup is of the network and clusters wherever you're located, but you better contact the admins to ask how you get your files to the right places.

Also make sure that if you transfer files to the servers/cluster, you adapt your R script so it points to the right directories. Which is probably not your own harddrive...

毁我热情 2024-09-22 07:03:22

当你说

transfer_input_files = C:/Users/OmegaAdmin/Desktop/test_case/two.R

That 告诉 Condor 在作业启动时将 two.R 复制到当前工作目录中。当前工作目录是专门创建的工作空间,而不是(通常)主目录。因此,我希望完整路径看起来像

C:/condor/execute/dir_28412/two.R

“然而,R 实际上正在寻找”

C:/Users/pcname/Desktop/test_case/two.R

为什么 R 在那里寻找? one.R 是否可能会说“在 $HOME/Desktop/test_case 中查找two.R”?它是否可能说“在 Desktop/testcase/two.R 中查找”并且 R 具有想要相对于用户主目录进行查找的配置?

解决方案几乎肯定是修改 one.R 或您的 R 配置以在当前工作目录中查找two.R。如果由于某种原因 R 更改了其当前工作目录,则环境变量 _CONDOR_SCRATCH_DIR 应包含它。


在相关注释中,您说:

arguments = one.R
input = one.R

第一个是传递给 Rscript.exe 的参数,我猜它告诉 R 加载并运行一个名为 one.R 的文件。只是脚本不存在!如果您希望它起作用,您需要将其添加到transfer_input_files。但它显然是有效的;为什么?因为 "input=one.R" 的意思是“获取 one.R 的内容并将其作为标准输入通过管道输入到 Rscript.exe;就像您输入这些内容一样。”我猜您可以删除参数,或者删除输入并将 one.R 添加到您的 transfer_input_files 中,从而消除歧义。

When you say

transfer_input_files = C:/Users/OmegaAdmin/Desktop/test_case/two.R

That tells Condor to copy two.R into the current working directory when the job starts. The current working directory is a specially created workspace, not (usually) a home directory. Thus I would expect the full path to look something like

C:/condor/execute/dir_28412/two.R

However, R is actually looking in

C:/Users/pcname/Desktop/test_case/two.R

Why is R looking there? Does one.R potentially say "Find two.R in $HOME/Desktop/test_case"? Does it perhaps say, "Look in Desktop/testcase/two.R" and R has configuration that wants to look relative to the user's home directory?

The solution is almost certainly to modify one.R or your R configuration to look for two.R in the current working directory. If for some reason R changes its current working directory, the environment variable _CONDOR_SCRATCH_DIR should contain it.


On a related note, you said:

arguments = one.R
input = one.R

The first is an argument passed to Rscript.exe, which I'm guessing tells R to load and run a file called one.R. Except that script isn't present! If you want that to work, you'll need to add it to transfer_input_files. But it obviously appears to work; why? Because "input=one.R" means "take the contents of one.R and pipe it in as standard input to Rscript.exe; the same as if you'd typed those contents in." I'm guessing you can remove the arguments, or remove the input and add one.R to your transfer_input_files, removing the ambiguity.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文