Hopefully this is not a dublicate and also not just a problem of our cluster's configuration...
I am submitting a job array to a cluster using qsub
with the following command:
qsub -q QUEUE -N JOBNAME -t 1:10 -e ${ERRFILE}_$SGE_TASK_ID /path/to/script.sh
where
ERRFILE=/home/USER/somedir/errors.
The idea is to specify an error file (also analogously the output file) that also contains the task ID from within the job array.
So far I have learned that the line
#$ -e ${ERRFILE}_$SGE_TASK_ID
inside the script.sh, does not work, because it is a comment and not evaluated by bash. My first line does not work however because $SGE_TASK_ID
is only set AFTER the job is submitted.
I read here that escaping the evaluation of $SGE_TASK_ID
(in that link it's PBS' $PBS_JOBID
, but a similar problem) should work, but when I tried
qsub -q QUEUE -N JOBNAME -t 1:10 -e ${ERRFILE}_\$SGE_TASK_ID /path/to/script.sh
it did not work as expected.
Am I missing something obvious? Is it possible to use $SGE_TASK_ID
in the name of an error file (the automatic naming of error files does that, but I want to specify the directory and if possible the name, too)?
Some additional remarks:
- I am using the
-cwd
option forqsub
inside script.sh, but that is NOT where I want my error files to be stored. - I have next to no control over how the cluster works and no root access (wouldn't know what I could need it for in this context but anyway...).
- Apparently our cluster does not use PBS.
- Yes my scripts are all executable and where applicable started with
#!/bin/bash
(I also specified the use of bash with the-S /bin/bash
option for qsub). - There seems to be a solution here, but I am not quite sure how that works and it also appears to be using PBS. If that answer DOES apply to my question and I misunderstood it, please let me know.
I would appreciate any hint into the right direction. Thank You!
#PBS -e="experiment_output_job.%j.%N.out" #PBS -o="experiment_output_job.%j.%N.out"
– CombinedHow to include the job id and other info in the output file for qsub?
– Combined