【问题标题】:Stop slurm sbatch from copying script to compute node停止 slurm sbatch 将脚本复制到计算节点
【发布时间】:2014-08-26 12:46:57
【问题描述】:

有没有办法阻止 sbatch 将脚本复制到计算节点。例如当我运行时:

sbatch --mem=300 /shared_between_all_nodes/test.sh

test.sh 被复制到正在执行的计算节点上的 /var/lib/slurm-llnl/slurmd/etc/。问题在于 /shared_between_all_nodes/ 中还有 test.sh 需要使用的其他脚本,我想避免对路径进行硬编码。

在 sge 中,我可以使用 qsub -b y 阻止它将脚本复制到计算节点。 slurm 中是否有类似的选项或配置?

【问题讨论】:

    标签: slurm


    【解决方案1】:

    使用 sbatch --wrap 是一个很好的解决方案

    sbatch --wrap /shared_between_all_nodes/test.sh
    

    如果脚本有参数,则需要引号

    sbatch --wrap "/shared_between_all_nodes/test.sh param1 param2"
    

    来自批量文档http://slurm.schedmd.com/sbatch.html

    --换行= Sbatch 会将指定的命令字符串包装在一个简单的“sh”shell 脚本中,并将该脚本提交给 slurm 控制器。使用 --wrap 时,命令行中可能不指定脚本名称和参数;而是使用 sbatch 生成的包装脚本。

    【讨论】:

      【解决方案2】:

      脚本可能会复制到那里,但工作目录将是启动sbatch 命令的目录。因此,如果该命令是从/shared_between_all_nodes/ 启动的,它应该可以工作。

      要能够在任何地方启动sbatch 表单,请使用此选项

         -D, --workdir=<directory>
                Set the working directory of the batch script to directory before 
                it is executed.
      

      喜欢

      sbatch --mem=300 -D /shared_between_all_nodes /shared_between_all_nodes/test.sh
      

      【讨论】:

      • 我需要能够获取到提交脚本所在的目录,而不是工作目录
      猜你喜欢
      • 2020-04-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-21
      • 1970-01-01
      • 1970-01-01
      • 2022-01-04
      • 1970-01-01
      相关资源
      最近更新 更多