【问题标题】:Running a job on multiple nodes of a GridEngine cluster在 GridEngine 集群的多个节点上运行作业
【发布时间】:2010-10-06 13:31:25
【问题描述】:

我可以访问一个 128 核的集群,我想在该集群上运行并行化作业。该集群使用 Sun GridEngine,我的程序是使用 Parallel Python、numpy、scipy 在 Python 2.5.8 上编写的。在单个节点(4 核)上运行作业会比单核产生约 3.5 倍的改进。我现在想把它提升到一个新的水平,并将工作拆分到大约 4 个节点上。我的qsub 脚本如下所示:

#!/bin/bash
# The name of the job, can be whatever makes sense to you
#$ -N jobname

# The job should be placed into the queue 'all.q'.
#$ -q all.q

# Redirect output stream to this file.
#$ -o jobname_output.dat

# Redirect error stream to this file.

#$ -e jobname_error.dat

# The batchsystem should use the current directory as working directory.
# Both files will be placed in the current
# directory. The batchsystem assumes to find the executable in this directory.
#$ -cwd

# request Bourne shell as shell for job.
#$ -S /bin/sh

# print date and time
date

# spython is the server's version of Python 2.5. Using python instead of spython causes the program to run in python 2.3
spython programname.py

# print date and time again
date

有人知道怎么做吗?

【问题讨论】:

  • 为什么有人会否决这个问题?如果人们有负面反馈,他们真的应该发表评论。

标签: python sungridengine qsub


【解决方案1】:

是的,您需要在脚本中包含 Grid Engine 选项 -np 16,如下所示:

# Use 16 processors
#$ -np 16

或在您提交脚本时在命令行上。或者,对于更永久的安排,请使用 .sge_request 文件。

在我曾经使用过的所有 GE 安装中,这将在尽可能少的节点上为您提供 16 个处理器(或现在的处理器内核),因此如果您的节点有 4 个内核,那么您将获得 4 个节点,如果他们有8 2 以此类推。要完成这项工作,假设 8 个节点上的 2 个内核(如果您需要为每个进程提供大量内存,您可能想要这样做)有点复杂,您应该咨询您的支持团队。

【讨论】:

  • 添加 ~$ -np 8 会出现错误提示 Unable to read script file because of error: ERROR! invalid option argument "-np"。我现在有一个仅限 Python 的解决方案,但如果有另一个选项会很好。
  • @Chinmay Kanchi:添加 #$ -np 16,而不是 ~$ -np 16
  • 是的,这就是我所做的。错过了评论中的#。干杯。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-04-24
  • 2016-12-30
  • 1970-01-01
  • 2013-02-02
  • 2013-11-07
  • 1970-01-01
相关资源
最近更新 更多