Search code examples
cshpbsqsubtorque

How to use the qsub -v command in PBS torque?


I would like to pass variables to a csh script by using "qsub -v" command. I understand we can list the parameters-value pairs as below,

qsub -v par1=value1 par2=value2 myScript.csh

Does anyone know if the values of these parameters can be a string, a list of numerical numbers separated by comma sign or a filename ? for example, is the command below possible ?

qsub -v par1='Cassie_score' par2=cassieFile.txt par3='100,200,300,' myScript.csh

Thank you very much,


Solution

  • They just need to be comma-separated:

    qsub -v var1="val1",var2=1,var3=val3 script.csh
    

    For your example that'd be:

    qsub -v par1='Cassie_score',par2=cassieFile.txt,par3='100,200,300,' myScript.csh
    

    Just note that this wouldn't move cassieFile.txt to the node that will run the job, so cassieFile.txt would need to be a path to a location on a shared filesystem.