首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Slurm作业数组错误: slurmstepd: error: execve():Rscript:没有这样的文件或目录

Slurm作业数组错误: slurmstepd: error: execve():Rscript:没有这样的文件或目录
EN

Stack Overflow用户
提问于 2021-04-28 16:57:50
回答 1查看 496关注 0票数 0

我正在尝试让一个非常基本的作业数组脚本在HPC上使用Slurm作业调度程序工作。我得到了一个错误:

代码语言:javascript
运行
复制
slurmstepd: error: execve(): Rscript: No such file or directory

这类似于this,但我没有使用任何export命令,所以这不是这里的原因。一些消息人士说,这可能与在Windows中创建这些脚本有关,因此行尾将不适用于Unix。这会是问题所在吗?如果是这样的话,我该如何检查呢?

我的shell脚本:

代码语言:javascript
运行
复制
#!/bin/bash

# Example of running R script with a job array

#SBATCH --nodes=1
#SBATCH --array=1-10                    # how many tasks in the array
#SBATCH --ntasks-per-node=10
#SBATCH -o hello-%j-%a.txt
#SBATCH --mail-user=user@email.address

# Load software
module load R/4.0.0-foss-2020a

# Run R script with a command line argument
srun Rscript hello.R $SLURM_ARRAY_TASK_ID

脚本-hello.R为:

代码语言:javascript
运行
复制
#!/usr/bin/env 
# Rscript

# accept command line arguments and save them in a list called args
args = commandArgs(trailingOnly=TRUE)

# print task number
print(paste0('Hello! I am a task number: ', args[1]))
EN

回答 1

Stack Overflow用户

发布于 2021-04-29 19:25:55

多亏了一些离线帮助,我得到了我的问题的答案。似乎我不需要在shell脚本中使用srun,而是需要在hello.R的shebang行中包含Rscript

Shell脚本是:

代码语言:javascript
运行
复制
#!/bin/bash

# Example of running R script with a job array

#SBATCH --nodes=1
#SBATCH --array=1-10                    # how many tasks in the array
#SBATCH --ntasks-per-node=10
#SBATCH -o hello-%j-%a.txt
#SBATCH --mail-user=tclewis1@sheffield.ac.uk

# Load software
module load R/4.0.0-foss-2020a

# Run R script with a command line argument
Rscript hello.R $SLURM_ARRAY_TASK_ID

而hello.R现在是:

代码语言:javascript
运行
复制
#!/usr/bin/env/Rscript

# accept command line arguments and save them in a list called args
args = commandArgs(trailingOnly=TRUE)

# print task number
print(paste0('Hello! I am a task number: ', args[1]))
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67296996

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档