cwvh/pbsmake — Issue #14: Getting rid of #PBS -v in targets
Author: imoverclocked
Created: 2012-01-05 20:17:55+00:00
State: open

In order to specify defaults from the pbsmake environment, #PBS lines need to be pre-filled into the script that can be overridden by the user. In many cases the semantics of this produce unexpected results. We need to add a syntax to allow features to be specified in the environment that are features of pbsmake and do not get carried through to the final script.

````
generic-target-%:
#PBS -v var1,var2,var3
echo $var1 $var2 $var3
echo $pm_target_match
````

The above example can only have var1,var2,var3 OR pm_target_match but not both since passing "-v pm_target_match" directly to qsub would override the -v argument in the #PBS comment.

The semantics of an @export keyword should work to incrementally append variables that are explicitly wanted in the target environment:

````
global1=foo
@export global1

global2=bar

minimal:
echo $global1 $global2

nominal:
@export global2
echo $global1 $global2

maximal:
@export-all
echo $global1 $global2
```

minimal: foo
nominal: foo bar
maximal: foo bar

This enables us to add dynamic variables (eg: pm_target_match) without users needing to update their code to see it.