23.4 Requesting Namespace Variables

The following instructions demonstrate how to request a specific namespace in a trigger script argument.

To request a namespace variable in a trigger

  1. Configure the trigger. If it is attached to a generic system job, verify that it meets all the generic system job trigger requirements.
  2. Create an argument list in the Action attribute (after the script path and before the closing quotes) and request the desired variable with an asterisk (*) in place of the namespace.
    ...Action="$HOME/myTrig.py $*.IPAddr"...

    Each applicable namespace variable is added to the argument list in the format <varName>=<val>. For instance, the example above would cause the script to run the following way:

    > myTrig.py vc1.IPAddr=/tmp/dir1 vc2.IPAddr=/tmp/dir2 vc4.IPAddr=/tmp/dir3

    Any other arguments provided here without namespaces will not change.

  3. Filter which namespaces are passed down to a job trigger by setting trigns when you submit the job. Its value is a comma-delimited list of the desired namespaces.
    msub -l ... -W x="trigns=vc2,vc4"

    If the new job is applied to the example in step 2, the script's arguments include vc2.IPAddr and vc4.Addr and exclude vc1.IPAddr. The script runs as follows:

    > myTrig.py vc2.IPAddr=/tmp/dir1 vc4.IPAddr=/tmp/dir2

Copyright © 2012 Adaptive Computing Enterprises, Inc.®