2

I am running my program on a high-performance computer, usually with different parameters as input. Those parameters are given to the program via a parameter file, i.e. the qsub-file looks like

#!/bin/bash #PBS -N <job-name> #PBS -A <name> #PBS -l select=1:ncpus=20:mpiprocs=20 #PBS -l walltime=80:00:00 #PBS -M <mail-address> #PBS -m bea module load foss cd $PBS_O_WORKDIR mpirun main parameters.prm # Append the job statistics to the std out file qstat -f $PBS_JOBID 

Now usually I run the same program multiple times more or less at the same time, with different parameter.prm-files. Nevertheless they all show up in the job-list with the same name, making the correlation between the job in the list and the used parameters difficult (not impossible).
Is there a way to change the name of the program in the job list dynamically, depending on the used input parameters (ideally from within main)? Or is there another way to change the job name without having to edit the job-file every time I run

qsub job_script.pbs 

?
Would be a solution to create a shell script which reads data from the parameter file, and then in turn creates the job-script and runs it? Or are there easier ways?

1 Answer 1

1

Simply use the -N option on the command line:

qsub -N job1 job_script.pbs

You can then use a for loop to iterate over the *.prm files:

for prm in *.prm do prmbase=$(basename $prm .prm) qsub -N $prmbase main $prm done 

This will name each job by the parameter file name, sans the .prm suffix.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks! Unfortunately I can not test it anymore, due to the switch from pbs to slurm on our HPC cluster...
Is there a way to use the -v to name the job?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.