如何指定的qsub错误日志文件和输出文件 [英] how to specify error log file and output file in qsub

查看:4194
本文介绍了如何指定的qsub错误日志文件和输出文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个的qsub脚本

I have a qsub script as

#####----submit_job.sh---#####
    #!/bin/sh
    #$ -N job1
    #$ -t 1-100
    #$ -cwd
    SEEDFILE=/home/user1/data1
    SEED=$(sed -n -e "$SGE_TASK_ID p" $SEEDFILE)
    /home/user1/run.sh $SEED 

问题is--它把所有的错误和输出文件(job1.eJOBID&安培; job1.oJOBID)从那里我运行的qsub submit_job.sh到同一目录下,而我想保存这些文件(输出和错误日志文件在同一个不同的地方(指定为$ SEED_output)。
我试图改变行

The problem is-- it puts all error and output files (job1.eJOBID & job1.oJOBID) to the same directory from where I am running qsub submit_job.sh while I want to save these file (output and error log file in same different place (specified as $SEED_output). I tried to change the line as

/home/user1/run.sh $SEED -o $SEED_output

但它没有工作。任何建议?我怎么可以指定默认的输出和错误日志文件的路径和名称??

But it didn't work. Any suggestion ?? How can I specify path and name of default output and error log file ??

推荐答案

通常错误和输出文件给定为使用qsub脚本或命令行选项来,像这样的qsub脚本PBS指令:

Typically error and output files are given as pbs directives in the qsub script or as command line options to the qsub script like so:

#! /bin/bash
#PBS -q queue_name
#PBS -A account_name
#PBS -l nodes=12:ppn=12
#PBS -l walltime=18:00:00
#PBS -e /mypath/error.txt
#PBS -o /mypath/output.txt

或作为命令行选项的qsub,像这样:

or as a command line option to qsub like so:

qsub -o /mypath/output.txt -e /mypath/error.txt submit_job.sh

使用我不认为你可以使用一个变量作为外壳不会看那些注释行的第一个选项。另外,我认为PBS与前壳将注释行交易。如果您知道路径,当你调用的qsub,你可以尝试第二个选项。
您也可以试试简单地重定向脚本本身的输出和错误:

With the first option I don't think you can use a variable as the shell won't look at lines that are commented. Plus I think PBS deals with the commented lines before the shell would. If you know the path when you're invoking qsub, you could try the second option. Alternatively you could try simply redirecting the output and error in the script itself:

/home/user1/run.sh $SEED > ${SEED}/output.txt 2> ${SEED}/error.txt

第三个选项可能是最容易的。输出和错误文件可能仍然在运行目录中创建,但他们会很可能是空的。

The third option is probably the easiest. Output and error files might still be created in the run directory, though they'd likely be empty.

这篇关于如何指定的qsub错误日志文件和输出文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆