Is there a way to add variables to a job script in OOD?

Wondering if we should send this question off to your contacts. I think if we could get examples on how to do the following we could really customize this to match a lot of situations.

Say we have a submit script that works like this which calls 4 nodes with 12 cores each. The executable is job.sh with an input file of test.inp.

#!/bin/bash

#PBS -V

#PBS -l select=4:ncpus=12

#PBS -N jobA

#PBS -j oe

mpirun job.sh -input test.inp

Is there a way we could add some variables to the above script? For example could we set the select and input file to a variable as listed below as (VAR1) & (VAR2):

#!/bin/bash
#PBS -V
#PBS -l select=$(VAR1):ncpus=12
#PBS -N jobA
#PBS -j oe

mpirun job.sh -input $(VAR2)

Then possibly in the “Job Options” section of Open OnDemand add a drop down that would populate these variables based on a drop down menu for ‘$(VAR1)’ of (1, 2, 3, 4) and selected/browsable input file for $(VAR2)?

Maybe there is a better way to add select-able options to a job script, if so we’d like suggestions?

Let me know if this should be tagged as a feature request.

Thanks
Dom

@domd1 we are considering methods for OnDemand 2.0 to improve the flexibility of the Job Composer; we do not have anything fully supported at this time.

I have been working on an example of how to do this using custom initializers, but have not finished that yet. My two thoughts for how to hack it in are to use the adapter native property of the OodCore::Job::Script to pass PBS directives, and environment variables to act as the other variables.

I think that the example should be useful so I intend to finish it.